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
Overriding Liferay MVC Commands in 7.2
I am trying to override the document library EditFolderMVCActionCommand class. I've created the class following the instructions found here: https://help.liferay.com/hc/en-us/articles/360028831752-Introduction-to-Overriding-Liferay-MVC-Commands
Below is my class, my problem is that when I edit a DL folder the parent class processAction is being called but my class is not. Any help or advice as to what I'm doing wrong is appreciated.
-Steve
package gov.nasa.hq.liferay.document.library.folder;
import com.liferay.document.library.constants.DLPortletKeys;
import com.liferay.portal.kernel.log.Log;
import
com.liferay.portal.kernel.log.LogFactoryUtil;
import
com.liferay.portal.kernel.portlet.bridges.mvc.BaseMVCActionCommand;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCActionCommand;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
/**
* @author sweiss
*
*/
@Component(
immediate = true,
property =
{
"javax.portlet.name=" +
DLPortletKeys.DOCUMENT_LIBRARY,
"javax.portlet.name=" +
DLPortletKeys.DOCUMENT_LIBRARY_ADMIN,
"javax.portlet.name=" +
DLPortletKeys.MEDIA_GALLERY_DISPLAY,
"mvc.command.name=/document_library/edit_folder",
"service.ranking:Integer=100"
},
service = MVCActionCommand.class)
public class
CustomEditFolderMVCActionCommand extends BaseMVCActionCommand {
private static Log _log = LogFactoryUtil.getLog(CustomEditFolderMVCActionCommand.class);;
@Reference(
target =
"(component.name=com.liferay.document.library.web.internal.portlet.action.EditFolderMVCActionCommand)")
protected MVCActionCommand mvcActionCommand;
@Override
protected void doProcessAction(ActionRequest
request, ActionResponse response) throws Exception {
String ID = "doProcessAction: ";
_log.info(ID + "ENTER");
mvcActionCommand.processAction(request, response);
_log.info(ID + "EXIT");
}
}
Powered by Liferay™