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

java.lang.Objectcom.opencms.file.CmsObject
- All Implemented Interfaces:
- com.opencms.core.I_CmsConstants
- public class CmsObject
- extends java.lang.Object
- implements com.opencms.core.I_CmsConstants
- extends java.lang.Object
This class provides access to the OpenCms and its resources.
The CmsObject encapsulates user identification and client requests and
is the central object to transport information in the Cms Servlet.
All operations on the CmsObject are forwarded to the class which extends A_CmsRessourceBroker
to ensure user authentification in all operations.
- Version:
- $Revision: 1.268.2.2 $
| Field Summary | |
private static int |
DEBUG
Internal debug flag, set to 9 for maximum verbosity |
private CmsRequestContext |
m_context
The resource broker to access the cms. |
private com.opencms.launcher.CmsLauncherManager |
m_launcherManager
The launcher manager used with this object, Is needed to clear the template caches. |
private com.opencms.linkmanagement.LinkChecker |
m_linkChecker
The class for linkmanagement. |
private com.opencms.util.LinkSubstitution |
m_linkSubstitution
The class for processing links. |
private int |
m_mode
the modus the cmsObject runs in (used i.e. |
private I_CmsResourceBroker |
m_rb
The resource broker to access the cms. |
private com.opencms.core.CmsCoreSession |
m_sessionStorage
Method that can be invoked to find out all currently logged in users. |
| Constructor Summary | |
CmsObject()
The default constructor. |
|
| Method Summary | |
void |
acceptTask(int taskId)
Accept a task from the Cms. |
boolean |
accessCreate(java.lang.String resource)
Checks, if the user may create this resource. |
boolean |
accessLock(java.lang.String resource)
Checks, if the user may lock this resource. |
boolean |
accessProject(int projectId)
Checks if the user can access the project. |
boolean |
accessRead(java.lang.String resource)
Checks, if the user may read this resource. |
boolean |
accessReadVisible(CmsResource resource)
Checks, if the user may read this resource and if it is visible to him. |
boolean |
accessWrite(java.lang.String resource)
Checks, if the user may write this resource. |
void |
addFileExtension(java.lang.String extension,
java.lang.String resTypeName)
Adds a file extension to the list of known file extensions. |
CmsGroup |
addGroup(java.lang.String name,
java.lang.String description,
int flags,
java.lang.String parent)
Adds a new group to the Cms. |
CmsUser |
addImportUser(java.lang.String name,
java.lang.String password,
java.lang.String recoveryPassword,
java.lang.String description,
java.lang.String firstname,
java.lang.String lastname,
java.lang.String email,
int flags,
java.util.Hashtable additionalInfos,
java.lang.String defaultGroup,
java.lang.String address,
java.lang.String section,
int type)
Adds a user to the Cms by import. |
CmsUser |
addUser(java.lang.String name,
java.lang.String password,
java.lang.String group,
java.lang.String description,
java.util.Hashtable additionalInfos,
int flags)
Adds a user to the Cms. |
void |
addUserToGroup(java.lang.String username,
java.lang.String groupname)
Adds a user to a group. |
CmsUser |
addWebUser(java.lang.String name,
java.lang.String password,
java.lang.String group,
java.lang.String description,
java.util.Hashtable additionalInfos,
int flags)
Adds a web user to the Cms. |
CmsUser |
addWebUser(java.lang.String name,
java.lang.String password,
java.lang.String group,
java.lang.String additionalGroup,
java.lang.String description,
java.util.Hashtable additionalInfos,
int flags)
Adds a web user to the Cms. |
CmsUser |
anonymousUser()
Returns the anonymous user object. |
void |
backupProject(int projectId,
int versionId,
long publishDate)
Creates a backup of the published project |
void |
changeLockedInProject(int projectId,
java.lang.String resourcename)
Changes the project-id of a resource to the new project for publishing the resource directly |
void |
changeUserType(int userId,
int userType)
Changes the type of the user |
void |
changeUserType(java.lang.String username,
int userType)
Changes the type of the user to webusertype |
void |
chgrp(java.lang.String filename,
java.lang.String newGroup)
Changes the group of a resource. |
void |
chgrp(java.lang.String filename,
java.lang.String newGroup,
boolean chRekursive)
Changes the group of a resource. |
void |
chmod(java.lang.String filename,
int flags)
Changes the flags of a resource. |
void |
chmod(java.lang.String filename,
int flags,
boolean chRekursive)
Changes the flags of a resource. |
void |
chown(java.lang.String filename,
java.lang.String newOwner)
Changes the owner of a resource. |
void |
chown(java.lang.String filename,
java.lang.String newOwner,
boolean chRekursive)
Changes the owner of a resource. |
void |
chtype(java.lang.String filename,
java.lang.String newType)
Changes the resourcetype of a resource. |
void |
clearcache()
Clears all internal DB-Caches. |
void |
clearElementCache()
Clears the element cache. |
void |
copyFile(java.lang.String source,
java.lang.String destination)
Deprecated. Use copyResource instead. |
void |
copyFolder(java.lang.String source,
java.lang.String destination)
Deprecated. Use copyResource instead. |
void |
copyResource(java.lang.String source,
java.lang.String destination)
Copies a file. |
void |
copyResource(java.lang.String source,
java.lang.String destination,
boolean keepFlags)
Copies a file. |
void |
copyResourceToProject(java.lang.String resource)
Copies a resource from the online project to a new, specified project. |
int |
countLockedResources(int id)
Counts the locked resources in a project. |
CmsFolder |
createChannel(java.lang.String parentChannel,
java.lang.String newChannelName)
Creates a new channel. |
CmsFile |
createFile(java.lang.String folder,
java.lang.String filename,
byte[] contents,
java.lang.String type)
Deprecated. Use createResource instead. |
CmsFile |
createFile(java.lang.String folder,
java.lang.String filename,
byte[] contents,
java.lang.String type,
java.util.Hashtable properties)
Deprecated. Use createResource instead. |
CmsFolder |
createFolder(java.lang.String folder,
java.lang.String newFolderName)
Deprecated. Use createResource instead. |
void |
createLinkEntrys(int pageId,
java.util.Vector linkTargets)
creates a link entry for each of the link targets in the linktable. |
void |
createOnlineLinkEntrys(int pageId,
java.util.Vector linkTarget)
creates a link entry for each of the link targets in the online linktable. |
CmsTask |
createProject(java.lang.String projectname,
int projectType,
java.lang.String roleName,
long timeout,
int priority)
Creates a new project for task handling. |
CmsProject |
createProject(java.lang.String name,
java.lang.String description,
java.lang.String groupname,
java.lang.String managergroupname)
Creates a new project. |
CmsProject |
createProject(java.lang.String name,
java.lang.String description,
java.lang.String groupname,
java.lang.String managergroupname,
int projecttype)
Creates a new project. |
CmsPropertydefinition |
createPropertydefinition(java.lang.String name,
java.lang.String resourcetype)
Creates the property-definition for a resource type. |
CmsResource |
createResource(java.lang.String newResourceName,
java.lang.String type,
java.util.Map properties,
byte[] contents,
java.lang.Object parameter)
|
CmsResource |
createResource(java.lang.String folder,
java.lang.String name,
java.lang.String type)
|
CmsResource |
createResource(java.lang.String folder,
java.lang.String name,
java.lang.String type,
java.util.Map properties)
|
CmsResource |
createResource(java.lang.String folder,
java.lang.String name,
java.lang.String type,
java.util.Map properties,
byte[] contents)
|
CmsTask |
createTask(int projectid,
java.lang.String agentName,
java.lang.String roleName,
java.lang.String taskname,
java.lang.String taskcomment,
int tasktype,
long timeout,
int priority)
Creates a new task. |
CmsTask |
createTask(java.lang.String agentName,
java.lang.String roleName,
java.lang.String taskname,
java.lang.String taskcomment,
long timeout,
int priority)
Creates a new task. |
CmsProject |
createTempfileProject()
Creates a new project for the temporary files. |
void |
deleteAllProperties(java.lang.String resourcename)
Deletes all properties for a file or folder. |
int |
deleteBackups(int weeks)
Deletes the versions from the backup tables that are older then the given weeks |
void |
deleteEmptyFolder(java.lang.String foldername)
Deletes a folder. |
void |
deleteExportLink(CmsExportLink link)
Deletes an exportlink in the database. |
void |
deleteExportLink(java.lang.String link)
Deletes an exportlink in the database. |
void |
deleteFile(java.lang.String filename)
Deprecated. Use deleteResource instead. |
void |
deleteFolder(java.lang.String foldername)
Deprecated. Use deleteResource instead. |
void |
deleteGroup(java.lang.String delgroup)
Deletes a group. |
void |
deleteLinkEntrys(int pageId)
deletes all entrys in the link table that belong to the pageId |
void |
deleteOnlineLinkEntrys(int pageId)
deletes all entrys in the online link table that belong to the pageId |
void |
deleteProject(int id)
Deletes a project. |
void |
deleteProperty(java.lang.String resourcename,
java.lang.String property)
Deletes a property for a file or folder. |
void |
deletePropertydefinition(java.lang.String name,
java.lang.String resourcetype)
Deletes the property-definition for a resource type. |
void |
deleteResource(java.lang.String filename)
Deletes a resource. |
void |
deleteUser(int userId)
Deletes a user from the Cms. |
void |
deleteUser(java.lang.String username)
Deletes a user from the Cms. |
void |
deleteWebUser(int userId)
Deletes a web user from the Cms. |
void |
destroy()
Destroys the resource borker and required modules and connections. |
java.lang.String |
digest(java.lang.String value)
Method to encrypt the passwords. |
protected void |
doChangeLockedInProject(int projectId,
java.lang.String resourcename)
Changes the project-id of a resource to the new project for publishing the resource directly |
protected void |
doChgrp(java.lang.String filename,
java.lang.String newGroup)
Changes the group of a resource. |
protected void |
doChmod(java.lang.String filename,
int flags)
Changes the flags of a resource. |
protected void |
doChown(java.lang.String filename,
java.lang.String newOwner)
Changes the owner of a resource. |
protected void |
doChtype(java.lang.String filename,
java.lang.String newType)
Changes the resourcetype of a resource. |
protected void |
doCopyFile(java.lang.String source,
java.lang.String destination)
Copies a file. |
protected void |
doCopyFolder(java.lang.String source,
java.lang.String destination)
Copies a folder. |
protected void |
doCopyResourceToProject(java.lang.String resource)
Copies a resource from the online project to a new, specified project. |
protected CmsFile |
doCreateFile(java.lang.String newFileName,
byte[] contents,
java.lang.String type)
Creates a new file with the given content and resourcetype. |
protected CmsFile |
doCreateFile(java.lang.String newFileName,
byte[] contents,
java.lang.String type,
java.util.Map properties)
Creates a new file with the given content and resourcetype. |
protected CmsFolder |
doCreateFolder(java.lang.String newFolderName,
java.util.Map properties)
Creates a new folder. |
protected CmsFolder |
doCreateFolder(java.lang.String folder,
java.lang.String newFolderName)
Creates a new folder. |
int |
doDecrementLinkCountForResource(java.lang.String theResourceName)
Decrement the VFS link counter for a resource. |
protected void |
doDeleteFile(java.lang.String filename)
Deletes a file. |
protected void |
doDeleteFolder(java.lang.String foldername)
Deletes a folder. |
protected CmsResource |
doImportResource(java.lang.String newResourceName,
int resourceType,
java.util.Map properties,
int launcherType,
java.lang.String launcherClassname,
java.lang.String ownername,
java.lang.String groupname,
int accessFlags,
long lastmodified,
byte[] filecontent)
Creates a new resource. |
int |
doIncrementLinkCountForResource(java.lang.String theResourceName)
Increment the VFS link counter for a resource. |
protected void |
doLockResource(java.lang.String resource,
boolean force)
Locks a given resource. |
protected void |
doMoveFile(java.lang.String source,
java.lang.String destination)
Moves a file to the given destination. |
protected void |
doRenameFile(java.lang.String oldname,
java.lang.String newname)
Renames the resource to the new name. |
protected void |
doRestoreResource(int versionId,
java.lang.String filename)
Restores a file in the current project with a version in the backup |
protected void |
doTouch(java.lang.String resourceName,
long timestamp)
Access the resource broker underneath to change the timestamp of a resource. |
protected void |
doUndeleteFile(java.lang.String filename)
Undeletes a file. |
protected void |
doUndeleteFolder(java.lang.String foldername)
Undeletes a folder. |
protected void |
doUndoChanges(java.lang.String resource)
Undo changes in a file. |
protected void |
doUnlockResource(java.lang.String resource)
Unlocks a resource. |
protected void |
doWriteResource(java.lang.String resourcename,
java.util.Map properties,
java.lang.String username,
java.lang.String groupname,
int accessFlags,
int resourceType,
byte[] filecontent)
Writes a resource and its properties to the Cms. |
void |
endTask(int taskid)
Ends a task of the Cms. |
void |
exportModuledata(java.lang.String exportFile,
java.lang.String[] exportChannels,
java.lang.String[] exportModules,
com.opencms.report.I_CmsReport report)
Exports channels and moduledata to zip. |
CmsFile |
exportResource(CmsFile file)
Exports a resource. |
void |
exportResources(java.lang.String exportFile,
java.lang.String[] exportPaths)
Exports cms-resources to a zip-file. |
void |
exportResources(java.lang.String exportFile,
java.lang.String[] exportPaths,
boolean includeSystem,
boolean excludeUnchanged)
Exports cms-resources to a zip-file. |
void |
exportResources(java.lang.String exportFile,
java.lang.String[] exportPaths,
boolean includeSystem,
boolean excludeUnchanged,
boolean exportUserdata)
Exports cms-resources to a zip-file. |
void |
exportResources(java.lang.String exportFile,
java.lang.String[] exportPaths,
boolean includeSystem,
boolean excludeUnchanged,
boolean exportUserdata,
long contentAge,
com.opencms.report.I_CmsReport report)
Exports cms-resources to a zip-file. |
void |
exportStaticResources(java.util.Vector linksToExport)
Creates a static export in the filesystem. |
void |
exportStaticResources(java.util.Vector startpoints,
java.util.Vector projectResources,
java.util.Vector allExportedLinks,
CmsPublishedResources changedResources,
com.opencms.report.I_CmsReport report)
Creates a static export in the filesystem |
java.util.ArrayList |
fetchVfsLinksForResource(java.lang.String theResourceName)
Fetches the resource names of all VFS links pointing to a given resource as an ArrayList. |
private void |
fireEvent(int type,
java.lang.Object data)
Fires a CmsEvent |
void |
forwardTask(int taskid,
java.lang.String newRoleName,
java.lang.String newUserName)
Forwards a task to a new user. |
java.util.Vector |
getAllAccessibleProjects()
Returns all projects, which the current user can access. |
java.util.Vector |
getAllBackupProjects()
Returns a Vector with all projects from history |
java.util.Vector |
getAllExportLinks()
Returns a Vector with all export links |
java.util.Vector |
getAllManageableProjects()
Returns all projects which are owned by the current user or which are manageable for the group of the user. |
java.util.Hashtable |
getAllResourceTypes()
Returns a Hashtable with all I_CmsResourceTypes. |
int |
getBackupVersionId()
Get the next version id for the published backup resources |
void |
getBrokenLinks(int projectId,
com.opencms.report.I_CmsReport report,
java.util.Vector changed,
java.util.Vector deleted,
java.util.Vector newRes)
checks a project for broken links that would appear if the project is published. |
java.util.Hashtable |
getCacheInfo()
Gets information about the cache size. |
java.util.Vector |
getChild(java.lang.String groupname)
Returns all child groups of a group. |
java.util.Vector |
getChilds(java.lang.String groupname)
Returns all child groups of a group. |
CmsObject |
getCmsObjectForStaticExport(com.opencms.core.CmsExportRequest dReq,
com.opencms.core.CmsExportResponse dRes)
Creates a special CmsObject for the static export. |
source.org.apache.java.util.Configurations |
getConfigurations()
Gets the configurations of the properties-file. |
java.util.Vector |
getDependingExportLinks(java.util.Vector res)
Reads all export links that depend on the resource. |
java.util.Vector |
getDirectGroupsOfUser(java.lang.String username)
Gets all groups to which a given user directly belongs. |
java.util.Vector |
getFilesInFolder(java.lang.String foldername)
Returns a Vector with all files of a given folder. |
java.util.Vector |
getFilesInFolder(java.lang.String foldername,
boolean includeDeleted)
Returns a Vector with all files of a given folder. |
java.util.Vector |
getFilesWithProperty(java.lang.String propertyDefinition,
java.lang.String propertyValue)
Returns a Vector with all resource-names of the resources that have set the given property to the given value. |
long |
getFileSystemChanges()
This method can be called, to determine if the file-system was changed in the past. |
long |
getFileSystemFolderChanges()
This method can be called, to determine if the file-system was changed in the past. |
java.util.Vector |
getFolderTree()
Returns a Vector with the complete folder-tree for this project. Subfolders can be read from an offline project and the online project. |
java.util.Vector |
getGroups()
Returns all groups in the Cms. |
java.util.Vector |
getGroupsOfUser(java.lang.String username)
Gets all groups of a user. |
com.opencms.launcher.CmsLauncherManager |
getLauncherManager()
Get the launcher manager used with this instance of CmsObject. |
int |
getLimitedWorkplacePort()
This is the port the workplace access is limited to. |
java.lang.String |
getLinkSubstitution(java.lang.String link)
Replaces the link according to the rules and registers it to the requestcontex if we are in export modus. |
java.util.Vector |
getLoggedInUsers()
Returns a list of all currently logged in users. |
int |
getMode()
Returns the mode this cmsObject is runnig in. |
java.util.Vector |
getOnlineBrokenLinks()
serches for broken links in the online project. |
com.opencms.template.cache.CmsElementCache |
getOnlineElementCache()
Gets the ElementCache used for the online project. |
com.opencms.linkmanagement.CmsPageLinks |
getPageLinks(java.lang.String page)
extracts the links of the page and returns them in a CmsPageLinks object. |
CmsGroup |
getParent(java.lang.String groupname)
Returns the parent group of a group. |
java.lang.String |
getReadingpermittedGroup(int projectId,
java.lang.String resource)
Checks which Group can read the resource and all the parent folders. |
I_CmsRegistry |
getRegistry()
Gets the Registry. |
CmsRequestContext |
getRequestContext()
Returns the current request-context. |
java.util.Vector |
getResourcesInFolder(java.lang.String folder)
Returns a Vector with the subresources for a folder. |
java.util.Vector |
getResourcesWithProperty(java.lang.String propertyDefinition)
Returns a Vector with all resources of the given type that have set the given property. |
java.util.Vector |
getResourcesWithProperty(java.lang.String propertyDefinition,
java.lang.String propertyValue,
int resourceType)
Returns a Vector with all resources of the given type that have set the given property to the given value. |
I_CmsResourceType |
getResourceType(int resourceType)
Returns a I_CmsResourceType. |
I_CmsResourceType |
getResourceType(java.lang.String resourceType)
Returns a I_CmsResourceType. |
java.lang.String |
getSiteName()
Returns the name of the current site, e.g. |
java.lang.String |
getSiteRoot(java.lang.String resourcename)
Returns the name of the current site root, e.g. |
static com.opencms.core.CmsStaticExportProperties |
getStaticExportProperties()
Returns the properties for the static export. |
java.util.Vector |
getSubFolders(java.lang.String foldername)
Returns a Vector with all subfolders of a given folder. |
java.util.Vector |
getSubFolders(java.lang.String foldername,
boolean includeDeleted)
Returns a Vector with all subfolders of a given folder. |
java.lang.String |
getTaskPar(int taskid,
java.lang.String parname)
Get a parameter value for a task. |
int |
getTaskType(java.lang.String taskname)
Get the template task id fo a given taskname. |
java.util.Vector |
getUsers()
Returns all users in the Cms. |
java.util.Vector |
getUsers(int type)
Returns all users of the given type in the Cms. |
java.util.Vector |
getUsers(int type,
java.lang.String namefilter)
Returns all users from a given type that start with a specified string |
java.util.Vector |
getUsersByLastname(java.lang.String Lastname,
int UserType,
int UserStatus,
int wasLoggedIn,
int nMax)
Gets all users with a certain Lastname. |
java.util.Vector< | |
JAVADOC
com.opencms.file.CmsObject