{ } }
Tree 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES   SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ibm.portal.model.LocalizedContextHome
LocalizedContextHome.BASE_TEXT_DIRECTION, LocalizedContextHome.ComparatorFactory
 
Field Summary
static java.lang.String JNDI_NAME
          JNDI name under which the home instance is bound
 
Method Summary
 LocalizedContext getLocalizedContext(HttpServletRequest aRequest)
          Return a context instance which uses the language ranges specified in the request.
 LocalizedContext getLocalizedContext(HttpServletRequest aRequest, 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(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, getResourceBundleProvider, getSupportedLocales
 

Field Detail

JNDI_NAME

static final java.lang.String JNDI_NAME
JNDI name under which the home instance is bound

See Also:
Constant Field Values
Method Detail

getLocalizedContext

LocalizedContext getLocalizedContext(HttpServletRequest aRequest)
Return a context instance which uses the language ranges specified in the request.

Specified by:
getLocalizedContext in interface LocalizedContextHome
Parameters:
aRequest - the request for which to return the context instance; the language preference is obtained via the HttpServletRequest#getLocales() method.
Returns:
a localized context instance working on the language ranges exposed by the request

getLocalizedContext

LocalizedContext getLocalizedContext(HttpServletRequest aRequest,
                                     HttpServletResponse aResponse)
Return 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 HttpServletRequest#getLocales() method.
aResponse - the response for which to return the context instance; the language preference is obtained via the HttpServletResponse#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(PageContext aPageContext)
Return a context instance which uses the language ranges specified in the given locale enumeration.

Specified by:
getLocalizedContext in interface LocalizedContextHome
Parameters:
aPageContext - the request for which to return the context instance; the language preference is obtained via the HttpServletRequest#getLocales() method.
Returns:
a localized context instance working on the language ranges exposed by the request
Tree 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES   SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD