public abstract class

AbstractXMLConfigModule

extends AbstractModule
java.lang.Object
   ↳ com.microstrategy.web.app.utils.upgrade.AbstractModule
     ↳ com.microstrategy.web.app.utils.upgrade.AbstractXMLConfigModule
Known Direct Subclasses

Class Overview

Extends AbstractModule by providing specific support to upgrade xml configuration files. This files have to use the AbstractConfigurationElement to parse the file's content in order to be upgraded by this class.

Running this module involves three main tasks:

  1. Calculate deltas: Loads the base xml definition, and the customized xml definition and calculates differences.
  2. Process deltas: If necessary the module can read through the differences and do further changes to ensure the new xml will follow new best practices.
  3. Save deltas: Once deltas have been calculated and process, they will be saved as part of a plugin

The location of all xml configuration files is specified through a parameter in the web.xml, subclasses need to implement initParameterName() to identify the name of such parameter.

Summary

Public Constructors
AbstractXMLConfigModule(UpgradeManager manager)
Default constructor.
Public Methods
void run(UpgradeInfo info)
It checks in the target application for the value of the initParameterName() to see if it's defined (globally and on every controller); whenever the value is defined, it calls processConfigFile(String) to process the correspoding configuration file.
Protected Methods
AbstractConfigurationElement calculateDeltas(AbstractConfigurationElement base, AbstractConfigurationElement custom)
Calculate deltas between the base and the custom element.
String calculateNewPath(String path, String newRelativePath)
Returns the new relative path for the given file, as should be defined in Microstrategy Web.
abstract Class elementClass()
Subclasses must implement this method to identify the AbstractConfigurationElement class that represents the root node of the xml.
AbstractConfigurationElement getBaseElement(String controllerName)
Returns the AbstractConfigurationElement as defined in the base Microstrategy Web installation.
AbstractConfigurationElement getCustomElement(String controllerName)
Returns the AbstractConfigurationElement as defined in the customized Microstrategy Web version.
UpgradeInfo getUpgradeInfo()
abstract String initParameterName()
Subclasses must implement this method to identify the name of the init-parameter that defines the location of the xml configuration file.
void processConfigFile(String controllerName)
Process the configuration file for the given controllerName.
AbstractConfigurationElement processDeltas(AbstractConfigurationElement deltas)
Modifies deltas so in the new plugin they reflect Microstrategy's recommended best practices.
AbstractConfigurationElement saveDeltas(AbstractConfigurationElement deltas)
Saves deltas into the plugin folder.
[Expand]
Inherited Methods
From class com.microstrategy.web.app.utils.upgrade.AbstractModule
From class java.lang.Object
From interface com.microstrategy.web.app.utils.upgrade.UpgradeModule

Public Constructors

public AbstractXMLConfigModule (UpgradeManager manager)

Default constructor. Receives the UpgradeManager instantiating this AbstractModule.

Public Methods

public void run (UpgradeInfo info)

It checks in the target application for the value of the initParameterName() to see if it's defined (globally and on every controller); whenever the value is defined, it calls processConfigFile(String) to process the correspoding configuration file.

Parameters
info upgrade information.

Protected Methods

protected AbstractConfigurationElement calculateDeltas (AbstractConfigurationElement base, AbstractConfigurationElement custom)

Calculate deltas between the base and the custom element. If equals, it returns null;

protected String calculateNewPath (String path, String newRelativePath)

Returns the new relative path for the given file, as should be defined in Microstrategy Web. This file is also marked as processed in the upgrade-manager so it gets copied to the correct new relative location when copying files.

Parameters
path The path of the file being processed. This path needs to point to an existing file.
newRelativePath The path relative to the customization's root folder where the file will be placed when upgrade is complete
Returns
  • a relative path that locates the file within Microstrategy Web in the target plugin folder.

protected abstract Class elementClass ()

Subclasses must implement this method to identify the AbstractConfigurationElement class that represents the root node of the xml.

protected AbstractConfigurationElement getBaseElement (String controllerName)

Returns the AbstractConfigurationElement as defined in the base Microstrategy Web installation. Returns an empty object if the parameter is not defined in the base Microstrategy Web version.

protected AbstractConfigurationElement getCustomElement (String controllerName)

Returns the AbstractConfigurationElement as defined in the customized Microstrategy Web version. Returns an empty object if the parameter is not defined in this version.

protected UpgradeInfo getUpgradeInfo ()

protected abstract String initParameterName ()

Subclasses must implement this method to identify the name of the init-parameter that defines the location of the xml configuration file.

protected void processConfigFile (String controllerName)

Process the configuration file for the given controllerName. It calculate deltas from the base-element and the custom-element (as specified by the parameter value for this controller), modifies the deltas as necessary and then saves them in the corresponding plugin folder. If both elements are equal, it returns with no further changes.

protected AbstractConfigurationElement processDeltas (AbstractConfigurationElement deltas)

Modifies deltas so in the new plugin they reflect Microstrategy's recommended best practices.

protected AbstractConfigurationElement saveDeltas (AbstractConfigurationElement deltas)

Saves deltas into the plugin folder.