|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.db.CmsSecurityManager
The OpenCms security manager.
The security manager checks the permissions required for a user action invoke by the Cms object. If permissions are granted, the security manager invokes a method on the OpenCms driver manager to access the database.
Field Summary | |
protected I_CmsDbContextFactory |
m_dbContextFactory
The factory to create runtime info objects. |
protected CmsDriverManager |
m_driverManager
The initialized OpenCms driver manager to access the database. |
static int |
PERM_ALLOWED
Indicates allowed permissions. |
static int |
PERM_DENIED
Indicates denied permissions. |
static int |
PERM_FILTERED
Indicates a resource was filtered during permission check. |
static int |
PERM_NOTLOCKED
Indicates a resource was not locked for a write / control operation. |
Method Summary | |
void |
acceptTask(CmsRequestContext context,
int taskId)
Updates the state of the given task as accepted by the current user. |
void |
addUserToGroup(CmsRequestContext context,
java.lang.String username,
java.lang.String groupname)
Adds a user to a group. |
CmsUser |
addWebUser(CmsRequestContext context,
java.lang.String name,
java.lang.String password,
java.lang.String group,
java.lang.String description,
java.util.Map additionalInfos)
Creates a new web user. |
CmsUser |
addWebUser(CmsRequestContext context,
java.lang.String name,
java.lang.String password,
java.lang.String group,
java.lang.String additionalGroup,
java.lang.String description,
java.util.Map additionalInfos)
Adds a web user to the Cms. |
void |
backupProject(CmsRequestContext context,
int tagId,
long publishDate)
Creates a backup of the current project. |
void |
changeLastModifiedProjectId(CmsRequestContext context,
CmsResource resource)
Changes the project id of the resource to the current project, indicating that the resource was last modified in this project. |
void |
changeLock(CmsRequestContext context,
CmsResource resource)
Changes the lock of a resource to the current user, that is "steals" the lock from another user. |
java.util.List |
changeResourcesInFolderWithProperty(CmsRequestContext context,
CmsResource resource,
java.lang.String propertyDefinition,
java.lang.String oldValue,
java.lang.String newValue,
boolean recursive)
Returns a list with all sub resources of a given folder that have set the given property, matching the current property's value with the given old value and replacing it by a given new value. |
void |
changeUserType(CmsRequestContext context,
CmsUUID userId,
int userType)
Changes the user type of the user. |
void |
changeUserType(CmsRequestContext context,
java.lang.String username,
int userType)
Changes the user type of the user. |
void |
checkManagerOfProjectRole(CmsDbContext dbc,
CmsProject project)
Checks if the current user has management access to the given project. |
void |
checkOfflineProject(CmsDbContext dbc)
Checks if the project in the given database context is not the "Online" project, and throws an Exception if this is the case. |
protected void |
checkPermissions(CmsDbContext dbc,
CmsResource resource,
CmsPermissionSet requiredPermissions,
boolean checkLock,
CmsResourceFilter filter)
Performs a blocking permission check on a resource. |
void |
checkPermissions(CmsRequestContext context,
CmsResource resource,
CmsPermissionSet requiredPermissions,
boolean checkLock,
CmsResourceFilter filter)
Performs a blocking permission check on a resource. |
protected void |
checkPermissions(CmsRequestContext context,
CmsResource resource,
CmsPermissionSet requiredPermissions,
int permissions)
Applies the permission check result of a previous call to hasPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter) . |
void |
checkPublishPermissions(CmsDbContext dbc,
CmsPublishList publishList)
Checks if the current user has the permissions to publish the given publish list (which contains the information about the resources / project to publish). |
void |
checkPublishPermissions(CmsRequestContext context,
CmsPublishList publishList)
Checks if the current user has the permissions to publish the given publish list (which contains the information about the resources / project to publish). |
void |
checkRole(CmsDbContext dbc,
CmsRole role)
Checks if the user of the current database context has permissions to impersonate the given role. |
void |
checkRole(CmsRequestContext context,
CmsRole role)
Checks if the user of the current database context has permissions to impersonate the given role. |
void |
chflags(CmsRequestContext context,
CmsResource resource,
int flags)
Changes the resource flags of a resource. |
void |
chtype(CmsRequestContext context,
CmsResource resource,
int type)
Changes the resource type of a resource. |
protected void |
clearPermissionCache()
Clears the permission cache. |
void |
copyAccessControlEntries(CmsRequestContext context,
CmsResource source,
CmsResource destination)
Copies the access control entries of a given resource to a destination resorce. |
void |
copyResource(CmsRequestContext context,
CmsResource source,
java.lang.String destination,
int siblingMode)
Copies a resource. |
void |
copyResourceToProject(CmsRequestContext context,
CmsResource resource)
Copies a resource to the current project of the user. |
int |
countLockedResources(CmsRequestContext context,
int id)
Counts the locked resources in this project. |
int |
countLockedResources(CmsRequestContext context,
java.lang.String foldername)
Counts the locked resources in a given folder. |
CmsGroup |
createGroup(CmsRequestContext context,
java.lang.String name,
java.lang.String description,
int flags,
java.lang.String parent)
Creates a new user group. |
CmsProject |
createProject(CmsRequestContext context,
java.lang.String name,
java.lang.String description,
java.lang.String groupname,
java.lang.String managergroupname,
int projecttype)
Creates a project. |
CmsPropertyDefinition |
createPropertyDefinition(CmsRequestContext context,
java.lang.String name)
Creates a property definition. |
CmsResource |
createResource(CmsRequestContext context,
java.lang.String resourcename,
int type,
byte[] content,
java.util.List properties)
Creates a new resource of the given resource type with the provided content and properties. |
void |
createSibling(CmsRequestContext context,
CmsResource source,
java.lang.String destination,
java.util.List properties)
Creates a new sibling of the source resource. |
CmsTask |
createTask(CmsRequestContext context,
CmsUser currentUser,
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(CmsRequestContext context,
java.lang.String agentName,
java.lang.String roleName,
java.lang.String taskname,
long timeout,
int priority)
Creates a new task. |
CmsProject |
createTempfileProject(CmsRequestContext context)
Creates the project for the temporary workplace files. |
CmsUser |
createUser(CmsRequestContext context,
java.lang.String name,
java.lang.String password,
java.lang.String description,
java.util.Map additionalInfos)
Creates a new user. |
void |
deleteAllStaticExportPublishedResources(CmsRequestContext context,
int linkType)
Deletes all entries in the published resource table. |
void |
deleteBackups(CmsRequestContext context,
long timestamp,
int versions,
I_CmsReport report)
Deletes the versions from the backup tables that are older then the given timestamp and/or number of remaining versions. |
void |
deleteGroup(CmsRequestContext context,
CmsUUID groupId,
CmsUUID replacementId)
Deletes a group, where all permissions, users and childs of the group are transfered to a replacement group. |
void |
deleteGroup(CmsRequestContext context,
java.lang.String name)
Delete a user group. |
void |
deleteProject(CmsRequestContext context,
int projectId)
Deletes a project. |
void |
deletePropertyDefinition(CmsRequestContext context,
java.lang.String name)
Deletes a property definition. |
void |
deleteResource(CmsRequestContext context,
CmsResource resource,
int siblingMode)
Deletes a resource given its name. |
void |
deleteStaticExportPublishedResource(CmsRequestContext context,
java.lang.String resourceName,
int linkType,
java.lang.String linkParameter)
Deletes an entry in the published resource table. |
void |
deleteUser(CmsRequestContext context,
CmsUUID userId)
Deletes a user. |
void |
deleteUser(CmsRequestContext context,
CmsUUID userId,
CmsUUID replacementId)
Deletes a user, where all permissions and resources attributes of the user were transfered to a replacement user. |
void |
deleteUser(CmsRequestContext context,
java.lang.String username)
Deletes a user. |
void |
deleteWebUser(CmsRequestContext context,
CmsUUID userId)
Deletes a web user. |
void |
destroy()
Destroys this security manager. |
void |
endTask(CmsRequestContext context,
int taskid)
Ends a task. |
boolean |
existsResource(CmsRequestContext context,
java.lang.String resourcePath,
CmsResourceFilter filter)
Checks the availability of a resource in the VFS, using the filter. |
CmsPublishList |
fillPublishList(CmsRequestContext context,
CmsPublishList publishList)
Fills the given publish list with the the VFS resources that actually get published. |
protected void |
finalize()
|
void |
forwardTask(CmsRequestContext context,
int taskid,
java.lang.String newRoleName,
java.lang.String newUserName)
Forwards a task to a new user. |
java.util.List |
getAccessControlEntries(CmsRequestContext context,
CmsResource resource,
boolean getInherited)
Returns the list of access control entries of a resource given its name. |
CmsAccessControlList |
getAccessControlList(CmsRequestContext context,
CmsResource resource,
boolean inheritedOnly)
Returns the access control list (summarized access control entries) of a given resource. |
java.util.List |
getAllAccessibleProjects(CmsRequestContext context)
Returns all projects which are owned by the current user or which are accessible for the group of the user. |
java.util.List |
getAllBackupProjects(CmsRequestContext context)
Returns a list with all projects from history. |
java.util.List |
getAllManageableProjects(CmsRequestContext context)
Returns all projects which are owned by the current user or which are manageable for the group of the user. |
int |
getBackupTagId(CmsRequestContext context)
Returns the next version id for the published backup resources. |
java.util.List |
getChild(CmsRequestContext context,
java.lang.String groupname)
Returns all child groups of a group. |
java.util.List |
getChilds(CmsRequestContext context,
java.lang.String groupname)
Returns all child groups of a group. |
java.util.Map |
getConfigurations()
Gets the configurations of the OpenCms properties file. |
java.util.List |
getDirectGroupsOfUser(CmsRequestContext context,
java.lang.String username)
Returns the list of groups to which the user directly belongs to. |
java.util.List |
getGroups(CmsRequestContext context)
Returns all available groups. |
java.util.List |
getGroupsOfUser(CmsRequestContext context,
java.lang.String username)
Returns the groups of a user. |
java.util.List |
getGroupsOfUser(CmsRequestContext context,
java.lang.String username,
java.lang.String remoteAddress)
Returns the groups of a Cms user filtered by the specified IP address. |
CmsLock |
getLock(CmsRequestContext context,
CmsResource resource)
Returns the lock state of a resource. |
CmsGroup |
getParent(CmsRequestContext context,
java.lang.String groupname)
Returns the parent group of a group. |
CmsPermissionSetCustom |
getPermissions(CmsRequestContext context,
CmsResource resource,
CmsUser user)
Returns the set of permissions of the current user for a given resource. |
java.util.List |
getResourcesForPrincipal(CmsRequestContext context,
CmsUUID principalId,
CmsPermissionSet permissions,
boolean includeAttr)
Returns all resources associated to a given principal via an ACE with the given permissions. |
java.util.List |
getResourcesInTimeRange(CmsRequestContext context,
java.lang.String folder,
long starttime,
long endtime)
Returns a list with all sub resources of the given parent folder (and all of it's subfolders) that have been modified in the given time range. |
CmsSqlManager |
getSqlManager()
Returns an instance of the common sql manager. |
java.lang.String |
getTaskPar(CmsRequestContext context,
int taskId,
java.lang.String parName)
Returns the value of the given parameter for the given task. |
int |
getTaskType(CmsRequestContext context,
java.lang.String taskName)
Get the template task id for a given taskname. |
java.util.List |
getUsers(CmsRequestContext context)
Returns all available users. |
java.util.List |
getUsers(CmsRequestContext context,
int type)
Returns all users from a given type. |
java.util.List |
getUsersOfGroup(CmsRequestContext context,
java.lang.String groupname)
Returns a list of users in a group. |
boolean |
hasManagerOfProjectRole(CmsDbContext dbc,
CmsProject project)
Checks if the current user has management access to the given project. |
protected int |
hasPermissions(CmsDbContext dbc,
CmsResource resource,
CmsPermissionSet requiredPermissions,
boolean checkLock,
CmsResourceFilter filter)
Performs a non-blocking permission check on a resource. |
int |
hasPermissions(CmsRequestContext context,
CmsResource resource,
CmsPermissionSet requiredPermissions,
boolean checkLock,
CmsResourceFilter filter)
Performs a non-blocking permission check on a resource. |
boolean |
hasRole(CmsDbContext dbc,
CmsRole role)
Checks if the user of the current database context is a member of the given role. |
boolean |
hasRole(CmsDbContext dbc,
CmsUser user,
CmsRole role)
Checks if the given user is a member of the given role. |
boolean |
hasRole(CmsRequestContext context,
CmsRole role)
Checks if the user of the given request context is a member of at last one of the roles in the given role set. |
void |
importAccessControlEntries(CmsRequestContext context,
CmsResource resource,
java.util.List acEntries)
Writes a list of access control entries as new access control entries of a given resource. |
CmsResource |
importResource(CmsRequestContext context,
java.lang.String resourcePath,
CmsResource resource,
byte[] content,
java.util.List properties,
boolean importCase)
Creates a new resource with the provided content and properties. |
CmsUser |
importUser(CmsRequestContext context,
java.lang.String id,
java.lang.String name,
java.lang.String password,
java.lang.String description,
java.lang.String firstname,
java.lang.String lastname,
java.lang.String email,
java.lang.String address,
int flags,
int type,
java.util.Map additionalInfos)
Creates a new user by import. |
void |
init(CmsConfigurationManager configurationManager,
I_CmsDbContextFactory dbContextFactory)
Initializes this security manager with a given runtime info factory. |
boolean |
isInsideCurrentProject(CmsRequestContext context,
java.lang.String resourcename)
Checks if the specified resource is inside the current project. |
boolean |
isManagerOfProject(CmsRequestContext context)
Checks if the current user has management access to the current project. |
void |
lockResource(CmsRequestContext context,
CmsResource resource,
int mode)
Locks a resource. |
CmsUser |
loginUser(CmsRequestContext context,
java.lang.String username,
java.lang.String password,
java.lang.String remoteAddress,
int userType)
Attempts to authenticate a user into OpenCms with the given password. |
I_CmsPrincipal |
lookupPrincipal(CmsRequestContext context,
CmsUUID principalId)
Lookup and read the user or group with the given UUID. |
I_CmsPrincipal |
lookupPrincipal(CmsRequestContext context,
java.lang.String principalName)
Lookup and read the user or group with the given name. |
java.lang.String |
moveToLostAndFound(CmsRequestContext context,
java.lang.String resourcename,
boolean returnNameOnly)
Moves a resource to the "lost and found" folder. |
static CmsSecurityManager |
newInstance(CmsConfigurationManager configurationManager,
I_CmsDbContextFactory runtimeInfoFactory)
Creates a new instance of the OpenCms security manager. |
CmsUUID |
publishProject(CmsObject cms,
CmsPublishList publishList,
I_CmsReport report)
Publishes the resources of a specified publish list. |
void |
reactivateTask(CmsRequestContext context,
int taskId)
Reactivates a task. |
CmsUser |
readAgent(CmsRequestContext context,
CmsTask task)
Reads the agent of a task. |
java.util.List |
readAllBackupFileHeaders(CmsRequestContext context,
CmsResource resource)
Reads all file headers of a file. |
java.util.List |
readAllPropertyDefinitions(CmsRequestContext context)
Reads all propertydefinitions for the given mapping type. |
CmsFolder |
readAncestor(CmsRequestContext context,
CmsResource resource,
CmsResourceFilter filter)
Returns the first ancestor folder matching the filter criteria. |
CmsBackupResource |
readBackupFile(CmsRequestContext context,
int tagId,
CmsResource resource)
Returns a file from the history. |
CmsBackupProject |
readBackupProject(CmsRequestContext context,
int tagId)
Returns a backup project. |
java.util.List |
readBackupPropertyObjects(CmsRequestContext context,
CmsBackupResource resource)
Reads the list of objects that belong the the given backup resource. |
java.util.List |
readChildResources(CmsRequestContext context,
CmsResource resource,
CmsResourceFilter filter,
boolean getFolders,
boolean getFiles)
Returns the child resources of a resource, that is the resources contained in a folder. |
CmsFile |
readFile(CmsRequestContext context,
CmsResource resource,
CmsResourceFilter filter)
Reads a file resource (including it's binary content) from the VFS, using the specified resource filter. |
protected CmsFolder |
readFolder(CmsDbContext dbc,
java.lang.String resourcename,
CmsResourceFilter filter)
Reads a folder from the VFS, using the specified resource filter. |
CmsFolder |
readFolder(CmsRequestContext context,
java.lang.String resourcename,
CmsResourceFilter filter)
Reads a folder resource from the VFS, using the specified resource filter. |
java.util.List |
readGivenTasks(CmsRequestContext context,
int projectId,
java.lang.String ownerName,
int taskType,
java.lang.String orderBy,
java.lang.String sort)
Reads all given tasks from a user for a project. |
CmsGroup |
readGroup(CmsRequestContext context,
CmsProject project)
Reads the group of a project. |
CmsGroup |
readGroup(CmsRequestContext context,
CmsTask task)
Reads the group (role) of a task from the OpenCms. |
CmsGroup |
readGroup(CmsRequestContext context,
CmsUUID groupId)
Reads a group based on its id. |
CmsGroup |
readGroup(CmsRequestContext context,
java.lang.String groupname)
Reads a group based on its name. |
CmsGroup |
readManagerGroup(CmsRequestContext context,
CmsProject project)
Reads the manager group of a project. |
CmsUser |
readOriginalAgent(CmsRequestContext context,
CmsTask task)
Reads the original agent of a task. |
CmsUser |
readOwner(CmsRequestContext context,
CmsProject project)
Reads the owner of a project from the OpenCms. |
CmsUser |
readOwner(CmsRequestContext context,
CmsTask task)
Reads the owner (initiator) of a task. |
CmsUser |
readOwner(CmsRequestContext context,
CmsTaskLog log)
Reads the owner of a tasklog. |
java.util.List |
readPath(CmsRequestContext context,
int projectId,
java.lang.String path,
CmsResourceFilter filter)
Builds a list of resources for a given path. |
CmsProject |
readProject(CmsRequestContext context,
CmsTask task)
Reads a project of a given task. |
CmsProject |
readProject(int id)
Reads a project given the projects id. |
CmsProject |
readProject(java.lang.String name)
Reads a project. |
java.util.List |
readProjectLogs(CmsRequestContext context,
int projectId)
Reads all task log entries for a project. |
java.util.List |
readProjectResources(CmsRequestContext context,
CmsProject project)
Returns the list of all resource names that define the "view" of the given project. |
java.util.List |
readProjectView(CmsRequestContext context,
int projectId,
int state)
Reads all resources of a project that match a given state from the VFS. |
CmsPropertyDefinition |
readPropertyDefinition(CmsRequestContext context,
java.lang.String name)
Reads a property definition. |
CmsProperty |
readPropertyObject(CmsRequestContext context,
CmsResource resource,
java.lang.String key,
boolean search)
Reads a property object from a resource specified by a property name. |
java.util.List |
readPropertyObjects(CmsRequestContext context,
CmsResource resource,
boolean search)
Reads all property objects from a resource. |
java.util.List |
readPublishedResources(CmsRequestContext context,
CmsUUID publishHistoryId)
Reads the resources that were published in a publish task for a given publish history ID. |
protected CmsResource |
readResource(CmsDbContext dbc,
java.lang.String resourcePath,
CmsResourceFilter filter)
Reads a resource from the OpenCms VFS, using the specified resource filter. |
CmsResource |
readResource(CmsRequestContext context,
java.lang.String resourcePath,
CmsResourceFilter filter)
Reads a resource from the VFS, using the specified resource filter. |
java.util.List |
readResources(CmsRequestContext context,
CmsResource parent,
CmsResourceFilter filter,
boolean readTree)
Reads all resources below the given path matching the filter criteria, including the full tree below the path only in case the readTree
parameter is true . |
java.util.List |
readResourcesWithProperty(CmsRequestContext context,
java.lang.String path,
java.lang.String propertyDefinition)
Reads all resources that have a value set for the specified property (definition) in the given path. |
java.util.List |
readResourcesWithProperty(CmsRequestContext context,
java.lang.String path,
java.lang.String propertyDefinition,
java.lang.String value)
Reads all resources that have a value (containing the specified value) set for the specified property (definition) in the given path. |
java.util.Set |
readResponsiblePrincipals(CmsRequestContext context,
CmsResource resource)
Returns a set of users that are responsible for a specific resource. |
java.util.Set |
readResponsibleUsers(CmsRequestContext context,
CmsResource resource)
Returns a set of users that are responsible for a specific resource. |
java.util.List |
readSiblings(CmsRequestContext context,
CmsResource resource,
CmsResourceFilter filter)
Returns a List of all siblings of the specified resource, the specified resource being always part of the result set. |
java.lang.String |
readStaticExportPublishedResourceParameters(CmsRequestContext context,
java.lang.String rfsName)
Returns the parameters of a resource in the table of all published template resources. |
java.util.List |
readStaticExportResources(CmsRequestContext context,
int parameterResources,
long timestamp)
Returns a list of all template resources which must be processed during a static export. |
CmsTask |
readTask(CmsRequestContext context,
int id)
Reads the task with the given id. |
java.util.List |
readTaskLogs(CmsRequestContext context,
int taskid)
Reads log entries for a task. |
java.util.List |
readTasksForProject(CmsRequestContext context,
int projectId,
int tasktype,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a project. |
java.util.List |
readTasksForRole(CmsRequestContext context,
int projectId,
java.lang.String roleName,
int tasktype,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a role in a project. |
java.util.List |
readTasksForUser(CmsRequestContext context,
int projectId,
java.lang.String userName,
int taskType,
java.lang.String orderBy,
java.lang.String sort)
Reads all tasks for a user in a project. |
CmsUser |
readUser(CmsRequestContext context,
CmsUUID id)
Returns a user object based on the id of a user. |
CmsUser |
readUser(CmsRequestContext context,
java.lang.String username,
int type)
Returns a user object. |
CmsUser |
readUser(CmsRequestContext context,
java.lang.String username,
java.lang.String password)
Returns a user object if the password for the user is correct. |
CmsUser |
readUser(java.lang.String username)
Returns a user object. |
CmsUser |
readWebUser(CmsRequestContext context,
java.lang.String username)
Read a web user from the database. |
CmsUser |
readWebUser(CmsRequestContext context,
java.lang.String username,
java.lang.String password)
Returns a user object if the password for the user is correct. |
void |
removeAccessControlEntry(CmsRequestContext context,
CmsResource resource,
CmsUUID principal)
Removes an access control entry for a given resource and principal. |
void |
removeResourceFromProject(CmsRequestContext context,
CmsResource resource)
Removes a resource from the current project of the user. |
void |
removeUserFromGroup(CmsRequestContext context,
java.lang.String username,
java.lang.String groupname)
Removes a user from a group. |
void |
replaceResource(CmsRequestContext context,
CmsResource resource,
int type,
byte[] content,
java.util.List properties)
Replaces the content, type and properties of a resource. |
void |
resetPassword(CmsRequestContext context,
java.lang.String username,
java.lang.String oldPassword,
java.lang.String newPassword)
Resets the password for a specified user. |
void |
restoreResource(CmsRequestContext context,
CmsResource resource,
int tag)
Restores a file in the current project with a version from the backup archive. |
void |
setDateExpired(CmsRequestContext context,
CmsResource resource,
long dateExpired)
Changes the "expire" date of a resource. |
void |
setDateLastModified(CmsRequestContext context,
CmsResource resource,
long dateLastModified)
Changes the "last modified" timestamp of a resource. |
void |
setDateReleased(CmsRequestContext context,
CmsResource resource,
long dateReleased)
Changes the "release" date of a resource. |
void |
setName(CmsRequestContext context,
int taskId,
java.lang.String name)
Set a new name for a task. |
void |
setParentGroup(CmsRequestContext context,
java.lang.String groupName,
java.lang.String parentGroupName)
Sets a new parent-group for an already existing group. |
void |
setPassword(CmsRequestContext context,
java.lang.String username,
java.lang.String newPassword)
Sets the password for a user. |
void |
setPriority(CmsRequestContext context,
int taskId,
int priority)
Set priority of a task. |
void |
setTaskPar(CmsRequestContext context,
int taskId,
java.lang.String parName,
java.lang.String parValue)
Set a Parameter for a task. |
void |
setTimeout(CmsRequestContext context,
int taskId,
long timeout)
Set timeout of a task. |
void |
undoChanges(CmsRequestContext context,
CmsResource resource)
Undos all changes in the resource by restoring the version from the online project to the current offline project. |
void |
unlockProject(CmsRequestContext context,
int projectId)
Unlocks all resources in this project. |
void |
unlockResource(CmsRequestContext context,
CmsResource resource)
Unlocks a resource. |
boolean |
userInGroup(CmsRequestContext context,
java.lang.String username,
java.lang.String groupname)
Tests if a user is member of the given group. |
java.util.Map |
validateHtmlLinks(CmsObject cms,
CmsPublishList publishList,
I_CmsReport report)
Validates the HTML links in the unpublished files of the specified publish list, if a file resource type implements the interface . |
void |
validatePassword(java.lang.String password)
This method checks if a new password follows the rules for new passwords, which are defined by a Class implementing the
interface and configured in the opencms.properties file. |
void |
writeAccessControlEntry(CmsRequestContext context,
CmsResource resource,
CmsAccessControlEntry ace)
Writes an access control entries to a given resource. |
CmsFile |
writeFile(CmsRequestContext context,
CmsFile resource)
Writes a resource to the OpenCms VFS, including it's content. |
void |
writeGroup(CmsRequestContext context,
CmsGroup group)
Writes an already existing group. |
void |
writeProject(CmsRequestContext context,
CmsProject project)
Writes an already existing project. |
void |
writePropertyObject(CmsRequestContext context,
CmsResource resource,
CmsProperty property)
Writes a property for a specified resource. |
void |
writePropertyObjects(CmsRequestContext context,
CmsResource resource,
java.util.List properties)
Writes a list of properties for a specified resource. |
void |
writeResource(CmsRequestContext context,
CmsResource resource)
Writes a resource to the OpenCms VFS. |
void |
writeStaticExportPublishedResource(CmsRequestContext context,
java.lang.String resourceName,
int linkType,
java.lang.String linkParameter,
long timestamp)
Inserts an entry in the published resource table. |
void |
writeTaskLog(CmsRequestContext context,
int taskid,
java.lang.String comment)
Writes a new user tasklog for a task. |
void |
writeTaskLog(CmsRequestContext context,
int taskId,
java.lang.String comment,
int type)
Writes a new user tasklog for a task. |
void |
writeUser(CmsRequestContext context,
CmsUser user)
Updates the user information. |
void |
writeWebUser(CmsRequestContext context,
CmsUser user)
Updates the user information of a web user. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PERM_ALLOWED
public static final int PERM_DENIED
public static final int PERM_FILTERED
public static final int PERM_NOTLOCKED
protected I_CmsDbContextFactory m_dbContextFactory
protected CmsDriverManager m_driverManager
Method Detail |
public static CmsSecurityManager newInstance(CmsConfigurationManager configurationManager, I_CmsDbContextFactory runtimeInfoFactory) throws CmsInitException
configurationManager
- the configuation managerruntimeInfoFactory
- the initialized OpenCms runtime info factory
CmsInitException
- if the securtiy manager could not be initializedpublic void acceptTask(CmsRequestContext context, int taskId) throws CmsException
context
- the current request contexttaskId
- the Id of the task to accept
CmsException
- if something goes wrongpublic void addUserToGroup(CmsRequestContext context, java.lang.String username, java.lang.String groupname) throws CmsException
context
- the current request contextusername
- the name of the user that is to be added to the groupgroupname
- the name of the group
CmsException
- if operation was not succesfullpublic CmsUser addWebUser(CmsRequestContext context, java.lang.String name, java.lang.String password, java.lang.String group, java.lang.String description, java.util.Map additionalInfos) throws CmsException
A web user has no access to the workplace but is able to access personalized
functions controlled by the OpenCms.
Moreover, a web user can be created by any user, the intention being that
a "Guest" user can create a personalized account for himself.
context
- the current request contextname
- the new name for the userpassword
- the new password for the usergroup
- the default groupname for the userdescription
- the description for the useradditionalInfos
- a Map
with additional infos for the user
CmsException
- if operation was not succesfullpublic CmsUser addWebUser(CmsRequestContext context, java.lang.String name, java.lang.String password, java.lang.String group, java.lang.String additionalGroup, java.lang.String description, java.util.Map additionalInfos) throws CmsException
A web user has no access to the workplace but is able to access personalized functions controlled by the OpenCms.
context
- the current request contextname
- the new name for the userpassword
- the new password for the usergroup
- the default groupname for the useradditionalGroup
- an additional group for the userdescription
- the description for the useradditionalInfos
- a Hashtable with additional infos for the user, these infos may be stored into the Usertables (depending on the implementation)
CmsException
- if operation was not succesfullpublic void backupProject(CmsRequestContext context, int tagId, long publishDate) throws CmsException
context
- the current request contexttagId
- the version of the backuppublishDate
- the date of publishing
CmsException
- if operation was not succesfulpublic void changeLastModifiedProjectId(CmsRequestContext context, CmsResource resource) throws CmsException
context
- the current request contextresource
- theresource to apply this operation to
CmsException
- if something goes wrongI_CmsResourceType.changeLastModifiedProjectId(CmsObject, CmsSecurityManager, CmsResource)
public void changeLock(CmsRequestContext context, CmsResource resource) throws CmsException
context
- the current request contextresource
- the resource to change the lock for
CmsException
- if something goes wrongI_CmsResourceType.changeLock(CmsObject, CmsSecurityManager, CmsResource)
public java.util.List changeResourcesInFolderWithProperty(CmsRequestContext context, CmsResource resource, java.lang.String propertyDefinition, java.lang.String oldValue, java.lang.String newValue, boolean recursive) throws CmsException, CmsVfsException
context
- the current request contextresource
- the resource on which property definition values are changedpropertyDefinition
- the name of the propertydefinition to change the valueoldValue
- the old value of the propertydefinitionnewValue
- the new value of the propertydefinitionrecursive
- if true, change recursively all property values on sub-resources (only for folders)
CmsResource
's where the property value has been changed
CmsVfsException
- for now only when the search for the oldvalue failed.
CmsException
- if operation was not successfulpublic void changeUserType(CmsRequestContext context, CmsUUID userId, int userType) throws CmsException
context
- the current request contextuserId
- the id of the user to changeuserType
- the new usertype of the user
CmsException
- if something goes wrongpublic void changeUserType(CmsRequestContext context, java.lang.String username, int userType) throws CmsException
Only the administrator can change the type.
context
- the current request contextusername
- the name of the user to changeuserType
- the new usertype of the user
CmsException
- if something goes wrongpublic void checkManagerOfProjectRole(CmsDbContext dbc, CmsProject project) throws CmsRoleViolationException
dbc
- the current database contextproject
- the project to check
CmsRoleViolationException
- if the user does not have the required role permissionspublic void checkOfflineProject(CmsDbContext dbc) throws CmsVfsException
This is used to ensure a user is in an "Offline" project before write access to VFS resources is granted.
dbc
- the current OpenCms users database context
CmsVfsException
- if the project in the given database context is the "Online" projectpublic void checkPermissions(CmsRequestContext context, CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter) throws CmsException, CmsSecurityException
If the required permissions are not satisfied by the permissions the user has on the resource, an exception is thrown.
context
- the current request contextresource
- the resource on which permissions are requiredrequiredPermissions
- the set of permissions required to access the resourcecheckLock
- if true, the lock status of the resource is also checkedfilter
- the filter for the resource
CmsException
- in case of any i/o error
CmsSecurityException
- if the required permissions are not satisfiedcheckPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, int)
public void checkPublishPermissions(CmsDbContext dbc, CmsPublishList publishList) throws CmsException, CmsMultiException
dbc
- the current OpenCms users database contextpublishList
- the publish list to check (contains the information about the resources / project to publish)
CmsException
- if the user does not have the required permissions becasue of project lock state
CmsMultiException
- if issues occur like a direct publish is attempted on a resource
whose parent folder is new or deleted in the offline project,
or if the current user has no management access to the current projectpublic void checkPublishPermissions(CmsRequestContext context, CmsPublishList publishList) throws CmsException, CmsMultiException
context
- the current request contextpublishList
- the publish list to check (contains the information about the resources / project to publish)
CmsException
- if the user does not have the required permissions becasue of project lock state
CmsMultiException
- if issues occur like a direct publish is attempted on a resource
whose parent folder is new or deleted in the offline project,
or if the current user has no management access to the current projectpublic void checkRole(CmsDbContext dbc, CmsRole role) throws CmsRoleViolationException
dbc
- the current OpenCms users database contextrole
- the role to check
CmsRoleViolationException
- if the user does not have the required role permissionspublic void checkRole(CmsRequestContext context, CmsRole role) throws CmsRoleViolationException
context
- the current request contextrole
- the role to check
CmsRoleViolationException
- if the user does not have the required role permissionspublic void chflags(CmsRequestContext context, CmsResource resource, int flags) throws CmsException, CmsSecurityException
The resource flags are used to indicate various "special" conditions for a resource. Most notably, the "internal only" setting which signals that a resource can not be directly requested with it's URL.
context
- the current request contextresource
- the resource to change the flags forflags
- the new resource flags for this resource
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource ((CmsPermissionSet.ACCESS_WRITE
required).I_CmsResourceType.chflags(CmsObject, CmsSecurityManager, CmsResource, int)
public void chtype(CmsRequestContext context, CmsResource resource, int type) throws CmsException, CmsSecurityException
OpenCms handles resources according to the resource type, not the file suffix. This is e.g. why a JSP in OpenCms can have the suffix ".html" instead of ".jsp" only. Changing the resource type makes sense e.g. if you want to make a plain text file a JSP resource, or a binary file an image, etc.
context
- the current request contextresource
- the resource to change the type fortype
- the new resource type for this resource
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource ((CmsPermissionSet.ACCESS_WRITE
required)).I_CmsResourceType.chtype(CmsObject, CmsSecurityManager, CmsResource, int)
,
CmsObject.chtype(String, int)
public void copyAccessControlEntries(CmsRequestContext context, CmsResource source, CmsResource destination) throws CmsException, CmsSecurityException
Already existing access control entries of the destination resource are removed.
context
- the current request contextsource
- the resource to copy the access control entries fromdestination
- the resource to which the access control entries are copied
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (CmsPermissionSet.ACCESS_CONTROL
required).public void copyResource(CmsRequestContext context, CmsResource source, java.lang.String destination, int siblingMode) throws CmsException, CmsSecurityException
You must ensure that the destination path is an absolute, valid and existing VFS path. Relative paths from the source are currently not supported.
The copied resource will always be locked to the current user after the copy operation.
In case the target resource already exists, it is overwritten with the source resource.
The siblingMode
parameter controls how to handle siblings
during the copy operation.
Possible values for this parameter are:
context
- the current request contextsource
- the resource to copydestination
- the name of the copy destination with complete pathsiblingMode
- indicates how to handle siblings during copy
CmsException
- if something goes wrong
CmsSecurityException
- if resource could not be copiedCmsObject.copyResource(String, String, int)
,
I_CmsResourceType.copyResource(CmsObject, CmsSecurityManager, CmsResource, String, int)
public void copyResourceToProject(CmsRequestContext context, CmsResource resource) throws CmsException, CmsRoleViolationException
context
- the current request contextresource
- the resource to apply this operation to
CmsException
- if something goes wrong
CmsRoleViolationException
- if the current user does not have management access to the project.I_CmsResourceType.copyResourceToProject(CmsObject, CmsSecurityManager, CmsResource)
public int countLockedResources(CmsRequestContext context, int id) throws CmsException, CmsRoleViolationException
context
- the current request contextid
- the id of the project
CmsException
- if something goes wrong
CmsRoleViolationException
- if the current user does not have management access to the project.public int countLockedResources(CmsRequestContext context, java.lang.String foldername) throws CmsException
context
- the current request contextfoldername
- the folder to search in
CmsException
- if something goes wrongpublic CmsGroup createGroup(CmsRequestContext context, java.lang.String name, java.lang.String description, int flags, java.lang.String parent) throws CmsException, CmsRoleViolationException
context
- the current request contextname
- the name of the new groupdescription
- the description for the new groupflags
- the flags for the new groupparent
- the name of the parent group (or null
)
CmsGroup
object representing the newly created group
CmsException
- if operation was not successful.
CmsRoleViolationException
- if the role CmsRole.ACCOUNT_MANAGER
is not owned by the current user.public CmsProject createProject(CmsRequestContext context, java.lang.String name, java.lang.String description, java.lang.String groupname, java.lang.String managergroupname, int projecttype) throws CmsException, CmsRoleViolationException
context
- the current request contextname
- the name of the project to createdescription
- the description of the projectgroupname
- the project user group to be setmanagergroupname
- the project manager group to be setprojecttype
- the type of the project
CmsException
- if something goes wrong
CmsRoleViolationException
- if the current user does not own the role CmsRole.PROJECT_MANAGER
.public CmsPropertyDefinition createPropertyDefinition(CmsRequestContext context, java.lang.String name) throws CmsException, CmsSecurityException, CmsRoleViolationException
Property definitions are valid for all resource types.
context
- the current request contextname
- the name of the property definition to create
CmsException
- if something goes wrong
CmsSecurityException
- if the current project is online.
CmsRoleViolationException
- if the current user does not own the role CmsRole.PROPERTY_MANAGER
.public CmsResource createResource(CmsRequestContext context, java.lang.String resourcename, int type, byte[] content, java.util.List properties) throws CmsException
If the provided content is null and the resource is not a folder, the content will be set to an empty byte array.
context
- the current request contextresourcename
- the name of the resource to create (full path)type
- the type of the resource to createcontent
- the content for the new resourceproperties
- the properties for the new resource
CmsException
- if something goes wrongI_CmsResourceType.createResource(CmsObject, CmsSecurityManager, String, byte[], List)
public void createSibling(CmsRequestContext context, CmsResource source, java.lang.String destination, java.util.List properties) throws CmsException
context
- the current request contextsource
- the resource to create a sibling fordestination
- the name of the sibling to create with complete pathproperties
- the individual properties for the new sibling
CmsException
- if something goes wrongI_CmsResourceType.createSibling(CmsObject, CmsSecurityManager, CmsResource, String, List)
public CmsTask createTask(CmsRequestContext context, CmsUser currentUser, int projectid, java.lang.String agentName, java.lang.String roleName, java.lang.String taskName, java.lang.String taskComment, int taskType, long timeout, int priority) throws CmsException
context
- the current request contextcurrentUser
- the current userprojectid
- the current project idagentName
- user who will edit the taskroleName
- usergroup for the tasktaskName
- name of the tasktaskType
- type of the tasktaskComment
- description of the tasktimeout
- time when the task must finishedpriority
- Id for the priority
CmsException
- if something goes wrongpublic CmsTask createTask(CmsRequestContext context, java.lang.String agentName, java.lang.String roleName, java.lang.String taskname, long timeout, int priority) throws CmsException
This is just a more limited version of the
method, where: createTask(CmsRequestContext, CmsUser, int, String, String, String, String, int, long, int)
context
- the current request contextagentName
- the user who will edit the taskroleName
- a usergroup for the tasktaskname
- the name of the tasktimeout
- the time when the task must finishedpriority
- the id for the priority of the task
CmsException
- if something goes wrongpublic CmsProject createTempfileProject(CmsRequestContext context) throws CmsException
context
- the current request context
CmsException
- if something goes wrongpublic CmsUser createUser(CmsRequestContext context, java.lang.String name, java.lang.String password, java.lang.String description, java.util.Map additionalInfos) throws CmsException, CmsRoleViolationException
context
- the current request contextname
- the name for the new userpassword
- the password for the new userdescription
- the description for the new useradditionalInfos
- the additional infos for the user
CmsException
- if something goes wrong
CmsRoleViolationException
- if the current user does not own the rule CmsRole.ACCOUNT_MANAGER
CmsObject.createUser(String, String, String, Map)
public void deleteAllStaticExportPublishedResources(CmsRequestContext context, int linkType) throws CmsException
context
- the current request contextlinkType
- the type of resource deleted (0= non-paramter, 1=parameter)
CmsException
- if something goes wrongpublic void deleteBackups(CmsRequestContext context, long timestamp, int versions, I_CmsReport report) throws CmsException, CmsRoleViolationException
The number of verions always wins, i.e. if the given timestamp would delete more versions than given in the versions parameter, the timestamp will be ignored.
Deletion will delete file header, content and properties.
context
- the current request contexttimestamp
- timestamp which defines the date after which backup resources must be deletedversions
- the number of versions per file which should kept in the systemreport
- the report for output logging
CmsException
- if operation was not succesful
CmsRoleViolationException
- if the current user does not own the rule CmsRole.HISTORY_MANAGER
public void deleteGroup(CmsRequestContext context, CmsUUID groupId, CmsUUID replacementId) throws CmsException, CmsRoleViolationException, CmsSecurityException
context
- the current request contextgroupId
- the id of the group to be deletedreplacementId
- the id of the group to be transfered, can be null
CmsException
- if operation was not succesful
CmsSecurityException
- if the group is a default group.
CmsRoleViolationException
- if the current user does not own the rule CmsRole.ACCOUNT_MANAGER
public void deleteGroup(CmsRequestContext context, java.lang.String name) throws CmsException, CmsRoleViolationException, CmsSecurityException
Only groups that contain no subgroups can be deleted.
context
- the current request contextname
- the name of the group that is to be deleted
CmsException
- if operation was not succesful
CmsSecurityException
- if the group is a default group.
CmsRoleViolationException
- if the current user does not own the rule CmsRole.ACCOUNT_MANAGER
public void deleteProject(CmsRequestContext context, int projectId) throws CmsException, CmsRoleViolationException
All modified resources currently inside this project will be reset to their online state.
context
- the current request contextprojectId
- the ID of the project to be deleted
CmsException
- if something goes wrong
CmsRoleViolationException
- if the current user does not own management access to the projectpublic void deletePropertyDefinition(CmsRequestContext context, java.lang.String name) throws CmsException, CmsSecurityException, CmsRoleViolationException
context
- the current request contextname
- the name of the property definition to delete
CmsException
- if something goes wrong
CmsSecurityException
- if the project to delete is the "Online" project
CmsRoleViolationException
- if the current user does not own the role CmsRole.PROPERTY_MANAGER
public void deleteResource(CmsRequestContext context, CmsResource resource, int siblingMode) throws CmsException, CmsSecurityException
The siblingMode
parameter controls how to handle siblings
during the delete operation.
Possible values for this parameter are:
context
- the current request contextresource
- the name of the resource to delete (full path)siblingMode
- indicates how to handle siblings of the deleted resource
CmsException
- if something goes wrong
CmsSecurityException
- if the user does not have CmsPermissionSet.ACCESS_WRITE
on the given resource.I_CmsResourceType.deleteResource(CmsObject, CmsSecurityManager, CmsResource, int)
public void deleteStaticExportPublishedResource(CmsRequestContext context, java.lang.String resourceName, int linkType, java.lang.String linkParameter) throws CmsException
context
- the current request contextresourceName
- The name of the resource to be deleted in the static exportlinkType
- the type of resource deleted (0= non-paramter, 1=parameter)linkParameter
- the parameters ofthe resource
CmsException
- if something goes wrongpublic void deleteUser(CmsRequestContext context, CmsUUID userId) throws CmsException
context
- the current request contextuserId
- the Id of the user to be deleted
CmsException
- if something goes wrongpublic void deleteUser(CmsRequestContext context, CmsUUID userId, CmsUUID replacementId) throws CmsException
context
- the current request contextuserId
- the id of the user to be deletedreplacementId
- the id of the user to be transfered
CmsException
- if operation was not successfulpublic void deleteUser(CmsRequestContext context, java.lang.String username) throws CmsException
context
- the current request contextusername
- the name of the user to be deleted
CmsException
- if something goes wrongpublic void deleteWebUser(CmsRequestContext context, CmsUUID userId) throws CmsException
context
- the current request contextuserId
- the Id of the web user to be deleted
CmsException
- if something goes wrongpublic void destroy() throws java.lang.Throwable
java.lang.Throwable
- if something goes wrongpublic void endTask(CmsRequestContext context, int taskid) throws CmsException
context
- the current request contexttaskid
- the ID of the task to end
CmsException
- if something goes wrongpublic boolean existsResource(CmsRequestContext context, java.lang.String resourcePath, CmsResourceFilter filter)
CmsResourceFilter.DEFAULT
filter.
A resource may be of type
or
CmsFile
.CmsFolder
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
will only return currently
"valid" resources, while using CmsResourceFilter.DEFAULT
will ignore the date release / date expired information of the resource.CmsResourceFilter.IGNORE_EXPIRATION
This method also takes into account the user permissions, so if
the given resource exists, but the current user has not the required
permissions, then this method will return false
.
context
- the current request contextresourcePath
- the name of the resource to read (full path)filter
- the resource filter to use while reading
true
if the resource is availableCmsObject.existsResource(String, CmsResourceFilter)
,
CmsObject.existsResource(String)
public CmsPublishList fillPublishList(CmsRequestContext context, CmsPublishList publishList) throws CmsException
Please refer to the source code of this method for the rules on how to decide whether a
new/changed/deleted
object can be published or not.CmsResource
context
- the current request contextpublishList
- must be initialized with basic publish information (Project or direct publish operation)
CmsException
- if something goes wrongCmsPublishList
public void forwardTask(CmsRequestContext context, int taskid, java.lang.String newRoleName, java.lang.String newUserName) throws CmsException
context
- the current request contexttaskid
- the Id of the task to forwardnewRoleName
- the new group name for the tasknewUserName
- the new user who gets the task. if it is empty, a new agent will automatic selected
CmsException
- if something goes wrongpublic java.util.List getAccessControlEntries(CmsRequestContext context, CmsResource resource, boolean getInherited) throws CmsException
context
- the current request contextresource
- the resource to read the access control entries forgetInherited
- true if the result should include all access control entries inherited by parent folders
CmsAccessControlEntry
objects defining all permissions for the given resource
CmsException
- if something goes wrongpublic CmsAccessControlList getAccessControlList(CmsRequestContext context, CmsResource resource, boolean inheritedOnly) throws CmsException
If inheritedOnly
is set, only inherited access control entries are returned.
context
- the current request contextresource
- the resourceinheritedOnly
- skip non-inherited entries if set
CmsException
- if something goes wrongpublic java.util.List getAllAccessibleProjects(CmsRequestContext context) throws CmsException
context
- the current request context
CmsProject
CmsException
- if something goes wrongpublic java.util.List getAllBackupProjects(CmsRequestContext context) throws CmsException
context
- the current request context
CmsBackupProject
objects
with all projects from history.
CmsException
- if operation was not succesfulpublic java.util.List getAllManageableProjects(CmsRequestContext context) throws CmsException
context
- the current request context
CmsProject
CmsException
- if operation was not succesfulpublic int getBackupTagId(CmsRequestContext context)
context
- the current request context
public java.util.List getChild(CmsRequestContext context, java.lang.String groupname) throws CmsException
context
- the current request contextgroupname
- the name of the group
CmsGroup
objects or null
CmsException
- if operation was not succesfulpublic java.util.List getChilds(CmsRequestContext context, java.lang.String groupname) throws CmsException
This method also returns all sub-child groups of the current group.
context
- the current request contextgroupname
- the name of the group
CmsGroup
objects or null
CmsException
- if operation was not succesfulpublic java.util.Map getConfigurations()
public java.util.List getDirectGroupsOfUser(CmsRequestContext context, java.lang.String username) throws CmsException
context
- the current request contextusername
- The name of the user
CmsGroup
objects
CmsException
- if operation was not succesfulpublic java.util.List getGroups(CmsRequestContext context) throws CmsException
context
- the current request context
CmsGroup
objects
CmsException
- if operation was not succesfulpublic java.util.List getGroupsOfUser(CmsRequestContext context, java.lang.String username) throws CmsException
context
- the current request contextusername
- the name of the user
CmsGroup
objects
CmsException
- if operation was not succesfulpublic java.util.List getGroupsOfUser(CmsRequestContext context, java.lang.String username, java.lang.String remoteAddress) throws CmsException
context
- the current request contextusername
- the name of the userremoteAddress
- the IP address to filter the groups in the result list
CmsGroup
objects filtered by the specified IP address
CmsException
- if operation was not succesfulpublic CmsLock getLock(CmsRequestContext context, CmsResource resource) throws CmsException
context
- the current request contextresource
- the resource to return the lock state for
CmsException
- if something goes wrongpublic CmsGroup getParent(CmsRequestContext context, java.lang.String groupname) throws CmsException
context
- the current request contextgroupname
- the name of the group
null
CmsException
- if operation was not succesfulpublic CmsPermissionSetCustom getPermissions(CmsRequestContext context, CmsResource resource, CmsUser user) throws CmsException
context
- the current request contextresource
- the resourceuser
- the user
CmsException
- if something goes wrongpublic java.util.List getResourcesForPrincipal(CmsRequestContext context, CmsUUID principalId, CmsPermissionSet permissions, boolean includeAttr) throws CmsException
If the includeAttr
flag is set it returns also all resources associated to
a given principal through some of following attributes.
context
- the current request contextprincipalId
- the id of the principalpermissions
- a set of permissions to match, can be null
for all ACEsincludeAttr
- a flag to include resources associated by attributes
CmsResource
objects
CmsException
- if something goes wrongpublic java.util.List getResourcesInTimeRange(CmsRequestContext context, java.lang.String folder, long starttime, long endtime) throws CmsException
The result list is descending sorted (newest resource first).
context
- the current request contextfolder
- the folder to get the subresources fromstarttime
- the begin of the time rangeendtime
- the end of the time range
CmsResource
objects
that have been modified in the given time range.
CmsException
- if operation was not succesfulpublic CmsSqlManager getSqlManager()
public java.lang.String getTaskPar(CmsRequestContext context, int taskId, java.lang.String parName) throws CmsException
context
- the current request contexttaskId
- the Id of the taskparName
- name of the parameter
CmsException
- if something goes wrongpublic int getTaskType(CmsRequestContext context, java.lang.String taskName) throws CmsException
context
- the current request contexttaskName
- name of the task
CmsException
- if something goes wrongpublic java.util.List getUsers(CmsRequestContext context) throws CmsException
context
- the current request context
CmsUser
objects
CmsException
- if operation was not succesfulpublic java.util.List getUsers(CmsRequestContext context, int type) throws CmsException
context
- the current request contexttype
- the type of the users
CmsUser
objects of the given type
CmsException
- if operation was not succesfulpublic java.util.List getUsersOfGroup(CmsRequestContext context, java.lang.String groupname) throws CmsException
context
- the current request contextgroupname
- the name of the group to list users from
CmsUser
objects in the group
CmsException
- if operation was not succesfulpublic boolean hasManagerOfProjectRole(CmsDbContext dbc, CmsProject project)
dbc
- the current database contextproject
- the project to check
true
, if the user has management access to the projectpublic int hasPermissions(CmsRequestContext context, CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter) throws CmsException
This test will not throw an exception in case the required permissions are not available for the requested operation. Instead, it will return one of the following values:
context
- the current request contextresource
- the resource on which permissions are requiredrequiredPermissions
- the set of permissions required for the operationcheckLock
- if true, a lock for the current user is required for
all write operations, if false it's ok to write as long as the resource
is not locked by another userfilter
- the resource filter to use
PERM_ALLOWED
if the user has sufficient permissions on the resource
for the requested operation
CmsException
- in case of i/o errors (NOT because of insufficient permissions)hasPermissions(CmsDbContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter)
public boolean hasRole(CmsDbContext dbc, CmsRole role)
dbc
- the current OpenCms users database contextrole
- the role to check
true
if the user of the current database context is at a member of at last
one of the roles in the given role setpublic boolean hasRole(CmsDbContext dbc, CmsUser user, CmsRole role)
dbc
- the current OpenCms users database contextuser
- the user to check the role forrole
- the role to check
true
if the user of the current database context is at a member of at last
one of the roles in the given role setpublic boolean hasRole(CmsRequestContext context, CmsRole role)
context
- the current request contextrole
- the role to check
true
if the user of given request context is at a member of at last
one of the roles in the given role setpublic void importAccessControlEntries(CmsRequestContext context, CmsResource resource, java.util.List acEntries) throws CmsException, CmsSecurityException
Already existing access control entries of this resource are removed before.
Access is granted, if:
context
- the current request contextresource
- the resourceacEntries
- a list of CmsAccessControlEntry
objects
CmsException
- if something goes wrong
CmsSecurityException
- if the required permissions are not satisfiedpublic CmsResource importResource(CmsRequestContext context, java.lang.String resourcePath, CmsResource resource, byte[] content, java.util.List properties, boolean importCase) throws CmsException
The content
parameter may be null if the resource id already exists.
If so, the created resource will be made a sibling of the existing resource,
the existing content will remain unchanged.
This is used during file import for import of siblings as the
manifest.xml
only contains one binary copy per file.
If the resource id exists but the content
is not null,
the created resource will be made a sibling of the existing resource,
and both will share the new content.
Note: the id used to identify the content record (pk of the record) is generated on each call of this method (with valid content) !
context
- the current request contextresourcePath
- the name of the resource to create (full path)resource
- the new resource to createcontent
- the content for the new resourceproperties
- the properties for the new resourceimportCase
- if true, signals that this operation is done while importing resource, causing different lock behaviour and potential "lost and found" usage
CmsException
- if something goes wrongpublic CmsUser importUser(CmsRequestContext context, java.lang.String id, java.lang.String name, java.lang.String password, java.lang.String description, java.lang.String firstname, java.lang.String lastname, java.lang.String email, java.lang.String address, int flags, int type, java.util.Map additionalInfos) throws CmsException, CmsRoleViolationException
context
- the current request contextid
- the id of the username
- the new name for the userpassword
- the new password for the userdescription
- the description for the userfirstname
- the firstname of the userlastname
- the lastname of the useremail
- the email of the useraddress
- the address of the userflags
- the flags for a user (for example I_CmsPrincipal.FLAG_ENABLED
)type
- the type of the useradditionalInfos
- the additional user infos
CmsException
- if something goes wrong
CmsRoleViolationException
- if the role CmsRole.ACCOUNT_MANAGER
is not owned by the current user.public void init(CmsConfigurationManager configurationManager, I_CmsDbContextFactory dbContextFactory) throws CmsInitException
configurationManager
- the configurationManagerdbContextFactory
- the initialized OpenCms runtime info factory
CmsInitException
- if the initialization failspublic boolean isInsideCurrentProject(CmsRequestContext context, java.lang.String resourcename)
The project "view" is determined by a set of path prefixes. If the resource starts with any one of this prefixes, it is considered to be "inside" the project.
context
- the current request contextresourcename
- the specified resource name (full path)
true
, if the specified resource is inside the current projectpublic boolean isManagerOfProject(CmsRequestContext context)
context
- the current request context
true
, if the user has management access to the current projectpublic void lockResource(CmsRequestContext context, CmsResource resource, int mode) throws CmsException
The mode
parameter controls what kind of lock is used.
Possible values for this parameter are:
context
- the current request contextresource
- the resource to lockmode
- flag indicating the mode for the lock
CmsException
- if something goes wrongCmsObject.lockResource(String, int)
,
I_CmsResourceType.lockResource(CmsObject, CmsSecurityManager, CmsResource, int)
public CmsUser loginUser(CmsRequestContext context, java.lang.String username, java.lang.String password, java.lang.String remoteAddress, int userType) throws CmsException
context
- the current request contextusername
- the name of the user to be logged inpassword
- the password of the userremoteAddress
- the ip address of the requestuserType
- the user type to log in (System user or Web user)
CmsException
- if the login was not succesfulpublic I_CmsPrincipal lookupPrincipal(CmsRequestContext context, CmsUUID principalId)
context
- the current request contextprincipalId
- the UUID of the principal to lookup
null
public I_CmsPrincipal lookupPrincipal(CmsRequestContext context, java.lang.String principalName)
context
- the current request contextprincipalName
- the name of the principal to lookup
null
public java.lang.String moveToLostAndFound(CmsRequestContext context, java.lang.String resourcename, boolean returnNameOnly) throws CmsException
The method can also be used to check get the name of a resource
in the "lost and found" folder only without actually moving the
the resource. To do this, the returnNameOnly
flag
must be set to true
.
In general, it is the same name as the given resource has, the only exception is if a resource in the "lost and found" folder with the same name already exists. In such case, a counter is added to the resource name.
context
- the current request contextresourcename
- the name of the resource to apply this operation toreturnNameOnly
- if true
, only the name of the resource in the "lost and found"
folder is returned, the move operation is not really performed
CmsException
- if something goes wrongCmsObject.moveToLostAndFound(String)
,
CmsObject.getLostAndFoundName(String)
public CmsUUID publishProject(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException
cms
- the current request contextpublishList
- a publish listreport
- an instance of I_CmsReport
to print messages
CmsException
- if something goes wrongfillPublishList(CmsRequestContext, CmsPublishList)
public void reactivateTask(CmsRequestContext context, int taskId) throws CmsException
Setting its state to
and
the percentage to zero.CmsTaskService.TASK_STATE_STARTED
context
- the current request contexttaskId
- the id of the task to reactivate
CmsException
- if something goes wrongpublic CmsUser readAgent(CmsRequestContext context, CmsTask task) throws CmsException
context
- the current request contexttask
- the task to read the agent from
CmsException
- if something goes wrongpublic java.util.List readAllBackupFileHeaders(CmsRequestContext context, CmsResource resource) throws CmsException
context
- the current request contextresource
- the resource to be read
CmsBackupResource
objects, read from the Cms
CmsException
- if something goes wrongpublic java.util.List readAllPropertyDefinitions(CmsRequestContext context) throws CmsException
context
- the current request context
CmsPropertyDefinition
objects (may be empty)
CmsException
- if something goes wrongpublic CmsFolder readAncestor(CmsRequestContext context, CmsResource resource, CmsResourceFilter filter) throws CmsException
If no folder matching the filter criteria is found, null is returned.
context
- the context of the current requestresource
- the resource to startfilter
- the resource filter to match while reading the ancestors
CmsException
- if something goes wrongpublic CmsBackupResource readBackupFile(CmsRequestContext context, int tagId, CmsResource resource) throws CmsException
context
- the current request contexttagId
- the id of the tag of the fileresource
- the resource to be read
CmsException
- if operation was not succesfulpublic CmsBackupProject readBackupProject(CmsRequestContext context, int tagId) throws CmsException
context
- the current request contexttagId
- the tagId of the project
CmsException
- if something goes wrongpublic java.util.List readBackupPropertyObjects(CmsRequestContext context, CmsBackupResource resource) throws CmsException
CmsProperty
objects that belong the the given backup resource.
context
- the current request contextresource
- the backup resource to read the properties from
CmsProperty
objects that belong the the given backup resource
CmsException
- if something goes wrongpublic java.util.List readChildResources(CmsRequestContext context, CmsResource resource, CmsResourceFilter filter, boolean getFolders, boolean getFiles) throws CmsException, CmsSecurityException
With the parameters getFolders
and getFiles
you can control what type of resources you want in the result list:
files, folders, or both.
This method is mainly used by the workplace explorer.
context
- the current request contextresource
- the resource to return the child resources forfilter
- the resource filter to usegetFolders
- if true the child folders are included in the resultgetFiles
- if true the child files are included in the result
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (read is required).public CmsFile readFile(CmsRequestContext context, CmsResource resource, CmsResourceFilter filter) throws CmsException
In case you do not need the file content,
use
instead.readResource(CmsRequestContext, String, CmsResourceFilter)
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
will only return currently
"valid" resources, while using CmsResourceFilter.DEFAULT
will ignore the date release / date expired information of the resource.CmsResourceFilter.IGNORE_EXPIRATION
context
- the current request contextresource
- the resource to be readfilter
- the filter object
CmsException
- if something goes wrongpublic CmsFolder readFolder(CmsRequestContext context, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
will only return currently
"valid" resources, while using CmsResourceFilter.DEFAULT
will ignore the date release / date expired information of the resource.CmsResourceFilter.IGNORE_EXPIRATION
context
- the current request contextresourcename
- the name of the folder to read (full path)filter
- the resource filter to use while reading
CmsException
- if something goes wrongpublic java.util.List readGivenTasks(CmsRequestContext context, int projectId, java.lang.String ownerName, int taskType, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
context
- the current request contextprojectId
- the id of the project in which the tasks are definedownerName
- the owner of the tasktaskType
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sorting of the tasks
CmsTask
objects for a user for a project
CmsException
- if operation was not successfulpublic CmsGroup readGroup(CmsRequestContext context, CmsProject project)
context
- the current request contextproject
- the project to read from
public CmsGroup readGroup(CmsRequestContext context, CmsTask task) throws CmsException
context
- the current request contexttask
- the task to read from
CmsException
- if operation was not succesfulpublic CmsGroup readGroup(CmsRequestContext context, CmsUUID groupId) throws CmsException
context
- the current request contextgroupId
- the id of the group that is to be read
CmsException
- if operation was not succesfulpublic CmsGroup readGroup(CmsRequestContext context, java.lang.String groupname) throws CmsException
context
- the current request contextgroupname
- the name of the group that is to be read
CmsException
- if operation was not succesfulpublic CmsGroup readManagerGroup(CmsRequestContext context, CmsProject project)
context
- the current request contextproject
- the project to read from
public CmsUser readOriginalAgent(CmsRequestContext context, CmsTask task) throws CmsException
context
- the current request contexttask
- the task to read the original agent from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsRequestContext context, CmsProject project) throws CmsException
context
- the current request contextproject
- the project to get the owner from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsRequestContext context, CmsTask task) throws CmsException
context
- the current request contexttask
- the task to read the owner from
CmsException
- if something goes wrongpublic CmsUser readOwner(CmsRequestContext context, CmsTaskLog log) throws CmsException
context
- the current request contextlog
- the tasklog
CmsException
- if something goes wrongpublic java.util.List readPath(CmsRequestContext context, int projectId, java.lang.String path, CmsResourceFilter filter) throws CmsException
context
- the current request contextprojectId
- the project to lookup the resourcepath
- the requested pathfilter
- a filter object (only "includeDeleted" information is used!)
CmsResource
s
CmsException
- if something goes wrongpublic CmsProject readProject(CmsRequestContext context, CmsTask task) throws CmsException
context
- the current request contexttask
- the task to read the project of
CmsException
- if something goes wrongpublic CmsProject readProject(int id) throws CmsException
id
- the id of the project
CmsException
- if something goes wrongpublic CmsProject readProject(java.lang.String name) throws CmsException
Important: Since a project name can be used multiple times, this is NOT the most efficient
way to read the project. This is only a convenience for front end developing.
Reading a project by name will return the first project with that name.
All core classes must use the id version readProject(int)
to ensure the right project is read.
name
- the name of the project
CmsException
- if something goes wrongpublic java.util.List readProjectLogs(CmsRequestContext context, int projectId) throws CmsException
context
- the current request contextprojectId
- the id of the project for which the tasklog will be read
CmsTaskLog
objects
CmsException
- if something goes wrongpublic java.util.List readProjectResources(CmsRequestContext context, CmsProject project) throws CmsException
context
- the current request contextproject
- the project to get the project resources for
String
objects
that define the "view" of the given project.
CmsException
- if something goes wrongpublic java.util.List readProjectView(CmsRequestContext context, int projectId, int state) throws CmsException
Possible values for the state
parameter are:
CmsResource.STATE_CHANGED
: Read all "changed" resources in the projectCmsResource.STATE_NEW
: Read all "new" resources in the projectCmsResource.STATE_DELETED
: Read all "deleted" resources in the projectCmsResource.STATE_KEEP
: Read all resources either "changed", "new" or "deleted" in the project
context
- the current request contextprojectId
- the id of the project to read the file resources forstate
- the resource state to match
CmsResource
objects matching the filter criteria
CmsException
- if something goes wrongCmsObject.readProjectView(int, int)
public CmsPropertyDefinition readPropertyDefinition(CmsRequestContext context, java.lang.String name) throws CmsException
If no property definition with the given name is found,
null
is returned.
context
- the current request contextname
- the name of the property definition to read
null
if there is no property definition with the given name.
CmsException
- if something goes wrongpublic CmsProperty readPropertyObject(CmsRequestContext context, CmsResource resource, java.lang.String key, boolean search) throws CmsException
Returns
if the property is not found.CmsProperty.getNullProperty()
context
- the context of the current requestresource
- the resource where the property is mapped tokey
- the property key namesearch
- if true
, the property is searched on all parent folders of the resource.
if it's not found attached directly to the resource.
CmsProperty.getNullProperty()
if the property was not found
CmsException
- if something goes wrongpublic java.util.List readPropertyObjects(CmsRequestContext context, CmsResource resource, boolean search) throws CmsException
Returns an empty list if no properties are found.
If the search
parameter is true
, the properties of all
parent folders of the resource are also read. The results are merged with the
properties directly attached to the resource. While merging, a property
on a parent folder that has already been found will be ignored.
So e.g. if a resource has a property "Title" attached, and it's parent folder
has the same property attached but with a differrent value, the result list will
contain only the property with the value from the resource, not form the parent folder(s).
context
- the context of the current requestresource
- the resource where the property is mapped tosearch
- true
, if the properties should be searched on all parent folders if not found on the resource
CmsProperty
objects
CmsException
- if something goes wrongpublic java.util.List readPublishedResources(CmsRequestContext context, CmsUUID publishHistoryId) throws CmsException
context
- the current request contextpublishHistoryId
- unique int ID to identify each publish task in the publish history
CmsPublishedResource
objects
CmsException
- if something goes wrongpublic CmsResource readResource(CmsRequestContext context, java.lang.String resourcePath, CmsResourceFilter filter) throws CmsException
A resource may be of type
or
CmsFile
. In case of
a file, the resource will not contain the binary file content. Since reading
the binary content is a cost-expensive database operation, it's recommended
to work with resources if possible, and only read the file content when absolutly
required. To "upgrade" a resource to a file,
use CmsFolder
.CmsFile.upgrade(CmsResource, CmsObject)
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For example,
using
will only return currently
"valid" resources, while using CmsResourceFilter.DEFAULT
will ignore the date release / date expired information of the resource.CmsResourceFilter.IGNORE_EXPIRATION
context
- the current request contextresourcePath
- the name of the resource to read (full path)filter
- the resource filter to use while reading
CmsException
- if the resource could not be read for any reasonCmsObject.readResource(String, CmsResourceFilter)
,
CmsObject.readResource(String)
,
CmsFile.upgrade(CmsResource, CmsObject)
public java.util.List readResources(CmsRequestContext context, CmsResource parent, CmsResourceFilter filter, boolean readTree) throws CmsException, CmsSecurityException
readTree
parameter is true
.
context
- the current request contextparent
- the parent path to read the resources fromfilter
- the filterreadTree
- true
to read all subresources
CmsResource
objects matching the filter criteria
CmsSecurityException
- if the user has insufficient permission for the given resource (read is required).
CmsException
- if something goes wrongpublic java.util.List readResourcesWithProperty(CmsRequestContext context, java.lang.String path, java.lang.String propertyDefinition) throws CmsException
Both individual and shared properties of a resource are checked.
context
- the current request contextpath
- the folder to get the resources with the property frompropertyDefinition
- the name of the property (definition) to check for
CmsResource
objects
that have a value set for the specified property.
CmsException
- if something goes wrongpublic java.util.List readResourcesWithProperty(CmsRequestContext context, java.lang.String path, java.lang.String propertyDefinition, java.lang.String value) throws CmsException
Both individual and shared properties of a resource are checked.
context
- the current request contextpath
- the folder to get the resources with the property frompropertyDefinition
- the name of the property (definition) to check forvalue
- the string to search in the value of the property
CmsResource
objects
that have a value set for the specified property.
CmsException
- if something goes wrongpublic java.util.Set readResponsiblePrincipals(CmsRequestContext context, CmsResource resource) throws CmsException
context
- the current request contextresource
- the resource to get the responsible users from
CmsException
- if something goes wrongpublic java.util.Set readResponsibleUsers(CmsRequestContext context, CmsResource resource) throws CmsException
context
- the current request contextresource
- the resource to get the responsible users from
CmsException
- if something goes wrongpublic java.util.List readSiblings(CmsRequestContext context, CmsResource resource, CmsResourceFilter filter) throws CmsException
context
- the request contextresource
- the specified resourcefilter
- a filter object
CmsResource
s that
are siblings to the specified resource,
including the specified resource itself.
CmsException
- if something goes wrongpublic java.lang.String readStaticExportPublishedResourceParameters(CmsRequestContext context, java.lang.String rfsName) throws CmsException
context
- the current request contextrfsName
- the rfs name of the resource
CmsException
- if something goes wrongpublic java.util.List readStaticExportResources(CmsRequestContext context, int parameterResources, long timestamp) throws CmsException
context
- the current request contextparameterResources
- flag for reading resources with parameters (1) or without (0)timestamp
- for reading the data from the db
String
objects
CmsException
- if something goes wrongpublic CmsTask readTask(CmsRequestContext context, int id) throws CmsException
context
- the current request contextid
- the id for the task to read
CmsException
- if something goes wrongpublic java.util.List readTaskLogs(CmsRequestContext context, int taskid) throws CmsException
context
- the current request contexttaskid
- the task for the tasklog to read
CmsTaskLog
objects
CmsException
- if something goes wrongpublic java.util.List readTasksForProject(CmsRequestContext context, int projectId, int tasktype, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
context
- the current request contextprojectId
- the id of the project in which the tasks are defined. Can be null to select all taskstasktype
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order: C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the project
CmsException
- if operation was not successfulpublic java.util.List readTasksForRole(CmsRequestContext context, int projectId, java.lang.String roleName, int tasktype, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
context
- the current request contextprojectId
- the id of the Project in which the tasks are definedroleName
- the role who has to process the tasktasktype
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the role
CmsException
- if operation was not successfulpublic java.util.List readTasksForUser(CmsRequestContext context, int projectId, java.lang.String userName, int taskType, java.lang.String orderBy, java.lang.String sort) throws CmsException
The tasktype
parameter will filter the tasks.
The possible values for this parameter are:
CmsTaskService.TASKS_ALL
: Reads all tasksCmsTaskService.TASKS_OPEN
: Reads all open tasksCmsTaskService.TASKS_DONE
: Reads all finished tasksCmsTaskService.TASKS_NEW
: Reads all new tasks
context
- the current request contextprojectId
- the id of the Project in which the tasks are defineduserName
- the user who has to process the tasktaskType
- the type of task you want to readorderBy
- specifies how to order the taskssort
- sort order C_SORT_ASC, C_SORT_DESC, or null
CmsTask
objects for the user
CmsException
- if operation was not successfulpublic CmsUser readUser(CmsRequestContext context, CmsUUID id) throws CmsException
context
- the current request contextid
- the id of the user to read
CmsException
- if something goes wrongpublic CmsUser readUser(CmsRequestContext context, java.lang.String username, int type) throws CmsException
context
- the current request contextusername
- the name of the user that is to be readtype
- the type of the user
CmsException
- if operation was not succesfulpublic CmsUser readUser(CmsRequestContext context, java.lang.String username, java.lang.String password) throws CmsException
If the user/pwd pair is not valid a
is thrown.CmsException
context
- the current request contextusername
- the username of the user that is to be readpassword
- the password of the user that is to be read
CmsException
- if operation was not succesfulpublic CmsUser readUser(java.lang.String username) throws CmsException
username
- the name of the user that is to be read
CmsException
- if operation was not succesfulpublic CmsUser readWebUser(CmsRequestContext context, java.lang.String username) throws CmsException
context
- the current request contextusername
- the web user to read
CmsException
- if the user could not be read.public CmsUser readWebUser(CmsRequestContext context, java.lang.String username, java.lang.String password) throws CmsException
If the user/pwd pair is not valid a
is thrown.CmsException
context
- the current request contextusername
- the username of the user that is to be readpassword
- the password of the user that is to be read
CmsException
- if operation was not succesfulpublic void removeAccessControlEntry(CmsRequestContext context, CmsResource resource, CmsUUID principal) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resourceprincipal
- the id of the principal to remove the the access control entry for
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (conrol of access control is required).public void removeResourceFromProject(CmsRequestContext context, CmsResource resource) throws CmsException, CmsRoleViolationException
context
- the current request contextresource
- the resource to apply this operation to
CmsException
- if something goes wrong
CmsRoleViolationException
- if the current user does not have management access to the project.I_CmsResourceType.copyResourceToProject(CmsObject, CmsSecurityManager, CmsResource)
public void removeUserFromGroup(CmsRequestContext context, java.lang.String username, java.lang.String groupname) throws CmsException, CmsRoleViolationException
context
- the current request contextusername
- the name of the user that is to be removed from the groupgroupname
- the name of the group
CmsException
- if operation was not succesful
CmsRoleViolationException
- if the current user does not own the rule CmsRole.ACCOUNT_MANAGER
public void replaceResource(CmsRequestContext context, CmsResource resource, int type, byte[] content, java.util.List properties) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the name of the resource to apply this operation totype
- the new type of the resourcecontent
- the new content of the resourceproperties
- the new properties of the resource
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (write access permission is required).CmsObject.replaceResource(String, int, byte[], List)
,
I_CmsResourceType.replaceResource(CmsObject, CmsSecurityManager, CmsResource, int, byte[], List)
public void resetPassword(CmsRequestContext context, java.lang.String username, java.lang.String oldPassword, java.lang.String newPassword) throws CmsException, CmsSecurityException
context
- the current request contextusername
- the name of the useroldPassword
- the old passwordnewPassword
- the new password
CmsException
- if the user data could not be read from the database
CmsSecurityException
- if the specified username and old password could not be verifiedpublic void restoreResource(CmsRequestContext context, CmsResource resource, int tag) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resource to restore from the archivetag
- the tag (version) id to resource form the archive
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (write access permission is required).CmsObject.restoreResourceBackup(String, int)
,
I_CmsResourceType.restoreResourceBackup(CmsObject, CmsSecurityManager, CmsResource, int)
public void setDateExpired(CmsRequestContext context, CmsResource resource, long dateExpired) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resource to touchdateExpired
- the new expire date of the changed resource
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (write access permission is required).CmsObject.setDateExpired(String, long, boolean)
,
I_CmsResourceType.setDateExpired(CmsObject, CmsSecurityManager, CmsResource, long, boolean)
public void setDateLastModified(CmsRequestContext context, CmsResource resource, long dateLastModified) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resource to touchdateLastModified
- timestamp the new timestamp of the changed resource
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (write access permission is required).CmsObject.setDateLastModified(String, long, boolean)
,
I_CmsResourceType.setDateLastModified(CmsObject, CmsSecurityManager, CmsResource, long, boolean)
public void setDateReleased(CmsRequestContext context, CmsResource resource, long dateReleased) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resource to touchdateReleased
- the new release date of the changed resource
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (write access permission is required).CmsObject.setDateReleased(String, long, boolean)
,
I_CmsResourceType.setDateReleased(CmsObject, CmsSecurityManager, CmsResource, long, boolean)
public void setName(CmsRequestContext context, int taskId, java.lang.String name) throws CmsException
context
- the current request contexttaskId
- the Id of the task to set the percentagename
- the new name value
CmsException
- if something goes wrongpublic void setParentGroup(CmsRequestContext context, java.lang.String groupName, java.lang.String parentGroupName) throws CmsException, CmsRoleViolationException
context
- the current request contextgroupName
- the name of the group that should be writtenparentGroupName
- the name of the parent group to set,
or null
if the parent
group should be deleted.
CmsException
- if operation was not succesful
CmsRoleViolationException
- if the current user does not own the rule CmsRole.ACCOUNT_MANAGER
public void setPassword(CmsRequestContext context, java.lang.String username, java.lang.String newPassword) throws CmsException, CmsRoleViolationException
context
- the current request contextusername
- the name of the usernewPassword
- the new password
CmsException
- if operation was not succesfull
CmsRoleViolationException
- if the current user does not own the rule CmsRole.ACCOUNT_MANAGER
public void setPriority(CmsRequestContext context, int taskId, int priority) throws CmsException
context
- the current request contexttaskId
- the Id of the task to set the percentagepriority
- the priority value
CmsException
- if something goes wrongpublic void setTaskPar(CmsRequestContext context, int taskId, java.lang.String parName, java.lang.String parValue) throws CmsException
context
- the current request contexttaskId
- the Id of the taskparName
- name of the parameterparValue
- value if the parameter
CmsException
- if something goes wrongpublic void setTimeout(CmsRequestContext context, int taskId, long timeout) throws CmsException
context
- the current request contexttaskId
- the Id of the task to set the percentagetimeout
- new timeout value
CmsException
- if something goes wrongpublic void undoChanges(CmsRequestContext context, CmsResource resource) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the name of the resource to apply this operation to
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (write access permission is required).CmsObject.undoChanges(String, boolean)
,
I_CmsResourceType.undoChanges(CmsObject, CmsSecurityManager, CmsResource, boolean)
public void unlockProject(CmsRequestContext context, int projectId) throws CmsException, CmsRoleViolationException
context
- the current request contextprojectId
- the id of the project to be published
CmsException
- if something goes wrong
CmsRoleViolationException
- if the current user does not own the rule CmsRole.PROJECT_MANAGER
for the current project.public void unlockResource(CmsRequestContext context, CmsResource resource) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resource to unlock
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (write access permission is required).CmsObject.unlockResource(String)
,
I_CmsResourceType.unlockResource(CmsObject, CmsSecurityManager, CmsResource)
public boolean userInGroup(CmsRequestContext context, java.lang.String username, java.lang.String groupname) throws CmsException
context
- the current request contextusername
- the name of the user to checkgroupname
- the name of the group to check
true
, if the user is in the group; or false
otherwise
CmsException
- if operation was not succesfulpublic java.util.Map validateHtmlLinks(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws java.lang.Exception
I_CmsXmlDocumentLinkValidatable
.
cms
- the current user's Cms objectpublishList
- an OpenCms publish listreport
- a report to write the messages to
String
objects) keyed by resource names
java.lang.Exception
- if something goes wrongfillPublishList(CmsRequestContext, CmsPublishList)
public void validatePassword(java.lang.String password) throws CmsSecurityException
I_CmsPasswordHandler
interface and configured in the opencms.properties file.If this method throws no exception the password is valid.
password
- the new password that has to be checked
CmsSecurityException
- if the password is not validpublic void writeAccessControlEntry(CmsRequestContext context, CmsResource resource, CmsAccessControlEntry ace) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resourceace
- the entry to write
CmsSecurityException
- if the user has insufficient permission for the given resource (CmsPermissionSet.ACCESS_CONTROL
required).
CmsException
- if something goes wrongpublic CmsFile writeFile(CmsRequestContext context, CmsFile resource) throws CmsException, CmsSecurityException
Applies only to resources of type
i.e. resources that have a binary content attached.CmsFile
Certain resource types might apply content validation or transformation rules before the resource is actually written to the VFS. The returned result might therefore be a modified version from the provided original.
context
- the current request contextresource
- the resource to apply this operation to
CmsSecurityException
- if the user has insufficient permission for the given resource (CmsPermissionSet.ACCESS_WRITE
required).
CmsException
- if something goes wrongCmsObject.writeFile(CmsFile)
,
I_CmsResourceType.writeFile(CmsObject, CmsSecurityManager, CmsFile)
public void writeGroup(CmsRequestContext context, CmsGroup group) throws CmsException, CmsRoleViolationException
The group id has to be a valid OpenCms group id.
The group with the given id will be completely overriden
by the given data.
context
- the current request contextgroup
- the group that should be written
CmsRoleViolationException
- if the current user does not own the role CmsRole.ACCOUNT_MANAGER
for the current project.
CmsException
- if operation was not succesfullpublic void writeProject(CmsRequestContext context, CmsProject project) throws CmsRoleViolationException, CmsException
The project id has to be a valid OpenCms project id.
The project with the given id will be completely overriden
by the given data.
project
- the project that should be writtencontext
- the current request context
CmsRoleViolationException
- if the current user does not own the role CmsRole.PROJECT_MANAGER
for the current project.
CmsException
- if operation was not successfulpublic void writePropertyObject(CmsRequestContext context, CmsResource resource, CmsProperty property) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resource to write the property forproperty
- the property to write
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (CmsPermissionSet.ACCESS_WRITE
required).CmsObject.writePropertyObject(String, CmsProperty)
,
I_CmsResourceType.writePropertyObject(CmsObject, CmsSecurityManager, CmsResource, CmsProperty)
public void writePropertyObjects(CmsRequestContext context, CmsResource resource, java.util.List properties) throws CmsException, CmsSecurityException
Code calling this method has to ensure that the no properties
a, b
are contained in the specified list so that a.equals(b)
,
otherwise an exception is thrown.
context
- the current request contextresource
- the resource to write the properties forproperties
- the list of properties to write
CmsException
- if something goes wrong
CmsSecurityException
- if the user has insufficient permission for the given resource (CmsPermissionSet.ACCESS_WRITE
required).CmsObject.writePropertyObjects(String, List)
,
I_CmsResourceType.writePropertyObjects(CmsObject, CmsSecurityManager, CmsResource, List)
public void writeResource(CmsRequestContext context, CmsResource resource) throws CmsException, CmsSecurityException
context
- the current request contextresource
- the resource to write
CmsSecurityException
- if the user has insufficient permission for the given resource (CmsPermissionSet.ACCESS_WRITE
required).
CmsException
- if something goes wrongpublic void writeStaticExportPublishedResource(CmsRequestContext context, java.lang.String resourceName, int linkType, java.lang.String linkParameter, long timestamp) throws CmsException
This is done during static export.
context
- the current request contextresourceName
- The name of the resource to be added to the static exportlinkType
- the type of resource exported (0= non-paramter, 1=parameter)linkParameter
- the parameters added to the resourcetimestamp
- a timestamp for writing the data into the db
CmsException
- if something goes wrongpublic void writeTaskLog(CmsRequestContext context, int taskid, java.lang.String comment) throws CmsException
context
- the current request contexttaskid
- the Id of the taskcomment
- description for the log
CmsException
- if something goes wrongpublic void writeTaskLog(CmsRequestContext context, int taskId, java.lang.String comment, int type) throws CmsException
context
- the current request contexttaskId
- the Id of the taskcomment
- description for the logtype
- type of the tasklog. User tasktypes must be greater than 100
CmsException
- something goes wrongpublic void writeUser(CmsRequestContext context, CmsUser user) throws CmsException, CmsRoleViolationException
The user id has to be a valid OpenCms user id.
The user with the given id will be completely overriden
by the given data.
context
- the current request contextuser
- the user to be updated
CmsRoleViolationException
- if the current user does not own the rule CmsRole.ACCOUNT_MANAGER
for the current project.
CmsException
- if operation was not succesfulpublic void writeWebUser(CmsRequestContext context, CmsUser user) throws CmsException
The user id has to be a valid OpenCms user id.
The user with the given id will be completely overriden
by the given data.
context
- the current request contextuser
- the user to be updated
CmsException
- if operation was not succesfulprotected void checkPermissions(CmsDbContext dbc, CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter) throws CmsException, CmsSecurityException
If the required permissions are not satisfied by the permissions the user has on the resource, an exception is thrown.
dbc
- the current database contextresource
- the resource on which permissions are requiredrequiredPermissions
- the set of permissions required to access the resourcecheckLock
- if true, the lock status of the resource is also checkedfilter
- the filter for the resource
CmsException
- in case of any i/o error
CmsSecurityException
- if the required permissions are not satisfiedhasPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter)
protected void checkPermissions(CmsRequestContext context, CmsResource resource, CmsPermissionSet requiredPermissions, int permissions) throws CmsSecurityException, CmsLockException, CmsVfsResourceNotFoundException
hasPermissions(CmsRequestContext, CmsResource, CmsPermissionSet, boolean, CmsResourceFilter)
.
context
- the current request contextresource
- the resource on which permissions are requiredrequiredPermissions
- the set of permissions required to access the resourcepermissions
- the permissions to check
CmsSecurityException
- if the required permissions are not satisfied
CmsLockException
- if the lock status is not as required
CmsVfsResourceNotFoundException
- if the required resource has been filteredprotected void clearPermissionCache()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
Object.finalize()
protected int hasPermissions(CmsDbContext dbc, CmsResource resource, CmsPermissionSet requiredPermissions, boolean checkLock, CmsResourceFilter filter) throws CmsException
This test will not throw an exception in case the required permissions are not available for the requested operation. Instead, it will return one of the following values:
dbc
- the current database contextresource
- the resource on which permissions are requiredrequiredPermissions
- the set of permissions required for the operationcheckLock
- if true, a lock for the current user is required for
all write operations, if false it's ok to write as long as the resource
is not locked by another userfilter
- the resource filter to use
PERM_ALLOWED
if the user has sufficient permissions on the resource
for the requested operation
CmsException
- in case of i/o errors (NOT because of insufficient permissions)protected CmsFolder readFolder(CmsDbContext dbc, java.lang.String resourcename, CmsResourceFilter filter) throws CmsException
dbc
- the current database contextresourcename
- the name of the folder to read (full path)filter
- the resource filter to use while reading
CmsException
- if something goes wrongprotected CmsResource readResource(CmsDbContext dbc, java.lang.String resourcePath, CmsResourceFilter filter) throws CmsException
dbc
- the current database contextresourcePath
- the name of the resource to read (full path)filter
- the resource filter to use while reading
CmsException
- if something goes wrongCmsObject.readResource(String, CmsResourceFilter)
,
CmsObject.readResource(String)
,
CmsFile.upgrade(CmsResource, CmsObject)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |