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.services.information;
1819import java.util.Map;
2021import javax.portlet.PortletMode;
22import javax.portlet.WindowState;
2324import org.apache.jetspeed.container.url.PortalURL;
25import org.apache.jetspeed.request.RequestContext;
26import org.apache.pluto.om.window.PortletWindow;
27import org.apache.pluto.services.information.PortletURLProvider;
2829/***30 * Provides access to the Portal URL manipulation 31 * 32 *33 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>34 * @version $Id: PortletURLProviderImpl.java 516448 2007-03-09 16:25:47Z ate $35 */36publicclassPortletURLProviderImpl implements PortletURLProvider
37 {
38private PortletWindow portletWindow = null;
39private PortletMode mode = null;
40private WindowState state = null;
41privateboolean action = false;
42privateboolean secure = false;
43private Map parameters = null;
4445private PortalURL url;
4647publicPortletURLProviderImpl(RequestContext context, PortletWindow portletWindow)
48 {
49this.portletWindow = portletWindow;
5051 url = context.getPortalURL();
52 }
5354publicvoid setPortletMode(PortletMode mode)
55 {
56this.mode = mode;
57 }
5859publicvoid setWindowState(WindowState state)
60 {
61this.state = state;
62 }
6364publicvoid setAction()
65 {
66 action = true;
67 }
6869publicvoid setSecure()
70 {
71 secure = true;
72 }
7374publicvoid clearParameters()
75 {
76// not used, handled by JetspeedNavigationalStateCodec itself77 }
7879publicvoid setParameters(Map parameters)
80 {
81this.parameters = parameters;
82 }
8384public String toString()
85 {
86return url.createPortletURL(portletWindow,parameters,mode,state,action,secure);
87 }
88 }