📄 cmsobject.java
字号:
// export the resources
m_rb.exportResources(m_context.currentUser(), m_context.currentProject(), exportFile, exportPaths, this);
}
/**
* Exports cms-resources to a zip-file.
*
* @param exportFile the name (absolute Path) of the export resource (zip-file).
* @param exportPath the name (absolute Path) of folder from which should be exported.
* @param includeSystem indicates if the system resources will be included in the export.
* @param excludeUnchanged <code>true</code>, if unchanged files should be excluded.
*
* @exception CmsException if operation was not successful.
*/
public void exportResources(String exportFile, String[] exportPaths, boolean includeSystem, boolean excludeUnchanged) throws CmsException {
// export the resources
m_rb.exportResources(m_context.currentUser(), m_context.currentProject(), exportFile, exportPaths, this, includeSystem, excludeUnchanged);
}
/**
* Exports cms-resources to a zip-file.
*
* @param exportFile the name (absolute Path) of the export resource (zip-file).
* @param exportPath the name (absolute Path) of folder from which should be exported.
* @param includeSystem indicates if the system resources will be included in the export.
* @param excludeUnchanged <code>true</code>, if unchanged files should be excluded.
*
* @exception CmsException if operation was not successful.
*/
public void exportResources(String exportFile, String[] exportPaths, boolean includeSystem, boolean excludeUnchanged, boolean exportUserdata) throws CmsException {
// export the resources
m_rb.exportResources(m_context.currentUser(), m_context.currentProject(), exportFile, exportPaths, this, includeSystem, excludeUnchanged, exportUserdata);
}
/**
* Exports a resource.
*/
public CmsFile exportResource(CmsFile file) throws CmsException {
I_CmsResourceType rt = getResourceType(file.getType());
return rt.exportResource(this, file);
}
/**
* Exports channels and moduledata to zip.
*
* <B>Security:</B>
* only Administrators can do this;
*
* @param currentUser user who requestd themethod
* @param currentProject current project of the user
* @param exportFile the name (absolute Path) of the export resource (zip)
* @param exportChannels the names (absolute Path) of channels from which should be exported
* @param exportModules the names of modules from which should be exported
* @param cms the cms-object to use for the export.
*
* @exception Throws CmsException if something goes wrong.
*/
public void exportModuledata(String exportFile, String[] exportChannels, String[] exportModules) throws CmsException {
m_rb.exportModuledata(m_context.currentUser(), m_context.currentProject(), exportFile, exportChannels, exportModules, this);
}
/**
* Creates a static export in the filesystem
*
* @param startpoints the startpoints for the export.
*
* @exception CmsException if operation was not successful.
*/
public void exportStaticResources(Vector startpoints, Vector projectResources,
CmsPublishedResources changedResources) throws CmsException {
m_rb.exportStaticResources(m_context.currentUser(), m_context.currentProject(),
this, startpoints, projectResources, changedResources);
}
/**
* Creates a special CmsObject for the static export.
*
* @param .
* @exception CmsException if operation was not successful.
*/
public CmsObject getCmsObjectForStaticExport(CmsExportRequest dReq, CmsExportResponse dRes) throws CmsException{
CmsObject cmsForStaticExport = new CmsObject();
cmsForStaticExport.init(m_rb, dReq, dRes, C_USER_GUEST,
C_GROUP_GUEST, C_PROJECT_ONLINE_ID, false, new CmsElementCache(), null);
cmsForStaticExport.setLauncherManager(getLauncherManager());
return cmsForStaticExport;
}
/**
* Forwards a task to a new user.
*
* @param taskid the id of the task which will be forwarded.
* @param newRole the new group for the task.
* @param newUser the new user who gets the task.
*
* @exception CmsException if operation was not successful.
*/
public void forwardTask(int taskid, String newRoleName, String newUserName) throws CmsException {
m_rb.forwardTask(m_context.currentUser(), m_context.currentProject(), taskid, newRoleName, newUserName);
}
/**
* Returns all projects, which the current user can access.
*
* @return a Vector of objects of type <code>CmsProject</code>.
*
* @exception CmsException if operation was not successful.
*/
public Vector getAllAccessibleProjects() throws CmsException {
return (m_rb.getAllAccessibleProjects(m_context.currentUser(), m_context.currentProject()));
}
/**
* Returns all projects which are owned by the current user or which are manageable
* for the group of the user.
*
* @return a Vector of objects of type <code>CmsProject</code>.
*
* @exception CmsException if operation was not successful.
*/
public Vector getAllManageableProjects() throws CmsException {
return (m_rb.getAllManageableProjects(m_context.currentUser(), m_context.currentProject()));
}
/**
* Returns a Vector with all projects from history
*
* @return Vector with all projects from history.
*
* @exception CmsException Throws CmsException if operation was not succesful.
*/
public Vector getAllBackupProjects() throws CmsException {
return m_rb.getAllBackupProjects();
}
/**
* Returns a Vector with all export links
*
* @return Vector (Strings) with all export links.
*
* @exception CmsException Throws CmsException if operation was not succesful.
*/
public Vector getAllExportLinks() throws CmsException{
return m_rb.getAllExportLinks();
}
/**
* Returns a Hashtable with all I_CmsResourceTypes.
*
* @rerun returns a Vector with all I_CmsResourceTypes.
*
* @exception CmsException if operation was not successful.
*/
public Hashtable getAllResourceTypes() throws CmsException {
return (m_rb.getAllResourceTypes(m_context.currentUser(), m_context.currentProject()));
}
/**
* Gets information about the cache size.
* <br>
* The size of the following caching areas is returned:
* <ul>
* <li>GroupCache</li>
* <li>UserGroupCache</li>
* <li>ResourceCache</li>
* <li>SubResourceCache</li>
* <li>ProjectCache</li>
* <li>PropertyCache</li>
* <li>PropertyDefinitionCache</li>
* <li>PropertyDefinitionVectorCache</li>
* </ul>
* @ return a Hashtable with information about the size of the various cache areas.
*/
public Hashtable getCacheInfo() {
return m_rb.getCacheInfo();
}
/**
* Returns all child groups of a group.
*
* @param groupname the name of the group.
* @return groups a Vector of all child groups or null.
* @exception CmsException if operation was not successful.
*/
public Vector getChild(String groupname) throws CmsException {
return (m_rb.getChild(m_context.currentUser(), m_context.currentProject(), groupname));
}
/**
* Returns all child groups of a group.
* <br>
* This method also returns all sub-child groups of the current group.
*
* @param groupname the name of the group.
* @return groups a Vector of all child groups or null.
* @exception CmsException if operation was not successful.
*/
public Vector getChilds(String groupname) throws CmsException {
return (m_rb.getChilds(m_context.currentUser(), m_context.currentProject(), groupname));
}
/**
* Gets the configurations of the properties-file.
* @return the configurations of the properties-file.
*/
public Configurations getConfigurations() {
return m_rb.getConfigurations(getRequestContext().currentUser(), getRequestContext().currentProject());
}
/**
* Gets all groups to which a given user directly belongs.
*
* @param username the name of the user to get all groups for.
* @return a Vector of all groups of a user.
*
* @exception CmsException if operation was not successful.
*/
public Vector getDirectGroupsOfUser(String username) throws CmsException {
return (m_rb.getDirectGroupsOfUser(m_context.currentUser(), m_context.currentProject(), username));
}
/**
* Returns a Vector with all files of a given folder.
* (only the direct subfiles, not the files in subfolders)
* <br>
* Files of a folder can be read from an offline Project and the online Project.
*
* @param foldername the complete path to the folder.
*
* @return subfiles a Vector with all files of the given folder.
*
* @exception CmsException if the user has not hte appropriate rigths to access or read the resource.
*/
public Vector getFilesInFolder(String foldername) throws CmsException {
return (m_rb.getFilesInFolder(m_context.currentUser(), m_context.currentProject(), getSiteRoot(foldername), false));
}
/**
* Returns a Vector with all files of a given folder.
* <br>
* Files of a folder can be read from an offline Project and the online Project.
*
* @param foldername the complete path to the folder.
* @param includeDeleted Include if the folder is marked as deleted
*
* @return subfiles a Vector with all files of the given folder.
*
* @exception CmsException if the user has not hte appropriate rigths to access or read the resource.
*/
public Vector getFilesInFolder(String foldername, boolean includeDeleted) throws CmsException {
return (m_rb.getFilesInFolder(m_context.currentUser(), m_context.currentProject(), getSiteRoot(foldername), includeDeleted));
}
/**
* Returns a Vector with all resource-names of the resources that have set the given property to the given value.
*
* @param propertydef the name of the property-definition to check.
* @param property the value of the property for the resource.
*
* @return a Vector with all names of the resources.
*
* @exception CmsException if operation was not successful.
*/
public Vector getFilesWithProperty(String propertyDefinition, String propertyValue) throws CmsException {
return m_rb.getFilesWithProperty(m_context.currentUser(), m_context.currentProject(), propertyDefinition, propertyValue);
}
/**
* This method can be called, to determine if the file-system was changed in the past.
* <br>
* A module can compare its previously stored number with the returned number.
* If they differ, the file system has been changed.
*
* @return the number of file-system-changes.
*/
public long getFileSystemChanges() {
return (m_rb.getFileSystemChanges(m_context.currentUser(), m_context.currentProject()));
}
/**
* This method can be called, to determine if the file-system was changed in the past.
* <br>
* A module can compare its previously stored number with the returned number.
* If they differ, the file system has been changed.
*
* @return the number of file-system-changes.
*/
public long getFileSystemFolderChanges() {
return (m_rb.getFileSystemFolderChanges(m_context.currentUser(), m_context.currentProject()));
}
/**
* Returns a Vector with the complete folder-tree for this project.<br>
*
* Subfolders can be read from an offline project and the online project. <br>
*
* @return subfolders A Vector with the complete folder-tree for this project.
*
* @exception CmsException Throws CmsException if operation was not succesful.
*/
public Vector getFolderTree() throws CmsException {
return (m_rb.getFolderTree(m_context.currentUser(), m_context.currentProject(), getSiteRoot("")));
}
/**
* Returns all groups in the Cms.
*
* @return a Vector of all groups in the Cms.
*
* @exception CmsException if operation was not successful
*/
public Vector getGroups() throws CmsException {
return (m_rb.getGroups(m_context.currentUser(), m_context.currentProject()));
}
/**
* Gets all groups of a user.
*
* @param username the name of the user to get all groups for.
* @return Vector of all groups of a user.
*
* @exception CmsException if operation was not succesful.
*/
public Vector getGroupsOfUser(String username) throws CmsException {
return (m_rb.getGroupsOfUser(m_context.currentUser(), m_context.currentProject(), username));
}
/**
* Get the launcher manager used with this instance of CmsObject.
* Creation date: (10/23/00 14:50:15)
* @author Finn Nielsen
* @return com.opencms.launcher.CmsLauncherManager
*/
public com.opencms.launcher.CmsLauncherManager getLauncherManager() {
return m_launcherManager;
}
/**
* Gets the ElementCache used for the online project.
* @return CmsElementCache
*/
public CmsElementCache getOnlineElementCache(){
return OpenCms.getOnlineElementCache();
}
/**
* Replaces the link according to the rules and registers it to the
* requestcontex if we are in export modus.
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -