Package com.saperion.ngc.iform
Class IndexMaskDocument
java.lang.Object
com.saperion.ngc.iform.IndexMaskDocument
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 ClassesModifier and TypeClassDescriptionstatic enum
Possible ways of storing ACLs when the document is saved. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an ACL to the document.void
addIndexValue
(String fieldName, Object value) Adds an index-value to the document.getAcls()
Returns the ACLs that were added byaddAcl(String)
.Returns the ID of the document if the document was already archived.Returns the document's index-properties or null, if the document was not yet archived.Returns the variables contained in the document.boolean
boolean
void
Removes an ACL that was added byaddAcl(String)
before.void
removeIndexValue
(String fieldName) Removes a value previously added byaddIndexValue(String, Object)
.void
Sets how to store the ACLs on the document.void
setComment
(String comment) Allows to set a comment to use for the new revision.void
setVariable
(DocumentVariable variable) Sets a new variable.
-
Method Details
-
getDocumentId
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
Returns the document's index-properties or null, if the document was not yet archived.- Returns:
- index properties or null
-
getVariables
Returns the variables contained in the document.- Returns:
- document variables
-
addAcl
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
Removes an ACL that was added byaddAcl(String)
before.- Parameters:
aclName
- the name of the ACL to remove
-
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
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
- 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
- Returns:
- comment for the new revision
-
setComment
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
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
Removes a value previously added byaddIndexValue(String, Object)
.- Parameters:
fieldName
- name of the value's field
-
getIndexValues
- Returns:
- index values set by script
-
setVariable
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
-