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.*;
23 import org.apache.pluto.core.*;
24
25 import org.apache.pluto.om.window.PortletWindow;
26 import org.apache.pluto.om.portlet.PortletDefinition;
27 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
28
29
30 public class PortletUtils
31 {
32
33
34 public static PortletWindow getPortletWindow(RenderRequest request)
35 {
36 InternalPortletRequest internalRequest = CoreUtils.getInternalRequest(request);
37 return internalRequest.getInternalPortletWindow();
38 }
39
40 public static PortletWindow getPortletWindow(ActionRequest request)
41 {
42 InternalPortletRequest internalRequest = CoreUtils.getInternalRequest(request);
43 return internalRequest.getInternalPortletWindow();
44 }
45
46
47 public static PortletWindow getPortletWindow(RenderResponse response)
48 {
49 InternalPortletResponse internalResponse = CoreUtils.getInternalResponse(response);
50 return internalResponse.getInternalPortletWindow();
51 }
52
53 public static PortletWindow getPortletWindow(ActionResponse response)
54 {
55 InternalPortletResponse internalResponse = CoreUtils.getInternalResponse(response);
56 return internalResponse.getInternalPortletWindow();
57 }
58
59
60 public static javax.servlet.ServletConfig getServletConfig(PortletConfig config)
61 {
62 InternalPortletConfig internalConfig = CoreUtils.getInternalConfig(config);
63 return internalConfig.getServletConfig();
64 }
65
66 public static PortletDefinition getPortletDefinition(PortletConfig config)
67 {
68 InternalPortletConfig internalConfig = CoreUtils.getInternalConfig(config);
69 return internalConfig.getInternalPortletDefinition();
70 }
71
72
73 public static javax.servlet.ServletContext getServletContext(PortletContext context)
74 {
75 InternalPortletContext internalContext = CoreUtils.getInternalContext(context);
76 return internalContext.getServletContext();
77 }
78
79 public static PortletApplicationDefinition getPortletApplicationDefinition(PortletContext context)
80 {
81 InternalPortletContext internalContext = CoreUtils.getInternalContext(context);
82 return internalContext.getInternalPortletApplicationDefinition();
83 }
84
85 }