001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.bookmarks.service.http;
022:
023: import com.liferay.portal.kernel.log.Log;
024: import com.liferay.portal.kernel.log.LogFactoryUtil;
025: import com.liferay.portal.kernel.util.BooleanWrapper;
026: import com.liferay.portal.kernel.util.LongWrapper;
027: import com.liferay.portal.kernel.util.MethodWrapper;
028: import com.liferay.portal.kernel.util.NullWrapper;
029: import com.liferay.portal.security.auth.HttpPrincipal;
030: import com.liferay.portal.service.http.TunnelUtil;
031:
032: import com.liferay.portlet.bookmarks.service.BookmarksEntryServiceUtil;
033:
034: /**
035: * <a href="BookmarksEntryServiceHttp.java.html"><b><i>View Source</i></b></a>
036: *
037: * <p>
038: * ServiceBuilder generated this class. Modifications in this class will be
039: * overwritten the next time is generated.
040: * </p>
041: *
042: * <p>
043: * This class provides a HTTP utility for the
044: * <code>com.liferay.portlet.bookmarks.service.BookmarksEntryServiceUtil</code> service
045: * utility. The static methods of this class calls the same methods of the
046: * service utility. However, the signatures are different because it requires an
047: * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
048: * parameter.
049: * </p>
050: *
051: * <p>
052: * The benefits of using the HTTP utility is that it is fast and allows for
053: * tunneling without the cost of serializing to text. The drawback is that it
054: * only works with Java.
055: * </p>
056: *
057: * <p>
058: * Set the property <code>tunnel.servlet.hosts.allowed</code> in
059: * portal.properties to configure security.
060: * </p>
061: *
062: * <p>
063: * The HTTP utility is only generated for remote services.
064: * </p>
065: *
066: * @author Brian Wing Shun Chan
067: *
068: * @see com.liferay.portal.security.auth.HttpPrincipal
069: * @see com.liferay.portlet.bookmarks.service.BookmarksEntryServiceUtil
070: * @see com.liferay.portlet.bookmarks.service.http.BookmarksEntryServiceSoap
071: *
072: */
073: public class BookmarksEntryServiceHttp {
074: public static com.liferay.portlet.bookmarks.model.BookmarksEntry addEntry(
075: HttpPrincipal httpPrincipal, long folderId,
076: java.lang.String name, java.lang.String url,
077: java.lang.String comments, java.lang.String[] tagsEntries,
078: boolean addCommunityPermissions, boolean addGuestPermissions)
079: throws com.liferay.portal.SystemException,
080: com.liferay.portal.PortalException {
081: try {
082: Object paramObj0 = new LongWrapper(folderId);
083:
084: Object paramObj1 = name;
085:
086: if (name == null) {
087: paramObj1 = new NullWrapper("java.lang.String");
088: }
089:
090: Object paramObj2 = url;
091:
092: if (url == null) {
093: paramObj2 = new NullWrapper("java.lang.String");
094: }
095:
096: Object paramObj3 = comments;
097:
098: if (comments == null) {
099: paramObj3 = new NullWrapper("java.lang.String");
100: }
101:
102: Object paramObj4 = tagsEntries;
103:
104: if (tagsEntries == null) {
105: paramObj4 = new NullWrapper("[Ljava.lang.String;");
106: }
107:
108: Object paramObj5 = new BooleanWrapper(
109: addCommunityPermissions);
110:
111: Object paramObj6 = new BooleanWrapper(addGuestPermissions);
112:
113: MethodWrapper methodWrapper = new MethodWrapper(
114: BookmarksEntryServiceUtil.class.getName(),
115: "addEntry", new Object[] { paramObj0, paramObj1,
116: paramObj2, paramObj3, paramObj4, paramObj5,
117: paramObj6 });
118:
119: Object returnObj = null;
120:
121: try {
122: returnObj = TunnelUtil.invoke(httpPrincipal,
123: methodWrapper);
124: } catch (Exception e) {
125: if (e instanceof com.liferay.portal.SystemException) {
126: throw (com.liferay.portal.SystemException) e;
127: }
128:
129: if (e instanceof com.liferay.portal.PortalException) {
130: throw (com.liferay.portal.PortalException) e;
131: }
132:
133: throw new com.liferay.portal.SystemException(e);
134: }
135:
136: return (com.liferay.portlet.bookmarks.model.BookmarksEntry) returnObj;
137: } catch (com.liferay.portal.SystemException se) {
138: _log.error(se, se);
139:
140: throw se;
141: }
142: }
143:
144: public static com.liferay.portlet.bookmarks.model.BookmarksEntry addEntry(
145: HttpPrincipal httpPrincipal, long folderId,
146: java.lang.String name, java.lang.String url,
147: java.lang.String comments, java.lang.String[] tagsEntries,
148: java.lang.String[] communityPermissions,
149: java.lang.String[] guestPermissions)
150: throws com.liferay.portal.SystemException,
151: com.liferay.portal.PortalException {
152: try {
153: Object paramObj0 = new LongWrapper(folderId);
154:
155: Object paramObj1 = name;
156:
157: if (name == null) {
158: paramObj1 = new NullWrapper("java.lang.String");
159: }
160:
161: Object paramObj2 = url;
162:
163: if (url == null) {
164: paramObj2 = new NullWrapper("java.lang.String");
165: }
166:
167: Object paramObj3 = comments;
168:
169: if (comments == null) {
170: paramObj3 = new NullWrapper("java.lang.String");
171: }
172:
173: Object paramObj4 = tagsEntries;
174:
175: if (tagsEntries == null) {
176: paramObj4 = new NullWrapper("[Ljava.lang.String;");
177: }
178:
179: Object paramObj5 = communityPermissions;
180:
181: if (communityPermissions == null) {
182: paramObj5 = new NullWrapper("[Ljava.lang.String;");
183: }
184:
185: Object paramObj6 = guestPermissions;
186:
187: if (guestPermissions == null) {
188: paramObj6 = new NullWrapper("[Ljava.lang.String;");
189: }
190:
191: MethodWrapper methodWrapper = new MethodWrapper(
192: BookmarksEntryServiceUtil.class.getName(),
193: "addEntry", new Object[] { paramObj0, paramObj1,
194: paramObj2, paramObj3, paramObj4, paramObj5,
195: paramObj6 });
196:
197: Object returnObj = null;
198:
199: try {
200: returnObj = TunnelUtil.invoke(httpPrincipal,
201: methodWrapper);
202: } catch (Exception e) {
203: if (e instanceof com.liferay.portal.SystemException) {
204: throw (com.liferay.portal.SystemException) e;
205: }
206:
207: if (e instanceof com.liferay.portal.PortalException) {
208: throw (com.liferay.portal.PortalException) e;
209: }
210:
211: throw new com.liferay.portal.SystemException(e);
212: }
213:
214: return (com.liferay.portlet.bookmarks.model.BookmarksEntry) returnObj;
215: } catch (com.liferay.portal.SystemException se) {
216: _log.error(se, se);
217:
218: throw se;
219: }
220: }
221:
222: public static void deleteEntry(HttpPrincipal httpPrincipal,
223: long entryId) throws com.liferay.portal.SystemException,
224: com.liferay.portal.PortalException {
225: try {
226: Object paramObj0 = new LongWrapper(entryId);
227:
228: MethodWrapper methodWrapper = new MethodWrapper(
229: BookmarksEntryServiceUtil.class.getName(),
230: "deleteEntry", new Object[] { paramObj0 });
231:
232: try {
233: TunnelUtil.invoke(httpPrincipal, methodWrapper);
234: } catch (Exception e) {
235: if (e instanceof com.liferay.portal.SystemException) {
236: throw (com.liferay.portal.SystemException) e;
237: }
238:
239: if (e instanceof com.liferay.portal.PortalException) {
240: throw (com.liferay.portal.PortalException) e;
241: }
242:
243: throw new com.liferay.portal.SystemException(e);
244: }
245: } catch (com.liferay.portal.SystemException se) {
246: _log.error(se, se);
247:
248: throw se;
249: }
250: }
251:
252: public static com.liferay.portlet.bookmarks.model.BookmarksEntry getEntry(
253: HttpPrincipal httpPrincipal, long entryId)
254: throws com.liferay.portal.SystemException,
255: com.liferay.portal.PortalException {
256: try {
257: Object paramObj0 = new LongWrapper(entryId);
258:
259: MethodWrapper methodWrapper = new MethodWrapper(
260: BookmarksEntryServiceUtil.class.getName(),
261: "getEntry", new Object[] { paramObj0 });
262:
263: Object returnObj = null;
264:
265: try {
266: returnObj = TunnelUtil.invoke(httpPrincipal,
267: methodWrapper);
268: } catch (Exception e) {
269: if (e instanceof com.liferay.portal.SystemException) {
270: throw (com.liferay.portal.SystemException) e;
271: }
272:
273: if (e instanceof com.liferay.portal.PortalException) {
274: throw (com.liferay.portal.PortalException) e;
275: }
276:
277: throw new com.liferay.portal.SystemException(e);
278: }
279:
280: return (com.liferay.portlet.bookmarks.model.BookmarksEntry) returnObj;
281: } catch (com.liferay.portal.SystemException se) {
282: _log.error(se, se);
283:
284: throw se;
285: }
286: }
287:
288: public static com.liferay.portlet.bookmarks.model.BookmarksEntry openEntry(
289: HttpPrincipal httpPrincipal, long entryId)
290: throws com.liferay.portal.SystemException,
291: com.liferay.portal.PortalException {
292: try {
293: Object paramObj0 = new LongWrapper(entryId);
294:
295: MethodWrapper methodWrapper = new MethodWrapper(
296: BookmarksEntryServiceUtil.class.getName(),
297: "openEntry", new Object[] { paramObj0 });
298:
299: Object returnObj = null;
300:
301: try {
302: returnObj = TunnelUtil.invoke(httpPrincipal,
303: methodWrapper);
304: } catch (Exception e) {
305: if (e instanceof com.liferay.portal.SystemException) {
306: throw (com.liferay.portal.SystemException) e;
307: }
308:
309: if (e instanceof com.liferay.portal.PortalException) {
310: throw (com.liferay.portal.PortalException) e;
311: }
312:
313: throw new com.liferay.portal.SystemException(e);
314: }
315:
316: return (com.liferay.portlet.bookmarks.model.BookmarksEntry) returnObj;
317: } catch (com.liferay.portal.SystemException se) {
318: _log.error(se, se);
319:
320: throw se;
321: }
322: }
323:
324: public static com.liferay.portlet.bookmarks.model.BookmarksEntry updateEntry(
325: HttpPrincipal httpPrincipal, long entryId, long folderId,
326: java.lang.String name, java.lang.String url,
327: java.lang.String comments, java.lang.String[] tagsEntries)
328: throws com.liferay.portal.SystemException,
329: com.liferay.portal.PortalException {
330: try {
331: Object paramObj0 = new LongWrapper(entryId);
332:
333: Object paramObj1 = new LongWrapper(folderId);
334:
335: Object paramObj2 = name;
336:
337: if (name == null) {
338: paramObj2 = new NullWrapper("java.lang.String");
339: }
340:
341: Object paramObj3 = url;
342:
343: if (url == null) {
344: paramObj3 = new NullWrapper("java.lang.String");
345: }
346:
347: Object paramObj4 = comments;
348:
349: if (comments == null) {
350: paramObj4 = new NullWrapper("java.lang.String");
351: }
352:
353: Object paramObj5 = tagsEntries;
354:
355: if (tagsEntries == null) {
356: paramObj5 = new NullWrapper("[Ljava.lang.String;");
357: }
358:
359: MethodWrapper methodWrapper = new MethodWrapper(
360: BookmarksEntryServiceUtil.class.getName(),
361: "updateEntry",
362: new Object[] { paramObj0, paramObj1, paramObj2,
363: paramObj3, paramObj4, paramObj5 });
364:
365: Object returnObj = null;
366:
367: try {
368: returnObj = TunnelUtil.invoke(httpPrincipal,
369: methodWrapper);
370: } catch (Exception e) {
371: if (e instanceof com.liferay.portal.SystemException) {
372: throw (com.liferay.portal.SystemException) e;
373: }
374:
375: if (e instanceof com.liferay.portal.PortalException) {
376: throw (com.liferay.portal.PortalException) e;
377: }
378:
379: throw new com.liferay.portal.SystemException(e);
380: }
381:
382: return (com.liferay.portlet.bookmarks.model.BookmarksEntry) returnObj;
383: } catch (com.liferay.portal.SystemException se) {
384: _log.error(se, se);
385:
386: throw se;
387: }
388: }
389:
390: private static Log _log = LogFactoryUtil
391: .getLog(BookmarksEntryServiceHttp.class);
392: }
|