com.adobe.livecycle.formsservice.client.interfaces
Interface IOutputContext

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FormsResult

public interface IOutputContext
extends java.io.Serializable

Provides access to processing results created by the renderForm and processFormSubmission, such as data content, the transformation result, and the content type. You do not work with an IOutputContext object directly. Instead, you work with a FormsResult object, that implements this interface.

See Also:
FormsResult

Method Summary
 short getAction()
          Indicates the processing state associated with the Forms service result.
 java.util.List getAttachments()
          Returns a list of PDF document attachments.
 java.lang.String getCharSet()
          Returns the character set encoding value; for example, ISO-8859-1, UTF-8, SHIFT_JIS.
 java.lang.String getClickedBtn()
          An XML Architecture Scripting Object Model (SOM) expression identifying the clicked button.
 java.lang.String getContentType()
          Returns the content type that describes the output content generated by the Forms service.
 java.lang.String getFormQuery()
          Returns the formQuery value, a parameter belonging to the renderForm method.
 java.lang.String getOption(java.lang.String opt)
          Returns the value of a specified run-time option that was set by using a RenderOptionsSpec object.
 java.lang.String getOptions()
          Returns an ampersand delimited list of options passed to the Forms service by invoking methods that belong to the RenderOptionsSpec object.
 Document getOutputContent()
          Returns the content generated by the Forms service.
 java.lang.String getOutputString()
          If the content type is text-based, this method returns the 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).
 Document getOutputXML()
          If the content type contains XML or HTML data, the transformation result is stored as well-formed XML.
 long getPageCount()
          Returns the total number of pages within the PDF form.
 long getPageNumber()
          Returns the current page number in a HTML form.
 java.lang.String getTransformationID()
          Although a client application indicates an output format preference (as specified by the formPreference parameter in renderForm), this value represents the actual transformation performed.
 Document getValidationErrorsList()
          Gets a list of validation errors as UTF8-encoded XML.
 Document getXMLData()
          If the XMLData run-time option is enabled (set using the RenderOptionsSpec object), this method returns UTF8-encoded XML data from the Forms service.
 void setOutputXML(Document sXML)
          Sets the output XML retrieved by calling getOutputXML.
 

Method Detail

getOutputContent

Document getOutputContent()
                          throws java.io.UnsupportedEncodingException
Returns the content generated by the Forms service. Depending on the FSAction 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.

Returns:
A com.adobe.idp.Document object that contains content generated by the Forms servicee. The content format may contain XML, HTML, or PDF data.
Throws:
java.io.UnsupportedEncodingException
See Also:
IOutputContext.getAction()

getContentType

java.lang.String getContentType()
Returns the content type that describes the output 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".

Returns:
A string value that specifies the content type.

getCharSet

java.lang.String getCharSet()
Returns the character set encoding value; for example, ISO-8859-1, UTF-8, SHIFT_JIS.

Returns:
The character set encoding value.

getClickedBtn

java.lang.String getClickedBtn()
An XML Architecture Scripting Object Model (SOM) expression identifying the clicked button. 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 SOM expression identifying the last button that was clicked on a form.

getOutputString

java.lang.String getOutputString()
If the content type is text-based, this method returns the 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 content that is generated by the Forms service.
See Also:
IOutputContext.getOutputContent()

getOutputXML

Document getOutputXML()
If the content type contains XML or HTML data, the transformation result is stored as well-formed XML. 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 com.adobe.idp.Document object that represents the content that is generated by the Forms services.
See Also:
IOutputContext.setOutputXML(Document)

setOutputXML

void setOutputXML(Document sXML)
Sets the output XML retrieved by calling getOutputXML. The output can be modified by a client application. For example, it is possible to enhance HTML transformations by adding elements that are not supported by the Forms service. An example is changing an input element to be a password type, which is not a support element.

Parameters:
sXML - A com.adobe.idp.Document object that contains modified XML data.
See Also:
IOutputContext.getOutputXML()

getValidationErrorsList

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. The following is valid format:
<validationerrors>

 <!-- page level errors -->

 <pages />

 <!-- field level errors -->

 <fields>

   <field>

   <name>rootsubform[1].FFField1[1]</name>

   <message>Mandatory Field</message>

  </field>

 </fields>

</validationerrors>

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

getAction

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 client application 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 content contains the results that must be returned to the client application. These values are valid:

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

getTransformationID

java.lang.String getTransformationID()
Although a client application indicates an output format preference (as specified by the formPreference parameter in renderForm), this value represents the actual transformation performed. In most cases, these values match but not always. If the formPreference parameter is assigned the value AUTO, the transformation is dynamically determined.

Returns:
A string value that specifies the transformation identifier.

getOptions

java.lang.String getOptions()
Returns an ampersand delimited list of options passed to the Forms service by invoking methods that belong to the RenderOptionsSpec object. This object is passed to the FormsServiceClient object's renderForm method or processFormSubmission method. For information, see Rendering Forms.

Returns:
A string value that specifies the run-time options that are set.
See Also:
renderForm(), processFormSubmission(), RenderOptionsSpec

getOption

java.lang.String getOption(java.lang.String opt)
Returns the value of a specified run-time option that was set by using a RenderOptionsSpec object.

Parameters:
opt - The name of the option for which a value is retrieved.
Returns:
A string value that represents the value of the specified option.

getXMLData

Document getXMLData()
If the XMLData run-time option is enabled (set using the RenderOptionsSpec object), this method returns UTF8-encoded XML data from the Forms service. The data is based on the current processing state of the Forms service and may be the result after calculations are performed (FSAction = Calculate) but may not necessarily be the same result as the data returned after a submit (FSAction = Submit).

Returns:
A com.adobe.idp.Document object containing the form’s XML data.

getFormQuery

java.lang.String getFormQuery()
Returns the formQuery value, a parameter belonging to the renderForm method. For example, assume cashsale.xdp is rendered to the client device (the value of the formQuery parameter in renderForm is cashsale.xdp). In this situation, this method returns cashsale.xdp.

Returns:
The name of the form design that was rendered.

getPageNumber

long getPageNumber()
Returns the current page number in a HTML form. This method is not relevant for PDFForms and is based on a zero-based index.

Returns:
A long value representing the current page number.

getPageCount

long getPageCount()
Returns the total number of pages within the PDF form.

Returns:
A long value representing the number of pages.

getAttachments

java.util.List getAttachments()
Returns a list of PDF document attachments.

Returns:
ArrayList An array list of attachments that were part of the rendered form.