Class FormArchive


  • public class FormArchive
    extends Object
    Provides a Composer Form Archive POJO.
    • 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 file
        metadata - the META-INF/formarchive.xml metadata
        formContentMap - the form HTML content keyed by browser types map
        resourcesMap - the form static resources map, keyed by filename
        interactiveTemplate - the XFA PDF form template
        receiptTemplate - the PDF receipt template
        xmlData - the form XML data definition
        contactEmailXPath - the form data configuration mapping for the "Contact Email Address" form element
        contactPhoneXPath - the form data configuration mapping for the "Contact Phone" form element
        saveChallengeXPath - the form data configuration mapping for the "Save Challenge Answer" form element
        dataExtractMappings - the data extract mappings (name/XPath pairs)
        lastModified - the date the form was last modified
        composerDataVersion - composer data version
        composerFormDescriptor - 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
      • toString

        public String toString()
        Provides a string representation of the object.
        Overrides:
        toString in class Object
        Returns:
        a string representation of the object