Extend MVC framework to have a better support for render and resource urls
Description
Activity

Sergio Gonzalez September 3, 2015 at 7:23 AM
{markdown}Just started reviewing <br><br> Sent from [GH](http://nodegh.io).{markdown}

Sergio Gonzalez July 24, 2015 at 12:26 AM
Hey David,
It's an extension of the previously existing MVCPortlet, so yeah, it's backwards compatible. The only change that should be done to keep backwards compatibility is update the name of the property used. Before it was like
@Component(
immediate = true,
property = {
"action.command.name=view",
"javax.portlet.name=" + InvitationPortletKeys.INVITATION
},
service = ActionCommand.class
)
and now it will be:
@Component(
immediate = true,
property = {
"javax.portlet.name=" + InvitationPortletKeys.INVITATION,
"mvc.command.name=view"
},
service = MVCActionCommand.class
)
Finally, one other thing that is necessary to take in consideration is that the previous ActionCommands were valid for both ActionURL and ResourceURL. However, now we have to distinguish both ActionURL and ResourceURL as different action, so you can actually map both with the same key and it will work (not like before).
So, if people were using ActionCommand for resourceURLs now they will need to use MVCResourceCommand for them and instead of using the parameter ActionRequest.ACTION_NAME they will need to use resourceID in the resourceURL.
Details
Details
Assignee

Reporter

Labels
Git Pull Request
Components
Fix versions
Priority
Zendesk Support
Linked Tickets
Zendesk Support

The current MVC framework provided by Liferay through MVCPortlet.java supports to have ActionCommand.java. Those ActionCommand classes can be OSGi components that are registered and are executed for both actionURLs and resourceURLs.
This is limiting because developers should be able to register a ActionCommand for a actionURL and other ActionCommand for a resourceURL using the same command.name for both.
Besides supporting Action and Resource we should also include support to handle renderURLs because currently the MVCPortlet framework only allows to do redirect to a specific JSP using the mvcPath parameter. Developers should also be able to register a particular Action for renderURLs so the render method of those actions are executed.