org.opencms.setup.update6to7.generic
Class CmsUpdateDBCmsUsers

java.lang.Object
  extended by org.opencms.setup.update6to7.A_CmsUpdateDBPart
      extended by org.opencms.setup.update6to7.generic.CmsUpdateDBCmsUsers
All Implemented Interfaces:
I_CmsUpdateDBPart
Direct Known Subclasses:
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
Version:
$Revision: 1.2 $
Author:
Roland Metzler

Field Summary
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.update6to7.A_CmsUpdateDBPart
m_poolData, m_queries, QUERY_PROPERTIES_PREFIX
 
Constructor Summary
CmsUpdateDBCmsUsers()
          Default constructor.
 
Method Summary
protected  void createUserDataTable(CmsSetupDb dbCon)
          Creates the CMS_USERDATA table if it does not exist yet.
 void internalExecute(CmsSetupDb dbCon)
          Does the hard work.
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.update6to7.A_CmsUpdateDBPart
execute, getDbInstance, getPoolData, isKeepHistory, loadQueryProperties, readQuery, setPoolData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

public void internalExecute(CmsSetupDb dbCon)
Description copied from class: A_CmsUpdateDBPart
Does the hard work.

Specified by:
internalExecute in class A_CmsUpdateDBPart
Parameters:
dbCon - the db connection interface
See Also:
A_CmsUpdateDBPart.internalExecute(org.opencms.setup.CmsSetupDb)

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

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 interface
id - the user id
key - the data key
value - the data value