cmsobject.java
来自「找了很久才找到到源代码」· Java 代码 · 共 1,624 行 · 第 1/5 页
JAVA
1,624 行
}
/**
* Deletes a resource given its name.<p>
*
* The <code>siblingMode</code> parameter controls how to handle siblings
* during the delete operation.<br>
*
* @param resourcename the name of the resource to delete (full path)
* @param siblingMode indicates how to handle siblings of the deleted resource
*
* @throws CmsException if something goes wrong
*
* @deprecated use {@link #deleteResource(String, CmsResource.CmsResourceDeleteMode)} method instead
*/
public void deleteResource(String resourcename, int siblingMode) throws CmsException {
deleteResource(resourcename, CmsResource.CmsResourceDeleteMode.valueOf(siblingMode));
}
/**
* Deletes a published resource entry.<p>
*
* @param resourceName The name of the resource to be deleted in the static export
* @param linkType the type of resource deleted (0= non-parameter, 1=parameter)
* @param linkParameter the parameters of the resource
*
* @throws CmsException if something goes wrong
*/
public void deleteStaticExportPublishedResource(String resourceName, int linkType, String linkParameter)
throws CmsException {
m_securityManager.deleteStaticExportPublishedResource(m_context, resourceName, linkType, linkParameter);
}
/**
* Deletes a user.<p>
*
* @param userId the id of the user to be deleted
*
* @throws CmsException if operation was not successful
*/
public void deleteUser(CmsUUID userId) throws CmsException {
m_securityManager.deleteUser(m_context, userId);
}
/**
* Deletes a user, where all permissions and resources attributes of the user
* were transfered to a replacement user.<p>
*
* @param userId the id of the user to be deleted
* @param replacementId the id of the user to be transfered, can be <code>null</code>
*
* @throws CmsException if operation was not successful
*/
public void deleteUser(CmsUUID userId, CmsUUID replacementId) throws CmsException {
m_securityManager.deleteUser(m_context, userId, replacementId);
}
/**
* Deletes a user.<p>
*
* @param username the name of the user to be deleted
*
* @throws CmsException if operation was not successful
*/
public void deleteUser(String username) throws CmsException {
m_securityManager.deleteUser(m_context, username);
}
/**
* Deletes a web user.<p>
*
* @param userId the id of the user to be deleted
*
* @throws CmsException if operation was not successful
*
* @deprecated there are no more web users, use a user without any role!
*/
public void deleteWebUser(CmsUUID userId) throws CmsException {
m_securityManager.deleteUser(m_context, userId);
}
/**
* Checks the availability of a resource in the VFS,
* using the <code>{@link CmsResourceFilter#DEFAULT}</code> filter.<p>
*
* A resource may be of type <code>{@link CmsFile}</code> or
* <code>{@link CmsFolder}</code>.<p>
*
* 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 <code>false</code>.<p>
*
* @param resourcename the name of the resource to check (full current site relative path)
*
* @return <code>true</code> if the resource is available
*
* @see #readResource(String)
* @see #existsResource(String, CmsResourceFilter)
*/
public boolean existsResource(String resourcename) {
return existsResource(resourcename, CmsResourceFilter.DEFAULT);
}
/**
* Checks the availability of a resource in the VFS,
* using the <code>{@link CmsResourceFilter#DEFAULT}</code> filter.<p>
*
* A resource may be of type <code>{@link CmsFile}</code> or
* <code>{@link CmsFolder}</code>.<p>
*
* The specified filter controls what kind of resources should be "found"
* during the read operation. This will depend on the application. For example,
* using <code>{@link CmsResourceFilter#DEFAULT}</code> will only return currently
* "valid" resources, while using <code>{@link CmsResourceFilter#IGNORE_EXPIRATION}</code>
* will ignore the date release / date expired information of the resource.<p>
*
* 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 <code>false</code>.<p>
*
* @param resourcename the name of the resource to check (full current site relative path)
* @param filter the resource filter to use while checking
*
* @return <code>true</code> if the resource is available
*
* @see #readResource(String)
* @see #readResource(String, CmsResourceFilter)
*/
public boolean existsResource(String resourcename, CmsResourceFilter filter) {
return m_securityManager.existsResource(m_context, addSiteRoot(resourcename), filter);
}
/**
* Returns the list of access control entries of a resource given its name.<p>
*
* @param resourceName the name of the resource
*
* @return a list of <code>{@link CmsAccessControlEntry}</code> objects
*
* @throws CmsException if something goes wrong
*/
public List getAccessControlEntries(String resourceName) throws CmsException {
return getAccessControlEntries(resourceName, true);
}
/**
* Returns the list of access control entries of a resource given its name.<p>
*
* @param resourceName the name of the resource
* @param getInherited <code>true</code>, if inherited access control entries should be returned, too
*
* @return a list of <code>{@link CmsAccessControlEntry}</code> objects defining all permissions for the given resource
*
* @throws CmsException if something goes wrong
*/
public List getAccessControlEntries(String resourceName, boolean getInherited) throws CmsException {
CmsResource res = readResource(resourceName, CmsResourceFilter.ALL);
return m_securityManager.getAccessControlEntries(m_context, res, getInherited);
}
/**
* Returns the access control list (summarized access control entries) of a given resource.<p>
*
* @param resourceName the name of the resource
*
* @return the access control list of the resource
*
* @throws CmsException if something goes wrong
*/
public CmsAccessControlList getAccessControlList(String resourceName) throws CmsException {
return getAccessControlList(resourceName, false);
}
/**
* Returns the access control list (summarized access control entries) of a given resource.<p>
*
* If <code>inheritedOnly</code> is set, only inherited access control entries are returned.<p>
*
* @param resourceName the name of the resource
* @param inheritedOnly if set, the non-inherited entries are skipped
*
* @return the access control list of the resource
*
* @throws CmsException if something goes wrong
*/
public CmsAccessControlList getAccessControlList(String resourceName, boolean inheritedOnly) throws CmsException {
CmsResource res = readResource(resourceName, CmsResourceFilter.ALL);
return m_securityManager.getAccessControlList(m_context, res, inheritedOnly);
}
/**
* Returns all projects which are owned by the current user or which are
* accessible for the group of the user.<p>
*
* @return a list of objects of type <code>{@link CmsProject}</code>
*
* @throws CmsException if operation was not successful
*/
public List getAllAccessibleProjects() throws CmsException {
return m_securityManager.getAllAccessibleProjects(m_context);
}
/**
* Returns a list with all projects from history.<p>
*
* @return list of <code>{@link CmsHistoryProject}</code> objects
* with all projects from history.
*
* @throws CmsException if operation was not successful
*
* @deprecated Use {@link #getAllHistoricalProjects()} instead
*/
public List getAllBackupProjects() throws CmsException {
return getAllHistoricalProjects();
}
/**
* Returns a list with all projects from history.<p>
*
* @return list of <code>{@link CmsHistoryProject}</code> objects
* with all projects from history
*
* @throws CmsException if operation was not successful
*/
public List getAllHistoricalProjects() throws CmsException {
return m_securityManager.getAllHistoricalProjects(m_context);
}
/**
* Returns all projects which are owned by the current user or which are manageable
* for the group of the user.<p>
*
* @return a list of objects of type <code>{@link CmsProject}</code>
*
* @throws CmsException if operation was not successful
*/
public List getAllManageableProjects() throws CmsException {
return m_securityManager.getAllManageableProjects(m_context);
}
/**
* Returns the next version id for the published backup resources.<p>
*
* @return int the new version id
*
* @throws CmsException if operation was not successful
*
* @deprecated this concept has been abandoned for OpenCms version 7
*/
public int getBackupTagId() throws CmsException {
return ((CmsHistoryProject)getAllHistoricalProjects().get(0)).getPublishTag() + 1;
}
/**
* Returns all child groups of a group.<p>
*
* @param groupname the name of the group
*
* @return a list of all child <code>{@link CmsGroup}</code> objects or <code>null</code>
*
* @throws CmsException if operation was not successful
*
* @deprecated use {@link #getChildren(String, boolean)} with <code>false</code> instead.
*/
public List getChild(String groupname) throws CmsException {
return getChildren(groupname, false);
}
/**
* Returns all child groups of a group.<p>
*
* @param groupname the name of the group
* @param includeSubChildren if set also returns all sub-child groups of the given group
*
* @return a list of all child <code>{@link CmsGroup}</code> objects or <code>null</code>
*
* @throws CmsException if operation was not successful
*/
public List getChildren(String groupname, boolean includeSubChildren) throws CmsException {
return m_securityManager.getChildren(m_context, groupname, includeSubChildren);
}
/**
* Returns all child groups of a group.<p>
*
* This method also returns all sub-child groups of the current group.<p>
*
* @param groupname the name of the group
*
* @return a list of all child <code>{@link CmsGroup}</code> objects or <code>null</code>
*
* @throws CmsException if operation was not successful
*
* @deprecated use {@link #getChildren(String, boolean)} with <code>true</code> instead.
*/
public List getChilds(String groupname) throws CmsException {
return getChildren(groupname, true);
}
/**
* Returns all groups to which a given user directly belongs.<p>
*
* @param username the name of the user to get all groups for
*
* @return a list of <code>{@link CmsGroup}</code> objects
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?