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

All Superinterfaces:
PortletService

public interface PortletModelProvider
extends PortletService

An interface for a provider of portlet 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.PortletModelProvider");
serviceAvailable = true;
} catch(javax.naming.NameNotFoundException ex) {
... error handling ...
}
...
if (serviceAvailable) {
PortletModelProvider provider = (PortletModelProvider) psh.getPortletService(PortletModelProvider.class);
PortletModel model = provider.getPortletModel(aRequest, aResponse);
...
}

Since:
6.0.1

Field Summary
static java.lang.String JNDI_NAME
          JNDI name for the service lookup
 
Method Summary
 AdminPortletModel getAdminPortletModel(javax.portlet.PortletRequest aRequest, javax.portlet.PortletResponse aResponse)
          Returns the administraive portlet model applicable to the current portlet request.
 PortletWindow getCurrentPortletWindow(javax.portlet.PortletRequest aRequest)
          Returns the portlet window for the given portlet request
 PortletModel getPortletModel(ContentPage aContentPage, javax.portlet.PortletRequest aRequest, javax.portlet.PortletResponse aResponse)
          Returns the portlet model for the given content page.
 PortletModel getPortletModel(javax.portlet.PortletRequest aRequest, javax.portlet.PortletResponse aResponse)
          Returns the portlet model applicable in the current portlet request.
 

Field Detail

JNDI_NAME

static final java.lang.String JNDI_NAME
JNDI name for the service lookup

Since:
7.0.0
See Also:
Constant Field Values
Method Detail

getPortletModel

PortletModel getPortletModel(javax.portlet.PortletRequest aRequest,
                             javax.portlet.PortletResponse aResponse)
                             throws ModelException
Returns the portlet model applicable in the current portlet request.

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

getPortletModel

PortletModel getPortletModel(ContentPage aContentPage,
                             javax.portlet.PortletRequest aRequest,
                             javax.portlet.PortletResponse aResponse)
                             throws ModelException
Returns the portlet model for the given content page.

Parameters:
aContentPage - the content page to get the portlet model for
aRequest - the current request
aResponse - the current response
Returns:
the portlet model for the given content page
Throws:
ModelException - in case the model cannot be obtained
Since:
8.0

getAdminPortletModel

AdminPortletModel getAdminPortletModel(javax.portlet.PortletRequest aRequest,
                                       javax.portlet.PortletResponse aResponse)
                                       throws ModelException
Returns the administraive portlet model applicable to the current portlet request.

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

getCurrentPortletWindow

PortletWindow getCurrentPortletWindow(javax.portlet.PortletRequest aRequest)
                                      throws ModelException
Returns the portlet window for the given portlet request

Parameters:
aRequest - the current request
Returns:
the portlet window matching the portlet request
Throws:
ModelException - in case the model cannot be obtained