1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.portlet;
24  
25  import java.io.IOException;
26  import java.io.Writer;
27  
28  import java.util.Map;
29  
30  import javax.portlet.PortletMode;
31  import javax.portlet.PortletModeException;
32  import javax.portlet.PortletSecurityException;
33  import javax.portlet.PortletURL;
34  import javax.portlet.WindowState;
35  import javax.portlet.WindowStateException;
36  
37  /**
38   * <a href="PortletURLWrapper.java.html"><b><i>View Source</i></b></a>
39   *
40   * @author Brian Wing Shun Chan
41   *
42   */
43  public class PortletURLWrapper implements PortletURL {
44  
45      public PortletURLWrapper(PortletURL portletURL) {
46          _portletURL = portletURL;
47      }
48  
49      public void addProperty(String key, String value) {
50          _portletURL.addProperty(key, value);
51      }
52  
53      public Map<String, String[]> getParameterMap() {
54          return _portletURL.getParameterMap();
55      }
56  
57      public PortletMode getPortletMode() {
58          return _portletURL.getPortletMode();
59      }
60  
61      public WindowState getWindowState() {
62          return _portletURL.getWindowState();
63      }
64  
65      public void removePublicRenderParameter(String name) {
66          _portletURL.removePublicRenderParameter(name);
67      }
68  
69      public void setParameter(String name, String value) {
70          _portletURL.setParameter(name, value);
71      }
72  
73      public void setParameter(String name, String[] values) {
74          _portletURL.setParameter(name, values);
75      }
76  
77      public void setParameters(Map<String, String[]> parameters) {
78          _portletURL.setParameters(parameters);
79      }
80  
81      public void setPortletMode(PortletMode portletMode)
82          throws PortletModeException{
83  
84          _portletURL.setPortletMode(portletMode);
85      }
86  
87      public void setProperty(String key, String value) {
88          _portletURL.setProperty(key, value);
89      }
90  
91      public void setSecure(boolean secure) throws PortletSecurityException {
92          _portletURL.setSecure(secure);
93      }
94  
95      public void setWindowState(WindowState windowState)
96          throws WindowStateException {
97  
98          _portletURL.setWindowState(windowState);
99      }
100 
101     public String toString() {
102         return _portletURL.toString();
103     }
104 
105     public void write(Writer writer) throws IOException {
106         _portletURL.write(writer);
107     }
108 
109     public void write(Writer writer, boolean escapeXML) throws IOException {
110         _portletURL.write(writer, escapeXML);
111     }
112 
113     private PortletURL _portletURL;
114 
115 }