Package org.opencms.setup.db.update6to7
Class CmsUpdateDBCmsUsers
java.lang.Object
org.opencms.setup.db.A_CmsUpdateDBPart
org.opencms.setup.db.update6to7.CmsUpdateDBCmsUsers
- All Implemented Interfaces:
I_CmsUpdateDBPart
- Direct Known Subclasses:
CmsUpdateDBCmsUsers
,CmsUpdateDBCmsUsers
,CmsUpdateDBCmsUsers
This class makes an update of the CMS_USERS table splitting it up into CMS_USERS and CMS_USERDATA.
Unnecessary colums from CMS_USERS will be deleted and the new column USER_DATECREATED is added.
- Since:
- 7.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
Constant for the query to create the user data table.protected static final String
Constant for the query to insert the new user data into the new table CMS_USERDATA.Fields inherited from class org.opencms.setup.db.A_CmsUpdateDBPart
m_poolData, m_queries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addUserDateCreated
(CmsSetupDb dbCon) Adds the new column USER_DATECREATED to the CMS_USERS table.protected void
addWebusersToGroup
(CmsSetupDb dbCon, org.opencms.util.CmsUUID id) Adds all webusers to the new previously created webusers group.protected boolean
checkUserDataTable
(CmsSetupDb dbCon) Checks if the CMS_USERDATA table exists.protected void
createUserDataTable
(CmsSetupDb dbCon) Creates the CMS_USERDATA table if it does not exist yet.protected org.opencms.util.CmsUUID
createWebusersGroup
(CmsSetupDb dbCon) creates a new group for the webusers.protected void
internalExecute
(CmsSetupDb dbCon) Does the hard work.protected void
Removes the columns USER_INFO, USER_ADDRESS, USER_DESCRIPTION and USER_TYPE from the CMS_USERS table.protected void
writeAdditionalUserInfo
(CmsSetupDb dbCon, String id, Map<String, Object> additionalInfo) Writes the additional user infos to the database.protected void
writeUserInfo
(CmsSetupDb dbCon, String id, String key, Object value) Writes one set of additional user info (key and its value) to the CMS_USERDATA table.Methods inherited from class org.opencms.setup.db.A_CmsUpdateDBPart
execute, getPoolData, getPropertyFileLocation, isKeepHistory, loadQueryProperties, readQuery
-
Field Details
-
QUERY_CREATE_TABLE_USERDATA
Constant for the query to create the user data table.- See Also:
-
QUERY_INSERT_CMS_USERDATA
Constant for the query to insert the new user data into the new table CMS_USERDATA.- See Also:
-
-
Constructor Details
-
CmsUpdateDBCmsUsers
Default constructor.- Throws:
IOException
- if the default sql queries property file could not be read
-
-
Method Details
-
internalExecute
Description copied from class:A_CmsUpdateDBPart
Does the hard work.- Specified by:
internalExecute
in classA_CmsUpdateDBPart
- Parameters:
dbCon
- the db connection interface- See Also:
-
addUserDateCreated
Adds the new column USER_DATECREATED to the CMS_USERS table.- Parameters:
dbCon
- the db connection interface- Throws:
SQLException
- if something goes wrong
-
addWebusersToGroup
protected void addWebusersToGroup(CmsSetupDb dbCon, org.opencms.util.CmsUUID id) throws SQLException Adds all webusers to the new previously created webusers group.- Parameters:
dbCon
- the db connection interfaceid
- the id of the new webusers group- Throws:
SQLException
- if something goes wrong
-
checkUserDataTable
Checks if the CMS_USERDATA table exists.- Parameters:
dbCon
- the db connection interface- Returns:
- true if it exists, false if not.
-
createUserDataTable
Creates the CMS_USERDATA table if it does not exist yet.- Parameters:
dbCon
- the db connection interface- Throws:
SQLException
- if soemthing goes wrong
-
createWebusersGroup
creates a new group for the webusers.- Parameters:
dbCon
- the db connection interface- Returns:
- the id of the new generated group
- Throws:
SQLException
- if something goes wrong
-
removeUnnecessaryColumns
Removes the columns USER_INFO, USER_ADDRESS, USER_DESCRIPTION and USER_TYPE from the CMS_USERS table.- Parameters:
dbCon
- the db connection interface- Throws:
SQLException
- if something goes wrong
-
writeAdditionalUserInfo
protected void writeAdditionalUserInfo(CmsSetupDb dbCon, String id, Map<String, Object> additionalInfo) Writes the additional user infos to the database.- Parameters:
dbCon
- the db connection interfaceid
- the user idadditionalInfo
- the additional info of the user
-
writeUserInfo
Writes one set of additional user info (key and its value) to the CMS_USERDATA table.- Parameters:
dbCon
- the db connection interfaceid
- the user idkey
- the data keyvalue
- the data value
-