com.opencms.file
Class CmsObject

java.lang.Object
  |
  +--com.opencms.file.CmsObject
All Implemented Interfaces:
I_CmsConstants

public class CmsObject
extends Object
implements I_CmsConstants

This class provides access to the OpenCms and its resources.
The CmsObject encapsulates user identification and client requests and is the central object to transport information in the Cms Servlet.
All operations on the CmsObject are forwarded to the class which extends A_CmsRessourceBroker to ensure user authentification in all operations.

Version:
$Revision: 1.268.2.2 $
Author:
Andreas Schouten, Michael Emmerich, Alexander Kandzior (a.kandzior@alkacon.com), Michaela Schleich

Field Summary
 
Fields inherited from interface com.opencms.core.I_CmsConstants
C_ACCESS_DEFAULT_FLAGS, C_ACCESS_GROUP, C_ACCESS_GROUP_READ, C_ACCESS_GROUP_VISIBLE, C_ACCESS_GROUP_WRITE, C_ACCESS_INTERNAL_READ, C_ACCESS_OWNER, C_ACCESS_OWNER_READ, C_ACCESS_OWNER_VISIBLE, C_ACCESS_OWNER_WRITE, C_ACCESS_PUBLIC, C_ACCESS_PUBLIC_READ, C_ACCESS_PUBLIC_VISIBLE, C_ACCESS_PUBLIC_WRITE, C_ACCESS_READ, C_ACCESS_VISIBLE, C_ACCESS_WRITE, C_ADDITIONAL_INFO_EXPLORERSETTINGS, C_ADDITIONAL_INFO_PREFERENCES, C_ADDITIONAL_INFO_STARTSETTINGS, C_ADDITIONAL_INFO_TASKSETTINGS, C_ADDITIONAL_INFO_TOWN, C_ADDITIONAL_INFO_ZIPCODE, C_AT_LEAST_ONCE, C_CLUSTERURL, C_CONFIGURATION_CACHE, C_CONFIGURATION_CLASS, C_CONFIGURATION_REGISTRY, C_CONFIGURATION_RESOURCEBROKER, C_COPYRIGHT, C_DEFAULT_SITE, C_DELETE_HISTORY, C_ENABLE_HISTORY, C_ERRPREFIX, C_ERRSPERATOR, C_EXPORT_TAG_ACCESS, C_EXPORT_TAG_ADDRESS, C_EXPORT_TAG_CREATOR, C_EXPORT_TAG_DATE, C_EXPORT_TAG_DEFAULTGROUP, C_EXPORT_TAG_DESCRIPTION, C_EXPORT_TAG_DESTINATION, C_EXPORT_TAG_EMAIL, C_EXPORT_TAG_EXPORT, C_EXPORT_TAG_FILE, C_EXPORT_TAG_FIRSTNAME, C_EXPORT_TAG_FLAGS, C_EXPORT_TAG_GROUP, C_EXPORT_TAG_GROUPDATA, C_EXPORT_TAG_GROUPNAME, C_EXPORT_TAG_INFO, C_EXPORT_TAG_LASTMODIFIED, C_EXPORT_TAG_LASTNAME, C_EXPORT_TAG_LAUNCHER_START_CLASS, C_EXPORT_TAG_MODULEXPORT, C_EXPORT_TAG_NAME, C_EXPORT_TAG_OC_VERSION, C_EXPORT_TAG_PARENTGROUP, C_EXPORT_TAG_PASSWORD, C_EXPORT_TAG_PROJECT, C_EXPORT_TAG_PROPERTIES, C_EXPORT_TAG_PROPERTY, C_EXPORT_TAG_RECOVERYPASSWORD, C_EXPORT_TAG_SECTION, C_EXPORT_TAG_SOURCE, C_EXPORT_TAG_TYPE, C_EXPORT_TAG_USER, C_EXPORT_TAG_USERDATA, C_EXPORT_TAG_USERGROUPDATA, C_EXPORT_TAG_USERGROUPS, C_EXPORT_TAG_USERINFO, C_EXPORT_TAG_VALUE, C_EXPORT_TAG_VERSION, C_EXPORT_VERSION, C_EXPORT_XMLFILENAME, C_EXPORTONLYFILES, C_EXPORTONLYUSERS, C_EXPORTPOINT, C_EXPORTPOINT_PATH, C_EXPORTUSERSFILES, C_FCONTENT, C_FELEMENT, C_FILE, C_FILECONTENT, C_FILES_IMPORTED, C_FLAG_DISABLED, C_FLAG_ENABLED, C_FLAG_GROUP_PROJECTCOWORKER, C_FLAG_GROUP_PROJECTMANAGER, C_FLAG_GROUP_ROLE, C_FOLDER, C_FOLDER_SEPARATOR, C_GROUP, C_GROUP_ADMIN, C_GROUP_GUEST, C_GROUP_PROJECTLEADER, C_GROUP_USERS, C_LINKCHECKTABLE_DATE, C_MAX_LENGTH_RESOURCE_NAME, C_MODULE_PROPERTY_ADDITIONAL_RESOURCES, C_MODULE_PROPERTY_ADDITIONAL_RESOURCES_SEPARATOR, C_MODUS_AUTO, C_MODUS_EXPORT, C_MODUS_EXTERN, C_MODUS_OFFLINE, C_MODUS_ONLINE, C_MOUNTPOINT_FILESYSTEM, C_MOUNTPOINT_MYSQL, C_NEVER, C_NO_FILES_IMPORTED, C_ORDER_AGENTUSER, C_ORDER_ENDTIME, C_ORDER_ID, C_ORDER_INITIATORUSER, C_ORDER_NAME, C_ORDER_ORIGINALUSER, C_ORDER_PERCENTAGE, C_ORDER_PRIORITY, C_ORDER_ROLE, C_ORDER_STARTTIME, C_ORDER_STATE, C_ORDER_TASKTYPE, C_ORDER_TIMEOUT, C_ORDER_WAKEUPTIME, C_PASSWORD_MINIMUMSIZE, C_PROJECT_ONLINE, C_PROJECT_ONLINE_ID, C_PROJECT_STATE_ARCHIVE, C_PROJECT_STATE_INVISIBLE, C_PROJECT_STATE_LOCKED, C_PROJECT_STATE_UNLOCKED, C_PROJECT_TYPE_INVISIBLE, C_PROJECT_TYPE_NORMAL, C_PROJECT_TYPE_TEMPORARY, C_PROPERTY_ACTIV, C_PROPERTY_CHANNELID, C_PROPERTY_CONTENT_ENCODING, C_PROPERTY_DEFAULT_FILE, C_PROPERTY_DESCRIPTION, C_PROPERTY_EXPORT, C_PROPERTY_EXPORTNAME, C_PROPERTY_KEYWORDS, C_PROPERTY_NAVPOS, C_PROPERTY_NAVTEXT, C_PROPERTY_RELATIVEROOT, C_PROPERTY_TEMPLATETYPE, C_PROPERTY_TITLE, C_PROPERTY_VISIBLE, C_PUBLISH_METHOD_LINK, C_REGISTRY_DESTINATION, C_REGISTRY_HISTORY, C_REGISTRY_KNOWNLAUNCHERS, C_REGISTRY_LAUNCHER, C_REGISTRY_SOURCE, C_REQUEST_CONSOLE, C_REQUEST_HTTP, C_RESPONSE_CONSOLE, C_RESPONSE_HTTP, C_ROOT, C_ROOT_TEMPLATE_NAME, C_ROOTNAME_COS, C_ROOTNAME_VFS, C_SESSION_ADMIN_POS, C_SESSION_BROADCASTMESSAGE, C_SESSION_CONTENT_ENCODING, C_SESSION_CURRENTGROUP, C_SESSION_DATA, C_SESSION_IS_DIRTY, C_SESSION_MESSAGEPENDING, C_SESSION_MODULE_VECTOR, C_SESSION_PROJECT, C_SESSION_THREAD_ERROR, C_SESSION_USERNAME, C_SORT_ASC, C_SORT_DESC, C_START_ACCESSFLAGS, C_START_DEFAULTGROUP, C_START_LANGUAGE, C_START_LOCKDIALOG, C_START_PROJECT, C_START_VIEW, C_STATE_CHANGED, C_STATE_DELETED, C_STATE_NEW, C_STATE_UNCHANGED, C_STATICEXPORT_PATH, C_STATICEXPORT_START, C_SYNCHRONISATION_PATH, C_SYNCHRONISATION_PROJECT, C_SYNCHRONISATION_RESOURCE, C_SYNCHRONISATION_RESOURCETAG, C_SYSTEMPROPERTY_CRONTABLE, C_SYSTEMPROPERTY_EXPORTPATH, C_SYSTEMPROPERTY_EXTENSIONS, C_SYSTEMPROPERTY_LINKCHECKTABLE, C_SYSTEMPROPERTY_MIMETYPES, C_SYSTEMPROPERTY_MOUNTPOINT, C_SYSTEMPROPERTY_RESOURCE_TYPE, C_TABLE_CHANNELID, C_TASK_FILTER, C_TASK_MESSAGES, C_TASK_MESSAGES_ACCEPTED, C_TASK_MESSAGES_COMPLETED, C_TASK_MESSAGES_FORWARDED, C_TASK_MESSAGES_MEMBERS, C_TASK_ORDER_BY_DATE, C_TASK_ORDER_BY_NAME, C_TASK_PRIORITY_HIGH, C_TASK_PRIORITY_LOW, C_TASK_PRIORITY_NORMAL, C_TASK_STATE_ENDED, C_TASK_STATE_HALTED, C_TASK_STATE_NOTENDED, C_TASK_STATE_PREPARE, C_TASK_STATE_START, C_TASK_STATE_STARTED, C_TASK_VIEW_ALL, C_TASKLOG_SYSTEM, C_TASKLOG_USER, C_TASKORDER_NONE, C_TASKORDER_STARTDATE, C_TASKORDER_TIMEOUT, C_TASKS_ACTIVE, C_TASKS_ALL, C_TASKS_DONE, C_TASKS_NEW, C_TASKS_OPEN, C_TASKSORDER_TASKNAME, C_TEMP_PREFIX, C_TFACCESS, C_TFGROUP, C_TFILEOBJ, C_TFILES, C_TFNAME, C_TFPROPERTYINFO, C_TFPROPERTYNAME, C_TFPROPERTYTYPE, C_TFPROPERTYVALUE, C_TFTYPE, C_TFTYPENAME, C_TFUSER, C_TGDESC, C_TGFLAG, C_TGNAME, C_TGPARENTGROUP, C_TGROUPOBJ, C_TGROUPS, C_TGROUPUSERS, C_TGUSER, C_TUADDINFO, C_TUDESC, C_TUDGROUP, C_TUDISABLED, C_TUEMAIL, C_TUFIRSTNAME, C_TUFLAG, C_TUGROUP, C_TUINFOKEY, C_TUINFOVALUE, C_TULOGIN, C_TUNAME, C_TUPASSWD, C_TUSERGROUPS, C_TUSEROBJ, C_TUSERS, C_TYPE_BODY_NAME, C_TYPE_COMPATIBLEPLAIN_NAME, C_TYPE_FOLDER, C_TYPE_FOLDER_NAME, C_TYPE_IMAGE_NAME, C_TYPE_LAST_INDEX, C_TYPE_PAGE_NAME, C_TYPE_PLAIN_NAME, C_UNKNOWN_ID, C_UNKNOWN_INT, C_UNKNOWN_LAUNCHER, C_UNKNOWN_LAUNCHER_ID, C_UNKNOWN_LONG, C_URL_PREFIX_EXPORT, C_URL_PREFIX_HTTP, C_URL_PREFIX_HTTPS, C_URL_PREFIX_SERVERNAME, C_USER, C_USER_ADMIN, C_USER_GUEST, C_USER_TYPE_SYSTEMANDWEBUSER, C_USER_TYPE_SYSTEMUSER, C_USER_TYPE_WEBUSER, C_WEB_APP_REPLACE_KEY, C_WEEKS_HISTORY, C_WHATEVER, C_XML_BODY_ELEMENT
 
Constructor Summary
CmsObject()
          The default constructor.
 
Method Summary
 void acceptTask(int taskId)
          Accept a task from the Cms.
 boolean accessCreate(String resource)
          Checks, if the user may create this resource.
 boolean accessLock(String resource)
          Checks, if the user may lock this resource.
 boolean accessProject(int projectId)
          Checks if the user can access the project.
 boolean accessRead(String resource)
          Checks, if the user may read this resource.
 boolean accessReadVisible(CmsResource resource)
          Checks, if the user may read this resource and if it is visible to him.
 boolean accessWrite(String resource)
          Checks, if the user may write this resource.
 void addFileExtension(String extension, String resTypeName)
          Adds a file extension to the list of known file extensions.
 CmsGroup addGroup(String name, String description, int flags, String parent)
          Adds a new group to the Cms.
 CmsUser addImportUser(String name, String password, String recoveryPassword, String description, String firstname, String lastname, String email, int flags, Hashtable additionalInfos, String defaultGroup, String address, String section, int type)
          Adds a user to the Cms by import.
 CmsUser addUser(String name, String password, String group, String description, Hashtable additionalInfos, int flags)
          Adds a user to the Cms.
 void addUserToGroup(String username, String groupname)
          Adds a user to a group.
 CmsUser addWebUser(String name, String password, String group, String description, Hashtable additionalInfos, int flags)
          Adds a web user to the Cms.
 CmsUser addWebUser(String name, String password, String group, String additionalGroup, String description, Hashtable additionalInfos, int flags)
          Adds a web user to the Cms.
 CmsUser anonymousUser()
          Returns the anonymous user object.
 void backupProject(int projectId, int versionId, long publishDate)
          Creates a backup of the published project
 void changeLockedInProject(int projectId, String resourcename)
          Changes the project-id of a resource to the new project for publishing the resource directly
 void changeUserType(int userId, int userType)
          Changes the type of the user
 void changeUserType(String username, int userType)
          Changes the type of the user to webusertype
 void chgrp(String filename, String newGroup)
          Changes the group of a resource.
 void chgrp(String filename, String newGroup, boolean chRekursive)
          Changes the group of a resource.
 void chmod(String filename, int flags)
          Changes the flags of a resource.
 void chmod(String filename, int flags, boolean chRekursive)
          Changes the flags of a resource.
 void chown(String filename, String newOwner)
          Changes the owner of a resource.
 void chown(String filename, String newOwner, boolean chRekursive)
          Changes the owner of a resource.
 void chtype(String filename, String newType)
          Changes the resourcetype of a resource.
 void clearcache()
          Clears all internal DB-Caches.
 void clearElementCache()
          Clears the element cache.
 void copyFile(String source, String destination)
          Deprecated. Use copyResource instead.
 void copyFolder(String source, String destination)
          Deprecated. Use copyResource instead.
 void copyResource(String source, String destination)
          Copies a file.
 void copyResource(String source, String destination, boolean keepFlags)
          Copies a file.
 void copyResourceToProject(String resource)
          Copies a resource from the online project to a new, specified project.
 int countLockedResources(int id)
          Counts the locked resources in a project.
 CmsFolder createChannel(String parentChannel, String newChannelName)
          Creates a new channel.
 CmsFile createFile(String folder, String filename, byte[] contents, String type)
          Deprecated. Use createResource instead.
 CmsFile createFile(String folder, String filename, byte[] contents, String type, Hashtable properties)
          Deprecated. Use createResource instead.
 CmsFolder createFolder(String folder, String newFolderName)
          Deprecated. Use createResource instead.
 void createLinkEntrys(int pageId, Vector linkTargets)
          creates a link entry for each of the link targets in the linktable.
 void createOnlineLinkEntrys(int pageId, Vector linkTarget)
          creates a link entry for each of the link targets in the online linktable.
 CmsTask createProject(String projectname, int projectType, String roleName, long timeout, int priority)
          Creates a new project for task handling.
 CmsProject createProject(String name, String description, String groupname, String managergroupname)
          Creates a new project.
 CmsProject createProject(String name, String description, String groupname, String managergroupname, int projecttype)
          Creates a new project.
 CmsPropertydefinition createPropertydefinition(String name, String resourcetype)
          Creates the property-definition for a resource type.
 CmsResource createResource(String newResourceName, String type, Map properties, byte[] contents, Object parameter)
           
 CmsResource createResource(String folder, String name, String type)
           
 CmsResource createResource(String folder, String name, String type, Map properties)
           
 CmsResource createResource(String folder, String name, String type, Map properties, byte[] contents)
           
 CmsTask createTask(int projectid, String agentName, String roleName, String taskname, String taskcomment, int tasktype, long timeout, int priority)
          Creates a new task.
 CmsTask createTask(String agentName, String roleName, String taskname, String taskcomment, long timeout, int priority)
          Creates a new task.
 CmsProject createTempfileProject()
          Creates a new project for the temporary files.
 void deleteAllProperties(String resourcename)
          Deletes all properties for a file or folder.
 int deleteBackups(int weeks)
          Deletes the versions from the backup tables that are older then the given weeks
 void deleteEmptyFolder(String foldername)
          Deletes a folder.
 void deleteExportLink(CmsExportLink link)
          Deletes an exportlink in the database.
 void deleteExportLink(String link)
          Deletes an exportlink in the database.
 void deleteFile(String filename)
          Deprecated. Use deleteResource instead.
 void deleteFolder(String foldername)
          Deprecated. Use deleteResource instead.
 void deleteGroup(String delgroup)
          Deletes a group.
 void deleteLinkEntrys(int pageId)
          deletes all entrys in the link table that belong to the pageId
 void deleteOnlineLinkEntrys(int pageId)
          deletes all entrys in the online link table that belong to the pageId
 void deleteProject(int id)
          Deletes a project.
 void deleteProperty(String resourcename, String property)
          Deletes a property for a file or folder.
 void deletePropertydefinition(String name, String resourcetype)
          Deletes the property-definition for a resource type.
 void deleteResource(String filename)
          Deletes a resource.
 void deleteUser(int userId)
          Deletes a user from the Cms.
 void deleteUser(String username)
          Deletes a user from the Cms.
 void deleteWebUser(int userId)
          Deletes a web user from the Cms.
 void destroy()
          Destroys the resource borker and required modules and connections.
 String digest(String value)
          Method to encrypt the passwords.
protected  void doChangeLockedInProject(int projectId, String resourcename)
          Changes the project-id of a resource to the new project for publishing the resource directly
protected  void doChgrp(String filename, String newGroup)
          Changes the group of a resource.
protected  void doChmod(String filename, int flags)
          Changes the flags of a resource.
protected  void doChown(String filename, String newOwner)
          Changes the owner of a resource.
protected  void doChtype(String filename, String newType)
          Changes the resourcetype of a resource.
protected  void doCopyFile(String source, String destination)
          Copies a file.
protected  void doCopyFolder(String source, String destination)
          Copies a folder.
protected  void doCopyResourceToProject(String resource)
          Copies a resource from the online project to a new, specified project.
protected  CmsFile doCreateFile(String newFileName, byte[] contents, String type)
          Creates a new file with the given content and resourcetype.
protected  CmsFile doCreateFile(String newFileName, byte[] contents, String type, Map properties)
          Creates a new file with the given content and resourcetype.
protected  CmsFolder doCreateFolder(String newFolderName, Map properties)
          Creates a new folder.
protected  CmsFolder doCreateFolder(String folder, String newFolderName)
          Creates a new folder.
 int doDecrementLinkCountForResource(String theResourceName)
          Decrement the VFS link counter for a resource.
protected  void doDeleteFile(String filename)
          Deletes a file.
protected  void doDeleteFolder(String foldername)
          Deletes a folder.
protected  CmsResource doImportResource(String newResourceName, int resourceType, Map properties, int launcherType, String launcherClassname, String ownername, String groupname, int accessFlags, long lastmodified, byte[] filecontent)
          Creates a new resource.
 int doIncrementLinkCountForResource(String theResourceName)
          Increment the VFS link counter for a resource.
protected  void doLockResource(String resource, boolean force)
          Locks a given resource.
protected  void doMoveFile(String source, String destination)
          Moves a file to the given destination.
protected  void doRenameFile(String oldname, String newname)
          Renames the resource to the new name.
protected  void doRestoreResource(int versionId, String filename)
          Restores a file in the current project with a version in the backup
protected  void doTouch(String resourceName, long timestamp)
          Access the resource broker underneath to change the timestamp of a resource.
protected  void doUndeleteFile(String filename)
          Undeletes a file.
protected  void doUndeleteFolder(String foldername)
          Undeletes a folder.
protected  void doUndoChanges(String resource)
          Undo changes in a file.
protected  void doUnlockResource(String resource)
          Unlocks a resource.
protected  void doWriteResource(String resourcename, Map properties, String username, String groupname, int accessFlags, int resourceType, byte[] filecontent)
          Writes a resource and its properties to the Cms.
 void endTask(int taskid)
          Ends a task of the Cms.
 void exportModuledata(String exportFile, String[] exportChannels, String[] exportModules, I_CmsReport report)
          Exports channels and moduledata to zip.
 CmsFile exportResource(CmsFile file)
          Exports a resource.
 void exportResources(String exportFile, String[] exportPaths)
          Exports cms-resources to a zip-file.
 void exportResources(String exportFile, String[] exportPaths, boolean includeSystem, boolean excludeUnchanged)
          Exports cms-resources to a zip-file.
 void exportResources(String exportFile, String[] exportPaths, boolean includeSystem, boolean excludeUnchanged, boolean exportUserdata)
          Exports cms-resources to a zip-file.
 void exportResources(String exportFile, String[] exportPaths, boolean includeSystem, boolean excludeUnchanged, boolean exportUserdata, long contentAge, I_CmsReport report)
          Exports cms-resources to a zip-file.
 void exportStaticResources(Vector linksToExport)
          Creates a static export in the filesystem.
 void exportStaticResources(Vector startpoints, Vector projectResources, Vector allExportedLinks, CmsPublishedResources changedResources, I_CmsReport report)
          Creates a static export in the filesystem
 ArrayList fetchVfsLinksForResource(String theResourceName)
          Fetches the resource names of all VFS links pointing to a given resource as an ArrayList.
 void forwardTask(int taskid, String newRoleName, String newUserName)
          Forwards a task to a new user.
 Vector getAllAccessibleProjects()
          Returns all projects, which the current user can access.
 Vector getAllBackupProjects()
          Returns a Vector with all projects from history
 Vector getAllExportLinks()
          Returns a Vector with all export links
 Vector getAllManageableProjects()
          Returns all projects which are owned by the current user or which are manageable for the group of the user.
 Hashtable getAllResourceTypes()
          Returns a Hashtable with all I_CmsResourceTypes.
 int getBackupVersionId()
          Get the next version id for the published backup resources
 void getBrokenLinks(int projectId, I_CmsReport report, Vector changed, Vector deleted, Vector newRes)
          checks a project for broken links that would appear if the project is published.
 Hashtable getCacheInfo()
          Gets information about the cache size.
 Vector getChild(String groupname)
          Returns all child groups of a group.
 Vector getChilds(String groupname)
          Returns all child groups of a group.
 CmsObject getCmsObjectForStaticExport(CmsExportRequest dReq, CmsExportResponse dRes)
          Creates a special CmsObject for the static export.
 source.org.apache.java.util.Configurations getConfigurations()
          Gets the configurations of the properties-file.
 Vector getDependingExportLinks(Vector res)
          Reads all export links that depend on the resource.
 Vector getDirectGroupsOfUser(String username)
          Gets all groups to which a given user directly belongs.
 Vector getFilesInFolder(String foldername)
          Returns a Vector with all files of a given folder.
 Vector getFilesInFolder(String foldername, boolean includeDeleted)
          Returns a Vector with all files of a given folder.
 Vector getFilesWithProperty(String propertyDefinition, String propertyValue)
          Returns a Vector with all resource-names of the resources that have set the given property to the given value.
 long getFileSystemChanges()
          This method can be called, to determine if the file-system was changed in the past.
 long getFileSystemFolderChanges()
          This method can be called, to determine if the file-system was changed in the past.
 Vector getFolderTree()
          Returns a Vector with the complete folder-tree for this project.
 Vector getGroups()
          Returns all groups in the Cms.
 Vector getGroupsOfUser(String username)
          Gets all groups of a user.
 CmsLauncherManager getLauncherManager()
          Get the launcher manager used with this instance of CmsObject.
 int getLimitedWorkplacePort()
          This is the port the workplace access is limited to.
 String getLinkSubstitution(String link)
          Replaces the link according to the rules and registers it to the requestcontex if we are in export modus.
 Vector getLoggedInUsers()
          Returns a list of all currently logged in users.
 int getMode()
          Returns the mode this cmsObject is runnig in.
 Vector getOnlineBrokenLinks()
          serches for broken links in the online project.
 CmsElementCache getOnlineElementCache()
          Gets the ElementCache used for the online project.
 CmsPageLinks getPageLinks(String page)
          extracts the links of the page and returns them in a CmsPageLinks object.
 CmsGroup getParent(String groupname)
          Returns the parent group of a group.
 String getReadingpermittedGroup(int projectId, String resource)
          Checks which Group can read the resource and all the parent folders.
 I_CmsRegistry getRegistry()
          Gets the Registry.
 CmsRequestContext getRequestContext()
          Returns the current request-context.
 Vector getResourcesInFolder(String folder)
          Returns a Vector with the subresources for a folder.
 Vector getResourcesWithProperty(String propertyDefinition)
          Returns a Vector with all resources of the given type that have set the given property.
 Vector getResourcesWithProperty(String propertyDefinition, String propertyValue, int resourceType)
          Returns a Vector with all resources of the given type that have set the given property to the given value.
 I_CmsResourceType getResourceType(int resourceType)
          Returns a I_CmsResourceType.
 I_CmsResourceType getResourceType(String resourceType)
          Returns a I_CmsResourceType.
 String getSiteName()
          Returns the name of the current site, e.g.
 String getSiteRoot(String resourcename)
          Returns the name of the current site root, e.g.
static CmsStaticExportProperties getStaticExportProperties()
          Returns the properties for the static export.
 Vector getSubFolders(String foldername)
          Returns a Vector with all subfolders of a given folder.
 Vector getSubFolders(String foldername, boolean includeDeleted)
          Returns a Vector with all subfolders of a given folder.
 String getTaskPar(int taskid, String parname)
          Get a parameter value for a task.
 int getTaskType(String taskname)
          Get the template task id fo a given taskname.
 Vector getUsers()
          Returns all users in the Cms.
 Vector getUsers(int type)
          Returns all users of the given type in the Cms.
 Vector getUsers(int type, String namefilter)
          Returns all users from a given type that start with a specified string

 Vector getUsersByLastname(String Lastname, int UserType, int UserStatus, int wasLoggedIn, int nMax)
          Gets all users with a certain Lastname.
 Vector getUsersOfGroup(String groupname)
          Gets all users of a group.
 Hashtable getVariantDependencies()
          Gets the hashtable with the variant dependencies used for the elementcache.
 Vector getVisibleResourcesWithProperty(String propertyDefinition, String propertyValue, int resourceType)
          Returns a Vector with all resources of the given type that have set the given property to the given value.
 void importFolder(String importFile, String importPath)
          Imports a import-resource (folder or zipfile) to the cms.
 CmsResource importResource(String source, String destination, String type, String user, String group, String access, long lastmodified, Map properties, String launcherStartClass, byte[] content, String importPath)
          Imports a resource to the cms.
 void importResources(String importFile, String importPath)
          Imports a import-resource (folder or zip-file) to the cms.
 void importResources(String importFile, String importPath, I_CmsReport report)
          Imports a import-resource (folder or zip-file) to the cms.
 void init(I_CmsResourceBroker broker)
          Initializes the CmsObject without a request-context (current-user, current-group, current-project).
 void init(I_CmsResourceBroker broker, I_CmsRequest req, I_CmsResponse resp, String user, String currentGroup, int currentProjectId, boolean streaming, CmsElementCache elementCache, CmsCoreSession sessionStorage, CmsResourceTranslator directoryTranslator, CmsResourceTranslator fileTranslator)
          Initializes the CmsObject for each request.
 boolean isAdmin()
          Checks, if the users current group is the admin-group.
 boolean isHistoryEnabled()
          Check if the history is enabled
 boolean isManagerOfProject()
          Checks, if the user has management access to the project.
 ArrayList joinLinksToTargets()
          Joins all links with their targets for the current project.
 ArrayList joinLinksToTargets(CmsProject theProject)
          Joins all links with their targets for a given project.
 ArrayList joinLinksToTargets(CmsProject theProject, I_CmsReport theReport)
          Joins all VFS links with their target resources for a given project, printing the output to the given report.
 ArrayList joinLinksToTargets(CmsUser theUser, CmsProject theProject, I_CmsReport theReport)
          Joins all VFS links with their target resources for a given project, printing the output to the given report.
 ArrayList joinLinksToTargets(I_CmsReport theReport)
          Joins all VFS links with their target resources for the current project, printing the output to the specified report.
 void linkResourceToTarget(String theLinkResourceName, String theTargetResourceName)
          Save the ID of the target resource for a VFS link.
 CmsUser lockedBy(CmsResource resource)
          Returns the user, who has locked a given resource.
 CmsUser lockedBy(String resource)
          Returns the user, who has locked a given resource.
 void lockResource(String resource)
          Locks the given resource.
 void lockResource(String resource, boolean force)
          Locks a given resource.
 String loginUser(String username, String password)
          Logs a user into the Cms, if the password is correct.
 String loginWebUser(String username, String password)
          Logs a web user into the Cms, if the password is correct.
 void moveFile(String source, String destination)
          Deprecated. Use moveResource instead.
 void moveResource(String source, String destination)
          Moves a resource to the given destination.
 CmsProject onlineProject()
          Returns the online project.
 void publishProject(int id)
          Publishes a project.
 void publishProject(int id, I_CmsReport report)
          Publishes a project.
 void publishResource(String resourcename)
          Publishes a single resource.
 int publishResource(String resourcename, boolean justPrepare)
          Publishes a single resource.
 int publishResource(String resourcename, boolean justPrepare, I_CmsReport report)
           
 CmsUser readAgent(CmsTask task)
          Reads the agent of a task from the OpenCms.
 Vector readAllFileHeaders(String filename)
          Deprecated. For reading the file history use method readAllFileHeadersForHist
 Vector readAllFileHeadersForHist(String filename)
          Reads all file headers of a file in the OpenCms.
 Vector readAllProjectResources(int projectId)
          select all projectResources from an given project
 Hashtable readAllProperties(String resource)
          Deprecated. use readProperties(String) instead
 Vector readAllPropertydefinitions(int resourceType)
          Reads all property-definitions for the given resource type.
 Vector readAllPropertydefinitions(String resourcetype)
          Reads all property-definitions for the given resource type.
 CmsBackupProject readBackupProject(int versionId)
          Reads a project from the Cms.
 String readCronTable()
          Gets the Crontable.
 CmsExportLink readExportLink(String request)
          Reads a exportrequest from the Cms.
 CmsExportLink readExportLinkHeader(String request)
          Reads a exportrequest without the dependencies from the Cms.
 String readExportPath()
          Reads the export-path of the system.
 CmsFile readFile(String filename)
          Reads a file from the Cms.
 CmsFile readFile(String filename, boolean includeDeleted)
          Reads a file from the Cms.
 CmsFile readFile(String folder, String filename)
          Reads a file from the Cms.
 Hashtable readFileExtensions()
          Gets the known file extensions (=suffixes).
 CmsBackupResource readFileForHist(String filename, int versionId)
          Reads a file from the Cms for history.
 CmsResource readFileHeader(String filename)
          Reads a file header from the Cms.
 CmsResource readFileHeader(String filename, boolean includeDeleted)
          Reads a file header from the Cms.
 CmsResource readFileHeader(String filename, int projectId)
          Reads a file header from the Cms.
 CmsResource readFileHeader(String folder, String filename)
          Reads a file header from the Cms.
 CmsResource readFileHeaderForHist(String filename, int versionId)
          Reads a file header from the Cms for history.
 Vector readFileHeaders(int projectId)
          Reads all file headers of a project from the Cms.
 Vector readFilesByType(int projectId, int resourcetype)
          Reads all files from the Cms, that are of the given type.
 CmsFolder readFolder(int folderid, boolean includeDeleted)
          Reads a folder from the Cms.
 CmsFolder readFolder(String folderName)
          Reads a folder from the Cms.
 CmsFolder readFolder(String folderName, boolean includeDeleted)
          Reads a folder from the Cms.
 Vector readGivenTasks(int projectId, String ownerName, int taskType, String orderBy, String sort)
          Reads all given tasks from a user for a project.
 CmsGroup readGroup(CmsProject project)
          Reads the group of a project from the OpenCms.
 CmsGroup readGroup(CmsResource resource)
          Reads the group of a resource from the Cms.
 CmsGroup readGroup(CmsTask task)
          Reads the group (role) of a task from the Cms.
 CmsGroup readGroup(int groupid)
          Reads a group of the Cms.
 CmsGroup readGroup(String groupname)
          Reads a group of the Cms.
 Hashtable readLinkCheckTable()
          Gets the Linkchecktable.
 Vector readLinkEntrys(int pageId)
          returns a Vector (Strings) with the link destinations of all links on the page with the pageId.
 CmsGroup readManagerGroup(CmsProject project)
          Reads the managergroup of a project from the Cms.
 Hashtable readMimeTypes()
          Gets all Mime-Types known by the system.
 Vector readOnlineLinkEntrys(int pageId)
          returns a Vector (Strings) with the link destinations of all links on the page with the pageId.
 CmsUser readOriginalAgent(CmsTask task)
          Reads the original agent of a task from the Cms.
 CmsUser readOwner(CmsProject project)
          Reads the owner of a project from the Cms.
 CmsUser readOwner(CmsResource resource)
          Reads the owner of a resource from the Cms.
 CmsUser readOwner(CmsTask task)
          Reads the owner (initiator) of a task from the Cms.
 CmsUser readOwner(CmsTaskLog log)
          Reads the owner of a tasklog from the Cms.
 CmsProject readProject(CmsResource res)
          Reads a project from the Cms.
 CmsProject readProject(CmsTask task)
          Reads a project from the Cms.
 CmsProject readProject(int id)
          Reads a project from the Cms.
 Vector readProjectLogs(int projectId)
          Reads log entries for a project.
 Vector readProjectView(int projectId, String filter)
          Reads all file headers of a project from the Cms.
 Map readProperties(String resource)
          Looks up all properties for a resource.
 Map readProperties(String resource, boolean search)
          Looks up all properties for a resource with optional direcory upward cascading.
 String readProperty(String resource, String property)
          Looks up a specified property from a resource.
 String readProperty(String resource, String property, boolean search)
          Looks up a specified property with optional direcory upward cascading.
 String readProperty(String resource, String property, boolean search, String propertyDefault)
          Looks up a specified property with optional direcory upward cascading, a default value will be returned if the property is not found on the resource (or it's parent folders in case search is set to true).
 CmsPropertydefinition readPropertydefinition(String name, String resourcetype)
          Reads the property-definition for the resource type.
 Vector readResourcesLikeName(String resourcename)
          Returns a Vector with the resources that contains the given part in the resourcename.
 CmsTask readTask(int id)
          Reads the task with the given id.
 Vector readTaskLogs(int taskid)
          Reads log entries for a task.
 Vector readTasksForProject(int projectId, int tasktype, String orderBy, String sort)
          Reads all tasks for a project.
 Vector readTasksForRole(int projectId, String roleName, int tasktype, String orderBy, String sort)
          Reads all tasks for a role in a project.
 Vector readTasksForUser(int projectId, String userName, int tasktype, String orderBy, String sort)
          Reads all tasks for a user in a project.
 CmsUser readUser(int id)
          Returns a user in the Cms.
 CmsUser readUser(String username)
          Returns a user in the Cms.
 CmsUser readUser(String username, int type)
          Returns a user in the Cms.
 CmsUser readUser(String username, String password)
          Returns a user in the Cms, if the password is correct.
 CmsUser readWebUser(String username)
          Returns a user object if the password for the user is correct.
 CmsUser readWebUser(String username, String password)
          Returns a user object if the password for the user is correct.
 void reaktivateTask(int taskId)
          Reactivates a task from the Cms.
 void recoverPassword(String username, String recoveryPassword, String newPassword)
          Sets a new password if the user knows his recovery-password.
 void removeUserFromGroup(String username, String groupname)
          Removes a user from a group.
 void renameFile(String oldname, String newname)
          Deprecated. Use renameResource instead.
 void renameResource(String oldname, String newname)
          Renames the resource to the new name.
 void replaceResource(String filename, String type, Hashtable newProperties, byte[] newContent)
          Replaces and existing resource by another file with different content and different file type.
 void restoreResource(int versionId, String filename)
          Restores a file in the current project with a version in the backup
 CmsFolder rootFolder()
          Returns the root-folder object.
 void sendBroadcastMessage(String message)
          Returns a list of all currently logged in users.
 void setContextTo(String name)
          Sets the name of the current site root
 void setContextToCos()
          Sets the name of the current site root of the content objects system
 void setContextToVfs()
          Sets the name of the current site root of the virtual file system
 void setLauncherManager(CmsLauncherManager newM_launcherManager)
          Set the launcher manager used with this instance of CmsObject.
 void setMode(int mode)
          Sets the mode this CmsObject runs in.
 void setName(int taskId, String name)
          Set a new name for a task.
 void setParentGroup(String groupName, String parentGroupName)
          Sets a new parent-group for an already existing group in the Cms.
 void setPassword(String username, String newPassword)
          Sets the password for a user.
 void setPassword(String username, String oldPassword, String newPassword)
          Sets the password for a user.
 void setPriority(int taskId, int priority)
          Sets the priority of a task.
 void setRecoveryPassword(String username, String oldPassword, String newPassword)
          Sets the recovery password for a user.
 void setTaskPar(int taskid, String parname, String parvalue)
          Set a parameter for a task.
 void setTimeout(int taskId, long timeout)
          Sets the timeout of a task.
 void syncFolder(String resourceName)
          Synchronize cms-resources on virtual filesystem with the server filesystem.
 void touch(String resourceName, long timestamp, boolean touchRecursive)
          Change the timestamp of a resource.
 void undeleteResource(String filename)
          Undeletes a resource.
 void undoChanges(String filename)
          Undo changes in a file by copying the online file.
 void unlockProject(int id)
          Unlocks all resources of a project.
 void unlockResource(String resource)
          Unlocks a resource.
 void updateOnlineProjectLinks(Vector deleted, Vector changed, Vector newRes, int pageType)
          When a project is published this method aktualises the online link table.
 boolean userInGroup(String username, String groupname)
          Tests, if a user is member of the given group.
 void writeCronTable(String crontable)
          Writes the Crontable.
 void writeExportLink(CmsExportLink link)
          Writes an exportlink to the Cms.
 void writeExportLinkProcessedState(CmsExportLink link)
          Sets one exportLink to procecced.
 void writeExportPath(String path)
          Writes the export-path for the system.
 void writeFile(CmsFile file)
          Writes a file to the Cms.
 void writeFileExtensions(Hashtable extensions)
          Writes the file extensions.
 void writeFileHeader(CmsFile file)
          Writes a file-header to the Cms.
 void writeGroup(CmsGroup group)
          Writes an already existing group to the Cms.
 void writeLinkCheckTable(Hashtable linkchecktable)
          Writes the Linkchecktable.
 void writeProperties(String name, Map properties)
          Writes a couple of Properties for a file or folder.
 void writeProperty(String name, String property, String value)
          Writes a property for a file or folder.
 CmsPropertydefinition writePropertydefinition(CmsPropertydefinition definition)
          Deprecated. Do not use this method any longer because there is no type of propertydefinition
 void writeTaskLog(int taskid, String comment)
          Writes a new user tasklog for a task.
 void writeTaskLog(int taskid, String comment, int taskType)
          Writes a new user tasklog for a task.
 void writeUser(CmsUser user)
          Updates the user information.
 void writeWebUser(CmsUser user)
          Updates the user information of a web user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsObject

public CmsObject()
The default constructor.

Method Detail

acceptTask

public void acceptTask(int taskId)
                throws CmsException
Accept a task from the Cms.

Throws:
CmsException - if operation was not successful.

accessCreate

public boolean accessCreate(String resource)
                     throws CmsException
Checks, if the user may create this resource.

Parameters:
resource - the resource to check.
Returns:
true if the user has the appropriate rigths to create the resource; false otherwise
Throws:
CmsException - if operation was not successful.

accessLock

public boolean accessLock(String resource)
                   throws CmsException
Checks, if the user may lock this resource.

Parameters:
resource - the resource to check.
Returns:
true if the user has the appropriate rights to lock this resource; false otherwise
Throws:
CmsException - if operation was not successful.

accessProject

public boolean accessProject(int projectId)
                      throws CmsException
Checks if the user can access the project.

Parameters:
projectId - the id of the project.
Returns:
true, if the user may access this project; false otherwise
Throws:
CmsException - if operation was not successful.

accessRead

public boolean accessRead(String resource)
                   throws CmsException
Checks, if the user may read this resource.

Parameters:
resource - The resource to check.
Returns:
true, if the user has the appropriate rigths to read the resource; false otherwise.
Throws:
CmsException - if operation was not successful.

accessWrite

public boolean accessWrite(String resource)
                    throws CmsException
Checks, if the user may write this resource.

Parameters:
resource - the resource to check.
Returns:
true, if the user has the appropriate rigths to write the resource; false otherwise.
Throws:
CmsException - if operation was not successful.

addFileExtension

public void addFileExtension(String extension,
                             String resTypeName)
                      throws CmsException
Adds a file extension to the list of known file extensions.

Security: Only members of the group administrators are allowed to add a file extension.

Parameters:
extension - a file extension like "html","txt" etc.
resTypeName - name of the resource type associated with the extension.
Throws:
CmsException - if operation was not successful.

addGroup

public CmsGroup addGroup(String name,
                         String description,
                         int flags,
                         String parent)
                  throws CmsException
Adds a new group to the Cms.

Security: Only members of the group administrators are allowed to add a new group.

Parameters:
name - the name of the new group
description - the description of the new group
flags - the flags for the new group
parent - the parent group
Returns:
a CmsGroup object representing the newly created group.
Throws:
CmsException - if operation was not successful.

addUser

public CmsUser addUser(String name,
                       String password,
                       String group,
                       String description,
                       Hashtable additionalInfos,
                       int flags)
                throws CmsException
Adds a user to the Cms.

Security: Only members of the group administrators are allowed to add a user.

Parameters:
name - the new name for the user.
password - the new password for the user.
group - the default groupname for the user.
description - the description for the user.
additionalInfos - a Hashtable with additional infos for the user. These Infos may be stored into the Usertables (depending on the implementation).
flags - the flags for a user (e.g. C_FLAG_ENABLED).
Returns:
a CmsUser object representing the added user.
Throws:
CmsException - if operation was not successful.

addImportUser

public CmsUser addImportUser(String name,
                             String password,
                             String recoveryPassword,
                             String description,
                             String firstname,
                             String lastname,
                             String email,
                             int flags,
                             Hashtable additionalInfos,
                             String defaultGroup,
                             String address,
                             String section,
                             int type)
                      throws CmsException
Adds a user to the Cms by import.

Security: Only members of the group administrators are allowed to add a user.

Parameters:
name - the new name for the user.
password - the new password for the user.
recoveryPassword - the new password for the user.
description - the description for the user.
firstname - the firstname of the user.
lastname - the lastname of the user.
email - the email of the user.
flags - the flags for a user (e.g. C_FLAG_ENABLED).
additionalInfos - a Hashtable with additional infos for the user. These Infos may be stored into the Usertables (depending on the implementation).
defaultGroup - the default groupname for the user.
address - the address of the user.
section - the section of the user.
type - the type of the user.
Returns:
a CmsUser object representing the added user.
Throws:
CmsException - if operation was not successful.

addUserToGroup

public void addUserToGroup(String username,
                           String groupname)
                    throws CmsException
Adds a user to a group.

Security: Only members of the group administrators are allowed to add a user to a group.

Parameters:
username - the name of the user that is to be added to the group.
groupname - the name of the group.
Throws:
CmsException - if operation was not successful.

addWebUser

public CmsUser addWebUser(String name,
                          String password,
                          String group,
                          String description,
                          Hashtable additionalInfos,
                          int flags)
                   throws CmsException
Adds a web user to the Cms.
A web user has no access to the workplace but is able to access personalized functions controlled by the OpenCms.

Parameters:
name - the new name for the user.
password - the new password for the user.
group - the default groupname for the user.
description - the description for the user.
additionalInfos - a Hashtable with additional infos for the user. These Infos may be stored into the Usertables (depending on the implementation).
flags - the flags for a user (e.g. C_FLAG_ENABLED)
Returns:
a CmsUser object representing the newly created user.
Throws:
CmsException - if operation was not successful.

addWebUser

public CmsUser addWebUser(String name,
                          String password,
                          String group,
                          String additionalGroup,
                          String description,
                          Hashtable additionalInfos,
                          int flags)
                   throws CmsException
Adds a web user to the Cms.
A web user has no access to the workplace but is able to access personalized functions controlled by the OpenCms.

Parameters:
name - the new name for the user.
password - the new password for the user.
group - the default groupname for the user.
additionalGroup - An additional group for the user.
description - the description for the user.
additionalInfos - a Hashtable with additional infos for the user. These Infos may be stored into the Usertables (depending on the implementation).
flags - the flags for a user (e.g. C_FLAG_ENABLED)
Returns:
a CmsUser object representing the newly created user.
Throws:
CmsException - if operation was not successful.

anonymousUser

public CmsUser anonymousUser()
                      throws CmsException
Returns the anonymous user object.

Returns:
a CmsUser object representing the anonymous user.
Throws:
CmsException - if operation was not successful.

chgrp

public void chgrp(String filename,
                  String newGroup)
           throws CmsException
Changes the group of a resource.
Only the group of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newGroup - the name of the new group for this resource.
Throws:
CmsException - if operation was not successful.

chgrp

public void chgrp(String filename,
                  String newGroup,
                  boolean chRekursive)
           throws CmsException
Changes the group of a resource.
Only the group of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newGroup - the name of the new group for this resource.
chRekursive - shows if the subResources (of a folder) should be changed too.
Throws:
CmsException - if operation was not successful.

doChgrp

protected void doChgrp(String filename,
                       String newGroup)
                throws CmsException
Changes the group of a resource.
Only the group of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newGroup - the name of the new group for this resource.
Throws:
CmsException - if operation was not successful.

chmod

public void chmod(String filename,
                  int flags)
           throws CmsException
Changes the flags of a resource.
Only the flags of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project. The user may change the flags, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
flags - the new flags for the resource.
Throws:
CmsException - if operation was not successful. for this resource.

chmod

public void chmod(String filename,
                  int flags,
                  boolean chRekursive)
           throws CmsException
Changes the flags of a resource.
Only the flags of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project. The user may change the flags, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
flags - the new flags for the resource.
chRekursive - shows if the subResources (of a folder) should be changed too.
Throws:
CmsException - if operation was not successful. for this resource.

doChmod

protected void doChmod(String filename,
                       int flags)
                throws CmsException
Changes the flags of a resource.
Only the flags of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project. The user may change the flags, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
flags - the new flags for the resource.
Throws:
CmsException - if operation was not successful. for this resource.

chown

public void chown(String filename,
                  String newOwner)
           throws CmsException
Changes the owner of a resource.
Only the owner of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project. The user may change this, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newOwner - the name of the new owner for this resource.
Throws:
CmsException - if operation was not successful.

chown

public void chown(String filename,
                  String newOwner,
                  boolean chRekursive)
           throws CmsException
Changes the owner of a resource.
Only the owner of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project. The user may change this, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newOwner - the name of the new owner for this resource.
chRekursive - shows if the subResources (of a folder) should be changed too.
Throws:
CmsException - if operation was not successful.

doChown

protected void doChown(String filename,
                       String newOwner)
                throws CmsException
Changes the owner of a resource.
Only the owner of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not existing in the offline project already, it is read from the online project and written into the offline project. The user may change this, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newOwner - the name of the new owner for this resource.
Throws:
CmsException - if operation was not successful.

chtype

public void chtype(String filename,
                   String newType)
            throws CmsException
Changes the resourcetype of a resource.
Only the resourcetype of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not exisiting in the offline project already, it is read from the online project and written into the offline project. The user may change this, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newType - the name of the new resourcetype for this resource.
Throws:
CmsException - if operation was not successful.

doChtype

protected void doChtype(String filename,
                        String newType)
                 throws CmsException
Changes the resourcetype of a resource.
Only the resourcetype of a resource in an offline project can be changed. The state of the resource is set to CHANGED (1). If the content of this resource is not exisiting in the offline project already, it is read from the online project and written into the offline project. The user may change this, if he is admin of the resource.

Security: Access is granted, if:

Parameters:
filename - the complete path to the resource.
newType - the name of the new resourcetype for this resource.
Throws:
CmsException - if operation was not successful.

clearcache

public void clearcache()
Clears all internal DB-Caches.


clearElementCache

public void clearElementCache()
Clears the element cache.


copyResource

public void copyResource(String source,
                         String destination)
                  throws CmsException
Copies a file.

Parameters:
source - the complete path of the sourcefile.
destination - the complete path of the destinationfolder.
Throws:
CmsException - if the file couldn't be copied, or the user has not the appropriate rights to copy the file.

copyResource

public void copyResource(String source,
                         String destination,
                         boolean keepFlags)
                  throws CmsException
Copies a file.

Parameters:
source - the complete path of the sourcefile.
destination - the complete path of the destinationfolder.
keepFlags - true if the copy should keep the source file's flags, false if the copy should get the user's default flags.
Throws:
CmsException - if the file couldn't be copied, or the user has not the appropriate rights to copy the file.

doCopyFile

protected void doCopyFile(String source,
                          String destination)
                   throws CmsException
Copies a file.

Parameters:
source - the complete path of the sourcefile.
destination - the complete path of the destinationfolder.
Throws:
CmsException - if the file couldn't be copied, or the user has not the appropriate rights to copy the file.

doCopyFolder

protected void doCopyFolder(String source,
                            String destination)
                     throws CmsException
Copies a folder.

Parameters:
source - the complete path of the sourcefolder.
destination - the complete path of the destinationfolder.
Throws:
CmsException - if the folder couldn't be copied, or if the user has not the appropriate rights to copy the folder.

copyFile

public void copyFile(String source,
                     String destination)
              throws CmsException
Deprecated. Use copyResource instead.

Copies a file.

Parameters:
source - the complete path of the sourcefile.
destination - the complete path of the destinationfolder.
Throws:
CmsException - if the file couldn't be copied, or the user has not the appropriate rights to copy the file.

copyFolder

public void copyFolder(String source,
                       String destination)
                throws CmsException
Deprecated. Use copyResource instead.

Copies a folder.

Parameters:
source - the complete path of the sourcefolder.
destination - the complete path of the destinationfolder.
Throws:
CmsException - if the folder couldn't be copied, or if the user has not the appropriate rights to copy the folder.

copyResourceToProject

public void copyResourceToProject(String resource)
                           throws CmsException
Copies a resource from the online project to a new, specified project.
Copying a resource will copy the file header or folder into the specified offline project and set its state to UNCHANGED.

Parameters:
resource - the name of the resource.
Throws:
CmsException - if operation was not successful.

doCopyResourceToProject

protected void doCopyResourceToProject(String resource)
                                throws CmsException
Copies a resource from the online project to a new, specified project.
Copying a resource will copy the file header or folder into the specified offline project and set its state to UNCHANGED.

Parameters:
resource - the name of the resource.
Throws:
CmsException - if operation was not successful.

countLockedResources

public int countLockedResources(int id)
                         throws CmsException
Counts the locked resources in a project.

Parameters:
id - the id of the project
Returns:
the number of locked resources in this project.
Throws:
CmsException - if operation was not successful.

createFile

public CmsFile createFile(String folder,
                          String filename,
                          byte[] contents,
                          String type)
                   throws CmsException
Deprecated. Use createResource instead.

Creates a new file with the given content and resourcetype.

Parameters:
folder - the complete path to the folder in which the file will be created.
filename - the name of the new file.
contents - the contents of the new file.
type - the resourcetype of the new file.
Returns:
file a CmsFile object representing the newly created file.
Throws:
if - the resourcetype is set to folder. The CmsException is also thrown, if the filename is not valid or if the user has not the appropriate rights to create a new file.
CmsException

createFile

public CmsFile createFile(String folder,
                          String filename,
                          byte[] contents,
                          String type,
                          Hashtable properties)
                   throws CmsException
Deprecated. Use createResource instead.

Creates a new file with the given content and resourcetype.

Parameters:
folder - the complete path to the folder in which the file will be created.
filename - the name of the new file.
contents - the contents of the new file.
type - the resourcetype of the new file.
properties - A Hashtable of properties, that should be set for this file. The keys for this Hashtable are the names for properties, the values are the values for the properties.
Returns:
file a CmsFile object representing the newly created file.
Throws:
CmsException - or if the resourcetype is set to folder. The CmsException is also thrown, if the filename is not valid or if the user has not the appropriate rights to create a new file.

replaceResource

public void replaceResource(String filename,
                            String type,
                            Hashtable newProperties,
                            byte[] newContent)
                     throws CmsException
Replaces and existing resource by another file with different content and different file type.

Parameters:
filename - the resource to replace
type - the type of the new resource
newContent - the content of the new resource
CmsException

createFolder

public CmsFolder createFolder(String folder,
                              String newFolderName)
                       throws CmsException
Deprecated. Use createResource instead.

Creates a new folder.

Parameters:
folder - the complete path to the folder in which the new folder will be created.
newFolderName - the name of the new folder.
Returns:
folder a CmsFolder object representing the newly created folder.
Throws:
CmsException - if the foldername is not valid, or if the user has not the appropriate rights to create a new folder.

createChannel

public CmsFolder createChannel(String parentChannel,
                               String newChannelName)
                        throws CmsException
Creates a new channel.

Parameters:
parentChannel - the complete path to the channel in which the new channel will be created.
newChannelName - the name of the new channel.
Returns:
folder a CmsFolder object representing the newly created channel.
Throws:
CmsException - if the channelname is not valid, or if the user has not the appropriate rights to create a new channel.

createResource

public CmsResource createResource(String folder,
                                  String name,
                                  String type)
                           throws CmsException
CmsException

createResource

public CmsResource createResource(String folder,
                                  String name,
                                  String type,
                                  Map properties)
                           throws CmsException
CmsException

createResource

public CmsResource createResource(String folder,
                                  String name,
                                  String type,
                                  Map properties,
                                  byte[] contents)
                           throws CmsException
CmsException

createResource

public CmsResource createResource(String newResourceName,
                                  String type,
                                  Map properties,
                                  byte[] contents,
                                  Object parameter)
                           throws CmsException
CmsException

doCreateFile

protected CmsFile doCreateFile(String newFileName,
                               byte[] contents,
                               String type)
                        throws CmsException
Creates a new file with the given content and resourcetype.

Parameters:
contents - the contents of the new file.
type - the resourcetype of the new file.
Returns:
file a CmsFile object representing the newly created file.
Throws:
CmsException - if the resourcetype is set to folder. The CmsException is also thrown, if the filename is not valid or if the user has not the appropriate rights to create a new file.

doCreateFile

protected CmsFile doCreateFile(String newFileName,
                               byte[] contents,
                               String type,
                               Map properties)
                        throws CmsException
Creates a new file with the given content and resourcetype.

Parameters:
contents - the contents of the new file.
type - the resourcetype of the new file.
properties - A Hashtable of properties, that should be set for this file. The keys for this Hashtable are the names for properties, the values are the values for the properties.
Returns:
file a CmsFile object representing the newly created file.
Throws:
CmsException - if the wrong properties are given, or if the resourcetype is set to folder. The CmsException is also thrown, if the filename is not valid or if the user has not the appropriate rights to create a new file.

doCreateFolder

protected CmsFolder doCreateFolder(String folder,
                                   String newFolderName)
                            throws CmsException
Creates a new folder.

Parameters:
folder - the complete path to the folder in which the new folder will be created.
newFolderName - the name of the new folder.
Returns:
folder a CmsFolder object representing the newly created folder.
Throws:
CmsException - if the foldername is not valid, or if the user has not the appropriate rights to create a new folder.

doCreateFolder

protected CmsFolder doCreateFolder(String newFolderName,
                                   Map properties)
                            throws CmsException
Creates a new folder.

Parameters:
newFolderName - the name of the new folder.
properties - A Hashtable of properties, that should be set for this folder. The keys for this Hashtable are the names for property-definitions, the values are the values for the properties.
Returns:
a CmsFolder object representing the newly created folder.
Throws:
CmsException - if the foldername is not valid, or if the user has not the appropriate rights to create a new folder.

doImportResource

protected CmsResource doImportResource(String newResourceName,
                                       int resourceType,
                                       Map properties,
                                       int launcherType,
                                       String launcherClassname,
                                       String ownername,
                                       String groupname,
                                       int accessFlags,
                                       long lastmodified,
                                       byte[] filecontent)
                                throws CmsException
Creates a new resource.

Parameters:
newResourceName - the name of the new resource.
resourceType - The resourcetype of the new resource
properties - A Hashtable of propertyinfos, that should be set for this folder. The keys for this Hashtable are the names for propertydefinitions, the values are the values for the propertyinfos.
launcherType - The launcher type of the new resource
launcherClassname - The name of the launcherclass of the new resource
ownername - The name of the owner of the new resource
groupname - The name of the group of the new resource
accessFlags - The accessFlags of the new resource
filecontent - The content of the resource if it is of type file
Returns:
a CmsFolder object representing the newly created folder.
Throws:
CmsException - if the resourcename is not valid, or if the user has not the appropriate rights to create a new resource.

doWriteResource

protected void doWriteResource(String resourcename,
                               Map properties,
                               String username,
                               String groupname,
                               int accessFlags,
                               int resourceType,
                               byte[] filecontent)
                        throws CmsException
Writes a resource and its properties to the Cms.

Parameters:
resourcename - The name of the resource to write.
properties - The properties of the resource.
username - The name of the new owner of the resource
groupname - The name of the new group of the resource
accessFlags - The new accessFlags of the resource
resourceType - The new type of the resource
filecontent - The new filecontent of the resource
Throws:
CmsException - Throws CmsException if operation was not succesful.

createProject

public CmsTask createProject(String projectname,
                             int projectType,
                             String roleName,
                             long timeout,
                             int priority)
                      throws CmsException
Creates a new project for task handling.

Parameters:
projectname - the name of the project
projectType - the type of the Project
timeout - the time when the Project must finished
priority - a Priority for the Project
Returns:
a CmsTask object representing the newly created task.
Throws:
CmsException - if operation was not successful.

createProject

public CmsProject createProject(String name,
                                String description,
                                String groupname,
                                String managergroupname)
                         throws CmsException
Creates a new project.

Parameters:
name - the name of the project to read.
description - the description for the new project.
groupname - the name of the group to be set.
managergroupname - the name of the managergroup to be set.
Throws:
CmsException - if operation was not successful.

createProject

public CmsProject createProject(String name,
                                String description,
                                String groupname,
                                String managergroupname,
                                int projecttype)
                         throws CmsException
Creates a new project.

Parameters:
name - the name of the project to read.
description - the description for the new project.
groupname - the name of the group to be set.
managergroupname - the name of the managergroup to be set.
projecttype - the type of the project (normal or temporary)
Throws:
CmsException - if operation was not successful.

createTempfileProject

public CmsProject createTempfileProject()
                                 throws CmsException
Creates a new project for the temporary files.

Throws:
CmsException - if operation was not successful.

createPropertydefinition

public CmsPropertydefinition createPropertydefinition(String name,
                                                      String resourcetype)
                                               throws CmsException
Creates the property-definition for a resource type.

Parameters:
name - the name of the property-definition to overwrite.
resourcetype - the name of the resource-type for the property-definition.
Throws:
CmsException - if operation was not successful.

createTask

public CmsTask createTask(int projectid,
                          String agentName,
                          String roleName,
                          String taskname,
                          String taskcomment,
                          int tasktype,
                          long timeout,
                          int priority)
                   throws CmsException
Creates a new task.

Security: All users can create a new task.

Parameters:
projectid - the Id of the current project task of the user.
taskname - a Name of the task.
tasktype - the type of the task.
taskcomment - a description of the task.
timeout - the time when the task must finished.
priority - the Id for the priority of the task.
Returns:
a CmsTask object representing the newly created task.
Throws:
CmsException - Throws CmsException if something goes wrong.

createTask

public CmsTask createTask(String agentName,
                          String roleName,
                          String taskname,
                          String taskcomment,
                          long timeout,
                          int priority)
                   throws CmsException
Creates a new task.

Security: All users can create a new task.

Parameters:
taskname - the name of the task.
taskcomment - a description of the task.
timeout - the time when the task must finished.
priority - the Id for the priority of the task.
Returns:
a CmsTask object representing the newly created task.
Throws:
CmsException - if operation was not successful.

deleteAllProperties

public void deleteAllProperties(String resourcename)
                         throws CmsException
Deletes all properties for a file or folder.

Parameters:
resourcename - the name of the resource for which all properties should be deleted.
Throws:
CmsException - if operation was not successful.

deleteFile

public void deleteFile(String filename)
                throws CmsException
Deprecated. Use deleteResource instead.

Deletes a file.

Parameters:
filename - the complete path of the file.
Throws:
CmsException - if the file couldn't be deleted, or if the user has not the appropriate rights to delete the file.

deleteFolder

public void deleteFolder(String foldername)
                  throws CmsException
Deprecated. Use deleteResource instead.

Deletes a folder.
This is a very complex operation, because all sub-resources may be deleted too.

Parameters:
foldername - the complete path of the folder.
Throws:
CmsException - if the folder couldn't be deleted, or if the user has not the rights to delete this folder.

deleteEmptyFolder

public void deleteEmptyFolder(String foldername)
                       throws CmsException
Deletes a folder.
This is a very complex operation, because all sub-resources may be deleted too.

Parameters:
foldername - the complete path of the folder.
Throws:
CmsException - if the folder couldn't be deleted, or if the user has not the rights to delete this folder.

deleteResource

public void deleteResource(String filename)
                    throws CmsException
Deletes a resource.

Parameters:
filename - the complete path of the file.
Throws:
CmsException - if the file couldn't be deleted, or if the user has not the appropriate rights to delete the file.

doDeleteFile

protected void doDeleteFile(String filename)
                     throws CmsException
Deletes a file.

Parameters:
filename - the complete path of the file.
Throws:
CmsException - if the file couldn't be deleted, or if the user has not the appropriate rights to delete the file.

doDeleteFolder

protected void doDeleteFolder(String foldername)
                       throws CmsException
Deletes a folder.
This is a very complex operation, because all sub-resources may be deleted too.

Parameters:
foldername - the complete path of the folder.
Throws:
CmsException - if the folder couldn't be deleted, or if the user has not the rights to delete this folder.

undeleteResource

public void undeleteResource(String filename)
                      throws CmsException
Undeletes a resource.

Parameters:
filename - the complete path of the file.
Throws:
CmsException - if the file couldn't be undeleted, or if the user has not the appropriate rights to undelete the file.

doUndeleteFile

protected void doUndeleteFile(String filename)
                       throws CmsException
Undeletes a file.

Parameters:
filename - the complete path of the file.
Throws:
CmsException - if the file couldn't be undeleted, or if the user has not the appropriate rights to undelete the file.

doUndeleteFolder

protected void doUndeleteFolder(String foldername)
                         throws CmsException
Undeletes a folder.
This is a very complex operation, because all sub-resources may be undeleted too.

Parameters:
foldername - the complete path of the folder.
Throws:
CmsException - if the folder couldn't be undeleted, or if the user has not the rights to undelete this folder.

deleteGroup

public void deleteGroup(String delgroup)
                 throws CmsException
Deletes a group.

Security: Only the admin user is allowed to delete a group.

Parameters:
delgroup - the name of the group.
Throws:
CmsException - if operation was not successful.

deleteProject

public void deleteProject(int id)
                   throws CmsException
Deletes a project.

Parameters:
id - the id of the project.
Throws:
CmsException - if operation was not successful.

deleteProperty

public void deleteProperty(String resourcename,
                           String property)
                    throws CmsException
Deletes a property for a file or folder.

Parameters:
resourcename - the name of a resource for which the property should be deleted.
property - the name of the property.
Throws:
CmsException - Throws if operation was not successful.

deletePropertydefinition

public void deletePropertydefinition(String name,
                                     String resourcetype)
                              throws CmsException
Deletes the property-definition for a resource type.

Parameters:
name - the name of the property-definition to delete.
resourcetype - the name of the resource-type for the property-definition.
Throws:
CmsException - if operation was not successful.

deleteUser

public void deleteUser(int userId)
                throws CmsException
Deletes a user from the Cms.

Security: Only a admin user is allowed to delete a user.

Throws:
CmsException - if operation was not successful.

deleteUser

public void deleteUser(String username)
                throws CmsException
Deletes a user from the Cms.

Security: Only a admin user is allowed to delete a user.

Throws:
CmsException - if operation was not successful.

deleteWebUser

public void deleteWebUser(int userId)
                   throws CmsException
Deletes a web user from the Cms.

Throws:
CmsException - if operation was not successful.

destroy

public void destroy()
             throws CmsException
Destroys the resource borker and required modules and connections.

Throws:
CmsException - if operation was not successful.

endTask

public void endTask(int taskid)
             throws CmsException
Ends a task of the Cms.

Parameters:
taskid - the ID of the task to end.
Throws:
CmsException - if operation was not successful.

exportResources

public void exportResources(String exportFile,
                            String[] exportPaths)
                     throws CmsException
Exports cms-resources to a zip-file.

Parameters:
exportFile - the name (absolute Path) of the export resource (zip-file).
Throws:
CmsException - if operation was not successful.

exportResources

public void exportResources(String exportFile,
                            String[] exportPaths,
                            boolean includeSystem,
                            boolean excludeUnchanged)
                     throws CmsException
Exports cms-resources to a zip-file.

Parameters:
exportFile - the name (absolute Path) of the export resource (zip-file).
includeSystem - indicates if the system resources will be included in the export.
excludeUnchanged - true, if unchanged files should be excluded.
Throws:
CmsException - if operation was not successful.

exportResources

public void exportResources(String exportFile,
                            String[] exportPaths,
                            boolean includeSystem,
                            boolean excludeUnchanged,
                            boolean exportUserdata,
                            long contentAge,
                            I_CmsReport report)
                     throws CmsException
Exports cms-resources to a zip-file.

Parameters:
exportFile - the name (absolute Path) of the export resource (zip-file).
includeSystem - indicates if the system resources will be included in the export.
excludeUnchanged - true, if unchanged files should be excluded.
report - the cmsReport to handle the log messages.
Throws:
CmsException - if operation was not successful.

exportResources

public void exportResources(String exportFile,
                            String[] exportPaths,
                            boolean includeSystem,
                            boolean excludeUnchanged,
                            boolean exportUserdata)
                     throws CmsException
Exports cms-resources to a zip-file.

Parameters:
exportFile - the name (absolute Path) of the export resource (zip-file).
includeSystem - indicates if the system resources will be included in the export.
excludeUnchanged - true, if unchanged files should be excluded.
Throws:
CmsException - if operation was not successful.

exportResource

public CmsFile exportResource(CmsFile file)
                       throws CmsException
Exports a resource.

CmsException

exportModuledata

public void exportModuledata(String exportFile,
                             String[] exportChannels,
                             String[] exportModules,
                             I_CmsReport report)
                      throws CmsException
Exports channels and moduledata to zip. Security: only Administrators can do this;

Parameters:
exportFile - the name (absolute Path) of the export resource (zip)
exportChannels - the names (absolute Path) of channels from which should be exported
exportModules - the names of modules from which should be exported
Throws:
Throws - CmsException if something goes wrong.
CmsException

exportStaticResources

public void exportStaticResources(Vector startpoints,
                                  Vector projectResources,
                                  Vector allExportedLinks,
                                  CmsPublishedResources changedResources,
                                  I_CmsReport report)
                           throws CmsException
Creates a static export in the filesystem

Parameters:
startpoints - the startpoints for the export.
projectResources -
allExportedLinks -
changedResources -
report - the cmsReport to handle the log messages.
Throws:
CmsException - if operation was not successful.

exportStaticResources

public void exportStaticResources(Vector linksToExport)
                           throws CmsException
Creates a static export in the filesystem. This method is used only on a slave system in a cluster. The Vector is generated in the static export on the master system (in the Vector allExportdLinks), so in this method the database must not be updated.

Parameters:
linksToExport - all links that where exported by the master OpenCms.
Throws:
CmsException - if operation was not successful.

getCmsObjectForStaticExport

public CmsObject getCmsObjectForStaticExport(CmsExportRequest dReq,
                                             CmsExportResponse dRes)
                                      throws CmsException
Creates a special CmsObject for the static export.

Throws:
CmsException - if operation was not successful.

forwardTask

public void forwardTask(int taskid,
                        String newRoleName,
                        String newUserName)
                 throws CmsException
Forwards a task to a new user.

Parameters:
taskid - the id of the task which will be forwarded.
Throws:
CmsException - if operation was not successful.

getAllAccessibleProjects

public Vector getAllAccessibleProjects()
                                throws CmsException
Returns all projects, which the current user can access.

Returns:
a Vector of objects of type CmsProject.
Throws:
CmsException - if operation was not successful.

getAllManageableProjects

public Vector getAllManageableProjects()
                                throws CmsException
Returns all projects which are owned by the current user or which are manageable for the group of the user.

Returns:
a Vector of objects of type CmsProject.
Throws:
CmsException - if operation was not successful.

getAllBackupProjects

public Vector getAllBackupProjects()
                            throws CmsException
Returns a Vector with all projects from history

Returns:
Vector with all projects from history.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getAllExportLinks

public Vector getAllExportLinks()
                         throws CmsException
Returns a Vector with all export links

Returns:
Vector (Strings) with all export links.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getAllResourceTypes

public Hashtable getAllResourceTypes()
                              throws CmsException
Returns a Hashtable with all I_CmsResourceTypes.

Returns:
returns a Vector with all I_CmsResourceTypes.
Throws:
CmsException - if operation was not successful.

getCacheInfo

public Hashtable getCacheInfo()
Gets information about the cache size.
The size of the following caching areas is returned:

Returns:
a Hashtable with information about the size of the various cache areas.

getChild

public Vector getChild(String groupname)
                throws CmsException
Returns all child groups of a group.

Parameters:
groupname - the name of the group.
Returns:
groups a Vector of all child groups or null.
Throws:
CmsException - if operation was not successful.

getChilds

public Vector getChilds(String groupname)
                 throws CmsException
Returns all child groups of a group.
This method also returns all sub-child groups of the current group.

Parameters:
groupname - the name of the group.
Returns:
groups a Vector of all child groups or null.
Throws:
CmsException - if operation was not successful.

getConfigurations

public source.org.apache.java.util.Configurations getConfigurations()
Gets the configurations of the properties-file.

Returns:
the configurations of the properties-file.

getDirectGroupsOfUser

public Vector getDirectGroupsOfUser(String username)
                             throws CmsException
Gets all groups to which a given user directly belongs.

Parameters:
username - the name of the user to get all groups for.
Returns:
a Vector of all groups of a user.
Throws:
CmsException - if operation was not successful.

getFilesInFolder

public Vector getFilesInFolder(String foldername)
                        throws CmsException
Returns a Vector with all files of a given folder. (only the direct subfiles, not the files in subfolders)
Files of a folder can be read from an offline Project and the online Project.

Parameters:
foldername - the complete path to the folder.
Returns:
subfiles a Vector with all files of the given folder.
Throws:
CmsException - if the user has not hte appropriate rigths to access or read the resource.

getFilesInFolder

public Vector getFilesInFolder(String foldername,
                               boolean includeDeleted)
                        throws CmsException
Returns a Vector with all files of a given folder.
Files of a folder can be read from an offline Project and the online Project.

Parameters:
foldername - the complete path to the folder.
includeDeleted - Include if the folder is marked as deleted
Returns:
subfiles a Vector with all files of the given folder.
Throws:
CmsException - if the user has not hte appropriate rigths to access or read the resource.

getFilesWithProperty

public Vector getFilesWithProperty(String propertyDefinition,
                                   String propertyValue)
                            throws CmsException
Returns a Vector with all resource-names of the resources that have set the given property to the given value.

Returns:
a Vector with all names of the resources.
Throws:
CmsException - if operation was not successful.

getFileSystemChanges

public long getFileSystemChanges()
This method can be called, to determine if the file-system was changed in the past.
A module can compare its previously stored number with the returned number. If they differ, the file system has been changed.

Returns:
the number of file-system-changes.

getFileSystemFolderChanges

public long getFileSystemFolderChanges()
This method can be called, to determine if the file-system was changed in the past.
A module can compare its previously stored number with the returned number. If they differ, the file system has been changed.

Returns:
the number of file-system-changes.

getFolderTree

public Vector getFolderTree()
                     throws CmsException
Returns a Vector with the complete folder-tree for this project.
Subfolders can be read from an offline project and the online project.

Returns:
subfolders A Vector with the complete folder-tree for this project.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getGroups

public Vector getGroups()
                 throws CmsException
Returns all groups in the Cms.

Returns:
a Vector of all groups in the Cms.
Throws:
CmsException - if operation was not successful

getGroupsOfUser

public Vector getGroupsOfUser(String username)
                       throws CmsException
Gets all groups of a user.

Parameters:
username - the name of the user to get all groups for.
Returns:
Vector of all groups of a user.
Throws:
CmsException - if operation was not succesful.

getLauncherManager

public CmsLauncherManager getLauncherManager()
Get the launcher manager used with this instance of CmsObject.

Returns:
com.opencms.launcher.CmsLauncherManager

getOnlineElementCache

public CmsElementCache getOnlineElementCache()
Gets the ElementCache used for the online project.

Returns:
CmsElementCache

getLinkSubstitution

public String getLinkSubstitution(String link)
Replaces the link according to the rules and registers it to the requestcontex if we are in export modus.

Returns:
String The substituded link.

getPageLinks

public CmsPageLinks getPageLinks(String page)
                          throws CmsException
extracts the links of the page and returns them in a CmsPageLinks object.

Returns:
CmsPageLinks The link destinations on the page.
CmsException

getStaticExportProperties

public static CmsStaticExportProperties getStaticExportProperties()
Returns the properties for the static export.


getMode

public int getMode()
Returns the mode this cmsObject is runnig in. AUTO mode (-1) means it is no special case and returns online ore offline depending on the current project.

Returns:
int The modus of this cmsObject.

setMode

public void setMode(int mode)
Sets the mode this CmsObject runs in. Used for static export.

Parameters:
mode - the mode to set

getVariantDependencies

public Hashtable getVariantDependencies()
Gets the hashtable with the variant dependencies used for the elementcache.

Returns:
Hashtable

getReadingpermittedGroup

public String getReadingpermittedGroup(int projectId,
                                       String resource)
                                throws CmsException
Checks which Group can read the resource and all the parent folders.

Returns:
The Group Id of the Group which can read the resource. null for all Groups and Admingroup for no Group.
CmsException

getParent

public CmsGroup getParent(String groupname)
                   throws CmsException
Returns the parent group of a group.

Parameters:
groupname - the name of the group.
Returns:
group the parent group or null.
Throws:
CmsException - if operation was not successful.

getRegistry

public I_CmsRegistry getRegistry()
                          throws CmsException
Gets the Registry.

Throws:
CmsException - if access is not allowed.

getRequestContext

public CmsRequestContext getRequestContext()
Returns the current request-context.

Returns:
the current request-context.

getResourcesInFolder

public Vector getResourcesInFolder(String folder)
                            throws CmsException
Returns a Vector with the subresources for a folder.

Parameters:
folder - The name of the folder to get the subresources from.
Returns:
subfolders A Vector with resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getResourcesWithProperty

public Vector getResourcesWithProperty(String propertyDefinition,
                                       String propertyValue,
                                       int resourceType)
                                throws CmsException
Returns a Vector with all resources of the given type that have set the given property to the given value. Security: All users are granted.

Parameters:
resourceType - The resource type of the resource
Returns:
Vector with all resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getResourcesWithProperty

public Vector getResourcesWithProperty(String propertyDefinition)
                                throws CmsException
Returns a Vector with all resources of the given type that have set the given property. Security: All users are granted.

Returns:
Vector with all resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getResourceType

public I_CmsResourceType getResourceType(int resourceType)
                                  throws CmsException
Returns a I_CmsResourceType.

Parameters:
resourceType - the id of the resource to get.
Returns:
a CmsResourceType.
Throws:
CmsException - if operation was not successful.

getResourceType

public I_CmsResourceType getResourceType(String resourceType)
                                  throws CmsException
Returns a I_CmsResourceType.

Parameters:
resourceType - the name of the resource to get.
Returns:
a CmsResourceType.
Throws:
CmsException - if operation was not successful.

getSubFolders

public Vector getSubFolders(String foldername)
                     throws CmsException
Returns a Vector with all subfolders of a given folder.

Parameters:
foldername - the complete path to the folder.
Returns:
subfolders a Vector with all subfolders for the given folder.
Throws:
CmsException - if the user has not the rights to access or read the resource.

getSubFolders

public Vector getSubFolders(String foldername,
                            boolean includeDeleted)
                     throws CmsException
Returns a Vector with all subfolders of a given folder.

Parameters:
foldername - the complete path to the folder.
includeDeleted - Include if the folder is marked as deleted
Returns:
subfolders a Vector with all subfolders (CmsFolder Objects) for the given folder.
Throws:
CmsException - if the user has not the rights to access or read the resource.

getTaskPar

public String getTaskPar(int taskid,
                         String parname)
                  throws CmsException
Get a parameter value for a task.

Parameters:
taskid - the id of the task.
parname - the name of the parameter.
Returns:
the parameter value.
Throws:
CmsException - if operation was not successful.

getTaskType

public int getTaskType(String taskname)
                throws CmsException
Get the template task id fo a given taskname.

Parameters:
taskname - the name of the task.
Returns:
the id of the task template.
Throws:
CmsException - if operation was not successful.

getUsers

public Vector getUsers()
                throws CmsException
Returns all users in the Cms.

Returns:
a Vector of all users in the Cms.
Throws:
CmsException - if operation was not successful.

getUsers

public Vector getUsers(int type)
                throws CmsException
Returns all users of the given type in the Cms.

Parameters:
type - the type of the users.
Returns:
vector of all users of the given type in the Cms.
Throws:
CmsException - if operation was not successful.

getUsers

public Vector getUsers(int type,
                       String namefilter)
                throws CmsException
Returns all users from a given type that start with a specified string

Parameters:
type - the type of the users.
Returns:
vector of all users of the given type in the Cms.
Throws:
CmsException - if operation was not successful.

getUsersOfGroup

public Vector getUsersOfGroup(String groupname)
                       throws CmsException
Gets all users of a group.

Parameters:
groupname - the name of the group to get all users for.
Returns:
all users in the group.
Throws:
CmsException - if operation was not successful.

getUsersByLastname

public Vector getUsersByLastname(String Lastname,
                                 int UserType,
                                 int UserStatus,
                                 int wasLoggedIn,
                                 int nMax)
                          throws CmsException
Gets all users with a certain Lastname.

Parameters:
Lastname - the start of the users lastname
UserType - webuser or systemuser
UserStatus - enabled, disabled
wasLoggedIn - was the user ever locked in?
nMax - max number of results
Returns:
the users.
Throws:
CmsException - if operation was not successful.

importFolder

public void importFolder(String importFile,
                         String importPath)
                  throws CmsException
Imports a import-resource (folder or zipfile) to the cms.

Parameters:
importFile - the name (absolute Path) of the import resource (zipfile or folder).
importPath - the name (absolute Path) of the folder in which should be imported.
Throws:
CmsException - if operation was not successful.

importResource

public CmsResource importResource(String source,
                                  String destination,
                                  String type,
                                  String user,
                                  String group,
                                  String access,
                                  long lastmodified,
                                  Map properties,
                                  String launcherStartClass,
                                  byte[] content,
                                  String importPath)
                           throws CmsException
Imports a resource to the cms.

Parameters:
source - the name of the import resource (zipfile or folder).
destination - the name (absolute Path) of the folder in which should be imported.
type - the type of the resource
user - the owner of the resource
group - the group of the resource
access - the access flags of the resource
properties - the properties of the resource
launcherStartClass - the name of launcher start class
content - the content of the resource
importPath - the name of the import path
Throws:
CmsException - if operation was not successful.

importResources

public void importResources(String importFile,
                            String importPath)
                     throws CmsException
Imports a import-resource (folder or zip-file) to the cms.

Parameters:
importFile - the name (absolute Path) of the import resource (zipfile or folder).
importPath - the name (absolute Path) of folder in which should be imported.
Throws:
CmsException - if operation was not successful.

importResources

public void importResources(String importFile,
                            String importPath,
                            I_CmsReport report)
                     throws CmsException
Imports a import-resource (folder or zip-file) to the cms.

Parameters:
importFile - the name (absolute Path) of the import resource (zipfile or folder).
importPath - the name (absolute Path) of folder in which should be imported.
report - A report object to provide the loggin messages.
Throws:
CmsException - if operation was not successful.

init

public void init(I_CmsResourceBroker broker)
          throws CmsException
Initializes the CmsObject without a request-context (current-user, current-group, current-project).

Parameters:
broker - the resourcebroker to access the database.
Throws:
CmsException - if operation was not successful.

init

public void init(I_CmsResourceBroker broker,
                 I_CmsRequest req,
                 I_CmsResponse resp,
                 String user,
                 String currentGroup,
                 int currentProjectId,
                 boolean streaming,
                 CmsElementCache elementCache,
                 CmsCoreSession sessionStorage,
                 CmsResourceTranslator directoryTranslator,
                 CmsResourceTranslator fileTranslator)
          throws CmsException
Initializes the CmsObject for each request.

Parameters:
broker - the resourcebroker to access the database.
req - the CmsRequest.
resp - the CmsResponse.
user - the current user for this request.
currentGroup - the current group for this request.
currentProjectId - the current projectId for this request.
streaming - true if streaming should be enabled while creating the request context, false otherwise.
elementCache - Starting point for the element cache or null if the element cache should be disabled.
directoryTranslator - Translator for directories (file with full path)
fileTranslator - Translator for new file names (without path)
Throws:
CmsException - if operation was not successful.

isAdmin

public boolean isAdmin()
                throws CmsException
Checks, if the users current group is the admin-group.

Returns:
true, if the users current group is the admin-group; false otherwise.
Throws:
CmsException - if operation was not successful.

isManagerOfProject

public boolean isManagerOfProject()
                           throws CmsException
Checks, if the user has management access to the project.

Returns:
true, if the users current group is the admin-group; false otherwise.
Throws:
CmsException - if operation was not successful.

lockedBy

public CmsUser lockedBy(CmsResource resource)
                 throws CmsException
Returns the user, who has locked a given resource.
A user can lock a resource, so he is the only one who can write this resource. This methods checks, who has locked a resource.

Parameters:
resource - the resource to check.
Returns:
the user who has locked the resource.
Throws:
CmsException - if operation was not successful.

lockedBy

public CmsUser lockedBy(String resource)
                 throws CmsException
Returns the user, who has locked a given resource.
A user can lock a resource, so he is the only one who can write this resource. This methods checks, who has locked a resource.

Parameters:
resource - The complete path to the resource.
Returns:
the user who has locked a resource.
Throws:
CmsException - if operation was not successful.

lockResource

public void lockResource(String resource)
                  throws CmsException
Locks the given resource.
A user can lock a resource, so he is the only one who can write this resource.

Parameters:
resource - The complete path to the resource to lock.
Throws:
CmsException - if the user has not the rights to lock this resource. It will also be thrown, if there is an existing lock.

lockResource

public void lockResource(String resource,
                         boolean force)
                  throws CmsException
Locks a given resource.
A user can lock a resource, so he is the only one who can write this resource.

Parameters:
resource - the complete path to the resource to lock.
force - if force is true, a existing locking will be overwritten.
Throws:
CmsException - if the user has not the rights to lock this resource. It will also be thrown, if there is a existing lock and force was set to false.

doLockResource

protected void doLockResource(String resource,
                              boolean force)
                       throws CmsException
Locks a given resource.
A user can lock a resource, so he is the only one who can write this resource.

Parameters:
resource - the complete path to the resource to lock.
force - if force is true, a existing locking will be overwritten.
Throws:
CmsException - if the user has not the rights to lock this resource. It will also be thrown, if there is a existing lock and force was set to false.

loginUser

public String loginUser(String username,
                        String password)
                 throws CmsException
Logs a user into the Cms, if the password is correct.

Parameters:
username - the name of the user.
password - the password of the user.
Returns:
the name of the logged in user.
Throws:
CmsException - if operation was not successful

loginWebUser

public String loginWebUser(String username,
                           String password)
                    throws CmsException
Logs a web user into the Cms, if the password is correct.

Parameters:
username - the name of the user.
password - the password of the user.
Returns:
the name of the logged in user.
Throws:
CmsException - if operation was not successful

moveFile

public void moveFile(String source,
                     String destination)
              throws CmsException
Deprecated. Use moveResource instead.

Moves a file to the given destination.

Parameters:
source - the complete path of the sourcefile.
destination - the complete path of the destinationfile.
Throws:
CmsException - if the user has not the rights to move this resource, or if the file couldn't be moved.

moveResource

public void moveResource(String source,
                         String destination)
                  throws CmsException
Moves a resource to the given destination.

Parameters:
source - the complete path of the sourcefile.
destination - the complete path of the destinationfile.
Throws:
CmsException - if the user has not the rights to move this resource, or if the file couldn't be moved.

doMoveFile

protected void doMoveFile(String source,
                          String destination)
                   throws CmsException
Moves a file to the given destination.

Parameters:
source - the complete path of the sourcefile.
destination - the complete path of the destinationfile.
Throws:
CmsException - if the user has not the rights to move this resource, or if the file couldn't be moved.

onlineProject

public CmsProject onlineProject()
                         throws CmsException
Returns the online project.

This is the default project. All anonymous (or guest) user will see the resources of this project.

Returns:
the online project object.
Throws:
CmsException - if operation was not successful.

publishProject

public void publishProject(int id)
                    throws CmsException
Publishes a project.

Parameters:
id - the id of the project to be published.
Returns:
a Vector of resources, that have been changed.
Throws:
CmsException - if operation was not successful.

publishProject

public void publishProject(int id,
                           I_CmsReport report)
                    throws CmsException
Publishes a project.

Parameters:
id - the id of the project to be published.
report - A report object to provide the loggin messages.
Returns:
a Vector of resources, that have been changed.
Throws:
CmsException - if operation was not successful.

publishResource

public void publishResource(String resourcename)
                     throws CmsException
Publishes a single resource.

Throws:
CmsException - if operation was not successful.

publishResource

public int publishResource(String resourcename,
                           boolean justPrepare)
                    throws CmsException
Publishes a single resource.

Returns:
the project id of the created project.
Throws:
CmsException - if operation was not successful.

publishResource

public int publishResource(String resourcename,
                           boolean justPrepare,
                           I_CmsReport report)
                    throws CmsException
CmsException

readAgent

public CmsUser readAgent(CmsTask task)
                  throws CmsException
Reads the agent of a task from the OpenCms.

Parameters:
task - the task to read the agent from.
Returns:
the owner of a task.
Throws:
CmsException - if operation was not successful.

readAllFileHeaders

public Vector readAllFileHeaders(String filename)
                          throws CmsException
Deprecated. For reading the file history use method readAllFileHeadersForHist

Reads all file headers of a file in the OpenCms.
This method returns a vector with all file headers, i.e. the file headers of a file, independent of the project they were attached to.
The reading excludes the filecontent.

Parameters:
filename - the name of the file to be read.
Returns:
a Vector of file headers read from the Cms.
Throws:
CmsException - if operation was not successful.

readAllFileHeadersForHist

public Vector readAllFileHeadersForHist(String filename)
                                 throws CmsException
Reads all file headers of a file in the OpenCms.
This method returns a vector with the history of all file headers, i.e. the file headers of a file, independent of the project they were attached to.
The reading excludes the filecontent.

Parameters:
filename - the name of the file to be read.
Returns:
a Vector of file headers read from the Cms.
Throws:
CmsException - if operation was not successful.

readAllProjectResources

public Vector readAllProjectResources(int projectId)
                               throws CmsException
select all projectResources from an given project

Throws:
CmsException - Throws CmsException if operation was not succesful

readAllPropertydefinitions

public Vector readAllPropertydefinitions(int resourceType)
                                  throws CmsException
Reads all property-definitions for the given resource type.

Returns:
a Vector with property-defenitions for the resource type. The Vector may be empty.
Throws:
CmsException - if operation was not successful.

readAllPropertydefinitions

public Vector readAllPropertydefinitions(String resourcetype)
                                  throws CmsException
Reads all property-definitions for the given resource type.

Parameters:
resourcetype - the name of the resource type to read the property-definitions for.
Returns:
a Vector with property-defenitions for the resource type. The Vector may be empty.
Throws:
CmsException - if operation was not successful.

deleteLinkEntrys

public void deleteLinkEntrys(int pageId)
                      throws CmsException
deletes all entrys in the link table that belong to the pageId

Parameters:
pageId - The resourceId (offline) of the page whose links should be deleted
CmsException

createLinkEntrys

public void createLinkEntrys(int pageId,
                             Vector linkTargets)
                      throws CmsException
creates a link entry for each of the link targets in the linktable.

Parameters:
pageId - The resourceId (offline) of the page whose liks should be traced.
CmsException

readLinkEntrys

public Vector readLinkEntrys(int pageId)
                      throws CmsException
returns a Vector (Strings) with the link destinations of all links on the page with the pageId.

Parameters:
pageId - The resourceId (offline) of the page whose liks should be read.
CmsException

deleteOnlineLinkEntrys

public void deleteOnlineLinkEntrys(int pageId)
                            throws CmsException
deletes all entrys in the online link table that belong to the pageId

Parameters:
pageId - The resourceId (online) of the page whose links should be deleted
CmsException

createOnlineLinkEntrys

public void createOnlineLinkEntrys(int pageId,
                                   Vector linkTarget)
                            throws CmsException
creates a link entry for each of the link targets in the online linktable.

Parameters:
pageId - The resourceId (online) of the page whose liks should be traced.
linkTarget - A vector of strings (the linkdestinations).
CmsException

readOnlineLinkEntrys

public Vector readOnlineLinkEntrys(int pageId)
                            throws CmsException
returns a Vector (Strings) with the link destinations of all links on the page with the pageId.

Parameters:
pageId - The resourceId (online) of the page whose liks should be read.
CmsException

getOnlineBrokenLinks

public Vector getOnlineBrokenLinks()
                            throws CmsException
serches for broken links in the online project.

Returns:
A Vector with a CmsPageLinks object for each page containing broken links this CmsPageLinks object contains all links on the page withouth a valid target.
CmsException

getBrokenLinks

public void getBrokenLinks(int projectId,
                           I_CmsReport report,
                           Vector changed,
                           Vector deleted,
                           Vector newRes)
                    throws CmsException
checks a project for broken links that would appear if the project is published.

Parameters:
projectId -
report - A cmsReport object for logging while the method is still running.
changed - A vecor (of CmsResources) with the changed resources in the project.
deleted - A vecor (of CmsResources) with the deleted resources in the project.
newRes - A vecor (of CmsResources) with the new resources in the project.
CmsException

updateOnlineProjectLinks

public void updateOnlineProjectLinks(Vector deleted,
                                     Vector changed,
                                     Vector newRes,
                                     int pageType)
                              throws CmsException
When a project is published this method aktualises the online link table.

CmsException

readExportPath

public String readExportPath()
                      throws CmsException
Reads the export-path of the system. This path is used for db-export and db-import.

Returns:
the exportpath.
Throws:
CmsException - if operation was not successful.

readExportLink

public CmsExportLink readExportLink(String request)
                             throws CmsException
Reads a exportrequest from the Cms.

Parameters:
request - the reourcename with the url parameter.
Returns:
CmsExportLink the read exportrequest.
Throws:
CmsException - if the user has not the rights to read this resource, or if it couldn't be read.

readExportLinkHeader

public CmsExportLink readExportLinkHeader(String request)
                                   throws CmsException
Reads a exportrequest without the dependencies from the Cms.

Parameters:
request - the reourcename with the url parameter.
Returns:
CmsExportLink the read exportrequest.
Throws:
CmsException - if the user has not the rights to read this resource, or if it couldn't be read.

writeExportLink

public void writeExportLink(CmsExportLink link)
                     throws CmsException
Writes an exportlink to the Cms.

Parameters:
link - the cmsexportlink object to write.
Throws:
CmsException - if something goes wrong.

deleteExportLink

public void deleteExportLink(String link)
                      throws CmsException
Deletes an exportlink in the database.

Parameters:
link - the name of the link
CmsException

deleteExportLink

public void deleteExportLink(CmsExportLink link)
                      throws CmsException
Deletes an exportlink in the database.

Parameters:
link - the cmsExportLink object to delete.
CmsException

getDependingExportLinks

public Vector getDependingExportLinks(Vector res)
                               throws CmsException
Reads all export links that depend on the resource.

Returns:
a Vector(of Strings) with the linkrequest names.
CmsException

writeExportLinkProcessedState

public void writeExportLinkProcessedState(CmsExportLink link)
                                   throws CmsException
Sets one exportLink to procecced.

Parameters:
link - the cmsexportlink.
Throws:
CmsException - if something goes wrong.

readFile

public CmsFile readFile(String filename)
                 throws CmsException
Reads a file from the Cms.

Parameters:
filename - the complete path to the file.
Returns:
file the read file.
Throws:
CmsException - if the user has not the rights to read this resource, or if the file couldn't be read.

readFile

public CmsFile readFile(String filename,
                        boolean includeDeleted)
                 throws CmsException
Reads a file from the Cms.

Parameters:
filename - the complete path to the file.
includeDeleted - If true the deleted file will be returned.
Returns:
file the read file.
Throws:
CmsException - if the user has not the rights to read this resource, or if the file couldn't be read.

readFile

public CmsFile readFile(String folder,
                        String filename)
                 throws CmsException
Reads a file from the Cms.

Parameters:
folder - the complete path to the folder from which the file will be read.
filename - the name of the file to be read.
Returns:
file the read file.
Throws:
CmsException - , if the user has not the rights to read this resource, or if the file couldn't be read.

readFileExtensions

public Hashtable readFileExtensions()
                             throws CmsException
Gets the known file extensions (=suffixes).

Returns:
a Hashtable with all known file extensions as Strings.
Throws:
CmsException - if operation was not successful.

readFileHeader

public CmsResource readFileHeader(String filename)
                           throws CmsException
Reads a file header from the Cms.
The reading excludes the filecontent.

Parameters:
filename - the complete path of the file to be read.
Returns:
file the read file.
Throws:
CmsException - , if the user has not the rights to read the file headers, or if the file headers couldn't be read.

readFileHeader

public CmsResource readFileHeader(String filename,
                                  boolean includeDeleted)
                           throws CmsException
Reads a file header from the Cms.
The reading excludes the filecontent.

Parameters:
filename - the complete path of the file to be read
includeDeleted - if true, deleted files (in offline projects) will also be read
Returns:
file the read file header
Throws:
CmsException - if the user has not the rights to read the file headers, or if the file headers couldn't be read

readFileHeader

public CmsResource readFileHeader(String filename,
                                  int projectId)
                           throws CmsException
Reads a file header from the Cms.
The reading excludes the filecontent.

Parameters:
filename - the complete path of the file to be read.
projectId - the id of the project where the resource should belong to
Returns:
file the read file.
Throws:
CmsException - , if the user has not the rights to read the file headers, or if the file headers couldn't be read.

readFileHeader

public CmsResource readFileHeader(String folder,
                                  String filename)
                           throws CmsException
Reads a file header from the Cms.
The reading excludes the filecontent.

Parameters:
folder - the complete path to the folder from which the file will be read.
filename - the name of the file to be read.
Returns:
file the read file.
Throws:
CmsException - if the user has not the rights to read the file header, or if the file header couldn't be read.

readFileHeaderForHist

public CmsResource readFileHeaderForHist(String filename,
                                         int versionId)
                                  throws CmsException
Reads a file header from the Cms for history.
The reading excludes the filecontent.

Parameters:
filename - the complete path of the file to be read.
versionId - the version id of the resource
Returns:
file the read file.
Throws:
CmsException - , if the user has not the rights to read the file headers, or if the file headers couldn't be read.

readFileForHist

public CmsBackupResource readFileForHist(String filename,
                                         int versionId)
                                  throws CmsException
Reads a file from the Cms for history.
The reading includes the filecontent.

Parameters:
filename - the complete path of the file to be read.
versionId - the version id of the resource
Returns:
file the read file.
Throws:
CmsException - , if the user has not the rights to read the file, or if the file couldn't be read.

readFileHeaders

public Vector readFileHeaders(int projectId)
                       throws CmsException
Reads all file headers of a project from the Cms.

Parameters:
projectId - the id of the project to read the file headers for.
Returns:
a Vector of resources.
Throws:
CmsException - if the user has not the rights to read the file headers, or if the file headers couldn't be read.

readFolder

public CmsFolder readFolder(String folderName,
                            boolean includeDeleted)
                     throws CmsException
Reads a folder from the Cms.

Parameters:
folderName - the complete path to the folder to be read
includeDeleted - Include the folder if it is marked as deleted
Returns:
The read folder
Throws:
CmsException - If the user does not have the permissions to read this folder, or if the folder couldn't be read

readFolder

public CmsFolder readFolder(String folderName)
                     throws CmsException
Reads a folder from the Cms.

Returns:
The read folder
Throws:
CmsException - if the user does not have the permissions to read this folder, or if the folder couldn't be read

readFolder

public CmsFolder readFolder(int folderid,
                            boolean includeDeleted)
                     throws CmsException
Reads a folder from the Cms.

Parameters:
folderid - the id of the folder to be read
includeDeleted - Include the folder if it is marked as deleted
Returns:
folder the read folder
Throws:
CmsException - if the user does not have the permissions to read this folder, or if the folder couldn't be read

readGivenTasks

public Vector readGivenTasks(int projectId,
                             String ownerName,
                             int taskType,
                             String orderBy,
                             String sort)
                      throws CmsException
Reads all given tasks from a user for a project.

Parameters:
projectId - the id of the project in which the tasks are defined.
orderBy - specifies how to order the tasks.
Throws:
CmsException - if operation was not successful.

readGroup

public CmsGroup readGroup(CmsProject project)
                   throws CmsException
Reads the group of a project from the OpenCms.

Returns:
the group of the given project.
Throws:
CmsException - if operation was not successful.

readGroup

public CmsGroup readGroup(CmsResource resource)
                   throws CmsException
Reads the group of a resource from the Cms.

Returns:
the group of a resource.
Throws:
CmsException - if operation was not successful.

readGroup

public CmsGroup readGroup(CmsTask task)
                   throws CmsException
Reads the group (role) of a task from the Cms.

Parameters:
task - the task to read the role from.
Returns:
the group of the task.
Throws:
CmsException - if operation was not successful.

readGroup

public CmsGroup readGroup(String groupname)
                   throws CmsException
Reads a group of the Cms.

Parameters:
groupname - the name of the group to be returned.
Returns:
a group in the Cms.
Throws:
CmsException - if operation was not successful.

readGroup

public CmsGroup readGroup(int groupid)
                   throws CmsException
Reads a group of the Cms.

Parameters:
groupid - the id of the group to be returned.
Returns:
a group in the Cms.
Throws:
CmsException - if operation was not successful.

readManagerGroup

public CmsGroup readManagerGroup(CmsProject project)
                          throws CmsException
Reads the managergroup of a project from the Cms.

Returns:
the managergroup of a project.
Throws:
CmsException - if operation was not successful.

readMimeTypes

public Hashtable readMimeTypes()
                        throws CmsException
Gets all Mime-Types known by the system.

Returns:
a Hashtable containing all mime-types.
Throws:
CmsException - if operation was not successful.

readOriginalAgent

public CmsUser readOriginalAgent(CmsTask task)
                          throws CmsException
Reads the original agent of a task from the Cms.

Parameters:
task - the task to read the original agent from.
Returns:
the owner of a task.
Throws:
CmsException - if operation was not successful.

readOwner

public CmsUser readOwner(CmsProject project)
                  throws CmsException
Reads the owner of a project from the Cms.

Returns:
the owner of the given project.
Throws:
CmsException - if operation was not successful.

readOwner

public CmsUser readOwner(CmsResource resource)
                  throws CmsException
Reads the owner of a resource from the Cms.

Returns:
the owner of a resource.
Throws:
CmsException - if operation was not successful.

readOwner

public CmsUser readOwner(CmsTask task)
                  throws CmsException
Reads the owner (initiator) of a task from the Cms.

Returns:
the owner of a task.
Throws:
CmsException - if operation was not successful.

readOwner

public CmsUser readOwner(CmsTaskLog log)
                  throws CmsException
Reads the owner of a tasklog from the Cms.

Returns:
the owner of a resource.
Throws:
CmsException - if operation was not successful.

readProject

public CmsProject readProject(int id)
                       throws CmsException
Reads a project from the Cms.

Throws:
CmsException - if operation was not successful.

readProject

public CmsProject readProject(CmsResource res)
                       throws CmsException
Reads a project from the Cms.

Throws:
CmsException - if operation was not successful.

readProject

public CmsProject readProject(CmsTask task)
                       throws CmsException
Reads a project from the Cms.

Throws:
CmsException - if operation was not successful.

readProjectView

public Vector readProjectView(int projectId,
                              String filter)
                       throws CmsException
Reads all file headers of a project from the Cms.

Parameters:
projectId - the id of the project to read the file headers for.
filter - The filter for the resources (all, new, changed, deleted, locked)
Returns:
a Vector (of CmsResources objects) of resources.
CmsException

readBackupProject

public CmsBackupProject readBackupProject(int versionId)
                                   throws CmsException
Reads a project from the Cms.

Throws:
CmsException - if operation was not successful.

readProjectLogs

public Vector readProjectLogs(int projectId)
                       throws CmsException
Reads log entries for a project.

Parameters:
projectId - the id of the project for which the tasklog will be read.
Returns:
a Vector of new TaskLog objects
Throws:
CmsException - if operation was not successful.

readProperty

public String readProperty(String resource,
                           String property)
                    throws CmsException
Looks up a specified property from a resource.

Parameters:
resource - the resource to look up the property for
property - the name of the property to look up
Returns:
the value of the property found, null if nothing was found
Throws:
CmsException - in case there where problems reading the property

readProperty

public String readProperty(String resource,
                           String property,
                           boolean search)
                    throws CmsException
Looks up a specified property with optional direcory upward cascading.

Parameters:
resource - the resource to look up the property for
property - the name of the property to look up
search - if true, the property will be looked up on all parent folders if it is not attached to the the resource, if false not (ie. normal property lookup)
Returns:
the value of the property found, null if nothing was found
Throws:
CmsException - in case there where problems reading the property

readProperty

public String readProperty(String resource,
                           String property,
                           boolean search,
                           String propertyDefault)
                    throws CmsException
Looks up a specified property with optional direcory upward cascading, a default value will be returned if the property is not found on the resource (or it's parent folders in case search is set to true).

Parameters:
resource - the resource to look up the property for
property - the name of the property to look up
search - if true, the property will be looked up on all parent folders if it is not attached to the the resource, if false not (ie. normal property lookup)
propertyDefault - a default value that will be returned if the property was not found on the selected resource
Returns:
the value of the property found, if nothing was found the value of the propertyDefault parameter is returned
Throws:
CmsException - in case there where problems reading the property

readProperties

public Map readProperties(String resource)
                   throws CmsException
Looks up all properties for a resource.

Parameters:
resource - the resource to look up the property for
Returns:
Map of Strings representing all properties of the resource
Throws:
CmsException - in case there where problems reading the properties

readProperties

public Map readProperties(String resource,
                          boolean search)
                   throws CmsException
Looks up all properties for a resource with optional direcory upward cascading.

Parameters:
resource - the resource to look up the property for
search - if true, the properties will also be looked up on all parent folders and the results will be merged, if false not (ie. normal property lookup)
Returns:
Map of Strings representing all properties of the resource
Throws:
CmsException - in case there where problems reading the properties

readAllProperties

public Hashtable readAllProperties(String resource)
                            throws CmsException
Deprecated. use readProperties(String) instead

Returns a list of all properties of a file or folder.

Returns:
a Vector of Strings
Throws:
CmsException - if operation was not succesful

readPropertydefinition

public CmsPropertydefinition readPropertydefinition(String name,
                                                    String resourcetype)
                                             throws CmsException
Reads the property-definition for the resource type.

Parameters:
name - the name of the property-definition to read.
resourcetype - the name of the resource type for the property-definition.
Returns:
the property-definition.
Throws:
CmsException - if operation was not successful.

readTask

public CmsTask readTask(int id)
                 throws CmsException
Reads the task with the given id.

Parameters:
id - the id of the task to be read.
Throws:
CmsException - if operation was not successful.

readTaskLogs

public Vector readTaskLogs(int taskid)
                    throws CmsException
Reads log entries for a task.

Parameters:
taskid - the task for which the tasklog will be read.
Returns:
a Vector of new TaskLog objects.
Throws:
CmsException - if operation was not successful.

readTasksForProject

public Vector readTasksForProject(int projectId,
                                  int tasktype,
                                  String orderBy,
                                  String sort)
                           throws CmsException
Reads all tasks for a project.

Parameters:
projectId - the id of the project in which the tasks are defined. Can be null to select all tasks.
tasktype - the type of task you want to read: C_TASKS_ALL, C_TASKS_OPEN, C_TASKS_DONE, C_TASKS_NEW
orderBy - specifies how to order the tasks.
sort - sort order: C_SORT_ASC, C_SORT_DESC, or null.
Throws:
CmsException - if operation was not successful.

readTasksForRole

public Vector readTasksForRole(int projectId,
                               String roleName,
                               int tasktype,
                               String orderBy,
                               String sort)
                        throws CmsException
Reads all tasks for a role in a project.

Parameters:
projectId - the id of the Project in which the tasks are defined.
tasktype - the type of task you want to read: C_TASKS_ALL, C_TASKS_OPEN, C_TASKS_DONE, C_TASKS_NEW.
orderBy - specifies how to order the tasks.
sort - sort order C_SORT_ASC, C_SORT_DESC, or null
Throws:
CmsException - if operation was not successful.

readTasksForUser

public Vector readTasksForUser(int projectId,
                               String userName,
                               int tasktype,
                               String orderBy,
                               String sort)
                        throws CmsException
Reads all tasks for a user in a project.

Parameters:
projectId - the id of the Project in which the tasks are defined.
tasktype - the type of task you want to read: C_TASKS_ALL, C_TASKS_OPEN, C_TASKS_DONE, C_TASKS_NEW.
orderBy - specifies how to order the tasks.
sort - sort order C_SORT_ASC, C_SORT_DESC, or null
Throws:
CmsException - if operation was not successful.

readUser

public CmsUser readUser(int id)
                 throws CmsException
Returns a user in the Cms.

Parameters:
id - the id of the user to be returned.
Returns:
a user in the Cms.
Throws:
CmsException - if operation was not successful

readUser

public CmsUser readUser(String username)
                 throws CmsException
Returns a user in the Cms.

Parameters:
username - the name of the user to be returned.
Returns:
a user in the Cms.
Throws:
CmsException - if operation was not successful

readUser

public CmsUser readUser(String username,
                        int type)
                 throws CmsException
Returns a user in the Cms.

Parameters:
username - the name of the user to be returned.
type - the type of the user.
Returns:
a user in the Cms.
Throws:
CmsException - if operation was not successful

readUser

public CmsUser readUser(String username,
                        String password)
                 throws CmsException
Returns a user in the Cms, if the password is correct.

Parameters:
username - the name of the user to be returned.
password - the password of the user to be returned.
Returns:
a user in the Cms.
Throws:
CmsException - if operation was not successful

readWebUser

public CmsUser readWebUser(String username)
                    throws CmsException
Returns a user object if the password for the user is correct.

Security: All users are granted.

Parameters:
username - The username of the user that is to be read.
Returns:
User
Throws:
CmsException - Throws CmsException if operation was not succesful

readWebUser

public CmsUser readWebUser(String username,
                           String password)
                    throws CmsException
Returns a user object if the password for the user is correct.

Security: All users are granted.

Parameters:
username - The username of the user that is to be read.
password - The password of the user that is to be read.
Returns:
User
Throws:
CmsException - Throws CmsException if operation was not succesful

reaktivateTask

public void reaktivateTask(int taskId)
                    throws CmsException
Reactivates a task from the Cms.

Throws:
CmsException - if operation was not successful.

recoverPassword

public void recoverPassword(String username,
                            String recoveryPassword,
                            String newPassword)
                     throws CmsException
Sets a new password if the user knows his recovery-password.

Parameters:
username - the name of the user.
recoveryPassword - the recovery password.
newPassword - the new password.
Throws:
CmsException - if operation was not successfull.

removeUserFromGroup

public void removeUserFromGroup(String username,
                                String groupname)
                         throws CmsException
Removes a user from a group.

Security: Only the admin user is allowed to remove a user from a group.

Parameters:
username - the name of the user that is to be removed from the group.
groupname - the name of the group.
Throws:
CmsException - if operation was not successful.

renameFile

public void renameFile(String oldname,
                       String newname)
                throws CmsException
Deprecated. Use renameResource instead.

Renames the file to the new name.

Parameters:
oldname - the complete path to the file which will be renamed.
newname - the new name of the file.
Throws:
CmsException - if the user has not the rights to rename the file, or if the file couldn't be renamed.

renameResource

public void renameResource(String oldname,
                           String newname)
                    throws CmsException
Renames the resource to the new name.

Parameters:
oldname - the complete path to the file which will be renamed.
newname - the new name of the file.
Throws:
CmsException - if the user has not the rights to rename the file, or if the file couldn't be renamed.

doRenameFile

protected void doRenameFile(String oldname,
                            String newname)
                     throws CmsException
Renames the resource to the new name.

Parameters:
oldname - the complete path to the file which will be renamed.
newname - the new name of the file.
Throws:
CmsException - if the user has not the rights to rename the file, or if the file couldn't be renamed.

restoreResource

public void restoreResource(int versionId,
                            String filename)
                     throws CmsException
Restores a file in the current project with a version in the backup

Parameters:
versionId - The version id of the resource
filename - The name of the file to restore
Throws:
CmsException - Throws CmsException if operation was not succesful.

doRestoreResource

protected void doRestoreResource(int versionId,
                                 String filename)
                          throws CmsException
Restores a file in the current project with a version in the backup

Parameters:
versionId - The version id of the resource
filename - The name of the file to restore
Throws:
CmsException - Throws CmsException if operation was not succesful.

rootFolder

public CmsFolder rootFolder()
                     throws CmsException
Returns the root-folder object.

Returns:
the root-folder object.
Throws:
CmsException - if operation was not successful.

setLauncherManager

public void setLauncherManager(CmsLauncherManager newM_launcherManager)
Set the launcher manager used with this instance of CmsObject.

Parameters:
newM_launcherManager - com.opencms.launcher.CmsLauncherManager

setName

public void setName(int taskId,
                    String name)
             throws CmsException
Set a new name for a task.

Parameters:
name - the new name of the task.
Throws:
CmsException - if operationwas not successful.

setParentGroup

public void setParentGroup(String groupName,
                           String parentGroupName)
                    throws CmsException
Sets a new parent-group for an already existing group in the Cms.

Parameters:
groupName - the name of the group that should be written to the Cms.
parentGroupName - the name of the parentGroup to set, or null if the parent group should be deleted.
Throws:
CmsException - if operation was not successfull.

setPassword

public void setPassword(String username,
                        String newPassword)
                 throws CmsException
Sets the password for a user.

Parameters:
username - the name of the user.
newPassword - the new password.
Throws:
CmsException - if operation was not successful.

setPassword

public void setPassword(String username,
                        String oldPassword,
                        String newPassword)
                 throws CmsException
Sets the password for a user.

Parameters:
username - the name of the user.
oldPassword - the old password.
newPassword - the new password.
Throws:
CmsException - if operation was not successful.

setPriority

public void setPriority(int taskId,
                        int priority)
                 throws CmsException
Sets the priority of a task.

Parameters:
priority - the new priority value.
Throws:
CmsException - if operation was not successful.

setRecoveryPassword

public void setRecoveryPassword(String username,
                                String oldPassword,
                                String newPassword)
                         throws CmsException
Sets the recovery password for a user.

Parameters:
username - the name of the user.
newPassword - the new recovery password.
Throws:
CmsException - if operation was not successful.

setTaskPar

public void setTaskPar(int taskid,
                       String parname,
                       String parvalue)
                throws CmsException
Set a parameter for a task.

Parameters:
taskid - the Id of the task.
parname - the ame of the parameter.
parvalue - the value of the parameter.
Returns:
the id of the inserted parameter or 0 if the parameter already exists for this task.
Throws:
CmsException - if operation was not successful.

setTimeout

public void setTimeout(int taskId,
                       long timeout)
                throws CmsException
Sets the timeout of a task.

Parameters:
timeout - the new timeout value.
Throws:
CmsException - if operation was not successful.

syncFolder

public void syncFolder(String resourceName)
                throws CmsException
Synchronize cms-resources on virtual filesystem with the server filesystem.

Throws:
CmsException - if operation was not successful.

unlockProject

public void unlockProject(int id)
                   throws CmsException
Unlocks all resources of a project.

Parameters:
id - the id of the project to be unlocked.
Throws:
CmsException - if operation was not successful.

unlockResource

public void unlockResource(String resource)
                    throws CmsException
Unlocks a resource.
A user can unlock a resource, so other users may lock this file.

Parameters:
resource - the complete path to the resource to be unlocked.
Throws:
CmsException - if the user has not the rights to unlock this resource.

undoChanges

public void undoChanges(String filename)
                 throws CmsException
Undo changes in a file by copying the online file.

Parameters:
filename - the complete path of the file.
Throws:
CmsException - if the file couldn't be deleted, or if the user has not the appropriate rights to write the file.

doUndoChanges

protected void doUndoChanges(String resource)
                      throws CmsException
Undo changes in a file.

Parameters:
resource - the complete path to the resource to be unlocked.
Throws:
CmsException - if the user has not the rights to write this resource.

doUnlockResource

protected void doUnlockResource(String resource)
                         throws CmsException
Unlocks a resource.
A user can unlock a resource, so other users may lock this file.

Parameters:
resource - the complete path to the resource to be unlocked.
Throws:
CmsException - if the user has not the rights to unlock this resource.

userInGroup

public boolean userInGroup(String username,
                           String groupname)
                    throws CmsException
Tests, if a user is member of the given group.

Parameters:
username - the name of the user to test.
groupname - the name of the group to test.
Returns:
true, if the user is in the group; else false otherwise.
Throws:
CmsException - if operation was not successful.

writeExportPath

public void writeExportPath(String path)
                     throws CmsException
Writes the export-path for the system.
This path is used for db-export and db-import.

Throws:
CmsException - if operation ws not successful.

writeFile

public void writeFile(CmsFile file)
               throws CmsException
Writes a file to the Cms.

Parameters:
file - the file to write.
Throws:
CmsException - if resourcetype is set to folder. The CmsException will also be thrown, if the user has not the rights write the file.

writeFileExtensions

public void writeFileExtensions(Hashtable extensions)
                         throws CmsException
Writes the file extensions.

Security: Only the admin user is allowed to write file extensions.

Parameters:
extensions - holds extensions as keys and resourcetypes (Strings) as values.
CmsException

writeFileHeader

public void writeFileHeader(CmsFile file)
                     throws CmsException
Writes a file-header to the Cms.

Parameters:
file - the file to write.
Throws:
CmsException - if resourcetype is set to folder. The CmsException will also be thrown, if the user has not the rights to write the file header..

writeGroup

public void writeGroup(CmsGroup group)
                throws CmsException
Writes an already existing group to the Cms.

Parameters:
group - the group that should be written to the Cms.
Throws:
CmsException - if operation was not successful.

writeProperties

public void writeProperties(String name,
                            Map properties)
                     throws CmsException
Writes a couple of Properties for a file or folder.

Parameters:
name - the resource-name of which the Property has to be set.
properties - a Hashtable with property-definitions and property values as Strings.
Throws:
CmsException - if operation was not successful.

writeProperty

public void writeProperty(String name,
                          String property,
                          String value)
                   throws CmsException
Writes a property for a file or folder.

Parameters:
name - the resource-name for which the property will be set.
property - the property-definition name.
value - the value for the property to be set.
Throws:
CmsException - if operation was not successful.

writePropertydefinition

public CmsPropertydefinition writePropertydefinition(CmsPropertydefinition definition)
                                              throws CmsException
Deprecated. Do not use this method any longer because there is no type of propertydefinition

Writes the property-definition for the resource type.

Throws:
CmsException - if operation was not successful.

writeTaskLog

public void writeTaskLog(int taskid,
                         String comment)
                  throws CmsException
Writes a new user tasklog for a task.

Parameters:
taskid - the Id of the task.
comment - the description for the log.
Throws:
CmsException - if operation was not successful.

writeTaskLog

public void writeTaskLog(int taskid,
                         String comment,
                         int taskType)
                  throws CmsException
Writes a new user tasklog for a task.

Parameters:
taskid - the Id of the task .
comment - the description for the log
Throws:
CmsException - if operation was not successful.

writeUser

public void writeUser(CmsUser user)
               throws CmsException
Updates the user information.

Security: Only the admin user is allowed to update the user information.

Parameters:
user - the user to be written.
Throws:
CmsException - if operation was not successful.

writeWebUser

public void writeWebUser(CmsUser user)
                  throws CmsException
Updates the user information of a web user.
Only a web user can be updated this way.

Parameters:
user - the user to be written.
Throws:
CmsException - if operation was not successful.

sendBroadcastMessage

public void sendBroadcastMessage(String message)
                          throws CmsException
Returns a list of all currently logged in users. This method is only allowed for administrators.

CmsException

getLoggedInUsers

public Vector getLoggedInUsers()
                        throws CmsException
Returns a list of all currently logged in users. This method is only allowed for administrators.

CmsException

changeLockedInProject

public void changeLockedInProject(int projectId,
                                  String resourcename)
                           throws CmsException
Changes the project-id of a resource to the new project for publishing the resource directly

Parameters:
resourcename - The name of the resource to change
CmsException

doChangeLockedInProject

protected void doChangeLockedInProject(int projectId,
                                       String resourcename)
                                throws CmsException
Changes the project-id of a resource to the new project for publishing the resource directly

Parameters:
resourcename - The name of the resource to change
CmsException

getSiteRoot

public String getSiteRoot(String resourcename)
Returns the name of the current site root, e.g. /default/vfs

Parameters:
resourcename - The name of the resource
Returns:
String The resourcename including its site root

getSiteName

public String getSiteName()
Returns the name of the current site, e.g. /default

Returns:
String The site name

setContextToVfs

public void setContextToVfs()
Sets the name of the current site root of the virtual file system


setContextToCos

public void setContextToCos()
Sets the name of the current site root of the content objects system


setContextTo

public void setContextTo(String name)
Sets the name of the current site root

Parameters:
name - The name of the context

isHistoryEnabled

public boolean isHistoryEnabled()
Check if the history is enabled

Returns:
boolean Is true if history is enabled

getBackupVersionId

public int getBackupVersionId()
Get the next version id for the published backup resources

Returns:
int The new version id

backupProject

public void backupProject(int projectId,
                          int versionId,
                          long publishDate)
                   throws CmsException
Creates a backup of the published project

Parameters:
versionId - The version of the backup
publishDate - The date of publishing
Throws:
CmsException - Throws CmsException if operation was not succesful.

readCronTable

public String readCronTable()
                     throws CmsException
Gets the Crontable. Security: All users are garnted

Returns:
the crontable.
CmsException

writeCronTable

public void writeCronTable(String crontable)
                    throws CmsException
Writes the Crontable. Security: Only a administrator can do this

Returns:
the crontable.
CmsException

digest

public String digest(String value)
Method to encrypt the passwords.

Parameters:
value - The value to encrypt.
Returns:
The encrypted value.

getLimitedWorkplacePort

public int getLimitedWorkplacePort()
This is the port the workplace access is limited to. With the opencms.properties the access to the workplace can be limited to a user defined port. With this feature a firewall can block all outside requests to this port with the result the workplace is only available in the local net segment.

Returns:
the portnumber or -1 if no port is set.

changeUserType

public void changeUserType(int userId,
                           int userType)
                    throws CmsException
Changes the type of the user

Parameters:
userId - The id of the user to change
userType - The new type of the user
CmsException

changeUserType

public void changeUserType(String username,
                           int userType)
                    throws CmsException
Changes the type of the user to webusertype

Parameters:
username - The name of the user to change
userType - The new type of the user
CmsException

readResourcesLikeName

public Vector readResourcesLikeName(String resourcename)
                             throws CmsException
Returns a Vector with the resources that contains the given part in the resourcename.
Security: Access is granted, if:

Parameters:
resourcename - A part of resourcename
Returns:
subfolders A Vector with resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readFilesByType

public Vector readFilesByType(int projectId,
                              int resourcetype)
                       throws CmsException
Reads all files from the Cms, that are of the given type.

Parameters:
projectId - A project id for reading online or offline resources
resourcetype - The type of the files.
Returns:
A Vector of files.
Throws:
CmsException - Throws CmsException if operation was not succesful

writeLinkCheckTable

public void writeLinkCheckTable(Hashtable linkchecktable)
                         throws CmsException
Writes the Linkchecktable. Security: Only a administrator can do this

Parameters:
linkchecktable - The hashtable that contains the links that were not reachable
Returns:
the linkchecktable.
CmsException

readLinkCheckTable

public Hashtable readLinkCheckTable()
                             throws CmsException
Gets the Linkchecktable. Security: All users are garnted

Returns:
the linkchecktable.
CmsException

deleteBackups

public int deleteBackups(int weeks)
                  throws CmsException
Deletes the versions from the backup tables that are older then the given weeks

Parameters:
weeks - The number of weeks: the max age of the remaining versions
Returns:
int The oldest remaining version
CmsException

accessReadVisible

public boolean accessReadVisible(CmsResource resource)
                          throws CmsException
Checks, if the user may read this resource and if it is visible to him. NOTE: If the ressource is in the project you never have to fallback.

Parameters:
resource - The resource to check.
Returns:
weather the user has access, or not.
CmsException

getVisibleResourcesWithProperty

public Vector getVisibleResourcesWithProperty(String propertyDefinition,
                                              String propertyValue,
                                              int resourceType)
                                       throws CmsException
Returns a Vector with all resources of the given type that have set the given property to the given value. Security: All users that have read and view access are granted.

Parameters:
resourceType - The resource type of the resource
Returns:
Vector with all resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

touch

public void touch(String resourceName,
                  long timestamp,
                  boolean touchRecursive)
           throws CmsException
Change the timestamp of a resource.

Parameters:
resourceName - the name of the resource to change
timestamp - timestamp the new timestamp of the changed resource
CmsException

doTouch

protected void doTouch(String resourceName,
                       long timestamp)
                throws CmsException
Access the resource broker underneath to change the timestamp of a resource.

Parameters:
resourceName - the name of the resource to change
timestamp - timestamp the new timestamp of the changed resource
CmsException

joinLinksToTargets

public ArrayList joinLinksToTargets()
                             throws CmsException
Joins all links with their targets for the current project.

Returns:
an ArrayList with the resources identified as broken links
Throws:
CmsException
See Also:
CmsResourceBroker.joinLinksToTargets(com.opencms.file.CmsObject, com.opencms.file.CmsUser, com.opencms.file.CmsProject, com.opencms.report.I_CmsReport)

joinLinksToTargets

public ArrayList joinLinksToTargets(CmsProject theProject)
                             throws CmsException
Joins all links with their targets for a given project.

Parameters:
theProject - the CmsProject for which the links should be joined with their targets
Returns:
an ArrayList with the resources identified as broken links
Throws:
CmsException
See Also:
CmsResourceBroker.joinLinksToTargets(com.opencms.file.CmsObject, com.opencms.file.CmsUser, com.opencms.file.CmsProject, com.opencms.report.I_CmsReport)

joinLinksToTargets

public ArrayList joinLinksToTargets(I_CmsReport theReport)
                             throws CmsException
Joins all VFS links with their target resources for the current project, printing the output to the specified report.

Parameters:
theReport - the report to print the output
Returns:
an ArrayList with the resources identified as broken links
Throws:
CmsException
See Also:
CmsResourceBroker.joinLinksToTargets(com.opencms.file.CmsObject, com.opencms.file.CmsUser, com.opencms.file.CmsProject, com.opencms.report.I_CmsReport)

joinLinksToTargets

public ArrayList joinLinksToTargets(CmsProject theProject,
                                    I_CmsReport theReport)
                             throws CmsException
Joins all VFS links with their target resources for a given project, printing the output to the given report.

Parameters:
theProject - the CmsProject for which the links should be joined with their targets
theReport - the report to print the output
Returns:
an ArrayList with the resources identified as broken links
Throws:
CmsException
See Also:
CmsResourceBroker.joinLinksToTargets(com.opencms.file.CmsObject, com.opencms.file.CmsUser, com.opencms.file.CmsProject, com.opencms.report.I_CmsReport)

joinLinksToTargets

public ArrayList joinLinksToTargets(CmsUser theUser,
                                    CmsProject theProject,
                                    I_CmsReport theReport)
                             throws CmsException
Joins all VFS links with their target resources for a given project, printing the output to the given report.

Parameters:
theUser - the current user
theProject - the CmsProject for which the links should be joined with their targets
theReport - the report to print the output
Returns:
an ArrayList with the resources identified as broken links
Throws:
CmsException
See Also:
CmsResourceBroker.joinLinksToTargets(com.opencms.file.CmsObject, com.opencms.file.CmsUser, com.opencms.file.CmsProject, com.opencms.report.I_CmsReport)

fetchVfsLinksForResource

public ArrayList fetchVfsLinksForResource(String theResourceName)
                                   throws CmsException
Fetches the resource names of all VFS links pointing to a given resource as an ArrayList.

Parameters:
theResourceName - the name of the resource for which all VFS links are fetched
Returns:
an ArrayList with the resources names of all links pointint to the specified resource
Throws:
CmsException

doDecrementLinkCountForResource

public int doDecrementLinkCountForResource(String theResourceName)
                                    throws CmsException
Decrement the VFS link counter for a resource. The link counter is saved in the RESOURCE_FLAGS table attribute.

Parameters:
theResourceName - the name of the resource for which the link count is decremented
Returns:
the current link count of the specified resource
Throws:
CmsException

doIncrementLinkCountForResource

public int doIncrementLinkCountForResource(String theResourceName)
                                    throws CmsException
Increment the VFS link counter for a resource. The link counter is saved in the RESOURCE_FLAGS table attribute.

Parameters:
theResourceName - the name of the resource for which the link count is incremented
Returns:
the current link count of the specified resource
Throws:
CmsException

linkResourceToTarget

public void linkResourceToTarget(String theLinkResourceName,
                                 String theTargetResourceName)
                          throws CmsException
Save the ID of the target resource for a VFS link. The target ID is saved in the RESOURCE_FLAGS table attribute.

Parameters:
theLinkResourceName - the resource name of the VFS link
theTargetResourceName - the name of the link's target resource
Throws:
CmsException