com.ibm.portal.cp.rating
Interface PortletRatingModelProvider
- All Superinterfaces:
- PortletService, RatingModelControllerProvider
public interface PortletRatingModelProvider
- extends PortletService, RatingModelControllerProvider
RatingModelProvider for portlet scope, i. e. with portlet request /
response.
PortletServiceHome psh;
javax.naming.Context ctx = new javax.naming.InitialContext();
boolean serviceAvailable = false;
try {
psh = (PortletServiceHome) ctx.lookup(PortletRatingModelProvider.JNDI_NAME);
serviceAvailable = true;
} catch(javax.naming.NameNotFoundException ex) {
... error handling ...
}
...
if (serviceAvailable) {
PortletRatingModelProvider provider = (PortletRatingModelProvider) psh.getPortletService(PortletRatingModelProvider.class);
RatingModel<Rating> model = provider.getRatingModel(aRequest, aResponse);
...
}
Note: The lookup for this provider should be executed within the
init
method of a portlet and only the lookup for the
RatingModel
itself should be performed on a per-request basis.
- Since:
- 7.0.0
Field Summary |
static java.lang.String |
JNDI_NAME
The JNDI lookup name |
Method Summary |
|
getRatingModel(javax.portlet.PortletRequest aRequest,
javax.portlet.PortletResponse aResponse)
Returns a RatingModel which exposes a
RatingModelLocator for the
getLocator() method. |
JNDI_NAME
static final java.lang.String JNDI_NAME
- The JNDI lookup name
- See Also:
- Constant Field Values
getRatingModel
<T extends Rating> RatingModel<T> getRatingModel(javax.portlet.PortletRequest aRequest,
javax.portlet.PortletResponse aResponse)
throws ModelException
- Returns a
RatingModel
which exposes a
RatingModelLocator for the
getLocator()
method.
- Parameters:
aRequest
- The current portlet requestaResponse
-
- Returns:
- The
RatingModel
.
- Throws:
ModelException