Package org.opencms.setup
Class CmsUpdateBean
java.lang.Object
org.opencms.setup.CmsSetupBean
org.opencms.setup.CmsUpdateBean
- All Implemented Interfaces:
org.opencms.main.I_CmsShellCommands
A java bean as a controller for the OpenCms update wizard.
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The empty jar marker attribute key.static final String
Folder constant name.protected int
The new logging offset in the database update thread.protected int
The old logging offset in the database update thread.Fields inherited from class org.opencms.setup.CmsSetupBean
ADDITIONAL_PREFIX, AS400_PROVIDER, COMPONENTS_PROPERTIES, DB2_PROVIDER, DEFAULT_POSITION, FOLDER_BACKUP, FOLDER_DATABASE, FOLDER_LIB, FOLDER_SETUP, GENERIC_PROVIDER, HSQLDB_PROVIDER, HTML_MESSAGE_FILE, m_availableModules, m_cms, m_components, m_installModules, m_logFile, m_moduleDependencies, m_moduleFilenames, m_modulesFolder, m_newLoggingOffset, m_oldLoggingOffset, m_webAppRfsPath, MAXDB_PROVIDER, MSSQL_PROVIDER, MYSQL_PROVIDER, ORACLE_PROVIDER, POSTGRESQL_PROVIDER, PROPKEY_CHECKED, PROPKEY_COMPONENT, PROPKEY_COMPONENTS, PROPKEY_DEPENDENCIES, PROPKEY_DESCRIPTION, PROPKEY_MODULES, PROPKEY_NAME, PROPKEY_POSITION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the subscription driver to the properties.boolean
checkOceeVersion
(String version) Compatibility check for OCEE modules.void
Creates the shared folder if possible.void
CmsShell command to delete spellcheck index.displayError
(String pathPrefix) Returns html code to display an error.protected String
Returns the admin Group.Returns the admin Pwd.Returns the admin User.Gets the folder for config files.double
Returns the detected mayor version, based on DB structure.Returns a map of all previously installed modules.Computes a list of modules which need to be removed before updating the other modules, e.g.List of modules to be updated.Returns the update database thread.Returns the update Project.Returns the update site.Returns the modules that does not need to be updated.Returns the workplace update thread.Gets the XML updater (lazily create it if it hasn't been created yet).Gets the folder for XML update files.Returns html for displaying a module selection box.void
Creates a new instance of the setup Bean.boolean
Returns the keep History parameter value.boolean
Returnstrue
if a DB update is needed.boolean
Checks whether the selected user and password are valid and the user has the ROOT_ADMIN role.void
Prepares step 1 of the update wizard.void
Prepares step 1 of the update wizard.void
prepareUpdateStep1bOutput
(javax.servlet.jsp.JspWriter out) Generates the output for step 1 of the setup wizard.void
Prepares step 5 of the update wizard.void
Prepares step 5 of the update wizard.void
prepareUpdateStep5bOutput
(javax.servlet.jsp.JspWriter out) Generates the output for the update wizard.void
Prepares step 6 of the update wizard.protected void
removeModule
(String moduleName, org.opencms.report.I_CmsReport report) Removes a module.protected void
setAdminGroup
(String adminGroup) Sets the admin Group.void
setAdminPwd
(String adminPwd) Sets the admin Pwd.void
setAdminUser
(String adminUser) Sets the admin User.void
setDetectedVersion
(double detectedVersion) Sets the detected mayor version.void
setKeepHistory
(boolean keepHistory) Sets the keep History parameter value.void
setPreserveLibModules
(String preserveLibModules) Sets the list of modules where the included libs should be preserved during update.void
setUpdateProject
(String updateProject) Sets the update Project.void
setUpdateSite
(String site) Sets the update site.void
void
void
Updates the JDBC driver class names.protected void
updateModule
(String moduleName, String importFile, org.opencms.report.I_CmsReport report) Imports a module (zipfile) from the default module directory, creating a temporary project for this.void
Installed all modules that have been set usingCmsSetupBean.setInstallModules(String)
.void
Fills the relations db tables during the update.Methods inherited from class org.opencms.setup.CmsSetupBean
addComponentsFromPath, backupConfiguration, buildDepsForAllComponents, checkEthernetAddress, clearCache, copyFile, displayErrors, getAvailableModules, getComponentModules, getComponents, getComponentsProperties, getConfigRfsPath, getContextPath, getDatabase, getDatabaseLibs, getDatabaseName, getDatabaseProperties, getDatabases, getDb, getDbConStrParams, getDbCreateConStr, getDbCreatePwd, getDbCreateUser, getDbDriver, getDbProperty, getDbTestQuery, getDbWorkConStr, getDbWorkPwd, getDbWorkUser, getDefaultContentEncoding, getDefaultWebApplication, getDisplayForModule, getErrors, getEthernetAddress, getExtProperty, getFullDatabaseKey, getHtmlForDbSelection, getHtmlHelpIcon, getHtmlPart, getHtmlPart, getLibFolder, getLogName, getModuleDependencies, getModuleFolder, getModulesToInstall, getPool, getProperties, getReplacer, getServerName, getServletConfig, getServletMapping, getSortedDatabases, getWebAppRfsPath, getWizardEnabled, getWorkplaceImportThread, getWorkplaceSite, getXmlHelper, hasIndexHtml, htmlComponent, htmlComponents, htmlModule, htmlModuleHelpDescriptions, importModuleFromDefault, importModulesFromSetupBean, init, init, initHtmlParts, initializeComponents, initShellCmsObject, isAutoMode, isChecked, isImportRunning, isInitialized, jsComponentDependencies, jsComponentModules, jsComponentNames, jsModuleDependencies, jsModuleNames, lockWizard, prepareStep10, prepareStep8, prepareStep8b, prepareStep8bOutput, readDatabaseConfig, saveProperties, saveProperties, setAutoMode, setDatabase, setDb, setDbConStrParams, setDbCreateConStr, setDbCreatePwd, setDbCreateUser, setDbDriver, setDbParamaters, setDbParamaters, setDbProperty, setDbWorkConStr, setDbWorkPwd, setDbWorkUser, setEthernetAddress, setExtProperty, setFullDatabaseKey, setInstallModules, setReplacer, setServerName, setStartView, setWorkplaceSite, sortModules, updateConfiguration, validateJdbc
-
Field Details
-
EMPTY_JAR_ATTRIBUTE_KEY
The empty jar marker attribute key.- See Also:
-
FOLDER_UPDATE
Folder constant name. -
m_newLoggingDBOffset
The new logging offset in the database update thread. -
m_oldLoggingDBOffset
The old logging offset in the database update thread.
-
-
Constructor Details
-
CmsUpdateBean
public CmsUpdateBean()Default constructor.
-
-
Method Details
-
addSubscriptionDriver
Adds the subscription driver to the properties. -
checkOceeVersion
Compatibility check for OCEE modules.- Parameters:
version
- the opencms version- Returns:
false
if OCEE is present but not compatible with opencms version
-
deleteSpellcheckIndex
CmsShell command to delete spellcheck index.Called by cmsupdate.ori to remove spellcheck index. Necessary because Solr/Lucene versions might have incompatible changes, and deleting the index causes the spellcheck index to be rebuilt.
-
displayError
Returns html code to display an error.- Overrides:
displayError
in classCmsSetupBean
- Parameters:
pathPrefix
- to adjust the path- Returns:
- html code
-
getAdminPwd
Returns the admin Pwd.- Returns:
- the admin Pwd
-
getAdminUser
Returns the admin User.- Returns:
- the admin User
-
getConfigFolder
Gets the folder for config files.- Returns:
- the folder for config files
-
getDetectedVersion
Returns the detected mayor version, based on DB structure.- Returns:
- the detected mayor version
-
getInstalledModules
Returns a map of all previously installed modules.- Returns:
- a map of
[String,
objectsCmsModuleVersion
] - See Also:
-
CmsModuleManager.getAllInstalledModules()
-
getModulesToUpdate
List of modules to be updated.- Returns:
- a list of module names
-
getUpdateDBThread
Returns the update database thread.- Returns:
- the update database thread
-
getUpdateProject
Returns the update Project.- Returns:
- the update Project
-
getUpdateSite
Returns the update site.- Returns:
- the update site
-
getUptodateModules
Returns the modules that does not need to be updated.- Returns:
- a list of module names
-
getWorkplaceUpdateThread
Returns the workplace update thread.- Returns:
- the workplace update thread
-
getXmlConfigUpdater
Gets the XML updater (lazily create it if it hasn't been created yet).- Returns:
- the XML updater
-
getXmlUpdateFolder
Gets the folder for XML update files.- Returns:
- the folder for XML update files
-
htmlModules
Description copied from class:CmsSetupBean
Returns html for displaying a module selection box.- Overrides:
htmlModules
in classCmsSetupBean
- Returns:
- html code
- See Also:
-
init
Creates a new instance of the setup Bean.- Overrides:
init
in classCmsSetupBean
- Parameters:
webAppRfsPath
- path to the OpenCms web applicationservletMapping
- the OpenCms servlet mappingdefaultWebApplication
- the name of the default web application
-
isKeepHistory
Returns the keep History parameter value.- Returns:
- the keep History parameter value
-
isNeedDbUpdate
Returnstrue
if a DB update is needed.- Returns:
true
if a DB update is needed
-
isValidUser
Checks whether the selected user and password are valid and the user has the ROOT_ADMIN role.- Returns:
true
if the selected user and password are valid and the user has the ROOT_ADMIN role
-
prepareUpdateStep1
Prepares step 1 of the update wizard. -
prepareUpdateStep1b
Prepares step 1 of the update wizard. -
prepareUpdateStep1bOutput
Generates the output for step 1 of the setup wizard.- Parameters:
out
- the JSP print stream- Throws:
IOException
- in case errors occur while writing to "out"
-
prepareUpdateStep5
Prepares step 5 of the update wizard. -
prepareUpdateStep5b
Prepares step 5 of the update wizard. -
prepareUpdateStep5bOutput
Generates the output for the update wizard.- Parameters:
out
- the JSP print stream- Throws:
IOException
- in case errors occur while writing to "out"
-
prepareUpdateStep6
Prepares step 6 of the update wizard. -
setAdminPwd
Sets the admin Pwd.- Parameters:
adminPwd
- the admin Pwd to set
-
setAdminUser
Sets the admin User.- Parameters:
adminUser
- the admin User to set
-
setDetectedVersion
Sets the detected mayor version.- Parameters:
detectedVersion
- the value to set
-
setKeepHistory
Sets the keep History parameter value.- Parameters:
keepHistory
- the keep History parameter value to set
-
setPreserveLibModules
Sets the list of modules where the included libs should be preserved during update.Called from step_5_update_modules.jsp.
- Parameters:
preserveLibModules
- the comma separated list of module names
-
setUpdateProject
Sets the update Project.- Parameters:
updateProject
- the update Project to set
-
setUpdateSite
Sets the update site.- Parameters:
site
- the update site to set
-
shellExit
- Specified by:
shellExit
in interfaceorg.opencms.main.I_CmsShellCommands
- Overrides:
shellExit
in classCmsSetupBean
- See Also:
-
I_CmsShellCommands.shellExit()
-
shellStart
- Specified by:
shellStart
in interfaceorg.opencms.main.I_CmsShellCommands
- Overrides:
shellStart
in classCmsSetupBean
- See Also:
-
I_CmsShellCommands.shellStart()
-
updateDBDriverProperties
Updates the JDBC driver class names.Needs to be executed before any database access.
-
updateModulesFromUpdateBean
Installed all modules that have been set usingCmsSetupBean.setInstallModules(String)
.This method is invoked as a shell command.
- Throws:
Exception
- if something goes wrong
-
updateRelations
Fills the relations db tables during the update.- Throws:
Exception
- if something goes wrong
-
getAdminGroup
Returns the admin Group.- Returns:
- the admin Group
-
getModulesToDelete
Computes a list of modules which need to be removed before updating the other modules, e.g. because of resource type conflicts.- Returns:
- the list of names of modules which need to be removed
-
removeModule
protected void removeModule(String moduleName, org.opencms.report.I_CmsReport report) throws org.opencms.main.CmsException Removes a module.- Parameters:
moduleName
- the name of the module to removereport
- the report to write to- Throws:
org.opencms.main.CmsException
- in case something goes wrong
-
setAdminGroup
Sets the admin Group.- Parameters:
adminGroup
- the admin Group to set
-
updateModule
protected void updateModule(String moduleName, String importFile, org.opencms.report.I_CmsReport report) throws Exception Imports a module (zipfile) from the default module directory, creating a temporary project for this.- Parameters:
moduleName
- the name of the module to replaceimportFile
- the name of the import .zip file located in the update module directoryreport
- the shell report to write the output- Throws:
Exception
- if something goes wrong- See Also:
-
CmsImportExportManager.importData(org.opencms.file.CmsObject, I_CmsReport, org.opencms.importexport.CmsImportParameters)
-