java.lang.Object | ||
↳ | com.microstrategy.web.beans.BeanContextImpl | |
↳ | com.microstrategy.web.app.beans.AppContextImpl |
This class implements the AppContext. The AppContext includes the objects that
the microstrategy application expects to pass information between the different components.
It saves an instance of specific applications objects, such as the SessionManager
,
the Preferences
and the RequestKeys
.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AppContextImpl()
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
dispenseFile(String realPath, String resourcePath)
If the file does not exist, a duplicate is made from the specified resource.
| ||||||||||
WebAppSessionManager |
getAppSessionManager()
This method returns the Application Session Manager associated with this application context.
| ||||||||||
String |
getBrowserHeaderLocaleId()
This method will extract from request header a value corresponding to browser's locale info.
| ||||||||||
String |
getBrowserHeaderLocaleId(Locale defaultLocale)
This method will extract from request header a value corresponding to browser's locale info.
| ||||||||||
String |
getBrowserLocaleId()
This method returns the Locale Id defined in web preferences as Language.
| ||||||||||
String |
getBrowserServerLocaleId()
This method returns the Locale associated with Date and Number format locale web preference.If default, it'll return
browser's locale Id instead.
| ||||||||||
BrowserSettings |
getBrowserSettings()
This method returns the
BrowserSettings instance associated with this
application context. | ||||||||||
String |
getConfigParameter(String param)
Returns the value of the configuration parameter
| ||||||||||
String |
getConfigServletPath()
Get the full application path to the Servlet as defined in the configuration file
| ||||||||||
ContainerServices |
getContainerServices()
This method gets the Container Services object associated with this application context.
| ||||||||||
ContextMenuManager |
getContextMenuManager(String contextMenuName)
Returns an instance of a
ContextMenuManager object. | ||||||||||
PageComponent |
getCurrentPage()
Returns the name of the current page associated with the context.
| ||||||||||
Document |
getDocumentFromFileResource(String filePath)
This method returns a DOM Document from a file resource.
| ||||||||||
ExternalSecurity |
getExternalSecurity()
This method returns the External Security instance associated with this application context.
| ||||||||||
String |
getFileContentsAsString(String filePath, String encoding)
Returns the contents of the resource file as string from the file path provided using the named character encoding.
| ||||||||||
String |
getFileContentsAsString(String filePath)
Returns the contents of the resource file as string from the file path provided.
| ||||||||||
String |
getFontName()
Returns a string with the name of the fonts, or the list of fonts
that a browser should use when rendering the page.
| ||||||||||
String |
getFontSize()
A string with the base font size to use, the string
might contain the type of size (i.e, pt, px, etc.)
| ||||||||||
Messages |
getMessages()
Returns the
Messages instance from this BeanContext. | ||||||||||
PageManager |
getPageManager()
This method gets the PageManager object associated with this application context.
| ||||||||||
Preferences |
getPreferences()
Returns the
Preferences object associated with this application context. | ||||||||||
String |
getRealPath(String filePath)
Return the absolute path of the relative path provided
| ||||||||||
String |
getResourceFileAsString(String filePath, String resourceFileName)
Returns the contents of the resource file as string from the file path provided.
| ||||||||||
String |
getResourcesFolder(String folderType)
Return the path to the resources folder indicated on the configuration file, corresponding to the
type sent as parameter.
| ||||||||||
String |
getRootName()
Returns the name of the root component
In the case of the jsp/servlet enviroment,it will be the name of the main servlet component
This corresponds to the value of the parameter
CONFIG_SERVLET_NAME | ||||||||||
String |
getServletPath()
Get the full application path to the Servlet.
| ||||||||||
SessionManager |
getSessionManager()
This method is deprecated.
Use
WebAppSessionManager instead, via the getAppSessionManager method. | ||||||||||
boolean |
isDoubleByte()
Returns true if the locale is a double byte language like Chinese, Korean or Japenese.
| ||||||||||
void |
putConfigParameter(String key, String value)
Appends a configuration parameter to the collection
| ||||||||||
void |
setAppSessionManager(WebAppSessionManager sm)
This method sets the Application Session Manager associated with this application context.
| ||||||||||
void |
setBrowserSettings(BrowserSettings bs)
This method sets the BrowserSettings object to be associated with this application context.
| ||||||||||
void |
setConfigServletPath(String configServletPath)
Define the full application path to the Servlet as defined in the configuration file.
| ||||||||||
void |
setContainerServices(ContainerServices cs)
This method sets the Container Services object associated with this application context.
| ||||||||||
void |
setCurrentPage(PageComponent page)
Set a page as the current page of this context.
| ||||||||||
void |
setDefaultEvent(int eventID)
This method will first check if the config parameter for default event is not present.
| ||||||||||
void |
setExternalSecurity(ExternalSecurity es)
This method sets the External Security associated with this application context.
| ||||||||||
void |
setMessages(Messages userMsgs)
Sets a
Messages instance to this BeanContext. | ||||||||||
void |
setPageManager(PageManager pageManager)
This method sets the PageManager object associated with this application context.
| ||||||||||
void |
setPreferences(Preferences preferences)
Sets the
Preferences object associated with this application context. | ||||||||||
void |
setServletPath(String servletPath)
Define the full application path to the Servlet.
| ||||||||||
void |
setSessionManager(SessionManager sessionManager)
This method is deprecated.
Use
WebAppSessionManager instead, via the getAppSessionManager method. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String |
getEventHandlersCatalogPath()
Returns the path to use for the EventHandlersCatalog file.
| ||||||||||
String |
getMessagesManagerPath()
Returns the path to use for the MessagesManager (locales) file.
| ||||||||||
String |
getPageManagerPath()
Returns the path to use for the PageManager file.
| ||||||||||
String |
getStyleCatalogPath()
Returns the path to use for the StyleCatalog file.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructor.
If the file does not exist, a duplicate is made from the specified resource. This method is used to generate user customizable files from resource templates. Its also a means of creating file system accessible files when the application is deployed as an unexpanded WAR (i.e. configuration files cannot be easily modified).
realPath | Actual location of the file. |
---|---|
resourcePath | Location of the master copy resource. |
IllegalArgumentException | Thrown if either the file or resource path is empty. |
---|---|
MSTRUncheckedException | Thrown if the resource could not be located, or if an error occurs during duplication. |
This method returns the Application Session Manager associated with this application context.
If not explicitly set through the setAppSessionManager(WebAppSessionManager)
method, a new one is automatically
created.
Note that this method fully replaces the getSessionManager method.
WebAppSessionManager
, representing the session manager associated with the AppContext object.This method will extract from request header a value corresponding to browser's locale info. This info will be resolved in order to return current browser's locale id.
String
with the Locale ID.
This method will extract from request header a value corresponding to browser's locale info. This info
will be resolved in order to return current browser's LCID. This is equivalent to
findBestSupportedLocale(Locale, Locale[])
with available display locales from
getAvailableLocales(int)
for TYPE_WEB_SUPPORTED
.
String
with the LCID
This method returns the Locale Id defined in web preferences as Language. If default, it'll return browser's locale Id instead.
String
with the Locale ID.
This method returns the Locale associated with Date and Number format locale web preference.If default, it'll return browser's locale Id instead.
String
with the Locale ID.
This method returns the BrowserSettings
instance associated with this
application context.
BrowserSettings
instance
Returns the value of the configuration parameter
param | name of the parameter to retrieve |
---|
Get the full application path to the Servlet as defined in the configuration file
String
with the servlet path
This method gets the Container Services object associated with this application context.
Returns an instance of a ContextMenuManager
object. Referenced ny name
contextMenuName | name of the ContextMenuManager object to retrieve |
---|
ContextMenuManager
object
Returns the name of the current page associated with the context.
It returns null
if there no current page.
PageComponent
which is set on this object.This method returns a DOM Document from a file resource. The method works by attempting the following operations, in order:
filePath | The absolute or relative path to the file resource. |
---|
Document
node that contains the file contents.
This method returns the External Security instance associated with this application context.
Returns the contents of the resource file as string from the file path provided using the named character encoding. it does not dispense the file
filePath | location of the resource file (relative path) |
---|---|
encoding | The name of a supported character encoding. |
Returns the contents of the resource file as string from the file path provided. it does not dispense the file
filePath | location of the resource file (relative path) |
---|
Returns a string with the name of the fonts, or the list of fonts that a browser should use when rendering the page. This is usually retrieved from user Preferences
A string with the base font size to use, the string might contain the type of size (i.e, pt, px, etc.)
Returns the Messages
instance from this BeanContext.
This method does not contact the MessagesManager
object associated
with this BeanContext
.
This method gets the PageManager object associated with this application context. If no PageManager has been explicitly associated, it will automatically used the one specified by the configuration parameters of the ContainerServices.
PageManager
object associated with this application context.
Returns the Preferences
object associated with this application context. The Preferences
mantains the current settings of the application at different levels.
Preferences
object associated with this application context.
Return the absolute path of the relative path provided
filePath | relative path to get the relative path from |
---|
Returns the contents of the resource file as string from the file path provided. If the resource cannot be found in the location, it will be dispensed
filePath | location of the resource file |
---|---|
resourceFileName | resource file |
Return the path to the resources folder indicated on the configuration file, corresponding to the
type sent as parameter.
This is actually a convenience method for the getConfigParameter. This method returns all configuration
parameters that starts with RESOURCE_FOLDER_PREFIX
and folderType is whatever goes after that.
This method also makes sure that the name of the folder has always a backslash "/" at the end.
folderType | integer constant that specifies the type of resource folder to return |
---|
Returns the name of the root component
In the case of the jsp/servlet enviroment,it will be the name of the main servlet component
This corresponds to the value of the parameter CONFIG_SERVLET_NAME
Get the full application path to the Servlet. This value is read form the configuration file and if is not set it will be automatically generated from the request.
String
with the servlet path
This method is deprecated.
Use WebAppSessionManager
instead, via the getAppSessionManager method.
Returns the SessionManager
object associated with this application context. The SessionManager
manages the different sessions to the Intelligence Server.
Returns true if the locale is a double byte language like Chinese, Korean or Japenese.
Appends a configuration parameter to the collection
key | name of the configuration parameter |
---|---|
value | value of the configuration parameter |
This method sets the Application Session Manager associated with this application context.
This method sets the BrowserSettings object to be associated with this application context.
bs | An instance of an BrowserSettings object.
|
---|
Define the full application path to the Servlet as defined in the configuration file.
configServletPath | a String with the servlet path
|
---|
This method sets the Container Services object associated with this application context.
cs | A ContainerServices object.
|
---|
Set a page as the current page of this context.
page | PageComponent instance. |
---|
This method will first check if the config parameter for default event is not present. If it is present then this method will not do anything. If the config paramter is not present, then this method will set the value of the config parameter with the @param eventID.
eventID | identifier of the event to become default if not specified on the configuration parameters. |
---|
This method sets the External Security associated with this application context.
es | An ExternalSecurity instance.
|
---|
Sets a Messages
instance to this BeanContext.
This method does not contact the MessagesManager
object associated
with this BeanContext
.
userMsgs | the Messages instance to set. |
---|
This method sets the PageManager object associated with this application context.
pageManager | A PageManager object.
|
---|
Sets the Preferences
object associated with this application context. The Preferences
mantains the current settings of the application at different levels.
preferences | the Preferences object associated with this application context.
|
---|
Define the full application path to the Servlet. This value is read form the configuration file and if is not set it will be automatically generated from the request.
servletPath | a String with the servlet path
|
---|
This method is deprecated.
Use WebAppSessionManager
instead, via the getAppSessionManager method.
Sets the SessionManager
object associated with this application context. The SessionManager
manages the different sessions to the Intelligence Server.
sessionManager | the session manager to associated with this AppContext |
---|
Returns the path to use for the EventHandlersCatalog file. This is only used if a EventHandlersCatalog has not
been explicitly set through the setEventHandlersCatalog(EventHandlersCatalog)
. By default it returns an empty string.
Other bean context can override this method to provide a different location.
Returns the path to use for the MessagesManager (locales) file. This is only used if a MessagesManager has not
been explicitly set through the setMessagesManager(MessagesManager)
.
Returns the path to use for the PageManager file. This is only used if a PageManager has not
been explicitly set through the setPageManager(PageManager)
. This method will calculate the path
based on the configuration parameters in the ContainerServices.
Returns the path to use for the StyleCatalog file. This is only used if a StyleCatalog has not
been explicitly set through the setStyleCatalog(StyleCatalog)
.