1
22
23 package com.liferay.portlet;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.kernel.bean.BeanLocatorUtil;
28 import com.liferay.portal.model.Layout;
29 import com.liferay.portal.model.Portlet;
30 import com.liferay.portal.model.PortletPreferencesIds;
31
32 import javax.portlet.ActionRequest;
33 import javax.portlet.PortletPreferences;
34 import javax.portlet.PreferencesValidator;
35 import javax.portlet.RenderRequest;
36
37 import javax.servlet.http.HttpServletRequest;
38
39
46 public class PortletPreferencesFactoryUtil {
47
48 public static PortalPreferences getPortalPreferences(HttpServletRequest req)
49 throws PortalException, SystemException {
50
51 return getPortletPreferencesFactory().getPortalPreferences(req);
52 }
53
54 public static PortalPreferences getPortalPreferences(ActionRequest req)
55 throws PortalException, SystemException {
56
57 return getPortletPreferencesFactory().getPortalPreferences(req);
58 }
59
60 public static PortalPreferences getPortalPreferences(RenderRequest req)
61 throws PortalException, SystemException {
62
63 return getPortletPreferencesFactory().getPortalPreferences(req);
64 }
65
66 public static PortletPreferences getPortletPreferences(
67 HttpServletRequest req, String portletId)
68 throws PortalException, SystemException {
69
70 return getPortletPreferencesFactory().getPortletPreferences(
71 req, portletId);
72 }
73
74 public static PortletPreferencesFactory getPortletPreferencesFactory() {
75 return _getUtil()._portletPreferencesFactory;
76 }
77
78 public static PortletPreferencesIds getPortletPreferencesIds(
79 HttpServletRequest req, String portletId)
80 throws PortalException, SystemException {
81
82 return getPortletPreferencesFactory().getPortletPreferencesIds(
83 req, portletId);
84 }
85
86 public static PortletPreferencesIds getPortletPreferencesIds(
87 HttpServletRequest req, Layout selLayout, String portletId)
88 throws PortalException, SystemException {
89
90 return getPortletPreferencesFactory().getPortletPreferencesIds(
91 req, selLayout, portletId);
92 }
93
94 public static PortletPreferences getPortletSetup(
95 Layout layout, String portletId)
96 throws PortalException, SystemException {
97
98 return getPortletPreferencesFactory().getPortletSetup(
99 layout, portletId);
100 }
101
102 public static PortletPreferences getPortletSetup(
103 HttpServletRequest req, String portletId)
104 throws PortalException, SystemException {
105
106 return getPortletPreferencesFactory().getPortletSetup(req, portletId);
107 }
108
109 public static PortletPreferences getPortletSetup(
110 HttpServletRequest req, String portletId, String defaultPreferences)
111 throws PortalException, SystemException {
112
113 return getPortletPreferencesFactory().getPortletSetup(
114 req, portletId, defaultPreferences);
115 }
116
117 public static PortletPreferences getPortletSetup(
118 ActionRequest req, String portletId)
119 throws PortalException, SystemException {
120
121 return getPortletPreferencesFactory().getPortletSetup(req, portletId);
122 }
123
124 public static PortletPreferences getPortletSetup(
125 RenderRequest req, String portletId)
126 throws PortalException, SystemException {
127
128 return getPortletPreferencesFactory().getPortletSetup(req, portletId);
129 }
130
131 public static PortletPreferences getPreferences(HttpServletRequest req) {
132 return getPortletPreferencesFactory().getPreferences(req);
133 }
134
135 public static PreferencesValidator getPreferencesValidator(
136 Portlet portlet) {
137
138 return getPortletPreferencesFactory().getPreferencesValidator(portlet);
139 }
140
141 public void setPortletPreferencesFactory(
142 PortletPreferencesFactory portletPreferencesFactory) {
143
144 _portletPreferencesFactory = portletPreferencesFactory;
145 }
146
147 private static PortletPreferencesFactoryUtil _getUtil() {
148 if (_util == null) {
149 _util =
150 (PortletPreferencesFactoryUtil)BeanLocatorUtil.locate(_UTIL);
151 }
152
153 return _util;
154 }
155
156 private static final String _UTIL =
157 PortletPreferencesFactoryUtil.class.getName();
158
159 private static PortletPreferencesFactoryUtil _util;
160
161 private PortletPreferencesFactory _portletPreferencesFactory;
162
163 }