Class IndexMaskDocument

java.lang.Object
com.saperion.ngc.iform.IndexMaskDocument

public class IndexMaskDocument extends 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 Details

    • getDocumentId

      public DocumentId getDocumentId() throws DocumentIdentificationException
      Returns the ID of the document if the document was already archived.
      Returns:
      the document's ID
      Throws:
      DocumentIdentificationException - if the document was not yet archived
    • 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 Map<String,DocumentVariable> getVariables()
      Returns the variables contained in the document.
      Returns:
      document variables
    • addAcl

      public void addAcl(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(String aclName)
      Removes an ACL that was added by addAcl(String) before.
      Parameters:
      aclName - the name of the ACL to remove
    • getAcls

      public Set<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
    • setAclWriteMode

      public void setAclWriteMode(IndexMaskDocument.AclWriteMode mode)
      Sets how to store the ACLs on the document. By default, new ACLs will be added to the existing ones on the document.
      Parameters:
      mode - IndexMaskDocument.AclWriteMode to use
    • getAclWriteMode

      public IndexMaskDocument.AclWriteMode getAclWriteMode()
      Returns:
      the way how ACLs will be added to the document
    • isArchived

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

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

      public void setComment(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(String fieldName, 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(String fieldName)
      Removes a value previously added by addIndexValue(String, Object).
      Parameters:
      fieldName - name of the value's field
    • getIndexValues

      public Map<String,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