1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 * 9 * http://www.apache.org/licenses/LICENSE-2.010 * 11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */17packageorg.apache.jetspeed.aggregator.impl;
1819import javax.portlet.PortletPreferences;
2021import org.apache.jetspeed.portlet.PortletHeaderRequest;
22import org.apache.jetspeed.request.RequestContext;
23import org.apache.pluto.core.impl.PortletPreferencesImpl;
24import org.apache.pluto.om.common.ParameterSet;
25import org.apache.pluto.om.common.Parameter;
26import org.apache.pluto.om.window.PortletWindow;
272829publicclassPortletHeaderRequestImpl implements PortletHeaderRequest
30 {
31private RequestContext requestContext;
32private String portletApplicationContextPath;
33private PortletWindow portletWindow;
34private ParameterSet initParamSet;
3536publicPortletHeaderRequestImpl( RequestContext requestContext, PortletWindow portletWindow, String portletApplicationContextPath )
37 {
38this.requestContext = requestContext;
39this.portletApplicationContextPath = portletApplicationContextPath;
40this.portletWindow = portletWindow;
41 }
4243public String getPortalContextPath()
44 {
45return requestContext.getRequest().getContextPath();
46 }
4748public PortletPreferences getPreferences()
49 {
50returnnew PortletPreferencesImpl(org.apache.pluto.Constants.METHOD_NOOP, this.portletWindow.getPortletEntity());
51 }
5253public String getInitParameter( String name )
54 {
55 ParameterSet iParamSet = this.initParamSet;
56if ( iParamSet == null )
57 {
58 iParamSet = this.portletWindow.getPortletEntity().getPortletDefinition().getInitParameterSet();
59this.initParamSet = iParamSet;
60 }
61if ( iParamSet != null )
62 {
63 Parameter initParam = iParamSet.get( name );
64if ( initParam != null )
65 {
66return initParam.getValue();
67 }
68 }
69returnnull;
70 }
7172/***73 * @return Returns the portletApplicationContextPath.74 */75public String getPortletApplicationContextPath()
76 {
77return portletApplicationContextPath;
78 }
7980 }