1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.pluto.core.impl;
21
22 import java.io.InputStream;
23
24 import javax.portlet.ActionRequest;
25 import javax.portlet.PortletPreferences;
26
27 import org.apache.pluto.factory.PortletObjectAccess;
28 import org.apache.pluto.om.window.PortletWindow;
29
30 /***
31
32 *
33 * To change this generated comment edit the template variable "typecomment":
34 * Window>Preferences>Java>Templates.
35 * To enable and disable the creation of type comments go to
36 * Window>Preferences>Java>Code Generation.
37 */
38 public class ActionRequestImpl extends PortletRequestImpl implements ActionRequest
39 {
40 /***
41 * Holds the portlet preferences
42 */
43 private PortletPreferences portletPreferences;
44
45 public ActionRequestImpl(PortletWindow portletWindow,
46 javax.servlet.http.HttpServletRequest servletRequest)
47 {
48 super(portletWindow, servletRequest);
49 }
50
51
52
53
54
55 public InputStream getPortletInputStream () throws java.io.IOException
56 {
57 javax.servlet.http.HttpServletRequest servletRequest = (javax.servlet.http.HttpServletRequest) super.getRequest();
58
59 if (servletRequest.getMethod().equals("POST"))
60 {
61 String contentType=servletRequest.getContentType();
62 if (contentType==null||contentType.equals("application/x-www-form-urlencoded"))
63 {
64 throw new java.lang.IllegalStateException(
65 "User request HTTP POST data is of type application/x-www-form-urlencoded. This data has been already processed by the portal/portlet-container and is available as request parameters."
66 );
67 }
68 }
69 return servletRequest.getInputStream();
70 }
71
72
73
74 public PortletPreferences getPreferences()
75 {
76 if (this.portletPreferences == null)
77 {
78 this.portletPreferences = PortletObjectAccess.getPortletPreferences(org.apache.pluto.Constants.METHOD_ACTION, super.getInternalPortletWindow().getPortletEntity());
79 }
80 return this.portletPreferences;
81 }
82
83 }