Class FormSubmitActionHandler
- java.lang.Object
-
- org.faceless.pdf2.viewer2.ViewerFeature
-
- org.faceless.pdf2.viewer2.ActionHandler
-
- 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.The name of this feature is FormSubmitActionHandlertimeout The connection timeout value in milliseconds (0 is infinite) readTimeout The read timeout value in milliseconds (0 is infinite) 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
-
Constructor Summary
Constructors Constructor Description FormSubmitActionHandler()
Create a new FormSubmitActionHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(PDFViewer viewer)
Called when the feature is first added to a viewerboolean
matches(DocumentPanel panel, PDFAction action)
Return true if this ActionFactory can handle the specifiedPDFAction
void
run(DocumentPanel docpanel, PDFAction action)
Run the specified actionvoid
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
-
-
-
-
Field Detail
-
FLAG_EMPTYFIELDS
public static final int FLAG_EMPTYFIELDS
Flag value forsubmit(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 forsubmit(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 forsubmit(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 forsubmit(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 forsubmit(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 forsubmit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int)
meaning the annotationPDFAnnotation.getUniqueID()
should be submitted- Since:
- 2.11.18
- See Also:
FDF.setIncludeUniqueID(boolean)
, Constant Field Values
-
NOANNOTATIONS
public static final int NOANNOTATIONS
Annotation value forsubmit(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 forsubmit(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 forsubmit(org.faceless.pdf2.viewer2.DocumentPanel, java.lang.String, java.lang.String, java.lang.String[], int, int)
meaning only annotations where theauthor
matches thecurrent user
.- Since:
- 2.11.18
- See Also:
- Constant Field Values
-
-
Method Detail
-
matches
public boolean matches(DocumentPanel panel, PDFAction action)
Description copied from class:ActionHandler
Return true if this ActionFactory can handle the specifiedPDFAction
- Specified by:
matches
in classActionHandler
-
initialize
public void initialize(PDFViewer viewer)
Description copied from class:ViewerFeature
Called when the feature is first added to a viewer- Overrides:
initialize
in classViewerFeature
-
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 classActionHandler
- Parameters:
docpanel
- the DocumentPanel running the actionaction
- 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 theDoc.submitForm
JavaScript method.- Parameters:
docpanel
- the DocumentPanelurl
- the URL the submit will be made tomethod
- the format - one of FDF, XFDF, HTML, HTMLGET, XML, or PDFfields
- the list of field names to include - may be null (for all fields). List will be moderated by theFLAG_EMPTY
parameterannotations
- one ofNOANNOTATIONS
,USERANNOTATIONS
orALLANNOTATIONS
flags
- a logical or of the variousflags
- Since:
- 2.11.18
- See Also:
FDF
-
-