Class DocumentId

java.lang.Object
com.saperion.ngc.model.document.DocumentId
All Implemented Interfaces:
Serializable

public class DocumentId extends Object implements 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 Details

    • DocumentId

      public DocumentId(String objectId, String ddcName)
      Creates a new DocumentId.
      Parameters:
      objectId - object ID of the document. This corresponds with the SysRowId.
      ddcName - ddc name
    • DocumentId

      public DocumentId(String objectId, String revisionId, String ddcName)
      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

      public DocumentId(String objectId, String revisionId, String ddcName, int elementId)
      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
      elementId - 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

      public String getObjectId()
      Returns:
      object ID of the document or null if not available. This corresponds with the SysRowId.
    • getRevisionId

      public String getRevisionId()
      Returns:
      revision ID of the document or null if not available. This corresponds with the HDOC.
    • getDdcName

      public String getDdcName()
      Returns:
      DDC name or null if not set.
    • convertToObjectIdList

      public static final List<String> convertToObjectIdList(Collection<DocumentId> list)
      Converts to a list of object id's.
      Parameters:
      list - Input
      Returns:
      List of object id's
    • convertToRevisionIdList

      public static final List<String> convertToRevisionIdList(Collection<DocumentId> list)
      /**Converts to a list of revision id's.
      Parameters:
      list - Input
      Returns:
      List of revision id's
    • equals

      public boolean equals(Object obj)
      Returns true if the IDs identify the same document. Revision IDs are compared only if present in both objects.
      Overrides:
      equals in class Object
      Parameters:
      obj - other id
      Returns:
      true if IDs identify the same document
      See Also:
    • 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.
      Overrides:
      hashCode in class Object
      Returns:
      hash code
      See Also:
    • toString

      public String toString()
      Returns a string representing this DocumentId. Format: DDC|ObjectId|RevisionId|Element.
      Overrides:
      toString in class Object
      Returns:
      string representation of this DocumentId
      See Also:
    • fromString

      public static DocumentId fromString(String idAsString)
      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