Class TemplateVersion

  • All Implemented Interfaces:
    IEntity, Auditable, Serializable, org.apache.cayenne.DataObject, org.apache.cayenne.Persistent, org.apache.cayenne.Validating

    @CacheGroups("CONFIG")
    public class TemplateVersion
    extends _TemplateVersion
    implements Auditable
    Provides a version of a form template, defining the actual form template files (e.g. PDF or ES2 guide) that will be used to render the form and receipt.
    See Also:
    Serialized Form
    • Field Detail

      • FORM_TYPE_DYNAMIC_PDF_FORM

        public static final String FORM_TYPE_DYNAMIC_PDF_FORM
        The "Dynamic PDF Form" form type
        See Also:
        Constant Field Values
      • FORM_TYPE_COMPOSER_SMARTFORM

        public static final String FORM_TYPE_COMPOSER_SMARTFORM
        The "Composer SmartForm" form type
        See Also:
        Constant Field Values
      • FORM_TYPE_MAESTRO_FORM

        public static final String FORM_TYPE_MAESTRO_FORM
        The "Maestro Form" form type
        See Also:
        Constant Field Values
      • FORM_TYPE_STATIC_PDF_FORM

        public static final String FORM_TYPE_STATIC_PDF_FORM
        The "Static PDF Form" form type
        See Also:
        Constant Field Values
      • FORM_TYPE_OTHER_DOCUMENT

        public static final String FORM_TYPE_OTHER_DOCUMENT
        The "Other Document" form type
        See Also:
        Constant Field Values
      • DIR_FORM

        public static final String DIR_FORM
        The subfolder to use when publishing the form template file
        See Also:
        Constant Field Values
      • DIR_RECEIPT

        public static final String DIR_RECEIPT
        The subfolder to use when publishing the receipt template file
        See Also:
        Constant Field Values
      • CURRENT_VERSION_PROPERTY

        public static final String CURRENT_VERSION_PROPERTY
        An auxiliary property indicating whether the template version is the one currently in use for its form
        See Also:
        Constant Field Values
    • Constructor Detail

      • TemplateVersion

        public TemplateVersion()
    • Method Detail

      • isFarFileFormType

        public static boolean isFarFileFormType​(String formType)
        Return true if the given formType uses a FAR file for storage.
        Parameters:
        formType - the form type
        Returns:
        true if the given formType uses a FAR file for storage
        Since:
        17.10.0
      • isDynamicPdfForm

        public boolean isDynamicPdfForm()
        Return whether the form template file is a XFA Dynamic PDF Form.
        Returns:
        true if the form type is FORM_TYPE_DYNAMIC_PDF_FORM
      • isComposerSmartForm

        public boolean isComposerSmartForm()
        Return whether the form template file is an Composer SmartForm.
        Returns:
        true if the form type is FORM_TYPE_COMPOSER_SMARTFORM
      • isJsApp

        public boolean isJsApp()
        Return whether the form template file is an JS App.
        Returns:
        true if the form type is FORM_TYPE_JS_APP
        Since:
        17.10.0
      • isMaestroForm

        public boolean isMaestroForm()
        Return whether the form template file is an Maestro Form.
        Returns:
        true if the form type is FORM_TYPE_MAESTRO_FORM
        Since:
        5.0.0
      • isMaestroFormOrJsApp

        public boolean isMaestroFormOrJsApp()
        Return true if the form template file is a Maestro Form or a JS App.
        Returns:
        true if the form template file is a Maestro Form or a JS App.
        Since:
        18.5.0
      • isStaticPdfForm

        public boolean isStaticPdfForm()
        Return whether the form template file is a static PDF form.
        Returns:
        true if the form type is FORM_TYPE_STATIC_PDF_FORM
      • isOtherDocument

        public boolean isOtherDocument()
        Return whether the form template file is an other type of document, e.g. Microsoft Word document.
        Returns:
        true if the form type is FORM_TYPE_OTHER_DOCUMENT
      • getVersionPropertyMap

        public Map<String,​VersionPropertyValue> getVersionPropertyMap()
        Return the map of VersionPropertyValues keyed on property name.
        Returns:
        the map of VersionPropertyValues keyed on property name
        Since:
        4.2.0
      • useLiveCycleForm

        public boolean useLiveCycleForm()
        Return true if form template version is configured to use a PDF form relying on LiveCycle. Such forms cannot be rendered any more as LiveCycle support has been removed.
        Returns:
        true if form template version is configured to use a PDF form relying on LiveCycle.
        Since:
        19.11.0
      • usePdfForm

        public boolean usePdfForm()
        Return true if form template version is configured to use PDF form.
        Returns:
        true if form template version is configured to use PDF form.
      • isCurrentVersion

        public boolean isCurrentVersion()
        Returns whether this template version is the one used by the form
        Returns:
        true if this template version matches the current version configured for the form
      • setFormFileName

        public void setFormFileName​(String formFileName)
        Set the formFileName value.
        Overrides:
        setFormFileName in class _TemplateVersion
        Parameters:
        formFileName - the formFileName value to set
      • setReceiptFileName

        public void setReceiptFileName​(String receiptFileName)
        Set the receiptFileName value.
        Overrides:
        setReceiptFileName in class _TemplateVersion
        Parameters:
        receiptFileName - the receiptFileName value to set
      • getFormDesignMetadataJson

        public String getFormDesignMetadataJson()
        Return the Form Design Metadata JSON.
        Returns:
        the Form Design Metadata JSON
        Since:
        5.1.0
      • setFormDesignMetadataJson

        public void setFormDesignMetadataJson​(String json)
        Set the Form Design Metadata JSON.
        Parameters:
        json - set the Form Design Metadata JSON
        Since:
        5.1.0
      • incrementMetadataPublishAttempts

        public void incrementMetadataPublishAttempts()
        Increment the number of form design metadata publish attempts by one.
        Since:
        5.1.0
      • getFormDesignUrl

        public String getFormDesignUrl()
        Returns:
        the form design URL or null if not available.
        Since:
        17.10.0