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