Class CmsPublishedResource

java.lang.Object
org.opencms.db.CmsPublishedResource
All Implemented Interfaces:
Serializable, Comparable<CmsPublishedResource>

Represents the state of a published resource *before* it got published.

This allows various subsequent tasks in the Cms app. (e.g. exporting files and folders) to identify published resources after a resource or project was published.

The values to fill this container are read from the Cms publish history database table that is written during each publishing process.

Since:
6.0.0
See Also:
  • Field Details

  • Constructor Details

    • CmsPublishedResource

      Creates an object for published VFS resources.

      Do not write objects created with this constructor to db, since the publish tag is not set.

      Parameters:
      resource - an CmsResource object to create a CmsPublishedResource from
    • CmsPublishedResource

      public CmsPublishedResource(CmsResource resource, int publishTag)
      Creates an object for published VFS resources.

      Parameters:
      resource - an CmsResource object to create a CmsPublishedResource from
      publishTag - the publish Tag
    • CmsPublishedResource

      public CmsPublishedResource(CmsResource resource, int publishTag, CmsResourceState state)
      Creates an object for published VFS resources.

      Parameters:
      resource - an CmsResource object to create a CmsPublishedResource from
      state - the resource state
      publishTag - the publish tag
    • CmsPublishedResource

      public CmsPublishedResource(CmsUUID structureId, CmsUUID resourceId, int publishTag, String rootPath, int resourceType, boolean isFolder, CmsResourceState resourceState, int siblingCount)
      Creates an object for published VFS resources.

      Parameters:
      structureId - the structure ID of the published resource
      resourceId - the resource ID of the published resource
      publishTag - the publish tag
      rootPath - the root path of the published resource
      resourceType - the type of the published resource
      isFolder - indicates if the published resource is a folder or a file
      resourceState - the state of the resource *before* it was published
      siblingCount - count of siblings of the published resource
  • Method Details

    • compareTo

      public int compareTo(CmsPublishedResource obj)
      Specified by:
      compareTo in interface Comparable<CmsPublishedResource>
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • getMovedState

      Returns the resource state including move operation information.

      Returns:
      the resource state including move operation information
    • getPublishTag

      public int getPublishTag()
      Returns the publish tag of the published resource.

      Returns:
      the publish tag of the published resource
    • getResourceId

      Returns the resource ID of the published resource.

      Returns:
      the resource ID of the published resource
    • getRootPath

      public String getRootPath()
      Returns the root path of the published resource.

      Returns:
      the root path of the published resource
    • getSiblingCount

      public int getSiblingCount()
      Returns the count of siblings of the published resource.

      If a resource has no sibling, the total sibling count for this resource is 1, if a resource has n siblings, the sibling count is n + 1.

      Returns:
      the count of siblings of the published resource
    • getState

      Returns the resource state of the published resource.

      Returns:
      the resource state of the published resource
    • getStructureId

      Returns the structure ID of the published resource.

      Returns:
      the structure ID of the published resource
    • getType

      public int getType()
      Returns the resource type of the published resource.

      Returns:
      the resource type of the published resource
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • isFile

      public boolean isFile()
      Determines if this resource is a file.

      Returns:
      true if this resource is a file, false otherwise
    • isFolder

      public boolean isFolder()
      Checks if this resource is a folder.

      Returns:
      true if this is is a folder
    • isMoved

      public boolean isMoved()
      Returns true if the resource has been moved.

      Returns:
      true if the resource has been moved
    • setState

      public void setState(CmsResourceState state)
      Sets the resource state of the published resource.

      This is sometimes required for offline search index generation.

      Parameters:
      state - the new state to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: