KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > knowgate > http > portlets > HipergateRenderResponse


1 /*
2   Copyright (C) 2003-2006 Know Gate S.L. All rights reserved.
3                            C/Oņa, 107 1š2 28050 Madrid (Spain)
4
5   Redistribution and use in source and binary forms, with or without
6   modification, are permitted provided that the following conditions
7   are met:
8
9   1. Redistributions of source code must retain the above copyright
10      notice, this list of conditions and the following disclaimer.
11
12   2. The end-user documentation included with the redistribution,
13      if any, must include the following acknowledgment:
14      "This product includes software parts from hipergate
15      (http://www.hipergate.org/)."
16      Alternately, this acknowledgment may appear in the software itself,
17      if and wherever such third-party acknowledgments normally appear.
18
19   3. The name hipergate must not be used to endorse or promote products
20      derived from this software without prior written permission.
21      Products derived from this software may not be called hipergate,
22      nor may hipergate appear in their name, without prior written
23      permission.
24
25   This library is distributed in the hope that it will be useful,
26   but WITHOUT ANY WARRANTY; without even the implied warranty of
27   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28
29   You should have received a copy of hipergate License with this code;
30   if not, visit http://www.hipergate.org or mail to info@hipergate.org
31 */

32
33 package com.knowgate.http.portlets;
34
35 import java.util.Hashtable JavaDoc;
36 import java.util.Enumeration JavaDoc;
37 import java.util.Properties JavaDoc;
38 import java.util.Map JavaDoc;
39 import java.util.Locale JavaDoc;
40 import java.util.Locale JavaDoc;
41
42 import java.io.IOException JavaDoc;
43 import java.io.PrintWriter JavaDoc;
44 import java.io.OutputStream JavaDoc;
45 import java.io.ByteArrayOutputStream JavaDoc;
46
47 import javax.portlet.PortletURL;
48 import javax.portlet.RenderResponse;
49
50 import javax.servlet.http.HttpServletResponse JavaDoc;
51
52 /**
53  * @author Sergio Montoro Ten
54  * @version 1.0
55  */

56
57 public class HipergateRenderResponse implements RenderResponse {
58
59   private Properties JavaDoc oProps;
60   private HttpServletResponse JavaDoc oSrvltRes;
61
62   public HipergateRenderResponse (HttpServletResponse JavaDoc oServletRes) {
63     oProps = new Properties JavaDoc();
64     oSrvltRes = oServletRes;
65   }
66
67   public void setProperty(String JavaDoc key, String JavaDoc value) {
68     oProps.setProperty (key, value);
69   }
70
71   public void addProperty(String JavaDoc key, String JavaDoc value) {
72     String JavaDoc sProp = oProps.getProperty(key);
73
74     if (sProp==null)
75       oProps.setProperty (key, value);
76     else {
77       oProps.remove(key);
78       oProps.setProperty(key, sProp + ";" + value);
79     }
80   }
81
82   public String JavaDoc encodeURL (String JavaDoc path) {
83     return oSrvltRes.encodeURL(path);
84   }
85
86   public String JavaDoc getContentType () {
87     throw new UnsupportedOperationException JavaDoc ("getContentType() not implemented HipergateRenderRequest");
88   }
89
90   public PortletURL createRenderURL () {
91     throw new UnsupportedOperationException JavaDoc ("createRenderURL() not implemented HipergateRenderRequest");
92   }
93
94   public PortletURL createActionURL () {
95     throw new UnsupportedOperationException JavaDoc ("createActionURL() not implemented HipergateRenderRequest");
96   }
97
98   public String JavaDoc getNamespace () {
99     throw new UnsupportedOperationException JavaDoc ("getNamespace() not implemented HipergateRenderRequest");
100   }
101
102   public void setTitle(String JavaDoc title) {
103     throw new UnsupportedOperationException JavaDoc ("setTitle() not implemented HipergateRenderRequest");
104   }
105
106   public void setContentType(String JavaDoc type) {
107     oSrvltRes.setContentType(type);
108   }
109
110    public String JavaDoc getCharacterEncoding() {
111      return oSrvltRes.getCharacterEncoding();
112    }
113
114    public PrintWriter JavaDoc getWriter() throws IOException JavaDoc {
115      return oSrvltRes.getWriter();
116    }
117
118    public Locale JavaDoc getLocale() {
119      return oSrvltRes.getLocale();
120    }
121
122    public void setBufferSize(int size) {
123     oSrvltRes.setBufferSize(size);
124    }
125
126    public int getBufferSize() {
127      return oSrvltRes.getBufferSize();
128    }
129
130    public void flushBuffer() throws IOException JavaDoc {
131      oSrvltRes.flushBuffer();
132    }
133
134    public void resetBuffer() {
135      oSrvltRes.resetBuffer();
136    }
137
138    public boolean isCommitted() {
139      return oSrvltRes.isCommitted();
140    }
141
142    public void reset() {
143      oSrvltRes.reset();
144    }
145
146    public OutputStream JavaDoc getPortletOutputStream() throws IOException JavaDoc {
147      return oSrvltRes.getOutputStream();
148    }
149
150 }
151
Popular Tags