Class FormArchive
- java.lang.Object
-
- com.avoka.fc.core.service.composer.FormArchive
-
public class FormArchive extends Object
Provides a Composer Form Archive POJO.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEVICE_TYPE_DEFAULT
The default device type.static String
DEVICE_TYPE_DESKTOP
The default device type.static String
DEVICE_TYPE_INTERACTIVE
The interactive device type.static String
DEVICE_TYPE_MOBILE
The mobile device type.static String
DEVICE_TYPE_PHONE
The mobile device type.static String
DEVICE_TYPE_RECEIPT
The receipt device type.static String
DEVICE_TYPE_TABLET
The tablet device type.static String
PARAM_XML_DATA
The submission 'xml_data' parameter name.static String
RESOURCE_DESIGN_INFO
The path to the design info resource.
-
Constructor Summary
Constructors Constructor Description FormArchive(String farFileName, Document metadata, Map<String,String> formContentMap, Map<String,byte[]> resourcesMap, FileItem interactiveTemplate, FileItem receiptTemplate, FileItem xmlData, String contactEmailXPath, String contactPhoneXPath, String saveChallengeXPath, List<SchemaExtractMapBean> dataExtractMappings, Date lastModified, String composerDataVersion, String composerFormDescriptor)
Create a FormArchive POJO for the given form content and resources maps.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAuthor()
Return the author for the given form archive.String
getBuildEnvironment()
Return the build environment for the given form archive.String
getBuildNumber()
Return the build number for the given form archive.String
getBuildServerUrl()
Return the build server URL for the given form archive.String
getBuildVersion()
Return the build version for the given form archive.String
getComposerDataVersion()
Gets the composer data version.String
getComposerFormDescriptor()
Gets the composer form descriptor XML.String
getContactEmailXPath()
Gets the form data configuration mapping for the "Contact Email Address" form elementString
getContactPhoneXPath()
Gets the form data configuration mapping for the "Contact Phone Address" form elementList<SchemaExtractMapBean>
getDataExtractMappings()
Return the submission data extract mappings.String
getDescription()
Return the description for the given form archive.String
getFarFileName()
Return the file name of the form archive.String
getFormContent(String deviceType)
Return the form HTML content for the given device type [ 'phone', 'tablet', 'default', 'interactive', 'receipt' ].Map<String,String>
getFormContentMap()
Return a map of HTML templates cached on browser type.org.jsoup.nodes.Document
getFormHtmlDocument(String deviceType)
Return the cached form HTML Document for the given device type.String
getFormKey()
Return the formKey for the given form archive.String
getFormName()
Return the SFC form name for the given form archive.String
getFormRevisionName()
String
getFormRevisionNumber()
String
getFormTemplatesString()
Return the form templates contained in this form archive as a comma-separated string (e.g.String
getGeneratedBy()
Return the generated by for the given form archive.Date
getGenerationDate()
Return the generation date for the given form archive.String
getHtmlTemplateName()
Return the HTML template name (path) if defined.FileItem
getInteractiveTemplate()
Return the XFA PDF interactive form template file item.Date
getLastModified()
Return the time the form was last modified.String
getMaestroRelease()
Return the Maestro form release version number.Document
getMetadata()
Return the form archive metadata (META-INF/formarchive.xml).String
getName()
Return the form archive name for the given form archive (contains the form name + variant name).String
getOrganization()
Return the organization for the given form archive.FileItem
getReceiptTemplate()
Return the PDF receipt template file item.byte[]
getResource(String path)
Return the FAR resource for the given path.Set<String>
getResourceName()
Return the set of FAR resource names.Map<String,byte[]>
getResourcesMap()
Return the FAR resources map.String
getSaveChallengeXPath()
Gets the form data configuration mapping for the "Save Challenge Answer" form elementFileItem
getXmlData()
Return the form XML data definition.boolean
hasHtmlDesktopTemplate()
Return true if the form archive contains a HTML desktop template.boolean
hasHtmlPhoneTemplate()
Return true if the form archive contains a HTML phone template.boolean
hasHtmlReceiptTemplate()
Return true if the form archive contains a HTML receipt template.boolean
hasHtmlTabletTemplate()
Return true if the form archive contains a HTML tablet template.boolean
hasHtmlTemplate()
Return true if the form archive contains a XFA interactive form template.boolean
hasInteractiveTemplate()
Return true if the form archive contains a XFA interactive form template.boolean
hasReceiptTemplate()
Return true if the form archive contains a PDF receipt template.boolean
hasSaveChallengeSupport()
Return true if the form archive supports "SaveChallenge" modal page or is a Maestro Form.boolean
isJsApp()
Return true if a JS App form archive.boolean
isMaestroForm()
Return true if a Maestro form archive.String
toString()
Provides a string representation of the object.
-
-
-
Field Detail
-
DEVICE_TYPE_MOBILE
public static final String DEVICE_TYPE_MOBILE
The mobile device type.- See Also:
- Constant Field Values
-
DEVICE_TYPE_PHONE
public static final String DEVICE_TYPE_PHONE
The mobile device type.- See Also:
- Constant Field Values
-
DEVICE_TYPE_TABLET
public static final String DEVICE_TYPE_TABLET
The tablet device type.- See Also:
- Constant Field Values
-
DEVICE_TYPE_DEFAULT
public static final String DEVICE_TYPE_DEFAULT
The default device type.- See Also:
- Constant Field Values
-
DEVICE_TYPE_DESKTOP
public static final String DEVICE_TYPE_DESKTOP
The default device type.- See Also:
- Constant Field Values
-
DEVICE_TYPE_INTERACTIVE
public static final String DEVICE_TYPE_INTERACTIVE
The interactive device type.- See Also:
- Constant Field Values
-
DEVICE_TYPE_RECEIPT
public static final String DEVICE_TYPE_RECEIPT
The receipt device type.- See Also:
- Constant Field Values
-
PARAM_XML_DATA
public static final String PARAM_XML_DATA
The submission 'xml_data' parameter name.- See Also:
- Constant Field Values
-
RESOURCE_DESIGN_INFO
public static final String RESOURCE_DESIGN_INFO
The path to the design info resource.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FormArchive
public FormArchive(String farFileName, Document metadata, Map<String,String> formContentMap, Map<String,byte[]> resourcesMap, FileItem interactiveTemplate, FileItem receiptTemplate, FileItem xmlData, String contactEmailXPath, String contactPhoneXPath, String saveChallengeXPath, List<SchemaExtractMapBean> dataExtractMappings, Date lastModified, String composerDataVersion, String composerFormDescriptor)
Create a FormArchive POJO for the given form content and resources maps.- Parameters:
farFileName
- the name of the form archive filemetadata
- the META-INF/formarchive.xml metadataformContentMap
- the form HTML content keyed by browser types mapresourcesMap
- the form static resources map, keyed by filenameinteractiveTemplate
- the XFA PDF form templatereceiptTemplate
- the PDF receipt templatexmlData
- the form XML data definitioncontactEmailXPath
- the form data configuration mapping for the "Contact Email Address" form elementcontactPhoneXPath
- the form data configuration mapping for the "Contact Phone" form elementsaveChallengeXPath
- the form data configuration mapping for the "Save Challenge Answer" form elementdataExtractMappings
- the data extract mappings (name/XPath pairs)lastModified
- the date the form was last modifiedcomposerDataVersion
- composer data versioncomposerFormDescriptor
- the composer form descriptor- Since:
- 4.2.0
-
-
Method Detail
-
getFarFileName
public String getFarFileName()
Return the file name of the form archive.- Returns:
- the FAR file name
-
getFormRevisionName
public String getFormRevisionName()
- Returns:
- the form revision name.
- Since:
- 4.2.0
-
getFormRevisionNumber
public String getFormRevisionNumber()
- Returns:
- the form revision number.
- Since:
- 4.2.0
-
getDescription
public String getDescription()
Return the description for the given form archive.- Returns:
- the form archive description
-
getAuthor
public String getAuthor()
Return the author for the given form archive.- Returns:
- the form archive author
-
getBuildEnvironment
public String getBuildEnvironment()
Return the build environment for the given form archive.- Returns:
- the form archive build environment
-
getBuildNumber
public String getBuildNumber()
Return the build number for the given form archive.- Returns:
- the form archive build number
-
getBuildServerUrl
public String getBuildServerUrl()
Return the build server URL for the given form archive.- Returns:
- the form archive build server URL
-
getBuildVersion
public String getBuildVersion()
Return the build version for the given form archive.- Returns:
- the form archive build version
-
getGeneratedBy
public String getGeneratedBy()
Return the generated by for the given form archive.- Returns:
- the form archive generated by
-
getGenerationDate
public Date getGenerationDate()
Return the generation date for the given form archive.- Returns:
- the form archive generation date
-
getOrganization
public String getOrganization()
Return the organization for the given form archive.- Returns:
- the form archive organization
-
getFormKey
public String getFormKey()
Return the formKey for the given form archive.- Returns:
- the form archive formKey
-
hasHtmlTemplate
public boolean hasHtmlTemplate()
Return true if the form archive contains a XFA interactive form template.- Returns:
- true if the form archive contains a XFA interactive form template, or false otherwise
-
getHtmlTemplateName
public String getHtmlTemplateName()
Return the HTML template name (path) if defined. The template name returned will be in order of preference: default, tablet, phone.- Returns:
- default HTML template name (path ) if defined.
-
hasHtmlPhoneTemplate
public boolean hasHtmlPhoneTemplate()
Return true if the form archive contains a HTML phone template.- Returns:
- true if the form archive contains a HTML phone template.
-
hasHtmlTabletTemplate
public boolean hasHtmlTabletTemplate()
Return true if the form archive contains a HTML tablet template.- Returns:
- true if the form archive contains a HTML tablet template.
-
hasHtmlDesktopTemplate
public boolean hasHtmlDesktopTemplate()
Return true if the form archive contains a HTML desktop template.- Returns:
- true if the form archive contains a HTML desktop template.
-
hasHtmlReceiptTemplate
public boolean hasHtmlReceiptTemplate()
Return true if the form archive contains a HTML receipt template.- Returns:
- true if the form archive contains a HTML receipt template.
-
getInteractiveTemplate
public FileItem getInteractiveTemplate()
Return the XFA PDF interactive form template file item.- Returns:
- the XFA PDF interactive form template file item.
-
hasInteractiveTemplate
public boolean hasInteractiveTemplate()
Return true if the form archive contains a XFA interactive form template.- Returns:
- true if the form archive contains a XFA interactive template, or false otherwise
-
getReceiptTemplate
public FileItem getReceiptTemplate()
Return the PDF receipt template file item.- Returns:
- the PDF receipt template file item.
-
hasReceiptTemplate
public boolean hasReceiptTemplate()
Return true if the form archive contains a PDF receipt template.- Returns:
- true if the form archive contains a PDF receipt template, or false otherwise
-
hasSaveChallengeSupport
public boolean hasSaveChallengeSupport()
Return true if the form archive supports "SaveChallenge" modal page or is a Maestro Form.- Returns:
- true if the form archive supports "SaveChallenge" modal page or is a Maestro Form.
- Since:
- 4.1.0
-
getLastModified
public Date getLastModified()
Return the time the form was last modified. This value is used for resource browser caching purposes.- Returns:
- the time the form was last modified. This value is used for resource browser caching purposes.
-
getMetadata
public Document getMetadata()
Return the form archive metadata (META-INF/formarchive.xml).- Returns:
- the form archive metadata (META-INF/formarchive.xml).
-
getName
public String getName()
Return the form archive name for the given form archive (contains the form name + variant name).- Returns:
- the form archive name
-
isMaestroForm
public boolean isMaestroForm()
Return true if a Maestro form archive.- Returns:
- true if a Maestro form archive
- Since:
- 5.0.0
-
getMaestroRelease
public String getMaestroRelease()
Return the Maestro form release version number.- Returns:
- the Maestro form release version number
- Since:
- 5.0.0
-
isJsApp
public boolean isJsApp()
Return true if a JS App form archive.- Returns:
- true if a JS App form archive
- Since:
- 18.5.0
-
getFormName
public String getFormName()
Return the SFC form name for the given form archive.- Returns:
- the SFC form name
-
getFormContent
public String getFormContent(String deviceType)
Return the form HTML content for the given device type [ 'phone', 'tablet', 'default', 'interactive', 'receipt' ].- Parameters:
deviceType
- the request device type- Returns:
- the form HTML content for the device type
-
getFormContentMap
public Map<String,String> getFormContentMap()
Return a map of HTML templates cached on browser type.- Returns:
- a map of HTML templates cached on browser type
-
getFormHtmlDocument
public org.jsoup.nodes.Document getFormHtmlDocument(String deviceType)
Return the cached form HTML Document for the given device type.- Parameters:
deviceType
- the browser device type- Returns:
- the cached form HTML Document for the given device type
-
getResource
public byte[] getResource(String path)
Return the FAR resource for the given path.- Parameters:
path
- relative path of the resource- Returns:
- the resource bytes for the give path
-
getResourceName
public Set<String> getResourceName()
Return the set of FAR resource names.- Returns:
- the set of FAR resource name
-
getResourcesMap
public Map<String,byte[]> getResourcesMap()
Return the FAR resources map.- Returns:
- the FAR resources map
-
getXmlData
public FileItem getXmlData()
Return the form XML data definition.- Returns:
- the form XML data definition
-
getComposerFormDescriptor
public String getComposerFormDescriptor()
Gets the composer form descriptor XML.- Returns:
- the composer form descriptor XML.
- Since:
- 4.2.0
-
getComposerDataVersion
public String getComposerDataVersion()
Gets the composer data version.- Returns:
- the composer data version
-
getContactEmailXPath
public String getContactEmailXPath()
Gets the form data configuration mapping for the "Contact Email Address" form element- Returns:
- the form data configuration mapping for the "Contact Email Address" form element
-
getContactPhoneXPath
public String getContactPhoneXPath()
Gets the form data configuration mapping for the "Contact Phone Address" form element- Returns:
- the form data configuration mapping for the "Contact Phone Address" form element
-
getSaveChallengeXPath
public String getSaveChallengeXPath()
Gets the form data configuration mapping for the "Save Challenge Answer" form element- Returns:
- the form data configuration mapping for the "Save Challenge Answer" form element
-
getDataExtractMappings
public List<SchemaExtractMapBean> getDataExtractMappings()
Return the submission data extract mappings.- Returns:
- the submission data extract mappings
-
getFormTemplatesString
public String getFormTemplatesString()
Return the form templates contained in this form archive as a comma-separated string (e.g. "PDF, HTML Desktop")- Returns:
- the form templates string
-
-