Package com.microstrategy.web.controller
Class ControllerHelper
- java.lang.Object
-
- com.microstrategy.web.controller.ControllerHelper
-
public class ControllerHelper extends java.lang.Object
- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ControllerHelper.BlockLibraryInfo
A simple class that records information about the Block Library loaded into the BlockFactory.
-
Constructor Summary
Constructors Constructor Description ControllerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
dispenseWebAPIErrorProperties(AppContext appContext)
Initialize web API error properties.static java.lang.String
filterQueryStringForRedirectOnLogin(java.lang.String queryString)
static Preferences
getAdminPrefs()
Return a instance of system administratorPreferences
.static java.lang.String
getDefaultPreference(java.lang.String key)
static java.lang.String
getLocalesXMLPath(AppContext appContext)
Resolve and return the full path to the locales.xml file.static java.lang.String
getRequiredParameter(AppContext appContext, java.lang.String name)
Retrieve the configuration parameter.static boolean
getSessionCookieUsage(Preferences adminPrefs)
Return whether uses session cookies as a system admin preferences.static void
handleBinaryPage(ContainerServices cs, PageComponent page)
Handle binary page by generating the content of the binary page back to client browser.static void
initializeAppEventHandlers(AppContext appContext, java.lang.String paramName)
Deprecated.although still honored, the appBeanEventsFile should not be used anymore.static ControllerHelper.BlockLibraryInfo
initializeBlockFactory(AppContext appContext, java.lang.String paramName)
Initialize the Block Factory with the library to be used by the application.static BrowserSettings
initializeBrowserSettings(PageManager pageMgr, Preferences adminPrefs, ContainerServices cs)
Create and initialize a BrowserSetting object.static void
initializeCacheConfig(AppContext appContext)
Initialize by reading and configuring theCacheRegistry
from cache configuration properties file.static void
initializeClientLog(AppContext appContext, java.lang.String levelParam, java.lang.String modeParam, java.lang.String typeParam, java.lang.String fileParam, java.lang.String pageParam, java.lang.String formParam)
Initialize and set up client logging system.static void
initializeCustomLogging(AppContext appContext)
Initialize the custom logging for the application.static void
initializeDefaultLogging(AppContext appContext, java.lang.String paramPropertiesFile, java.lang.String resourceName, java.lang.String paramFilesDefaultLocation)
Initialize the default logging system.static DynamicMenus
initializeDynamicMenus(AppContext appContext, java.lang.String paramName)
Deprecated.DynamicMenus should be retrieved from pageConfig.static PageComponent
initializeErrorPage(AppContext appContext, WebComponent servletWebComponent)
Deprecated.It is not used anywhere in the application.static void
initializeExternalSecurityClass(AppContext appContext, java.lang.String paramName)
Deprecated.This method is not used anyrmore, theinitializeExternalSecurityComponent(com.microstrategy.web.app.beans.AppContext)
will now throw an Exception if the external security parameter is specified and the corresponding class cannot be instantiated.static ExternalSecurity
initializeExternalSecurityComponent(AppContext appContext)
Create and initialize a external security component.static WebFeatures
initializeFeatures(AppContext appContext)
Create and initialize the globabl feature.static void
initializeFormatPropertiesMapping(AppContext appContext)
Initialize and read in the formatting properties mapping information from formatting properties configuration file.static void
initializeFormatter(AppContext appContext)
Initialize the formatter by reading in format information for various locales from formatting configuration file.static void
initializeJavaScriptDependencyAnalyzer(AppContext appContext)
static MessagesManager
initializeMessagesManager(AppContext appContext, java.lang.String paramName)
Initialize the messages manager from the configuration file specified by the parameter.static void
initializeObjBrowserFolderLinks(AppContext appContext)
Deprecated.This is method is not used anymore.static PageManager
initializePageManager(AppContext appContext, java.lang.String paramName)
Deprecated.The PageManager needs not initialized anystatic PageManager
initializePageManager(AppContext appContext, java.lang.String paramName, java.lang.String resourceName)
Deprecated.The PageManager needs not initialized anystatic void
initializePrefsGroups(AppContext appContext, java.lang.String paramName)
static RequestKeys
initializeRequestKeys(ContainerServices cs)
Create and initialize a new request keys.static void
initializeSDKEventHandlers(AppContext appContext, java.lang.String paramName)
Deprecated.although still honored, the mdBeanEventsFile should not be used anymore.static ServletWebComponent
initializeServletWebComponent(AppContext appContext, Preferences adminPrefs, java.lang.String name)
Create and initialize aServletWebComponent
.static void
initializeSSL(AppContext appContext)
static void
initializeStdOutRedirect(AppContext appContext)
static StyleCatalog
initializeStyleCatalog(AppContext appContext, java.lang.String paramName, java.lang.String resourceName)
Deprecated.The StyleCatalog needs not to be initialized anystatic void
initializeSubscriptionSetup(AppContext appContext, java.lang.String engineParam, java.lang.String portalParam, java.lang.String apiParam, java.lang.String apiTemplateParam, java.lang.String folderParam)
Initialize and set up subscription from configuration file.static void
initializeSysAdminPrefs(AppContext appContext, java.lang.String paramName)
Initialize the system administrator preferences by making sure there is a copy of definition file at the location specified by the parameter.static void
initializeSysServerDefaultPrefs(AppContext appContext, java.lang.String paramName)
Initialize the admin setting preferences configuration file specified by a parameter.static void
initializeWidgetFactory(AppContext appContext, java.lang.String paramName)
Deprecated.UseinitializeBlockFactory(AppContext, String)
instead.static boolean
isCookiesEnabled(Preferences adminPrefs)
Deprecated.- Cookies should always be enabled nowstatic boolean
isIframeJSPValid(AppContext appContext, java.lang.String paramName, java.lang.String resourceName)
static org.w3c.dom.Document
loadConfigDocument(AppContext appContext, java.lang.String name)
Load and return the configuration document specified by a parameter.static void
reloadLoggingProperties()
Reload logging properties.static java.lang.String
resolveFilePathParameter(AppContext appContext, java.lang.String defaultFile, java.lang.String paramName)
Resolve and return the full path of the file specified by a parameter.static java.lang.String
resolveLogPathParameter(AppContext appContext, java.lang.String defaultFile, java.lang.String paramName)
Resolve and return the log path value based on parameter value.static void
savePreferences(AppContext appContext, Preferences adminPrefs, PageComponent page)
Save system admin preferences to persistent storage.static void
saveSessionManager(AppContext appContext, boolean useSessionCookie, java.lang.String sessKey)
Save session manager state to either session attribute or to client cookie identified by the key.static void
setEncryption(Preferences adminPrefs)
Set up whether to use encryption forWebClusterAdmin
by reading from system admin preferences.static boolean
shouldRedirectOnLogin()
Redirect on Login Failure (DE127390) Use default value if unable to retrieve preference
-
-
-
Method Detail
-
filterQueryStringForRedirectOnLogin
public static java.lang.String filterQueryStringForRedirectOnLogin(java.lang.String queryString)
-
getRequiredParameter
public static java.lang.String getRequiredParameter(AppContext appContext, java.lang.String name)
Retrieve the configuration parameter.- Parameters:
appContext
- Application Contextname
- The name of the target parameter- Returns:
- The parameter value
-
loadConfigDocument
public static org.w3c.dom.Document loadConfigDocument(AppContext appContext, java.lang.String name) throws WebAppException
Load and return the configuration document specified by a parameter.- Parameters:
appContext
- Application Contextname
- The name of the parameter- Returns:
- Document object
- Throws:
WebAppException
-
initializeCustomLogging
public static void initializeCustomLogging(AppContext appContext)
Initialize the custom logging for the application.Custom logger.properties is required to be added to file
mstrExternalConfigurationFileAllowList
in current Web application classpath.- Parameters:
appContext
- application context object
-
initializeDefaultLogging
public static void initializeDefaultLogging(AppContext appContext, java.lang.String paramPropertiesFile, java.lang.String resourceName, java.lang.String paramFilesDefaultLocation)
Initialize the default logging system.- Parameters:
appContext
- application context objectparamPropertiesFile
- ParresourceName
-paramFilesDefaultLocation
-
-
reloadLoggingProperties
public static void reloadLoggingProperties()
Reload logging properties.- Since:
- MicroStrategy Web 8.0.0
-
initializeSysAdminPrefs
public static void initializeSysAdminPrefs(AppContext appContext, java.lang.String paramName)
Initialize the system administrator preferences by making sure there is a copy of definition file at the location specified by the parameter.- Parameters:
appContext
- application context objectparamName
- Parameter Name
-
initializePrefsGroups
public static void initializePrefsGroups(AppContext appContext, java.lang.String paramName)
-
initializeFormatter
public static void initializeFormatter(AppContext appContext)
Initialize the formatter by reading in format information for various locales from formatting configuration file.- Parameters:
appContext
- application context object
-
initializeFormatPropertiesMapping
public static void initializeFormatPropertiesMapping(AppContext appContext)
Initialize and read in the formatting properties mapping information from formatting properties configuration file.- Since:
- MicroStrategy Web 8.0.0
-
initializeObjBrowserFolderLinks
public static void initializeObjBrowserFolderLinks(AppContext appContext)
Deprecated.This is method is not used anymore. Object browser folder links can now be accessed through the Page configuration.- Since:
- MicroStrategy Web 8.0.0
-
initializeCacheConfig
public static void initializeCacheConfig(AppContext appContext)
Initialize by reading and configuring theCacheRegistry
from cache configuration properties file.- Parameters:
appContext
- application context object
-
initializeSysServerDefaultPrefs
public static void initializeSysServerDefaultPrefs(AppContext appContext, java.lang.String paramName)
Initialize the admin setting preferences configuration file specified by a parameter.- Parameters:
appContext
- application context objectparamName
- the name of the parameter to be read
-
initializePageManager
public static PageManager initializePageManager(AppContext appContext, java.lang.String paramName, java.lang.String resourceName)
Deprecated.The PageManager needs not initialized anyThis method has been deprecated. The PageManager is now cached through the ConfigurationFilesCache which is responsible for loading, initializing and applying customizations. The AppContext will get the PageManager instance directly from the Cache so the controller needs not to call this method to initialize it.
To get the instance of the pageManager from the cache:
_pageManager = (PageManager) ConfigurationFilesCache.getConfiguration(path, PageManager.class);
-
initializePageManager
public static PageManager initializePageManager(AppContext appContext, java.lang.String paramName)
Deprecated.The PageManager needs not initialized anyThis method has been deprecated. The PageManager is now cached through the ConfigurationFilesCache which is responsible for loading, initializing and applying customizations. The AppContext will get the PageManager instance directly from the Cache so the controller needs not to call this method to initialize it.
To get the instance of the pageManager from the cache:
_pageManager = (PageManager) ConfigurationFilesCache.getConfiguration(path, PageManager.class);
-
initializeDynamicMenus
public static DynamicMenus initializeDynamicMenus(AppContext appContext, java.lang.String paramName)
Deprecated.DynamicMenus should be retrieved from pageConfig.- See Also:
PageManager.getDynamicMenus()
-
initializeMessagesManager
public static MessagesManager initializeMessagesManager(AppContext appContext, java.lang.String paramName)
Initialize the messages manager from the configuration file specified by the parameter.- Parameters:
appContext
- application context objectparamName
- the name of the parameter- Returns:
- MessagesManager
-
initializeWidgetFactory
public static void initializeWidgetFactory(AppContext appContext, java.lang.String paramName)
Deprecated.UseinitializeBlockFactory(AppContext, String)
instead.Initialize the Blocks used by the application.- Parameters:
appContext
- TheAppContext
instance necessary for initialization.paramName
- The name of the init parameter that defines the Block Library path.- Since:
- MicroStrategy Web 9.0.0
-
initializeBlockFactory
public static ControllerHelper.BlockLibraryInfo initializeBlockFactory(AppContext appContext, java.lang.String paramName)
Initialize the Block Factory with the library to be used by the application.- Parameters:
appContext
- TheAppContext
instance necessary for initialization.paramName
- The name of the init parameter that defines the Block Library path.- Returns:
- A
ControllerHelper.BlockLibraryInfo
object that holds information about the library. - Since:
- MicroStrategy Web 8.1.0
-
initializeAppEventHandlers
public static void initializeAppEventHandlers(AppContext appContext, java.lang.String paramName)
Deprecated.although still honored, the appBeanEventsFile should not be used anymore. You can change the eventsFile instaed.Initializes app Eventhandler factory using the value of the given parameter.- See Also:
AppEventHandlerFactory
-
initializeSDKEventHandlers
public static void initializeSDKEventHandlers(AppContext appContext, java.lang.String paramName)
Deprecated.although still honored, the mdBeanEventsFile should not be used anymore. You can change the eventsFile instaed.Initializes SDK Eventhandler factory using the value of the given parameter.- See Also:
WebEventHandlerFactory
-
initializeStyleCatalog
public static StyleCatalog initializeStyleCatalog(AppContext appContext, java.lang.String paramName, java.lang.String resourceName)
Deprecated.The StyleCatalog needs not to be initialized anyThis method has been deprecated. The StyleCatalog is now cached through the ConfigurationFilesCache which is responsible for loading, initializing and applying customizations. The AppContext will get the StyleCatalog instance directly from the Cache so the controller needs not to call this method to initialize it.
To get the instance of the pageManager from the cache:
_styleCatalog = (StyleCatalog) ConfigurationFilesCache.getConfiguration(path, StyleCatalogImpl.class);
-
isIframeJSPValid
public static boolean isIframeJSPValid(AppContext appContext, java.lang.String paramName, java.lang.String resourceName)
- Since:
- MicroStrategy Web 8.0.0
-
initializeExternalSecurityClass
public static void initializeExternalSecurityClass(AppContext appContext, java.lang.String paramName)
Deprecated.This method is not used anyrmore, theinitializeExternalSecurityComponent(com.microstrategy.web.app.beans.AppContext)
will now throw an Exception if the external security parameter is specified and the corresponding class cannot be instantiated.- Since:
- MicroStrategy Web 8.0.0
-
initializeSubscriptionSetup
public static void initializeSubscriptionSetup(AppContext appContext, java.lang.String engineParam, java.lang.String portalParam, java.lang.String apiParam, java.lang.String apiTemplateParam, java.lang.String folderParam)
Initialize and set up subscription from configuration file.- Parameters:
appContext
- application context objectengineParam
-portalParam
-apiParam
-apiTemplateParam
-folderParam
-
-
initializeClientLog
public static void initializeClientLog(AppContext appContext, java.lang.String levelParam, java.lang.String modeParam, java.lang.String typeParam, java.lang.String fileParam, java.lang.String pageParam, java.lang.String formParam)
Initialize and set up client logging system.- Parameters:
appContext
- application context objectlevelParam
-modeParam
-typeParam
-fileParam
-pageParam
-formParam
-
-
initializeRequestKeys
public static RequestKeys initializeRequestKeys(ContainerServices cs)
Create and initialize a new request keys.- Parameters:
cs
- Container Service- Returns:
- RequestKeys created
-
initializeJavaScriptDependencyAnalyzer
public static void initializeJavaScriptDependencyAnalyzer(AppContext appContext)
- Since:
- MicroStrategy Web 9.0.0
-
initializeExternalSecurityComponent
public static ExternalSecurity initializeExternalSecurityComponent(AppContext appContext)
Create and initialize a external security component.- Parameters:
appContext
- application context object- Returns:
- External security component created
-
initializeBrowserSettings
public static BrowserSettings initializeBrowserSettings(PageManager pageMgr, Preferences adminPrefs, ContainerServices cs)
Create and initialize a BrowserSetting object.- Parameters:
pageMgr
- PagemanageradminPrefs
- Admin Preferencescs
- ContainerServices- Returns:
- BrowserSetting object created
-
isCookiesEnabled
@Deprecated public static boolean isCookiesEnabled(Preferences adminPrefs)
Deprecated.- Cookies should always be enabled nowDetermine whether the cookies is enabled as admin preference.- Since:
- MicroStrategy Web 8.0.2
-
initializeFeatures
public static WebFeatures initializeFeatures(AppContext appContext)
Create and initialize the globabl feature.- Parameters:
appContext
- application context object- Returns:
- Global Features
-
initializeServletWebComponent
public static ServletWebComponent initializeServletWebComponent(AppContext appContext, Preferences adminPrefs, java.lang.String name)
Create and initialize aServletWebComponent
.- Parameters:
appContext
- application context objectadminPrefs
- admin preference to read information to initialize the ServletWebComponent.name
- the name to be used as the name of the ServletWebComponent- Returns:
- ServletWebComponent created
-
initializeErrorPage
public static PageComponent initializeErrorPage(AppContext appContext, WebComponent servletWebComponent)
Deprecated.It is not used anywhere in the application.
-
dispenseWebAPIErrorProperties
public static void dispenseWebAPIErrorProperties(AppContext appContext)
Initialize web API error properties.- Since:
- MicroStrategy Web 8.0.1
-
getAdminPrefs
public static Preferences getAdminPrefs()
Return a instance of system administratorPreferences
.
-
getSessionCookieUsage
public static boolean getSessionCookieUsage(Preferences adminPrefs)
Return whether uses session cookies as a system admin preferences.- Parameters:
adminPrefs
- Admin preferences to read from.
-
setEncryption
public static void setEncryption(Preferences adminPrefs)
Set up whether to use encryption forWebClusterAdmin
by reading from system admin preferences.- Parameters:
adminPrefs
- Admin preferences to read from.
-
savePreferences
public static void savePreferences(AppContext appContext, Preferences adminPrefs, PageComponent page)
Save system admin preferences to persistent storage.- Parameters:
appContext
- application context objectadminPrefs
- admin preference to read informationpage
-
-
saveSessionManager
public static void saveSessionManager(AppContext appContext, boolean useSessionCookie, java.lang.String sessKey)
Save session manager state to either session attribute or to client cookie identified by the key.- Parameters:
appContext
- application contextuseSessionCookie
- a boolean value of whether use cookie or session as storagesessKey
- the key/name of session attribute or cookie
-
handleBinaryPage
public static void handleBinaryPage(ContainerServices cs, PageComponent page)
Handle binary page by generating the content of the binary page back to client browser.- Parameters:
cs
- container service to be used to send content back to browserpage
- the PageComponent corresponding to the binary page
-
resolveFilePathParameter
public static java.lang.String resolveFilePathParameter(AppContext appContext, java.lang.String defaultFile, java.lang.String paramName)
Resolve and return the full path of the file specified by a parameter.- Parameters:
appContext
- Application ContextdefaultFile
- The default file pathparamName
- The name of the parameter- Returns:
- The full path of the file
- Since:
- MicroStrategy Web 7.5.1
-
resolveLogPathParameter
public static java.lang.String resolveLogPathParameter(AppContext appContext, java.lang.String defaultFile, java.lang.String paramName)
Resolve and return the log path value based on parameter value.- Since:
- MicroStrategy Web 7.5.1
-
getLocalesXMLPath
public static java.lang.String getLocalesXMLPath(AppContext appContext)
Resolve and return the full path to the locales.xml file.- Parameters:
appContext
- application context object- Returns:
- the full path
- Since:
- MicroStrategy Web 9.0.0
-
initializeSSL
public static void initializeSSL(AppContext appContext)
-
initializeStdOutRedirect
public static void initializeStdOutRedirect(AppContext appContext)
-
getDefaultPreference
public static java.lang.String getDefaultPreference(java.lang.String key)
-
shouldRedirectOnLogin
public static boolean shouldRedirectOnLogin()
Redirect on Login Failure (DE127390) Use default value if unable to retrieve preference- Returns:
- boolean
-
-