Class CmsProject

java.lang.Object
org.opencms.file.CmsProject
All Implemented Interfaces:
Serializable, Cloneable, Comparable<CmsProject>
Direct Known Subclasses:
CmsHistoryProject

public class CmsProject extends Object implements Cloneable, Comparable<CmsProject>, 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:
  • Field Details

  • 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 project
      projectFqn - the name for this project
      description - the description for this project
      ownerId - the owner id for this project
      groupId - the group id for this project
      managerGroupId - the manager group id for this project
      flags - the flags for this project
      dateCreated - the creation date of this project
      type - the type of this project
  • Method Details

    • checkProjectName

      public static void checkProjectName(String name)
      Throws a runtime exception if name is empty.

      Parameters:
      name - the project name to check
    • isInsideProject

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

      Parameters:
      projectResources - a List of project resources as Strings
      resource - the resource to check
      Returns:
      true, if the resource is "inside" the project resources
    • isInsideProject

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

      Parameters:
      projectResources - a List of project resources as Strings
      resourcename - 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 Object clone()
      Overrides:
      clone in class Object
      See Also:
    • compareTo

      public int compareTo(CmsProject o)
      Compares this instance to another given object instance of this class .

      Specified by:
      compareTo in interface Comparable<CmsProject>
      Parameters:
      o - the other given object instance to compare with
      Returns:
      integer value for sorting the objects
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • getDateCreated

      public long 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

      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
    • getId

      public CmsUUID 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

      public String getName()
      Returns the name of this project.

      Returns:
      the name of this project
    • getOuFqn

      public 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

      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

      public CmsUUID getUuid()
      Returns the id of this project.

      Returns:
      the id of this project
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • isDeleteAfterPublishing

      public boolean isDeleteAfterPublishing()
      Returns the delete After Publishing flag.

      Returns:
      the delete After Publishing flag
      See Also:
    • isHidden

      public boolean isHidden()
      Returns the 'hidden' flag.

      Returns:
      the 'hidden' flag
      See Also:
    • 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()
      Returns true if this project is the Online project.

      Returns:
      true if 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(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(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 String toString()
      Overrides:
      toString in class Object
      See Also: