Package com.ibm.portal.model

This package defines ways to obtain models through JNDI lookups.

See:
          Description

Interface Summary
ContentMetaDataModelHome Home interface for JNDI based lookups for ContentMetaDataModelProvider.
ContentMetaDataModelProvider An interface for a provider of the content node meta data model.
ContentModelHome Home interface for JNDI based lookups for ContentModelProvider.
ContentModelProvider An interface for a provider of content models.
CorLocalizedContextHome A home interface for lookups to LocalizedContext instances.
LanguageListHome Home interface for JNDI based lookups for LanguageListProvider.
LanguageListProvider An interface for a provider of the language list.
LocalizedContext A helper object which allows to retrieve titles and descriptions for resources implementing the Localized interface.
LocalizedContextHome A home interface for lookups to LocalizedContext instances.
LocalizedStringResolver Deprecated. instead, use LocalizedContext instances which can be obtained from PortalLocalizedContextHome and PortletLocalizedContextHome.
MarkupListHome Home interface for JNDI based lookups for MarkupListProvider.
MarkupListProvider An interface for a provider of markup lists.
NavigationModelHome Home interface for JNDI based lookups for NavigationModelProvider.
NavigationModelProvider An interface for a provider of navigation models.
NavigationSelectionModelHome Home interface for JNDI based lookups for NavigationSelectionModelProvider.
NavigationSelectionModelProvider An interface for a provider of navigation models.
PortalLocalizedContextHome A home interface for lookups to LocalizedContext instances.
PortletModelHome Home interface for JNDI based lookups for PortletModelProvider.
PortletModelProvider An interface for a provider of portlet models.
SkinListHome Home interface for JNDI based lookups for SkinListProvider.
SkinListProvider An interface for a provider of skin lists.
ThemeListHome Home interface for JNDI based lookups for ThemeListProvider.
ThemeListProvider An interface for a provider of theme lists.
 

Package com.ibm.portal.model Description

This package defines ways to obtain models through JNDI lookups.

Package Specification

The interfaces presented here can be used obtain "model providers" via a JNDI lookup.

For lookups in code with a javax.servlet.ServletRequest available, these lookups can be used:

For lookups in code of a JSR portlet, the portlet service infrastructure is used. See com.ibm.portal.portlet.service for details on how to use this. The single services are exposed in the package com.ibm.portal.portlet.service.model.

For lookups in code of an IBM portlet, the IBM portlet service infrastructure is used. See org.apache.jetspeed.portlet.service for details on how to use this. The single services are exposed in the package com.ibm.portal.ibmportlet.service.model.

For lookups of ObjectID objects, these lookups can be used:

Coding examples:

Accessing a model on a servlet level:

Context ctx = new InitialContext();
NavigationModelHome home = (NavigationModelHome) ctx.lookup("portal:service/model/NavigationModel");
if (home != null) {
    NavigationModel model = home.getNavigationModelProvider().getNavigationModel(aRequest, aResponse);
    ...
}
Accessing a model on a JSR 168 portlet level:

PortletServiceHome psh;
javax.naming.Context ctx = new javax.naming.InitialContext();
boolean serviceAvailable = false;

try {
    psh = (PortletServiceHome) ctx.lookup("portletservice/com.ibm.portal.portlet.service.model.NavigationModelProvider");
    serviceAvailable = true;
} catch(javax.naming.NameNotFoundException ex) {
    ... error handling ...
}
...
if (serviceAvailable) {
    NavigationModelProvider provider = (NavigationModelProvider) psh.getPortletService(NavigationModelProvider.class);
    ...
}
Accessing a model on a IBM legacy portlet level:

NavigationModelProvider provider = (NavigationModelProvider) aPortletContext.getService(com.ibm.portal.ibmportlet.service.model.NavigationModelProvider.class);
if (provider != null) {
    NavigationModel model = provider.getNavigationModel(aRequest, aResponse);
    ...
}
Lookup ObjectID objects for unique names:

javax.naming.Context ctx = new InitialContext();

ObjectID oidForName = (ObjectID) ctx.lookup("portal:uniquename/unique name");
Lookup ObjectID objects for portlet definitions by providing the portlet's application ID and the portlet's name:

javax.naming.Context ctx = new InitialContext();

ObjectID oidForName = (ObjectID) ctx.lookup("portal:config/portletdefinition/application guid/portlet name");