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.BookmarksEntryServiceUtil;
35
36
73 public class BookmarksEntryServiceHttp {
74 public static com.liferay.portlet.bookmarks.model.BookmarksEntry addEntry(
75 HttpPrincipal httpPrincipal, long folderId, java.lang.String name,
76 java.lang.String url, java.lang.String comments,
77 java.lang.String[] tagsEntries, boolean addCommunityPermissions,
78 boolean addGuestPermissions)
79 throws com.liferay.portal.SystemException,
80 com.liferay.portal.PortalException {
81 try {
82 Object paramObj0 = new LongWrapper(folderId);
83 Object paramObj1 = name;
84
85 if (name == null) {
86 paramObj1 = new NullWrapper("java.lang.String");
87 }
88
89 Object paramObj2 = url;
90
91 if (url == null) {
92 paramObj2 = new NullWrapper("java.lang.String");
93 }
94
95 Object paramObj3 = comments;
96
97 if (comments == null) {
98 paramObj3 = new NullWrapper("java.lang.String");
99 }
100
101 Object paramObj4 = tagsEntries;
102
103 if (tagsEntries == null) {
104 paramObj4 = new NullWrapper("[Ljava.lang.String;");
105 }
106
107 Object paramObj5 = new BooleanWrapper(addCommunityPermissions);
108 Object paramObj6 = new BooleanWrapper(addGuestPermissions);
109 MethodWrapper methodWrapper = new MethodWrapper(BookmarksEntryServiceUtil.class.getName(),
110 "addEntry",
111 new Object[] {
112 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
113 paramObj5, paramObj6
114 });
115 Object returnObj = null;
116
117 try {
118 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
119 }
120 catch (Exception e) {
121 if (e instanceof com.liferay.portal.SystemException) {
122 throw (com.liferay.portal.SystemException)e;
123 }
124
125 if (e instanceof com.liferay.portal.PortalException) {
126 throw (com.liferay.portal.PortalException)e;
127 }
128
129 throw new com.liferay.portal.SystemException(e);
130 }
131
132 return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
133 }
134 catch (com.liferay.portal.SystemException se) {
135 _log.error(se, se);
136 throw se;
137 }
138 }
139
140 public static com.liferay.portlet.bookmarks.model.BookmarksEntry addEntry(
141 HttpPrincipal httpPrincipal, long folderId, java.lang.String name,
142 java.lang.String url, java.lang.String comments,
143 java.lang.String[] tagsEntries,
144 java.lang.String[] communityPermissions,
145 java.lang.String[] guestPermissions)
146 throws com.liferay.portal.SystemException,
147 com.liferay.portal.PortalException {
148 try {
149 Object paramObj0 = new LongWrapper(folderId);
150 Object paramObj1 = name;
151
152 if (name == null) {
153 paramObj1 = new NullWrapper("java.lang.String");
154 }
155
156 Object paramObj2 = url;
157
158 if (url == null) {
159 paramObj2 = new NullWrapper("java.lang.String");
160 }
161
162 Object paramObj3 = comments;
163
164 if (comments == null) {
165 paramObj3 = new NullWrapper("java.lang.String");
166 }
167
168 Object paramObj4 = tagsEntries;
169
170 if (tagsEntries == null) {
171 paramObj4 = new NullWrapper("[Ljava.lang.String;");
172 }
173
174 Object paramObj5 = communityPermissions;
175
176 if (communityPermissions == null) {
177 paramObj5 = new NullWrapper("[Ljava.lang.String;");
178 }
179
180 Object paramObj6 = guestPermissions;
181
182 if (guestPermissions == null) {
183 paramObj6 = new NullWrapper("[Ljava.lang.String;");
184 }
185
186 MethodWrapper methodWrapper = new MethodWrapper(BookmarksEntryServiceUtil.class.getName(),
187 "addEntry",
188 new Object[] {
189 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
190 paramObj5, paramObj6
191 });
192 Object returnObj = null;
193
194 try {
195 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
196 }
197 catch (Exception e) {
198 if (e instanceof com.liferay.portal.SystemException) {
199 throw (com.liferay.portal.SystemException)e;
200 }
201
202 if (e instanceof com.liferay.portal.PortalException) {
203 throw (com.liferay.portal.PortalException)e;
204 }
205
206 throw new com.liferay.portal.SystemException(e);
207 }
208
209 return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
210 }
211 catch (com.liferay.portal.SystemException se) {
212 _log.error(se, se);
213 throw se;
214 }
215 }
216
217 public static void deleteEntry(HttpPrincipal httpPrincipal, long entryId)
218 throws com.liferay.portal.SystemException,
219 com.liferay.portal.PortalException {
220 try {
221 Object paramObj0 = new LongWrapper(entryId);
222 MethodWrapper methodWrapper = new MethodWrapper(BookmarksEntryServiceUtil.class.getName(),
223 "deleteEntry", new Object[] { paramObj0 });
224
225 try {
226 TunnelUtil.invoke(httpPrincipal, methodWrapper);
227 }
228 catch (Exception e) {
229 if (e instanceof com.liferay.portal.SystemException) {
230 throw (com.liferay.portal.SystemException)e;
231 }
232
233 if (e instanceof com.liferay.portal.PortalException) {
234 throw (com.liferay.portal.PortalException)e;
235 }
236
237 throw new com.liferay.portal.SystemException(e);
238 }
239 }
240 catch (com.liferay.portal.SystemException se) {
241 _log.error(se, se);
242 throw se;
243 }
244 }
245
246 public static com.liferay.portlet.bookmarks.model.BookmarksEntry getEntry(
247 HttpPrincipal httpPrincipal, long entryId)
248 throws com.liferay.portal.SystemException,
249 com.liferay.portal.PortalException {
250 try {
251 Object paramObj0 = new LongWrapper(entryId);
252 MethodWrapper methodWrapper = new MethodWrapper(BookmarksEntryServiceUtil.class.getName(),
253 "getEntry", new Object[] { paramObj0 });
254 Object returnObj = null;
255
256 try {
257 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
258 }
259 catch (Exception e) {
260 if (e instanceof com.liferay.portal.SystemException) {
261 throw (com.liferay.portal.SystemException)e;
262 }
263
264 if (e instanceof com.liferay.portal.PortalException) {
265 throw (com.liferay.portal.PortalException)e;
266 }
267
268 throw new com.liferay.portal.SystemException(e);
269 }
270
271 return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
272 }
273 catch (com.liferay.portal.SystemException se) {
274 _log.error(se, se);
275 throw se;
276 }
277 }
278
279 public static com.liferay.portlet.bookmarks.model.BookmarksEntry openEntry(
280 HttpPrincipal httpPrincipal, long entryId)
281 throws com.liferay.portal.SystemException,
282 com.liferay.portal.PortalException {
283 try {
284 Object paramObj0 = new LongWrapper(entryId);
285 MethodWrapper methodWrapper = new MethodWrapper(BookmarksEntryServiceUtil.class.getName(),
286 "openEntry", new Object[] { paramObj0 });
287 Object returnObj = null;
288
289 try {
290 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
291 }
292 catch (Exception e) {
293 if (e instanceof com.liferay.portal.SystemException) {
294 throw (com.liferay.portal.SystemException)e;
295 }
296
297 if (e instanceof com.liferay.portal.PortalException) {
298 throw (com.liferay.portal.PortalException)e;
299 }
300
301 throw new com.liferay.portal.SystemException(e);
302 }
303
304 return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
305 }
306 catch (com.liferay.portal.SystemException se) {
307 _log.error(se, se);
308 throw se;
309 }
310 }
311
312 public static com.liferay.portlet.bookmarks.model.BookmarksEntry updateEntry(
313 HttpPrincipal httpPrincipal, long entryId, long folderId,
314 java.lang.String name, java.lang.String url, java.lang.String comments,
315 java.lang.String[] tagsEntries)
316 throws com.liferay.portal.SystemException,
317 com.liferay.portal.PortalException {
318 try {
319 Object paramObj0 = new LongWrapper(entryId);
320 Object paramObj1 = new LongWrapper(folderId);
321 Object paramObj2 = name;
322
323 if (name == null) {
324 paramObj2 = new NullWrapper("java.lang.String");
325 }
326
327 Object paramObj3 = url;
328
329 if (url == null) {
330 paramObj3 = new NullWrapper("java.lang.String");
331 }
332
333 Object paramObj4 = comments;
334
335 if (comments == null) {
336 paramObj4 = new NullWrapper("java.lang.String");
337 }
338
339 Object paramObj5 = tagsEntries;
340
341 if (tagsEntries == null) {
342 paramObj5 = new NullWrapper("[Ljava.lang.String;");
343 }
344
345 MethodWrapper methodWrapper = new MethodWrapper(BookmarksEntryServiceUtil.class.getName(),
346 "updateEntry",
347 new Object[] {
348 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
349 paramObj5
350 });
351 Object returnObj = null;
352
353 try {
354 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
355 }
356 catch (Exception e) {
357 if (e instanceof com.liferay.portal.SystemException) {
358 throw (com.liferay.portal.SystemException)e;
359 }
360
361 if (e instanceof com.liferay.portal.PortalException) {
362 throw (com.liferay.portal.PortalException)e;
363 }
364
365 throw new com.liferay.portal.SystemException(e);
366 }
367
368 return (com.liferay.portlet.bookmarks.model.BookmarksEntry)returnObj;
369 }
370 catch (com.liferay.portal.SystemException se) {
371 _log.error(se, se);
372 throw se;
373 }
374 }
375
376 private static Log _log = LogFactoryUtil.getLog(BookmarksEntryServiceHttp.class);
377 }