|
|||||||||
| Home >> All >> com >> opencms >> defaults >> [ master overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.opencms.defaults.master
Class CmsMasterContent

java.lang.Objectcom.opencms.defaults.A_CmsContentDefinition
com.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
- extends com.opencms.defaults.A_CmsContentDefinition
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 |
|
| 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:
getTitlein interfacecom.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:
chgrpin interfacecom.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:
chownin interfacecom.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:
chmodin interfacecom.opencms.defaults.I_CmsExtendedContentDefinition
copy
public int copy(com.opencms.file.CmsObject cms) throws java.lang.Exception
- copy method
- Specified by:
copyin interfacecom.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:
getIdin interfacecom.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:
getOwnerin interfacecom.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:
getGroupIdin interfacecom.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:
getProjectIdin interfacecom.opencms.defaults.I_CmsExtendedContentDefinition
getState
public int getState()
- Returns the state of the content definition:
unchanged, new, changed or deleted
- Specified by:
getStatein interfacecom.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:
getLockedInProjectin interfacecom.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:
getAccessFlagsin interfacecom.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:
publishResourcein interfacecom.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:
undeletein interfacecom.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:
getDateLastModifiedin interfacecom.opencms.defaults.I_CmsExtendedContentDefinition
getDateCreated
public long getDateCreated()
- Returns the date of the creation of the content definition
- Specified by:
getDateCreatedin interfacecom.opencms.defaults.I_CmsExtendedContentDefinition
getLastModifiedBy
public int getLastModifiedBy()
- Returns the id of the user who has modified the content definition
- Specified by:
getLastModifiedByin interfacecom.opencms.defaults.I_CmsExtendedContentDefinition
getLastModifiedByName
public java.lang.String getLastModifiedByName()
- Returns the name of the user who has modified the content definition
- Specified by:
getLastModifiedByNamein interfacecom.opencms.defaults.I_CmsExtendedContentDefinition
getVersionId
public int getVersionId()
- Returns the id of the version in the history of the content definition
- Specified by:
getVersionIdin interfacecom.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:
restorein interfacecom.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:
getHistoryin interfacecom.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:
getVersionFromHistoryin interfacecom.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.
|
|||||||||
| Home >> All >> com >> opencms >> defaults >> [ master overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC