Package com.microstrategy.web.controller
Class GenericWebAppController
- java.lang.Object
-
- com.microstrategy.web.controller.AppControllerImpl
-
- com.microstrategy.web.controller.GenericWebAppController
-
- All Implemented Interfaces:
AppController
- Direct Known Subclasses:
AdminController
,MSTRWebController
,ServerAdminController
public class GenericWebAppController extends AppControllerImpl
This class provides a generic implementation of AppController that suits many MicroStrategy web applications. This class contains much of the code from the MSTRWebController class.- Since:
- MicroStrategy Web 9.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected ControllerHelper.BlockLibraryInfo
_blockLibraryInfo
protected java.lang.String
_configServletPath
protected int
_defaultEvent
protected AppContext
_globalAppContext
protected java.lang.String
_iframeJSP
protected java.lang.String
_iserverPollingFreq
protected long
_messagesLastModified
Deprecated.MessagesBundle will take care themselves to reload if necessary.protected MessagesManager
_messagesManager
Deprecated.Get the pageManager fromBeanContext.getMessagesManager()
or directly from theConfigurationFilesCache
.protected long
_pageConfigLastModified
Deprecated.the pageConfig will take care itself to reload if necessary.protected PageManager
_pageManager
Deprecated.Get the pageManager fromAppContext.getPageManager()
or directly from theConfigurationFilesCache
.protected boolean
_reloadConfigFiles
protected java.lang.String
_servletName
Deprecated.This variable should be marked private and will be removed in future versions of the product.protected java.lang.String
_servletPath
Deprecated.This variable should be marked private and will be removed in future versions of the product.protected StyleCatalog
_styleCatalog
Deprecated.Get the style catalog fromBeanContext.getStyleCatalog()
or directly from theConfigurationFilesCache
.protected long
_styleCatalogLastModified
Deprecated.the styleCatalog will take care itself to reload if necessary.protected java.lang.String
_xhrJSP
protected static java.lang.String
SESSION_SESSION_MANAGER
The key to use for the Session Manager.
-
Constructor Summary
Constructors Constructor Description GenericWebAppController()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addStandardCacheHeaders(ContainerServices cs)
AppContext
createNewAppContext(ContainerServices cs)
Deprecated.UsecreateNewAppContext(ContainerServices, boolean)
instead.AppContext
createNewAppContext(ContainerServices cs, boolean externalApp)
Creates a new AppContextInstance.void
errorAfterRedirect(RequestState reqState, java.lang.Exception e)
Inform the application that the request has failed inside the redirected pagejava.lang.String
extractParameterFromURL(java.lang.String url, java.lang.String parameterName)
protected ProductLicenseInfo[]
getApplicableLicenses()
java.lang.String
getBaseURL(ContainerServices cs)
Returns the root name to use on event links and as the action of the forms generated by the applicationprotected java.lang.String
getDefaultURLLink(ServletWebComponent servletWebComponent)
protected long
getLastModifiedTime(AppContext appContext, java.lang.String param)
Deprecated.No longer used by the MicroStrategy Web controllers.java.lang.String
getPage(RequestState reqState)
Get the page to redirect to.void
initializeApp(ContainerServices cs)
Initialize our web application.ExternalSecurity
newExternalSecurity()
Creates new instance of the ExternalSecurity component to be used for authenticating and authorizing users on each of their requests.RequestState
newRequestState()
Create a new per-request data structureboolean
processRequest(RequestState reqState)
Handle an incoming HTTP Request.protected void
setupSessionManager(AppContext appContext, ServletWebComponent servletWebComponent)
void
terminateApp()
Subclasses that override this method should invoke this via super.terminateApp to ensure threads and other application related resources are cleaned up properly.protected void
validateRandomNum(ContainerServices cs, AppContext appContext)
Checks if validateRandNum token contains correct value if CSRF protection is enabled Places results in CSRFError httpsession attribute Enforcement of CSRFError httpsession attribute is in ServletEventHandlerImpl
-
-
-
Field Detail
-
SESSION_SESSION_MANAGER
protected static final java.lang.String SESSION_SESSION_MANAGER
The key to use for the Session Manager.- See Also:
- Constant Field Values
-
_pageManager
protected PageManager _pageManager
Deprecated.Get the pageManager fromAppContext.getPageManager()
or directly from theConfigurationFilesCache
.This used to be the instance of the PageManager used by this Controller. The Controller would initialized this instance in the initializeApp method, keep a reference and then assign it to the AppContext on every request.
Now all configuration files are cached by theConfigurationFilesCache
, so if you need to access the page config, you can get a reference (based on the file path) from this Cache. The AppContextImpl will automatically try to get the PageManager from the Cache if a PageManager is not explicitly set.
-
_globalAppContext
protected AppContext _globalAppContext
-
_messagesManager
protected MessagesManager _messagesManager
Deprecated.Get the pageManager fromBeanContext.getMessagesManager()
or directly from theConfigurationFilesCache
.This used to be the instance of the MessagesManager used by this Controller. The Controller would initialized this instance in the initializeApp method, keep a reference and then assign it to the AppContext on every request.
Now all configuration files are cached by theConfigurationFilesCache
, so if you need to access the page config, you can get a reference (based on the file path) from this Cache. The AppContextImpl will automatically try to get the MessagesManager from the Cache if a PageManager is not explicitly set.
-
_styleCatalog
protected StyleCatalog _styleCatalog
Deprecated.Get the style catalog fromBeanContext.getStyleCatalog()
or directly from theConfigurationFilesCache
.This used to be the instance of the StyleCatalog used by this Controller. The Controller would initialized this instance in the initializeApp method, keep a reference and then assign it to the AppContext on every request.
Now all configuration files are cached by theConfigurationFilesCache
, so if you need to access the style catalog, you can get a reference (based on the file path) from this Cache. The AppContextImpl will automatically try to get the StyleCatalog from the Cache if a StyleCatalog is not explicitly set.
-
_defaultEvent
protected int _defaultEvent
-
_reloadConfigFiles
protected boolean _reloadConfigFiles
-
_configServletPath
protected java.lang.String _configServletPath
-
_xhrJSP
protected java.lang.String _xhrJSP
- Since:
- MicroStrategy Web 9.0.1
-
_iframeJSP
protected java.lang.String _iframeJSP
-
_iserverPollingFreq
protected java.lang.String _iserverPollingFreq
-
_servletName
protected java.lang.String _servletName
Deprecated.This variable should be marked private and will be removed in future versions of the product. You can callgetBaseURL(com.microstrategy.web.platform.ContainerServices)
instead.
-
_servletPath
protected java.lang.String _servletPath
Deprecated.This variable should be marked private and will be removed in future versions of the product. You can callBeanContext.getServletPath()
instead.
-
_pageConfigLastModified
protected long _pageConfigLastModified
Deprecated.the pageConfig will take care itself to reload if necessary.
-
_styleCatalogLastModified
protected long _styleCatalogLastModified
Deprecated.the styleCatalog will take care itself to reload if necessary.
-
_messagesLastModified
protected long _messagesLastModified
Deprecated.MessagesBundle will take care themselves to reload if necessary.
-
_blockLibraryInfo
protected ControllerHelper.BlockLibraryInfo _blockLibraryInfo
-
-
Method Detail
-
initializeApp
public void initializeApp(ContainerServices cs)
Description copied from interface:AppController
Initialize our web application. Save all persistent data structures back into the implementation class as private data members.
-
newRequestState
public RequestState newRequestState()
Description copied from interface:AppController
Create a new per-request data structure- Returns:
RequestState
-
processRequest
public boolean processRequest(RequestState reqState)
Description copied from interface:AppController
Handle an incoming HTTP Request. The state of the incoming request is saved back into the RequestState object for later review by the controller.- Returns:
- boolean
-
getDefaultURLLink
protected java.lang.String getDefaultURLLink(ServletWebComponent servletWebComponent)
-
errorAfterRedirect
public void errorAfterRedirect(RequestState reqState, java.lang.Exception e)
Description copied from interface:AppController
Inform the application that the request has failed inside the redirected page
-
getPage
public java.lang.String getPage(RequestState reqState)
Description copied from interface:AppController
Get the page to redirect to. Must handle the case that an error was found before redirection. In such a case, the page returned should be an error page.- Returns:
- String
-
getBaseURL
public java.lang.String getBaseURL(ContainerServices cs)
Description copied from interface:AppController
Returns the root name to use on event links and as the action of the forms generated by the application- Returns:
- String
-
newExternalSecurity
public ExternalSecurity newExternalSecurity()
Description copied from interface:AppController
Creates new instance of the ExternalSecurity component to be used for authenticating and authorizing users on each of their requests.- Returns:
- new instance of the ExternalSecurity component.
-
terminateApp
public void terminateApp()
Description copied from class:AppControllerImpl
Subclasses that override this method should invoke this via super.terminateApp to ensure threads and other application related resources are cleaned up properly.- Specified by:
terminateApp
in interfaceAppController
- Overrides:
terminateApp
in classAppControllerImpl
-
createNewAppContext
public AppContext createNewAppContext(ContainerServices cs)
Deprecated.UsecreateNewAppContext(ContainerServices, boolean)
instead.Creates a new AppContext instance.- Parameters:
cs
- TheContainerServices
instance of the caller.- Returns:
- A populated
AppContext
instance.
-
createNewAppContext
public AppContext createNewAppContext(ContainerServices cs, boolean externalApp)
Creates a new AppContextInstance.- Parameters:
cs
- TheContainerServices
instance of the caller.externalApp
- If this is being called from an external application (one other than MicroStrategy Web), then the following properties are set on the new instance:- styleCatalog
- pageManager
- messagesManager
-
setupSessionManager
protected void setupSessionManager(AppContext appContext, ServletWebComponent servletWebComponent) throws WebAppException
- Throws:
WebAppException
-
getLastModifiedTime
protected long getLastModifiedTime(AppContext appContext, java.lang.String param)
Deprecated.No longer used by the MicroStrategy Web controllers.Gets teh last modified time of a resource.- Parameters:
appContext
- TheAppContext
to use for resolving resource parameters.param
- The name of the resource to check.- Returns:
- A long value for the last modified time.
-
getApplicableLicenses
protected ProductLicenseInfo[] getApplicableLicenses() throws LicensingException
- Throws:
LicensingException
-
addStandardCacheHeaders
protected void addStandardCacheHeaders(ContainerServices cs)
-
extractParameterFromURL
public java.lang.String extractParameterFromURL(java.lang.String url, java.lang.String parameterName)
-
validateRandomNum
protected void validateRandomNum(ContainerServices cs, AppContext appContext) throws WebException
Checks if validateRandNum token contains correct value if CSRF protection is enabled Places results in CSRFError httpsession attribute Enforcement of CSRFError httpsession attribute is in ServletEventHandlerImpl- Parameters:
cs
-appContext
-- Throws:
WebException
-
-