Class AbstractXMLConfigModule

  • All Implemented Interfaces:
    UpgradeModule
    Direct Known Subclasses:
    LocalesModule, PageConfigsModule, StyleCatalogModule

    public abstract class AbstractXMLConfigModule
    extends AbstractModule

    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.

    Since:
    MicroStrategy Web 9.0.0
    • Constructor Detail

      • AbstractXMLConfigModule

        public AbstractXMLConfigModule​(UpgradeManager manager)
        Default constructor. Receives the UpgradeManager instantiating this AbstractModule.
    • Method Detail

      • processConfigFile

        protected void processConfigFile​(java.lang.String controllerName)
                                  throws UpgradeException
        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.
        Throws:
        UpgradeException
      • getUpgradeInfo

        protected UpgradeInfo getUpgradeInfo()
      • getBaseElement

        protected AbstractConfigurationElement getBaseElement​(java.lang.String controllerName)
                                                       throws ConfigException
        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.
        Throws:
        ConfigException
      • getCustomElement

        protected AbstractConfigurationElement getCustomElement​(java.lang.String controllerName)
                                                         throws ConfigException
        Returns the AbstractConfigurationElement as defined in the customized Microstrategy Web version. Returns an empty object if the parameter is not defined in this version.
        Throws:
        ConfigException
      • calculateNewPath

        protected java.lang.String calculateNewPath​(java.lang.String path,
                                                    java.lang.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.
      • elementClass

        protected abstract java.lang.Class elementClass()
        Subclasses must implement this method to identify the AbstractConfigurationElement class that represents the root node of the xml.
      • initParameterName

        protected abstract java.lang.String initParameterName()
        Subclasses must implement this method to identify the name of the init-parameter that defines the location of the xml configuration file.