Class IndexMaskDocument


  • public class IndexMaskDocument
    extends java.lang.Object
    Represents the document that is currently in use by an index-mask. If the document is already archived, an IndexMaskDocument instance will contain the document's ID, metadata and variables. If the document is not yet archived, the IndexMaskDocument can be used to set index values and ACLs, but it will not contain any information about the document.
    • Method Detail

      • getIndexProperties

        public ResultProperties getIndexProperties()
        Returns the document's index-properties or null, if the document was not yet archived.
        Returns:
        index properties or null
      • getVariables

        public java.util.Map<java.lang.String,​DocumentVariable> getVariables()
        Returns the variables contained in the document.
        Returns:
        document variables
      • addAcl

        public void addAcl​(java.lang.String aclName)
        Adds an ACL to the document. These ACLs will be added to the document when it is saved.
        Parameters:
        aclName - the name of the ACL to add
      • removeAcl

        public void removeAcl​(java.lang.String aclName)
        Removes an ACL that was added by addAcl(String) before.
        Parameters:
        aclName - the name of the ACL to remove
      • getAcls

        public java.util.Set<java.lang.String> getAcls()
        Returns the ACLs that were added by addAcl(String). Note that this method does not return the ACLs that were already added to the document in the archive.
        Returns:
        Set of ACL names
      • isArchived

        public boolean isArchived()
        Returns:
        true if the document is already archived (= has meta-data)
      • getComment

        public java.lang.String getComment()
        Returns:
        comment for the new revision
      • setComment

        public void setComment​(java.lang.String comment)
        Allows to set a comment to use for the new revision. The user will not be asked to enter a comment if this is != null.
        Parameters:
        comment - comment to use for the new revision
      • addIndexValue

        public void addIndexValue​(java.lang.String fieldName,
                                  java.lang.Object value)
        Adds an index-value to the document. The value will oberwrite a value defined in the field of the mask corresponding to the fieldName.
        Parameters:
        fieldName - the name of the field
        value - the value of the property (must match the field-type)
      • removeIndexValue

        public void removeIndexValue​(java.lang.String fieldName)
        Removes a value previously added by addIndexValue(String, Object).
        Parameters:
        fieldName - name of the value's field
      • getIndexValues

        public java.util.Map<java.lang.String,​java.lang.Object> getIndexValues()
        Returns:
        index values set by script
      • setVariable

        public void setVariable​(DocumentVariable variable)
        Sets a new variable. This method is meant to be called from a script. Variables set using this method will overwrite values that were changed by the user in the mask.
        Parameters:
        variable - the DocumentVariable to set
      • isVariablesChanged

        public boolean isVariablesChanged()
        Returns:
        true if variables were changed