org.opencms.file
Class CmsProject

java.lang.Object
  extended byorg.opencms.file.CmsProject
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
CmsBackupProject

public class CmsProject
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable

Describes an OpenCms project, which contains a set of VFS resources that are being worked on at the same time.

Since:
6.0.0
Version:
$Revision: 1.19 $
Author:
Alexander Kandzior, Michael Emmerich

Field Summary
static int ONLINE_PROJECT_ID
          The id of the online project.
static java.lang.String ONLINE_PROJECT_NAME
          The name of the online project.
static int PROJECT_STATE_INVISIBLE
          Indicates that a project is invisible in the workplace.
static int PROJECT_STATE_UNLOCKED
          Indicates an unlocked project.
static int PROJECT_TYPE_NORMAL
          Indicates a normal project.
static int PROJECT_TYPE_TEMPORARY
          Indicates a temporary project that is deleted after it is published.
 
Constructor Summary
CmsProject()
          Default constructor for gui usage.
CmsProject(int projectId, java.lang.String name, java.lang.String description, int taskId, CmsUUID ownerId, CmsUUID groupId, CmsUUID managerGroupId, int flags, long dateCreated, int type)
          Creates a new CmsProject.
CmsProject(java.sql.ResultSet res, CmsSqlManager sqlManager)
          Construct a new CmsProject from a SQL ResultSet.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this Objects instance.
 int compareTo(java.lang.Object o)
          Compares this instance to another given object instance of this class .
 boolean equals(java.lang.Object obj)
           
 long getDateCreated()
          Returns the creation date of this project.
 java.lang.String getDescription()
          Returns the description of this project.
 int getFlags()
          Returns the state of this project.
 CmsUUID getGroupId()
          Returns the user group id of this project.
 int getId()
          Returns the id of this project.
 CmsUUID getManagerGroupId()
          Returns the manager group id of this project.
 java.lang.String getName()
          Returns the name of this project.
 CmsUUID getOwnerId()
          Returns the user id of the project owner.
 int getTaskId()
          Returns the task id of this project.
 int getType()
          Returns the type of this project.
 int hashCode()
           
 boolean isDeleteAfterPublishing()
          Returns the delete After Publishing flag.
static boolean isInsideProject(java.util.List 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.
static boolean isInsideProject(java.util.List 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.
 boolean isOnlineProject()
          Returns true if this project is the Online project.
static boolean isOnlineProject(int projectId)
          Returns true if the given project id is the online project id.
 void setDeleteAfterPublishing(boolean deleteAfterPublishing)
          Sets the delete After Publishing flag.
 void setDescription(java.lang.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 setManagerGroupId(CmsUUID id)
          Sets the manager group id of this project.
 void setName(java.lang.String name)
          Sets the name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ONLINE_PROJECT_ID

public static final int ONLINE_PROJECT_ID
The id of the online project.

See Also:
Constant Field Values

ONLINE_PROJECT_NAME

public static final java.lang.String ONLINE_PROJECT_NAME
The name of the online project.

See Also:
Constant Field Values

PROJECT_STATE_INVISIBLE

public static final int PROJECT_STATE_INVISIBLE
Indicates that a project is invisible in the workplace.

See Also:
Constant Field Values

PROJECT_STATE_UNLOCKED

public static final int PROJECT_STATE_UNLOCKED
Indicates an unlocked project.

See Also:
Constant Field Values

PROJECT_TYPE_NORMAL

public static final int PROJECT_TYPE_NORMAL
Indicates a normal project.

See Also:
Constant Field Values

PROJECT_TYPE_TEMPORARY

public static final int PROJECT_TYPE_TEMPORARY
Indicates a temporary project that is deleted after it is published.

See Also:
Constant Field Values
Constructor Detail

CmsProject

public CmsProject()
Default constructor for gui usage.


CmsProject

public CmsProject(int projectId,
                  java.lang.String name,
                  java.lang.String description,
                  int taskId,
                  CmsUUID ownerId,
                  CmsUUID groupId,
                  CmsUUID managerGroupId,
                  int flags,
                  long dateCreated,
                  int type)
Creates a new CmsProject.

Parameters:
projectId - the id to use for this project
name - the name for this project
description - the description for this project
taskId - the task id 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

CmsProject

public CmsProject(java.sql.ResultSet res,
                  CmsSqlManager sqlManager)
           throws java.sql.SQLException
Construct a new CmsProject from a SQL ResultSet.

Parameters:
res - the result set to create a project from
sqlManager - the SQL manager to use
Throws:
java.sql.SQLException - in case something goes wrong
Method Detail

isInsideProject

public static boolean isInsideProject(java.util.List 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(java.util.List 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 Strings
resourcename - the resource to check
Returns:
true, if the resource is "inside" the project resources

isOnlineProject

public static boolean isOnlineProject(int 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()
Returns a clone of this Objects instance.

Returns:
a clone of this instance

compareTo

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

Specified by:
compareTo in interface java.lang.Comparable
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)
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

getId

public int getId()
Returns the id of this project.

Returns:
the 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

getOwnerId

public CmsUUID getOwnerId()
Returns the user id of the project owner.

Returns:
the user id of the project owner

getTaskId

public int getTaskId()
Returns the task id of this project.

Returns:
the task id of this project

getType

public int getType()
Returns the type of this project.

Returns:
the type of this project

hashCode

public int hashCode()
See Also:
Object.hashCode()

isDeleteAfterPublishing

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

Returns:
the delete After Publishing flag
See Also:
getType()

isOnlineProject

public boolean isOnlineProject()
Returns true if this project is the Online project.

Returns:
true if this project is the Online 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

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

toString

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