Thanks for the answers! At first, I was more confused than before, but I managed to code it. Actually, instead of overriding a class, this approach puts a wrapper around the method call in question and reverts some of the attributes to it's original (desired) value. It's okay for my goals, but it's not as flexible as my original idea (By now, I think I'd actually need a EXT plugin for that ... or not?).
For the record: I created a hook plugin in Eclipse/Liferay IDE and replaced a few JSPs (see standard tutorials) from the requests portlet. As soon as that worked, I had to do the following steps:
WEB-INF/liferay-hook.xml 1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.1.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_1_0.dtd">
3
4<hook>
5 <custom-jsp-dir>/custom_jsps</custom-jsp-dir>
6 <struts-action>
7 <struts-action-path>/requests/view</struts-action-path>
8 <struts-action-impl>com.liferay.portlet.customrequests.action.ViewAction</struts-action-impl>
9 </struts-action>
10</hook>
I found the relevant struts-action-path in ROOT/WEB-INF/struts-config.xml by looking for "requests" and "ViewAction".
Then I created a new class in my hook:
ViewAction.java (in package com.liferay.portlet.customrequests.action)
1
2package com.liferay.portlet.customrequests.action;
3
4import com.liferay.portal.kernel.struts.BaseStrutsPortletAction;
5import com.liferay.portal.kernel.struts.StrutsPortletAction;
6
7import javax.portlet.ActionRequest;
8import javax.portlet.ActionResponse;
9import javax.portlet.PortletConfig;
10import javax.portlet.RenderRequest;
11import javax.portlet.RenderResponse;
12import javax.portlet.ResourceRequest;
13import javax.portlet.ResourceResponse;
14
15import com.liferay.portal.util.WebKeys;
16
17public class ViewAction extends BaseStrutsPortletAction {
18
19 public void processAction(
20 StrutsPortletAction originalStrutsPortletAction,
21 PortletConfig portletConfig, ActionRequest actionRequest,
22 ActionResponse actionResponse)
23 throws Exception {
24 originalStrutsPortletAction.processAction(
25 originalStrutsPortletAction, portletConfig, actionRequest,
26 actionResponse);
27 }
28
29 public String render(
30 StrutsPortletAction originalStrutsPortletAction,
31 PortletConfig portletConfig, RenderRequest renderRequest,
32 RenderResponse renderResponse)
33 throws Exception {
34 String ret = originalStrutsPortletAction.render(
35 null, portletConfig, renderRequest, renderResponse);
36 renderRequest.setAttribute(WebKeys.PORTLET_DECORATE, Boolean.TRUE);
37 return ret;
38 }
39
40 public void serveResource(
41 StrutsPortletAction originalStrutsPortletAction,
42 PortletConfig portletConfig, ResourceRequest resourceRequest,
43 ResourceResponse resourceResponse)
44 throws Exception {
45 originalStrutsPortletAction.serveResource(
46 originalStrutsPortletAction, portletConfig, resourceRequest,
47 resourceResponse);
48 }
49}
The only relevant line that changed behaviour actually is the renderRequest.setAttribute(...) line...
Export to WAR file, deploy -- works!
Be kell jelentkezni ahhoz, hogy ez helytelenként legyen megjelölve.