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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.ListUtil;
022    
023    import com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil;
024    
025    import java.rmi.RemoteException;
026    
027    /**
028     * Provides the SOAP utility for the
029     * {@link com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it is difficult for SOAP to
032     * support certain types.
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    @ProviderType
068    public class BookmarksFolderServiceSoap {
069            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap addFolder(
070                    long parentFolderId, java.lang.String name,
071                    java.lang.String description,
072                    com.liferay.portal.service.ServiceContext serviceContext)
073                    throws RemoteException {
074                    try {
075                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.addFolder(parentFolderId,
076                                            name, description, serviceContext);
077    
078                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
079                    }
080                    catch (Exception e) {
081                            _log.error(e, e);
082    
083                            throw new RemoteException(e.getMessage());
084                    }
085            }
086    
087            public static void deleteFolder(long folderId) throws RemoteException {
088                    try {
089                            BookmarksFolderServiceUtil.deleteFolder(folderId);
090                    }
091                    catch (Exception e) {
092                            _log.error(e, e);
093    
094                            throw new RemoteException(e.getMessage());
095                    }
096            }
097    
098            public static void deleteFolder(long folderId, boolean includeTrashedEntries)
099                    throws RemoteException {
100                    try {
101                            BookmarksFolderServiceUtil.deleteFolder(folderId,
102                                    includeTrashedEntries);
103                    }
104                    catch (Exception e) {
105                            _log.error(e, e);
106    
107                            throw new RemoteException(e.getMessage());
108                    }
109            }
110    
111            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap getFolder(
112                    long folderId) throws RemoteException {
113                    try {
114                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.getFolder(folderId);
115    
116                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
117                    }
118                    catch (Exception e) {
119                            _log.error(e, e);
120    
121                            throw new RemoteException(e.getMessage());
122                    }
123            }
124    
125            public static java.lang.Long[] getFolderIds(long groupId, long folderId)
126                    throws RemoteException {
127                    try {
128                            java.util.List<java.lang.Long> returnValue = BookmarksFolderServiceUtil.getFolderIds(groupId,
129                                            folderId);
130    
131                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
132                    }
133                    catch (Exception e) {
134                            _log.error(e, e);
135    
136                            throw new RemoteException(e.getMessage());
137                    }
138            }
139    
140            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
141                    long groupId) throws RemoteException {
142                    try {
143                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
144                                    BookmarksFolderServiceUtil.getFolders(groupId);
145    
146                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
147                    }
148                    catch (Exception e) {
149                            _log.error(e, e);
150    
151                            throw new RemoteException(e.getMessage());
152                    }
153            }
154    
155            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
156                    long groupId, long parentFolderId) throws RemoteException {
157                    try {
158                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
159                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId);
160    
161                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
162                    }
163                    catch (Exception e) {
164                            _log.error(e, e);
165    
166                            throw new RemoteException(e.getMessage());
167                    }
168            }
169    
170            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
171                    long groupId, long parentFolderId, int start, int end)
172                    throws RemoteException {
173                    try {
174                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
175                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId,
176                                            start, end);
177    
178                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
179                    }
180                    catch (Exception e) {
181                            _log.error(e, e);
182    
183                            throw new RemoteException(e.getMessage());
184                    }
185            }
186    
187            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
188                    long groupId, long parentFolderId, int status, int start, int end)
189                    throws RemoteException {
190                    try {
191                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
192                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId,
193                                            status, start, end);
194    
195                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
196                    }
197                    catch (Exception e) {
198                            _log.error(e, e);
199    
200                            throw new RemoteException(e.getMessage());
201                    }
202            }
203    
204            public static int getFoldersAndEntriesCount(long groupId, long folderId)
205                    throws RemoteException {
206                    try {
207                            int returnValue = BookmarksFolderServiceUtil.getFoldersAndEntriesCount(groupId,
208                                            folderId);
209    
210                            return returnValue;
211                    }
212                    catch (Exception e) {
213                            _log.error(e, e);
214    
215                            throw new RemoteException(e.getMessage());
216                    }
217            }
218    
219            public static int getFoldersAndEntriesCount(long groupId, long folderId,
220                    int status) throws RemoteException {
221                    try {
222                            int returnValue = BookmarksFolderServiceUtil.getFoldersAndEntriesCount(groupId,
223                                            folderId, status);
224    
225                            return returnValue;
226                    }
227                    catch (Exception e) {
228                            _log.error(e, e);
229    
230                            throw new RemoteException(e.getMessage());
231                    }
232            }
233    
234            public static int getFoldersCount(long groupId, long parentFolderId)
235                    throws RemoteException {
236                    try {
237                            int returnValue = BookmarksFolderServiceUtil.getFoldersCount(groupId,
238                                            parentFolderId);
239    
240                            return returnValue;
241                    }
242                    catch (Exception e) {
243                            _log.error(e, e);
244    
245                            throw new RemoteException(e.getMessage());
246                    }
247            }
248    
249            public static int getFoldersCount(long groupId, long parentFolderId,
250                    int status) throws RemoteException {
251                    try {
252                            int returnValue = BookmarksFolderServiceUtil.getFoldersCount(groupId,
253                                            parentFolderId, status);
254    
255                            return returnValue;
256                    }
257                    catch (Exception e) {
258                            _log.error(e, e);
259    
260                            throw new RemoteException(e.getMessage());
261                    }
262            }
263    
264            public static void getSubfolderIds(Long[] folderIds, long groupId,
265                    long folderId) throws RemoteException {
266                    try {
267                            BookmarksFolderServiceUtil.getSubfolderIds(ListUtil.toList(
268                                            folderIds), groupId, folderId);
269                    }
270                    catch (Exception e) {
271                            _log.error(e, e);
272    
273                            throw new RemoteException(e.getMessage());
274                    }
275            }
276    
277            public static java.lang.Long[] getSubfolderIds(long groupId, long folderId,
278                    boolean recurse) throws RemoteException {
279                    try {
280                            java.util.List<java.lang.Long> returnValue = BookmarksFolderServiceUtil.getSubfolderIds(groupId,
281                                            folderId, recurse);
282    
283                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
284                    }
285                    catch (Exception e) {
286                            _log.error(e, e);
287    
288                            throw new RemoteException(e.getMessage());
289                    }
290            }
291    
292            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap moveFolder(
293                    long folderId, long parentFolderId) throws RemoteException {
294                    try {
295                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.moveFolder(folderId,
296                                            parentFolderId);
297    
298                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
299                    }
300                    catch (Exception e) {
301                            _log.error(e, e);
302    
303                            throw new RemoteException(e.getMessage());
304                    }
305            }
306    
307            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap moveFolderFromTrash(
308                    long folderId, long parentFolderId) throws RemoteException {
309                    try {
310                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.moveFolderFromTrash(folderId,
311                                            parentFolderId);
312    
313                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
314                    }
315                    catch (Exception e) {
316                            _log.error(e, e);
317    
318                            throw new RemoteException(e.getMessage());
319                    }
320            }
321    
322            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap moveFolderToTrash(
323                    long folderId) throws RemoteException {
324                    try {
325                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.moveFolderToTrash(folderId);
326    
327                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
328                    }
329                    catch (Exception e) {
330                            _log.error(e, e);
331    
332                            throw new RemoteException(e.getMessage());
333                    }
334            }
335    
336            public static void restoreFolderFromTrash(long folderId)
337                    throws RemoteException {
338                    try {
339                            BookmarksFolderServiceUtil.restoreFolderFromTrash(folderId);
340                    }
341                    catch (Exception e) {
342                            _log.error(e, e);
343    
344                            throw new RemoteException(e.getMessage());
345                    }
346            }
347    
348            public static void subscribeFolder(long groupId, long folderId)
349                    throws RemoteException {
350                    try {
351                            BookmarksFolderServiceUtil.subscribeFolder(groupId, folderId);
352                    }
353                    catch (Exception e) {
354                            _log.error(e, e);
355    
356                            throw new RemoteException(e.getMessage());
357                    }
358            }
359    
360            public static void unsubscribeFolder(long groupId, long folderId)
361                    throws RemoteException {
362                    try {
363                            BookmarksFolderServiceUtil.unsubscribeFolder(groupId, folderId);
364                    }
365                    catch (Exception e) {
366                            _log.error(e, e);
367    
368                            throw new RemoteException(e.getMessage());
369                    }
370            }
371    
372            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap updateFolder(
373                    long folderId, long parentFolderId, java.lang.String name,
374                    java.lang.String description, boolean mergeWithParentFolder,
375                    com.liferay.portal.service.ServiceContext serviceContext)
376                    throws RemoteException {
377                    try {
378                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.updateFolder(folderId,
379                                            parentFolderId, name, description, mergeWithParentFolder,
380                                            serviceContext);
381    
382                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
383                    }
384                    catch (Exception e) {
385                            _log.error(e, e);
386    
387                            throw new RemoteException(e.getMessage());
388                    }
389            }
390    
391            private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceSoap.class);
392    }