Liferay 7.0-ce-b4

com.liferay.portal.kernel.portlet.bridges.mvc
Interface MVCResourceCommand

All Superinterfaces:
MVCCommand
All Known Implementing Classes:
BaseMVCResourceCommand

public interface MVCResourceCommand
extends MVCCommand

Provides an interface to allow the portlet to serve a resource. This interface can only be used when the portlet is based on MVCPortlet.

The resource command to be invoked is determined by two factors:

Implementations of this interface must be OSGi components that are registered in the OSGi Registry with the following properties:

The method MVCPortlet.serveResource(ResourceRequest, ResourceResponse) searches the OSGi Registry for the resource command that matches both the resource request's portlet name with the property javax.portlet.name and the resource request's ResourceID with the property mvc.command.name.

In general, only one resource command is executed per portlet resource URL. If the ResourceID of the resource request is, however, a comma separated list of multiple names, MVCPortlet finds the resource commands and invokes them sequentially in the order they're specified in the list.

When there are multiple resource commands registered for the same portlet name and with the same command name, only the resource command with the highest service ranking is invoked.

BaseMVCResourceCommand is an abstract class that implements this interface and can be extended to simplify using resource commands.


Field Summary
static MVCResourceCommand EMPTY
           
 
Method Summary
 boolean serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
          Invoked by MVCPortlet to allow the portlet to serve a resource.
 

Field Detail

EMPTY

static final MVCResourceCommand EMPTY
Method Detail

serveResource

boolean serveResource(ResourceRequest resourceRequest,
                      ResourceResponse resourceResponse)
                      throws PortletException
Invoked by MVCPortlet to allow the portlet to serve a resource.

Parameters:
resourceRequest - the resource request
resourceResponse - the resource response
Returns:
true if an error occurs in serving the resource; false otherwise
Throws:
PortletException

Liferay 7.0-ce-b4