com.ibm.portal.model
Interface PortalLocalizedContextHome
- All Superinterfaces:
- LocaleCapable, LocalizedContextHome
-
public interface PortalLocalizedContextHome
- extends LocalizedContextHome
A home interface for lookups to LocalizedContext
instances. To obtain the home instance, a JNDI lookup needs to be performed,
e.g.:
Context ctx = new InitialContext();
PortalLocalizedContextHome home = (PortalLocalizedContextHome) ctx.lookup(PortalLocalizedContextHome.JNDI_NAME);
if (home != null) {
LocalizedContext ctx = home.getLocalizedContext(aRequest);
...
}
Since JNDI lookups may be expensive, it is recommended to store the
home instance for reuse, if the service is used repeatedly.
NOTE: This API may only be used in the scope of an HTTP request in WebSphere Portal, i.e. within a theme.
The API can not be invoked directly by a custom servlet.
- Since:
- 6.1.0
Field Summary
|
static java.lang.String |
JNDI_NAME
JNDI name under which the home instance is bound |
Method Summary
|
LocalizedContext |
getLocalizedContext(javax.servlet.http.HttpServletRequest aRequest)
Return a context instance which uses the language ranges specified in
the request. |
LocalizedContext |
getLocalizedContext(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse)
Return a context instance which uses the language ranges specified in
the request, considering also the language selected on the response. |
LocalizedContext |
getLocalizedContext(javax.servlet.jsp.PageContext aPageContext)
Return a context instance which uses the language ranges specified in
the given locale enumeration. |
Methods inherited from interface com.ibm.portal.model.LocalizedContextHome
|
getAvailableLocales, getBaseTextDirection, getDefaultCollators, getDefaultLocale, getExpandedLocales, getExpandedSupportedLocales, getLocalizedContext, getLocalizedContext, getLocalizedContext, getResourceBundleProvider, getSupportedLocales |
JNDI_NAME
static final java.lang.String JNDI_NAME
- JNDI name under which the home instance is bound
- See Also:
- Constant Field Values
getLocalizedContext
LocalizedContext getLocalizedContext(javax.servlet.http.HttpServletRequest aRequest)
- Returns a context instance which uses the language ranges specified in
the request.
- Parameters:
- aRequest - the request for which to return the context instance; the
language preference is obtained via the
ServletRequest.getLocales() method.
- Returns:
- a localized context instance working on the language ranges
exposed by the request
getLocalizedContext
LocalizedContext getLocalizedContext(javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse)
- Returns a context instance which uses the language ranges specified in
the request, considering also the language selected on the response.
- Parameters:
- aRequest - the request for which to return the context instance; the
language preference is obtained via the
ServletRequest.getLocales() method.
- aResponse - the response for which to return the context instance; the
language preference is obtained via the
ServletResponse.getLocale() method.
- Returns:
- a localized context instance working on the language ranges
exposed by the request and response
- Since:
- 6.1.0.3
getLocalizedContext
LocalizedContext getLocalizedContext(javax.servlet.jsp.PageContext aPageContext)
- Returns a context instance which uses the language ranges specified in
the given locale enumeration.
- Parameters:
- aPageContext - the request for which to return the context instance; the
language preference is obtained via the
ServletRequest.getLocales() method.
- Returns:
- a localized context instance working on the language ranges
exposed by the request