1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.kernel.portlet;
21  
22  import java.io.IOException;
23  import java.io.Writer;
24  
25  import java.util.Map;
26  
27  import javax.portlet.PortletMode;
28  import javax.portlet.PortletModeException;
29  import javax.portlet.PortletSecurityException;
30  import javax.portlet.PortletURL;
31  import javax.portlet.WindowState;
32  import javax.portlet.WindowStateException;
33  
34  /**
35   * <a href="PortletURLWrapper.java.html"><b><i>View Source</i></b></a>
36   *
37   * @author Brian Wing Shun Chan
38   *
39   */
40  public class PortletURLWrapper implements PortletURL {
41  
42      public PortletURLWrapper(PortletURL portletURL) {
43          _portletURL = portletURL;
44      }
45  
46      public void addProperty(String key, String value) {
47          _portletURL.addProperty(key, value);
48      }
49  
50      public Map<String, String[]> getParameterMap() {
51          return _portletURL.getParameterMap();
52      }
53  
54      public PortletMode getPortletMode() {
55          return _portletURL.getPortletMode();
56      }
57  
58      public WindowState getWindowState() {
59          return _portletURL.getWindowState();
60      }
61  
62      public void removePublicRenderParameter(String name) {
63          _portletURL.removePublicRenderParameter(name);
64      }
65  
66      public void setParameter(String name, String value) {
67          _portletURL.setParameter(name, value);
68      }
69  
70      public void setParameter(String name, String[] values) {
71          _portletURL.setParameter(name, values);
72      }
73  
74      public void setParameters(Map<String, String[]> parameters) {
75          _portletURL.setParameters(parameters);
76      }
77  
78      public void setPortletMode(PortletMode portletMode)
79          throws PortletModeException{
80  
81          _portletURL.setPortletMode(portletMode);
82      }
83  
84      public void setProperty(String key, String value) {
85          _portletURL.setProperty(key, value);
86      }
87  
88      public void setSecure(boolean secure) throws PortletSecurityException {
89          _portletURL.setSecure(secure);
90      }
91  
92      public void setWindowState(WindowState windowState)
93          throws WindowStateException {
94  
95          _portletURL.setWindowState(windowState);
96      }
97  
98      public String toString() {
99          return _portletURL.toString();
100     }
101 
102     public void write(Writer writer) throws IOException {
103         _portletURL.write(writer);
104     }
105 
106     public void write(Writer writer, boolean escapeXML) throws IOException {
107         _portletURL.write(writer, escapeXML);
108     }
109 
110     private PortletURL _portletURL;
111 
112 }