1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
package org.apache.jetspeed.aggregator.impl; |
18 |
|
|
19 |
|
import javax.portlet.PortletPreferences; |
20 |
|
|
21 |
|
import org.apache.jetspeed.portlet.PortletHeaderRequest; |
22 |
|
import org.apache.jetspeed.request.RequestContext; |
23 |
|
import org.apache.pluto.core.impl.PortletPreferencesImpl; |
24 |
|
import org.apache.pluto.om.common.ParameterSet; |
25 |
|
import org.apache.pluto.om.common.Parameter; |
26 |
|
import org.apache.pluto.om.window.PortletWindow; |
27 |
|
|
28 |
|
|
29 |
|
public class PortletHeaderRequestImpl implements PortletHeaderRequest |
30 |
|
{ |
31 |
|
private RequestContext requestContext; |
32 |
|
private String portletApplicationContextPath; |
33 |
|
private PortletWindow portletWindow; |
34 |
|
private ParameterSet initParamSet; |
35 |
|
|
36 |
|
public PortletHeaderRequestImpl( RequestContext requestContext, PortletWindow portletWindow, String portletApplicationContextPath ) |
37 |
0 |
{ |
38 |
0 |
this.requestContext = requestContext; |
39 |
0 |
this.portletApplicationContextPath = portletApplicationContextPath; |
40 |
0 |
this.portletWindow = portletWindow; |
41 |
0 |
} |
42 |
|
|
43 |
|
public String getPortalContextPath() |
44 |
|
{ |
45 |
0 |
return requestContext.getRequest().getContextPath(); |
46 |
|
} |
47 |
|
|
48 |
|
public PortletPreferences getPreferences() |
49 |
|
{ |
50 |
0 |
return new PortletPreferencesImpl(org.apache.pluto.Constants.METHOD_NOOP, this.portletWindow.getPortletEntity()); |
51 |
|
} |
52 |
|
|
53 |
|
public String getInitParameter( String name ) |
54 |
|
{ |
55 |
0 |
ParameterSet iParamSet = this.initParamSet; |
56 |
0 |
if ( iParamSet == null ) |
57 |
|
{ |
58 |
0 |
iParamSet = this.portletWindow.getPortletEntity().getPortletDefinition().getInitParameterSet(); |
59 |
0 |
this.initParamSet = iParamSet; |
60 |
|
} |
61 |
0 |
if ( iParamSet != null ) |
62 |
|
{ |
63 |
0 |
Parameter initParam = iParamSet.get( name ); |
64 |
0 |
if ( initParam != null ) |
65 |
|
{ |
66 |
0 |
return initParam.getValue(); |
67 |
|
} |
68 |
|
} |
69 |
0 |
return null; |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
public String getPortletApplicationContextPath() |
76 |
|
{ |
77 |
0 |
return portletApplicationContextPath; |
78 |
|
} |
79 |
|
|
80 |
|
} |