Package com.saperion.ngc.iform
Class IndexMaskDocument
- java.lang.Object
-
- com.saperion.ngc.iform.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexMaskDocument.AclWriteMode
Possible ways of storing ACLs when the document is saved.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAcl(java.lang.String aclName)
Adds an ACL to the document.void
addIndexValue(java.lang.String fieldName, java.lang.Object value)
Adds an index-value to the document.java.util.Set<java.lang.String>
getAcls()
Returns the ACLs that were added byaddAcl(String)
.IndexMaskDocument.AclWriteMode
getAclWriteMode()
java.lang.String
getComment()
DocumentId
getDocumentId()
Returns the ID of the document if the document was already archived.ResultProperties
getIndexProperties()
Returns the document's index-properties or null, if the document was not yet archived.java.util.Map<java.lang.String,java.lang.Object>
getIndexValues()
java.util.Map<java.lang.String,DocumentVariable>
getVariables()
Returns the variables contained in the document.boolean
isArchived()
boolean
isVariablesChanged()
void
removeAcl(java.lang.String aclName)
Removes an ACL that was added byaddAcl(String)
before.void
removeIndexValue(java.lang.String fieldName)
Removes a value previously added byaddIndexValue(String, Object)
.void
setAclWriteMode(IndexMaskDocument.AclWriteMode mode)
Sets how to store the ACLs on the document.void
setComment(java.lang.String comment)
Allows to set a comment to use for the new revision.void
setVariable(DocumentVariable variable)
Sets a new variable.
-
-
-
Method Detail
-
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 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 byaddAcl(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 byaddAcl(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 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 fieldvalue
- the value of the property (must match the field-type)
-
removeIndexValue
public void removeIndexValue(java.lang.String fieldName)
Removes a value previously added byaddIndexValue(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
- theDocumentVariable
to set
-
isVariablesChanged
public boolean isVariablesChanged()
- Returns:
- true if variables were changed
-
-