org.opencms.db
Class CmsPublishedResource

java.lang.Object
  extended byorg.opencms.db.CmsPublishedResource
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class CmsPublishedResource
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

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
Version:
$Revision: 1.31 $
Author:
Thomas Weckert
See Also:
I_CmsProjectDriver.readPublishedResources(CmsDbContext, int, CmsUUID), Serialized Form

Constructor Summary
CmsPublishedResource(CmsResource resource)
          Creates an object for published VFS resources.
CmsPublishedResource(CmsResource resource, int backupTagId)
          Creates an object for published VFS resources.
CmsPublishedResource(CmsUUID structureId, CmsUUID resourceId, int backupTagId, java.lang.String rootPath, int resourceType, boolean isFolder, int resourceState, int siblingCount)
          Creates an object for published VFS resources.
 
Method Summary
 int compareTo(java.lang.Object obj)
           
 boolean equals(java.lang.Object obj)
           
protected  void finalize()
           
 int getBackupTagId()
          Returns the backup tag ID of the published resource.
 CmsUUID getResourceId()
          Returns the resource ID of the published resource.
 java.lang.String getRootPath()
          Returns the root path of the published resource.
 int getSiblingCount()
          Returns the count of siblings of the published resource.
 int getState()
          Returns the resource state of the published resource.
 CmsUUID getStructureId()
          Returns the structure ID of the published resource.
 int getType()
          Returns the resource type of the published resource.
 int hashCode()
           
 boolean isChanged()
          Checks if the resource is changed.
 boolean isDeleted()
          Checks if the resource is deleted.
 boolean isFile()
          Determines if this resource is a file.
 boolean isFolder()
          Checks if this resource is a folder.
 boolean isNew()
          Checks if the resource is new.
 boolean isUnChanged()
          Checks if the resource is unchanged.
 boolean isVfsResource()
          Checks if this published resource represents a VFS resource.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmsPublishedResource

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

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

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

CmsPublishedResource

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

Parameters:
resource - an CmsResource object to create a CmsPublishedResource from
backupTagId - the backup tag id

CmsPublishedResource

public CmsPublishedResource(CmsUUID structureId,
                            CmsUUID resourceId,
                            int backupTagId,
                            java.lang.String rootPath,
                            int resourceType,
                            boolean isFolder,
                            int 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
backupTagId - the resource's tag ID in the backup tables
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 Detail

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

getBackupTagId

public int getBackupTagId()
Returns the backup tag ID of the published resource.

Returns:
the backup tag ID of the published resource

getResourceId

public CmsUUID getResourceId()
Returns the resource ID of the published resource.

Returns:
the resource ID of the published resource

getRootPath

public java.lang.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

public int getState()
Returns the resource state of the published resource.

Returns:
the resource state of the published resource

getStructureId

public CmsUUID 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()
See Also:
Object.hashCode()

isChanged

public boolean isChanged()
Checks if the resource is changed.

Returns:
true if the resource is changed

isDeleted

public boolean isDeleted()
Checks if the resource is deleted.

Returns:
true if the resource is deleted

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

isNew

public boolean isNew()
Checks if the resource is new.

Returns:
true if the resource is new

isUnChanged

public boolean isUnChanged()
Checks if the resource is unchanged.

Returns:
true if the resource is unchanged

isVfsResource

public boolean isVfsResource()
Checks if this published resource represents a VFS resource.

If the published resource has no structure id, it is considered to be no VFS resource.

Returns:
true if this published resource is a VFS resource

toString

public java.lang.String toString()
See Also:
Object.toString()

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable
See Also:
Object.finalize()