com.adobe.livecycle.formsservice.client
Class FormsResult

java.lang.Object
  extended by com.adobe.livecycle.formsservice.client.FormsResult
All Implemented Interfaces:
java.io.Serializable

public class FormsResult
extends java.lang.Object
implements java.io.Serializable

Provides access to the Forms service processing results, such as the data content, the transformation result, and the content type. To display a form in a client web browser, write the data stream obtained using this object to a client web browser. To obtain a data stream, invoke the getOutputContent method. A FormsResult object is returned by the following FormsServiceClient methods:

To see how to write data located within an object of this type to a client web browser, see the Rendering an interactive PDF form using the Java API quick start in Programming with LiveCycle ES4.

See Also:
Serialized Form

Constructor Summary
FormsResult()
          This constructor is for internal use only.
FormsResult(short action, java.lang.String options, java.lang.String tratransformationID, java.lang.String formQuery, long pageNumber, long pageCount, java.util.List attachments, Document validationErrorsList, java.lang.String clickedBtn, Document xMLData)
          This constructor is for internal use only.
 
Method Summary
 short getAction()
          Indicates the processing state associated with the Forms service result.
 java.util.List getAttachments()
          Retrieves the file attachments that are rendered with the form.
 java.lang.String getCharSet()
          Returns the character set encoding value; for example, ISO-8859-1, UTF-8, SHIFT_JIS.
 java.lang.String getClickedBtn()
          Returns an XML Architecture Scripting Object Model (SOM) expression identifying the last button that was clicked on a form.
 java.lang.String getContentType()
          Returns the content type that describes the data content generated by the Forms service.
 java.lang.String getFormQuery()
          Retrieves the name of the form design on which the rendered form is based.
 java.lang.String getLocale()
          Gets a locale value that is used by the Forms service to send validation messsages to client devices, such as web browsers, as part of HTML transformations.
 java.lang.String getOption(java.lang.String opt)
          For internal use only.
 java.lang.String getOptions()
          Retrieves run-time options that are applicable to the Forms service.
 Document getOutputContent()
          Returns data content generated by the Forms service.
 java.lang.String getOutputString()
          If the content type is text-based, this method returns the data content that is generated by the Forms service as a string; otherwise, it returns an empty string (binary content is accessible using the getOutputContent method).
 int getOutputType()
          Returns the output type value that specifies how a form that is rendered as HTML is displayed.
 Document getOutputXML()
          If the content type contains XML or HTML data, the transformation result is stored as well-formed XML, which can be retrieved as this string.
 long getPageCount()
          Retrieves number of pages that is located within the rendered form.
 long getPageNumber()
          Retrieves the page number of the rendered form.
 java.lang.String getTransformationID()
          Although a client application indicates an output format preference, this value represents the actual transformation performed.
 Document getValidationErrorsList()
          Gets a list of validation errors as UTF8-encoded XML.
 Document getXMLData()
          Retrieves form XML data.
 void setCharSet(java.lang.String charSet)
          For internal use only.
 void setContentType(java.lang.String contentType)
          For internal use only.
 void setOutputContent(Document contentDoc, java.lang.String sContentType)
          Sets the output content.
 void setOutputXML(Document outputXML)
          For internal use only.
 void setTransformationID(java.lang.String transformationID)
          For internal use only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormsResult

public FormsResult()
This constructor is for internal use only. Use the return value from the specified methods.


FormsResult

public FormsResult(short action,
                   java.lang.String options,
                   java.lang.String tratransformationID,
                   java.lang.String formQuery,
                   long pageNumber,
                   long pageCount,
                   java.util.List attachments,
                   Document validationErrorsList,
                   java.lang.String clickedBtn,
                   Document xMLData)
This constructor is for internal use only. Use the return value from the specified methods.

Method Detail

getOutputContent

public Document getOutputContent()
                          throws java.io.UnsupportedEncodingException
Returns data content generated by the Forms service. Depending on the action value, the content may be sent back to the originating client device (such as a web browser) or may be available for further processing by the client application. To see this method used in a code example, see the Rendering an interactive PDF form using the Java API quick start in Programming with LiveCycle ES4.

Returns:
A Document object representing the data content generated by the Forms service. The content format may contain XML, HTML, or PDF data.
Throws:
java.io.UnsupportedEncodingException
See Also:
FormsResult.getAction()

getContentType

public java.lang.String getContentType()
Returns the content type that describes the data content generated by the Forms service. These values are valid:

If the content type is text/html, the character set value is appended; for example, text/html; charset="ISO-8859-1".

To see this method used in a code example, see the Rendering an interactive PDF form using the Java API quick start in Programming with LiveCycle ES4.

Returns:
A string value that specifies the content type.

getCharSet

public java.lang.String getCharSet()
Returns the character set encoding value; for example, ISO-8859-1, UTF-8, SHIFT_JIS. You can set the character set encoding value by invoking the RenderOptionsSpec object's setCharset method.

Returns:
The character set encoding value.
See Also:
setCharset()

getClickedBtn

public java.lang.String getClickedBtn()
Returns an XML Architecture Scripting Object Model (SOM) expression identifying the last button that was clicked on a form. A SOM expression references objects, properties, and methods within a particular Document Object Model (DOM). The following example is a SOM expression: Untitled[0].main[0].ButtonHello[0]

where Untitled and main represent the form's XML hierarchy. The name of the button on the form is ButtonHello. For information about the XML Architecture, go to http://partners.adobe.com/asn/tech/pdf/xmlformspec.jsp.

Returns:
A string value that specifies a SOM expression identifying the last button that was clicked on a form.

getOutputString

public java.lang.String getOutputString()
If the content type is text-based, this method returns the data content that is generated by the Forms service as a string; otherwise, it returns an empty string (binary content is accessible using the getOutputContent method).

Returns:
A string that represents the data content that is generated by the Forms service.
See Also:
FormsResult.getOutputContent()

getOutputXML

public Document getOutputXML()
If the content type contains XML or HTML data, the transformation result is stored as well-formed XML, which can be retrieved as this string. The XML data can be parsed, modified, and placed into an IOutputContext interface, which updates its state to reflect changes. The setOutputXML method is used for this purpose.

Returns:
A well-formed XML string that represents the content that is generated by the Forms services.
See Also:
FormsResult.setOutputXML(Document)

getValidationErrorsList

public Document getValidationErrorsList()
Gets a list of validation errors as UTF8-encoded XML. This is useful for client applications that want to access errors directly after the call but before any content is returned.

Returns:
A com.adobe.idp.Document object containing UTF8 encoded XML data.

getAction

public short getAction()
Indicates the processing state associated with the Forms service result. Client applications can query this value to determine whether interaction between the Forms service and web browser is complete. The value 0 (Submit) indicates that validated XML data is available. In this situation, interaction is complete. However, if the value is 1 (Calculate), the data content contains calculation results that must be returned to the web browser so that the user can view the results. These values are valid:

To see this method used in a code example, see the Handling submitted forms using the Java API quick start in Programming with LiveCycle ES4.

Returns:
A short value that specifies the processing state associated with the Forms service.

getTransformationID

public java.lang.String getTransformationID()
Although a client application indicates an output format preference, this value represents the actual transformation performed. In most cases, these values match but not always.

Returns:
A string value that specifies the transformation identifier.

getOptions

public java.lang.String getOptions()
Retrieves run-time options that are applicable to the Forms service. Run-time options are set when invoking a render method. For example, when you call the renderPDFForm method, you can set run-time options by invoking methods that belong to the PDFFormRenderSpec object.

Returns:
A string value that specifies run-time options. Each run-time value is separated by an ampersand character.

getXMLData

public Document getXMLData()
Retrieves form XML data. This method returns all form XML data, not data that is merged with the form.

Returns:
A Document object that contains form XML data.

getFormQuery

public java.lang.String getFormQuery()
Retrieves the name of the form design on which the rendered form is based. For example, if the form design is based on a form design named Loan.xdp, then this method returns Loan.xdp.

Returns:
A string value that specifies the name of the form design.

getPageNumber

public long getPageNumber()
Retrieves the page number of the rendered form.

Returns:
A long value that specifies the page number.

getPageCount

public long getPageCount()
Retrieves number of pages that is located within the rendered form.

Returns:
A long value that specifies the number of pages in the rendered form.

getAttachments

public java.util.List getAttachments()
Retrieves the file attachments that are rendered with the form. You can only retrieve attachments if the form is submitted as PDF data. To see this method used in a code example, see the Handling forms submitted as PDF using the Java API quick start in Programming with LiveCycle ES4.

Returns:
A java.util.List object that contains file attachments.

getLocale

public java.lang.String getLocale()
Gets a locale value that is used by the Forms service to send validation messsages to client devices, such as web browsers, as part of HTML transformations.

Returns:
The currently used locale value.

getOutputType

public int getOutputType()
Returns the output type value that specifies how a form that is rendered as HTML is displayed. The following values are valid:

Returns:
Returns the output type value that is used by the Forms service.

setOutputContent

public void setOutputContent(Document contentDoc,
                             java.lang.String sContentType)
                      throws java.lang.Exception
Sets the output content.

Parameters:
contentDoc - The output content.
sContentType - The content type.
Throws:
java.lang.Exception

getOption

public java.lang.String getOption(java.lang.String opt)
For internal use only. Do not use


setOutputXML

public void setOutputXML(Document outputXML)
For internal use only. Do not use


setCharSet

public void setCharSet(java.lang.String charSet)
For internal use only. Do not use


setContentType

public void setContentType(java.lang.String contentType)
For internal use only. Do not use


setTransformationID

public void setTransformationID(java.lang.String transformationID)
For internal use only. Do not use



[an error occurred while processing this directive] [an error occurred while processing this directive]