java.lang.Object | ||
↳ | com.microstrategy.utils.config.AbstractConfigurationElement | |
↳ | com.microstrategy.web.platform.ApplicationParameters |
This class represents the application parameters, typically configured through the "microstrategy.xml" file. This element has two children:
getParameter(String, String)
method therefore receives two arguments, the name of the parameter
and the name of the controller. If a parameter was specified for the given controller, it returns
that value; otherwise if the parameter was specified globally, it returns that value; if the
parameter is not found it returns null.
To provide backwards compability, if the "web.xml" is found inside the WEB-INF/ folder,
this class will also parse this file and use the init-parameters and context-parameters of this file. This behavior can
be turned off by passing false
in the constructor.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CONFIG_FILES_DEFAULT_LOCATION | Constant for the parameter's name that identifies the default configuration files location. | |||||||||
String | CONFIG_FILE_PATH | Constant for the parameter's name that identifies the page-config file location. | |||||||||
String | DTD_PATH | Constant for the parameter's name that identifies the dtd files location. | |||||||||
String | EVENTS_PATH | Constant for the parameter's name that identifies the events file location. | |||||||||
String | GLOBAL_NODE | ||||||||||
String | LOCALES_CONFIG_PATH | Constant for the parameter's name that identifies the locales.xml file location. | |||||||||
String | NODE_NAME | ||||||||||
String | STYLE_CATALOG_PATH | Constant for the parameter's name that identifies the style-catalog file location. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ApplicationParameters() | |||||||||||
ApplicationParameters(boolean useWebXmlParameters)
Createa a new instance and indicates whether to use parameters defined in /WEB-INF/web.xml
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ControllerInfoList |
getControllers()
Returns the list of controllers as defined in the xml file.
| ||||||||||
String |
getDTDsBasePath()
Returns the path to the folder where system dtd files, used to validate
xml files, is located.
| ||||||||||
String |
getEventsCatalogPath()
Returns the path for the events.xml file.
| ||||||||||
ParameterInfoList |
getGlobalParameters()
Returns the list of global parameters, i.e.
| ||||||||||
String |
getLocalesConfigPath()
Returns the path for the locales.xml file.
| ||||||||||
String |
getPageConfigPath(String controllerName)
Returns the path for the pageConfig file used by the given controller.
| ||||||||||
String |
getParameter(String parameterName, String controllerName)
Returns the value of the given parameter.
| ||||||||||
Enumeration |
getParameterNames(String controllerName)
Returns the complete list of parameters names for the given controller.
| ||||||||||
String |
getStyleCatalogPath()
Returns the path for the styleCatalog file.
| ||||||||||
void |
initFromWebXML(String webXmlPath)
Parses the web.xml for context-param and init-parameters.
| ||||||||||
void |
load(String fileName)
Extends load by making sure parameters of web.xml are also loaded if necessary.
| ||||||||||
String |
resolveConfigFilePath(String parameterName, String controllerName)
It reads the value of the given parameter in the given controller, and if necessary it prefixes it
with the config files base folder location.
| ||||||||||
void |
saveWebXMLAs(String newLocation)
This method saves the parameters found in the web.xml file into the given path
using the new xml structure.
| ||||||||||
boolean |
useWebXml()
Returns
true is this class will return values from the web.xml. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String |
getConfigFilesBaseFolder(String controllerName)
Returns the default location of configuration files based on the
CONFIG_FILES_DEFAULT_LOCATION
parameter value. | ||||||||||
String |
getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings;
if no single attribute can be used, return null and override the
getKey and
setKey methods. | ||||||||||
void |
initFromFile(String filePath, CustomizationInfo c)
Extends initFromFile by checking if the path is for the web.xml, if so, it calls
initFromWebXML, as parsing this file is different from the current implementation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constant for the parameter's name that identifies the default configuration files location.
Constant for the parameter's name that identifies the page-config file location.
Constant for the parameter's name that identifies the dtd files location.
Constant for the parameter's name that identifies the events file location.
Constant for the parameter's name that identifies the locales.xml file location.
Constant for the parameter's name that identifies the style-catalog file location.
Createa a new instance and indicates whether to use parameters defined in /WEB-INF/web.xml
Returns the list of controllers as defined in the xml file.
Returns the path to the folder where system dtd files, used to validate xml files, is located. It's equivalent to:
getParameter(DTD_PATH, null);
Returns the path for the events.xml file. It's equivalent to:
getConfigFilePath(EVENTS_PATH, null);
Returns the list of global parameters, i.e. parameters that apply to all controllers.
Returns the path for the locales.xml file. It's equivalent to:
getConfigFilePath(LOCALES_CONFIG_PATH, null);
Returns the path for the pageConfig file used by the given controller. It's equivalent to:
getConfigFilePath(CONFIG_FILE_PATH, controllerName);
Returns the value of the given parameter.
If a controllername is specified, it first checks if the parameter is defined
for this controller, if not it will return the value is defined for the global parameters.
If the parameter is not defined at either level (controller or global), it returns null.
Returns the complete list of parameters names for the given controller. The list also includes global parameters.
Returns the path for the styleCatalog file. It's equivalent to:
getConfigFilePath(STYLE_CATALOG_PATH, null);
Parses the web.xml for context-param and init-parameters.
ConfigException |
---|
Extends load by making sure parameters of web.xml are also loaded if necessary.
fileName | The path to the configuration file. This path will be resolved by the FileLoader
|
---|
ConfigException |
---|
It reads the value of the given parameter in the given controller, and if necessary it prefixes it with the config files base folder location. The following rules are applied:
null
is returned.
RELATIVE_PREFIX
, or the prefix ABSOLUTE_PREFIX
,
the parameter value is returned as is.
getConfigFilesBaseFolder(String)
value and
the parameter value.
This method saves the parameters found in the web.xml file into the given path using the new xml structure. It's only intended to use for upgrading from the old xml structure to the current.
ConfigException |
---|
Returns true
is this class will return values from the web.xml.
Returns the default location of configuration files based on the CONFIG_FILES_DEFAULT_LOCATION
parameter value. If the parameter is empty, it returns the root folder "/".
This method must return the attribute that uniquely identifies this element among its siblings;
if no single attribute can be used, return null and override the getKey
and
setKey
methods.
Extends initFromFile by checking if the path is for the web.xml, if so, it calls initFromWebXML, as parsing this file is different from the current implementation.
ConfigException |
---|