1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.LongWrapper;
28 import com.liferay.portal.kernel.util.MethodWrapper;
29 import com.liferay.portal.kernel.util.NullWrapper;
30 import com.liferay.portal.security.auth.HttpPrincipal;
31 import com.liferay.portal.service.PortletPreferencesServiceUtil;
32
33
72 public class PortletPreferencesServiceHttp {
73 public static void deleteArchivedPreferences(HttpPrincipal httpPrincipal,
74 long portletItemId)
75 throws com.liferay.portal.PortalException,
76 com.liferay.portal.SystemException {
77 try {
78 Object paramObj0 = new LongWrapper(portletItemId);
79
80 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
81 "deleteArchivedPreferences", new Object[] { paramObj0 });
82
83 try {
84 TunnelUtil.invoke(httpPrincipal, methodWrapper);
85 }
86 catch (Exception e) {
87 if (e instanceof com.liferay.portal.PortalException) {
88 throw (com.liferay.portal.PortalException)e;
89 }
90
91 if (e instanceof com.liferay.portal.SystemException) {
92 throw (com.liferay.portal.SystemException)e;
93 }
94
95 throw new com.liferay.portal.SystemException(e);
96 }
97 }
98 catch (com.liferay.portal.SystemException se) {
99 _log.error(se, se);
100
101 throw se;
102 }
103 }
104
105 public static void restoreArchivedPreferences(HttpPrincipal httpPrincipal,
106 long groupId, java.lang.String name, java.lang.String portletId,
107 javax.portlet.PortletPreferences preferences)
108 throws com.liferay.portal.PortalException,
109 com.liferay.portal.SystemException {
110 try {
111 Object paramObj0 = new LongWrapper(groupId);
112
113 Object paramObj1 = name;
114
115 if (name == null) {
116 paramObj1 = new NullWrapper("java.lang.String");
117 }
118
119 Object paramObj2 = portletId;
120
121 if (portletId == null) {
122 paramObj2 = new NullWrapper("java.lang.String");
123 }
124
125 Object paramObj3 = preferences;
126
127 if (preferences == null) {
128 paramObj3 = new NullWrapper("javax.portlet.PortletPreferences");
129 }
130
131 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
132 "restoreArchivedPreferences",
133 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
134
135 try {
136 TunnelUtil.invoke(httpPrincipal, methodWrapper);
137 }
138 catch (Exception e) {
139 if (e instanceof com.liferay.portal.PortalException) {
140 throw (com.liferay.portal.PortalException)e;
141 }
142
143 if (e instanceof com.liferay.portal.SystemException) {
144 throw (com.liferay.portal.SystemException)e;
145 }
146
147 throw new com.liferay.portal.SystemException(e);
148 }
149 }
150 catch (com.liferay.portal.SystemException se) {
151 _log.error(se, se);
152
153 throw se;
154 }
155 }
156
157 public static void updateArchivePreferences(HttpPrincipal httpPrincipal,
158 long userId, long groupId, java.lang.String name,
159 java.lang.String portletId, javax.portlet.PortletPreferences preferences)
160 throws com.liferay.portal.PortalException,
161 com.liferay.portal.SystemException {
162 try {
163 Object paramObj0 = new LongWrapper(userId);
164
165 Object paramObj1 = new LongWrapper(groupId);
166
167 Object paramObj2 = name;
168
169 if (name == null) {
170 paramObj2 = new NullWrapper("java.lang.String");
171 }
172
173 Object paramObj3 = portletId;
174
175 if (portletId == null) {
176 paramObj3 = new NullWrapper("java.lang.String");
177 }
178
179 Object paramObj4 = preferences;
180
181 if (preferences == null) {
182 paramObj4 = new NullWrapper("javax.portlet.PortletPreferences");
183 }
184
185 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
186 "updateArchivePreferences",
187 new Object[] {
188 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
189 });
190
191 try {
192 TunnelUtil.invoke(httpPrincipal, methodWrapper);
193 }
194 catch (Exception e) {
195 if (e instanceof com.liferay.portal.PortalException) {
196 throw (com.liferay.portal.PortalException)e;
197 }
198
199 if (e instanceof com.liferay.portal.SystemException) {
200 throw (com.liferay.portal.SystemException)e;
201 }
202
203 throw new com.liferay.portal.SystemException(e);
204 }
205 }
206 catch (com.liferay.portal.SystemException se) {
207 _log.error(se, se);
208
209 throw se;
210 }
211 }
212
213 private static Log _log = LogFactoryUtil.getLog(PortletPreferencesServiceHttp.class);
214 }