📄 cmsshellcommands.java
字号:
* @param filename The complete path to the resource.
* @param newType The name of the new resourcetype for this resource.
*/
public void chtype(String filename, String newType) {
try {
m_cms.chtype(filename, newType);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Clears all internal DB-Caches.
*/
public void clearcache() {
try {
m_cms.clearcache();
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Copies the file.
*
* @param source The complete path of the sourcefile.
* @param destination The complete path of the destination.
*
* @exception CmsException will be thrown, if the file couldn't be copied.
* The CmsException will also be thrown, if the user has not the rights
* for this resource.
*/
public void copyFile(String source, String destination) {
try {
m_cms.copyFile(source, destination);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Copies a folder.
*
* @param source the complete path of the sourcefolder.
* @param destination the complete path of the destinationfolder.
*/
public void copyFolder(String source, String destination) {
try {
// copy the folder with keeping the flags
m_cms.copyResource(source, destination, true);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Copies a resource.
*
* @param source the complete path of the sourcefolder.
* @param destination the complete path of the destinationfolder.
*/
public void copyResource(String source, String destination) {
try {
m_cms.copyResource(source, destination);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Copies a resource from the online project to a new, specified project.<br>
* Copying a resource will copy the file header or folder into the specified
* offline project and set its state to UNCHANGED.
*
* @param resource The name of the resource.
*/
public void copyResourceToProject(String resource) {
try {
m_cms.copyResourceToProject(resource);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Returns a copyright-string for this OpenCms.
*/
public void copyright() {
String[] copy = m_cms.copyright();
for(int i = 0;i < copy.length;i++) {
System.out.println(copy[i]);
}
}
/**
* Counts the locked resources in a project.
*
* @param id the id of the project
*/
public void countLockedResources(String id) {
try {
int intId = Integer.parseInt(id);
System.out.println(m_cms.countLockedResources(intId));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Creates a new folder.
*
* @param folder The complete path to the folder in which the new folder
* will be created.
* @param newFolderName The name of the new folder (No pathinformation allowed).
*/
public void createFolder(String folder, String newFolderName) {
try {
System.out.println(m_cms.createFolder(folder, newFolderName));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* This method creates a new module in the repository.
*
* @param String modulename the name of the module.
* @param String niceModulename another name of the module.
* @param String description the description of the module.
* @param String author the name of the author.
* @param String createDate the creation date of the module
* @param String version the version number of the module.
*/
public void createModule(String modulename, String niceModulename, String description, String author, String createDate, String version) {
// create the module
try {
I_CmsRegistry reg = m_cms.getRegistry();
int ver = Integer.parseInt(version);
long date = Long.parseLong(createDate);
reg.createModule(modulename, niceModulename, description, author, date, ver);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Creates a project.
*
* @param name The name of the project to read.
* @param description The description for the new project.
* @param groupname the name of the group to be set.
*/
public void createProject(String name, String description, String groupname, String managergroupname) {
try {
System.out.println(m_cms.createProject(name, description, groupname, managergroupname));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Creates a project.
*
* @param name The name of the project to read.
* @param description The description for the new project.
* @param groupname the name of the group to be set.
*/
public void createProject(String name, String description, String groupname, String managergroupname, String projecttype) {
try {
System.out.println(m_cms.createProject(name, description, groupname, managergroupname, Integer.parseInt(projecttype)));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Creates a new project for the temporary files.
*
* @exception CmsException if operation was not successful.
*/
public void createTempfileProject() throws CmsException
{
try {
System.out.println(m_cms.createTempfileProject());
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Creates the propertydefinition for the resource type.<BR/>
*
* @param name The name of the propertydefinition to overwrite.
* @param resourcetype The name of the resource-type for the propertydefinition.
*
* @exception CmsException Throws CmsException if something goes wrong.
*/
public void createPropertydefinition(String name, String resourcetype) throws CmsException {
try {
System.out.println(m_cms.createPropertydefinition(name, resourcetype));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Creates a new task.
* <p>
* <B>Security:</B>
* All users can create a new task.
* @param agent the User who will edit the task.
* @param role a Usergroup for the task.
* @param taskname the name of the task.
* @param taskcomment a description of the task.
* @param timeout the time when the task must finished.
* @param priority the Id for the priority of the task.
*/
public void createTask(String agentName, String roleName, String taskname, String taskcomment, String timeout, String priority) {
try {
int intPriority = Integer.parseInt(priority);
long longTimeout = Long.parseLong(timeout);
System.out.println(m_cms.createTask(agentName, roleName, taskname, taskcomment, longTimeout, intPriority));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Creates a new task.
* <p>
* <B>Security:</B>
* All users can create a new task.
*
* @param projectid the Id of the current project task of the user.
* @param agentname the User who will edit the task.
* @param rolename a Usergroup for the task.
* @param taskname a Name of the task.
* @param tasktype the type of the task.
* @param taskcomment a description of the task.
* @param timeout the time when the task must finished.
* @param priority the Id for the priority of the task.
*/
public void createTask(String projectid, String agentName, String roleName,
String taskname, String taskcomment, String tasktype, String timeout, String priority) {
try {
System.out.println(m_cms.createTask(Integer.parseInt(projectid), agentName, roleName, taskname, taskcomment,
Integer.parseInt(tasktype), Long.parseLong(timeout), Integer.parseInt(priority)));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Deletes all propertyinformation for a file or folder.
*
* @param resource The name of the resource of which the propertyinformations
* have to be deleted.
*/
public void deleteAllProperties(String resource) {
try {
m_cms.deleteAllProperties(resource);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Deletes the file.
*
* @param filename The complete path of the file.
*/
public void deleteFile(String filename) {
try {
m_cms.deleteFile(filename);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Deletes the folder.
*
* @param foldername The complete path of the folder.
*/
public void deleteFolder(String foldername) {
try {
m_cms.deleteFolder(foldername);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Deletes a Resource.
*
* @param filename the complete path of the sourcefolder.
*/
public void deleteResource(String filename) {
try {
m_cms.deleteResource(filename);
} catch (Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Undeletes the resource.
*
* @param resourcename The complete path of the resource.
*/
public void undeleteResource(String resourcename) {
try {
m_cms.undeleteResource(resourcename);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Delete a group from the Cms.<BR/>
*
* @param delgroup The name of the group that is to be deleted.
*/
public void deleteGroup(String delgroup) {
try {
m_cms.deleteGroup(delgroup);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Deletes a module from the cms.
*
* @param module The name of module to delete.
*/
public void deleteModule(String module) {
try {
I_CmsRegistry reg = m_cms.getRegistry();
reg.deleteModule(module, new Vector());
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* This method deletes the view for an module.
*
* @param String the name of the module.
*/
public void deleteModuleView(String modulename) {
try {
I_CmsRegistry reg = m_cms.getRegistry();
reg.deleteModuleView(modulename);
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Deletes a project.
*
* @param id The id of the project to delete.
*/
public void deleteProject(String id) {
try {
m_cms.deleteProject(Integer.parseInt(id));
}
catch(Exception exc) {
CmsShell.printException(exc);
}
}
/**
* Deletes a propertyinformation for a file or folder.
*
* @param resourcename The resource-name of which the propertyinformation has to be delteted.
* @param property The propertydefinition-name of which the propertyinformation has to be set.
*/
public void deleteProperty(String resourcename, String property) {
try {
m_cms.deleteProperty(resourcename, property);
}
catch(Exception exc) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -