Package org.opencms.file
Class CmsProject
- java.lang.Object
-
- org.opencms.file.CmsProject
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<CmsProject>
- Direct Known Subclasses:
CmsHistoryProject
public class CmsProject extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<CmsProject>, java.io.Serializable
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCmsProject.CmsProjectTypeEnumeration class for project types.
-
Field Summary
Fields Modifier and Type Field Description static CmsUUIDONLINE_PROJECT_IDThe id of the online project.static java.lang.StringONLINE_PROJECT_NAMEThe name of the online project.static intPROJECT_FLAG_HIDDENIndicates that a project is invisible in the workplace.static intPROJECT_FLAG_NONEIndicates that a normal project.static intPROJECT_HIDDEN_IN_SELECTORIndicates that a project should be hidden from the workplace project selector, but should otherwise behave the same as normal projects.static CmsProject.CmsProjectTypePROJECT_TYPE_NORMALIndicates a normal project.static CmsProject.CmsProjectTypePROJECT_TYPE_TEMPORARYIndicates a temporary project that is deleted after it is published.static CmsProject.CmsProjectTypePROJECT_TYPE_WORKFLOWThe project type for a workflow project.
-
Constructor Summary
Constructors Constructor Description CmsProject()Default constructor for gui usage.CmsProject(CmsUUID projectId, java.lang.String projectFqn, java.lang.String description, CmsUUID ownerId, CmsUUID groupId, CmsUUID managerGroupId, int flags, long dateCreated, CmsProject.CmsProjectType type)Creates a new CmsProject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckProjectName(java.lang.String name)Throws a runtime exception if name is empty.java.lang.Objectclone()intcompareTo(CmsProject o)Compares this instance to another given object instance of this class .booleanequals(java.lang.Object obj)longgetDateCreated()Returns the creation date of this project.java.lang.StringgetDescription()Returns the description of this project.intgetFlags()Returns the state of this project.CmsUUIDgetGroupId()Returns the user group id of this project.CmsUUIDgetId()Returns the id of this project.CmsUUIDgetManagerGroupId()Returns the manager group id of this project.java.lang.StringgetName()Returns the name of this project.java.lang.StringgetOuFqn()Returns the fully qualified name of the associated organizational unit.CmsUUIDgetOwnerId()Returns the user id of the project owner.java.lang.StringgetSimpleName()Returns the simple name of this organizational unit.CmsProject.CmsProjectTypegetType()Returns the type of this project.CmsUUIDgetUuid()Returns the id of this project.inthashCode()booleanisDeleteAfterPublishing()Returns the delete After Publishing flag.booleanisHidden()Returns the 'hidden' flag.booleanisHiddenFromSelector()Checks if the project should be hidden from the project selector in the workplace.static booleanisInsideProject(java.util.List<java.lang.String> projectResources, java.lang.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 booleanisInsideProject(java.util.List<java.lang.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.booleanisOnlineProject()Returnstrueif this project is the Online project.static booleanisOnlineProject(CmsUUID projectId)Returns true if the given project id is the online project id.booleanisWorkflowProject()Returns true if this is a workflow project.voidsetDeleteAfterPublishing(boolean deleteAfterPublishing)Sets the delete After Publishing flag.voidsetDescription(java.lang.String description)Sets the description of this project.voidsetFlags(int flags)Sets the flags of this project.voidsetGroupId(CmsUUID id)Sets the user group id of this project.voidsetHidden(boolean value)Sets the 'hidden' flag.voidsetManagerGroupId(CmsUUID id)Sets the manager group id of this project.voidsetName(java.lang.String name)Sets the name.voidsetOwnerId(CmsUUID id)Sets the owner id of this project.java.lang.StringtoString()
-
-
-
Field Detail
-
ONLINE_PROJECT_NAME
public static final java.lang.String ONLINE_PROJECT_NAME
The name of the online project.- See Also:
- Constant Field Values
-
ONLINE_PROJECT_ID
public static final CmsUUID ONLINE_PROJECT_ID
The id of the online project.
-
PROJECT_FLAG_HIDDEN
public static final int PROJECT_FLAG_HIDDEN
Indicates that a project is invisible in the workplace.- See Also:
- Constant Field Values
-
PROJECT_FLAG_NONE
public static final int PROJECT_FLAG_NONE
Indicates that a normal project.- See Also:
- Constant Field Values
-
PROJECT_HIDDEN_IN_SELECTOR
public static final int 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:
- Constant Field Values
-
PROJECT_TYPE_NORMAL
public static final CmsProject.CmsProjectType PROJECT_TYPE_NORMAL
Indicates a normal project.
-
PROJECT_TYPE_TEMPORARY
public static final CmsProject.CmsProjectType PROJECT_TYPE_TEMPORARY
Indicates a temporary project that is deleted after it is published.
-
PROJECT_TYPE_WORKFLOW
public static final CmsProject.CmsProjectType PROJECT_TYPE_WORKFLOW
The project type for a workflow project.
-
-
Constructor Detail
-
CmsProject
public CmsProject()
Default constructor for gui usage.
-
CmsProject
public CmsProject(CmsUUID projectId, java.lang.String projectFqn, java.lang.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 Detail
-
checkProjectName
public static void checkProjectName(java.lang.String name)
Throws a runtime exception if name is empty.- Parameters:
name- the project name to check
-
isInsideProject
public static boolean isInsideProject(java.util.List<java.lang.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.- Parameters:
projectResources- a List of project resources as Stringsresource- the resource to check- Returns:
- true, if the resource is "inside" the project resources
-
isInsideProject
public static boolean isInsideProject(java.util.List<java.lang.String> projectResources, java.lang.String resourcename)
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
public static boolean isOnlineProject(CmsUUID projectId)
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
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object- See Also:
Object.clone()
-
compareTo
public int compareTo(CmsProject o)
Compares this instance to another given object instance of this class .- Specified by:
compareToin interfacejava.lang.Comparable<CmsProject>- Parameters:
o- the other given object instance to compare with- Returns:
- integer value for sorting the objects
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
getDateCreated
public long getDateCreated()
Returns the creation date of this project.- Returns:
- the creation date of this project
-
getDescription
public java.lang.String getDescription()
Returns the description of this project.- Returns:
- the description of this project
-
getFlags
public int getFlags()
Returns the state of this project.- Returns:
- the state of this project
-
getGroupId
public CmsUUID getGroupId()
Returns the user group id of this project.- Returns:
- the user group id of this project
-
getManagerGroupId
public CmsUUID getManagerGroupId()
Returns the manager group id of this project.- Returns:
- the manager group id of this project
-
getName
public java.lang.String getName()
Returns the name of this project.- Returns:
- the name of this project
-
getOuFqn
public java.lang.String getOuFqn()
Returns the fully qualified name of the associated organizational unit.- Returns:
- the fully qualified name of the associated organizational unit
-
getOwnerId
public CmsUUID getOwnerId()
Returns the user id of the project owner.- Returns:
- the user id of the project owner
-
getSimpleName
public java.lang.String getSimpleName()
Returns the simple name of this organizational unit.- Returns:
- the simple name of this organizational unit.
-
getType
public CmsProject.CmsProjectType getType()
Returns the type of this project.- Returns:
- the type of this project
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
isDeleteAfterPublishing
public boolean isDeleteAfterPublishing()
Returns the delete After Publishing flag.- Returns:
- the delete After Publishing flag
- See Also:
getType()
-
isHidden
public boolean isHidden()
Returns the 'hidden' flag.- Returns:
- the 'hidden' flag
- See Also:
getFlags()
-
isHiddenFromSelector
public boolean 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
public boolean isOnlineProject()
Returnstrueif this project is the Online project.- Returns:
trueif this project is the Online project
-
isWorkflowProject
public boolean isWorkflowProject()
Returns true if this is a workflow project.- Returns:
- true if this is a workflow project
-
setDeleteAfterPublishing
public void setDeleteAfterPublishing(boolean deleteAfterPublishing)
Sets the delete After Publishing flag.- Parameters:
deleteAfterPublishing- the delete After Publishing flag to set
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of this project.- Parameters:
description- the description to set
-
setFlags
public void setFlags(int flags)
Sets the flags of this project.- Parameters:
flags- the flag to set
-
setGroupId
public void setGroupId(CmsUUID id)
Sets the user group id of this project.- Parameters:
id- the user group id of this project
-
setHidden
public void setHidden(boolean value)
Sets the 'hidden' flag.- Parameters:
value- the value to set
-
setManagerGroupId
public void setManagerGroupId(CmsUUID id)
Sets the manager group id of this project.- Parameters:
id- the manager group id of this project
-
setName
public void setName(java.lang.String name)
Sets the name.- Parameters:
name- the name to set
-
setOwnerId
public void setOwnerId(CmsUUID id)
Sets the owner id of this project.- Parameters:
id- the id of the new owner
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-