|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.file.genericSql.CmsDbAccess
This is the generic access module to load and store resources from and into the database.
| Field Summary | |
protected static String |
C_CONFIGURATIONS_DIGEST
Constant to get property from configurations. |
protected static String |
C_CONFIGURATIONS_DIGEST_FILE_ENCODING
Constant to get property from configurations. |
protected static String |
C_CONFIGURATIONS_POOL
Constant to get property from configurations. |
protected static int |
C_MAX_TABLES
The maximum amount of tables. |
protected static int |
C_RESTYPE_LINK_ID
|
static long |
C_SESSION_TIMEOUT
The session-timeout value: currently six hours. |
protected static String |
C_TABLE_FILES
Table-key for max-id |
protected static String |
C_TABLE_GROUPS
Table-key for max-id |
protected static String |
C_TABLE_GROUPUSERS
Table-key for max-id |
protected static String |
C_TABLE_PROJECTS
Table-key for max-id |
protected static String |
C_TABLE_PROPERTIES
Table-key for max-id |
protected static String |
C_TABLE_PROPERTYDEF
Table-key for max-id |
protected static String |
C_TABLE_RESOURCES
Table-key for max-id |
protected static String |
C_TABLE_SYSTEMPROPERTIES
Table-key for max-id |
protected static String |
C_TABLE_TASK
Table-key for max-id |
protected static String |
C_TABLE_TASKLOG
Table-key for max-id |
protected static String |
C_TABLE_TASKPAR
Table-key for max-id |
protected static String |
C_TABLE_TASKTYPE
Table-key for max-id |
protected static String |
C_TABLE_USERS
Table-key for max-id |
protected static boolean |
C_USE_TARGET_DATE
|
protected CmsQueries |
m_cq
'Constants' file. |
protected MessageDigest |
m_digest
A digest to encrypt the passwords. |
protected String |
m_digestFileEncoding
The file.encoding to code passwords after encryption with digest. |
protected int[] |
m_maxIds
A array containing all max-ids for the tables. |
protected String |
m_poolName
The name of the pool to use |
protected String |
m_poolNameBackup
The name of the backup pool to use |
protected String |
m_poolNameOnline
The name of the online pool to use |
| Fields inherited from interface com.opencms.boot.I_CmsLogChannels |
C_FLEX_CACHE, C_FLEX_LOADER, C_LOGGING, C_MODULE_CRITICAL, C_MODULE_DEBUG, C_MODULE_INFO, C_OPENCMS_CACHE, C_OPENCMS_CRITICAL, C_OPENCMS_CRONSCHEDULER, C_OPENCMS_DEBUG, C_OPENCMS_ELEMENTCACHE, C_OPENCMS_INFO, C_OPENCMS_INIT, C_OPENCMS_POOL, C_OPENCMS_STATICEXPORT, C_OPENCMS_STREAMING, C_PREPROCESSOR_IS_LOGGING |
| Constructor Summary | |
CmsDbAccess(source.org.apache.java.util.Configurations config)
Instanciates the access-module and sets up all required modules and connections. |
|
| Method Summary | |
CmsUser |
addImportUser(String name,
String password,
String recoveryPassword,
String description,
String firstname,
String lastname,
String email,
long lastlogin,
long lastused,
int flags,
Hashtable additionalInfos,
CmsGroup defaultGroup,
String address,
String section,
int type)
Adds a user to the database. |
Serializable |
addSystemProperty(String name,
Serializable object)
Creates a serializable object in the systempropertys. |
CmsUser |
addUser(String name,
String password,
String description,
String firstname,
String lastname,
String email,
long lastlogin,
long lastused,
int flags,
Hashtable additionalInfos,
CmsGroup defaultGroup,
String address,
String section,
int type)
Adds a user to the database. |
void |
addUserToGroup(int userid,
int groupid)
Adds a user to a group. |
void |
backupProject(CmsProject project,
int versionId,
long publishDate,
CmsUser currentUser)
Creates a backup of the published project |
void |
backupResource(int projectId,
CmsResource resource,
byte[] content,
Map properties,
int versionId,
long publishDate)
Creates a backup of the published resource |
void |
changeLockedInProject(int newProjectId,
String resourcename)
Changes the project-id of a resource to the new project for publishing the resource directly |
void |
changeUserType(int userId,
int userType)
Changes the user type of the user |
protected String |
checkExport(String filename,
Hashtable exportpoints)
Private helper method for publihing into the filesystem. |
int |
checkGroupDependence(Vector groups)
checks a Vector of Groupids for the Group which can read all files |
protected String |
checkNull(String value)
Checks, if the String was null or is empty. |
protected void |
clearFilesTable()
Deletes all files in CMS_FILES without fileHeader in CMS_RESOURCES |
void |
copyFile(CmsProject project,
CmsProject onlineProject,
int userId,
String source,
int parentId,
String destination)
Copies the file. |
int |
countLockedResources(CmsProject project)
Counts the locked resources in this project. |
protected int |
countProperties(CmsPropertydefinition metadef)
Returns the amount of properties for a propertydefinition. |
CmsFile |
createFile(CmsProject project,
CmsProject onlineProject,
CmsFile file,
int userId,
int parentId,
String filename)
Creates a new file from an given CmsFile object and a new filename. |
CmsFile |
createFile(CmsUser user,
CmsProject project,
CmsProject onlineProject,
String filename,
int flags,
int parentId,
byte[] contents,
I_CmsResourceType resourceType)
Creates a new file with the given content and resourcetype. |
protected void |
createFileContent(int fileId,
byte[] fileContent,
int versionId,
String usedPool,
String usedStatement)
Creates the content entry for a file |
CmsFolder |
createFolder(CmsUser user,
CmsProject project,
CmsProject onlineProject,
CmsFolder folder,
int parentId,
String foldername)
Creates a new folder from an existing folder object. |
CmsFolder |
createFolder(CmsUser user,
CmsProject project,
int parentId,
int fileId,
String foldername,
int flags)
Creates a new folder |
CmsGroup |
createGroup(String name,
String description,
int flags,
String parent)
Add a new group to the Cms. |
void |
createLinkEntrys(int pageId,
Vector linkTargets)
creates a link entry for each of the link targets in the linktable. |
void |
createOnlineLinkEntrys(int pageId,
Vector linkTargets)
creates a link entry for each of the link targets in the online linktable. |
CmsProject |
createProject(CmsUser owner,
CmsGroup group,
CmsGroup managergroup,
CmsTask task,
String name,
String description,
int flags,
int type)
Creates a project. |
void |
createProjectResource(int projectId,
String resourceName)
Creates a new projectResource from an given CmsResource object. |
CmsPropertydefinition |
createPropertydefinition(String name,
int resourcetype,
int projectId)
Creates the propertydefinitions for the resource type. |
CmsResource |
createResource(CmsProject project,
CmsProject onlineProject,
CmsResource newResource,
byte[] filecontent,
int userId,
boolean isFolder)
Creates a new resource from an given CmsResource object. |
void |
createSession(String sessionId,
Hashtable data)
This method creates a new session in the database. |
CmsTask |
createTask(int rootId,
int parentId,
int tasktype,
int ownerId,
int agentId,
int roleId,
String taskname,
Timestamp wakeuptime,
Timestamp timeout,
int priority)
Creates a new task. |
void |
deleteAllProjectResources(int projectId)
delete all projectResource from an given CmsProject object. |
void |
deleteAllProperties(int projectId,
CmsResource resource)
Deletes all properties for a file or folder. |
void |
deleteAllProperties(int projectId,
int resourceId)
Deletes all properties for a file or folder. |
int |
deleteBackups(long maxdate)
Deletes the versions from the backup tables that are older then the given date |
void |
deleteExportLink(CmsExportLink link)
Deletes an exportlink from the Cms. |
void |
deleteExportLink(String link)
Deletes an exportlink from the Cms. |
void |
deleteFile(CmsProject project,
String filename)
Deletes the file. |
void |
deleteFolder(CmsProject project,
CmsFolder orgFolder)
Deletes the folder. |
void |
deleteGroup(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(CmsProject project)
Deletes a project from the cms. |
void |
deleteProjectProperties(CmsProject project)
Deletes all properties for a project. |
void |
deleteProjectResource(int projectId,
String resourceName)
delete a projectResource from an given CmsResource object. |
void |
deleteProjectResources(CmsProject project)
Deletes a specified project |
void |
deleteProperty(String meta,
int projectId,
CmsResource resource,
int resourceType)
Deletes a property for a file or folder. |
void |
deletePropertydefinition(CmsPropertydefinition metadef)
Delete the propertydefinitions for the resource type. |
protected void |
deleteResource(CmsResource resource)
Private helper method to delete a resource. |
void |
deleteSessions()
Deletes old sessions. |
void |
deleteSystemProperty(String name)
Deletes a serializable object from the systempropertys. |
void |
deleteUser(int id)
Deletes a user from the database. |
void |
deleteUser(String name)
Deletes a user from the database. |
void |
destroy()
Destroys this access-module |
protected String |
digest(String value)
Private method to encrypt the passwords. |
void |
endTask(int taskId)
Ends a task from the Cms. |
int |
fetchAllVfsLinks(CmsProject theProject,
ArrayList theResourceIDs,
ArrayList theLinkContents,
ArrayList theLinkResources,
int theResourceTypeLinkID)
Fetch all VFS links pointing to other VFS resources. |
protected long |
fetchDateFromResource(int theProjectId,
int theResourceId,
long theDefaultDate)
|
int |
fetchResourceFlags(CmsProject theProject,
String theResourceName)
Fetches the RESOURCE_FLAGS attribute for a given resource name. |
int |
fetchResourceID(CmsProject theProject,
String theResourceName,
int skipResourceTypeID)
Fetch the ID for a given VFS link target. |
ArrayList |
fetchVfsLinksForResourceID(CmsProject theProject,
int theResourceID,
int theResourceTypeLinkID)
Fetches all VFS links pointing to a given resource ID. |
protected void |
fillDefaults()
Private method to init all default-resources |
protected int |
findAgent(int roleid)
Finds an agent for a given role (group). |
void |
forwardTask(int taskId,
int newRoleId,
int newUserId)
Forwards a task to another user. |
Vector |
getAllAccessibleProjectsByGroup(CmsGroup group)
Returns all projects, which are accessible by a group. |
Vector |
getAllAccessibleProjectsByManagerGroup(CmsGroup group)
Returns all projects, which are manageable by a group. |
Vector |
getAllAccessibleProjectsByUser(CmsUser user)
Returns all projects, which are owned by a user. |
Vector |
getAllBackupProjects()
Returns all projects from the history. |
Vector |
getAllExportLinks()
Reads all export links. |
Vector |
getAllProjects(int state)
Returns all projects, with the overgiven state. |
int |
getBackupVersionId()
Get the next version id for the published backup resources |
void |
getBrokenLinks(I_CmsReport report,
Vector changed,
Vector deleted,
Vector newRes)
checks a project for broken links that would appear if the project is published. |
protected byte[] |
getBytesFromResultset(ResultSet res,
String columnName)
Returns the bytes from a result set |
Vector |
getChild(String groupname)
Returns all child groups of a groups |
protected void |
getConnectionPools(source.org.apache.java.util.Configurations config,
String rbName)
Gets all necessary connection pools This method can be adjusted for each resourcebroker |
Vector |
getDependingExportLinks(Vector resources)
Reads all export links that depend on the resource. |
Vector |
getFilesInFolder(int projectId,
CmsFolder parentFolder)
Returns a Vector with all file headers of a folder. |
Vector |
getFilesWithProperty(int projectId,
String propertyDefinition,
String propertyValue)
Returns a Vector with all resource-names that have set the given property to the given value. |
Vector |
getFolderTree(int projectId,
String rootName)
Reads the complete folder-tree for this project. |
Vector |
getGroups()
Returns all groups |
Vector |
getGroupsOfUser(String name)
Returns a list of groups of a user. |
Vector |
getOnlineBrokenLinks()
serches for broken links in the online project. |
CmsProject |
getOnlineProject()
Retrieves the online project from the database. |
Vector |
getOnlineResourceNames()
This method reads all resource names from the table CmsOnlineResources |
protected CmsQueries |
getQueries()
retrieve the correct instance of the queries holder. |
String |
getReadingpermittedGroup(int projectId,
String resource)
Checks which Group can read the resource and all the parent folders. |
Vector |
getResourcesInFolder(int projectId,
CmsFolder offlineResource)
Reads all resources (including the folders) residing in a folder |
Vector |
getResourcesWithProperty(int projectId,
String propertyDefinition)
Returns a Vector with all resources of the given type that have set the given property. |
Vector |
getResourcesWithProperty(int projectId,
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. |
Vector |
getSubFolders(int projectId,
CmsFolder parentFolder)
Returns a Vector with all subfolders. |
String |
getTaskPar(int taskId,
String parname)
Get a parameter value for a task. |
int |
getTaskType(String taskName)
Get the template task id fo a given taskname. |
protected String |
getTaskTypeConditon(boolean first,
int tasktype)
|
protected Vector |
getUndeletedResources(Vector resources)
Gets all resources that are marked as undeleted. |
Vector |
getUsers(int type)
Gets all users of a type. |
Vector |
getUsers(int type,
String namefilter)
Gets all users of a type and namefilter. |
Vector |
getUsersByLastname(String lastname,
int userType,
int userStatus,
int wasLoggedIn,
int nMax)
Gets all users with a certain Lastname. |
Vector |
getUsersOfGroup(String name,
int type)
Returns a list of users of a group. |
protected int |
insertTaskPar(int taskId,
String parname,
String parvalue)
|
protected int |
insertTaskType(int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
|
protected void |
m_doSetBytes(PreparedStatement statement,
int posn,
byte[] content)
TESTFIX (mfoley@iee.org) New Code: Performs an Oracle-safe setBytes() action. |
protected int |
nextId(String key)
Private method to get the next id for a table. |
Vector |
publishProject(CmsUser user,
int projectId,
CmsProject onlineProject,
boolean enableHistory,
I_CmsReport report,
Hashtable exportpoints)
Publishes a specified project to the online project. |
Vector |
readAllFileHeaders(int projectId,
String resourceName)
Reads all file headers of a file in the OpenCms. |
Vector |
readAllFileHeadersForHist(String resourceName)
Reads all file headers of a file in the OpenCms. |
Vector |
readAllProjectResources(int projectId)
select all projectResources from an given project |
Vector |
readAllPropertydefinitions(I_CmsResourceType resourcetype,
int projectId)
Reads all propertydefinitions for the given resource type. |
Vector |
readAllPropertydefinitions(int resourcetype,
int projectId)
Reads all propertydefinitions for the given resource type. |
CmsBackupProject |
readBackupProject(int versionId)
Reads a project from the backup tables. |
protected Vector |
readBackupProjectResources(int versionId)
select a projectResource from an given project and resourcename |
CmsExportLink |
readExportLink(String request)
Reads a exportrequest from the Cms. |
CmsExportLink |
readExportLinkHeader(String request)
Reads a exportrequest without the dependencies from the Cms. |
CmsFile |
readFile(int projectId,
int onlineProjectId,
String filename)
Reads a file from the Cms. |
CmsFile |
readFile(int projectId,
int onlineProjectId,
String filename,
boolean includeDeleted)
Reads a file from the Cms. |
protected byte[] |
readFileContent(int projectId,
int fileId)
Private helper method to read the fileContent for publishProject(export). |
CmsBackupResource |
readFileForHist(int versionId,
String filename)
Reads a file from the history of the Cms. |
CmsFile |
readFileHeader(int projectId,
CmsResource resource)
Reads a file header from the Cms. |
CmsFile |
readFileHeader(int projectId,
int resourceId)
Reads a file header from the Cms. |
CmsFile |
readFileHeader(int projectId,
String filename,
boolean includeDeleted)
Reads a file header from the Cms. |
CmsBackupResource |
readFileHeaderForHist(int versionId,
String filename)
Reads a file header from the backup of the Cms. |
CmsFile |
readFileHeaderInProject(int projectId,
String filename)
Reads a file header from the Cms. |
CmsFile |
readFileInProject(int projectId,
int onlineProjectId,
String filename)
Reads a file in the project from the Cms. |
Vector |
readFiles(int projectId)
Reads all files from the Cms, that are in one project. |
Vector |
readFiles(int projectId,
boolean includeUnchanged,
boolean onlyProject)
Reads all files from the Cms, that are in one project. |
Vector |
readFilesByType(int projectId,
int resourcetype)
Reads all files from the Cms, that are of the given type. |
CmsFolder |
readFolder(int projectId,
int folderid)
Reads a folder from the Cms. |
CmsFolder |
readFolder(int projectId,
String foldername)
Reads a folder from the Cms. |
CmsFolder |
readFolderInProject(int projectId,
String foldername)
Reads a folder from the Cms that exists in the project. |
Vector |
readFolders(int projectId)
Reads all folders from the Cms, that are in one project. |
Vector |
readFolders(int projectId,
boolean includeUnchanged,
boolean onlyProject)
Reads all folders from the Cms, that are in one project. |
CmsGroup |
readGroup(int id)
Returns a group object. |
CmsGroup |
readGroup(String groupname)
Returns a group object. |
Vector |
readLinkEntrys(int pageId)
returns a Vector (Strings) with the link destinations of all links on the page with the pageId. |
Vector |
readOnlineLinkEntrys(int pageId)
returns a Vector (Strings) with the link destinations of all links on the page with the pageId. |
CmsProject |
readProject(CmsTask task)
Reads a project by task-id. |
CmsProject |
readProject(int id)
Reads a project. |
Vector |
readProjectLogs(int projectid)
Reads log entries for a project. |
String |
readProjectResource(int projectId,
String resourcename)
select a projectResource from an given project and resourcename |
Vector |
readProjectView(int currentProject,
int project,
String filter)
Reads all resource from the Cms, that are in one project. |
HashMap |
readProperties(int projectId,
CmsResource resource,
int resourceType)
Returns a list of all properties of a file or folder. |
String |
readProperty(String meta,
int projectId,
CmsResource resource,
int resourceType)
Returns a property of a file or folder. |
CmsPropertydefinition |
readPropertydefinition(String name,
I_CmsResourceType type,
int projectId)
Reads a propertydefinition for the given resource type. |
CmsPropertydefinition |
readPropertydefinition(String name,
int type,
int projectId)
Reads a propertydefinition for the given resource type. |
protected CmsResource |
readResource(CmsProject project,
String filename)
Reads a resource from the Cms. |
Vector |
readResources(CmsProject project)
Reads all resource from the Cms, that are in one project. |
Vector |
readResourcesLikeName(CmsProject project,
String resourcename)
Reads all resources that contains the given string in the resourcename and exists in the current project. |
Hashtable |
readSession(String sessionId)
Reads a session from the database. |
Serializable |
readSystemProperty(String name)
Reads a serializable object from the systempropertys. |
CmsTask |
readTask(int id)
Reads a task from the Cms. |
CmsTaskLog |
readTaskLog(int id)
Reads a log for a task. |
Vector |
readTaskLogs(int taskId)
Reads log entries for a task. |
Vector |
readTasks(CmsProject project,
CmsUser agent,
CmsUser owner,
CmsGroup role,
int tasktype,
String orderBy,
String sort)
Reads all tasks of a user in a project. |
CmsUser |
readUser(int id)
Reads a user from the cms, only if the password is correct. |
CmsUser |
readUser(String name,
int type)
Reads a user from the cms. |
CmsUser |
readUser(String name,
String password,
int type)
Reads a user from the cms, only if the password is correct. |
void |
recoverPassword(String user,
String recoveryPassword,
String password)
Sets the password, only if the user knows the recovery-password. |
void |
removeFile(int projectId,
String filename)
Deletes a file in the database. |
void |
removeFolder(int projectId,
CmsFolder folder)
Deletes a folder in the database. |
protected void |
removeFolderForPublish(int projectId,
String foldername)
Deletes a folder in the database. |
protected void |
removeTemporaryFile(CmsFile file)
Removes the temporary files of the given resource |
void |
removeUserFromGroup(int userid,
int groupid)
Removes a user from a group. |
void |
renameFile(CmsProject project,
CmsProject onlineProject,
int userId,
int oldfileID,
String newname)
Renames the file to the new name. |
void |
setPassword(String user,
String password)
Sets a new password for a user. |
void |
setRecoveryPassword(String user,
String password)
Sets a new password for a user. |
int |
setTaskPar(int taskId,
String parname,
String parvalue)
Set a Parameter for a task. |
protected Vector |
SortEntrys(Vector list)
Sorts a vector of files or folders alphabetically. |
void |
undeleteFile(CmsProject project,
String filename)
Undeletes the file. |
void |
unlockProject(CmsProject project)
Unlocks all resources in this project. |
int |
updateAllResourceFlags(CmsProject theProject,
int theValue)
Update the resources flag attribute of all resources. |
void |
updateLockstate(CmsResource res,
int projectId)
Updates the LOCKED_BY state of a Resource. |
void |
updateOnlineProjectLinks(Vector deleted,
Vector changed,
Vector newRes,
int pageType)
When a project is published this method aktualises the online link table. |
int |
updateResourceFlags(CmsProject theProject,
int theResourceID,
int theValue)
Update the resource flag attribute for a given resource. |
void |
updateResourcestate(CmsResource res)
Updates the state of a Resource. |
int |
updateSession(String sessionId,
Hashtable data)
This method updates a session in the database. |
protected void |
updateTaskPar(int parid,
String parvalue)
|
protected void |
updateTaskType(int taskId,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
|
boolean |
userInGroup(int userid,
int groupid)
Checks if a user is member of a group. |
void |
writeExportLink(CmsExportLink link)
Writes an exportlink to the Cms. |
void |
writeExportLinkProcessedState(CmsExportLink link)
Sets one exportLink to procecced. |
void |
writeFile(CmsProject project,
CmsProject onlineProject,
CmsFile file,
boolean changed)
Writes a file to the Cms. |
void |
writeFile(CmsProject project,
CmsProject onlineProject,
CmsFile file,
boolean changed,
int userId)
Writes a file to the Cms. |
protected void |
writeFileContent(int fileId,
byte[] fileContent,
String usedPool,
String usedStatement)
Writes the file content of an existing file |
void |
writeFileHeader(CmsProject project,
CmsFile file,
boolean changed)
Writes the fileheader to the Cms. |
void |
writeFileHeader(CmsProject project,
CmsFile file,
boolean changed,
int userId)
Writes the fileheader to the Cms. |
void |
writeFolder(CmsProject project,
CmsFolder folder,
boolean changed)
Writes a folder to the Cms. |
void |
writeFolder(CmsProject project,
CmsFolder folder,
boolean changed,
int userId)
Writes a folder to the Cms. |
void |
writeGroup(CmsGroup group)
Writes an already existing group in the Cms. |
void |
writeProject(CmsProject project)
Deletes a project from the cms. |
void |
writeProperties(Map propertyinfos,
int projectId,
CmsResource resource,
int resourceType)
Writes a couple of Properties for a file or folder. |
void |
writeProperties(Map propertyinfos,
int projectId,
CmsResource resource,
int resourceType,
boolean addDefinition)
Writes a couple of Properties for a file or folder. |
void |
writeProperty(String meta,
int projectId,
String value,
CmsResource resource,
int resourceType,
boolean addDefinition)
Writes a property for a file or folder. |
CmsPropertydefinition |
writePropertydefinition(CmsPropertydefinition propertyDef,
int projectId)
Updates the name of the propertydefinition for the resource type. |
void |
writeResource(CmsProject project,
CmsResource resource,
byte[] filecontent,
boolean changed,
int userId)
Writes a folder to the Cms. |
Serializable |
writeSystemProperty(String name,
Serializable object)
Writes a serializable object to the systemproperties. |
void |
writeSystemTaskLog(int taskid,
String comment)
|
CmsTask |
writeTask(CmsTask task)
Updates a task. |
void |
writeTaskLog(int taskId,
int userid,
Timestamp starttime,
String comment,
int type)
Writes new log for a task. |
int |
writeTaskType(int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
Creates a new tasktype set in the database. |
void |
writeUser(CmsUser user)
Writes a user to the database. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static int C_RESTYPE_LINK_ID
protected static boolean C_USE_TARGET_DATE
protected String m_poolName
protected String m_poolNameOnline
protected String m_poolNameBackup
public static long C_SESSION_TIMEOUT
protected static int C_MAX_TABLES
protected static String C_TABLE_SYSTEMPROPERTIES
protected static String C_TABLE_GROUPS
protected static String C_TABLE_GROUPUSERS
protected static String C_TABLE_USERS
protected static String C_TABLE_PROJECTS
protected static String C_TABLE_RESOURCES
protected static String C_TABLE_FILES
protected static String C_TABLE_PROPERTYDEF
protected static String C_TABLE_PROPERTIES
protected static String C_TABLE_TASK
protected static String C_TABLE_TASKTYPE
protected static String C_TABLE_TASKPAR
protected static String C_TABLE_TASKLOG
protected static String C_CONFIGURATIONS_DIGEST
protected static String C_CONFIGURATIONS_DIGEST_FILE_ENCODING
protected static String C_CONFIGURATIONS_POOL
protected int[] m_maxIds
protected MessageDigest m_digest
protected String m_digestFileEncoding
protected CmsQueries m_cq
| Constructor Detail |
public CmsDbAccess(source.org.apache.java.util.Configurations config)
throws CmsException
config - The OpenCms configuration.
CmsException - Throws CmsException if something goes wrong.| Method Detail |
protected void m_doSetBytes(PreparedStatement statement,
int posn,
byte[] content)
throws SQLException
statement - The PreparedStatement.posn - The parameter placeholder in the prepared statement.content - The byte array to be inserted into the prepared statement.
SQLException - Throws SQLException if something goes wrong.
protected void getConnectionPools(source.org.apache.java.util.Configurations config,
String rbName)
config - The configuration
public Serializable addSystemProperty(String name,
Serializable object)
throws CmsException
name - The name of the property.object - The property-object.
CmsException - Throws CmsException if something goes wrong.
public CmsUser addUser(String name,
String password,
String description,
String firstname,
String lastname,
String email,
long lastlogin,
long lastused,
int flags,
Hashtable additionalInfos,
CmsGroup defaultGroup,
String address,
String section,
int type)
throws CmsException
name - usernamepassword - user-passworddescription - user-descriptionfirstname - user-firstnamelastname - user-lastnameemail - user-emaillastlogin - user-lastloginlastused - user-lastusedflags - user-flagsadditionalInfos - user-additional-infosdefaultGroup - user-defaultGroupaddress - user-defauladdresssection - user-sectiontype - user-type
thorws - CmsException if something goes wrong.
CmsException
public CmsUser addImportUser(String name,
String password,
String recoveryPassword,
String description,
String firstname,
String lastname,
String email,
long lastlogin,
long lastused,
int flags,
Hashtable additionalInfos,
CmsGroup defaultGroup,
String address,
String section,
int type)
throws CmsException
name - usernamepassword - user-passwordrecoveryPassword - user-recoveryPassworddescription - user-descriptionfirstname - user-firstnamelastname - user-lastnameemail - user-emaillastlogin - user-lastloginlastused - user-lastusedflags - user-flagsadditionalInfos - user-additional-infosdefaultGroup - user-defaultGroupaddress - user-defauladdresssection - user-sectiontype - user-type
thorws - CmsException if something goes wrong.
CmsException
public void addUserToGroup(int userid,
int groupid)
throws CmsException
userid - The id of the user that is to be added to the group.groupid - The id of the group.
CmsException - Throws CmsException if operation was not succesfull.
protected String checkExport(String filename,
Hashtable exportpoints)
filename - Name of a resource in the OpenCms system.
protected String checkNull(String value)
value - the String to check.
protected void clearFilesTable()
throws CmsException
CmsException
public void copyFile(CmsProject project,
CmsProject onlineProject,
int userId,
String source,
int parentId,
String destination)
throws CmsException
project - The project in which the resource will be used.onlineProject - The online project of the OpenCms.userId - The id of the user who wants to copy the file.source - The complete path of the sourcefile.parentId - The parentId of the resource.destination - The complete path of the destinationfile.
CmsException - Throws CmsException if operation was not succesful.
public int countLockedResources(CmsProject project)
throws CmsException
project - The project to be unlocked.
CmsException - Throws CmsException if something goes wrong.
protected int countProperties(CmsPropertydefinition metadef)
throws CmsException
metadef - The propertydefinition to test.
CmsException - Throws CmsException if something goes wrong.
public CmsFile createFile(CmsProject project,
CmsProject onlineProject,
CmsFile file,
int userId,
int parentId,
String filename)
throws CmsException
project - The project in which the resource will be used.onlineProject - The online project of the OpenCms.file - The file to be written to the Cms.parentId - The parentId of the resource.filename - The complete new name of the file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public CmsFile createFile(CmsUser user,
CmsProject project,
CmsProject onlineProject,
String filename,
int flags,
int parentId,
byte[] contents,
I_CmsResourceType resourceType)
throws CmsException
user - The user who wants to create the file.project - The project in which the resource will be used.onlineProject - The online project of the OpenCms.filename - The complete name of the new file (including pathinformation).flags - The flags of this resource.parentId - The parentId of the resource.contents - The contents of the new file.resourceType - The resourceType of the new file.
CmsException - Throws CmsException if operation was not succesful
public CmsFolder createFolder(CmsUser user,
CmsProject project,
int parentId,
int fileId,
String foldername,
int flags)
throws CmsException
user - The user who wants to create the folder.project - The project in which the resource will be used.parentId - The parentId of the folder.fileId - The fileId of the folder.foldername - The complete path to the folder in which the new folder will
be created.flags - The flags of this resource.
CmsException - Throws CmsException if operation was not succesful.
public CmsFolder createFolder(CmsUser user,
CmsProject project,
CmsProject onlineProject,
CmsFolder folder,
int parentId,
String foldername)
throws CmsException
user - The user who wants to create the folder.project - The project in which the resource will be used.onlineProject - The online project of the OpenCms.folder - The folder to be written to the Cms.parentId - The parentId of the resource.foldername - The complete path of the new name of this folder.
CmsException - Throws CmsException if operation was not succesful.
public CmsResource createResource(CmsProject project,
CmsProject onlineProject,
CmsResource newResource,
byte[] filecontent,
int userId,
boolean isFolder)
throws CmsException
project - The project in which the resource will be used.onlineProject - The online project of the OpenCms.newResource - The resource to be written to the Cms.filecontent - The filecontent if the resource is a fileuserId - The ID of the current user.
CmsException - Throws CmsException if operation was not succesful
public void createProjectResource(int projectId,
String resourceName)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public CmsGroup createGroup(String name,
String description,
int flags,
String parent)
throws CmsException
name - The name of the new group.description - The description for the new group.flags - The flags for the new group.
CmsException - Throws CmsException if operation was not succesfull.
public CmsProject createProject(CmsUser owner,
CmsGroup group,
CmsGroup managergroup,
CmsTask task,
String name,
String description,
int flags,
int type)
throws CmsException
owner - The owner of this project.group - The group for this project.managergroup - The managergroup for this project.task - The task.name - The name of the project to create.description - The description for the new project.flags - The flags for the project (e.g. archive).type - the type for the project (e.g. normal).
CmsException - Throws CmsException if something goes wrong.
public CmsPropertydefinition createPropertydefinition(String name,
int resourcetype,
int projectId)
throws CmsException
name - The name of the propertydefinitions to overwrite.resourcetype - The resource-type for the propertydefinitions.
CmsException - Throws CmsException if something goes wrong.
public void createSession(String sessionId,
Hashtable data)
throws CmsException
sessionId - the id of the session.
CmsException
public CmsTask createTask(int rootId,
int parentId,
int tasktype,
int ownerId,
int agentId,
int roleId,
String taskname,
Timestamp wakeuptime,
Timestamp timeout,
int priority)
throws CmsException
rootId - id of the root task projectparentId - id of the parent tasktasktype - type of the taskownerId - id of the owneragentId - id of the agentroleId - id of the roletaskname - name of the taskwakeuptime - time when the task will be wake uptimeout - time when the task times outpriority - priority of the task
CmsException - if something goes wrong.
public void deleteAllProperties(int projectId,
CmsResource resource)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public void deleteAllProperties(int projectId,
int resourceId)
throws CmsException
resourceId - The id of the resource.
CmsException - Throws CmsException if operation was not succesful
public void deleteFile(CmsProject project,
String filename)
throws CmsException
project - The project in which the resource will be used.filename - The complete path of the file.
CmsException - Throws CmsException if operation was not succesful.
public void deleteFolder(CmsProject project,
CmsFolder orgFolder)
throws CmsException
project - The project in which the resource will be used.orgFolder - The folder that will be deleted.
CmsException - Throws CmsException if operation was not succesful.
public void deleteGroup(String delgroup)
throws CmsException
delgroup - The name of the group that is to be deleted.
CmsException - Throws CmsException if operation was not succesfull.
public void deleteProject(CmsProject project)
throws CmsException
project - the project to delete.
CmsException - Throws CmsException if something goes wrong.
public void deleteProjectProperties(CmsProject project)
throws CmsException
project - The project to delete.
CmsException - Throws CmsException if operation was not succesful
public void deleteProjectResources(CmsProject project)
throws CmsException
project - The project to be deleted.
CmsException - Throws CmsException if operation was not succesful.
public void deleteAllProjectResources(int projectId)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public void deleteProjectResource(int projectId,
String resourceName)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public void deleteProperty(String meta,
int projectId,
CmsResource resource,
int resourceType)
throws CmsException
meta - The property-name of which the property has to be read.resourceType - The Type of the resource.
CmsException - Throws CmsException if operation was not succesful
public void deletePropertydefinition(CmsPropertydefinition metadef)
throws CmsException
metadef - The propertydefinitions to be deleted.
CmsException - Throws CmsException if something goes wrong.
protected void deleteResource(CmsResource resource)
throws CmsException
CmsException - Throws CmsException if operation was not succesful.public void deleteSessions()
public void deleteSystemProperty(String name)
throws CmsException
name - The name of the property.
CmsException - Throws CmsException if something goes wrong.
public void deleteUser(int id)
throws CmsException
thorws - CmsException if something goes wrong.
CmsException
public void deleteUser(String name)
throws CmsException
thorws - CmsException if something goes wrong.
CmsException
public void destroy()
throws CmsException
throws - CmsException if something goes wrong.
CmsExceptionprotected String digest(String value)
value - The value to encrypt.
public void endTask(int taskId)
throws CmsException
CmsException - Throws CmsException if something goes wrong.
protected void fillDefaults()
throws CmsException
CmsException
protected int findAgent(int roleid)
throws CmsException
CmsException - Throws CmsException if something goes wrong.
public void forwardTask(int taskId,
int newRoleId,
int newUserId)
throws CmsException
taskId - The id of the task that will be fowarded.newRoleId - The new Group the task belongs tonewUserId - User who gets the task.
CmsException - Throws CmsException if something goes wrong.
public Vector getAllAccessibleProjectsByGroup(CmsGroup group)
throws CmsException
group - The requesting group.
CmsException
public Vector getAllAccessibleProjectsByManagerGroup(CmsGroup group)
throws CmsException
group - The requesting group.
CmsException
public Vector getAllAccessibleProjectsByUser(CmsUser user)
throws CmsException
user - The requesting user.
CmsException
public Vector getAllProjects(int state)
throws CmsException
state - The state of the projects to read.
CmsException
public Vector getAllBackupProjects()
throws CmsException
CmsException
public Vector getChild(String groupname)
throws CmsException
groupname - The name of the group.
CmsException - Throws CmsException if operation was not succesful.
public Vector getFilesInFolder(int projectId,
CmsFolder parentFolder)
throws CmsException
parentFolder - The folder to be searched.
CmsException - Throws CmsException if operation was not succesful.
public Vector getFilesWithProperty(int projectId,
String propertyDefinition,
String propertyValue)
throws CmsException
CmsException - Throws CmsException if operation was not succesful.
public Vector getResourcesWithProperty(int projectId,
String propertyDefinition,
String propertyValue,
int resourceType)
throws CmsException
CmsException - Throws CmsException if operation was not succesful.
public Vector getResourcesWithProperty(int projectId,
String propertyDefinition)
throws CmsException
CmsException - Throws CmsException if operation was not succesful.
public Vector getFolderTree(int projectId,
String rootName)
throws CmsException
rootName - The name of the root, e.g. /default/vfs
CmsException - Throws CmsException if operation was not succesful
public Vector getGroups()
throws CmsException
CmsException - Throws CmsException if operation was not succesful.
public Vector getGroupsOfUser(String name)
throws CmsException
name - The name of the user.
CmsException - Throws CmsException if operation was not succesful
public CmsProject getOnlineProject()
throws CmsException
CmsException - Throws CmsException if the resource is not found, or the database communication went wrong.
public String getReadingpermittedGroup(int projectId,
String resource)
throws CmsException
CmsException
public int checkGroupDependence(Vector groups)
throws CmsException
groups - A Vector with groupids (Integer).
CmsException
public Vector getResourcesInFolder(int projectId,
CmsFolder offlineResource)
throws CmsException
offlineResource - the parent resource id of the offline resoure.
CmsException - Throws CmsException if operation was not succesful
public Vector getSubFolders(int projectId,
CmsFolder parentFolder)
throws CmsException
parentFolder - The folder to be searched.
CmsException - Throws CmsException if operation was not succesful.
public String getTaskPar(int taskId,
String parname)
throws CmsException
parname - Name of the parameter.
CmsException - Throws CmsException if something goes wrong.
public int getTaskType(String taskName)
throws CmsException
taskName - Name of the TAsk
CmsException - Throws CmsException if something goes wrong.
protected String getTaskTypeConditon(boolean first,
int tasktype)
protected Vector getUndeletedResources(Vector resources)
resources - Vector of resources
public Vector getUsers(int type)
throws CmsException
type - The type of the user.
thorws - CmsException if something goes wrong.
CmsException
public Vector getUsers(int type,
String namefilter)
throws CmsException
type - The type of the user.
thorws - CmsException if something goes wrong.
CmsException
public Vector getUsersOfGroup(String name,
int type)
throws CmsException
name - The name of the group.type - the type of the users to read.
CmsException - Throws CmsException if operation was not succesful
public Vector getUsersByLastname(String lastname,
int userType,
int userStatus,
int wasLoggedIn,
int nMax)
throws CmsException
wasLoggedIn - was the user ever locked in?nMax - max number of results
CmsException - if operation was not successful.
protected int insertTaskPar(int taskId,
String parname,
String parvalue)
throws CmsException
CmsException
protected int insertTaskType(int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
throws CmsException
CmsException
protected int nextId(String key)
throws CmsException
key - A key for the table to get the max-id from.
CmsException
public Vector publishProject(CmsUser user,
int projectId,
CmsProject onlineProject,
boolean enableHistory,
I_CmsReport report,
Hashtable exportpoints)
throws CmsException
onlineProject - The online project of the OpenCms.report - A report object to provide the loggin messages.
CmsException - Throws CmsException if operation was not succesful.public int getBackupVersionId()
public void backupProject(CmsProject project,
int versionId,
long publishDate,
CmsUser currentUser)
throws CmsException
project - The project in which the resource was published.versionId - The version of the backuppublishDate - The date of publishing
CmsException - Throws CmsException if operation was not succesful.
public void backupResource(int projectId,
CmsResource resource,
byte[] content,
Map properties,
int versionId,
long publishDate)
throws CmsException
projectId - The project in which the resource was published.resource - The published resourcecontent - The file content if the resource is a file.properties - The properties of the resource.versionId - The version of the backuppublishDate - The date of publishing
CmsException - Throws CmsException if operation was not succesful.
public Vector readAllProjectResources(int projectId)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public Vector readAllFileHeaders(int projectId,
String resourceName)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public Vector readAllFileHeadersForHist(String resourceName)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public HashMap readProperties(int projectId,
CmsResource resource,
int resourceType)
throws CmsException
resource - the resource to read the properties fromresourceType - the type of the resource
CmsException - Throws CmsException if operation was not succesful
public Vector readAllPropertydefinitions(int resourcetype,
int projectId)
throws CmsException
resourcetype - The resource type to read the propertydefinitions for.
CmsException - Throws CmsException if something goes wrong.
public Vector readAllPropertydefinitions(I_CmsResourceType resourcetype,
int projectId)
throws CmsException
resourcetype - The resource type to read the propertydefinitions for.
CmsException - Throws CmsException if something goes wrong.
public CmsFile readFile(int projectId,
int onlineProjectId,
String filename)
throws CmsException
projectId - The Id of the project in which the resource will be used.onlineProjectId - The online projectId of the OpenCms.filename - The complete name of the new file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public void deleteLinkEntrys(int pageId)
throws CmsException
pageId - The resourceId (offline) of the page whose links should be deleted
CmsException
public void createLinkEntrys(int pageId,
Vector linkTargets)
throws CmsException
pageId - The resourceId (offline) of the page whose liks should be traced.
CmsException
public Vector readLinkEntrys(int pageId)
throws CmsException
pageId - The resourceId (offline) of the page whose liks should be read.
CmsException
public void deleteOnlineLinkEntrys(int pageId)
throws CmsException
pageId - The resourceId (online) of the page whose links should be deleted
CmsException
public void createOnlineLinkEntrys(int pageId,
Vector linkTargets)
throws CmsException
pageId - The resourceId (online) of the page whose liks should be traced.
CmsException
public Vector readOnlineLinkEntrys(int pageId)
throws CmsException
pageId - The resourceId (online) of the page whose liks should be read.
CmsException
public Vector getOnlineBrokenLinks()
throws CmsException
CmsException
public void getBrokenLinks(I_CmsReport report,
Vector changed,
Vector deleted,
Vector newRes)
throws CmsException
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
public Vector getOnlineResourceNames()
throws CmsException
CmsException
public void updateOnlineProjectLinks(Vector deleted,
Vector changed,
Vector newRes,
int pageType)
throws CmsException
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
public CmsExportLink readExportLink(String request)
throws CmsException
request - The request to be read.
CmsException - Throws CmsException if operation was not succesful.
public CmsExportLink readExportLinkHeader(String request)
throws CmsException
request - The request to be read.
CmsException - Throws CmsException if operation was not succesful.
public void writeExportLinkProcessedState(CmsExportLink link)
throws CmsException
link - the cmsexportlink.
CmsException - if something goes wrong.
public void deleteExportLink(String link)
throws CmsException
link - the cmsexportlink to delete.
CmsException - if something goes wrong.
public void deleteExportLink(CmsExportLink link)
throws CmsException
link - the cmsexportlink object to delete.
CmsException - if something goes wrong.
public void writeExportLink(CmsExportLink link)
throws CmsException
link - the cmsexportlink object to write.
CmsException - if something goes wrong.
public Vector getDependingExportLinks(Vector resources)
throws CmsException
CmsException
public Vector getAllExportLinks()
throws CmsException
CmsException
public CmsFile readFile(int projectId,
int onlineProjectId,
String filename,
boolean includeDeleted)
throws CmsException
projectId - The Id of the project in which the resource will be used.onlineProjectId - The online projectId of the OpenCms.filename - The complete name of the new file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public CmsFile readFileInProject(int projectId,
int onlineProjectId,
String filename)
throws CmsException
projectId - The Id of the project in which the resource will be used.onlineProjectId - The online projectId of the OpenCms.filename - The complete name of the new file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
protected byte[] readFileContent(int projectId,
int fileId)
throws CmsException
fileId - the fileId.
CmsException - Throws CmsException if operation was not succesful.
public CmsFile readFileHeader(int projectId,
int resourceId)
throws CmsException
projectId - The Id of the projectresourceId - The Id of the resource.
CmsException - Throws CmsException if operation was not succesful
public CmsFile readFileHeader(int projectId,
CmsResource resource)
throws CmsException
projectId - The Id of the project
CmsException - Throws CmsException if operation was not succesful
public CmsFile readFileHeader(int projectId,
String filename,
boolean includeDeleted)
throws CmsException
projectId - The Id of the project in which the resource will be used.filename - The complete name of the new file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public CmsBackupResource readFileHeaderForHist(int versionId,
String filename)
throws CmsException
versionId - The Id of the version of the resource.filename - The complete name of the new file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public CmsBackupResource readFileForHist(int versionId,
String filename)
throws CmsException
versionId - The versionId of the resource.filename - The complete name of the file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public CmsFile readFileHeaderInProject(int projectId,
String filename)
throws CmsException
projectId - The Id of the project in which the resource will be used.filename - The complete name of the new file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public Vector readFiles(int projectId)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public Vector readFiles(int projectId,
boolean includeUnchanged,
boolean onlyProject)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public CmsFolder readFolder(int projectId,
String foldername)
throws CmsException
foldername - The name of the folder to be read.
CmsException - Throws CmsException if operation was not succesful.
public CmsFolder readFolder(int projectId,
int folderid)
throws CmsException
folderid - The id of the folder to be read.
CmsException - Throws CmsException if operation was not succesful.
public CmsFolder readFolderInProject(int projectId,
String foldername)
throws CmsException
foldername - The name of the folder to be read.
CmsException - Throws CmsException if operation was not succesful.
public Vector readFolders(int projectId)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public Vector readFolders(int projectId,
boolean includeUnchanged,
boolean onlyProject)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public CmsGroup readGroup(int id)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public CmsGroup readGroup(String groupname)
throws CmsException
groupname - The name of the group that is to be read.
CmsException - Throws CmsException if operation was not succesful
public CmsProject readProject(int id)
throws CmsException
id - The id of the project.
CmsException - Throws CmsException if something goes wrong.
public CmsProject readProject(CmsTask task)
throws CmsException
task - The task to read the project for.
CmsException - Throws CmsException if something goes wrong.
public Vector readProjectView(int currentProject,
int project,
String filter)
throws CmsException
project - The id of the project in which the resource will be used.filter - The filter for the resources to be read
CmsException - Throws CmsException if operation was not succesful
public CmsBackupProject readBackupProject(int versionId)
throws CmsException
versionId - The versionId of the backup project.
CmsException - Throws CmsException if something goes wrong.
public Vector readProjectLogs(int projectid)
throws CmsException
CmsException - Throws CmsException if something goes wrong.
public String readProperty(String meta,
int projectId,
CmsResource resource,
int resourceType)
throws CmsException
meta - The property-name of which the property has to be read.resourceType - The Type of the resource.
CmsException - Throws CmsException if operation was not succesful
public CmsPropertydefinition readPropertydefinition(String name,
int type,
int projectId)
throws CmsException
name - The name of the propertydefinition to read.type - The resource type for which the propertydefinition is valid.
CmsException - Throws CmsException if something goes wrong.
public CmsPropertydefinition readPropertydefinition(String name,
I_CmsResourceType type,
int projectId)
throws CmsException
name - The name of the propertydefinition to read.type - The resource type for which the propertydefinition is valid.
CmsException - Throws CmsException if something goes wrong.
protected CmsResource readResource(CmsProject project,
String filename)
throws CmsException
project - The project in which the resource will be used.filename - The complete name of the new file (including pathinformation).
CmsException - Throws CmsException if operation was not succesful
public Vector readResources(CmsProject project)
throws CmsException
project - The project in which the resource will be used.
CmsException - Throws CmsException if operation was not succesful
public String readProjectResource(int projectId,
String resourcename)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
protected Vector readBackupProjectResources(int versionId)
throws CmsException
CmsException - Throws CmsException if operation was not succesful
public Hashtable readSession(String sessionId)
throws CmsException
thorws - CmsException if something goes wrong.
CmsException
public Serializable readSystemProperty(String name)
throws CmsException
name - The name of the property.
CmsException - Throws CmsException if something goes wrong.
public CmsTask readTask(int id)
throws CmsException
id - The id of the task to read.
CmsException - Throws CmsException if something goes wrong.
public CmsTaskLog readTaskLog(int id)
throws CmsException
id - The id for the tasklog .
CmsException - Throws CmsException if something goes wrong.
public Vector readTaskLogs(int taskId)
throws CmsException
CmsException - Throws CmsException if something goes wrong.
public Vector readTasks(CmsProject project,
CmsUser agent,
CmsUser owner,
CmsGroup role,
int tasktype,
String orderBy,
String sort)
throws CmsException
project - The Project in which the tasks are defined.agent - The task agentowner - The task owner .tasktype - C_TASKS_ALL, C_TASKS_OPEN, C_TASKS_DONE, C_TASKS_NEWorderBy - Chooses, how to order the tasks.sort - Sort Ascending or Descending (ASC or DESC)
CmsException - Throws CmsException if something goes wrong.
public CmsUser readUser(int id)
throws CmsException
id - the id of the user.
thorws - CmsException if something goes wrong.
CmsException
public CmsUser readUser(String name,
int type)
throws CmsException
name - the name of the user.type - the type of the user.
thorws - CmsException if something goes wrong.
CmsException
public CmsUser readUser(String name,
String password,
int type)
throws CmsException
name - the name of the user.password - the password of the user.type - the type of the user.
thorws - CmsException if something goes wrong.
CmsException
public void recoverPassword(String user,
String recoveryPassword,
String password)
throws CmsException
user - the user to set the password for.recoveryPassword - the recoveryPassword the user has to know to set the password.password - the password to set
thorws - CmsException if something goes wrong.
CmsException
public void removeFile(int projectId,
String filename)
throws CmsException
filename - The complete path of the file.
CmsException - Throws CmsException if operation was not succesful
public void removeFolder(int projectId,
CmsFolder folder)
throws CmsException
folder - The folder.
CmsException - Throws CmsException if operation was not succesful
protected void removeFolderForPublish(int projectId,
String foldername)
throws CmsException
foldername - The complete path of the folder.
CmsException - Throws CmsException if operation was not succesful
protected void removeTemporaryFile(CmsFile file)
throws CmsException
file - The file of which the remporary files should be deleted
CmsException - Throws CmsException if operation was not succesful.
public void removeUserFromGroup(int userid,
int groupid)
throws CmsException
userid - The id of the user that is to be added to the group.groupid - The id of the group.
CmsException - Throws CmsException if operation was not succesful.
public void renameFile(CmsProject project,
CmsProject onlineProject,
int userId,
int oldfileID,
String newname)
throws CmsException
project - The prect in which the resource will be used.onlineProject - The online project of the OpenCms.userId - The user idoldfileID - The id of the resource which will be renamed.newname - The new name of the resource.
CmsException - Throws CmsException if operation was not succesful.
public void setPassword(String user,
String password)
throws CmsException
user - the user to set the password for.password - the password to set
thorws - CmsException if something goes wrong.
CmsException
public void setRecoveryPassword(String user,
String password)
throws CmsException
user - the user to set the password for.password - the recoveryPassword to set
thorws - CmsException if something goes wrong.
CmsException
public int setTaskPar(int taskId,
String parname,
String parvalue)
throws CmsException
parname - Name of the parameter.parvalue - Value if the parameter.
CmsException - Throws CmsException if something goes wrong.protected Vector SortEntrys(Vector list)
public void undeleteFile(CmsProject project,
String filename)
throws CmsException
project - The project in which the resource will be used.filename - The complete path of the file.
CmsException - Throws CmsException if operation was not succesful.
public void unlockProject(CmsProject project)
throws CmsException
project - The project to be unlocked.
CmsException - Throws CmsException if something goes wrong.
public void updateLockstate(CmsResource res,
int projectId)
throws CmsException
res - com.opencms.file.CmsResource
CmsException - The exception description.
public void updateResourcestate(CmsResource res)
throws CmsException
res - com.opencms.file.CmsResource
CmsException - The exception description.
public int updateSession(String sessionId,
Hashtable data)
throws CmsException
sessionId - the id of the session.
CmsException
protected void updateTaskPar(int parid,
String parvalue)
throws CmsException
CmsException
protected void updateTaskType(int taskId,
int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
throws CmsException
CmsException
public boolean userInGroup(int userid,
int groupid)
throws CmsException
groupid - The id of the group to check.
CmsException - Throws CmsException if operation was not succesful
public void writeFile(CmsProject project,
CmsProject onlineProject,
CmsFile file,
boolean changed)
throws CmsException
project - The project in which the resource will be used.onlineProject - The online project of the OpenCms.file - The new file.changed - Flag indicating if the file state must be set to changed.
CmsException - Throws CmsException if operation was not succesful.
public void writeFile(CmsProject project,
CmsProject onlineProject,
CmsFile file,
boolean changed,
int userId)
throws CmsException
project - The project in which the resource will be used.onlineProject - The online project of the OpenCms.file - The new file.changed - Flag indicating if the file state must be set to changed.userId - The id of the user who has changed the resource.
CmsException - Throws CmsException if operation was not succesful.
public void writeFileHeader(CmsProject project,
CmsFile file,
boolean changed)
throws CmsException
project - The project in which the resource will be used.file - The new file.changed - Flag indicating if the file state must be set to changed.
CmsException - Throws CmsException if operation was not succesful.
public void writeFileHeader(CmsProject project,
CmsFile file,
boolean changed,
int userId)
throws CmsException
project - The project in which the resource will be used.file - The new file.changed - Flag indicating if the file state must be set to changed.userId - The id of the user who has changed the resource.
CmsException - Throws CmsException if operation was not succesful.
public void writeFolder(CmsProject project,
CmsFolder folder,
boolean changed)
throws CmsException
project - The project in which the resource will be used.folder - The folder to be written.changed - Flag indicating if the file state must be set to changed.
CmsException - Throws CmsException if operation was not succesful.
public void writeFolder(CmsProject project,
CmsFolder folder,
boolean changed,
int userId)
throws CmsException
project - The project in which the resource will be used.folder - The folder to be written.changed - Flag indicating if the file state must be set to changed.userId - The user who has changed the resource
CmsException - Throws CmsException if operation was not succesful.
public void writeResource(CmsProject project,
CmsResource resource,
byte[] filecontent,
boolean changed,
int userId)
throws CmsException
project - The project in which the resource will be used.changed - Flag indicating if the file state must be set to changed.userId - The user who has changed the resource
CmsException - Throws CmsException if operation was not succesful.
public void writeGroup(CmsGroup group)
throws CmsException
group - The group that should be written to the Cms.
CmsException - Throws CmsException if operation was not succesfull.
public void writeProject(CmsProject project)
throws CmsException
project - the project to delete.
CmsException - Throws CmsException if something goes wrong.
public void writeProperties(Map propertyinfos,
int projectId,
CmsResource resource,
int resourceType)
throws CmsException
propertyinfos - A Hashtable with propertydefinition- property-pairs as strings.projectId - The id of the current project.resource - The CmsResource object of the resource that gets the properties.resourceType - The Type of the resource.
CmsException - Throws CmsException if operation was not succesful
public void writeProperties(Map propertyinfos,
int projectId,
CmsResource resource,
int resourceType,
boolean addDefinition)
throws CmsException
propertyinfos - A Hashtable with propertydefinition- property-pairs as strings.projectId - The id of the current project.resource - The CmsResource object of the resource that gets the properties.resourceType - The Type of the resource.addDefinition - If true then the propertydefinition is added if it not exists
CmsException - Throws CmsException if operation was not succesful
public void writeProperty(String meta,
int projectId,
String value,
CmsResource resource,
int resourceType,
boolean addDefinition)
throws CmsException
meta - The property-name of which the property has to be read.value - The value for the property to be set.resourceType - The Type of the resource.addDefinition - If true then the propertydefinition is added if it not exists
CmsException - Throws CmsException if operation was not succesful
public CmsPropertydefinition writePropertydefinition(CmsPropertydefinition propertyDef,
int projectId)
throws CmsException
CmsException - Throws CmsException if something goes wrong.
public Serializable writeSystemProperty(String name,
Serializable object)
throws CmsException
name - The name of the property.object - The property-object.
CmsException - Throws CmsException if something goes wrong.
public void writeSystemTaskLog(int taskid,
String comment)
throws CmsException
CmsException
public CmsTask writeTask(CmsTask task)
throws CmsException
task - The task that will be written.
CmsException - Throws CmsException if something goes wrong.
public void writeTaskLog(int taskId,
int userid,
Timestamp starttime,
String comment,
int type)
throws CmsException
starttime - Time when the log is created.comment - Description for the log.type - Type of the log. 0 = Sytem log, 1 = User Log
CmsException - Throws CmsException if something goes wrong.
public int writeTaskType(int autofinish,
int escalationtyperef,
String htmllink,
String name,
String permission,
int priorityref,
int roleref)
throws CmsException
CmsException - Throws CmsException if something goes wrong.
public void writeUser(CmsUser user)
throws CmsException
user - the user to write
thorws - CmsException if something goes wrong.
CmsException
public void changeLockedInProject(int newProjectId,
String resourcename)
throws CmsException
newProjectId - The new project-idresourcename - The name of the resource to change
CmsException
public void changeUserType(int userId,
int userType)
throws CmsException
userId - The id of the user to changeuserType - The new usertype of the user
CmsException
public Vector readResourcesLikeName(CmsProject project,
String resourcename)
throws CmsException
project - The project in which the resource will be used.resourcename - A part of the resourcename
CmsException - Throws CmsException if operation was not succesful
public Vector readFilesByType(int projectId,
int resourcetype)
throws CmsException
projectId - A project id for reading online or offline resourcesresourcetype - The type of the files.
CmsException - Throws CmsException if operation was not succesful
public int deleteBackups(long maxdate)
throws CmsException
maxdate - The date of the last version that should be remained after deleting
CmsExceptionprotected CmsQueries getQueries()
protected byte[] getBytesFromResultset(ResultSet res,
String columnName)
throws SQLException
res - The ResultSet to read fromcolumnName - The name of the column to read from
SQLException
protected void createFileContent(int fileId,
byte[] fileContent,
int versionId,
String usedPool,
String usedStatement)
throws CmsException
fileId - The ID of the new filefileContent - The content of the new fileversionId - For the content of a backup file you need to insert the versionId of the backupusedPool - The name of the databasepool to useusedStatement - Specifies which tables must be used: offline, online or backup
CmsException
protected void writeFileContent(int fileId,
byte[] fileContent,
String usedPool,
String usedStatement)
throws CmsException
fileId - The ID of the file to updatefileContent - The new content of the fileusedPool - The name of the database pool to useusedStatement - Specifies which tables must be used: offline, online or backup
CmsException
public int updateAllResourceFlags(CmsProject theProject,
int theValue)
throws CmsException
theProject - the resources in this project are updatedtheValue - the new int value of the resource fags attribute
CmsException
public int fetchAllVfsLinks(CmsProject theProject,
ArrayList theResourceIDs,
ArrayList theLinkContents,
ArrayList theLinkResources,
int theResourceTypeLinkID)
throws CmsException
theProject - the resources in this project are updatedtheResourceIDs - reference to an ArrayList where the ID's of the fetched links are storedtheLinkContents - reference to an ArrayList where the contents of the fetched links (= VFS resource names of the targets) are storedtheResourceTypeLinkID - reference to an ArrayList where the resource names of the fetched links are stored
CmsException
public int fetchResourceID(CmsProject theProject,
String theResourceName,
int skipResourceTypeID)
throws CmsException
theProject - the CmsProject where the resource is fetchedtheResourceName - the name of the resource for which we fetch it's IDskipResourceTypeID - targets of this resource type are ignored
CmsException
public int updateResourceFlags(CmsProject theProject,
int theResourceID,
int theValue)
throws CmsException
theProject - the CmsProject where the resource is updatedtheResourceID - the ID of the resource which is updatedtheValue - the new value of the resource flag attribute
CmsException
public ArrayList fetchVfsLinksForResourceID(CmsProject theProject,
int theResourceID,
int theResourceTypeLinkID)
throws CmsException
theProject - the current projecttheResourceID - the ID of the resource of which the VFS links are fetchedtheResourceTypeLinkID - the resource type ID of VFS links
CmsException
public int fetchResourceFlags(CmsProject theProject,
String theResourceName)
throws CmsException
theProject - the current project to choose the right SQL querytheResourceName - the name of the resource of which the resource flags are fetched
CmsException
protected long fetchDateFromResource(int theProjectId,
int theResourceId,
long theDefaultDate)
throws CmsException
CmsException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||