Class PageSegmentHandle

java.lang.Object
com.levigo.jadice.web.shared.model.PageSegmentHandle
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ClassPathWithRenderControlsHandle, CompositeHandle, PasswordContainingPageSegmentHandle, ServerBasedDnDHandle

public abstract class PageSegmentHandle extends Object implements Serializable
A handle to identify and recover a PageSegment on the server. The PageSegmentHandle instances are created by a DocumentDataProvider on the server side. They are passed from server to client and from client to server whenever document related operations are involved.
See Also:
  • Constructor Details

    • PageSegmentHandle

      public PageSegmentHandle()
  • Method Details

    • init

      public void init(String documentLayer, int pageIndex, String pageSegmentUUID)
      Provide the PageSegmentHandle with its payload data to uniquely identify it.
      Parameters:
      documentLayer - The layer this PageSegment is associated with
      pageIndex - The index of the page. Regardless of whether this is a "standard" or a composite document this is always the absolute page index relative to page 0 of the very first document.
      pageSegmentUUID - The unique key of this PageSegment
    • getDocumentLayer

      public String getDocumentLayer()
      Gets the DocumentLayer of this PageSegment.
      Returns:
      The name of the document layer, as in DocumentLayer.getName().
    • setDocumentLayer

      public void setDocumentLayer(String documentLayer)
      Associates the handle with a DocumentLayer, represented by its name. See DocumentLayer.DEFAULT, DocumentLayer.ANNOTATIONS, DocumentLayer.EMBEDDED_ANNOTATIONS.
      Parameters:
      documentLayer - The name of the document layer, as in DocumentLayer.getName().
    • getPageIndex

      public int getPageIndex()
      Gets the index of the page containing the PageSegment.
      Returns:
      The 0-based page index of this PageSegment.
    • setPageIndex

      public void setPageIndex(int pageIndex)
      Sets the index of the page containing the PageSegment.
      Parameters:
      pageIndex - The 0-based page index of this PageSegment.
    • getPageSegmentUUID

      public String getPageSegmentUUID()
      Gets the UUID for caching the PageSegment.
      Returns:
      pageSegmentUUID The page segment's unique identifier.
    • setPageSegmentUUID

      public void setPageSegmentUUID(String pageSegmentUUID)
      Sets the UUID for caching the PageSegment.
      Parameters:
      pageSegmentUUID - The page segment's unique identifier.
    • getIdentifier

      public abstract String getIdentifier()
      Creates a "DocumentID" to be able to cache the Jadice document on recovering. NOTE: The Identifier represents the ID of the Document, not the PageSegment!
      Returns:
      The unique DocumentID of the document associated with this PageSegment.
    • copy

      public abstract PageSegmentHandle copy()
    • copyTo

      protected void copyTo(PageSegmentHandle handle)
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object