Class PrintTemplate

  • All Implemented Interfaces:
    java.io.Serializable

    public class PrintTemplate
    extends java.lang.Object
    implements java.io.Serializable
    Print template
    See Also:
    Serialized Form
    • Field Detail

      • TYPE_DEFAULT

        public static final java.lang.String TYPE_DEFAULT
        Default type HTML
        See Also:
        Constant Field Values
      • RESOURCES_TYPES

        public static final java.lang.String[] RESOURCES_TYPES
        Resource types to be substituted
    • Constructor Detail

      • PrintTemplate

        public PrintTemplate​(ObjectDB object,
                             java.lang.String name,
                             java.lang.String display,
                             java.lang.String type,
                             java.lang.String usage,
                             java.lang.String method,
                             java.lang.String template,
                             java.lang.String docId,
                             java.lang.String mimeType,
                             java.lang.String fileName,
                             boolean grantable,
                             char visible)
        Constructor
        Parameters:
        object - Object name
        name - Template name
        display - Display
        usage - Usage
        method - Method
        template - Template content
        docId - Template document ID
        mimeType - Output MIME type
        fileName - Output file name
        grantable - Public or restricted to groups
        visible - Action visibility
    • Method Detail

      • getObject

        public ObjectDB getObject()
      • getName

        public java.lang.String getName()
      • getDisplay

        public java.lang.String getDisplay()
      • getLabel

        public java.lang.String getLabel()
      • getType

        public java.lang.String getType()
      • getUsage

        public java.lang.String getUsage()
      • getMethod

        public java.lang.String getMethod()
      • getPrintTemplateId

        public static java.lang.String getPrintTemplateId​(java.lang.String name,
                                                          java.lang.String lang)
      • isGrantable

        public boolean isGrantable()
        Grantable ?
      • setGrantable

        public void setGrantable​(boolean b)
      • getGrantedGroups

        public java.util.List<java.lang.String> getGrantedGroups()
        Granted groups ?
      • addGrantedGroup

        public void addGrantedGroup​(java.lang.String group)
      • removeGrantedGroup

        public void removeGrantedGroup​(java.lang.String group)
      • isGranted

        public boolean isGranted​(Grant g)
      • isForUsage

        public boolean isForUsage​(char usage)
      • isForObjectUsage

        public boolean isForObjectUsage()
      • isForListUsage

        public boolean isForListUsage()
      • isForMailingUsage

        public boolean isForMailingUsage()
      • isForExportUsage

        public boolean isForExportUsage()
      • isForOtherUsage

        public boolean isForOtherUsage()
      • isEnabled

        public boolean isEnabled()
      • setEnabled

        public void setEnabled​(boolean enabled)
      • isVisible

        public boolean isVisible()
        Visible ?
      • getVisibility

        public char getVisibility()
        Action visibility Action.ACTION_ALL | ACTION_HIDDEN | ACTION_PLUS
      • setVisible

        public void setVisible​(boolean b)
      • setVisible

        public void setVisible​(char vis)
        Set action visibility
        Parameters:
        vis - Action.ACTION_ALL or Action.ACTION_HIDDEN or Action.ACTION_PLUS
      • getDocId

        public java.lang.String getDocId()
      • setDocId

        public void setDocId​(java.lang.String docId)
      • getTemplate

        @Deprecated
        public java.lang.String getTemplate​(Grant g)
        Deprecated.
        Use getTemplate()
      • getTemplate

        public java.lang.String getTemplate()
      • setTemplate

        public void setTemplate​(java.lang.String template)
      • getMimeType

        @Deprecated
        public java.lang.String getMimeType()
        Deprecated.
      • getMIMEType

        public java.lang.String getMIMEType()
      • setMimeType

        @Deprecated
        public void setMimeType​(java.lang.String mimeType)
        Deprecated.
      • setMIMEType

        public void setMIMEType​(java.lang.String mimeType)
      • getFilename

        public java.lang.String getFilename()
      • setFilename

        public void setFilename​(java.lang.String filename)
      • generateDefaultSubTemplate

        public static java.lang.String generateDefaultSubTemplate​(ObjectDB obj)
                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • generateDefaultTemplate

        public static java.lang.String generateDefaultTemplate​(ObjectDB obj)
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • substituteResources

        public static java.lang.String substituteResources​(java.lang.String template,
                                                           ObjectDB obj)
                                                    throws java.lang.Exception
        Substitute resources contents
        Throws:
        java.lang.Exception
      • substituteTexts

        public static java.lang.String substituteTexts​(java.lang.String template,
                                                       java.lang.String encoding,
                                                       Grant g)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • substituteLabels

        public static java.lang.String substituteLabels​(java.lang.String template,
                                                        java.lang.String encoding,
                                                        ObjectDB obj)
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • substituteFilters

        public static java.lang.String substituteFilters​(java.lang.String template,
                                                         java.lang.String encoding,
                                                         ObjectDB obj)
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • subsituteExprs

        public static java.lang.String subsituteExprs​(java.lang.String template,
                                                      java.lang.String encoding,
                                                      ObjectDB obj,
                                                      java.lang.String row_id)
      • substituteFields

        public static java.lang.String substituteFields​(java.lang.String template,
                                                        java.lang.String encoding,
                                                        ObjectDB obj,
                                                        java.lang.String[] row)
      • substituteDirectURL

        public static java.lang.String substituteDirectURL​(java.lang.String text,
                                                           ObjectDB obj)
        Substitutes [DIRECTURL] with the direct URL to open the object update form
        Parameters:
        text - A text
        obj - Object
        Returns:
        the result text
      • fillTemplate

        public static java.lang.String fillTemplate​(ObjectDB obj,
                                                    java.lang.String template,
                                                    java.lang.String encoding,
                                                    java.util.List<java.lang.String[]> rows)
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fillTemplate

        public static java.lang.String fillTemplate​(ObjectDB obj,
                                                    java.lang.String template,
                                                    java.lang.String encoding,
                                                    java.lang.String[] row)
                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • fillWithCurrentObject

        public java.lang.Object fillWithCurrentObject​(ObjectDB obj)
                                               throws java.lang.Exception
        Build the template with current object (record)
        Parameters:
        obj - Object
        Returns:
        Print flow
        Throws:
        java.lang.Exception
      • getCurrentList

        public java.util.List<java.lang.String[]> getCurrentList​(ObjectDB obj)
      • fillWithCurrentList

        public java.lang.Object fillWithCurrentList​(ObjectDB obj)
                                             throws java.lang.Exception
        Build the template with current object (list)
        Parameters:
        obj - Object
        Returns:
        Print flow
        Throws:
        java.lang.Exception