public class CmsPublishList
extends java.lang.Object
implements java.io.Externalizable
Only classes inside the org.opencms.db package can add or remove elements to or from this list. This allows the OpenCms API to pass the list around between classes, but with restricted access to create this list.
To create a publish list, one of the public constructors must be used in order to set the basic operation mode
(project publish or direct publish).
After this, use
to fill the actual values of the publish list.CmsDriverManager.fillPublishList(CmsDbContext, CmsPublishList)
CmsDriverManager.fillPublishList(CmsDbContext, CmsPublishList)
,
序列化表格构造器和说明 |
---|
CmsPublishList()
Empty constructor.
|
CmsPublishList(boolean all,
java.util.List<CmsResource> directPublishResources,
boolean directPublishSiblings)
Constructs a publish list for a list of direct publish resources.
|
CmsPublishList(CmsProject project)
Constructs a publish list for a given project.
|
CmsPublishList(CmsResource directPublishResource,
boolean publishSiblings)
Constructs a publish list for a single direct publish resource.
|
CmsPublishList(java.util.List<CmsResource> directPublishResources,
boolean publishSiblings)
Constructs a publish list for a list of direct publish resources.
|
CmsPublishList(java.util.List<CmsResource> directPublishResources,
boolean publishSiblings,
boolean publishSubResources)
Constructs a publish list for a list of direct publish resources.
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
add(CmsResource resource,
boolean check)
Adds a new/changed Cms folder resource to the publish list.
|
protected void |
addAll(java.util.Collection<CmsResource> resources,
boolean check)
Appends all the given resources to this publish list.
|
protected CmsResource |
checkContainsSubResources(CmsObject cms,
java.util.List<CmsResource> folders)
Checks whether the publish list contains all sub-resources of a list of folders.
|
protected boolean |
containsResource(CmsResource res)
Checks if the publish list contains a resource.
|
protected boolean |
containsSubResources(CmsObject cms,
CmsResource folder)
Checks if the publish list contains all sub-resources of a given folder.
|
java.util.List<CmsResource> |
getAllResources()
Returns a list of all resources in the publish list,
including folders and files.
|
java.util.List<CmsResource> |
getDeletedFolderList()
Returns a list of folder resources with the deleted state.
|
java.util.List<CmsResource> |
getDirectPublishResources()
Returns the list of resources that should be published for a "direct" publish operation.
|
java.util.List<CmsResource> |
getFileList()
Returns an unmodifiable list of the files in this publish list.
|
java.util.List<CmsResource> |
getFolderList()
Returns an unmodifiable list of the new/changed folders in this publish list.
|
protected java.util.List<CmsResource> |
getMissingSubResources(CmsObject cms,
java.util.List<CmsResource> folders)
Gets the sub-resources of a list of folders which are missing from the publish list.
|
protected java.util.List<CmsResource> |
getMovedFolders(CmsObject cms)
Internal method to get the moved folders from the publish list.
|
CmsUUID |
getProjectId()
Returns the id of the project that should be published, or
-1 if this publish list
is initialized for a "direct publish" operation. |
CmsUUID |
getPublishHistoryId()
Returns the publish history Id for this publish list.
|
protected java.util.List<CmsResource> |
getTopFolders(java.util.List<CmsResource> folders)
Gives the "roots" of a list of folders, i.e. the list of folders which are not descendants of any other folders in the original list
|
java.util.List<CmsResource> |
getTopMovedFolders(CmsObject cms)
Gets the list of moved folders which are not subfolders of other moved folders in the 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 is used for a "direct publish" operation.
|
boolean |
isPublishSiblings()
Returns
true if all siblings of the project resources are to be published. |
boolean |
isPublishSubResources()
Returns
true if sub-resources in folders should be published (for direct publish only). |
boolean |
isUserPublishList()
Returns true if this is a user publish list.
|
void |
readExternal(java.io.ObjectInput in) |
protected boolean |
remove(CmsResource resource)
Removes a Cms resource from the publish list.
|
void |
revive(CmsObject cms)
Revives the publish list by populating the internal resource lists with
instances. |
void |
setUserPublishList(boolean isUserPublishList)
Sets the 'user publish list' flag on this publish list.
|
int |
size()
Returns the number of all resources to be published.
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
public CmsPublishList()
public CmsPublishList(boolean all, java.util.List<CmsResource> directPublishResources, boolean directPublishSiblings)
all
- no redundant resource are filtered outdirectPublishResources
- a list of CmsResource
instances to be published directlydirectPublishSiblings
- indicates if all siblings of the selected resources should be publishedpublic CmsPublishList(CmsProject project)
project
- the project to publish, this should always be the id of the current projectpublic CmsPublishList(CmsResource directPublishResource, boolean publishSiblings)
directPublishResource
- a VFS resource to be published directlypublishSiblings
- indicates if all siblings of the selected resources should be publishedpublic CmsPublishList(java.util.List<CmsResource> directPublishResources, boolean publishSiblings)
directPublishResources
- a list of CmsResource
instances to be published directlypublishSiblings
- indicates if all siblings of the selected resources should be publishedpublic CmsPublishList(java.util.List<CmsResource> directPublishResources, boolean publishSiblings, boolean publishSubResources)
directPublishResources
- a list of CmsResource
instances to be published directlypublishSiblings
- indicates if all siblings of the selected resources should be publishedpublishSubResources
- indicates if sub-resources in folders should be published (for direct publish only)public java.util.List<CmsResource> getAllResources()
CmsResource
objectspublic java.util.List<CmsResource> getDeletedFolderList()
public java.util.List<CmsResource> getDirectPublishResources()
Will return null
if this publish list was not initialized for a "direct publish" but
for a project publish.
null
public java.util.List<CmsResource> getFileList()
public java.util.List<CmsResource> getFolderList()
public CmsUUID getProjectId()
-1
if this publish list
is initialized for a "direct publish" operation.-1
public CmsUUID getPublishHistoryId()
public java.util.List<CmsResource> getTopMovedFolders(CmsObject cms) throws CmsException
cms
- the current cms contextCmsException
- if something goes wrongpublic boolean isDirectPublish()
public boolean isPublishSiblings()
true
if all siblings of the project resources are to be published.true
if all siblings of the project resources are to be publishedspublic boolean isPublishSubResources()
true
if sub-resources in folders should be published (for direct publish only).true
if sub-resources in folders should be published (for direct publish only)public boolean isUserPublishList()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
在接口中 java.io.Externalizable
java.io.IOException
Externalizable.readExternal(java.io.ObjectInput)
public void revive(CmsObject cms)
CmsResource
instances.cms
- a cms object used to read the resource instancespublic void setUserPublishList(boolean isUserPublishList)
isUserPublishList
- if true, the list is marked as a user publish listpublic int size()
public java.lang.String toString()
toString
在类中 java.lang.Object
Object.toString()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
在接口中 java.io.Externalizable
java.io.IOException
Externalizable.writeExternal(java.io.ObjectOutput)
protected void add(CmsResource resource, boolean check) throws java.lang.IllegalArgumentException
resource
- a new/changed Cms folder resourcecheck
- if set an exception is thrown if the specified resource is unchanged,
if not set the resource is ignoredjava.lang.IllegalArgumentException
- if the specified resource is unchangedprotected void addAll(java.util.Collection<CmsResource> resources, boolean check) throws java.lang.IllegalArgumentException
resources
- resources to be added to this publish listcheck
- if set an exception is thrown if the a resource is unchanged,
if not set the resource is ignoredjava.lang.IllegalArgumentException
- if one of the resources is unchangedprotected CmsResource checkContainsSubResources(CmsObject cms, java.util.List<CmsResource> folders) throws CmsException
cms
- the current CMS contextfolders
- the folders which should be checkedCmsException
- if something goes wrongprotected boolean containsResource(CmsResource res)
res
- the resourceprotected boolean containsSubResources(CmsObject cms, CmsResource folder) throws CmsException
cms
- the current CMS contextfolder
- the folder for which the check should be performedCmsException
- if something goes wrongprotected java.util.List<CmsResource> getMissingSubResources(CmsObject cms, java.util.List<CmsResource> folders) throws CmsException
cms
- the current CMS contextfolders
- the folders which should be checkedCmsException
- if something goes wrongprotected java.util.List<CmsResource> getMovedFolders(CmsObject cms) throws CmsException
cms
- the current CMS contextCmsException
- if something goes wrongprotected java.util.List<CmsResource> getTopFolders(java.util.List<CmsResource> folders)
folders
- the original list of foldersprotected void initialize()
protected boolean remove(CmsResource resource)
resource
- a Cms resourceList.remove(java.lang.Object)