Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opencms.defaults.master
Class CmsMasterContent  view CmsMasterContent download CmsMasterContent.java

java.lang.Object
  extended bycom.opencms.defaults.A_CmsContentDefinition
      extended bycom.opencms.defaults.master.CmsMasterContent
All Implemented Interfaces:
java.lang.Cloneable, com.opencms.core.I_CmsConstants, com.opencms.template.I_CmsContent, com.opencms.defaults.I_CmsExtendedContentDefinition

public abstract class CmsMasterContent
extends com.opencms.defaults.A_CmsContentDefinition
implements com.opencms.defaults.I_CmsExtendedContentDefinition

This class is the master of several Modules. It carries a lot of generic data-fileds which can be used for a special Module. The module creates a set of methods to support project-integration, history and import - export.


Field Summary
private static java.util.HashMap c_accessObjects
          A private HashMap to store all data access-objects.
protected  java.util.Vector m_availableChannels
          Vector of currently available channels
protected  com.opencms.file.CmsObject m_cms
          The cms-object to get access to the cms-ressources
protected  CmsMasterDataSet m_dataSet
          The dataset which holds all informations about this module
protected  boolean m_lockstateWasChanged
          Is set to true, if the lockstate changes
protected  java.util.Vector m_selectedChannels
          Vector of currently selected channels
 
Fields inherited from class com.opencms.defaults.A_CmsContentDefinition
 
Fields inherited from interface com.opencms.core.I_CmsConstants
C_ACCESS_DEFAULT_FLAGS, C_ACCESS_GROUP, C_ACCESS_GROUP_READ, C_ACCESS_GROUP_VISIBLE, C_ACCESS_GROUP_WRITE, C_ACCESS_INTERNAL_READ, C_ACCESS_OWNER, C_ACCESS_OWNER_READ, C_ACCESS_OWNER_VISIBLE, C_ACCESS_OWNER_WRITE, C_ACCESS_PUBLIC, C_ACCESS_PUBLIC_READ, C_ACCESS_PUBLIC_VISIBLE, C_ACCESS_PUBLIC_WRITE, C_ACCESS_READ, C_ACCESS_VISIBLE, C_ACCESS_WRITE, C_ADDITIONAL_INFO_EXPLORERSETTINGS, C_ADDITIONAL_INFO_PREFERENCES, C_ADDITIONAL_INFO_STARTSETTINGS, C_ADDITIONAL_INFO_TASKSETTINGS, C_ADDITIONAL_INFO_TOWN, C_ADDITIONAL_INFO_ZIPCODE, C_AT_LEAST_ONCE, C_CLUSTERURL, C_CONFIGURATION_CACHE, C_CONFIGURATION_CLASS, C_CONFIGURATION_REGISTRY, C_CONFIGURATION_RESOURCEBROKER, C_COPYRIGHT, C_DEFAULT_SITE, C_DELETE_HISTORY, C_ENABLE_HISTORY, C_ERRPREFIX, C_ERRSPERATOR, C_EXPORT_TAG_ACCESS, C_EXPORT_TAG_ADDRESS, C_EXPORT_TAG_CREATOR, C_EXPORT_TAG_DATE, C_EXPORT_TAG_DEFAULTGROUP, C_EXPORT_TAG_DESCRIPTION, C_EXPORT_TAG_DESTINATION, C_EXPORT_TAG_EMAIL, C_EXPORT_TAG_EXPORT, C_EXPORT_TAG_FILE, C_EXPORT_TAG_FIRSTNAME, C_EXPORT_TAG_FLAGS, C_EXPORT_TAG_GROUP, C_EXPORT_TAG_GROUPDATA, C_EXPORT_TAG_GROUPNAME, C_EXPORT_TAG_INFO, C_EXPORT_TAG_LASTMODIFIED, C_EXPORT_TAG_LASTNAME, C_EXPORT_TAG_LAUNCHER_START_CLASS, C_EXPORT_TAG_MODULEXPORT, C_EXPORT_TAG_NAME, C_EXPORT_TAG_OC_VERSION, C_EXPORT_TAG_PARENTGROUP, C_EXPORT_TAG_PASSWORD, C_EXPORT_TAG_PROJECT, C_EXPORT_TAG_PROPERTIES, C_EXPORT_TAG_PROPERTY, C_EXPORT_TAG_RECOVERYPASSWORD, C_EXPORT_TAG_SECTION, C_EXPORT_TAG_SOURCE, C_EXPORT_TAG_TYPE, C_EXPORT_TAG_USER, C_EXPORT_TAG_USERDATA, C_EXPORT_TAG_USERGROUPDATA, C_EXPORT_TAG_USERGROUPS, C_EXPORT_TAG_USERINFO, C_EXPORT_TAG_VALUE, C_EXPORT_TAG_VERSION, C_EXPORT_VERSION, C_EXPORT_XMLFILENAME, C_EXPORTONLYFILES, C_EXPORTONLYUSERS, C_EXPORTPOINT, C_EXPORTPOINT_PATH, C_EXPORTUSERSFILES, C_FCONTENT, C_FELEMENT, C_FILE, C_FILECONTENT, C_FILES_IMPORTED, C_FLAG_DISABLED, C_FLAG_ENABLED, C_FLAG_GROUP_PROJECTCOWORKER, C_FLAG_GROUP_PROJECTMANAGER, C_FLAG_GROUP_ROLE, C_FOLDER, C_FOLDER_SEPARATOR, C_GROUP, C_GROUP_ADMIN, C_GROUP_GUEST, C_GROUP_PROJECTLEADER, C_GROUP_USERS, C_LINKCHECKTABLE_DATE, C_MAX_LENGTH_RESOURCE_NAME, C_MODULE_PROPERTY_ADDITIONAL_RESOURCES, C_MODULE_PROPERTY_ADDITIONAL_RESOURCES_SEPARATOR, C_MODUS_AUTO, C_MODUS_EXPORT, C_MODUS_EXTERN, C_MODUS_OFFLINE, C_MODUS_ONLINE, C_MOUNTPOINT_FILESYSTEM, C_MOUNTPOINT_MYSQL, C_NEVER, C_NO_FILES_IMPORTED, C_ORDER_AGENTUSER, C_ORDER_ENDTIME, C_ORDER_ID, C_ORDER_INITIATORUSER, C_ORDER_NAME, C_ORDER_ORIGINALUSER, C_ORDER_PERCENTAGE, C_ORDER_PRIORITY, C_ORDER_ROLE, C_ORDER_STARTTIME, C_ORDER_STATE, C_ORDER_TASKTYPE, C_ORDER_TIMEOUT, C_ORDER_WAKEUPTIME, C_PASSWORD_MINIMUMSIZE, C_PROJECT_ONLINE, C_PROJECT_ONLINE_ID, C_PROJECT_STATE_ARCHIVE, C_PROJECT_STATE_INVISIBLE, C_PROJECT_STATE_LOCKED, C_PROJECT_STATE_UNLOCKED, C_PROJECT_TYPE_INVISIBLE, C_PROJECT_TYPE_NORMAL, C_PROJECT_TYPE_TEMPORARY, C_PROPERTY_ACTIV, C_PROPERTY_CHANNELID, C_PROPERTY_CONTENT_ENCODING, C_PROPERTY_DEFAULT_FILE, C_PROPERTY_DESCRIPTION, C_PROPERTY_EXPORT, C_PROPERTY_EXPORTNAME, C_PROPERTY_KEYWORDS, C_PROPERTY_NAVPOS, C_PROPERTY_NAVTEXT, C_PROPERTY_RELATIVEROOT, C_PROPERTY_TEMPLATETYPE, C_PROPERTY_TITLE, C_PROPERTY_VISIBLE, C_PUBLISH_METHOD_LINK, C_REGISTRY_DESTINATION, C_REGISTRY_HISTORY, C_REGISTRY_KNOWNLAUNCHERS, C_REGISTRY_LAUNCHER, C_REGISTRY_SOURCE, C_REQUEST_CONSOLE, C_REQUEST_HTTP, C_RESPONSE_CONSOLE, C_RESPONSE_HTTP, C_ROOT, C_ROOT_TEMPLATE_NAME, C_ROOTNAME_COS, C_ROOTNAME_VFS, C_SESSION_ADMIN_POS, C_SESSION_BROADCASTMESSAGE, C_SESSION_CONTENT_ENCODING, C_SESSION_CURRENTGROUP, C_SESSION_DATA, C_SESSION_IS_DIRTY, C_SESSION_MESSAGEPENDING, C_SESSION_MODULE_VECTOR, C_SESSION_PROJECT, C_SESSION_THREAD_ERROR, C_SESSION_USERNAME, C_SORT_ASC, C_SORT_DESC, C_START_ACCESSFLAGS, C_START_DEFAULTGROUP, C_START_LANGUAGE, C_START_LOCKDIALOG, C_START_PROJECT, C_START_VIEW, C_STATE_CHANGED, C_STATE_DELETED, C_STATE_NEW, C_STATE_UNCHANGED, C_STATICEXPORT_PATH, C_STATICEXPORT_START, C_SYNCHRONISATION_PATH, C_SYNCHRONISATION_PROJECT, C_SYNCHRONISATION_RESOURCE, C_SYNCHRONISATION_RESOURCETAG, C_SYSTEMPROPERTY_CRONTABLE, C_SYSTEMPROPERTY_EXPORTPATH, C_SYSTEMPROPERTY_EXTENSIONS, C_SYSTEMPROPERTY_LINKCHECKTABLE, C_SYSTEMPROPERTY_MIMETYPES, C_SYSTEMPROPERTY_MOUNTPOINT, C_SYSTEMPROPERTY_RESOURCE_TYPE, C_TABLE_CHANNELID, C_TASK_FILTER, C_TASK_MESSAGES, C_TASK_MESSAGES_ACCEPTED, C_TASK_MESSAGES_COMPLETED, C_TASK_MESSAGES_FORWARDED, C_TASK_MESSAGES_MEMBERS, C_TASK_ORDER_BY_DATE, C_TASK_ORDER_BY_NAME, C_TASK_PRIORITY_HIGH, C_TASK_PRIORITY_LOW, C_TASK_PRIORITY_NORMAL, C_TASK_STATE_ENDED, C_TASK_STATE_HALTED, C_TASK_STATE_NOTENDED, C_TASK_STATE_PREPARE, C_TASK_STATE_START, C_TASK_STATE_STARTED, C_TASK_VIEW_ALL, C_TASKLOG_SYSTEM, C_TASKLOG_USER, C_TASKORDER_NONE, C_TASKORDER_STARTDATE, C_TASKORDER_TIMEOUT, C_TASKS_ACTIVE, C_TASKS_ALL, C_TASKS_DONE, C_TASKS_NEW, C_TASKS_OPEN, C_TASKSORDER_TASKNAME, C_TEMP_PREFIX, C_TFACCESS, C_TFGROUP, C_TFILEOBJ, C_TFILES, C_TFNAME, C_TFPROPERTYINFO, C_TFPROPERTYNAME, C_TFPROPERTYTYPE, C_TFPROPERTYVALUE, C_TFTYPE, C_TFTYPENAME, C_TFUSER, C_TGDESC, C_TGFLAG, C_TGNAME, C_TGPARENTGROUP, C_TGROUPOBJ, C_TGROUPS, C_TGROUPUSERS, C_TGUSER, C_TUADDINFO, C_TUDESC, C_TUDGROUP, C_TUDISABLED, C_TUEMAIL, C_TUFIRSTNAME, C_TUFLAG, C_TUGROUP, C_TUINFOKEY, C_TUINFOVALUE, C_TULOGIN, C_TUNAME, C_TUPASSWD, C_TUSERGROUPS, C_TUSEROBJ, C_TUSERS, C_TYPE_BODY_NAME, C_TYPE_COMPATIBLEPLAIN_NAME, C_TYPE_FOLDER, C_TYPE_FOLDER_NAME, C_TYPE_IMAGE_NAME, C_TYPE_LAST_INDEX, C_TYPE_PAGE_NAME, C_TYPE_PLAIN_NAME, C_UNKNOWN_ID, C_UNKNOWN_INT, C_UNKNOWN_LAUNCHER, C_UNKNOWN_LAUNCHER_ID, C_UNKNOWN_LONG, C_URL_PREFIX_EXPORT, C_URL_PREFIX_HTTP, C_URL_PREFIX_HTTPS, C_URL_PREFIX_SERVERNAME, C_USER, C_USER_ADMIN, C_USER_GUEST, C_USER_TYPE_SYSTEMANDWEBUSER, C_USER_TYPE_SYSTEMUSER, C_USER_TYPE_WEBUSER, C_WEB_APP_REPLACE_KEY, C_WEEKS_HISTORY, C_WHATEVER, C_XML_BODY_ELEMENT
 
Constructor Summary
CmsMasterContent()
          TESTFIX (a.kandzior@alkacon.com) New code: Empty constructor needed for instanciating CDs as JavaBeans on JSPs.
CmsMasterContent(com.opencms.file.CmsObject cms)
          Constructor to create a new contentdefinition.
CmsMasterContent(com.opencms.file.CmsObject cms, CmsMasterDataSet dataset)
          Constructor to create a new contentdefinition.
CmsMasterContent(com.opencms.file.CmsObject cms, java.lang.Integer id)
          Constructor to read a existing contentdefinition from the database.
 
Method Summary
protected static boolean accessGroup(com.opencms.file.CmsObject cms, com.opencms.file.CmsUser currentUser, int flags, com.opencms.file.CmsResource resource)
          Checks, if the group may access this resource.
protected static boolean accessOther(int flags, com.opencms.file.CmsResource resource)
          Checks, if others may access this resource.
protected static boolean accessOwner(com.opencms.file.CmsObject cms, com.opencms.file.CmsUser currentUser, int flags, com.opencms.file.CmsResource resource)
          Checks, if the owner may access this resource.
 void addChannel(java.lang.String channel)
          Registers a new channel, that should be written by calling write().
 void addMedia(CmsMasterMedia media)
          Registers a new media, that should be written by calling write().
static boolean beforePublish(com.opencms.file.CmsObject cms, java.lang.Boolean enableHistory, java.lang.Integer projectId, java.lang.Integer versionId, java.lang.Long publishingDate, java.util.Vector changedRessources, java.util.Vector changedModuleData, CmsMasterDataSet dataset)
          Overwrite this method in your subclasses to execute any tasks before the resources are published.
 void chgrp(com.opencms.file.CmsObject cms, int group)
          change group method for the permissions of content definition
 void chmod(com.opencms.file.CmsObject cms, int accessflags)
          change access flags method for the permissions of content definition
 void chown(com.opencms.file.CmsObject cms, int owner)
          change owner method for the permissions of content definition
 int copy(com.opencms.file.CmsObject cms)
          copy method
 void delete(com.opencms.file.CmsObject cms)
          delete method for delete instance of content definition
 void deleteChannel(java.lang.String channel)
          Registers a channel for deletion.
 void deleteMedia(CmsMasterMedia media)
          Registers a media for deletion.
 int getAccessFlags()
          get the accessFlag for the CD
 java.lang.String getAccessFlagsAsString()
          Convenience method to get the access-Flags as String representation.
static java.util.Vector getAllSubChannelsOf(com.opencms.file.CmsObject cms, java.lang.String channel)
          Get all subchannels of a channel.
 java.util.Vector getAllSubChannelsOfRootChannel(com.opencms.file.CmsObject cms)
          Get all subchannels of the module root channel without the root channel in the channel names Method returns only channels that doesn't have further subchannels because it is it not intended to add contentdefinitions to channels that are not endpoints in the channel folder structure.
 java.util.Vector getAvailableChannels(com.opencms.file.CmsObject cms)
          Get all currently available channels Note: the root channel of the module is not included in the returned channelnames.
 java.util.Vector getChannels()
          Returns a Vector of channels for this master cd.
 long getDateCreated()
          Returns the date of the creation of the content definition
 long getDateLastModified()
          Returns the date of the last modification of the content definition
protected static com.opencms.defaults.master.genericsql.CmsDbAccess getDbAccessObject(int subId)
          Returns a database access object for the contentdefinition type.
 java.lang.String getGroup()
          Gets the groupname
 int getGroupId()
          Gets the groupid
 java.util.Vector getHistory(com.opencms.file.CmsObject cms)
          History method returns the vector of the versions of content definition in the history
 int getId()
          gets the unique Id of a content definition instance
 int getLastModifiedBy()
          Returns the id of the user who has modified the content definition
 java.lang.String getLastModifiedByName()
          Returns the name of the user who has modified the content definition
 int getLockedInProject()
          Returns the projectId of the content definition that is stored in the cd table after the cd was locked
 int getLockstate()
          Gets the lockstate.
 java.util.Vector getMedia()
          Returns a Vector of media-objects for this master cd.
 int getOwner()
          Gets the owner of this contentdefinition.
 java.lang.String getOwnerName()
          Gets the ownername
 int getProjectId()
          Returns the projectId of the content definition.
 java.lang.String getRootChannel()
          Get the root channel of the module
 java.util.Vector getSelectedChannels()
          Get all currently selected channels
 int getState()
          Returns the state of the content definition: unchanged, new, changed or deleted
abstract  int getSubId()
          Returns the sub-id of this contentdefinition.
 java.lang.String getTitle()
          Returns the title of this cd
 java.lang.String getUniqueId(com.opencms.file.CmsObject cms)
          gets the unique Id of a content definition instance
 java.lang.Object getVersionFromHistory(com.opencms.file.CmsObject cms, int versionId)
          History method returns the cd of the version with the given versionId
 int getVersionId()
          Returns the id of the version in the history of the content definition
protected static boolean hasWriteAccess(com.opencms.file.CmsObject cms, com.opencms.file.CmsResource resource)
          has the current user the right to write the resource
 void importMaster()
          import method to import the current content of the content definition to the database.
protected  void initValues()
          This method initialises all needed members with default-values.
 boolean isReadable()
          returns true if the CD is readable for the current user
 boolean isVisible()
          has the current user the right to view the CD
 boolean isWriteable()
          returns true if the CD is writeable for the current user
protected static void publishProject(com.opencms.file.CmsObject cms, boolean enableHistory, int projectId, int versionId, long publishingDate, int subId, java.lang.String contentDefinitionClassName, java.util.Vector changedRessources, java.util.Vector changedModuleData)
          Publishes all modified content definitions for this project.
 void publishResource(com.opencms.file.CmsObject cms)
          Publishes the content definition directly
protected static java.util.Vector readAllByChannel(com.opencms.file.CmsObject cms, int channelId, int subId)
          Returns a Vector with the datasets of the contentdefinitions in the given channel.
protected static void registerDbAccessObject(int subId, com.opencms.defaults.master.genericsql.CmsDbAccess dBAccessObject)
          Registers a database access object for the contentdefinition type.
 void restore(com.opencms.file.CmsObject cms, int versionId)
          Restore method for restore instance of content definition from the history
 void setAccessFlags(int accessFlags)
          set the accessFlag for the CD
 void setAvailableChannels(java.lang.String channels)
          Set the Available Channels
 void setGroup(int id)
          Sets the group.
 void setLockstate(int lockstate)
          Sets the lockstates
 void setOwner(int id)
          Sets the owner of this contentdefinition.
 void setSelectedChannels(java.lang.String channels)
          set Selected Channels
 void setTitle(java.lang.String title)
          Sets title of this cd
 java.lang.String toString()
          Returns a String representation of this instance.
 void undelete(com.opencms.file.CmsObject cms)
          Undelete method for undelete instance of content definition
protected  void updateChannels()
          Add or remove channels compares the currently selected channels with the selected channels stored in the database and adds or deletes channels if necessary
 void updateMedia(CmsMasterMedia media)
          Registers a media for update
 void write(com.opencms.file.CmsObject cms)
          write method to write the current content of the content definition to the database.
 
Methods inherited from class com.opencms.defaults.A_CmsContentDefinition
accessGroup, accessOther, accessOwner, applyFilter, applyFilter, check, getFieldMethods, getFieldNames, getFilterMethods, getUrl, hasReadAccess, hasWriteAccess, isExtendedList, isLockable, isTimedContent, setGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_cms

protected com.opencms.file.CmsObject m_cms
The cms-object to get access to the cms-ressources


m_dataSet

protected CmsMasterDataSet m_dataSet
The dataset which holds all informations about this module


m_lockstateWasChanged

protected boolean m_lockstateWasChanged
Is set to true, if the lockstate changes


c_accessObjects

private static java.util.HashMap c_accessObjects
A private HashMap to store all data access-objects.


m_selectedChannels

protected java.util.Vector m_selectedChannels
Vector of currently selected channels


m_availableChannels

protected java.util.Vector m_availableChannels
Vector of currently available channels

Constructor Detail

CmsMasterContent

public CmsMasterContent(com.opencms.file.CmsObject cms)
Constructor to create a new contentdefinition. You can set data with your set-Methods. After you have called the write-method this definition gets a unique id.


CmsMasterContent

public CmsMasterContent(com.opencms.file.CmsObject cms,
                        CmsMasterDataSet dataset)
Constructor to create a new contentdefinition. You can set data with your set-Methods. After you have called the write-method this definition gets a unique id.


CmsMasterContent

public CmsMasterContent(com.opencms.file.CmsObject cms,
                        java.lang.Integer id)
                 throws com.opencms.core.CmsException
Constructor to read a existing contentdefinition from the database. The data read from the databse will be filled into the member-variables. You can read them with the get- and modify them with the ser-methods. Changes you have made must be written back to the database by calling the write-method.


CmsMasterContent

public CmsMasterContent()
TESTFIX (a.kandzior@alkacon.com) New code: Empty constructor needed for instanciating CDs as JavaBeans on JSPs.

Method Detail

registerDbAccessObject

protected static void registerDbAccessObject(int subId,
                                             com.opencms.defaults.master.genericsql.CmsDbAccess dBAccessObject)
Registers a database access object for the contentdefinition type.


getDbAccessObject

protected static com.opencms.defaults.master.genericsql.CmsDbAccess getDbAccessObject(int subId)
Returns a database access object for the contentdefinition type.


initValues

protected void initValues()
This method initialises all needed members with default-values.


getTitle

public java.lang.String getTitle()
Returns the title of this cd

Specified by:
getTitle in interface com.opencms.defaults.I_CmsExtendedContentDefinition

setTitle

public void setTitle(java.lang.String title)
Sets title of this cd


getMedia

public java.util.Vector getMedia()
                          throws com.opencms.core.CmsException
Returns a Vector of media-objects for this master cd.


addMedia

public void addMedia(CmsMasterMedia media)
Registers a new media, that should be written by calling write().


deleteMedia

public void deleteMedia(CmsMasterMedia media)
Registers a media for deletion.


updateMedia

public void updateMedia(CmsMasterMedia media)
Registers a media for update


getChannels

public java.util.Vector getChannels()
                             throws com.opencms.core.CmsException
Returns a Vector of channels for this master cd.


addChannel

public void addChannel(java.lang.String channel)
Registers a new channel, that should be written by calling write().


deleteChannel

public void deleteChannel(java.lang.String channel)
Registers a channel for deletion.


delete

public void delete(com.opencms.file.CmsObject cms)
            throws java.lang.Exception
delete method for delete instance of content definition


chgrp

public void chgrp(com.opencms.file.CmsObject cms,
                  int group)
           throws java.lang.Exception
change group method for the permissions of content definition

Specified by:
chgrp in interface com.opencms.defaults.I_CmsExtendedContentDefinition

chown

public void chown(com.opencms.file.CmsObject cms,
                  int owner)
           throws java.lang.Exception
change owner method for the permissions of content definition

Specified by:
chown in interface com.opencms.defaults.I_CmsExtendedContentDefinition

chmod

public void chmod(com.opencms.file.CmsObject cms,
                  int accessflags)
           throws java.lang.Exception
change access flags method for the permissions of content definition

Specified by:
chmod in interface com.opencms.defaults.I_CmsExtendedContentDefinition

copy

public int copy(com.opencms.file.CmsObject cms)
         throws java.lang.Exception
copy method

Specified by:
copy in interface com.opencms.defaults.I_CmsExtendedContentDefinition

write

public void write(com.opencms.file.CmsObject cms)
           throws com.opencms.core.CmsException
write method to write the current content of the content definition to the database.


importMaster

public void importMaster()
                  throws java.lang.Exception
import method to import the current content of the content definition to the database.


getUniqueId

public java.lang.String getUniqueId(com.opencms.file.CmsObject cms)
gets the unique Id of a content definition instance


getId

public int getId()
gets the unique Id of a content definition instance

Specified by:
getId in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getLockstate

public int getLockstate()
Gets the lockstate.


setLockstate

public void setLockstate(int lockstate)
Sets the lockstates


getOwner

public int getOwner()
Gets the owner of this contentdefinition.

Specified by:
getOwner in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getOwnerName

public java.lang.String getOwnerName()
Gets the ownername


setOwner

public void setOwner(int id)
Sets the owner of this contentdefinition.


getGroup

public java.lang.String getGroup()
Gets the groupname


getGroupId

public int getGroupId()
Gets the groupid

Specified by:
getGroupId in interface com.opencms.defaults.I_CmsExtendedContentDefinition

setGroup

public void setGroup(int id)
Sets the group.


getProjectId

public int getProjectId()
Returns the projectId of the content definition. If the cd belongs to the current project the value is the id of the current project otherwise its the id of the online project

Specified by:
getProjectId in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getState

public int getState()
Returns the state of the content definition: unchanged, new, changed or deleted

Specified by:
getState in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getLockedInProject

public int getLockedInProject()
Returns the projectId of the content definition that is stored in the cd table after the cd was locked

Specified by:
getLockedInProject in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getSubId

public abstract int getSubId()
Returns the sub-id of this contentdefinition. You have to implement this method so it returns a unique sunb-id that describes the type of the contentdefinition. (E.g. article: sub-id=1; table: sub-id=2).


toString

public java.lang.String toString()
Returns a String representation of this instance. This can be used for debugging purposes.


setAccessFlags

public void setAccessFlags(int accessFlags)
set the accessFlag for the CD


getAccessFlags

public int getAccessFlags()
get the accessFlag for the CD

Specified by:
getAccessFlags in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getAccessFlagsAsString

public java.lang.String getAccessFlagsAsString()
Convenience method to get the access-Flags as String representation.


isVisible

public boolean isVisible()
has the current user the right to view the CD


isReadable

public boolean isReadable()
returns true if the CD is readable for the current user


isWriteable

public boolean isWriteable()
returns true if the CD is writeable for the current user


publishResource

public void publishResource(com.opencms.file.CmsObject cms)
                     throws java.lang.Exception
Publishes the content definition directly

Specified by:
publishResource in interface com.opencms.defaults.I_CmsExtendedContentDefinition

undelete

public void undelete(com.opencms.file.CmsObject cms)
              throws java.lang.Exception
Undelete method for undelete instance of content definition

Specified by:
undelete in interface com.opencms.defaults.I_CmsExtendedContentDefinition

beforePublish

public static boolean beforePublish(com.opencms.file.CmsObject cms,
                                    java.lang.Boolean enableHistory,
                                    java.lang.Integer projectId,
                                    java.lang.Integer versionId,
                                    java.lang.Long publishingDate,
                                    java.util.Vector changedRessources,
                                    java.util.Vector changedModuleData,
                                    CmsMasterDataSet dataset)
Overwrite this method in your subclasses to execute any tasks before the resources are published.


publishProject

protected static void publishProject(com.opencms.file.CmsObject cms,
                                     boolean enableHistory,
                                     int projectId,
                                     int versionId,
                                     long publishingDate,
                                     int subId,
                                     java.lang.String contentDefinitionClassName,
                                     java.util.Vector changedRessources,
                                     java.util.Vector changedModuleData)
                              throws com.opencms.core.CmsException
Publishes all modified content definitions for this project.


readAllByChannel

protected static java.util.Vector readAllByChannel(com.opencms.file.CmsObject cms,
                                                   int channelId,
                                                   int subId)
                                            throws com.opencms.core.CmsException
Returns a Vector with the datasets of the contentdefinitions in the given channel.


getDateLastModified

public long getDateLastModified()
Returns the date of the last modification of the content definition

Specified by:
getDateLastModified in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getDateCreated

public long getDateCreated()
Returns the date of the creation of the content definition

Specified by:
getDateCreated in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getLastModifiedBy

public int getLastModifiedBy()
Returns the id of the user who has modified the content definition

Specified by:
getLastModifiedBy in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getLastModifiedByName

public java.lang.String getLastModifiedByName()
Returns the name of the user who has modified the content definition

Specified by:
getLastModifiedByName in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getVersionId

public int getVersionId()
Returns the id of the version in the history of the content definition

Specified by:
getVersionId in interface com.opencms.defaults.I_CmsExtendedContentDefinition

restore

public void restore(com.opencms.file.CmsObject cms,
                    int versionId)
             throws java.lang.Exception
Restore method for restore instance of content definition from the history

Specified by:
restore in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getHistory

public java.util.Vector getHistory(com.opencms.file.CmsObject cms)
                            throws java.lang.Exception
History method returns the vector of the versions of content definition in the history

Specified by:
getHistory in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getVersionFromHistory

public java.lang.Object getVersionFromHistory(com.opencms.file.CmsObject cms,
                                              int versionId)
                                       throws java.lang.Exception
History method returns the cd of the version with the given versionId

Specified by:
getVersionFromHistory in interface com.opencms.defaults.I_CmsExtendedContentDefinition

getSelectedChannels

public java.util.Vector getSelectedChannels()
                                     throws com.opencms.core.CmsException
Get all currently selected channels


setSelectedChannels

public void setSelectedChannels(java.lang.String channels)
set Selected Channels


getAvailableChannels

public java.util.Vector getAvailableChannels(com.opencms.file.CmsObject cms)
                                      throws com.opencms.core.CmsException
Get all currently available channels Note: the root channel of the module is not included in the returned channelnames. For example if the root channel is /Jobs/ and a channel's name is /Jobs/Education/Cologne/ the returned name for this channel will be /Education/Cologne/.


setAvailableChannels

public void setAvailableChannels(java.lang.String channels)
Set the Available Channels


getAllSubChannelsOf

public static java.util.Vector getAllSubChannelsOf(com.opencms.file.CmsObject cms,
                                                   java.lang.String channel)
                                            throws com.opencms.core.CmsException
Get all subchannels of a channel. Method returns only channels that doesn't have further subchannels because it is it not intended to add contentdefinitions to channels that are not endpoints of the channel folder structure. If different functionality is needed this method has to be overridden in derived contentdefinition classes.


getAllSubChannelsOfRootChannel

public java.util.Vector getAllSubChannelsOfRootChannel(com.opencms.file.CmsObject cms)
                                                throws com.opencms.core.CmsException
Get all subchannels of the module root channel without the root channel in the channel names Method returns only channels that doesn't have further subchannels because it is it not intended to add contentdefinitions to channels that are not endpoints in the channel folder structure. If different functionality is needed this method has to be overridden in derived contentdefinition classes.


updateChannels

protected void updateChannels()
                       throws com.opencms.core.CmsException
Add or remove channels compares the currently selected channels with the selected channels stored in the database and adds or deletes channels if necessary


getRootChannel

public java.lang.String getRootChannel()
Get the root channel of the module


hasWriteAccess

protected static boolean hasWriteAccess(com.opencms.file.CmsObject cms,
                                        com.opencms.file.CmsResource resource)
                                 throws com.opencms.core.CmsException
has the current user the right to write the resource


accessOwner

protected static boolean accessOwner(com.opencms.file.CmsObject cms,
                                     com.opencms.file.CmsUser currentUser,
                                     int flags,
                                     com.opencms.file.CmsResource resource)
                              throws com.opencms.core.CmsException
Checks, if the owner may access this resource.


accessGroup

protected static boolean accessGroup(com.opencms.file.CmsObject cms,
                                     com.opencms.file.CmsUser currentUser,
                                     int flags,
                                     com.opencms.file.CmsResource resource)
                              throws com.opencms.core.CmsException
Checks, if the group may access this resource.


accessOther

protected static boolean accessOther(int flags,
                                     com.opencms.file.CmsResource resource)
                              throws com.opencms.core.CmsException
Checks, if others may access this resource.