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
053     * http://localhost:8080/api/secure/axis. Set the property
054     * <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
055     * security.
056     * </p>
057     *
058     * <p>
059     * The SOAP utility is only generated for remote services.
060     * </p>
061     *
062     * @author    Brian Wing Shun Chan
063     * @see       BookmarksFolderServiceHttp
064     * @see       com.liferay.portlet.bookmarks.model.BookmarksFolderSoap
065     * @see       com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil
066     * @generated
067     */
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 com.liferay.portlet.bookmarks.model.BookmarksFolderSoap getFolder(
099                    long folderId) throws RemoteException {
100                    try {
101                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.getFolder(folderId);
102    
103                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
104                    }
105                    catch (Exception e) {
106                            _log.error(e, e);
107    
108                            throw new RemoteException(e.getMessage());
109                    }
110            }
111    
112            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
113                    long groupId) throws RemoteException {
114                    try {
115                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
116                                    BookmarksFolderServiceUtil.getFolders(groupId);
117    
118                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
119                    }
120                    catch (Exception e) {
121                            _log.error(e, e);
122    
123                            throw new RemoteException(e.getMessage());
124                    }
125            }
126    
127            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
128                    long groupId, long parentFolderId) throws RemoteException {
129                    try {
130                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
131                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId);
132    
133                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
134                    }
135                    catch (Exception e) {
136                            _log.error(e, e);
137    
138                            throw new RemoteException(e.getMessage());
139                    }
140            }
141    
142            public static com.liferay.portlet.bookmarks.model.BookmarksFolderSoap[] getFolders(
143                    long groupId, long parentFolderId, int start, int end)
144                    throws RemoteException {
145                    try {
146                            java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> returnValue =
147                                    BookmarksFolderServiceUtil.getFolders(groupId, parentFolderId,
148                                            start, end);
149    
150                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModels(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            public static int getFoldersCount(long groupId, long parentFolderId)
160                    throws RemoteException {
161                    try {
162                            int returnValue = BookmarksFolderServiceUtil.getFoldersCount(groupId,
163                                            parentFolderId);
164    
165                            return returnValue;
166                    }
167                    catch (Exception e) {
168                            _log.error(e, e);
169    
170                            throw new RemoteException(e.getMessage());
171                    }
172            }
173    
174            public static void getSubfolderIds(Long[] folderIds, long groupId,
175                    long folderId) throws RemoteException {
176                    try {
177                            BookmarksFolderServiceUtil.getSubfolderIds(ListUtil.toList(
178                                            folderIds), groupId, folderId);
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 updateFolder(
188                    long folderId, long parentFolderId, java.lang.String name,
189                    java.lang.String description, boolean mergeWithParentFolder,
190                    com.liferay.portal.service.ServiceContext serviceContext)
191                    throws RemoteException {
192                    try {
193                            com.liferay.portlet.bookmarks.model.BookmarksFolder returnValue = BookmarksFolderServiceUtil.updateFolder(folderId,
194                                            parentFolderId, name, description, mergeWithParentFolder,
195                                            serviceContext);
196    
197                            return com.liferay.portlet.bookmarks.model.BookmarksFolderSoap.toSoapModel(returnValue);
198                    }
199                    catch (Exception e) {
200                            _log.error(e, e);
201    
202                            throw new RemoteException(e.getMessage());
203                    }
204            }
205    
206            private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceSoap.class);
207    }