1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services.information;
18
19 import java.util.Map;
20
21 import javax.portlet.PortletMode;
22 import javax.portlet.WindowState;
23
24 import org.apache.jetspeed.container.url.PortalURL;
25 import org.apache.jetspeed.request.RequestContext;
26 import org.apache.pluto.om.window.PortletWindow;
27 import org.apache.pluto.services.information.PortletURLProvider;
28
29 /***
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 */
36 public class PortletURLProviderImpl implements PortletURLProvider
37 {
38 private PortletWindow portletWindow = null;
39 private PortletMode mode = null;
40 private WindowState state = null;
41 private boolean action = false;
42 private boolean secure = false;
43 private Map parameters = null;
44
45 private PortalURL url;
46
47 public PortletURLProviderImpl(RequestContext context, PortletWindow portletWindow)
48 {
49 this.portletWindow = portletWindow;
50
51 url = context.getPortalURL();
52 }
53
54 public void setPortletMode(PortletMode mode)
55 {
56 this.mode = mode;
57 }
58
59 public void setWindowState(WindowState state)
60 {
61 this.state = state;
62 }
63
64 public void setAction()
65 {
66 action = true;
67 }
68
69 public void setSecure()
70 {
71 secure = true;
72 }
73
74 public void clearParameters()
75 {
76
77 }
78
79 public void setParameters(Map parameters)
80 {
81 this.parameters = parameters;
82 }
83
84 public String toString()
85 {
86 return url.createPortletURL(portletWindow,parameters,mode,state,action,secure);
87 }
88 }