Package com.saperion.ngc.model.document
Class DocumentId
java.lang.Object
com.saperion.ngc.model.document.DocumentId
- All Implemented Interfaces:
Serializable
Identifies a document on the backend system. By convention either object ID or revision ID must
be set. The element-number is contained to specify which element to show in a viewer. It is ignored
in the equals- and hashCode-methods.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentId
(String objectId, String ddcName) Creates a new DocumentId.DocumentId
(String objectId, String revisionId, String ddcName) Creates a new DocumentId.DocumentId
(String objectId, String revisionId, String ddcName, int elementId) Creates a new DocumentId. -
Method Summary
Modifier and TypeMethodDescriptionConverts to a list of object id's./**Converts to a list of revision id's.boolean
Returns true if the IDs identify the same document.static DocumentId
fromString
(String idAsString) Creates a new DocumentId based on the specified string.int
int
hashCode()
Generates a hash code for the ID.boolean
void
setAttachment
(boolean isAttachment) toString()
Returns a string representing this DocumentId.
-
Constructor Details
-
DocumentId
Creates a new DocumentId.- Parameters:
objectId
- object ID of the document. This corresponds with the SysRowId.ddcName
- ddc name
-
DocumentId
Creates a new DocumentId.- Parameters:
objectId
- object ID of the document. This corresponds with the SysRowId.revisionId
- revision ID of the document. This corresponds with the HDOC.ddcName
- ddc name
-
DocumentId
Creates a new DocumentId.- Parameters:
objectId
- object ID of the document. This corresponds with the SysRowId.revisionId
- revision ID of the document. This corresponds with the HDOC.ddcName
- ddc nameelementId
- element ID. Used only for structured documents to identify the page.
-
-
Method Details
-
getElementId
public int getElementId()- Returns:
- element ID. Used only for structured documents to identify the page. -1 for everything else.
-
getObjectId
- Returns:
- object ID of the document or null if not available. This corresponds with the SysRowId.
-
getRevisionId
- Returns:
- revision ID of the document or null if not available. This corresponds with the HDOC.
-
getDdcName
- Returns:
- DDC name or null if not set.
-
convertToObjectIdList
Converts to a list of object id's.- Parameters:
list
- Input- Returns:
- List of object id's
-
convertToRevisionIdList
/**Converts to a list of revision id's.- Parameters:
list
- Input- Returns:
- List of revision id's
-
equals
Returns true if the IDs identify the same document. Revision IDs are compared only if present in both objects. -
hashCode
public int hashCode()Generates a hash code for the ID. The hash code is based on a string with the format ddcName|SysRowId|HDoc. -
toString
Returns a string representing this DocumentId. Format: DDC|ObjectId|RevisionId|Element. -
fromString
Creates a new DocumentId based on the specified string. The format of the string is expected to be exactly like it is created by the toString method.- Parameters:
idAsString
- string representation of the ID- Returns:
- DocumentId instance
- See Also:
-
isAttachment
public boolean isAttachment()- Returns:
- true if this document ID identifies an attachment of a workflow task
-
setAttachment
public void setAttachment(boolean isAttachment) - Parameters:
isAttachment
- set to true if this ID identifies an attachment of a workflow task
-