KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > portlet > impl > ActionRequestImpl


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.portlet.impl;
10
11 import java.io.BufferedReader JavaDoc;
12 import java.io.IOException JavaDoc;
13 import java.io.InputStream JavaDoc;
14 import java.io.UnsupportedEncodingException JavaDoc;
15 import java.util.Enumeration JavaDoc;
16 import java.util.Map JavaDoc;
17
18 import javax.portlet.ActionRequest;
19 import javax.portlet.PortletPreferences;
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21
22 import org.jboss.portal.server.PortalRequest;
23 import org.jboss.portal.server.PortalResponse;
24 import org.jboss.portal.server.Window;
25 import org.jboss.portal.server.WindowContext;
26 import org.jboss.portal.server.user.UserContext;
27
28 /**
29  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
30  * @version $Revision: 1.2 $
31  */

32 public class ActionRequestImpl extends PortletRequestImpl implements ActionRequest
33 {
34
35    public ActionRequestImpl(
36          UserContext userContext,
37          PortletPreferences preferences,
38          Window window,
39          WindowContext windowCtx,
40          PortalRequest req,
41          PortalResponse resp,
42          HttpServletRequest JavaDoc dreq)
43    {
44       super(userContext, preferences, window, windowCtx, req, resp, dreq);
45       preferences = null;
46    }
47
48    // PLT.11.1.1
49

50    public String JavaDoc getParameter(String JavaDoc s)
51    {
52       return req.getTargetParameters().getParameter(s);
53    }
54
55    public Enumeration JavaDoc getParameterNames()
56    {
57       return req.getTargetParameters().getParameterNames();
58    }
59
60    public String JavaDoc[] getParameterValues(String JavaDoc s)
61    {
62       return req.getTargetParameters().getParameterValues(s);
63    }
64
65    public Map JavaDoc getParameterMap()
66    {
67       return req.getTargetParameters().getParameterMap();
68    }
69
70    //
71

72    public InputStream JavaDoc getPortletInputStream() throws IOException JavaDoc
73    {
74       return req.getInputStream();
75    }
76
77    public void setCharacterEncoding(String JavaDoc s) throws UnsupportedEncodingException JavaDoc
78    {
79       // This method is frankly stupid
80
throw new IllegalStateException JavaDoc("called after the body has been read");
81       // req.setCharacterEncoding(s);
82
}
83
84    public BufferedReader JavaDoc getReader() throws UnsupportedEncodingException JavaDoc, IOException JavaDoc
85    {
86       return req.getReader();
87    }
88
89    public String JavaDoc getCharacterEncoding()
90    {
91       return req.getCharacterEncoding();
92    }
93
94    public String JavaDoc getContentType()
95    {
96       return req.getContentType();
97    }
98
99    public int getContentLength()
100    {
101       return req.getContentLength();
102    }
103 }
104
Popular Tags