Class ControllerHelper


  • public class ControllerHelper
    extends java.lang.Object
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Detail

      • ControllerHelper

        public ControllerHelper()
    • 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 Context
        name - 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 Context
        name - 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 object
        paramPropertiesFile - Par
        resourceName -
        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 object
        paramName - 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 the CacheRegistry 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 object
        paramName - 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 any
        This 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 any
        This 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);
      • 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 object
        paramName - the name of the parameter
        Returns:
        MessagesManager
      • initializeWidgetFactory

        public static void initializeWidgetFactory​(AppContext appContext,
                                                   java.lang.String paramName)
        Initialize the Blocks used by the application.
        Parameters:
        appContext - The AppContext 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 - The AppContext 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 any
        This 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
      • 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 object
        engineParam -
        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 object
        levelParam -
        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 - Pagemanager
        adminPrefs - Admin Preferences
        cs - ContainerServices
        Returns:
        BrowserSetting object created
      • isCookiesEnabled

        @Deprecated
        public static boolean isCookiesEnabled​(Preferences adminPrefs)
        Deprecated.
        - Cookies should always be enabled now
        Determine 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 a ServletWebComponent.
        Parameters:
        appContext - application context object
        adminPrefs - 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 administrator Preferences.
      • 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 for WebClusterAdmin 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 object
        adminPrefs - admin preference to read information
        page -
      • 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 context
        useSessionCookie - a boolean value of whether use cookie or session as storage
        sessKey - 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 browser
        page - 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 Context
        defaultFile - The default file path
        paramName - 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