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
public class CmsUpdateDBCmsUsers extends A_CmsUpdateDBPart
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
Fields Modifier and Type Field Description protected static java.lang.String
QUERY_CREATE_TABLE_USERDATA
Constant for the query to create the user data table.protected static java.lang.String
QUERY_INSERT_CMS_USERDATA
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 Constructor Description CmsUpdateDBCmsUsers()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
removeUnnecessaryColumns(CmsSetupDb dbCon)
Removes the columns USER_INFO, USER_ADDRESS, USER_DESCRIPTION and USER_TYPE from the CMS_USERS table.protected void
writeAdditionalUserInfo(CmsSetupDb dbCon, java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> additionalInfo)
Writes the additional user infos to the database.protected void
writeUserInfo(CmsSetupDb dbCon, java.lang.String id, java.lang.String key, java.lang.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 Detail
-
QUERY_CREATE_TABLE_USERDATA
protected static final java.lang.String QUERY_CREATE_TABLE_USERDATA
Constant for the query to create the user data table.- See Also:
- Constant Field Values
-
QUERY_INSERT_CMS_USERDATA
protected static final java.lang.String QUERY_INSERT_CMS_USERDATA
Constant for the query to insert the new user data into the new table CMS_USERDATA.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsUpdateDBCmsUsers
public CmsUpdateDBCmsUsers() throws java.io.IOException
Default constructor.- Throws:
java.io.IOException
- if the default sql queries property file could not be read
-
-
Method Detail
-
internalExecute
protected void internalExecute(CmsSetupDb dbCon)
Description copied from class:A_CmsUpdateDBPart
Does the hard work.- Specified by:
internalExecute
in classA_CmsUpdateDBPart
- Parameters:
dbCon
- the db connection interface- See Also:
A_CmsUpdateDBPart.internalExecute(org.opencms.setup.CmsSetupDb)
-
addUserDateCreated
protected void addUserDateCreated(CmsSetupDb dbCon) throws java.sql.SQLException
Adds the new column USER_DATECREATED to the CMS_USERS table.- Parameters:
dbCon
- the db connection interface- Throws:
java.sql.SQLException
- if something goes wrong
-
addWebusersToGroup
protected void addWebusersToGroup(CmsSetupDb dbCon, org.opencms.util.CmsUUID id) throws java.sql.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:
java.sql.SQLException
- if something goes wrong
-
checkUserDataTable
protected boolean checkUserDataTable(CmsSetupDb dbCon)
Checks if the CMS_USERDATA table exists.- Parameters:
dbCon
- the db connection interface- Returns:
- true if it exists, false if not.
-
createUserDataTable
protected void createUserDataTable(CmsSetupDb dbCon) throws java.sql.SQLException
Creates the CMS_USERDATA table if it does not exist yet.- Parameters:
dbCon
- the db connection interface- Throws:
java.sql.SQLException
- if soemthing goes wrong
-
createWebusersGroup
protected org.opencms.util.CmsUUID createWebusersGroup(CmsSetupDb dbCon) throws java.sql.SQLException
creates a new group for the webusers.- Parameters:
dbCon
- the db connection interface- Returns:
- the id of the new generated group
- Throws:
java.sql.SQLException
- if something goes wrong
-
removeUnnecessaryColumns
protected void removeUnnecessaryColumns(CmsSetupDb dbCon) throws java.sql.SQLException
Removes the columns USER_INFO, USER_ADDRESS, USER_DESCRIPTION and USER_TYPE from the CMS_USERS table.- Parameters:
dbCon
- the db connection interface- Throws:
java.sql.SQLException
- if something goes wrong
-
writeAdditionalUserInfo
protected void writeAdditionalUserInfo(CmsSetupDb dbCon, java.lang.String id, java.util.Map<java.lang.String,java.lang.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
protected void writeUserInfo(CmsSetupDb dbCon, java.lang.String id, java.lang.String key, java.lang.Object value)
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
-
-