org.opencms.db
Class CmsPublishList

java.lang.Object
  extended byorg.opencms.db.CmsPublishList

public class CmsPublishList
extends Object

A container for all new/changed/deteled Cms resources of a project or a direct published resource (and optionally it's siblings) that actually get published.

Only classes inside the org.opencms.db package can add or remove elements to or from this list. This allows the Cms app to pass the list around between classes, but with restricted access to create this list.

CmsDriverManager.getPublishList(CmsDbContext, CmsResource, boolean) creates Cms publish lists.

Since:
6.0.0
Version:
$Revision: 1.24 $
Author:
Thomas Weckert
See Also:
CmsDriverManager.getPublishList(CmsDbContext, CmsResource, boolean)

Constructor Summary
CmsPublishList()
          Constructs an empty publish list for the resources of a project to be published.
CmsPublishList(CmsResource directPublishResource)
          Constructs an empty publish list with additional information for a direct published resource.
 
Method Summary
protected  void addFile(CmsResource resource)
          Adds a new/changed/deleted Cms file resource to the publish list.
protected  void addFiles(List list)
          Appends all of the new/changed/deleted Cms file resources in the specified list to the end of this publish list.
protected  void addFolder(CmsResource resource)
          Adds a new/changed Cms folder resource to the publish list.
protected  void addFolders(List list)
          Appends all of the new/changed Cms folder resources in the specified list to the end of this publish list.
protected  void finalize()
           
 List getDeletedFolderList()
          Returns a list of folder resources with the given state.
 CmsResource getDirectPublishResource()
          Returns the resource that should be published or null.
 List getFileList()
          Returns an unmodifiable list of the Cms file resources in this publish list.
 List getFolderList()
          Returns an unmodifiable list of the new/changed Cms folder resources in this publish list.
protected  List getFolderListInstance()
          Returns the list with the new/changed Cms folder resources.
 CmsUUID getPublishHistoryId()
          Returns the publish history Id for this publish list.
protected  void initialize()
          Initializes the publish list, ensuring all internal lists are in the right order.
 boolean isDirectPublish()
          Checks if this is a publish list for a direct published file *OR* folder.
 boolean isDirectPublishFile()
          Checks if this is a publish list for a direct published file.
protected  boolean remove(CmsResource resource)
          Removes a Cms resource from the publish list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmsPublishList

public CmsPublishList()
Constructs an empty publish list for the resources of a project to be published.


CmsPublishList

public CmsPublishList(CmsResource directPublishResource)
Constructs an empty publish list with additional information for a direct published resource.

Parameters:
directPublishResource - a Cms resource to be published directly
Method Detail

getDeletedFolderList

public List getDeletedFolderList()
Returns a list of folder resources with the given state.

Returns:
a list of folder resources with the desired state

getDirectPublishResource

public CmsResource getDirectPublishResource()
Returns the resource that should be published or null.

Returns:
the resource that should be published or null

getFileList

public List getFileList()
Returns an unmodifiable list of the Cms file resources in this publish list.

Returns:
the list with the Cms file resources in this publish list

getFolderList

public List getFolderList()
Returns an unmodifiable list of the new/changed Cms folder resources in this publish list.

Returns:
the list with the new/changed Cms file resources in this publish list

getPublishHistoryId

public CmsUUID getPublishHistoryId()
Returns the publish history Id for this publish list.

Returns:
the publish history Id

isDirectPublish

public boolean isDirectPublish()
Checks if this is a publish list for a direct published file *OR* folder.

Returns:
true if this is a publish list for a direct published file *OR* folder
See Also:
isDirectPublishFile()

isDirectPublishFile

public boolean isDirectPublishFile()
Checks if this is a publish list for a direct published file.

Returns:
true if this is a publish list for a direct published file
See Also:
isDirectPublish()

toString

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

addFile

protected void addFile(CmsResource resource)
                throws CmsIllegalArgumentException
Adds a new/changed/deleted Cms file resource to the publish list.

Parameters:
resource - a new/changed/deleted Cms file resource
Throws:
CmsIllegalArgumentException - if the specified resource is not a file or unchanged

addFiles

protected void addFiles(List list)
                 throws IllegalArgumentException
Appends all of the new/changed/deleted Cms file resources in the specified list to the end of this publish list.

Parameters:
list - a list with new/changed/deleted Cms file resources to be added to this publish list
Throws:
IllegalArgumentException - if one of the resources is not a file or unchanged

addFolder

protected void addFolder(CmsResource resource)
                  throws IllegalArgumentException
Adds a new/changed Cms folder resource to the publish list.

Parameters:
resource - a new/changed Cms folder resource
Throws:
IllegalArgumentException - if the specified resource is not a folder or unchanged

addFolders

protected void addFolders(List list)
                   throws IllegalArgumentException
Appends all of the new/changed Cms folder resources in the specified list to the end of this publish list.

Parameters:
list - a list with new/changed Cms folder resources to be added to this publish list
Throws:
IllegalArgumentException - if one of the resources is not a folder or unchanged

finalize

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

getFolderListInstance

protected List getFolderListInstance()
Returns the list with the new/changed Cms folder resources.

Returns:
the list with the new/changed Cms folder resources

initialize

protected void initialize()
Initializes the publish list, ensuring all internal lists are in the right order.


remove

protected boolean remove(CmsResource resource)
Removes a Cms resource from the publish list.

Parameters:
resource - a Cms resource
Returns:
true if this publish list contains the specified resource
See Also:
List.remove(java.lang.Object)