1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.pluto.portlet;
21
22 import javax.portlet.ActionRequest;
23 import javax.portlet.ActionResponse;
24 import javax.portlet.PortletConfig;
25 import javax.portlet.PortletContext;
26 import javax.portlet.RenderRequest;
27 import javax.portlet.RenderResponse;
28
29 import org.apache.pluto.core.CoreUtils;
30 import org.apache.pluto.core.InternalPortletConfig;
31 import org.apache.pluto.core.InternalPortletContext;
32 import org.apache.pluto.core.InternalPortletRequest;
33 import org.apache.pluto.core.InternalPortletResponse;
34 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
35 import org.apache.pluto.om.portlet.PortletDefinition;
36 import org.apache.pluto.om.window.PortletWindow;
37
38
39 public class PortletUtils
40 {
41
42
43 public static PortletWindow getPortletWindow(RenderRequest request)
44 {
45 InternalPortletRequest internalRequest = CoreUtils.getInternalRequest(request);
46 return internalRequest.getInternalPortletWindow();
47 }
48
49 public static PortletWindow getPortletWindow(ActionRequest request)
50 {
51 InternalPortletRequest internalRequest = CoreUtils.getInternalRequest(request);
52 return internalRequest.getInternalPortletWindow();
53 }
54
55
56 public static PortletWindow getPortletWindow(RenderResponse response)
57 {
58 InternalPortletResponse internalResponse = CoreUtils.getInternalResponse(response);
59 return internalResponse.getInternalPortletWindow();
60 }
61
62 public static PortletWindow getPortletWindow(ActionResponse response)
63 {
64 InternalPortletResponse internalResponse = CoreUtils.getInternalResponse(response);
65 return internalResponse.getInternalPortletWindow();
66 }
67
68
69 public static javax.servlet.ServletConfig getServletConfig(PortletConfig config)
70 {
71 InternalPortletConfig internalConfig = CoreUtils.getInternalConfig(config);
72 return internalConfig.getServletConfig();
73 }
74
75 public static PortletDefinition getPortletDefinition(PortletConfig config)
76 {
77 InternalPortletConfig internalConfig = CoreUtils.getInternalConfig(config);
78 return internalConfig.getInternalPortletDefinition();
79 }
80
81
82 public static javax.servlet.ServletContext getServletContext(PortletContext context)
83 {
84 InternalPortletContext internalContext = CoreUtils.getInternalContext(context);
85 return internalContext.getServletContext();
86 }
87
88 public static PortletApplicationDefinition getPortletApplicationDefinition(PortletContext context)
89 {
90 InternalPortletContext internalContext = CoreUtils.getInternalContext(context);
91 return internalContext.getInternalPortletApplicationDefinition();
92 }
93
94 }