com.ibm.portal.portlet.service.model
Interface ContentModelProvider

All Superinterfaces:
PortletService

public interface ContentModelProvider
extends PortletService

An interface for a provider of content models.

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.ContentModelProvider");
serviceAvailable = true;
} catch(javax.naming.NameNotFoundException ex) {
... error handling ...
}
...
if (serviceAvailable) {
ContentModelProvider provider = (ContentModelProvider) psh.getPortletService(ContentModelProvider.class);
ContentModel model = provider.getContentModel(aRequest, aResponse);
...
}

Since:
5.1.0.1

Field Summary
static java.lang.String JNDI_NAME
           
 
Method Summary
<T extends java.lang.Object & ContentNode>
ContentModel<T>
getContentModel(javax.portlet.PortletRequest aRequest, javax.portlet.PortletResponse aResponse)
          Returns the content model applicable in the current request.
 

Field Detail

JNDI_NAME

static final java.lang.String JNDI_NAME
Since:
6.1.0.1
See Also:
Constant Field Values
Method Detail

getContentModel

<T extends java.lang.Object & ContentNode> ContentModel<T> getContentModel(javax.portlet.PortletRequest aRequest,
                                                                          javax.portlet.PortletResponse aResponse)
                                                                      throws ModelException
Returns the content model applicable in the current request.

Parameters:
aRequest - the current request
aResponse - the current response
Returns:
the content model valid in the current request
Throws:
ModelException - in case the model cannot be obtained