Package org.opencms.db
Class CmsPublishedResource
java.lang.Object
org.opencms.db.CmsPublishedResource
- All Implemented Interfaces:
Serializable
,Comparable<CmsPublishedResource>
public class CmsPublishedResource
extends Object
implements 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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Add new resource states under consideration of the move operation. -
Field Summary
Modifier and TypeFieldDescriptionstatic final CmsPublishedResource.CmsPublishedResourceState
Additional state for moved resources, the (new) destination of the moved resource.static final CmsPublishedResource.CmsPublishedResourceState
Additional state for moved resources, the (deleted) source of the moved resource. -
Constructor Summary
ConstructorDescriptionCmsPublishedResource
(CmsResource resource) Creates an object for published VFS resources.CmsPublishedResource
(CmsResource resource, int publishTag) Creates an object for published VFS resources.CmsPublishedResource
(CmsResource resource, int publishTag, CmsResourceState state) Creates an object for published VFS resources.CmsPublishedResource
(CmsUUID structureId, CmsUUID resourceId, int publishTag, String rootPath, int resourceType, boolean isFolder, CmsResourceState resourceState, int siblingCount) Creates an object for published VFS resources. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Returns the resource state including move operation information.int
Returns the publish tag of the published resource.Returns the resource ID of the published resource.Returns the root path of the published resource.int
Returns the count of siblings of the published resource.getState()
Returns the resource state of the published resource.Returns the structure ID of the published resource.int
getType()
Returns the resource type of the published resource.int
hashCode()
boolean
isFile()
Determines if this resource is a file.boolean
isFolder()
Checks if this resource is a folder.boolean
isMoved()
Returnstrue
if the resource has been moved.void
setState
(CmsResourceState state) Sets the resource state of the published resource.toString()
-
Field Details
-
STATE_MOVED_DESTINATION
Additional state for moved resources, the (new) destination of the moved resource. -
STATE_MOVED_SOURCE
Additional state for moved resources, the (deleted) source of the moved resource.
-
-
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
Creates an object for published VFS resources.- Parameters:
resource
- an CmsResource object to create a CmsPublishedResource frompublishTag
- the publish Tag
-
CmsPublishedResource
Creates an object for published VFS resources.- Parameters:
resource
- an CmsResource object to create a CmsPublishedResource fromstate
- the resource statepublishTag
- 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 resourceresourceId
- the resource ID of the published resourcepublishTag
- the publish tagrootPath
- the root path of the published resourceresourceType
- the type of the published resourceisFolder
- indicates if the published resource is a folder or a fileresourceState
- the state of the resource *before* it was publishedsiblingCount
- count of siblings of the published resource
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CmsPublishedResource>
- See Also:
-
equals
-
getMovedState
Returns the resource state including move operation information.- Returns:
- the resource state including move operation information
-
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
Returns the root path of the published resource.- Returns:
- the root path of the published resource
-
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 hasn
siblings, the sibling count isn + 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
Returns the resource type of the published resource.- Returns:
- the resource type of the published resource
-
hashCode
-
isFile
Determines if this resource is a file.- Returns:
- true if this resource is a file, false otherwise
-
isFolder
Checks if this resource is a folder.- Returns:
- true if this is is a folder
-
isMoved
Returnstrue
if the resource has been moved.- Returns:
true
if the resource has been moved
-
setState
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
-