Skip to content

Instantly share code, notes, and snippets.

@gamerson
Created March 8, 2016 00:10
Show Gist options
  • Select an option

  • Save gamerson/8e10d0245b1efcbd438f to your computer and use it in GitHub Desktop.

Select an option

Save gamerson/8e10d0245b1efcbd438f to your computer and use it in GitHub Desktop.
OverrideEditFolderMVCResourceCommand.java
import javax.portlet.PortletException;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
import org.osgi.service.component.annotations.Component;
import com.liferay.document.library.web.constants.DLPortletKeys;
import com.liferay.document.library.web.portlet.action.EditFolderMVCResourceCommand;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCResourceCommand;
@Component(
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=1000"
},
service = MVCResourceCommand.class
)
public class OverrideEditFolderMVCResourceCommand extends EditFolderMVCResourceCommand {
@Override
public boolean serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws PortletException {
// do something then call super
return super.serveResource(resourceRequest, resourceResponse);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment