com.crionics.jpdf.action
Class SubmitFormAction

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.action.AbstractAction
          extended by com.crionics.jpdf.action.SubmitFormAction

public class SubmitFormAction
extends AbstractAction

A Submit Form Action transmits the names and values of selected interactive Form Fields to a specified uniform resource locator (URL), presumably the address of a World Wide Web server that will process them and send back a response.


Field Summary
static int ATT_ANNOTATIONS
          Attribute which specifies if all annotations in the underlying PDF document, should be submitted or not.
static int ATT_EMBEDFORM
          Attribute which specifies that the URL entry of the submitted FDF will be a file specification containing an embedded file stream representing the PDF file from which the FDF is being submitted.
static int ATT_EXCLUDE
          Attribute which specifies that all the Form Fields present in the document should be submitted but the ones specified in the Fields Array of this action, and the ones with their NoExport Flags set.
static int ATT_FKEY
          Attribute which specifies if the submitted FDF should exclude the URL entry or not.
static int ATT_HTMLFORMAT
          Attribute which specifies if the data should be submitted in a HTML Form Format or in a Forms Data Format.
static int ATT_HTTPGET
          Attribute which specifies if the data should be submitted using a HTTP GET request or Post request.
static int ATT_INCREMENTAL
          Attribute which specifies if the submitted FDF file should includes the contents of all incremental updates.
static int ATT_MOUSEPOS
          Attribute which specifies if the coordinates of the mouse click that caused the submitform action are transmitted as part of the form data.
static int ATT_NONUSERANNOT
          Attribute which specifies if only those annotations whose names matches the name of the current user, as determined by the remote server to which the form is being submitted.
static int ATT_PDFFORMAT
          Attribute which specifies if the document is to be submitted in PDF format, using the MIME content type application/pdf (described in Internet RFC 2045, Multipurpose Internet Mail Extensions (MIME), Part One: Format of Internet Message Bodies).
static int ATT_STDDATE
          Attribute which specifies if any submitted field values representing dates should be converted to the standard format adopted by the PDF format.
static int ATT_VALUELESS
          Attribute which specifies if all fields designated by the Fields array and the Include/ Exclude flag are submitted, regardless of whether they have a value.
static int ATT_XPDF
          Attribute which specifies if field names and values are submitted in XFDF format.
 
Method Summary
static SubmitFormAction createInstance(PdfDocument doc)
          Allows the creation of a new Action into the Specified document.
 AbstractField[] getFields()
          Recovers the Form Fields which will be submitted or not depending on the attribute ATT_EXCLUDE.
 java.net.URL getURL()
          Returns the URL which will be used to submit the data.
 boolean isAttributeSet(int attributeID)
          Returns the current setting (set or not) of the specified attribute.
 void setAttribute(int attributeID, boolean flag)
          Sets/Clears the specified attribute.
 void setFields(AbstractField[] fields)
          Sets the Form Fields which will be submitted or not depending on the attribute ATT_EXCLUDE.
 void setFields(java.lang.String[] fieldNames)
          Sets the Form Fields which will be submitted or not depending on the attribute ATT_EXCLUDE.
 void setURL(java.net.URL url)
          Sets the URL which will be used to submit the data.
 
Methods inherited from class com.crionics.jpdf.action.AbstractAction
getNextAction, hasNextAction, setNextAction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATT_ANNOTATIONS

public static final int ATT_ANNOTATIONS
Attribute which specifies if all annotations in the underlying PDF document, should be submitted or not. Meaningful only when the form is being submitted in Forms Data Format (that is, when both the ATT_XPDFand ATT_HTMLFORMATattributes are clear).


ATT_EMBEDFORM

public static final int ATT_EMBEDFORM
Attribute which specifies that the URL entry of the submitted FDF will be a file specification containing an embedded file stream representing the PDF file from which the FDF is being submitted. Meaningful only when the form is being submitted in Forms Data Format (that is, when both the ATT_XPDFand ATT_HTMLFORMATattributes are clear).


ATT_EXCLUDE

public static final int ATT_EXCLUDE
Attribute which specifies that all the Form Fields present in the document should be submitted but the ones specified in the Fields Array of this action, and the ones with their NoExport Flags set. If this attribute is cleared, only the Form Fields present in the Fields Array of this action will be submitted.


ATT_FKEY

public static final int ATT_FKEY
Attribute which specifies if the submitted FDF should exclude the URL entry or not. Meaningful only when the form is being submitted in Forms Data Format (that is, when both the ATT_XPDFand ATT_HTMLFORMATattributes are clear).


ATT_HTMLFORMAT

public static final int ATT_HTMLFORMAT
Attribute which specifies if the data should be submitted in a HTML Form Format or in a Forms Data Format. Meaningful only when the form is being submitted in Forms Data Format (that is, when both the ATT_XPDFand ATT_PDFFORMATattributes are clear).


ATT_HTTPGET

public static final int ATT_HTTPGET
Attribute which specifies if the data should be submitted using a HTTP GET request or Post request. This flag is meaningful only when ATT_HTMLFORMATis set; if the attribute ATT_HTMLFORMATis clear, this flag must also be clear.


ATT_INCREMENTAL

public static final int ATT_INCREMENTAL
Attribute which specifies if the submitted FDF file should includes the contents of all incremental updates. Meaningful only when the form is being submitted in Forms Data Format (that is, when both the ATT_XPDFand ATT_HTMLFORMATattributes are clear).


ATT_MOUSEPOS

public static final int ATT_MOUSEPOS
Attribute which specifies if the coordinates of the mouse click that caused the submitform action are transmitted as part of the form data. The coordinate values are relative to the upper-left corner of the Form Field widget annotation rectangle. They are represented in the data in the format as:
name.x=xval&name.y=yval
where name is the Form Field mapping name if present, otherwise the field name.
If the Form Field mapping name is a single space character, both the name and the dot following it are suppressed, resulting in the format x=xval&y=yval.
This flag is meaningful only when ATT_HTMLFORMATis set; if the attribute ATT_HTMLFORMATis clear, this flag must also be clear.


ATT_NONUSERANNOT

public static final int ATT_NONUSERANNOT
Attribute which specifies if only those annotations whose names matches the name of the current user, as determined by the remote server to which the form is being submitted. The name entry, which specifies the text label to be displayed in the title bar of the annotation’s pop-up window, is assumed to represent the name of the user authoring the annotation. This allows multiple users to collaborate in annotating a single remote PDF document without affecting one another’s annotations. Meaningful only when the form is being submitted in Forms Data Format (that is, when both the ATT_XPDFand ATT_HTMLFORMATattributes are clear).


ATT_PDFFORMAT

public static final int ATT_PDFFORMAT
Attribute which specifies if the document is to be submitted in PDF format, using the MIME content type application/pdf (described in Internet RFC 2045, Multipurpose Internet Mail Extensions (MIME), Part One: Format of Internet Message Bodies). If this flag is set, all other flags are ignored except ATT_HTTPGET.


ATT_STDDATE

public static final int ATT_STDDATE
Attribute which specifies if any submitted field values representing dates should be converted to the standard format adopted by the PDF format.
YYYYMMDDHHmmSSOHH'mm' where
The apostrophe character (') after HH and mm is part of the syntax. All fields after the year are optional.
The default values for MM and DD are both 01; all other numerical fields default to zero values.
A plus sign (+) as the value of the O field signifies that local time is later than UT, a minus sign (?) that local time is earlier than UT, and the letter Z that local time is equal to UT. If no UT information is specified, the relationship of the specified time to UT is considered to be unknown. For example, December 23, 1998, at 7:52 PM, U.S. Pacific Standard Time, is represented by the string:
199812231952?08'00'


ATT_VALUELESS

public static final int ATT_VALUELESS
Attribute which specifies if all fields designated by the Fields array and the Include/ Exclude flag are submitted, regardless of whether they have a value. For fields without a value, only the field name is transmitted.
If clear, fields without a value are not submitted.


ATT_XPDF

public static final int ATT_XPDF
Attribute which specifies if field names and values are submitted in XFDF format. Meaningful only if the ATT_PDFFORMATflag is clear.

Method Detail

createInstance

public static SubmitFormAction createInstance(PdfDocument doc)
                                       throws PdfException,
                                              java.io.IOException
Allows the creation of a new Action into the Specified document.

The usage of this method requires the acquision of the Module jPDF Creator or jPDF Template

Parameters:
doc - The Document into which the Action should be created.
Returns:
The action created.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getFields

public AbstractField[] getFields()
                          throws PdfException,
                                 java.io.IOException
Recovers the Form Fields which will be submitted or not depending on the attribute ATT_EXCLUDE.

Returns:
An array of the fields or null if all the Form Fields present in the PDF document will be affected by this action.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

getURL

public java.net.URL getURL()
                    throws PdfException,
                           java.io.IOException
Returns the URL which will be used to submit the data.

Returns:
The URL.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

isAttributeSet

public boolean isAttributeSet(int attributeID)
                       throws java.io.IOException,
                              PdfException
Returns the current setting (set or not) of the specified attribute.

Parameters:
attributeID - The attribute (one of the ATT_... constant of this class).
Returns:
true if set, false otherwise.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setAttribute

public void setAttribute(int attributeID,
                         boolean flag)
                  throws java.io.IOException,
                         PdfException
Sets/Clears the specified attribute.

Parameters:
attributeID - The attribute (one of the ATT_... constant of this class) to set/clear.
flag - true to set it, false to clear it.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setFields

public void setFields(AbstractField[] fields)
               throws PdfException,
                      java.io.IOException
Sets the Form Fields which will be submitted or not depending on the attribute ATT_EXCLUDE.

Parameters:
fields - An array of the fields or null if all the Form Fields present in the PDF document will be affected by this action.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setFields

public void setFields(java.lang.String[] fieldNames)
               throws PdfException,
                      java.io.IOException
Sets the Form Fields which will be submitted or not depending on the attribute ATT_EXCLUDE.

Parameters:
fieldNames - The names of the Form Field or null if all the Form Fields present in the PDF document will be affected by this action.
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.

setURL

public void setURL(java.net.URL url)
            throws PdfException,
                   java.io.IOException
Sets the URL which will be used to submit the data.

Parameters:
url - The URL
Throws:
PdfException - If a problem occured while parsing the document.
java.io.IOException - If a problem occured while parsing the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.