Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Modify the action to edit article.
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:
What should I do in Liferay DXP to modify the action of edit article?
Thank you very much.
Regards,
Patricia
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
All of the same things that are found here: https://github.com/liferay/liferay-blade-samples/tree/master/liferay-workspace/modules/blade.doclib.resourcecommand.override
Come meet me at the 2017 LSNA!
Come meet me at the 2017 LSNA!
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
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
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!
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!
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.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™