1
22
23 package com.liferay.portlet.bookmarks.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.BooleanWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34 import com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil;
35
36
75 public class BookmarksFolderServiceHttp {
76 public static com.liferay.portlet.bookmarks.model.BookmarksFolder addFolder(
77 HttpPrincipal httpPrincipal, long plid, long parentFolderId,
78 java.lang.String name, java.lang.String description,
79 boolean addCommunityPermissions, boolean addGuestPermissions)
80 throws com.liferay.portal.PortalException,
81 com.liferay.portal.SystemException {
82 try {
83 Object paramObj0 = new LongWrapper(plid);
84
85 Object paramObj1 = new LongWrapper(parentFolderId);
86
87 Object paramObj2 = name;
88
89 if (name == null) {
90 paramObj2 = new NullWrapper("java.lang.String");
91 }
92
93 Object paramObj3 = description;
94
95 if (description == null) {
96 paramObj3 = new NullWrapper("java.lang.String");
97 }
98
99 Object paramObj4 = new BooleanWrapper(addCommunityPermissions);
100
101 Object paramObj5 = new BooleanWrapper(addGuestPermissions);
102
103 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
104 "addFolder",
105 new Object[] {
106 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
107 paramObj5
108 });
109
110 Object returnObj = null;
111
112 try {
113 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
114 }
115 catch (Exception e) {
116 if (e instanceof com.liferay.portal.PortalException) {
117 throw (com.liferay.portal.PortalException)e;
118 }
119
120 if (e instanceof com.liferay.portal.SystemException) {
121 throw (com.liferay.portal.SystemException)e;
122 }
123
124 throw new com.liferay.portal.SystemException(e);
125 }
126
127 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
128 }
129 catch (com.liferay.portal.SystemException se) {
130 _log.error(se, se);
131
132 throw se;
133 }
134 }
135
136 public static com.liferay.portlet.bookmarks.model.BookmarksFolder addFolder(
137 HttpPrincipal httpPrincipal, long plid, long parentFolderId,
138 java.lang.String name, java.lang.String description,
139 java.lang.String[] communityPermissions,
140 java.lang.String[] guestPermissions)
141 throws com.liferay.portal.PortalException,
142 com.liferay.portal.SystemException {
143 try {
144 Object paramObj0 = new LongWrapper(plid);
145
146 Object paramObj1 = new LongWrapper(parentFolderId);
147
148 Object paramObj2 = name;
149
150 if (name == null) {
151 paramObj2 = new NullWrapper("java.lang.String");
152 }
153
154 Object paramObj3 = description;
155
156 if (description == null) {
157 paramObj3 = new NullWrapper("java.lang.String");
158 }
159
160 Object paramObj4 = communityPermissions;
161
162 if (communityPermissions == null) {
163 paramObj4 = new NullWrapper("[Ljava.lang.String;");
164 }
165
166 Object paramObj5 = guestPermissions;
167
168 if (guestPermissions == null) {
169 paramObj5 = new NullWrapper("[Ljava.lang.String;");
170 }
171
172 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
173 "addFolder",
174 new Object[] {
175 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
176 paramObj5
177 });
178
179 Object returnObj = null;
180
181 try {
182 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
183 }
184 catch (Exception e) {
185 if (e instanceof com.liferay.portal.PortalException) {
186 throw (com.liferay.portal.PortalException)e;
187 }
188
189 if (e instanceof com.liferay.portal.SystemException) {
190 throw (com.liferay.portal.SystemException)e;
191 }
192
193 throw new com.liferay.portal.SystemException(e);
194 }
195
196 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
197 }
198 catch (com.liferay.portal.SystemException se) {
199 _log.error(se, se);
200
201 throw se;
202 }
203 }
204
205 public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
206 throws com.liferay.portal.PortalException,
207 com.liferay.portal.SystemException {
208 try {
209 Object paramObj0 = new LongWrapper(folderId);
210
211 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
212 "deleteFolder", new Object[] { paramObj0 });
213
214 try {
215 TunnelUtil.invoke(httpPrincipal, methodWrapper);
216 }
217 catch (Exception e) {
218 if (e instanceof com.liferay.portal.PortalException) {
219 throw (com.liferay.portal.PortalException)e;
220 }
221
222 if (e instanceof com.liferay.portal.SystemException) {
223 throw (com.liferay.portal.SystemException)e;
224 }
225
226 throw new com.liferay.portal.SystemException(e);
227 }
228 }
229 catch (com.liferay.portal.SystemException se) {
230 _log.error(se, se);
231
232 throw se;
233 }
234 }
235
236 public static com.liferay.portlet.bookmarks.model.BookmarksFolder getFolder(
237 HttpPrincipal httpPrincipal, long folderId)
238 throws com.liferay.portal.PortalException,
239 com.liferay.portal.SystemException {
240 try {
241 Object paramObj0 = new LongWrapper(folderId);
242
243 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
244 "getFolder", new Object[] { paramObj0 });
245
246 Object returnObj = null;
247
248 try {
249 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
250 }
251 catch (Exception e) {
252 if (e instanceof com.liferay.portal.PortalException) {
253 throw (com.liferay.portal.PortalException)e;
254 }
255
256 if (e instanceof com.liferay.portal.SystemException) {
257 throw (com.liferay.portal.SystemException)e;
258 }
259
260 throw new com.liferay.portal.SystemException(e);
261 }
262
263 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
264 }
265 catch (com.liferay.portal.SystemException se) {
266 _log.error(se, se);
267
268 throw se;
269 }
270 }
271
272 public static com.liferay.portlet.bookmarks.model.BookmarksFolder updateFolder(
273 HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
274 java.lang.String name, java.lang.String description,
275 boolean mergeWithParentFolder)
276 throws com.liferay.portal.PortalException,
277 com.liferay.portal.SystemException {
278 try {
279 Object paramObj0 = new LongWrapper(folderId);
280
281 Object paramObj1 = new LongWrapper(parentFolderId);
282
283 Object paramObj2 = name;
284
285 if (name == null) {
286 paramObj2 = new NullWrapper("java.lang.String");
287 }
288
289 Object paramObj3 = description;
290
291 if (description == null) {
292 paramObj3 = new NullWrapper("java.lang.String");
293 }
294
295 Object paramObj4 = new BooleanWrapper(mergeWithParentFolder);
296
297 MethodWrapper methodWrapper = new MethodWrapper(BookmarksFolderServiceUtil.class.getName(),
298 "updateFolder",
299 new Object[] {
300 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
301 });
302
303 Object returnObj = null;
304
305 try {
306 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
307 }
308 catch (Exception e) {
309 if (e instanceof com.liferay.portal.PortalException) {
310 throw (com.liferay.portal.PortalException)e;
311 }
312
313 if (e instanceof com.liferay.portal.SystemException) {
314 throw (com.liferay.portal.SystemException)e;
315 }
316
317 throw new com.liferay.portal.SystemException(e);
318 }
319
320 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
321 }
322 catch (com.liferay.portal.SystemException se) {
323 _log.error(se, se);
324
325 throw se;
326 }
327 }
328
329 private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceHttp.class);
330 }