1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  public class PortletURLWrapper implements PortletURL {
43  
44      public PortletURLWrapper(PortletURL portletURL) {
45          _portletURL = portletURL;
46      }
47  
48      public void addProperty(String key, String value) {
49          _portletURL.addProperty(key, value);
50      }
51  
52      public Map<String, String[]> getParameterMap() {
53          return _portletURL.getParameterMap();
54      }
55  
56      public PortletMode getPortletMode() {
57          return _portletURL.getPortletMode();
58      }
59  
60      public WindowState getWindowState() {
61          return _portletURL.getWindowState();
62      }
63  
64      public void removePublicRenderParameter(String name) {
65          _portletURL.removePublicRenderParameter(name);
66      }
67  
68      public void setParameter(String name, String value) {
69          _portletURL.setParameter(name, value);
70      }
71  
72      public void setParameter(String name, String[] values) {
73          _portletURL.setParameter(name, values);
74      }
75  
76      public void setParameters(Map<String, String[]> parameters) {
77          _portletURL.setParameters(parameters);
78      }
79  
80      public void setPortletMode(PortletMode portletMode)
81          throws PortletModeException{
82  
83          _portletURL.setPortletMode(portletMode);
84      }
85  
86      public void setProperty(String key, String value) {
87          _portletURL.setProperty(key, value);
88      }
89  
90      public void setSecure(boolean secure) throws PortletSecurityException {
91          _portletURL.setSecure(secure);
92      }
93  
94      public void setWindowState(WindowState windowState)
95          throws WindowStateException {
96  
97          _portletURL.setWindowState(windowState);
98      }
99  
100     public String toString() {
101         return _portletURL.toString();
102     }
103 
104     public void write(Writer writer) throws IOException {
105         _portletURL.write(writer);
106     }
107 
108     public void write(Writer writer, boolean escapeXML) throws IOException {
109         _portletURL.write(writer, escapeXML);
110     }
111 
112     private PortletURL _portletURL;
113 
114 }