com.opencms.file.genericSql
Class CmsResourceBroker

java.lang.Object
  |
  +--com.opencms.file.genericSql.CmsResourceBroker
All Implemented Interfaces:
I_CmsConstants, I_CmsResourceBroker
Direct Known Subclasses:
CmsResourceBroker, CmsResourceBroker, CmsResourceBroker

public class CmsResourceBroker
extends Object
implements I_CmsResourceBroker, I_CmsConstants

This is THE resource broker. It merges all resource broker into one public class. The interface is local to package. All methods get additional parameters (callingUser and currentproject) to check the security- police.

Version:
$Revision: 1.375.2.2 $ $Date: 2003/06/27 14:59:46 $
Author:
Andreas Schouten, Michaela Schleich, Michael Emmerich, Anders Fugmann

Field Summary
protected static String C_CACHE_ALL_PROPERTIES
           
protected static String C_CACHE_NULL_PROPERTY_VALUE
           
protected  Map m_accessCache
           
protected  int m_cachelimit
           
protected  source.org.apache.java.util.Configurations m_configuration
          The configuration of the property-file.
protected  CmsDbAccess m_dbAccess
          The access-module.
protected  long m_fileSystemChanges
          Constant to count the file-system changes.
protected  long m_fileSystemFolderChanges
          Constant to count the file-system changes if Folders are involved.
protected  Map m_groupCache
           
protected  int m_limitedWorkplacePort
          The portnumber the workplace access is limited to.
protected  CmsProject m_onlineProjectCache
           
protected  Map m_projectCache
           
protected  Map m_propertyCache
           
protected  Map m_propertyDefCache
           
protected  Map m_propertyDefVectorCache
           
protected  String m_refresh
           
protected  I_CmsRegistry m_registry
          The Registry
protected  Map m_resourceCache
           
protected  Map m_resourceListCache
           
protected  Hashtable m_resourceTypes
          Hashtable with resource-types.
protected  Map m_userCache
           
protected  Map m_userGroupsCache
           
 
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
CmsResourceBroker()
           
 
Method Summary
 void acceptTask(CmsUser currentUser, CmsProject currentProject, int taskId)
          Accept a task from the Cms.
 boolean accessCreate(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Checks, if the user may create this resource.
 boolean accessCreate(CmsUser currentUser, CmsProject currentProject, String resourceName)
          Checks, if the user may create this resource.
protected  boolean accessGroup(CmsUser currentUser, CmsProject currentProject, CmsResource resource, int flags)
          Checks, if the group may access this resource.
 boolean accessLock(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Checks, if the user may lock this resource.
 boolean accessLock(CmsUser currentUser, CmsProject currentProject, String resourceName)
          Checks, if the user may lock this resource.
protected  boolean accessOther(CmsResource resource, int flags)
          Checks, if others may access this resource.
protected  boolean accessOwner(CmsUser currentUser, CmsProject currentProject, CmsResource resource, int flags)
          Checks, if the owner may access this resource.
 boolean accessProject(CmsUser currentUser, CmsProject currentProject, int projectId)
          Tests if the user can access the project.
 boolean accessRead(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Checks if the user may read this resource.
 boolean accessRead(CmsUser currentUser, CmsProject currentProject, String resourceName)
          Checks if the user may read this resource.
 boolean accessReadVisible(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Checks, if the user may read this resource and if it is visible to him.
 boolean accessUnlock(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Checks, if the user may unlock this resource.
 boolean accessWrite(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Checks, if the user may write this resource.
 boolean accessWrite(CmsUser currentUser, CmsProject currentProject, String resourceName)
          Checks, if the user may write this resource.
 boolean accessWriteUnlocked(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Checks, if the user may write the unlocked resource.
 void addFileExtension(CmsUser currentUser, CmsProject currentProject, String extension, String resTypeName)
          adds a file extension to the list of known file extensions Security: Users, which are in the group "administrators" are granted.
 CmsGroup addGroup(CmsUser currentUser, CmsProject currentProject, String name, String description, int flags, String parent)
          Add a new group to the Cms.
 CmsUser addImportUser(CmsUser currentUser, CmsProject currentProject, 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.
 CmsUser addUser(CmsObject cms, CmsUser currentUser, CmsProject currentProject, String name, String password, String group, String description, Hashtable additionalInfos, int flags)
          Adds a user to the Cms.
 void addUserToGroup(CmsUser currentUser, CmsProject currentProject, String username, String groupname)
          Adds a user to a group.
 CmsUser addWebUser(CmsObject cms, CmsUser currentUser, CmsProject currentProject, String name, String password, String group, String description, Hashtable additionalInfos, int flags)
          Adds a web user to the Cms.
 CmsUser addWebUser(CmsObject cms, CmsUser currentUser, CmsProject currentProject, String name, String password, String group, String additionalGroup, String description, Hashtable additionalInfos, int flags)
          Adds a web user to the Cms.
 CmsUser anonymousUser(CmsUser currentUser, CmsProject currentProject)
          Returns the anonymous user object.
 void backupProject(int projectId, int versionId, long publishDate, CmsUser currentUser)
          Creates a backup of the published project
 void changeLockedInProject(int projectId, String resourcename, CmsUser currentUser)
          Changes the project-id of a resource to the new project for publishing the resource directly
 void changeUserType(CmsUser currentUser, CmsProject currentProject, CmsUser user, int userType)
          Changes the user type of the user Only the administrator can change the type
 void changeUserType(CmsUser currentUser, CmsProject currentProject, int userId, int userType)
          Changes the user type of the user Only the administrator can change the type
 void changeUserType(CmsUser currentUser, CmsProject currentProject, String username, int userType)
          Changes the user type of the user Only the administrator can change the type
 void chgrp(CmsUser currentUser, CmsProject currentProject, String filename, String newGroup)
          Changes the group for this resource
Only the group of a resource in an offline project can be changed.
 void chmod(CmsUser currentUser, CmsProject currentProject, String filename, int flags)
          Changes the flags for this resource.
 void chown(CmsUser currentUser, CmsProject currentProject, String filename, String newOwner)
          Changes the owner for this resource.
 void chstate(CmsUser currentUser, CmsProject currentProject, String filename, int state)
          Changes the state for this resource
The user may change this, if he is admin of the resource.
 void chtype(CmsUser currentUser, CmsProject currentProject, String filename, String newType)
          Changes the resourcetype for this resource
Only the resourcetype of a resource in an offline project can be changed.
 void clearcache()
          Clears all internal DB-Caches.
protected  void clearResourceCache()
          Clears all the depending caches when a resource was changed
protected  void clearResourceCache(String resourcename, CmsProject currentProject, CmsUser currentUser)
          Clears all the depending caches when a resource was changed
protected  void clearUserCache(CmsUser user)
          Clears the user cache for the given user
 void copyFile(CmsUser currentUser, CmsProject currentProject, String source, String destination)
          Copies a file in the Cms.
 void copyFolder(CmsUser currentUser, CmsProject currentProject, String source, String destination)
          Copies a folder in the Cms.
 void copyResourceToProject(CmsUser currentUser, CmsProject currentProject, String resource)
          Copies a resource from the online project to a new, specified project.
 int countLockedResources(CmsUser currentUser, CmsProject currentProject, int id)
          Counts the locked resources in this project.
 CmsDbAccess createDbAccess(source.org.apache.java.util.Configurations configurations)
          return the correct DbAccess class.
 CmsProject createDirectPublishProject(CmsUser currentUser, CmsProject currentProject, String name, String description, String groupname, String managergroupname, int projecttype)
          Creates a project for the direct publish.
 CmsFile createFile(CmsUser currentUser, CmsGroup currentGroup, CmsProject currentProject, String newFileName, byte[] contents, String type, Map propertyinfos)
          Creates a new file with the given content and resourcetype.
 CmsFolder createFolder(CmsUser currentUser, CmsGroup currentGroup, CmsProject currentProject, String newFolderName, Map propertyinfos)
          Creates a new folder.
 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.
 CmsProject createProject(CmsUser currentUser, CmsProject currentProject, String name, String description, String groupname, String managergroupname)
          Creates a project.
 CmsProject createProject(CmsUser currentUser, CmsProject currentProject, String name, String description, String groupname, String managergroupname, int projecttype)
          Creates a project.
 CmsTask createProject(CmsUser currentUser, String projectName, int projectType, String roleName, long timeout, int priority)
          Creates a new project for task handling.
 CmsPropertydefinition createPropertydefinition(CmsUser currentUser, CmsProject currentProject, String name, String resourcetype)
          Creates the propertydefinition for the resource type.
 CmsTask createTask(CmsUser currentUser, CmsProject currentProject, String agentName, String roleName, String taskname, String taskcomment, long timeout, int priority)
          Creates a new task.
 CmsTask createTask(CmsUser currentUser, int projectid, String agentName, String roleName, String taskName, String taskComment, int taskType, long timeout, int priority)
          Creates a new task.
 CmsProject createTempfileProject(CmsObject cms, CmsUser currentUser, CmsProject currentProject)
          Creates a project for the temporary files.
 int decrementLinkCountForResource(CmsProject theProject, String theResourceName)
          Decrement the VFS link counter for a resource.
 void deleteAllProperties(CmsUser currentUser, CmsProject currentProject, String resource)
          Deletes all propertyinformation for a file or folder.
 int deleteBackups(CmsObject cms, CmsUser currentUser, CmsProject currentProject, int weeks)
          Deletes the versions from the backup tables that are older then the given weeks
 void deleteExportLink(CmsExportLink link)
          Deletes an exportlink in the database.
 void deleteExportLink(String link)
          Deletes an exportlink in the database.
 void deleteFile(CmsUser currentUser, CmsProject currentProject, String filename)
          Deletes a file in the Cms.
 void deleteFolder(CmsUser currentUser, CmsProject currentProject, String foldername)
          Deletes a folder in the Cms.
 void deleteGroup(CmsUser currentUser, CmsProject currentProject, String delgroup)
          Delete a group from the Cms.
 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(CmsUser currentUser, CmsProject currentProject, int id)
          Deletes a project.
 void deleteProperty(CmsUser currentUser, CmsProject currentProject, String resource, String property)
          Deletes a propertyinformation for a file or folder.
 void deletePropertydefinition(CmsUser currentUser, CmsProject currentProject, String name, String resourcetype)
          Delete the propertydefinition for the resource type.
 void deleteUser(CmsUser currentUser, CmsProject currentProject, int userId)
          Deletes a user from the Cms.
 void deleteUser(CmsUser currentUser, CmsProject currentProject, String username)
          Deletes a user from the Cms.
 void deleteWebUser(CmsUser currentUser, CmsProject currentProject, int userId)
          Deletes a web user from the Cms.
 void destroy()
          Destroys the resource broker and required modules and connections.
 String digest(String value)
          Method to encrypt the passwords.
 void endTask(CmsUser currentUser, CmsProject currentProject, int taskid)
          Ends a task from the Cms.
 void exportModuledata(CmsUser currentUser, CmsProject currentProject, String exportFile, String[] exportChannels, String[] exportModules, CmsObject cms, I_CmsReport report)
          Exports channels and moduledata to zip.
 void exportResources(CmsUser currentUser, CmsProject currentProject, String exportFile, String[] exportPaths, CmsObject cms)
          Exports cms-resources to zip.
 void exportResources(CmsUser currentUser, CmsProject currentProject, String exportFile, String[] exportPaths, CmsObject cms, boolean excludeSystem, boolean excludeUnchanged)
          Exports cms-resources to zip.
 void exportResources(CmsUser currentUser, CmsProject currentProject, String exportFile, String[] exportPaths, CmsObject cms, boolean excludeSystem, boolean excludeUnchanged, boolean exportUserdata, long contentAge, I_CmsReport report)
          Exports cms-resources to zip.
 void exportStaticResources(CmsUser currentUser, CmsProject currentProject, CmsObject cms, Vector linksToExport)
          Creates a static export in the filesystem.
 void exportStaticResources(CmsUser currentUser, CmsProject currentProject, CmsObject cms, Vector startpoints, Vector projectResources, Vector allExportedLinks, CmsPublishedResources changedResources, I_CmsReport report)
          Creates a static export of a Cmsresource in the filesystem
 ArrayList fetchVfsLinksForResource(CmsUser theUser, CmsProject theProject, String theResourceName)
          Fetches all VFS links pointing to a given resource name.
protected  void fileSystemChanged(boolean folderChanged)
          This method is called, when a resource was changed.
 void forwardTask(CmsUser currentUser, CmsProject currentProject, int taskid, String newRoleName, String newUserName)
          Forwards a task to a new user.
 Vector getAllAccessibleProjects(CmsUser currentUser, CmsProject currentProject)
          Returns all projects, which are owned by the user or which are accessible for the group of the user.
 Vector getAllBackupProjects()
          Returns a Vector with all projects from history
 Vector getAllExportLinks()
          Returns a Vector with all export links
 Vector getAllManageableProjects(CmsUser currentUser, CmsProject currentProject)
          Returns all projects, which are owned by the user or which are manageable for the group of the user.
 Hashtable getAllResourceTypes(CmsUser currentUser, CmsProject currentProject)
          Returns a Vector 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()
          Returns informations about the cache

Security: All users are granted, except the anonymous user.

 Vector getChild(CmsUser currentUser, CmsProject currentProject, String groupname)
          Returns all child groups of a group

Security: All users are granted, except the anonymous user.

 Vector getChilds(CmsUser currentUser, CmsProject currentProject, String groupname)
          Returns all child groups of a group

This method also returns all sub-child groups of the current group.

 source.org.apache.java.util.Configurations getConfigurations(CmsUser currentUser, CmsProject currentProject)
          Method to access the configurations of the properties-file.
 Vector getDependingExportLinks(Vector res)
          Reads all export links that depend on the resource.
 Vector getDirectGroupsOfUser(CmsUser currentUser, CmsProject currentProject, String username)
          Returns the list of groups to which the user directly belongs to

Security: All users are granted.

 Vector getFilesInFolder(CmsUser currentUser, CmsProject currentProject, String foldername)
          Returns a Vector with all files of a folder.
 Vector getFilesInFolder(CmsUser currentUser, CmsProject currentProject, String foldername, boolean includeDeleted)
          Returns a Vector with all files of a folder.
 Vector getFilesWithProperty(CmsUser currentUser, CmsProject currentProject, String propertyDefinition, String propertyValue)
          Returns a Vector with all resource-names that have set the given property to the given value.
 long getFileSystemChanges(CmsUser currentUser, CmsProject currentProject)
          This method can be called, to determine if the file-system was changed in the past.
 long getFileSystemFolderChanges(CmsUser currentUser, CmsProject currentProject)
          This method can be called, to determine if the file-system was changed in the past.
 Vector getFolderTree(CmsUser currentUser, CmsProject currentProject, String rootName)
          Returns a Vector with the complete folder-tree for this project.
 Vector getGroups(CmsUser currentUser, CmsProject currentProject)
          Returns all groups

Security: All users are granted, except the anonymous user.

 Vector getGroupsOfUser(CmsUser currentUser, CmsProject currentProject, String username)
          Returns a list of groups of a user.
 int getLimitedWorkplacePort()
          This is the port the workplace access is limited to.
 Vector getOnlineBrokenLinks()
          serches for broken links in the online project.
 CmsGroup getParent(CmsUser currentUser, CmsProject currentProject, String groupname)
          Returns the parent group of a group

Security: All users are granted.

 CmsResource getParentResource(CmsUser currentUser, CmsProject currentProject, String resourcename)
          Returns the parent resource of a resouce.
 String getReadingpermittedGroup(int projectId, String resource)
          Checks which Group can read the resource and all the parent folders.
 I_CmsRegistry getRegistry(CmsUser currentUser, CmsProject currentProject, CmsObject cms)
          Gets the Registry.
 Vector getResourcesInFolder(CmsUser currentUser, CmsProject currentProject, String folder)
          Returns a Vector with the subresources for a folder.
 Vector getResourcesWithProperty(CmsUser currentUser, CmsProject currentProject, String propertyDefinition)
          Returns a Vector with all resources of the given type that have set the given property to the given value.
 Vector getResourcesWithProperty(CmsUser currentUser, CmsProject currentProject, 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(CmsUser currentUser, CmsProject currentProject, int resourceType)
          Returns a I_CmsResourceType.
 I_CmsResourceType getResourceType(CmsUser currentUser, CmsProject currentProject, String resourceType)
          Returns a I_CmsResourceType.
 Vector getSubFolders(CmsUser currentUser, CmsProject currentProject, String foldername)
          Returns a Vector with all subfolders.
 Vector getSubFolders(CmsUser currentUser, CmsProject currentProject, String foldername, boolean includeDeleted)
          Returns a Vector with all subfolders.
 String getTaskPar(CmsUser currentUser, CmsProject currentProject, 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(CmsUser currentUser, CmsProject currentProject)
          Returns all users

Security: All users are granted, except the anonymous user.

 Vector getUsers(CmsUser currentUser, CmsProject currentProject, int type)
          Returns all users from a given type

Security: All users are granted, except the anonymous user.

 Vector getUsers(CmsUser currentUser, CmsProject currentProject, int type, String namestart)
          Returns all users from a given type that start with a specified string

Security: All users are granted, except the anonymous user.

 Vector getUsersByLastname(CmsUser currentUser, CmsProject currentProject, String Lastname, int UserType, int UserStatus, int wasLoggedIn, int nMax)
          Gets all users with a certain Lastname.
 Vector getUsersOfGroup(CmsUser currentUser, CmsProject currentProject, String groupname)
          Returns a list of users in a group.
 Vector getVisibleResourcesWithProperty(CmsUser currentUser, CmsProject currentProject, 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.
protected  Vector helperGetFilesInFolder(CmsUser currentUser, CmsProject currentProject, String foldername, boolean includeDeleted)
          A helper method for this resource-broker.
protected  Vector helperGetSubFolders(CmsUser currentUser, CmsProject currentProject, String foldername)
          A helper method for this resource-broker.
 void importFolder(CmsUser currentUser, CmsProject currentProject, String importFile, String importPath, CmsObject cms)
          Imports a import-resource (folder or zipfile) to the cms.
 CmsResource importResource(CmsUser currentUser, CmsProject currentProject, String newResourceName, int resourceType, Map propertyinfos, int launcherType, String launcherClassname, String ownername, String groupname, int accessFlags, long lastmodified, byte[] filecontent)
          Imports a resource.
 void importResources(CmsUser currentUser, CmsProject currentProject, String importFile, String importPath, CmsObject cms, I_CmsReport report)
          Imports a import-resource (folder or zipfile) to the cms.
 int incrementLinkCountForResource(CmsProject theProject, String theResourceName)
          Increment the VFS link counter for a resource.
 void init(source.org.apache.java.util.Configurations config)
          Initializes the resource broker and sets up all required modules and connections.
 boolean isAdmin(CmsUser currentUser, CmsProject currentProject)
          Determines, if the users current group is the admin-group.
 boolean isHistoryEnabled(CmsObject cms)
          Returns true if history is enabled
 boolean isManagerOfProject(CmsUser currentUser, CmsProject currentProject)
          Determines, if the users may manage a project.
 boolean isProjectManager(CmsUser currentUser, CmsProject currentProject)
          Determines, if the users current group is the projectleader-group.
 boolean isUser(CmsUser currentUser, CmsProject currentProject)
          Determines, if the users current group is the projectleader-group.
protected  boolean isWebgroup(CmsGroup group)
          Checks if this is a valid group for webusers
 ArrayList joinLinksToTargets(CmsObject cms, CmsUser theUser, CmsProject theProject, I_CmsReport theReport)
          Rebuilds the internal datastructure to join links with their targets.
 void linkResourceToTarget(CmsProject theProject, String theLinkResourceName, String theTargetResourceName)
          Save the ID of the target resource for a VFS link.
 CmsUser lockedBy(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Returns the user, who had locked the resource.
 CmsUser lockedBy(CmsUser currentUser, CmsProject currentProject, String resource)
          Returns the user, who had locked the resource.
 void lockResource(CmsUser currentUser, CmsProject currentProject, String resourcename, boolean force)
          Locks a resource.
 CmsUser loginUser(CmsUser currentUser, CmsProject currentProject, String username, String password)
          Logs a user into the Cms, if the password is correct.
 CmsUser loginWebUser(CmsUser currentUser, CmsProject currentProject, String username, String password)
          Logs a web user into the Cms, if the password is correct.
protected  Vector mergeResources(Vector offline, Vector online)
          Merges two resource-vectors into one vector.
 void moveFile(CmsUser currentUser, CmsProject currentProject, String source, String destination)
          Moves the file.
 CmsProject onlineProject(CmsUser currentUser, CmsProject currentProject)
          Returns the onlineproject.
 CmsPublishedResources publishProject(CmsObject cms, CmsUser currentUser, CmsProject currentProject, int id, I_CmsReport report)
          Publishes a project.
 CmsUser readAgent(CmsUser currentUser, CmsProject currentProject, CmsTask task)
          Reads the agent of a task from the OpenCms.
 Vector readAllFileHeaders(CmsUser currentUser, CmsProject currentProject, String filename)
          Reads all file headers of a file in the OpenCms.
 Vector readAllFileHeadersForHist(CmsUser currentUser, CmsProject currentProject, String filename)
          Reads all file headers of a file in the OpenCms.
 Vector readAllProjectResources(int projectId)
          select all projectResources from an given project
 Vector readAllPropertydefinitions(CmsUser currentUser, CmsProject currentProject, int resourceType)
          Reads all propertydefinitions for the given resource type.
 Vector readAllPropertydefinitions(CmsUser currentUser, CmsProject currentProject, String resourcetype)
          Reads all propertydefinitions for the given resource type.
 CmsBackupProject readBackupProject(CmsUser currentUser, CmsProject currentProject, int versionId)
          Reads the backupinformation of a project from the Cms.
 String readCronTable(CmsUser currentUser, CmsProject currentProject)
          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(CmsUser currentUser, CmsProject currentProject)
          Reads the export-path for the system.
 CmsFile readFile(CmsUser currentUser, CmsProject currentProject, String filename)
          Reads a file from the Cms.
 CmsFile readFile(CmsUser currentUser, CmsProject currentProject, String filename, boolean includeDeleted)
          Reads a file from the Cms.
 Hashtable readFileExtensions(CmsUser currentUser, CmsProject currentProject)
          Gets the known file extensions (=suffixes) Security: All users are granted access
 CmsBackupResource readFileForHist(CmsUser currentUser, CmsProject currentProject, int versionId, String filename)
          Reads a file from the history of the Cms.
 CmsResource readFileHeader(CmsUser currentUser, CmsProject currentProject, int projectId, String filename)
          Reads a file header a previous project of the Cms.
 CmsResource readFileHeader(CmsUser currentUser, CmsProject currentProject, String filename)
          Reads a file header from the Cms.
 CmsResource readFileHeader(CmsUser currentUser, CmsProject currentProject, String filename, boolean includeDeleted)
          Reads a file header from the Cms.
 CmsBackupResource readFileHeaderForHist(CmsUser currentUser, CmsProject currentProject, int versionId, String filename)
          Reads a file header from the history of the Cms.
 Vector readFileHeaders(CmsUser currentUser, CmsProject currentProject, int projectId)
          Reads all file headers for a project from the Cms.
 Vector readFilesByType(CmsUser currentUser, CmsProject currentProject, int projectId, int resourcetype)
          Reads all files from the Cms, that are of the given type.
 CmsFolder readFolder(CmsUser currentUser, CmsProject currentProject, int folderid, boolean includeDeleted)
          Reads a folder from the Cms.
protected  CmsFolder readFolder(CmsUser currentUser, CmsProject currentProject, int project, String folder)
          Reads a folder from the Cms.
 CmsFolder readFolder(CmsUser currentUser, CmsProject currentProject, String folder)
          Reads a folder from the Cms.
 CmsFolder readFolder(CmsUser currentUser, CmsProject currentProject, String folder, boolean includeDeleted)
          Reads a folder from the Cms.
 Vector readGivenTasks(CmsUser currentUser, CmsProject currentProject, int projectId, String ownerName, int taskType, String orderBy, String sort)
          Reads all given tasks from a user for a project.
 CmsGroup readGroup(CmsUser currentUser, CmsProject currentProject, CmsProject project)
          Reads the group of a project from the OpenCms.
 CmsGroup readGroup(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Reads the group of a resource from the OpenCms.
 CmsGroup readGroup(CmsUser currentUser, CmsProject currentProject, CmsTask task)
          Reads the group (role) of a task from the OpenCms.
 CmsGroup readGroup(CmsUser currentUser, CmsProject currentProject, int groupid)
          Returns a group object.
 CmsGroup readGroup(CmsUser currentUser, CmsProject currentProject, String groupname)
          Returns a group object.
 Hashtable readLinkCheckTable(CmsUser currentUser, CmsProject currentProject)
          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(CmsUser currentUser, CmsProject currentProject, CmsProject project)
          Reads the managergroup of a project from the OpenCms.
 Hashtable readMimeTypes(CmsUser currentUser, CmsProject currentProject)
          Gets the MimeTypes.
 Vector readOnlineLinkEntrys(int pageId)
          returns a Vector (Strings) with the link destinations of all links on the page with the pageId.
 CmsUser readOriginalAgent(CmsUser currentUser, CmsProject currentProject, CmsTask task)
          Reads the original agent of a task from the OpenCms.
 CmsUser readOwner(CmsUser currentUser, CmsProject currentProject, CmsProject project)
          Reads the owner of a project from the OpenCms.
 CmsUser readOwner(CmsUser currentUser, CmsProject currentProject, CmsResource resource)
          Reads the owner of a resource from the OpenCms.
 CmsUser readOwner(CmsUser currentUser, CmsProject currentProject, CmsTask task)
          Reads the owner (initiator) of a task from the OpenCms.
 CmsUser readOwner(CmsUser currentUser, CmsProject currentProject, CmsTaskLog log)
          Reads the owner of a tasklog from the OpenCms.
 CmsProject readProject(CmsUser currentUser, CmsProject currentProject, CmsResource res)
          Reads a project from the Cms.
 CmsProject readProject(CmsUser currentUser, CmsProject currentProject, CmsTask task)
          Reads a project from the Cms.
 CmsProject readProject(CmsUser currentUser, CmsProject currentProject, int id)
          Reads a project from the Cms.
 Vector readProjectLogs(CmsUser currentUser, CmsProject currentProject, int projectid)
          Reads log entries for a project.
 Vector readProjectView(CmsUser currentUser, CmsProject currentProject, int projectId, String filter)
          Reads all file headers of a project from the Cms.
 Map readProperties(CmsUser currentUser, CmsProject currentProject, String resource, String siteRoot, boolean search)
          Looks up all properties for a resource with optional direcory upward cascading.
 String readProperty(CmsUser currentUser, CmsProject currentProject, String resource, String siteRoot, String property, boolean search)
          Looks up a specified property with optional direcory upward cascading.
 String readProperty(CmsUser currentUser, CmsProject currentProject, String resource, String siteRoot, 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(CmsUser currentUser, CmsProject currentProject, String name, String resourcetype)
          Reads a definition for the given resource type.
 Vector readResources(CmsProject project)
          Insert the method's description here.
 Vector readResourcesLikeName(CmsUser currentUser, CmsProject currentProject, String resourcename)
          Returns a Vector with the resources that contains the given part in the resourcename.
 CmsTask readTask(CmsUser currentUser, CmsProject currentProject, int id)
          Read a task by id.
 Vector readTaskLogs(CmsUser currentUser, CmsProject currentProject, int taskid)
          Reads log entries for a task.
 Vector readTasksForProject(CmsUser currentUser, CmsProject currentProject, int projectId, int tasktype, String orderBy, String sort)
          Reads all tasks for a project.
 Vector readTasksForRole(CmsUser currentUser, CmsProject currentProject, int projectId, String roleName, int tasktype, String orderBy, String sort)
          Reads all tasks for a role in a project.
 Vector readTasksForUser(CmsUser currentUser, CmsProject currentProject, int projectId, String userName, int taskType, String orderBy, String sort)
          Reads all tasks for a user in a project.
 CmsUser readUser(CmsUser currentUser, CmsProject currentProject, int id)
          Returns a user object.
 CmsUser readUser(CmsUser currentUser, CmsProject currentProject, String username)
          Returns a user object.
 CmsUser readUser(CmsUser currentUser, CmsProject currentProject, String username, int type)
          Returns a user object.
 CmsUser readUser(CmsUser currentUser, CmsProject currentProject, String username, String password)
          Returns a user object if the password for the user is correct.
 CmsUser readWebUser(CmsUser currentUser, CmsProject currentProject, String username)
          Returns a user object if the password for the user is correct.
 CmsUser readWebUser(CmsUser currentUser, CmsProject currentProject, String username, String password)
          Returns a user object if the password for the user is correct.
 void reaktivateTask(CmsUser currentUser, CmsProject currentProject, int taskId)
          Reaktivates a task from the Cms.
 void recoverPassword(CmsObject cms, CmsUser currentUser, CmsProject currentProject, String username, String recoveryPassword, String newPassword)
          Sets a new password only if the user knows his recovery-password.
 void removeUserFromGroup(CmsUser currentUser, CmsProject currentProject, String username, String groupname)
          Removes a user from a group.
 void renameFile(CmsUser currentUser, CmsProject currentProject, String oldname, String newname)
          Renames the file to a new name.
 void restoreResource(CmsUser currentUser, CmsProject currentProject, int versionId, String filename)
          Restores a file in the current project with a version in the backup
 Hashtable restoreSession(String oldSessionId)
          This method loads old sessiondata from the database.
 void setName(CmsUser currentUser, CmsProject currentProject, int taskId, String name)
          Set a new name for a task Security: All users are granted.
 void setParentGroup(CmsUser currentUser, CmsProject currentProject, String groupName, String parentGroupName)
          Sets a new parent-group for an already existing group in the Cms.
 void setPassword(CmsObject cms, CmsUser currentUser, CmsProject currentProject, String username, String newPassword)
          Sets the password for a user.
 void setPassword(CmsObject cms, CmsUser currentUser, CmsProject currentProject, String username, String oldPassword, String newPassword)
          Sets the password for a user.
 void setPriority(CmsUser currentUser, CmsProject currentProject, int taskId, int priority)
          Set priority of a task Security: All users are granted.
 void setRecoveryPassword(CmsObject cms, CmsUser currentUser, CmsProject currentProject, String username, String password, String newPassword)
          Sets the recovery password for a user.
 void setTaskPar(CmsUser currentUser, CmsProject currentProject, int taskId, String parName, String parValue)
          Set a Parameter for a task.
 void setTimeout(CmsUser currentUser, CmsProject currentProject, int taskId, long timeout)
          Set timeout of a task Security: All users are granted.
 boolean shouldReloadClasses(int projectId, Vector classFiles)
          This method checks, if there is a classFile marked as changed or deleted.
 void storeSession(String sessionId, Hashtable sessionData)
          This method stores sessiondata into the database.
 void touch(CmsUser currentUser, CmsProject currentProject, String resourceName, long timestamp)
          Access the resource broker underneath to change the timestamp of a resource.
 void undeleteResource(CmsUser currentUser, CmsProject currentProject, String filename)
          Undeletes a file in the Cms.
 void undoChanges(CmsUser currentUser, CmsProject currentProject, String resourceName)
          Undo all changes in the resource, restore the online file.
 void unlockProject(CmsUser currentUser, CmsProject currentProject, int id)
          Unlocks all resources in this project.
 void unlockResource(CmsUser currentUser, CmsProject currentProject, String resourcename)
          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(CmsUser currentUser, CmsProject currentProject, String username, String groupname)
          Checks if a user is member of a group.
protected  void validFilename(String filename)
          Checks ii characters in a String are allowed for filenames
protected  void validName(String name, boolean blank)
          Checks ii characters in a String are allowed for names
protected  void validTaskname(String taskname)
          Checks ii characters in a String are allowed for filenames
 void writeCronTable(CmsUser currentUser, CmsProject currentProject, 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(CmsUser currentUser, CmsProject currentProject, String path)
          Writes the export-path for the system.
 void writeFile(CmsUser currentUser, CmsProject currentProject, CmsFile file)
          Writes a file to the Cms.
 void writeFileExtensions(CmsUser currentUser, CmsProject currentProject, Hashtable extensions)
          Writes the file extensions Security: Users, which are in the group "Administrators" are authorized.
 void writeFileHeader(CmsUser currentUser, CmsProject currentProject, CmsFile file)
          Writes a fileheader to the Cms.
 void writeGroup(CmsUser currentUser, CmsProject currentProject, CmsGroup group)
          Writes an already existing group in the Cms.
 void writeLinkCheckTable(CmsUser currentUser, CmsProject currentProject, Hashtable linkchecktable)
          Writes the Linkchecktable.
 void writeProperties(CmsUser currentUser, CmsProject currentProject, String resource, Map propertyinfos)
          Writes a couple of propertyinformation for a file or folder.
 void writeProperty(CmsUser currentUser, CmsProject currentProject, String resource, String property, String value)
          Writes a propertyinformation for a file or folder.
 CmsPropertydefinition writePropertydefinition(CmsUser currentUser, CmsProject currentProject, CmsPropertydefinition propertydef)
          Updates the propertydefinition for the resource type.
 void writeResource(CmsUser currentUser, CmsProject currentProject, String resourcename, Map properties, String username, String groupname, int accessFlags, int resourceType, byte[] filecontent)
          Writes a resource and its properties to the Cms.
 void writeTaskLog(CmsUser currentUser, CmsProject currentProject, int taskid, String comment)
          Writes a new user tasklog for a task.
 void writeTaskLog(CmsUser currentUser, CmsProject currentProject, int taskid, String comment, int type)
          Writes a new user tasklog for a task.
 void writeUser(CmsUser currentUser, CmsProject currentProject, CmsUser user)
          Updates the user information.
 void writeWebUser(CmsUser currentUser, CmsProject currentProject, 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
 

Field Detail

m_fileSystemChanges

protected long m_fileSystemChanges
Constant to count the file-system changes.


m_fileSystemFolderChanges

protected long m_fileSystemFolderChanges
Constant to count the file-system changes if Folders are involved.


m_resourceTypes

protected Hashtable m_resourceTypes
Hashtable with resource-types.


m_configuration

protected source.org.apache.java.util.Configurations m_configuration
The configuration of the property-file.


m_dbAccess

protected CmsDbAccess m_dbAccess
The access-module.


m_registry

protected I_CmsRegistry m_registry
The Registry


m_limitedWorkplacePort

protected int m_limitedWorkplacePort
The portnumber the workplace access is limited to.


m_userCache

protected Map m_userCache

m_groupCache

protected Map m_groupCache

m_userGroupsCache

protected Map m_userGroupsCache

m_projectCache

protected Map m_projectCache

m_propertyCache

protected Map m_propertyCache

m_propertyDefCache

protected Map m_propertyDefCache

m_propertyDefVectorCache

protected Map m_propertyDefVectorCache

m_accessCache

protected Map m_accessCache

m_resourceCache

protected Map m_resourceCache

m_resourceListCache

protected Map m_resourceListCache

C_CACHE_NULL_PROPERTY_VALUE

protected static final String C_CACHE_NULL_PROPERTY_VALUE
See Also:
Constant Field Values

C_CACHE_ALL_PROPERTIES

protected static final String C_CACHE_ALL_PROPERTIES
See Also:
Constant Field Values

m_onlineProjectCache

protected CmsProject m_onlineProjectCache

m_cachelimit

protected int m_cachelimit

m_refresh

protected String m_refresh
Constructor Detail

CmsResourceBroker

public CmsResourceBroker()
Method Detail

acceptTask

public void acceptTask(CmsUser currentUser,
                       CmsProject currentProject,
                       int taskId)
                throws CmsException
Accept a task from the Cms. Security: All users are granted.

Specified by:
acceptTask in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Throws:
CmsException - Throws CmsException if something goes wrong.

accessCreate

public boolean accessCreate(CmsUser currentUser,
                            CmsProject currentProject,
                            CmsResource resource)
                     throws CmsException
Checks, if the user may create this resource.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
Returns:
wether the user has access, or not.
CmsException

accessCreate

public boolean accessCreate(CmsUser currentUser,
                            CmsProject currentProject,
                            String resourceName)
                     throws CmsException
Checks, if the user may create this resource.

Specified by:
accessCreate in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
wether the user has access, or not.
CmsException

accessGroup

protected boolean accessGroup(CmsUser currentUser,
                              CmsProject currentProject,
                              CmsResource resource,
                              int flags)
                       throws CmsException
Checks, if the group may access this resource.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
flags - The flags to check.
Returns:
wether the user has access, or not.
CmsException

accessLock

public boolean accessLock(CmsUser currentUser,
                          CmsProject currentProject,
                          CmsResource resource)
                   throws CmsException
Checks, if the user may lock this resource.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
Returns:
wether the user may lock this resource, or not.
CmsException

accessLock

public boolean accessLock(CmsUser currentUser,
                          CmsProject currentProject,
                          String resourceName)
                   throws CmsException
Checks, if the user may lock this resource.

Specified by:
accessLock in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
wether the user may lock this resource, or not.
CmsException

accessOther

protected boolean accessOther(CmsResource resource,
                              int flags)
                       throws CmsException
Checks, if others may access this resource.

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

accessOwner

protected boolean accessOwner(CmsUser currentUser,
                              CmsProject currentProject,
                              CmsResource resource,
                              int flags)
                       throws CmsException
Checks, if the owner may access this resource.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
flags - The flags to check.
Returns:
wether the user has access, or not.
CmsException

accessProject

public boolean accessProject(CmsUser currentUser,
                             CmsProject currentProject,
                             int projectId)
                      throws CmsException
Tests if the user can access the project. Security: All users are granted.

Specified by:
accessProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
projectId - the id of the project.
Returns:
true, if the user has access, else returns false.
Throws:
CmsException - Throws CmsException if something goes wrong.

accessRead

public boolean accessRead(CmsUser currentUser,
                          CmsProject currentProject,
                          CmsResource resource)
                   throws CmsException
Checks if the user may read this resource. NOTE: If the ressource is in the project you never have to fallback.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
Returns:
weather the user has access, or not.
CmsException

accessRead

public boolean accessRead(CmsUser currentUser,
                          CmsProject currentProject,
                          String resourceName)
                   throws CmsException
Checks if the user may read this resource. NOTE: If the ressource is in the project you never have to fallback.

Specified by:
accessRead in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
weather the user has access, or not.
CmsException

accessUnlock

public boolean accessUnlock(CmsUser currentUser,
                            CmsProject currentProject,
                            CmsResource resource)
                     throws CmsException
Checks, if the user may unlock this resource.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
Returns:
wether the user may unlock this resource, or not.
CmsException

accessWrite

public boolean accessWrite(CmsUser currentUser,
                           CmsProject currentProject,
                           CmsResource resource)
                    throws CmsException
Checks, if the user may write this resource.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
Returns:
wether the user has access, or not.
CmsException

accessWrite

public boolean accessWrite(CmsUser currentUser,
                           CmsProject currentProject,
                           String resourceName)
                    throws CmsException
Checks, if the user may write this resource.

Specified by:
accessWrite in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
wether the user has access, or not.
CmsException

accessWriteUnlocked

public boolean accessWriteUnlocked(CmsUser currentUser,
                                   CmsProject currentProject,
                                   CmsResource resource)
                            throws CmsException
Checks, if the user may write the unlocked resource.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
Returns:
wether the user has access, or not.
CmsException

addFileExtension

public void addFileExtension(CmsUser currentUser,
                             CmsProject currentProject,
                             String extension,
                             String resTypeName)
                      throws CmsException
adds a file extension to the list of known file extensions Security: Users, which are in the group "administrators" are granted.

Specified by:
addFileExtension in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
extension - a file extension like 'html'
resTypeName - name of the resource type associated to the extension
CmsException

addGroup

public CmsGroup addGroup(CmsUser currentUser,
                         CmsProject currentProject,
                         String name,
                         String description,
                         int flags,
                         String parent)
                  throws CmsException
Add a new group to the Cms.
Only the admin can do this.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
addGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name of the new group.
description - The description for the new group.
flags - The flags for the new group.
Returns:
Group
Throws:
CmsException - Throws CmsException if operation was not succesfull.

addUser

public CmsUser addUser(CmsObject cms,
                       CmsUser currentUser,
                       CmsProject currentProject,
                       String name,
                       String password,
                       String group,
                       String description,
                       Hashtable additionalInfos,
                       int flags)
                throws CmsException
Adds a user to the Cms. Only a adminstrator can add users to the cms.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
addUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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:
user The added user will be returned.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

addImportUser

public CmsUser addImportUser(CmsUser currentUser,
                             CmsProject currentProject,
                             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. Only a adminstrator can add users to the cms.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
addImportUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name for the user.
password - The password for the user.
recoveryPassword - The recoveryPassword 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:
user The added user will be returned.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

addUserToGroup

public void addUserToGroup(CmsUser currentUser,
                           CmsProject currentProject,
                           String username,
                           String groupname)
                    throws CmsException
Adds a user to a group.
Only the admin can do this.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
addUserToGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user that is to be added to the group.
groupname - The name of the group.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

addWebUser

public CmsUser addWebUser(CmsObject cms,
                          CmsUser currentUser,
                          CmsProject currentProject,
                          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.

Specified by:
addWebUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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:
user The added user will be returned.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

addWebUser

public CmsUser addWebUser(CmsObject cms,
                          CmsUser currentUser,
                          CmsProject currentProject,
                          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.

Specified by:
addWebUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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:
user The added user will be returned.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

anonymousUser

public CmsUser anonymousUser(CmsUser currentUser,
                             CmsProject currentProject)
                      throws CmsException
Returns the anonymous user object.

Security: All users are granted.

Specified by:
anonymousUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the anonymous user object.
Throws:
CmsException - Throws CmsException if operation was not succesful

chgrp

public void chgrp(CmsUser currentUser,
                  CmsProject currentProject,
                  String filename,
                  String newGroup)
           throws CmsException
Changes the group for this 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 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:

Specified by:
chgrp in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The complete path to the resource.
newGroup - The name of the new group for this resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

chmod

public void chmod(CmsUser currentUser,
                  CmsProject currentProject,
                  String filename,
                  int flags)
           throws CmsException
Changes the flags for this 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 exisiting 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:

Specified by:
chmod in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The complete path to the resource.
flags - The new accessflags for the resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

chown

public void chown(CmsUser currentUser,
                  CmsProject currentProject,
                  String filename,
                  String newOwner)
           throws CmsException
Changes the owner for this 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 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:

Specified by:
chown in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The complete path to the resource.
newOwner - The name of the new owner for this resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

touch

public void touch(CmsUser currentUser,
                  CmsProject currentProject,
                  String resourceName,
                  long timestamp)
           throws CmsException
Access the resource broker underneath to change the timestamp of a resource.

Specified by:
touch in interface I_CmsResourceBroker
Parameters:
currentUser - the currentuser who requested this method
currentProject - the current project of the user
resourceName - the name of the resource to change
timestamp - timestamp the new timestamp of the changed resource
CmsException

chstate

public void chstate(CmsUser currentUser,
                    CmsProject currentProject,
                    String filename,
                    int state)
             throws CmsException
Changes the state for this resource
The user may change this, if he is admin of the resource. Security: Access is granted, if:

Specified by:
chstate in interface I_CmsResourceBroker
Parameters:
filename - The complete path to the resource.
state - The new state of this resource.
Throws:
CmsException - will be thrown, if the user has not the rights for this resource.

chtype

public void chtype(CmsUser currentUser,
                   CmsProject currentProject,
                   String filename,
                   String newType)
            throws CmsException
Changes the resourcetype for this 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:

Specified by:
chtype in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The complete path to the resource.
newType - The name of the new resourcetype for this resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

clearcache

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

Specified by:
clearcache in interface I_CmsResourceBroker

copyFile

public void copyFile(CmsUser currentUser,
                     CmsProject currentProject,
                     String source,
                     String destination)
              throws CmsException
Copies a file in the Cms.
Security: Access is granted, if:

Specified by:
copyFile in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
source - The complete path of the sourcefile.
destination - The complete path to the destination.
Throws:
CmsException - Throws CmsException if operation was not succesful.

copyFolder

public void copyFolder(CmsUser currentUser,
                       CmsProject currentProject,
                       String source,
                       String destination)
                throws CmsException
Copies a folder in the Cms.
Security: Access is granted, if:

Specified by:
copyFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
source - The complete path of the sourcefolder.
destination - The complete path to the destination.
Throws:
CmsException - Throws CmsException if operation was not succesful.

copyResourceToProject

public void copyResourceToProject(CmsUser currentUser,
                                  CmsProject currentProject,
                                  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. Security: Access is granted, if:

Specified by:
copyResourceToProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The name of the resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

countLockedResources

public int countLockedResources(CmsUser currentUser,
                                CmsProject currentProject,
                                int id)
                         throws CmsException
Counts the locked resources in this project. Security Only the admin or the owner of the project can do this.

Specified by:
countLockedResources in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
id - The id of the project
Returns:
the amount of locked resources in this project.
Throws:
CmsException - Throws CmsException if something goes wrong.

createDbAccess

public CmsDbAccess createDbAccess(source.org.apache.java.util.Configurations configurations)
                           throws CmsException
return the correct DbAccess class. This method should be overloaded by all other Database Drivers Creation date: (09/15/00 %r)

Parameters:
configurations - source.org.apache.java.util.Configurations
Returns:
com.opencms.file.genericSql.CmsDbAccess
Throws:
CmsException - Thrown if CmsDbAccess class could not be instantiated.

createFile

public CmsFile createFile(CmsUser currentUser,
                          CmsGroup currentGroup,
                          CmsProject currentProject,
                          String newFileName,
                          byte[] contents,
                          String type,
                          Map propertyinfos)
                   throws CmsException
Creates a new file with the given content and resourcetype.
Files can only be created in an offline project, the state of the new file is set to NEW (2).
Security: Access is granted, if:

Specified by:
createFile in interface I_CmsResourceBroker
Parameters:
currentUser - The user who owns this file.
currentGroup - The group who owns this file.
currentProject - The project in which the resource will be used.
contents - The contents of the new file.
type - The name of the resourcetype of the new file.
propertyinfos - 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.
newFileName - The name of the new file with full path information.
Returns:
file The created file.
Throws:
CmsException - Throws CmsException if operation was not succesful.

createFolder

public CmsFolder createFolder(CmsUser currentUser,
                              CmsGroup currentGroup,
                              CmsProject currentProject,
                              String newFolderName,
                              Map propertyinfos)
                       throws CmsException
Creates a new folder. Security: Access is granted, if:

Specified by:
createFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentGroup - The group who requested this method.
currentProject - The current project of the user.
newFolderName - The name of the new folder (No pathinformation allowed).
propertyinfos - 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.
Returns:
file The created file.
Throws:
CmsException - will be thrown for missing propertyinfos, for worng propertydefs or if the filename is not valid. The CmsException will also be thrown, if the user has not the rights for this resource.

importResource

public CmsResource importResource(CmsUser currentUser,
                                  CmsProject currentProject,
                                  String newResourceName,
                                  int resourceType,
                                  Map propertyinfos,
                                  int launcherType,
                                  String launcherClassname,
                                  String ownername,
                                  String groupname,
                                  int accessFlags,
                                  long lastmodified,
                                  byte[] filecontent)
                           throws CmsException
Imports a resource. Security: Access is granted, if:

Specified by:
importResource in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
newResourceName - The name of the new resource (No pathinformation allowed).
resourceType - The resourcetype of the new resource
propertyinfos - 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:
CmsResource The created resource.
Throws:
CmsException - will be thrown for missing propertyinfos, for worng propertydefs or if the filename is not valid. The CmsException will also be thrown, if the user has not the rights for this resource.

createProject

public CmsProject createProject(CmsUser currentUser,
                                CmsProject currentProject,
                                String name,
                                String description,
                                String groupname,
                                String managergroupname)
                         throws CmsException
Creates a project. Security Only the users which are in the admin or projectleader-group are granted. Changed: added the parent id

Specified by:
createProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name of the project to read.
description - The description for the new project.
Throws:
CmsException - Throws CmsException if something goes wrong.

createProject

public CmsProject createProject(CmsUser currentUser,
                                CmsProject currentProject,
                                String name,
                                String description,
                                String groupname,
                                String managergroupname,
                                int projecttype)
                         throws CmsException
Creates a project. Security Only the users which are in the admin or projectleader-group are granted. Changed: added the project type

Specified by:
createProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name of the project to read.
description - The description for the new project.
projecttype - the project type (normal or temporary)
Throws:
CmsException - Throws CmsException if something goes wrong.

createDirectPublishProject

public CmsProject createDirectPublishProject(CmsUser currentUser,
                                             CmsProject currentProject,
                                             String name,
                                             String description,
                                             String groupname,
                                             String managergroupname,
                                             int projecttype)
                                      throws CmsException
Creates a project for the direct publish. Security Only the users which are in the admin or projectleader-group of the current project are granted. Changed: added the project type

Specified by:
createDirectPublishProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name of the project to read.
description - The description for the new project.
Throws:
CmsException - Throws CmsException if something goes wrong.

createTempfileProject

public CmsProject createTempfileProject(CmsObject cms,
                                        CmsUser currentUser,
                                        CmsProject currentProject)
                                 throws CmsException
Creates a project for the temporary files. Security Only the users which are in the admin or projectleader-group are granted. Changed: added the project type

Specified by:
createTempfileProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Throws:
CmsException - Throws CmsException if something goes wrong.

createProject

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

Specified by:
createProject in interface I_CmsResourceBroker
Parameters:
currentUser - User who creates the project
projectName - Name of the project
projectType - Type of the Project
timeout - Time when the Project must finished
priority - Priority for the Project
Returns:
The new task project
Throws:
CmsException - Throws CmsException if something goes wrong.

createPropertydefinition

public CmsPropertydefinition createPropertydefinition(CmsUser currentUser,
                                                      CmsProject currentProject,
                                                      String name,
                                                      String resourcetype)
                                               throws CmsException
Creates the propertydefinition for the resource type.
Security Only the admin can do this.

Specified by:
createPropertydefinition in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name of the propertydefinition to overwrite.
resourcetype - The name of the resource-type for the propertydefinition.
Throws:
CmsException - Throws CmsException if something goes wrong.

createTask

public CmsTask createTask(CmsUser currentUser,
                          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 are granted.

Specified by:
createTask in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
projectid - The Id of the current project task of the user.
agentName - User who will edit the task
roleName - Usergroup for the task
taskName - Name of the task
taskType - Type of the task
taskComment - Description of the task
timeout - Time when the task must finished
priority - Id for the priority
Returns:
A new Task Object
Throws:
CmsException - Throws CmsException if something goes wrong.

createTask

public CmsTask createTask(CmsUser currentUser,
                          CmsProject currentProject,
                          String agentName,
                          String roleName,
                          String taskname,
                          String taskcomment,
                          long timeout,
                          int priority)
                   throws CmsException
Creates a new task. Security: All users are granted.

Specified by:
createTask in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskname - Name of the task
taskcomment - Description of the task.
timeout - Time when the task must finished
priority - Id for the priority
Returns:
A new Task Object
Throws:
CmsException - Throws CmsException if something goes wrong.

deleteAllProperties

public void deleteAllProperties(CmsUser currentUser,
                                CmsProject currentProject,
                                String resource)
                         throws CmsException
Deletes all propertyinformation for a file or folder. Security Only the user is granted, who has the right to write the resource.

Specified by:
deleteAllProperties in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The name of the resource of which the propertyinformations have to be deleted.
Throws:
CmsException - Throws CmsException if operation was not succesful

deleteFile

public void deleteFile(CmsUser currentUser,
                       CmsProject currentProject,
                       String filename)
                throws CmsException
Deletes a file in the Cms.
A file can only be deleteed in an offline project. A file is deleted by setting its state to DELETED (3).
Security: Access is granted, if:

Specified by:
deleteFile in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The complete path of the file.
Throws:
CmsException - Throws CmsException if operation was not succesful.

deleteFolder

public void deleteFolder(CmsUser currentUser,
                         CmsProject currentProject,
                         String foldername)
                  throws CmsException
Deletes a folder in the Cms.
Only folders in an offline Project can be deleted. A folder is deleted by setting its state to DELETED (3).
In its current implmentation, this method can ONLY delete empty folders. Security: Access is granted, if:

Specified by:
deleteFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
foldername - The complete path of the folder.
Throws:
CmsException - Throws CmsException if operation was not succesful.

undeleteResource

public void undeleteResource(CmsUser currentUser,
                             CmsProject currentProject,
                             String filename)
                      throws CmsException
Undeletes a file in the Cms.
A file can only be undeleted in an offline project. A file is undeleted by setting its state to CHANGED (1).
Security: Access is granted, if:

Specified by:
undeleteResource in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The complete path of the file.
Throws:
CmsException - Throws CmsException if operation was not succesful.

deleteGroup

public void deleteGroup(CmsUser currentUser,
                        CmsProject currentProject,
                        String delgroup)
                 throws CmsException
Delete a group from the Cms.
Only groups that contain no subgroups can be deleted. Only the admin can do this.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
deleteGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
delgroup - The name of the group that is to be deleted.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

deleteProject

public void deleteProject(CmsUser currentUser,
                          CmsProject currentProject,
                          int id)
                   throws CmsException
Deletes a project. Security Only the admin or the owner of the project can do this.

Specified by:
deleteProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
id - The id of the project to be published.
Throws:
CmsException - Throws CmsException if something goes wrong.

deleteProperty

public void deleteProperty(CmsUser currentUser,
                           CmsProject currentProject,
                           String resource,
                           String property)
                    throws CmsException
Deletes a propertyinformation for a file or folder. Security Only the user is granted, who has the right to write the resource.

Specified by:
deleteProperty in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The name of the resource of which the propertyinformation has to be read.
property - The propertydefinition-name of which the propertyinformation has to be set.
Throws:
CmsException - Throws CmsException if operation was not succesful

deletePropertydefinition

public void deletePropertydefinition(CmsUser currentUser,
                                     CmsProject currentProject,
                                     String name,
                                     String resourcetype)
                              throws CmsException
Delete the propertydefinition for the resource type.
Security Only the admin can do this.

Specified by:
deletePropertydefinition in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name of the propertydefinition to read.
resourcetype - The name of the resource type for which the propertydefinition is valid.
Throws:
CmsException - Throws CmsException if something goes wrong.

deleteUser

public void deleteUser(CmsUser currentUser,
                       CmsProject currentProject,
                       int userId)
                throws CmsException
Deletes a user from the Cms. Only a adminstrator can do this.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
deleteUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
userId - The Id of the user to be deleted.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

deleteUser

public void deleteUser(CmsUser currentUser,
                       CmsProject currentProject,
                       String username)
                throws CmsException
Deletes a user from the Cms.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
deleteUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

deleteWebUser

public void deleteWebUser(CmsUser currentUser,
                          CmsProject currentProject,
                          int userId)
                   throws CmsException
Deletes a web user from the Cms.

Specified by:
deleteWebUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
userId - The Id of the user to be deleted.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

destroy

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

Specified by:
destroy in interface I_CmsResourceBroker
Throws:
CmsException - Throws CmsException if something goes wrong.

endTask

public void endTask(CmsUser currentUser,
                    CmsProject currentProject,
                    int taskid)
             throws CmsException
Ends a task from the Cms. Security: All users are granted.

Specified by:
endTask in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskid - The ID of the task to end.
Throws:
CmsException - Throws CmsException if something goes wrong.

exportResources

public void exportResources(CmsUser currentUser,
                            CmsProject currentProject,
                            String exportFile,
                            String[] exportPaths,
                            CmsObject cms)
                     throws CmsException
Exports cms-resources to zip. Security: only Administrators can do this;

Specified by:
exportResources in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
exportFile - the name (absolute Path) of the export resource (zip)
cms - the cms-object to use for the export.
exportPaths - the name (absolute Path) of folders from which should be exported
Throws:
Throws - CmsException if something goes wrong.
CmsException

exportResources

public void exportResources(CmsUser currentUser,
                            CmsProject currentProject,
                            String exportFile,
                            String[] exportPaths,
                            CmsObject cms,
                            boolean excludeSystem,
                            boolean excludeUnchanged)
                     throws CmsException
Exports cms-resources to zip. Security: only Administrators can do this;

Specified by:
exportResources in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
exportFile - the name (absolute Path) of the export resource (zip)
excludeUnchanged - true, if unchanged files should be excluded.
cms - the cms-object to use for the export.
exportPaths - the name (absolute Path) of folders from which should be exported
Throws:
Throws - CmsException if something goes wrong.
CmsException

exportResources

public void exportResources(CmsUser currentUser,
                            CmsProject currentProject,
                            String exportFile,
                            String[] exportPaths,
                            CmsObject cms,
                            boolean excludeSystem,
                            boolean excludeUnchanged,
                            boolean exportUserdata,
                            long contentAge,
                            I_CmsReport report)
                     throws CmsException
Exports cms-resources to zip. Security: only Administrators can do this;

Specified by:
exportResources in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
exportFile - the name (absolute Path) of the export resource (zip)
exportPaths - the name (absolute Path) of folders from which should be exported
cms - the cms-object to use for the export.
excludeUnchanged - true, if unchanged files should be excluded.
contentAge - Max age of content to be exported (timestamp)
report - the cmsReport to handle the log messages.
Throws:
Throws - CmsException if something goes wrong.
CmsException

exportModuledata

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

Specified by:
exportModuledata in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
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
cms - the cms-object to use for the export.
Throws:
Throws - CmsException if something goes wrong.
CmsException

fileSystemChanged

protected void fileSystemChanged(boolean folderChanged)
This method is called, when a resource was changed. Currently it counts the changes.


forwardTask

public void forwardTask(CmsUser currentUser,
                        CmsProject currentProject,
                        int taskid,
                        String newRoleName,
                        String newUserName)
                 throws CmsException
Forwards a task to a new user. Security: All users are granted.

Specified by:
forwardTask in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskid - The Id of the task to forward.
Throws:
CmsException - Throws CmsException if something goes wrong.

getAllAccessibleProjects

public Vector getAllAccessibleProjects(CmsUser currentUser,
                                       CmsProject currentProject)
                                throws CmsException
Returns all projects, which are owned by the user or which are accessible for the group of the user. Security All users are granted.

Specified by:
getAllAccessibleProjects in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
a Vector of projects.
CmsException

getAllManageableProjects

public Vector getAllManageableProjects(CmsUser currentUser,
                                       CmsProject currentProject)
                                throws CmsException
Returns all projects, which are owned by the user or which are manageable for the group of the user. Security All users are granted.

Specified by:
getAllManageableProjects in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
a Vector of projects.
CmsException

getAllBackupProjects

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

Specified by:
getAllBackupProjects in interface I_CmsResourceBroker
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

Specified by:
getAllExportLinks in interface I_CmsResourceBroker
Returns:
Vector (Strings) with all export links.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getAllResourceTypes

public Hashtable getAllResourceTypes(CmsUser currentUser,
                                     CmsProject currentProject)
                              throws CmsException
Returns a Vector with all I_CmsResourceTypes. Security: All users are granted.

Specified by:
getAllResourceTypes in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user. Returns a Hashtable with all I_CmsResourceTypes.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getCacheInfo

public Hashtable getCacheInfo()
Returns informations about the cache

Security: All users are granted, except the anonymous user.

Specified by:
getCacheInfo in interface I_CmsResourceBroker
Returns:
A hashtable with informations about the cache.

getChild

public Vector getChild(CmsUser currentUser,
                       CmsProject currentProject,
                       String groupname)
                throws CmsException
Returns all child groups of a group

Security: All users are granted, except the anonymous user.

Specified by:
getChild in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
groupname - The name of the group.
Returns:
groups A Vector of all child groups or null.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getChilds

public Vector getChilds(CmsUser currentUser,
                        CmsProject currentProject,
                        String groupname)
                 throws CmsException
Returns all child groups of a group

This method also returns all sub-child groups of the current group. Security: All users are granted, except the anonymous user.

Specified by:
getChilds in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
groupname - The name of the group.
Returns:
groups A Vector of all child groups or null.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getConfigurations

public source.org.apache.java.util.Configurations getConfigurations(CmsUser currentUser,
                                                                    CmsProject currentProject)
Method to access the configurations of the properties-file. Security: All users are granted.

Specified by:
getConfigurations in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
The Configurations of the properties-file.

getDirectGroupsOfUser

public Vector getDirectGroupsOfUser(CmsUser currentUser,
                                    CmsProject currentProject,
                                    String username)
                             throws CmsException
Returns the list of groups to which the user directly belongs to

Security: All users are granted.

Specified by:
getDirectGroupsOfUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user.
Returns:
Vector of groups
Throws:
CmsException - Throws CmsException if operation was not succesful

getFilesInFolder

public Vector getFilesInFolder(CmsUser currentUser,
                               CmsProject currentProject,
                               String foldername)
                        throws CmsException
Returns a Vector with all files of a folder.
Files of a folder can be read from an offline Project and the online Project.
Security: Access is granted, if:

Specified by:
getFilesInFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
foldername - the complete path to the folder.
Returns:
A Vector with all subfiles for the overgiven folder.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getFilesInFolder

public Vector getFilesInFolder(CmsUser currentUser,
                               CmsProject currentProject,
                               String foldername,
                               boolean includeDeleted)
                        throws CmsException
Returns a Vector with all files of a folder.
Files of a folder can be read from an offline Project and the online Project.
Security: Access is granted, if:

Specified by:
getFilesInFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
foldername - the complete path to the folder.
includeDeleted - Include the folder if it is deleted
Returns:
A Vector with all subfiles for the overgiven folder.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getFilesWithProperty

public Vector getFilesWithProperty(CmsUser currentUser,
                                   CmsProject currentProject,
                                   String propertyDefinition,
                                   String propertyValue)
                            throws CmsException
Returns a Vector with all resource-names that have set the given property to the given value. Security: All users are granted.

Specified by:
getFilesWithProperty in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
Vector with all names of resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getFileSystemChanges

public long getFileSystemChanges(CmsUser currentUser,
                                 CmsProject currentProject)
This method can be called, to determine if the file-system was changed in the past. A module can compare its previosly stored number with this returned number. If they differ, a change was made. Security: All users are granted.

Specified by:
getFileSystemChanges in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the number of file-system-changes.

getFileSystemFolderChanges

public long getFileSystemFolderChanges(CmsUser currentUser,
                                       CmsProject currentProject)
This method can be called, to determine if the file-system was changed in the past. A module can compare its previosly stored number with this returned number. If they differ, a change was made. Security: All users are granted.

Specified by:
getFileSystemFolderChanges in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the number of file-system-changes.

getFolderTree

public Vector getFolderTree(CmsUser currentUser,
                            CmsProject currentProject,
                            String rootName)
                     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.
Security: Access is granted, if:

Specified by:
getFolderTree in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
rootName - The name of the root, e.g. /default/vfs
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(CmsUser currentUser,
                        CmsProject currentProject)
                 throws CmsException
Returns all groups

Security: All users are granted, except the anonymous user.

Specified by:
getGroups in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
users A Vector of all existing groups.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getGroupsOfUser

public Vector getGroupsOfUser(CmsUser currentUser,
                              CmsProject currentProject,
                              String username)
                       throws CmsException
Returns a list of groups of a user.

Security: All users are granted.

Specified by:
getGroupsOfUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user.
Returns:
Vector of groups
Throws:
CmsException - Throws CmsException if operation was not succesful

getReadingpermittedGroup

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

Specified by:
getReadingpermittedGroup in interface I_CmsResourceBroker
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(CmsUser currentUser,
                          CmsProject currentProject,
                          String groupname)
                   throws CmsException
Returns the parent group of a group

Security: All users are granted.

Specified by:
getParent in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
groupname - The name of the group.
Returns:
group The parent group or null.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getParentResource

public CmsResource getParentResource(CmsUser currentUser,
                                     CmsProject currentProject,
                                     String resourcename)
                              throws CmsException
Returns the parent resource of a resouce.

Security: All users are granted.

Specified by:
getParentResource in interface I_CmsResourceBroker
Parameters:
currentUser - the user who requested this method.
currentProject - the current project of the user.
resourcename - the name of the resource to find the parent for
Returns:
The parent resource read from the VFS
Throws:
CmsException - if parent resource could not be read

getRegistry

public I_CmsRegistry getRegistry(CmsUser currentUser,
                                 CmsProject currentProject,
                                 CmsObject cms)
                          throws CmsException
Gets the Registry.

Specified by:
getRegistry in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
cms - The actual CmsObject
Throws:
Throws - CmsException if access is not allowed.
CmsException

getResourcesInFolder

public Vector getResourcesInFolder(CmsUser currentUser,
                                   CmsProject currentProject,
                                   String folder)
                            throws CmsException
Returns a Vector with the subresources for a folder.
Security: Access is granted, if:

Specified by:
getResourcesInFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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(CmsUser currentUser,
                                       CmsProject currentProject,
                                       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.

Specified by:
getResourcesWithProperty in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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(CmsUser currentUser,
                                       CmsProject currentProject,
                                       String propertyDefinition)
                                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.

Specified by:
getResourcesWithProperty in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
Vector with all resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getResourceType

public I_CmsResourceType getResourceType(CmsUser currentUser,
                                         CmsProject currentProject,
                                         int resourceType)
                                  throws CmsException
Returns a I_CmsResourceType. Security: All users are granted.

Specified by:
getResourceType in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resourceType - the id of the resourceType to get. Returns a I_CmsResourceType.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getResourceType

public I_CmsResourceType getResourceType(CmsUser currentUser,
                                         CmsProject currentProject,
                                         String resourceType)
                                  throws CmsException
Returns a I_CmsResourceType. Security: All users are granted.

Specified by:
getResourceType in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resourceType - the name of the resource to get. Returns a I_CmsResourceType.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getSubFolders

public Vector getSubFolders(CmsUser currentUser,
                            CmsProject currentProject,
                            String foldername)
                     throws CmsException
Returns a Vector with all subfolders.
Subfolders can be read from an offline project and the online project.
Security: Access is granted, if:

Specified by:
getSubFolders in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
foldername - the complete path to the folder.
Returns:
subfolders A Vector with all subfolders for the given folder.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getSubFolders

public Vector getSubFolders(CmsUser currentUser,
                            CmsProject currentProject,
                            String foldername,
                            boolean includeDeleted)
                     throws CmsException
Returns a Vector with all subfolders.
Subfolders can be read from an offline project and the online project.
Security: Access is granted, if:

Specified by:
getSubFolders in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
foldername - the complete path to the folder.
includeDeleted - Include the folder if it is deleted
Returns:
subfolders A Vector with all subfolders for the given folder.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getTaskPar

public String getTaskPar(CmsUser currentUser,
                         CmsProject currentProject,
                         int taskId,
                         String parName)
                  throws CmsException
Get a parameter value for a task. Security: All users are granted.

Specified by:
getTaskPar in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskId - The Id of the task.
parName - Name of the parameter.
Throws:
CmsException - Throws CmsException if something goes wrong.

getTaskType

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

Specified by:
getTaskType in interface I_CmsResourceBroker
Parameters:
taskName - Name of the Task
Returns:
id from the task template
Throws:
CmsException - Throws CmsException if something goes wrong.

getUsers

public Vector getUsers(CmsUser currentUser,
                       CmsProject currentProject)
                throws CmsException
Returns all users

Security: All users are granted, except the anonymous user.

Specified by:
getUsers in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
users A Vector of all existing users.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getUsers

public Vector getUsers(CmsUser currentUser,
                       CmsProject currentProject,
                       int type)
                throws CmsException
Returns all users from a given type

Security: All users are granted, except the anonymous user.

Specified by:
getUsers in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
type - The type of the users.
Returns:
users A Vector of all existing users.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getUsers

public Vector getUsers(CmsUser currentUser,
                       CmsProject currentProject,
                       int type,
                       String namestart)
                throws CmsException
Returns all users from a given type that start with a specified string

Security: All users are granted, except the anonymous user.

Specified by:
getUsers in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
type - The type of the users.
namestart - The filter for the username
Returns:
users A Vector of all existing users.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getUsersOfGroup

public Vector getUsersOfGroup(CmsUser currentUser,
                              CmsProject currentProject,
                              String groupname)
                       throws CmsException
Returns a list of users in a group.

Security: All users are granted, except the anonymous user.

Specified by:
getUsersOfGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
groupname - The name of the group to list users from.
Returns:
Vector of users.
Throws:
CmsException - Throws CmsException if operation was not succesful.

getUsersByLastname

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

Specified by:
getUsersByLastname in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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.

helperGetFilesInFolder

protected Vector helperGetFilesInFolder(CmsUser currentUser,
                                        CmsProject currentProject,
                                        String foldername,
                                        boolean includeDeleted)
                                 throws CmsException
A helper method for this resource-broker. Returns a Vector with all files of a folder. The method does not read any files from the parrent folder, and do also return deleted files.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
foldername - the complete path to the folder.
Returns:
subfiles A Vector with all subfiles for the overgiven folder.
Throws:
CmsException - Throws CmsException if operation was not succesful.

helperGetSubFolders

protected Vector helperGetSubFolders(CmsUser currentUser,
                                     CmsProject currentProject,
                                     String foldername)
                              throws CmsException
A helper method for this resource-broker. Returns a Hashtable with all subfolders.
Subfolders can be read from an offline project and the online project.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project to read the folders from.
foldername - the complete path to the folder.
Returns:
subfolders A Hashtable with all subfolders for the given folder.
Throws:
CmsException - Throws CmsException if operation was not succesful.

importFolder

public void importFolder(CmsUser currentUser,
                         CmsProject currentProject,
                         String importFile,
                         String importPath,
                         CmsObject cms)
                  throws CmsException
Imports a import-resource (folder or zipfile) to the cms. Security: only Administrators can do this;

Specified by:
importFolder in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
importFile - the name (absolute Path) of the import resource (zip or folder)
importPath - the name (absolute Path) of folder in which should be imported
cms - the cms-object to use for the import.
Throws:
Throws - CmsException if something goes wrong.
CmsException

importResources

public void importResources(CmsUser currentUser,
                            CmsProject currentProject,
                            String importFile,
                            String importPath,
                            CmsObject cms,
                            I_CmsReport report)
                     throws CmsException
Imports a import-resource (folder or zipfile) to the cms. Security: only Administrators can do this;

Specified by:
importResources in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
importFile - the name (absolute Path) of the import resource (zip or folder)
importPath - the name (absolute Path) of folder in which should be imported
cms - the cms-object to use for the import.
report - A report object to provide the loggin messages.
Throws:
Throws - CmsException if something goes wrong.
CmsException

init

public void init(source.org.apache.java.util.Configurations config)
          throws CmsException
Initializes the resource broker and sets up all required modules and connections.

Specified by:
init in interface I_CmsResourceBroker
Parameters:
config - The OpenCms configuration.
Throws:
CmsException - Throws CmsException if something goes wrong.

isAdmin

public boolean isAdmin(CmsUser currentUser,
                       CmsProject currentProject)
                throws CmsException
Determines, if the users current group is the admin-group. Security: All users are granted.

Specified by:
isAdmin in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
true, if the users current group is the admin-group, else it returns false.
Throws:
CmsException - Throws CmsException if operation was not succesful.

isManagerOfProject

public boolean isManagerOfProject(CmsUser currentUser,
                                  CmsProject currentProject)
                           throws CmsException
Determines, if the users may manage a project.
Only the manager of a project may publish it. Security: All users are granted.

Specified by:
isManagerOfProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
true, if the may manage this project.
Throws:
CmsException - Throws CmsException if operation was not succesful.

isProjectManager

public boolean isProjectManager(CmsUser currentUser,
                                CmsProject currentProject)
                         throws CmsException
Determines, if the users current group is the projectleader-group.
All projectleaders can create new projects, or close their own projects. Security: All users are granted.

Specified by:
isProjectManager in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
true, if the users current group is the projectleader-group, else it returns false.
Throws:
CmsException - Throws CmsException if operation was not succesful.

isUser

public boolean isUser(CmsUser currentUser,
                      CmsProject currentProject)
               throws CmsException
Determines, if the users current group is the projectleader-group.
All projectleaders can create new projects, or close their own projects. Security: All users are granted.

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
true, if the users current group is the projectleader-group, else it returns false.
Throws:
CmsException - Throws CmsException if operation was not succesful.

lockedBy

public CmsUser lockedBy(CmsUser currentUser,
                        CmsProject currentProject,
                        CmsResource resource)
                 throws CmsException
Returns the user, who had locked the resource.
A user can lock a resource, so he is the only one who can write this resource. This methods checks, if a resource was locked.

Specified by:
lockedBy in interface I_CmsResourceBroker
Parameters:
resource - The resource.
Returns:
the user, who had locked the resource.
Throws:
CmsException - will be thrown, if the user has not the rights for this resource.

lockedBy

public CmsUser lockedBy(CmsUser currentUser,
                        CmsProject currentProject,
                        String resource)
                 throws CmsException
Returns the user, who had locked the resource.
A user can lock a resource, so he is the only one who can write this resource. This methods checks, if a resource was locked.

Specified by:
lockedBy in interface I_CmsResourceBroker
Parameters:
resource - The complete path to the resource.
Returns:
the user, who had locked the resource.
Throws:
CmsException - will be thrown, if the user has not the rights for this resource.

lockResource

public void lockResource(CmsUser currentUser,
                         CmsProject currentProject,
                         String resourcename,
                         boolean force)
                  throws CmsException
Locks a resource.
Only a resource in an offline project can be locked. 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. A user can lock a resource, so he is the only one who can write this resource.
Security: Access is granted, if:

Specified by:
lockResource in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
force - If force is true, a existing locking will be oberwritten.
Throws:
CmsException - Throws CmsException if operation was not succesful. It will also be thrown, if there is a existing lock and force was set to false.

loginUser

public CmsUser loginUser(CmsUser currentUser,
                         CmsProject currentProject,
                         String username,
                         String password)
                  throws CmsException
Logs a user into the Cms, if the password is correct. Security All users are granted.

Specified by:
loginUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user to be returned.
password - The password of the user to be returned.
Returns:
the logged in user.
Throws:
CmsException - Throws CmsException if operation was not succesful

loginWebUser

public CmsUser loginWebUser(CmsUser currentUser,
                            CmsProject currentProject,
                            String username,
                            String password)
                     throws CmsException
Logs a web user into the Cms, if the password is correct. Security All users are granted.

Specified by:
loginWebUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user to be returned.
password - The password of the user to be returned.
Returns:
the logged in user.
Throws:
CmsException - Throws CmsException if operation was not succesful

mergeResources

protected Vector mergeResources(Vector offline,
                                Vector online)
Merges two resource-vectors into one vector. All offline-resources will be putted to the return-vector. All additional online-resources will be putted to the return-vector, too. All online resources, which are present in the offline-vector will be ignored.

Parameters:
offline - The vector with the offline resources.
online - The vector with the online resources.
Returns:
The merged vector.

moveFile

public void moveFile(CmsUser currentUser,
                     CmsProject currentProject,
                     String source,
                     String destination)
              throws CmsException
Moves the file. This operation includes a copy and a delete operation. These operations are done with their security-checks.

Specified by:
moveFile in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
source - The complete path of the sourcefile.
destination - The complete path of the destinationfile.
Throws:
CmsException - will be thrown, if the file couldn't be moved. The CmsException will also be thrown, if the user has not the rights for this resource.

onlineProject

public CmsProject onlineProject(CmsUser currentUser,
                                CmsProject currentProject)
                         throws CmsException
Returns the onlineproject. All anonymous (CmsUser callingUser, or guest) users will see the resources of this project. Security: All users are granted.

Specified by:
onlineProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the onlineproject object.
Throws:
CmsException - Throws CmsException if something goes wrong.

exportStaticResources

public void exportStaticResources(CmsUser currentUser,
                                  CmsProject currentProject,
                                  CmsObject cms,
                                  Vector startpoints,
                                  Vector projectResources,
                                  Vector allExportedLinks,
                                  CmsPublishedResources changedResources,
                                  I_CmsReport report)
                           throws CmsException
Creates a static export of a Cmsresource in the filesystem

Specified by:
exportStaticResources in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
cms - the cms-object to use for the export.
startpoints - the startpoints for the export.
report - the cmsReport to handle the log messages.
Throws:
CmsException - if operation was not successful.

exportStaticResources

public void exportStaticResources(CmsUser currentUser,
                                  CmsProject currentProject,
                                  CmsObject cms,
                                  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.

Specified by:
exportStaticResources in interface I_CmsResourceBroker
Parameters:
currentUser - user who requestd themethod
currentProject - current project of the user
cms - the cms-object to use for the export.
linksToExport - all links that where exported by the master OpenCms.
Throws:
CmsException - if operation was not successful.

publishProject

public CmsPublishedResources publishProject(CmsObject cms,
                                            CmsUser currentUser,
                                            CmsProject currentProject,
                                            int id,
                                            I_CmsReport report)
                                     throws CmsException
Publishes a project. Security Only the admin or the owner of the project can do this.

Specified by:
publishProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
id - The id of the project to be published.
report - A report object to provide the loggin messages.
cms - The CmsObject.
Returns:
CmsPublishedResources The object includes the vectors of changed resources.
Throws:
CmsException - Throws CmsException if something goes wrong.

shouldReloadClasses

public boolean shouldReloadClasses(int projectId,
                                   Vector classFiles)
This method checks, if there is a classFile marked as changed or deleted. If that is so, we have to reload all classes and instances to get rid of old versions.


readAgent

public CmsUser readAgent(CmsUser currentUser,
                         CmsProject currentProject,
                         CmsTask task)
                  throws CmsException
Reads the agent of a task from the OpenCms. Security: All users are granted.

Specified by:
readAgent in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
task - The task to read the agent from.
Returns:
The owner of a task.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readAllFileHeaders

public Vector readAllFileHeaders(CmsUser currentUser,
                                 CmsProject currentProject,
                                 String filename)
                          throws CmsException
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. Security: Access is granted, if:

Specified by:
readAllFileHeaders in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The name of the file to be read.
Returns:
Vector of file headers read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readAllFileHeadersForHist

public Vector readAllFileHeadersForHist(CmsUser currentUser,
                                        CmsProject currentProject,
                                        String filename)
                                 throws CmsException
Reads all file headers of a file in the OpenCms.
This method returns a vector with the histroy 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. Security: Access is granted, if:

Specified by:
readAllFileHeadersForHist in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The name of the file to be read.
Returns:
Vector of file headers read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readAllProjectResources

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

Specified by:
readAllProjectResources in interface I_CmsResourceBroker
Throws:
CmsException - Throws CmsException if operation was not succesful

readAllPropertydefinitions

public Vector readAllPropertydefinitions(CmsUser currentUser,
                                         CmsProject currentProject,
                                         int resourceType)
                                  throws CmsException
Reads all propertydefinitions for the given resource type. Security All users are granted.

Specified by:
readAllPropertydefinitions in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resourceType - The resource type to read the propertydefinitions for.
Returns:
propertydefinitions A Vector with propertydefefinitions for the resource type. The Vector is maybe empty.
Throws:
CmsException - Throws CmsException if something goes wrong.

readAllPropertydefinitions

public Vector readAllPropertydefinitions(CmsUser currentUser,
                                         CmsProject currentProject,
                                         String resourcetype)
                                  throws CmsException
Reads all propertydefinitions for the given resource type. Security All users are granted.

Specified by:
readAllPropertydefinitions in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resourcetype - The name of the resource type to read the propertydefinitions for.
Returns:
propertydefinitions A Vector with propertydefefinitions for the resource type. The Vector is maybe empty.
Throws:
CmsException - Throws CmsException if something goes wrong.

deleteLinkEntrys

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

Specified by:
deleteLinkEntrys in interface I_CmsResourceBroker
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.

Specified by:
createLinkEntrys in interface I_CmsResourceBroker
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.

Specified by:
readLinkEntrys in interface I_CmsResourceBroker
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

Specified by:
deleteOnlineLinkEntrys in interface I_CmsResourceBroker
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.

Specified by:
createOnlineLinkEntrys in interface I_CmsResourceBroker
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.

Specified by:
readOnlineLinkEntrys in interface I_CmsResourceBroker
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.

Specified by:
getOnlineBrokenLinks in interface I_CmsResourceBroker
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.

Specified by:
getBrokenLinks in interface I_CmsResourceBroker
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.

Specified by:
updateOnlineProjectLinks in interface I_CmsResourceBroker
Parameters:
deleted - A Vector (of CmsResources) with the deleted resources of the project.
changed - A Vector (of CmsResources) with the changed resources of the project.
newRes - A Vector (of CmsResources) with the newRes resources of the project.
CmsException

readExportPath

public String readExportPath(CmsUser currentUser,
                             CmsProject currentProject)
                      throws CmsException
Reads the export-path for the system. This path is used for db-export and db-import. Security: All users are granted.

Specified by:
readExportPath in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the exportpath.
CmsException

readExportLink

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

Specified by:
readExportLink in interface I_CmsResourceBroker
Parameters:
request - The request to be read.
Returns:
The exportrequest read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readExportLinkHeader

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

Specified by:
readExportLinkHeader in interface I_CmsResourceBroker
Parameters:
request - The request to be read.
Returns:
The exportrequest read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

writeExportLink

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

Specified by:
writeExportLink in interface I_CmsResourceBroker
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.

Specified by:
deleteExportLink in interface I_CmsResourceBroker
Parameters:
link - the name of the link
CmsException

deleteExportLink

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

Specified by:
deleteExportLink in interface I_CmsResourceBroker
Parameters:
link - the cmsExportLink object to delete.
CmsException

writeExportLinkProcessedState

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

Specified by:
writeExportLinkProcessedState in interface I_CmsResourceBroker
Parameters:
link - the cmsexportlink.
Throws:
CmsException - if something goes wrong.

getDependingExportLinks

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

Specified by:
getDependingExportLinks in interface I_CmsResourceBroker
Returns:
a Vector(of Strings) with the linkrequest names.
CmsException

readFile

public CmsFile readFile(CmsUser currentUser,
                        CmsProject currentProject,
                        String filename)
                 throws CmsException
Reads a file from the Cms.

Security: Access is granted, if:

Specified by:
readFile in interface I_CmsResourceBroker
Parameters:
currentUser - the user who requested this method
currentProject - the current project of the user
filename - the name of the file to be read
Returns:
the file read from the VFS
Throws:
CmsException - if operation was not succesful

readFile

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

Security: Access is granted, if:

Specified by:
readFile in interface I_CmsResourceBroker
Parameters:
currentUser - the user who requested this method
currentProject - the current project of the user
filename - the name of the file to be read
includeDeleted - If true the deleted file will be returned, too
Returns:
the file read from the VFS
Throws:
CmsException - if operation was not succesful

readFileExtensions

public Hashtable readFileExtensions(CmsUser currentUser,
                                    CmsProject currentProject)
                             throws CmsException
Gets the known file extensions (=suffixes) Security: All users are granted access

Specified by:
readFileExtensions in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method, not used here
currentProject - The current project of the user, not used here
Returns:
Hashtable with file extensions as Strings
CmsException

readFileHeader

public CmsResource readFileHeader(CmsUser currentUser,
                                  CmsProject currentProject,
                                  int projectId,
                                  String filename)
                           throws CmsException
Reads a file header a previous project of the Cms.
The reading excludes the filecontent.
A file header can be read from an offline project or the online project. Security: Access is granted, if:

Specified by:
readFileHeader in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
projectId - The id of the project to read the file from.
filename - The name of the file to be read.
Returns:
The file read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readFileHeader

public CmsResource readFileHeader(CmsUser currentUser,
                                  CmsProject currentProject,
                                  String filename)
                           throws CmsException
Reads a file header from the Cms.
The reading excludes the filecontent.
A file header can be read from an offline project or the online project. Security: Access is granted, if:

Specified by:
readFileHeader in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The name of the file to be read.
Returns:
The file read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readFileHeader

public CmsResource readFileHeader(CmsUser currentUser,
                                  CmsProject currentProject,
                                  String filename,
                                  boolean includeDeleted)
                           throws CmsException
Reads a file header from the Cms.
The reading excludes the filecontent.
A file header can be read from an offline project or the online project. Security: Access is granted, if:

Specified by:
readFileHeader in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
filename - The name of the file to be read.
includeDeleted - If false then throw exception if the file is marked as deleted
Returns:
The file read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readFileHeaderForHist

public CmsBackupResource readFileHeaderForHist(CmsUser currentUser,
                                               CmsProject currentProject,
                                               int versionId,
                                               String filename)
                                        throws CmsException
Reads a file header from the history of the Cms.
The reading excludes the filecontent.
A file header is read from the backup resources.

Specified by:
readFileHeaderForHist in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
versionId - The id of the version of the file.
filename - The name of the file to be read.
Returns:
The file read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readFileForHist

public CmsBackupResource readFileForHist(CmsUser currentUser,
                                         CmsProject currentProject,
                                         int versionId,
                                         String filename)
                                  throws CmsException
Reads a file from the history of the Cms.
The reading includes the filecontent.
A file is read from the backup resources.

Specified by:
readFileForHist in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
versionId - The id of the version of the file.
filename - The name of the file to be read.
Returns:
The file read from the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readFileHeaders

public Vector readFileHeaders(CmsUser currentUser,
                              CmsProject currentProject,
                              int projectId)
                       throws CmsException
Reads all file headers for a project from the Cms.

Specified by:
readFileHeaders in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
projectId - The id of the project to read the resources for.
Returns:
a Vector of resources.
Throws:
CmsException - will be thrown, if the file couldn't be read. The CmsException will also be thrown, if the user has not the rights for this resource.

readFolder

protected CmsFolder readFolder(CmsUser currentUser,
                               CmsProject currentProject,
                               int project,
                               String folder)
                        throws CmsException
Reads a folder from the Cms.
Security: Access is granted, if:

Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
project - the project to read the folder from.
Returns:
folder The read folder.
Throws:
CmsException - will be thrown, if the folder couldn't be read. The CmsException will also be thrown, if the user has not the rights for this resource

readFolder

public CmsFolder readFolder(CmsUser currentUser,
                            CmsProject currentProject,
                            String folder)
                     throws CmsException
Reads a folder from the Cms.
Security: Access is granted, if:

Specified by:
readFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
folder - The complete path of the folder to be read.
Returns:
folder The read folder.
Throws:
CmsException - will be thrown, if the folder couldn't be read. The CmsException will also be thrown, if the user has not the rights for this resource.

readFolder

public CmsFolder readFolder(CmsUser currentUser,
                            CmsProject currentProject,
                            String folder,
                            boolean includeDeleted)
                     throws CmsException
Reads a folder from the Cms.
Security: Access is granted, if:

Specified by:
readFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
includeDeleted - Include the folder it it is marked as deleted
folder - The complete pathname of the folder to be read.
Returns:
folder The read folder.
Throws:
CmsException - will be thrown, if the folder couldn't be read. The CmsException will also be thrown, if the user has not the rights for this resource.

readFolder

public CmsFolder readFolder(CmsUser currentUser,
                            CmsProject currentProject,
                            int folderid,
                            boolean includeDeleted)
                     throws CmsException
Reads a folder from the Cms.
Security: Access is granted, if:

Specified by:
readFolder in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
folderid - The id of the folder to be read.
includeDeleted - Include the folder it it is marked as deleted
Returns:
folder The read folder.
Throws:
CmsException - will be thrown, if the folder couldn't be read. The CmsException will also be thrown, if the user has not the rights for this resource.

readGivenTasks

public Vector readGivenTasks(CmsUser currentUser,
                             CmsProject currentProject,
                             int projectId,
                             String ownerName,
                             int taskType,
                             String orderBy,
                             String sort)
                      throws CmsException
Reads all given tasks from a user for a project. Security: All users are granted.

Specified by:
readGivenTasks in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
projectId - The id of the Project in which the tasks are defined.
orderBy - Chooses, how to order the tasks.
Throws:
CmsException - Throws CmsException if something goes wrong.

readGroup

public CmsGroup readGroup(CmsUser currentUser,
                          CmsProject currentProject,
                          CmsProject project)
                   throws CmsException
Reads the group of a project from the OpenCms. Security: All users are granted.

Specified by:
readGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
The group of a resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readGroup

public CmsGroup readGroup(CmsUser currentUser,
                          CmsProject currentProject,
                          CmsResource resource)
                   throws CmsException
Reads the group of a resource from the OpenCms. Security: All users are granted.

Specified by:
readGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
The group of a resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readGroup

public CmsGroup readGroup(CmsUser currentUser,
                          CmsProject currentProject,
                          CmsTask task)
                   throws CmsException
Reads the group (role) of a task from the OpenCms. Security: All users are granted.

Specified by:
readGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
task - The task to read from.
Returns:
The group of a resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readGroup

public CmsGroup readGroup(CmsUser currentUser,
                          CmsProject currentProject,
                          String groupname)
                   throws CmsException
Returns a group object.

Security: All users are granted.

Specified by:
readGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
groupname - The name of the group that is to be read.
Returns:
Group.
Throws:
CmsException - Throws CmsException if operation was not succesful

readGroup

public CmsGroup readGroup(CmsUser currentUser,
                          CmsProject currentProject,
                          int groupid)
                   throws CmsException
Returns a group object.

Security: All users are granted.

Specified by:
readGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
groupid - The id of the group that is to be read.
Returns:
Group.
Throws:
CmsException - Throws CmsException if operation was not succesful

readManagerGroup

public CmsGroup readManagerGroup(CmsUser currentUser,
                                 CmsProject currentProject,
                                 CmsProject project)
                          throws CmsException
Reads the managergroup of a project from the OpenCms. Security: All users are granted.

Specified by:
readManagerGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
The group of a resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readMimeTypes

public Hashtable readMimeTypes(CmsUser currentUser,
                               CmsProject currentProject)
                        throws CmsException
Gets the MimeTypes. The Mime-Types will be returned. Security: All users are garnted

Specified by:
readMimeTypes in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the mime-types.
CmsException

readOriginalAgent

public CmsUser readOriginalAgent(CmsUser currentUser,
                                 CmsProject currentProject,
                                 CmsTask task)
                          throws CmsException
Reads the original agent of a task from the OpenCms. Security: All users are granted.

Specified by:
readOriginalAgent in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
task - The task to read the original agent from.
Returns:
The owner of a task.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readOwner

public CmsUser readOwner(CmsUser currentUser,
                         CmsProject currentProject,
                         CmsProject project)
                  throws CmsException
Reads the owner of a project from the OpenCms. Security: All users are granted.

Specified by:
readOwner in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
The owner of a resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readOwner

public CmsUser readOwner(CmsUser currentUser,
                         CmsProject currentProject,
                         CmsResource resource)
                  throws CmsException
Reads the owner of a resource from the OpenCms. Security: All users are granted.

Specified by:
readOwner in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
The owner of a resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readOwner

public CmsUser readOwner(CmsUser currentUser,
                         CmsProject currentProject,
                         CmsTask task)
                  throws CmsException
Reads the owner (initiator) of a task from the OpenCms. Security: All users are granted.

Specified by:
readOwner in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
task - The task to read the owner from.
Returns:
The owner of a task.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readOwner

public CmsUser readOwner(CmsUser currentUser,
                         CmsProject currentProject,
                         CmsTaskLog log)
                  throws CmsException
Reads the owner of a tasklog from the OpenCms. Security: All users are granted.

Specified by:
readOwner in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
The owner of a resource.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readProject

public CmsProject readProject(CmsUser currentUser,
                              CmsProject currentProject,
                              int id)
                       throws CmsException
Reads a project from the Cms. Security All users are granted.

Specified by:
readProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
id - The id of the project to read.
Throws:
CmsException - Throws CmsException if something goes wrong.

readProject

public CmsProject readProject(CmsUser currentUser,
                              CmsProject currentProject,
                              CmsResource res)
                       throws CmsException
Reads a project from the Cms. Security All users are granted.

Specified by:
readProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
res - The resource to read the project of.
Throws:
CmsException - Throws CmsException if something goes wrong.

readProject

public CmsProject readProject(CmsUser currentUser,
                              CmsProject currentProject,
                              CmsTask task)
                       throws CmsException
Reads a project from the Cms. Security All users are granted.

Specified by:
readProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
task - The task to read the project of.
Throws:
CmsException - Throws CmsException if something goes wrong.

readProjectView

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

Specified by:
readProjectView in interface I_CmsResourceBroker
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 resources.
CmsException

readBackupProject

public CmsBackupProject readBackupProject(CmsUser currentUser,
                                          CmsProject currentProject,
                                          int versionId)
                                   throws CmsException
Reads the backupinformation of a project from the Cms. Security All users are granted.

Specified by:
readBackupProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
versionId - The versionId of the project.
Throws:
CmsException - Throws CmsException if something goes wrong.

readProjectLogs

public Vector readProjectLogs(CmsUser currentUser,
                              CmsProject currentProject,
                              int projectid)
                       throws CmsException
Reads log entries for a project.

Specified by:
readProjectLogs in interface I_CmsResourceBroker
Parameters:
projectid - The id of the projec for tasklog to read.
Returns:
A Vector of new TaskLog objects
Throws:
CmsException - Throws CmsException if something goes wrong.

readProperty

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

Security: Only a user is granted who has the right to read the resource.

Specified by:
readProperty in interface I_CmsResourceBroker
Parameters:
currentUser - the current user
currentProject - the current project of the user
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(CmsUser currentUser,
                           CmsProject currentProject,
                           String resource,
                           String siteRoot,
                           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).

Security: Only a user is granted who has the right to read the resource.

Specified by:
readProperty in interface I_CmsResourceBroker
Parameters:
currentUser - the current user
currentProject - the current project of the user
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(CmsUser currentUser,
                          CmsProject currentProject,
                          String resource,
                          String siteRoot,
                          boolean search)
                   throws CmsException
Looks up all properties for a resource with optional direcory upward cascading.

Security: Only a user is granted who has the right to read the resource.

Specified by:
readProperties in interface I_CmsResourceBroker
Parameters:
currentUser - the current user
currentProject - the current project of the user
resource - the resource to look up the property for
siteRoot - the current site root
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

readPropertydefinition

public CmsPropertydefinition readPropertydefinition(CmsUser currentUser,
                                                    CmsProject currentProject,
                                                    String name,
                                                    String resourcetype)
                                             throws CmsException
Reads a definition for the given resource type. Security All users are granted.

Specified by:
readPropertydefinition in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The name of the propertydefinition to read.
resourcetype - The name of the resource type for which the propertydefinition is valid.
Returns:
propertydefinition The propertydefinition that corresponds to the overgiven arguments - or null if there is no valid propertydefinition.
Throws:
CmsException - Throws CmsException if something goes wrong.

readResources

public Vector readResources(CmsProject project)
                     throws CmsException
Insert the method's description here. Creation date: (09-10-2000 09:29:45)

Specified by:
readResources in interface I_CmsResourceBroker
Parameters:
project - com.opencms.file.CmsProject
Returns:
java.util.Vector
Throws:
CmsException - The exception description.

readTask

public CmsTask readTask(CmsUser currentUser,
                        CmsProject currentProject,
                        int id)
                 throws CmsException
Read a task by id. Security: All users are granted.

Specified by:
readTask in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
id - The id for the task to read.
Throws:
CmsException - Throws CmsException if something goes wrong.

readTaskLogs

public Vector readTaskLogs(CmsUser currentUser,
                           CmsProject currentProject,
                           int taskid)
                    throws CmsException
Reads log entries for a task. Security: All users are granted.

Specified by:
readTaskLogs in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskid - The task for the tasklog to read .
Returns:
A Vector of new TaskLog objects
Throws:
CmsException - Throws CmsException if something goes wrong.

readTasksForProject

public Vector readTasksForProject(CmsUser currentUser,
                                  CmsProject currentProject,
                                  int projectId,
                                  int tasktype,
                                  String orderBy,
                                  String sort)
                           throws CmsException
Reads all tasks for a project. Security: All users are granted.

Specified by:
readTasksForProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
projectId - The id of the Project in which the tasks are defined. Can be null for all tasks
tasktype - Task type you want to read: C_TASKS_ALL, C_TASKS_OPEN, C_TASKS_DONE, C_TASKS_NEW
orderBy - Chooses, how to order the tasks.
sort - Sort order C_SORT_ASC, C_SORT_DESC, or null
Throws:
CmsException - Throws CmsException if something goes wrong.

readTasksForRole

public Vector readTasksForRole(CmsUser currentUser,
                               CmsProject currentProject,
                               int projectId,
                               String roleName,
                               int tasktype,
                               String orderBy,
                               String sort)
                        throws CmsException
Reads all tasks for a role in a project. Security: All users are granted.

Specified by:
readTasksForRole in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
projectId - The id of the Project in which the tasks are defined.
tasktype - Task type you want to read: C_TASKS_ALL, C_TASKS_OPEN, C_TASKS_DONE, C_TASKS_NEW.
orderBy - Chooses, how to order the tasks.
sort - Sort order C_SORT_ASC, C_SORT_DESC, or null
Throws:
CmsException - Throws CmsException if something goes wrong.

readTasksForUser

public Vector readTasksForUser(CmsUser currentUser,
                               CmsProject currentProject,
                               int projectId,
                               String userName,
                               int taskType,
                               String orderBy,
                               String sort)
                        throws CmsException
Reads all tasks for a user in a project. Security: All users are granted.

Specified by:
readTasksForUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
projectId - The id of the Project in which the tasks are defined.
userName - The user who has to process the task.
taskType - Task type you want to read: C_TASKS_ALL, C_TASKS_OPEN, C_TASKS_DONE, C_TASKS_NEW.
orderBy - Chooses, how to order the tasks.
sort - Sort order C_SORT_ASC, C_SORT_DESC, or null
Throws:
CmsException - Throws CmsException if something goes wrong.

readUser

public CmsUser readUser(CmsUser currentUser,
                        CmsProject currentProject,
                        int id)
                 throws CmsException
Returns a user object.

Security: All users are granted.

Specified by:
readUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
id - The id of the user that is to be read.
Returns:
User
Throws:
CmsException - Throws CmsException if operation was not succesful

readUser

public CmsUser readUser(CmsUser currentUser,
                        CmsProject currentProject,
                        String username)
                 throws CmsException
Returns a user object.

Security: All users are granted.

Specified by:
readUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user that is to be read.
Returns:
User
Throws:
CmsException - Throws CmsException if operation was not succesful

readUser

public CmsUser readUser(CmsUser currentUser,
                        CmsProject currentProject,
                        String username,
                        int type)
                 throws CmsException
Returns a user object.

Security: All users are granted.

Specified by:
readUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user that is to be read.
type - The type of the user.
Returns:
User
Throws:
CmsException - Throws CmsException if operation was not succesful

readUser

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

Security: All users are granted.

Specified by:
readUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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

readWebUser

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

Security: All users are granted.

Specified by:
readWebUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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(CmsUser currentUser,
                           CmsProject currentProject,
                           String username,
                           String password)
                    throws CmsException
Returns a user object if the password for the user is correct.

Security: All users are granted.

Specified by:
readWebUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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(CmsUser currentUser,
                           CmsProject currentProject,
                           int taskId)
                    throws CmsException
Reaktivates a task from the Cms. Security: All users are granted.

Specified by:
reaktivateTask in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Throws:
CmsException - Throws CmsException if something goes wrong.

recoverPassword

public void recoverPassword(CmsObject cms,
                            CmsUser currentUser,
                            CmsProject currentProject,
                            String username,
                            String recoveryPassword,
                            String newPassword)
                     throws CmsException
Sets a new password only if the user knows his recovery-password. All users can do this if he knows the recovery-password.

Security: All users can do this if he knows the recovery-password.

Specified by:
recoverPassword in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user.
recoveryPassword - The recovery password.
newPassword - The new password.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

removeUserFromGroup

public void removeUserFromGroup(CmsUser currentUser,
                                CmsProject currentProject,
                                String username,
                                String groupname)
                         throws CmsException
Removes a user from a group. Only the admin can do this.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
removeUserFromGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user that is to be removed from the group.
groupname - The name of the group.
Throws:
CmsException - Throws CmsException if operation was not succesful.

renameFile

public void renameFile(CmsUser currentUser,
                       CmsProject currentProject,
                       String oldname,
                       String newname)
                throws CmsException
Renames the file to a new name.
Rename can only be done in an offline project. To rename a file, the following steps have to be done: Security: Access is granted, if:

Specified by:
renameFile in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
oldname - The complete path to the resource which will be renamed.
newname - The new name of the resource (CmsUser callingUser, No path information allowed).
Throws:
CmsException - Throws CmsException if operation was not succesful.

restoreSession

public Hashtable restoreSession(String oldSessionId)
                         throws CmsException
This method loads old sessiondata from the database. It is used for sessionfailover.

Specified by:
restoreSession in interface I_CmsResourceBroker
Parameters:
oldSessionId - the id of the old session.
Returns:
the old sessiondata.
CmsException

restoreResource

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

Specified by:
restoreResource in interface I_CmsResourceBroker
Parameters:
currentUser - The current user
currentProject - The current project
versionId - The version id of the resource
filename - The name of the file to restore
Throws:
CmsException - Throws CmsException if operation was not succesful.

setName

public void setName(CmsUser currentUser,
                    CmsProject currentProject,
                    int taskId,
                    String name)
             throws CmsException
Set a new name for a task Security: All users are granted.

Specified by:
setName in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
name - The new name value
Throws:
CmsException - Throws CmsException if something goes wrong.

setParentGroup

public void setParentGroup(CmsUser currentUser,
                           CmsProject currentProject,
                           String groupName,
                           String parentGroupName)
                    throws CmsException
Sets a new parent-group for an already existing group in the Cms.
Only the admin can do this.

Specified by:
setParentGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
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 - Throws CmsException if operation was not succesfull.

setPassword

public void setPassword(CmsObject cms,
                        CmsUser currentUser,
                        CmsProject currentProject,
                        String username,
                        String newPassword)
                 throws CmsException
Sets the password for a user. Only a adminstrator can do this.

Security: Users, which are in the group "administrators" are granted.

Specified by:
setPassword in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user.
newPassword - The new password.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

setPassword

public void setPassword(CmsObject cms,
                        CmsUser currentUser,
                        CmsProject currentProject,
                        String username,
                        String oldPassword,
                        String newPassword)
                 throws CmsException
Sets the password for a user. Every user who knows the username and the password can do this.

Security: Users, who knows the username and the old password are granted.

Specified by:
setPassword in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user.
oldPassword - The new password.
newPassword - The new password.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

setPriority

public void setPriority(CmsUser currentUser,
                        CmsProject currentProject,
                        int taskId,
                        int priority)
                 throws CmsException
Set priority of a task Security: All users are granted.

Specified by:
setPriority in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Throws:
CmsException - Throws CmsException if something goes wrong.

setRecoveryPassword

public void setRecoveryPassword(CmsObject cms,
                                CmsUser currentUser,
                                CmsProject currentProject,
                                String username,
                                String password,
                                String newPassword)
                         throws CmsException
Sets the recovery password for a user. Only a adminstrator or the curretuser can do this.

Security: Users, which are in the group "administrators" are granted.
Current users can change their own password.

Specified by:
setRecoveryPassword in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
username - The name of the user.
password - The password of the user.
newPassword - The new recoveryPassword to be set.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

setTaskPar

public void setTaskPar(CmsUser currentUser,
                       CmsProject currentProject,
                       int taskId,
                       String parName,
                       String parValue)
                throws CmsException
Set a Parameter for a task. Security: All users are granted.

Specified by:
setTaskPar in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskId - The Id of the task.
parName - Name of the parameter.
parValue - Value if the parameter.
Returns:
The id of the inserted parameter or 0 if the parameter already exists for this task.
Throws:
CmsException - Throws CmsException if something goes wrong.

setTimeout

public void setTimeout(CmsUser currentUser,
                       CmsProject currentProject,
                       int taskId,
                       long timeout)
                throws CmsException
Set timeout of a task Security: All users are granted.

Specified by:
setTimeout in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Throws:
CmsException - Throws CmsException if something goes wrong.

storeSession

public void storeSession(String sessionId,
                         Hashtable sessionData)
                  throws CmsException
This method stores sessiondata into the database. It is used for sessionfailover.

Specified by:
storeSession in interface I_CmsResourceBroker
Parameters:
sessionId - the id of the session.
Returns:
data the sessionData.
CmsException

undoChanges

public void undoChanges(CmsUser currentUser,
                        CmsProject currentProject,
                        String resourceName)
                 throws CmsException
Undo all changes in the resource, restore the online file.

Specified by:
undoChanges in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resourceName - The name of the resource to be restored.
Throws:
CmsException - Throws CmsException if something goes wrong.

unlockProject

public void unlockProject(CmsUser currentUser,
                          CmsProject currentProject,
                          int id)
                   throws CmsException
Unlocks all resources in this project. Security Only the admin or the owner of the project can do this.

Specified by:
unlockProject in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
id - The id of the project to be published.
Throws:
CmsException - Throws CmsException if something goes wrong.

unlockResource

public void unlockResource(CmsUser currentUser,
                           CmsProject currentProject,
                           String resourcename)
                    throws CmsException
Unlocks a resource.
Only a resource in an offline project can be unlock. 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. Only the user who locked a resource can unlock it. Security: Access is granted, if:

Specified by:
unlockResource in interface I_CmsResourceBroker
Parameters:
resourcename - The complete path to the resource to lock.
Throws:
CmsException - Throws CmsException if operation was not succesful.

userInGroup

public boolean userInGroup(CmsUser currentUser,
                           CmsProject currentProject,
                           String username,
                           String groupname)
                    throws CmsException
Checks if a user is member of a group.

Security: All users are granted, except the anonymous user.

Specified by:
userInGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
groupname - The name of the group to check.
Returns:
True or False
Throws:
CmsException - Throws CmsException if operation was not succesful

validFilename

protected void validFilename(String filename)
                      throws CmsException
Checks ii characters in a String are allowed for filenames

Parameters:
filename - String to check
Throws:
throws - a exception, if the check fails.
CmsException

validTaskname

protected void validTaskname(String taskname)
                      throws CmsException
Checks ii characters in a String are allowed for filenames

Throws:
throws - a exception, if the check fails.
CmsException

validName

protected void validName(String name,
                         boolean blank)
                  throws CmsException
Checks ii characters in a String are allowed for names

Parameters:
name - String to check
Throws:
throws - a exception, if the check fails.
CmsException

writeExportPath

public void writeExportPath(CmsUser currentUser,
                            CmsProject currentProject,
                            String path)
                     throws CmsException
Writes the export-path for the system. This path is used for db-export and db-import. Security: Users, which are in the group "administrators" are granted.

Specified by:
writeExportPath in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
CmsException

writeFile

public void writeFile(CmsUser currentUser,
                      CmsProject currentProject,
                      CmsFile file)
               throws CmsException
Writes a file to the Cms.
A file can only be written to an offline project.
The state of the resource is set to CHANGED (1). The file content of the file is either updated (if it is already existing in the offline project), or created in the offline project (if it is not available there).
Security: Access is granted, if:

Specified by:
writeFile in interface I_CmsResourceBroker
Parameters:
currentUser - The user who own this file.
currentProject - The project in which the resource will be used.
file - The name of the file to write.
Throws:
CmsException - Throws CmsException if operation was not succesful.

writeResource

public void writeResource(CmsUser currentUser,
                          CmsProject currentProject,
                          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.
A resource can only be written to an offline project.
The state of the resource is set to CHANGED (1). The file content of the file is either updated (if it is already existing in the offline project), or created in the offline project (if it is not available there).
Security: Access is granted, if:

Specified by:
writeResource in interface I_CmsResourceBroker
Parameters:
currentUser - The current user.
currentProject - The project in which the resource will be used.
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.

writeFileExtensions

public void writeFileExtensions(CmsUser currentUser,
                                CmsProject currentProject,
                                Hashtable extensions)
                         throws CmsException
Writes the file extensions Security: Users, which are in the group "Administrators" are authorized.

Specified by:
writeFileExtensions in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
extensions - Holds extensions as keys and resourcetypes (Stings) as values
CmsException

writeFileHeader

public void writeFileHeader(CmsUser currentUser,
                            CmsProject currentProject,
                            CmsFile file)
                     throws CmsException
Writes a fileheader to the Cms.
A file can only be written to an offline project.
The state of the resource is set to CHANGED (1). The file content of the file is either updated (if it is already existing in the offline project), or created in the offline project (if it is not available there).
Security: Access is granted, if:

Specified by:
writeFileHeader in interface I_CmsResourceBroker
Parameters:
currentUser - The user who own this file.
currentProject - The project in which the resource will be used.
file - The file to write.
Throws:
CmsException - Throws CmsException if operation was not succesful.

writeGroup

public void writeGroup(CmsUser currentUser,
                       CmsProject currentProject,
                       CmsGroup group)
                throws CmsException
Writes an already existing group in the Cms.
Only the admin can do this.

Specified by:
writeGroup in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
group - The group that should be written to the Cms.
Throws:
CmsException - Throws CmsException if operation was not succesfull.

writeProperties

public void writeProperties(CmsUser currentUser,
                            CmsProject currentProject,
                            String resource,
                            Map propertyinfos)
                     throws CmsException
Writes a couple of propertyinformation for a file or folder. Security Only the user is granted, who has the right to write the resource.

Specified by:
writeProperties in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The name of the resource of which the propertyinformation has to be read.
propertyinfos - A Hashtable with propertydefinition- propertyinfo-pairs as strings.
Throws:
CmsException - Throws CmsException if operation was not succesful

writeProperty

public void writeProperty(CmsUser currentUser,
                          CmsProject currentProject,
                          String resource,
                          String property,
                          String value)
                   throws CmsException
Writes a propertyinformation for a file or folder. Security Only the user is granted, who has the right to write the resource.

Specified by:
writeProperty in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The name of the resource of which the propertyinformation has to be read.
property - The propertydefinition-name of which the propertyinformation has to be set.
value - The value for the propertyinfo to be set.
Throws:
CmsException - Throws CmsException if operation was not succesful

writePropertydefinition

public CmsPropertydefinition writePropertydefinition(CmsUser currentUser,
                                                     CmsProject currentProject,
                                                     CmsPropertydefinition propertydef)
                                              throws CmsException
Updates the propertydefinition for the resource type.
Security Only the admin can do this.

Specified by:
writePropertydefinition in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
propertydef - The propertydef to be deleted.
Returns:
The propertydefinition, that was written.
Throws:
CmsException - Throws CmsException if something goes wrong.

writeTaskLog

public void writeTaskLog(CmsUser currentUser,
                         CmsProject currentProject,
                         int taskid,
                         String comment)
                  throws CmsException
Writes a new user tasklog for a task. Security: All users are granted.

Specified by:
writeTaskLog in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskid - The Id of the task .
comment - Description for the log
Throws:
CmsException - Throws CmsException if something goes wrong.

writeTaskLog

public void writeTaskLog(CmsUser currentUser,
                         CmsProject currentProject,
                         int taskid,
                         String comment,
                         int type)
                  throws CmsException
Writes a new user tasklog for a task. Security: All users are granted.

Specified by:
writeTaskLog in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
taskid - The Id of the task .
comment - Description for the log
Throws:
CmsException - Throws CmsException if something goes wrong.

writeUser

public void writeUser(CmsUser currentUser,
                      CmsProject currentProject,
                      CmsUser user)
               throws CmsException
Updates the user information.

Security: Only users, which are in the group "administrators" are granted.

Specified by:
writeUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
user - The user to be updated.
Throws:
CmsException - Throws CmsException if operation was not succesful

writeWebUser

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

Security: Only users of the user type webuser can be updated this way.

Specified by:
writeWebUser in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
user - The user to be updated.
Throws:
CmsException - Throws CmsException if operation was not succesful

changeLockedInProject

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

Specified by:
changeLockedInProject in interface I_CmsResourceBroker
Parameters:
resourcename - The name of the resource to change
CmsException

isHistoryEnabled

public boolean isHistoryEnabled(CmsObject cms)
Returns true if history is enabled

Specified by:
isHistoryEnabled in interface I_CmsResourceBroker
Parameters:
cms - The CmsObject
Returns:
boolean If true the history is enabled

getBackupVersionId

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

Specified by:
getBackupVersionId in interface I_CmsResourceBroker
Returns:
int The new version id

backupProject

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

Specified by:
backupProject in interface I_CmsResourceBroker
Parameters:
versionId - The version of the backup
publishDate - The date of publishing
Throws:
CmsException - Throws CmsException if operation was not succesful.

isWebgroup

protected boolean isWebgroup(CmsGroup group)
                      throws CmsException
Checks if this is a valid group for webusers

Parameters:
group - The group to be checked
Returns:
boolean If the group does not belong to Users, Administrators or Projectmanagers return true
CmsException

readCronTable

public String readCronTable(CmsUser currentUser,
                            CmsProject currentProject)
                     throws CmsException
Gets the Crontable. Security: All users are garnted

Specified by:
readCronTable in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the crontable.
CmsException

writeCronTable

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

Specified by:
writeCronTable in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the crontable.
CmsException

clearResourceCache

protected void clearResourceCache(String resourcename,
                                  CmsProject currentProject,
                                  CmsUser currentUser)
Clears all the depending caches when a resource was changed

Parameters:
resourcename - The name of the changed resource

clearResourceCache

protected void clearResourceCache()
Clears all the depending caches when a resource was changed


clearUserCache

protected void clearUserCache(CmsUser user)
Clears the user cache for the given user


digest

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

Specified by:
digest in interface I_CmsResourceBroker
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.

Specified by:
getLimitedWorkplacePort in interface I_CmsResourceBroker
Returns:
the portnumber or -1 if no port is set.

changeUserType

public void changeUserType(CmsUser currentUser,
                           CmsProject currentProject,
                           int userId,
                           int userType)
                    throws CmsException
Changes the user type of the user Only the administrator can change the type

Specified by:
changeUserType in interface I_CmsResourceBroker
Parameters:
currentUser - The current user
currentProject - The current project
userId - The id of the user to change
userType - The new usertype of the user
CmsException

changeUserType

public void changeUserType(CmsUser currentUser,
                           CmsProject currentProject,
                           String username,
                           int userType)
                    throws CmsException
Changes the user type of the user Only the administrator can change the type

Specified by:
changeUserType in interface I_CmsResourceBroker
Parameters:
currentUser - The current user
currentProject - The current project
username - The name of the user to change
userType - The new usertype of the user
CmsException

changeUserType

public void changeUserType(CmsUser currentUser,
                           CmsProject currentProject,
                           CmsUser user,
                           int userType)
                    throws CmsException
Changes the user type of the user Only the administrator can change the type

Specified by:
changeUserType in interface I_CmsResourceBroker
Parameters:
currentUser - The current user
currentProject - The current project
userType - The new usertype of the user
user - The CmsUser object of the user to change
CmsException

readResourcesLikeName

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

Specified by:
readResourcesLikeName in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resourcename - A part of resourcename
Returns:
subfolders A Vector with resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

readFilesByType

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

Specified by:
readFilesByType in interface I_CmsResourceBroker
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(CmsUser currentUser,
                                CmsProject currentProject,
                                Hashtable linkchecktable)
                         throws CmsException
Writes the Linkchecktable. Security: Only a administrator can do this

Specified by:
writeLinkCheckTable in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
linkchecktable - The hashtable that contains the links that were not reachable
Returns:
the linkchecktable.
CmsException

readLinkCheckTable

public Hashtable readLinkCheckTable(CmsUser currentUser,
                                    CmsProject currentProject)
                             throws CmsException
Gets the Linkchecktable. Security: All users are garnted

Specified by:
readLinkCheckTable in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
Returns:
the linkchecktable.
CmsException

deleteBackups

public int deleteBackups(CmsObject cms,
                         CmsUser currentUser,
                         CmsProject currentProject,
                         int weeks)
                  throws CmsException
Deletes the versions from the backup tables that are older then the given weeks

Specified by:
deleteBackups in interface I_CmsResourceBroker
Parameters:
cms - The CmsObject for reading the registry
currentUser - The current user
currentProject - The currently used project
weeks - The number of weeks: the max age of the remaining versions
Returns:
int The oldest remaining version
CmsException

accessReadVisible

public boolean accessReadVisible(CmsUser currentUser,
                                 CmsProject currentProject,
                                 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.

Specified by:
accessReadVisible in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resource - The resource to check.
Returns:
weather the user has access, or not.
CmsException

getVisibleResourcesWithProperty

public Vector getVisibleResourcesWithProperty(CmsUser currentUser,
                                              CmsProject currentProject,
                                              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.

Specified by:
getVisibleResourcesWithProperty in interface I_CmsResourceBroker
Parameters:
currentUser - The user who requested this method.
currentProject - The current project of the user.
resourceType - The resource type of the resource
Returns:
Vector with all resources.
Throws:
CmsException - Throws CmsException if operation was not succesful.

joinLinksToTargets

public ArrayList joinLinksToTargets(CmsObject cms,
                                    CmsUser theUser,
                                    CmsProject theProject,
                                    I_CmsReport theReport)
                             throws CmsException
Rebuilds the internal datastructure to join links with their targets. Each target saves the total count of links pointing to itself. Each links saves the ID of it's target.

Specified by:
joinLinksToTargets in interface I_CmsResourceBroker
Parameters:
cms - the current user's CmsObject instance
theUser - the current user
theProject - the current project
theReport - the report to print the output
Returns:
an ArrayList with the resource names that were identified as broken links
Throws:
CmsException
See Also:
CmsDbAccess.updateResourceFlags(com.opencms.file.CmsProject, int, int), CmsDbAccess.fetchAllVfsLinks(com.opencms.file.CmsProject, java.util.ArrayList, java.util.ArrayList, java.util.ArrayList, int), CmsDbAccess.fetchResourceID(com.opencms.file.CmsProject, java.lang.String, int), CmsDbAccess.updateAllResourceFlags(com.opencms.file.CmsProject, int)

fetchVfsLinksForResource

public ArrayList fetchVfsLinksForResource(CmsUser theUser,
                                          CmsProject theProject,
                                          String theResourceName)
                                   throws CmsException
Fetches all VFS links pointing to a given resource name.

Specified by:
fetchVfsLinksForResource in interface I_CmsResourceBroker
Parameters:
theUser - the current user
theProject - the current project
theResourceName - the name of the resource of which the VFS links are fetched
Returns:
an ArrayList with the resource names of the fetched VFS links
Throws:
CmsException

decrementLinkCountForResource

public int decrementLinkCountForResource(CmsProject theProject,
                                         String theResourceName)
                                  throws CmsException
Decrement the VFS link counter for a resource.

Specified by:
decrementLinkCountForResource in interface I_CmsResourceBroker
Parameters:
theProject - the current project
theResourceName - the name of the resource for which the link count is decremented
Returns:
the current link count of the specified resource
Throws:
CmsException

incrementLinkCountForResource

public int incrementLinkCountForResource(CmsProject theProject,
                                         String theResourceName)
                                  throws CmsException
Increment the VFS link counter for a resource.

Specified by:
incrementLinkCountForResource in interface I_CmsResourceBroker
Parameters:
theProject - the current project
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(CmsProject theProject,
                                 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.

Specified by:
linkResourceToTarget in interface I_CmsResourceBroker
Parameters:
theProject - the current project
theLinkResourceName - the resource name of the VFS link
theTargetResourceName - the name of the link's target resource
Throws:
CmsException