com.ibm.portal.model
Interface LocalizedStringResolver
Deprecated. instead, use LocalizedContext instances which can be obtained from PortalLocalizedContextHome and PortletLocalizedContextHome.
Obtains title or description of a localized object by
employing a fallback mechanism in case the title or description is not
available in the requested locale(s). This utilizes the expected behavior of
the Localized methods: They only return non-null results in case they
keep a title or description in the requested locale.
The helper class uses the following fallback order of locales: Try all the given
locales, failing that try the portal default locale, failing that try the
system default locale. If no title
could be determined in any tested locale, the unique name or in
absence of a unique name the object id of the resource is returned, if the
resource is identifiable. If it is not, an empty string will be returned.
An unavailable description is treated similarly, but no unique name or object
ID will be used as a description.
The resolver can be obtained through a JNDI lookup:
Context ctx = new InitialContext();
final LocalizedStringResolver resolver = (LocalizedStringResolver)
ctx.lookup("portal:service/model/LocalizedStringResolver");
if (resolver != null) {
final String title = resolver.getTitle(aLocalizedObject, aRequest.getLocales());
...
}
public interface LocalizedStringResolver
- Since:
- 5.1.0.1
- See Also:
- Identifiable,
Localized
Method Summary |
java.lang.String
| getDescription(Localized anObject,
java.util.Enumeration<java.util.Locale> aLocaleEnumeration)
Deprecated. Returns the description of the given node in a locale given by the enumeration.
|
java.lang.String
| getTitle(Localized anObject,
java.util.Enumeration<java.util.Locale> aLocaleEnumeration)
Deprecated. Returns the title of the given node in a locale given by the enumeration.
|
getTitle
java.lang.String getTitle(Localized anObject,
java.util.Enumeration<java.util.Locale> aLocaleEnumeration)
- Deprecated.
- Returns the title of the given node in a locale given by the enumeration.
Fallback rules as described for this interface apply.
- Parameters:
- anObject - the object whose title to retrieve
- aLocaleEnumeration - an enumeration of locales (e.g. obtained by calling javax.servlet.ServletRequest#getLocales())
- Returns:
- the title of the node in an appropriate locale (see interface documentation above)
getDescription
java.lang.String getDescription(Localized anObject,
java.util.Enumeration<java.util.Locale> aLocaleEnumeration)
- Deprecated.
- Returns the description of the given node in a locale given by the enumeration.
Fallback rules as described for this interface apply.
- Parameters:
- anObject - the object whose description to retrieve
- aLocaleEnumeration - an enumeration of locales (e.g. obtained by calling javax.servlet.ServletRequest#getLocales())
- Returns:
- the description of the node in an appropriate locale (see interface documentation above)