001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.bookmarks.service.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.util.ListUtil;
020    
021    import com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    /**
026     * <p>
027     * This class provides a SOAP utility for the
028     * {@link com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it is difficult for SOAP to
031     * support certain types.
032     * </p>
033     *
034     * <p>
035     * ServiceBuilder follows certain rules in translating the methods. For example,
036     * if the method in the service utility returns a {@link java.util.List}, that
037     * is translated to an array of {@link com.liferay.portlet.bookmarks.model.BookmarksFolderSoap}.
038     * If the method in the service utility returns a
039     * {@link com.liferay.portlet.bookmarks.model.BookmarksFolder}, that is translated to a
040     * {@link com.liferay.portlet.bookmarks.model.BookmarksFolderSoap}. Methods that SOAP cannot
041     * safely wire are skipped.
042     * </p>
043     *
044     * <p>
045     * The benefits of using the SOAP utility is that it is cross platform
046     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
047     * even Perl, to call the generated services. One drawback of SOAP is that it is
048     * slow because it needs to serialize all calls into a text format (XML).
049     * </p>
050     *
051     * <p>
052     * You can see a list of services at http://localhost:8080/api/axis. Set the
053     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
054     * security.
055     * </p>
056     *
057     * <p>
058     * The SOAP utility is only generated for remote services.
059     * </p>
060     *
061     * @author    Brian Wing Shun Chan
062     * @see       BookmarksFolderServiceHttp
063     * @see       com.liferay.portlet.bookmarks.model.BookmarksFolderSoap
064     * @see       com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil
065     * @generated
066     */
067    public class BookmarksFolderServiceSoap {
068            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap addFolder(
069                    long parentFolderId, java.lang.String name,
070                    java.lang.String description,
071                    com.liferay.portal.service.ServiceContext serviceContext)
072                    throws RemoteException {
073                    try {
074                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.addFolder(parentFolderId,
075                                            name, description, serviceContext);
076    
077                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
078                    }
079                    catch (Exception e) {
080                            _log.error(e, e);
081    
082                            throw new RemoteException(e.getMessage());
083                    }
084            }
085    
086            public static void deleteFolder(long folderId) throws RemoteException {
087                    try {
088                            BookmarksFolderServiceUtil.deleteFolder(folderId);
089                    }
090                    catch (Exception e) {
091                            _log.error(e, e);
092    
093                            throw new RemoteException(e.getMessage());
094                    }
095            }
096    
097            public static void deleteFolder(long folderId, boolean includeTrashedEntries)
098                    throws RemoteException {
099                    try {
100                            BookmarksFolderServiceUtil.deleteFolder(folderId,
101                                    includeTrashedEntries);
102                    }
103                    catch (Exception e) {
104                            _log.error(e, e);
105    
106                            throw new RemoteException(e.getMessage());
107                    }
108            }
109    
110            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap getFolder(
111                    long folderId) throws RemoteException {
112                    try {
113                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.getFolder(folderId);
114    
115                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
116                    }
117                    catch (Exception e) {
118                            _log.error(e, e);
119    
120                            throw new RemoteException(e.getMessage());
121                    }
122            }
123    
124            public static java.lang.Long[] getFolderIds(long groupId, long folderId)
125                    throws RemoteException {
126                    try {
127                            java.util.List<java.lang.Long> returnValue = BookmarksFolderServiceUtil.getFolderIds(groupId,
128                                            folderId);
129    
130                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
131                    }
132                    catch (Exception e) {
133                            _log.error(e, e);
134    
135                            throw new RemoteException(e.getMessage());
136                    }
137            }
138    
139            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
140                    long groupId) throws RemoteException {
141                    try {
142                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
143                                    BookmarksFolderServiceUtil.getFolders(groupId);
144    
145                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
146                    }
147                    catch (Exception e) {
148                            _log.error(e, e);
149    
150                            throw new RemoteException(e.getMessage());
151                    }
152            }
153    
154            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
155                    long groupId, long parentFolderId) throws RemoteException {
156                    try {
157                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
158                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId);
159    
160                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
161                    }
162                    catch (Exception e) {
163                            _log.error(e, e);
164    
165                            throw new RemoteException(e.getMessage());
166                    }
167            }
168    
169            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
170                    long groupId, long parentFolderId, int start, int end)
171                    throws RemoteException {
172                    try {
173                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
174                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId,
175                                            start, end);
176    
177                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
178                    }
179                    catch (Exception e) {
180                            _log.error(e, e);
181    
182                            throw new RemoteException(e.getMessage());
183                    }
184            }
185    
186            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
187                    long groupId, long parentFolderId, int status, int start, int end)
188                    throws RemoteException {
189                    try {
190                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
191                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId,
192                                            status, start, end);
193    
194                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
195                    }
196                    catch (Exception e) {
197                            _log.error(e, e);
198    
199                            throw new RemoteException(e.getMessage());
200                    }
201            }
202    
203            public static int getFoldersAndEntriesCount(long groupId, long folderId)
204                    throws RemoteException {
205                    try {
206                            int returnValue = BookmarksFolderServiceUtil.getFoldersAndEntriesCount(groupId,
207                                            folderId);
208    
209                            return returnValue;
210                    }
211                    catch (Exception e) {
212                            _log.error(e, e);
213    
214                            throw new RemoteException(e.getMessage());
215                    }
216            }
217    
218            public static int getFoldersAndEntriesCount(long groupId, long folderId,
219                    int status) throws RemoteException {
220                    try {
221                            int returnValue = BookmarksFolderServiceUtil.getFoldersAndEntriesCount(groupId,
222                                            folderId, status);
223    
224                            return returnValue;
225                    }
226                    catch (Exception e) {
227                            _log.error(e, e);
228    
229                            throw new RemoteException(e.getMessage());
230                    }
231            }
232    
233            public static int getFoldersCount(long groupId, long parentFolderId)
234                    throws RemoteException {
235                    try {
236                            int returnValue = BookmarksFolderServiceUtil.getFoldersCount(groupId,
237                                            parentFolderId);
238    
239                            return returnValue;
240                    }
241                    catch (Exception e) {
242                            _log.error(e, e);
243    
244                            throw new RemoteException(e.getMessage());
245                    }
246            }
247    
248            public static int getFoldersCount(long groupId, long parentFolderId,
249                    int status) throws RemoteException {
250                    try {
251                            int returnValue = BookmarksFolderServiceUtil.getFoldersCount(groupId,
252                                            parentFolderId, status);
253    
254                            return returnValue;
255                    }
256                    catch (Exception e) {
257                            _log.error(e, e);
258    
259                            throw new RemoteException(e.getMessage());
260                    }
261            }
262    
263            public static void getSubfolderIds(Long[] folderIds, long groupId,
264                    long folderId) throws RemoteException {
265                    try {
266                            BookmarksFolderServiceUtil.getSubfolderIds(ListUtil.toList(
267                                            folderIds), groupId, folderId);
268                    }
269                    catch (Exception e) {
270                            _log.error(e, e);
271    
272                            throw new RemoteException(e.getMessage());
273                    }
274            }
275    
276            public static java.lang.Long[] getSubfolderIds(long groupId, long folderId,
277                    boolean recurse) throws RemoteException {
278                    try {
279                            java.util.List<java.lang.Long> returnValue = BookmarksFolderServiceUtil.getSubfolderIds(groupId,
280                                            folderId, recurse);
281    
282                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
283                    }
284                    catch (Exception e) {
285                            _log.error(e, e);
286    
287                            throw new RemoteException(e.getMessage());
288                    }
289            }
290    
291            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap moveFolder(
292                    long folderId, long parentFolderId) throws RemoteException {
293                    try {
294                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.moveFolder(folderId,
295                                            parentFolderId);
296    
297                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
298                    }
299                    catch (Exception e) {
300                            _log.error(e, e);
301    
302                            throw new RemoteException(e.getMessage());
303                    }
304            }
305    
306            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap moveFolderFromTrash(
307                    long folderId, long parentFolderId) throws RemoteException {
308                    try {
309                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.moveFolderFromTrash(folderId,
310                                            parentFolderId);
311    
312                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
313                    }
314                    catch (Exception e) {
315                            _log.error(e, e);
316    
317                            throw new RemoteException(e.getMessage());
318                    }
319            }
320    
321            public static void moveFolderToTrash(long folderId)
322                    throws RemoteException {
323                    try {
324                            BookmarksFolderServiceUtil.moveFolderToTrash(folderId);
325                    }
326                    catch (Exception e) {
327                            _log.error(e, e);
328    
329                            throw new RemoteException(e.getMessage());
330                    }
331            }
332    
333            public static void restoreFolderFromTrash(long folderId)
334                    throws RemoteException {
335                    try {
336                            BookmarksFolderServiceUtil.restoreFolderFromTrash(folderId);
337                    }
338                    catch (Exception e) {
339                            _log.error(e, e);
340    
341                            throw new RemoteException(e.getMessage());
342                    }
343            }
344    
345            public static void subscribeFolder(long groupId, long folderId)
346                    throws RemoteException {
347                    try {
348                            BookmarksFolderServiceUtil.subscribeFolder(groupId, folderId);
349                    }
350                    catch (Exception e) {
351                            _log.error(e, e);
352    
353                            throw new RemoteException(e.getMessage());
354                    }
355            }
356    
357            public static void unsubscribeFolder(long groupId, long folderId)
358                    throws RemoteException {
359                    try {
360                            BookmarksFolderServiceUtil.unsubscribeFolder(groupId, folderId);
361                    }
362                    catch (Exception e) {
363                            _log.error(e, e);
364    
365                            throw new RemoteException(e.getMessage());
366                    }
367            }
368    
369            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap updateFolder(
370                    long folderId, long parentFolderId, java.lang.String name,
371                    java.lang.String description, boolean mergeWithParentFolder,
372                    com.liferay.portal.service.ServiceContext serviceContext)
373                    throws RemoteException {
374                    try {
375                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.updateFolder(folderId,
376                                            parentFolderId, name, description, mergeWithParentFolder,
377                                            serviceContext);
378    
379                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
380                    }
381                    catch (Exception e) {
382                            _log.error(e, e);
383    
384                            throw new RemoteException(e.getMessage());
385                    }
386            }
387    
388            private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceSoap.class);
389    }