Package org.opencms.file
Class CmsProject
java.lang.Object
org.opencms.file.CmsProject
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<CmsProject>
- Direct Known Subclasses:
CmsHistoryProject
Describes an OpenCms project,
which contains a set of VFS resources that are being worked on at the same time.
- Since:
- 6.0.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Enumeration class for project types. -
Field Summary
Modifier and TypeFieldDescriptionstatic final CmsUUID
The id of the online project.static final String
The name of the online project.static final int
Indicates that a project is invisible in the workplace.static final int
Indicates that a normal project.static final int
Indicates that a project should be hidden from the workplace project selector, but should otherwise behave the same as normal projects.static final CmsProject.CmsProjectType
Indicates a normal project.static final CmsProject.CmsProjectType
Indicates a temporary project that is deleted after it is published.static final CmsProject.CmsProjectType
The project type for a workflow project. -
Constructor Summary
ConstructorDescriptionDefault constructor for gui usage.CmsProject
(CmsUUID projectId, String projectFqn, String description, CmsUUID ownerId, CmsUUID groupId, CmsUUID managerGroupId, int flags, long dateCreated, CmsProject.CmsProjectType type) Creates a new CmsProject. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkProjectName
(String name) Throws a runtime exception if name is empty.clone()
int
Compares this instance to another given object instance of this class .boolean
long
Returns the creation date of this project.Returns the description of this project.int
getFlags()
Returns the state of this project.Returns the user group id of this project.getId()
Returns the id of this project.Returns the manager group id of this project.getName()
Returns the name of this project.getOuFqn()
Returns the fully qualified name of the associated organizational unit.Returns the user id of the project owner.Returns the simple name of this organizational unit.getType()
Returns the type of this project.getUuid()
Returns the id of this project.int
hashCode()
boolean
Returns the delete After Publishing flag.boolean
isHidden()
Returns the 'hidden' flag.boolean
Checks if the project should be hidden from the project selector in the workplace.static boolean
isInsideProject
(List<String> projectResources, String resourcename) Checks if the full resource name (including the site root) of a resource matches any of the project resources of a project.static boolean
isInsideProject
(List<String> projectResources, CmsResource resource) Checks if the full resource name (including the site root) of a resource matches any of the project resources of a project.boolean
Returnstrue
if this project is the Online project.static boolean
isOnlineProject
(CmsUUID projectId) Returns true if the given project id is the online project id.boolean
Returns true if this is a workflow project.void
setDeleteAfterPublishing
(boolean deleteAfterPublishing) Sets the delete After Publishing flag.void
setDescription
(String description) Sets the description of this project.void
setFlags
(int flags) Sets the flags of this project.void
setGroupId
(CmsUUID id) Sets the user group id of this project.void
setHidden
(boolean value) Sets the 'hidden' flag.void
Sets the manager group id of this project.void
Sets the name.void
setOwnerId
(CmsUUID id) Sets the owner id of this project.toString()
-
Field Details
-
ONLINE_PROJECT_NAME
The name of the online project.- See Also:
-
ONLINE_PROJECT_ID
The id of the online project. -
PROJECT_FLAG_HIDDEN
Indicates that a project is invisible in the workplace.- See Also:
-
PROJECT_FLAG_NONE
Indicates that a normal project.- See Also:
-
PROJECT_HIDDEN_IN_SELECTOR
Indicates that a project should be hidden from the workplace project selector, but should otherwise behave the same as normal projects.- See Also:
-
PROJECT_TYPE_NORMAL
Indicates a normal project. -
PROJECT_TYPE_TEMPORARY
Indicates a temporary project that is deleted after it is published. -
PROJECT_TYPE_WORKFLOW
The project type for a workflow project.
-
-
Constructor Details
-
CmsProject
public CmsProject()Default constructor for gui usage. -
CmsProject
public CmsProject(CmsUUID projectId, String projectFqn, String description, CmsUUID ownerId, CmsUUID groupId, CmsUUID managerGroupId, int flags, long dateCreated, CmsProject.CmsProjectType type) Creates a new CmsProject.- Parameters:
projectId
- the id to use for this projectprojectFqn
- the name for this projectdescription
- the description for this projectownerId
- the owner id for this projectgroupId
- the group id for this projectmanagerGroupId
- the manager group id for this projectflags
- the flags for this projectdateCreated
- the creation date of this projecttype
- the type of this project
-
-
Method Details
-
checkProjectName
Throws a runtime exception if name is empty.- Parameters:
name
- the project name to check
-
isInsideProject
Checks if the full resource name (including the site root) of a resource matches any of the project resources of a project.- Parameters:
projectResources
- a List of project resources as Stringsresource
- the resource to check- Returns:
- true, if the resource is "inside" the project resources
-
isInsideProject
Checks if the full resource name (including the site root) of a resource matches any of the project resources of a project.- Parameters:
projectResources
- a List of project resources as Stringsresourcename
- the resource to check- Returns:
- true, if the resource is "inside" the project resources
-
isOnlineProject
Returns true if the given project id is the online project id.- Parameters:
projectId
- the project id to check- Returns:
- true if the given project id is the online project id
-
clone
-
compareTo
Compares this instance to another given object instance of this class .- Specified by:
compareTo
in interfaceComparable<CmsProject>
- Parameters:
o
- the other given object instance to compare with- Returns:
- integer value for sorting the objects
-
equals
-
getDateCreated
Returns the creation date of this project.- Returns:
- the creation date of this project
-
getDescription
Returns the description of this project.- Returns:
- the description of this project
-
getFlags
Returns the state of this project.- Returns:
- the state of this project
-
getGroupId
Returns the user group id of this project.- Returns:
- the user group id of this project
-
getId
Returns the id of this project.- Returns:
- the id of this project
-
getManagerGroupId
Returns the manager group id of this project.- Returns:
- the manager group id of this project
-
getName
Returns the name of this project.- Returns:
- the name of this project
-
getOuFqn
Returns the fully qualified name of the associated organizational unit.- Returns:
- the fully qualified name of the associated organizational unit
-
getOwnerId
Returns the user id of the project owner.- Returns:
- the user id of the project owner
-
getSimpleName
Returns the simple name of this organizational unit.- Returns:
- the simple name of this organizational unit.
-
getType
Returns the type of this project.- Returns:
- the type of this project
-
getUuid
Returns the id of this project.- Returns:
- the id of this project
-
hashCode
-
isDeleteAfterPublishing
Returns the delete After Publishing flag.- Returns:
- the delete After Publishing flag
- See Also:
-
isHidden
Returns the 'hidden' flag.- Returns:
- the 'hidden' flag
- See Also:
-
isHiddenFromSelector
Checks if the project should be hidden from the project selector in the workplace.- Returns:
- true if the project should not appear in the workplace's project selector
-
isOnlineProject
Returnstrue
if this project is the Online project.- Returns:
true
if this project is the Online project
-
isWorkflowProject
Returns true if this is a workflow project.- Returns:
- true if this is a workflow project
-
setDeleteAfterPublishing
Sets the delete After Publishing flag.- Parameters:
deleteAfterPublishing
- the delete After Publishing flag to set
-
setDescription
Sets the description of this project.- Parameters:
description
- the description to set
-
setFlags
Sets the flags of this project.- Parameters:
flags
- the flag to set
-
setGroupId
Sets the user group id of this project.- Parameters:
id
- the user group id of this project
-
setHidden
Sets the 'hidden' flag.- Parameters:
value
- the value to set
-
setManagerGroupId
Sets the manager group id of this project.- Parameters:
id
- the manager group id of this project
-
setName
Sets the name.- Parameters:
name
- the name to set
-
setOwnerId
Sets the owner id of this project.- Parameters:
id
- the id of the new owner
-
toString
-