org.faceless.pdf2.viewer2.feature
Class FormSubmitActionHandler

java.lang.Object
  extended by org.faceless.pdf2.viewer2.ViewerFeature
      extended by org.faceless.pdf2.viewer2.ActionHandler
          extended by org.faceless.pdf2.viewer2.feature.FormSubmitActionHandler

public class FormSubmitActionHandler
extends ActionHandler

Create a handler to handler "FormSubmit" actions.

The following initialization parameters can be specified to configure this feature.
timeoutThe connection timeout value in milliseconds (0 is infinite)
readTimeoutThe read timeout value in milliseconds (0 is infinite)
The name of this feature is FormSubmitActionHandler

This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.

Since:
2.8.3

Field Summary
static int ALLANNOTATIONS
          Annotation value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning all annotations should be submitted
static int FLAG_CANONICALDATES
          Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning dates should be submitted in canonical format
static int FLAG_EMBEDFORM
          Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning the Form should be emdedded in the FDF (not currently implemnted)
static int FLAG_EMPTYFIELDS
          Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning empty fields should be submitted
static int FLAG_FKEY
          Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning the Filename should be submitted
static int FLAG_INCREMENTAL
          Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning incremental updates should be submitted (not currently implemented)
static int FLAG_NMKEY
          Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning the annotation PDFAnnotation.getUniqueID() should be submitted
static int NOANNOTATIONS
          Annotation value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning no annotations should be submitted
static int USERANNOTATIONS
          Annotation value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning only annotations where the author matches the current user.
 
Constructor Summary
FormSubmitActionHandler()
          Create a new FormSubmitActionHandler
 
Method Summary
 void initialize(PDFViewer viewer)
          Called when the feature is first added to a viewer
 boolean matches(DocumentPanel panel, PDFAction action)
          Return true if this ActionFactory can handle the specified PDFAction
 void run(DocumentPanel docpanel, PDFAction action)
          Run the specified action
 void setReadTimeout(int timeout)
          Set the timeout in milliseconds that should be used when reading from a URL.
 void setTimeout(int timeout)
          Set the timeout in milliseconds that should be used when connecting to a URL.
 void submit(DocumentPanel docpanel, String url, String method, String[] fields, int annotations, int flags)
          Submit the document form.
 
Methods inherited from class org.faceless.pdf2.viewer2.ActionHandler
toString
 
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAG_EMPTYFIELDS

public static final int FLAG_EMPTYFIELDS
Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning empty fields should be submitted

Since:
2.11.18
See Also:
Constant Field Values

FLAG_INCREMENTAL

public static final int FLAG_INCREMENTAL
Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning incremental updates should be submitted (not currently implemented)

Since:
2.11.18
See Also:
Constant Field Values

FLAG_CANONICALDATES

public static final int FLAG_CANONICALDATES
Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning dates should be submitted in canonical format

Since:
2.11.18
See Also:
FDF.getCanonicalDate(org.faceless.pdf2.FormElement), Constant Field Values

FLAG_FKEY

public static final int FLAG_FKEY
Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning the Filename should be submitted

Since:
2.11.18
See Also:
Constant Field Values

FLAG_EMBEDFORM

public static final int FLAG_EMBEDFORM
Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning the Form should be emdedded in the FDF (not currently implemnted)

Since:
2.11.18
See Also:
Constant Field Values

FLAG_NMKEY

public static final int FLAG_NMKEY
Flag value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning the annotation PDFAnnotation.getUniqueID() should be submitted

Since:
2.11.18
See Also:
FDF.setIncludeUniqueID(boolean), Constant Field Values

NOANNOTATIONS

public static final int NOANNOTATIONS
Annotation value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning no annotations should be submitted

Since:
2.11.18
See Also:
Constant Field Values

ALLANNOTATIONS

public static final int ALLANNOTATIONS
Annotation value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning all annotations should be submitted

Since:
2.11.18
See Also:
Constant Field Values

USERANNOTATIONS

public static final int USERANNOTATIONS
Annotation value for submit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int) meaning only annotations where the author matches the current user.

Since:
2.11.18
See Also:
Constant Field Values
Constructor Detail

FormSubmitActionHandler

public FormSubmitActionHandler()
Create a new FormSubmitActionHandler

Since:
2.11
Method Detail

matches

public boolean matches(DocumentPanel panel,
                       PDFAction action)
Description copied from class: ActionHandler
Return true if this ActionFactory can handle the specified PDFAction

Specified by:
matches in class ActionHandler

initialize

public void initialize(PDFViewer viewer)
Description copied from class: ViewerFeature
Called when the feature is first added to a viewer

Overrides:
initialize in class ViewerFeature

setTimeout

public void setTimeout(int timeout)
Set the timeout in milliseconds that should be used when connecting to a URL. A value of 0 (the default) means infinite.

Parameters:
timeout - the number of milliseconds to wait while connecting to a URL before timing out

setReadTimeout

public void setReadTimeout(int timeout)
Set the timeout in milliseconds that should be used when reading from a URL. A value of 0 (the default) means infinite.

Parameters:
timeout - the number of milliseconds to wait while reading from a URL before timing out

run

public void run(DocumentPanel docpanel,
                PDFAction action)
Description copied from class: ActionHandler
Run the specified action

Specified by:
run in class ActionHandler
Parameters:
docpanel - the DocumentPanel running the action
action - the action

submit

public void submit(DocumentPanel docpanel,
                   String url,
                   String method,
                   String[] fields,
                   int annotations,
                   int flags)
Submit the document form. This method is intended to be called from the Doc.submitForm JavaScript method.

Parameters:
docpanel - the DocumentPanel
url - the URL the submit will be made to
method - the format - one of FDF, XFDF, HTML, HTMLGET, XML, or PDF
fields - the list of field names to include - may be null (for all fields). List will be moderated by the FLAG_EMPTY parameter
annotations - one of NOANNOTATIONS, USERANNOTATIONS or ALLANNOTATIONS
flags - a logical or of the various flags
Since:
2.11.18
See Also:
FDF


Copyright © 2001-2013 Big Faceless Organization