01: /*
02: * (C) Copyright 2000 - 2003 Nabh Information Systems, Inc.
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License
06: * as published by the Free Software Foundation; either version 2
07: * of the License, or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: *
18: */
19:
20: package com.nabhinc.portal.container;
21:
22: import java.util.HashMap;
23: import java.util.Vector;
24:
25: import javax.portlet.PortletResponse;
26: import javax.servlet.http.HttpServletResponse;
27:
28: /**
29: *
30: *
31: * @author Padmanabh dabke
32: * (c) 2003 Nabh Information Systems, Inc. All Rights Reserved.
33: */
34: public class PortletResponseImpl implements PortletResponse {
35:
36: protected HttpServletResponse priResponse = null;
37:
38: protected PortalInterface priPortalInterface = null;
39:
40: protected HashMap priProperties = new HashMap();
41:
42: public PortletResponseImpl(HttpServletResponse resp) {
43: priResponse = resp;
44: }
45:
46: /**
47: * @see javax.portlet.PortletResponse#addProperty(java.lang.String, java.lang.String)
48: */
49: @SuppressWarnings("unchecked")
50: public void addProperty(String key, String value) {
51: Vector v = (Vector) priProperties.get(key);
52: if (v == null) {
53: v = new Vector(4);
54: v.addElement(value);
55: priProperties.put(key, v);
56: } else {
57: v.addElement(value);
58: }
59:
60: }
61:
62: /**
63: * @see javax.portlet.PortletResponse#setProperty(java.lang.String, java.lang.String)
64: */
65: @SuppressWarnings("unchecked")
66: public void setProperty(String key, String value) {
67: Vector v = new Vector(4);
68: v.addElement(value);
69: priProperties.put(key, v);
70:
71: }
72:
73: /**
74: * @see javax.portlet.PortletResponse#encodeURL(java.lang.String)
75: */
76: public String encodeURL(String path) {
77: return priResponse.encodeURL(path);
78: }
79:
80: public HttpServletResponse getHttpServletResponse() {
81: return priResponse;
82: }
83:
84: public void setHttpServletResponse(HttpServletResponse resp) {
85: priResponse = resp;
86: }
87:
88: public void clearProperties() {
89: priProperties.clear();
90: }
91:
92: public void setPortalInterface(PortalInterface pi) {
93: this.priPortalInterface = pi;
94: }
95:
96: }
|