RE: Modify the action to edit article.

Patricia Hevia, modified 8 Years ago. Junior Member Posts: 69 Join Date: 3/24/11 Recent Posts
Hello,

I am working with Liferay DXP and I would like to modify the action to edit article.
In Liferay 6.2, to modify the edit action I should do a struct action hook.
In Liferay DXP, the code to add an article is in the JournalPortlet class. The Liferay code is:

public class JournalPortlet extends MVCPortlet {
	public static final String VERSION_SEPARATOR = "_version_";
	public void addArticle(
			ActionRequest actionRequest, ActionResponse actionResponse)
		throws Exception {

		updateArticle(actionRequest, actionResponse);
	}
	..................
}


What should I do in Liferay DXP to modify the action of edit article?

Thank you very much.

Regards,
Patricia
Patricia Hevia, modified 8 Years ago. Junior Member Posts: 69 Join Date: 3/24/11 Recent Posts
Hello,

Thank you for your answer.

I have seen this example but I have some doubts.

In the example, the override resource class (EditFolderMVCResourceCommand) implements "MVCResourceCommand" but the "JournalPortlet" class extends "MVCPortlet". This class does not implements "MVCActionCommand". Can I modify the JournalPortlet in spite of this class extends "MVCPortlet"?

I do not know which "mvc.command.name" param I should indicate in Component annotation (@Component) because the JournalPortlet does not have this property. Which value property should I use?

Thank you very much.

Regards,
Patricia
thumbnail
David H Nebinger, modified 8 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Gotcha, yeah you can't modify methods embedded in the portlet class itself.

The solution I posted here would work: https://web.liferay.com/web/user.26526/blog/-/blogs/extending-liferay-osgi-modules

But it is very heavy handed; be sure to take note of all of the warnings in the post.




Come meet me at the 2017 LSNA!
thumbnail
Beatriz Valdés Suárez, modified 6 Years ago. Junior Member Posts: 50 Join Date: 3/31/14 Recent Posts
Hello Patricia,Could you resolve this? I'm with similar problem.