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.journal.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.journal.service.JournalFolderServiceUtil;
024    
025    import java.rmi.RemoteException;
026    
027    /**
028     * Provides the SOAP utility for the
029     * {@link com.liferay.portlet.journal.service.JournalFolderServiceUtil} 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.journal.model.JournalFolderSoap}.
038     * If the method in the service utility returns a
039     * {@link com.liferay.portlet.journal.model.JournalFolder}, that is translated to a
040     * {@link com.liferay.portlet.journal.model.JournalFolderSoap}. 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 JournalFolderServiceHttp
063     * @see com.liferay.portlet.journal.model.JournalFolderSoap
064     * @see com.liferay.portlet.journal.service.JournalFolderServiceUtil
065     * @generated
066     */
067    @ProviderType
068    public class JournalFolderServiceSoap {
069            public static com.liferay.portlet.journal.model.JournalFolderSoap addFolder(
070                    long groupId, 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.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.addFolder(groupId,
076                                            parentFolderId, name, description, serviceContext);
077    
078                            return com.liferay.portlet.journal.model.JournalFolderSoap.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                            JournalFolderServiceUtil.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                            JournalFolderServiceUtil.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.journal.model.JournalFolderSoap fetchFolder(
112                    long folderId) throws RemoteException {
113                    try {
114                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.fetchFolder(folderId);
115    
116                            return com.liferay.portlet.journal.model.JournalFolderSoap.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 com.liferay.portlet.journal.model.JournalFolderSoap getFolder(
126                    long folderId) throws RemoteException {
127                    try {
128                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.getFolder(folderId);
129    
130                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
131                    }
132                    catch (Exception e) {
133                            _log.error(e, e);
134    
135                            throw new RemoteException(e.getMessage());
136                    }
137            }
138    
139            public static java.lang.Long[] getFolderIds(long groupId, long folderId)
140                    throws RemoteException {
141                    try {
142                            java.util.List<java.lang.Long> returnValue = JournalFolderServiceUtil.getFolderIds(groupId,
143                                            folderId);
144    
145                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
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.journal.model.JournalFolderSoap[] getFolders(
155                    long groupId) throws RemoteException {
156                    try {
157                            java.util.List<com.liferay.portlet.journal.model.JournalFolder> returnValue =
158                                    JournalFolderServiceUtil.getFolders(groupId);
159    
160                            return com.liferay.portlet.journal.model.JournalFolderSoap.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.journal.model.JournalFolderSoap[] getFolders(
170                    long groupId, long parentFolderId) throws RemoteException {
171                    try {
172                            java.util.List<com.liferay.portlet.journal.model.JournalFolder> returnValue =
173                                    JournalFolderServiceUtil.getFolders(groupId, parentFolderId);
174    
175                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModels(returnValue);
176                    }
177                    catch (Exception e) {
178                            _log.error(e, e);
179    
180                            throw new RemoteException(e.getMessage());
181                    }
182            }
183    
184            public static com.liferay.portlet.journal.model.JournalFolderSoap[] getFolders(
185                    long groupId, long parentFolderId, int status)
186                    throws RemoteException {
187                    try {
188                            java.util.List<com.liferay.portlet.journal.model.JournalFolder> returnValue =
189                                    JournalFolderServiceUtil.getFolders(groupId, parentFolderId,
190                                            status);
191    
192                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModels(returnValue);
193                    }
194                    catch (Exception e) {
195                            _log.error(e, e);
196    
197                            throw new RemoteException(e.getMessage());
198                    }
199            }
200    
201            public static com.liferay.portlet.journal.model.JournalFolderSoap[] getFolders(
202                    long groupId, long parentFolderId, int start, int end)
203                    throws RemoteException {
204                    try {
205                            java.util.List<com.liferay.portlet.journal.model.JournalFolder> returnValue =
206                                    JournalFolderServiceUtil.getFolders(groupId, parentFolderId,
207                                            start, end);
208    
209                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModels(returnValue);
210                    }
211                    catch (Exception e) {
212                            _log.error(e, e);
213    
214                            throw new RemoteException(e.getMessage());
215                    }
216            }
217    
218            public static com.liferay.portlet.journal.model.JournalFolderSoap[] getFolders(
219                    long groupId, long parentFolderId, int status, int start, int end)
220                    throws RemoteException {
221                    try {
222                            java.util.List<com.liferay.portlet.journal.model.JournalFolder> returnValue =
223                                    JournalFolderServiceUtil.getFolders(groupId, parentFolderId,
224                                            status, start, end);
225    
226                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModels(returnValue);
227                    }
228                    catch (Exception e) {
229                            _log.error(e, e);
230    
231                            throw new RemoteException(e.getMessage());
232                    }
233            }
234    
235            public static int getFoldersAndArticlesCount(long groupId,
236                    Long[] folderIds, int status) throws RemoteException {
237                    try {
238                            int returnValue = JournalFolderServiceUtil.getFoldersAndArticlesCount(groupId,
239                                            ListUtil.toList(folderIds), status);
240    
241                            return returnValue;
242                    }
243                    catch (Exception e) {
244                            _log.error(e, e);
245    
246                            throw new RemoteException(e.getMessage());
247                    }
248            }
249    
250            public static int getFoldersAndArticlesCount(long groupId, long folderId)
251                    throws RemoteException {
252                    try {
253                            int returnValue = JournalFolderServiceUtil.getFoldersAndArticlesCount(groupId,
254                                            folderId);
255    
256                            return returnValue;
257                    }
258                    catch (Exception e) {
259                            _log.error(e, e);
260    
261                            throw new RemoteException(e.getMessage());
262                    }
263            }
264    
265            public static int getFoldersAndArticlesCount(long groupId, long folderId,
266                    int status) throws RemoteException {
267                    try {
268                            int returnValue = JournalFolderServiceUtil.getFoldersAndArticlesCount(groupId,
269                                            folderId, status);
270    
271                            return returnValue;
272                    }
273                    catch (Exception e) {
274                            _log.error(e, e);
275    
276                            throw new RemoteException(e.getMessage());
277                    }
278            }
279    
280            public static int getFoldersAndArticlesCount(long groupId, long userId,
281                    long folderId, int status) throws RemoteException {
282                    try {
283                            int returnValue = JournalFolderServiceUtil.getFoldersAndArticlesCount(groupId,
284                                            userId, folderId, status);
285    
286                            return returnValue;
287                    }
288                    catch (Exception e) {
289                            _log.error(e, e);
290    
291                            throw new RemoteException(e.getMessage());
292                    }
293            }
294    
295            public static int getFoldersCount(long groupId, long parentFolderId)
296                    throws RemoteException {
297                    try {
298                            int returnValue = JournalFolderServiceUtil.getFoldersCount(groupId,
299                                            parentFolderId);
300    
301                            return returnValue;
302                    }
303                    catch (Exception e) {
304                            _log.error(e, e);
305    
306                            throw new RemoteException(e.getMessage());
307                    }
308            }
309    
310            public static int getFoldersCount(long groupId, long parentFolderId,
311                    int status) throws RemoteException {
312                    try {
313                            int returnValue = JournalFolderServiceUtil.getFoldersCount(groupId,
314                                            parentFolderId, status);
315    
316                            return returnValue;
317                    }
318                    catch (Exception e) {
319                            _log.error(e, e);
320    
321                            throw new RemoteException(e.getMessage());
322                    }
323            }
324    
325            /**
326            * @deprecated As of 7.0.0, replaced by {@link #getSubfolderIds(List, long,
327            long, boolean)}
328            */
329            public static void getSubfolderIds(Long[] folderIds, long groupId,
330                    long folderId) throws RemoteException {
331                    try {
332                            JournalFolderServiceUtil.getSubfolderIds(ListUtil.toList(folderIds),
333                                    groupId, folderId);
334                    }
335                    catch (Exception e) {
336                            _log.error(e, e);
337    
338                            throw new RemoteException(e.getMessage());
339                    }
340            }
341    
342            public static void getSubfolderIds(Long[] folderIds, long groupId,
343                    long folderId, boolean recurse) throws RemoteException {
344                    try {
345                            JournalFolderServiceUtil.getSubfolderIds(ListUtil.toList(folderIds),
346                                    groupId, folderId, recurse);
347                    }
348                    catch (Exception e) {
349                            _log.error(e, e);
350    
351                            throw new RemoteException(e.getMessage());
352                    }
353            }
354    
355            public static java.lang.Long[] getSubfolderIds(long groupId, long folderId,
356                    boolean recurse) throws RemoteException {
357                    try {
358                            java.util.List<java.lang.Long> returnValue = JournalFolderServiceUtil.getSubfolderIds(groupId,
359                                            folderId, recurse);
360    
361                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
362                    }
363                    catch (Exception e) {
364                            _log.error(e, e);
365    
366                            throw new RemoteException(e.getMessage());
367                    }
368            }
369    
370            public static com.liferay.portlet.journal.model.JournalFolderSoap moveFolder(
371                    long folderId, long parentFolderId,
372                    com.liferay.portal.service.ServiceContext serviceContext)
373                    throws RemoteException {
374                    try {
375                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.moveFolder(folderId,
376                                            parentFolderId, serviceContext);
377    
378                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
379                    }
380                    catch (Exception e) {
381                            _log.error(e, e);
382    
383                            throw new RemoteException(e.getMessage());
384                    }
385            }
386    
387            public static com.liferay.portlet.journal.model.JournalFolderSoap moveFolderFromTrash(
388                    long folderId, long parentFolderId,
389                    com.liferay.portal.service.ServiceContext serviceContext)
390                    throws RemoteException {
391                    try {
392                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.moveFolderFromTrash(folderId,
393                                            parentFolderId, serviceContext);
394    
395                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
396                    }
397                    catch (Exception e) {
398                            _log.error(e, e);
399    
400                            throw new RemoteException(e.getMessage());
401                    }
402            }
403    
404            public static com.liferay.portlet.journal.model.JournalFolderSoap moveFolderToTrash(
405                    long folderId) throws RemoteException {
406                    try {
407                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.moveFolderToTrash(folderId);
408    
409                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
410                    }
411                    catch (Exception e) {
412                            _log.error(e, e);
413    
414                            throw new RemoteException(e.getMessage());
415                    }
416            }
417    
418            public static void restoreFolderFromTrash(long folderId)
419                    throws RemoteException {
420                    try {
421                            JournalFolderServiceUtil.restoreFolderFromTrash(folderId);
422                    }
423                    catch (Exception e) {
424                            _log.error(e, e);
425    
426                            throw new RemoteException(e.getMessage());
427                    }
428            }
429    
430            public static com.liferay.portlet.journal.model.JournalFolderSoap updateFolder(
431                    long folderId, long parentFolderId, java.lang.String name,
432                    java.lang.String description, boolean mergeWithParentFolder,
433                    com.liferay.portal.service.ServiceContext serviceContext)
434                    throws RemoteException {
435                    try {
436                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.updateFolder(folderId,
437                                            parentFolderId, name, description, mergeWithParentFolder,
438                                            serviceContext);
439    
440                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
441                    }
442                    catch (Exception e) {
443                            _log.error(e, e);
444    
445                            throw new RemoteException(e.getMessage());
446                    }
447            }
448    
449            private static Log _log = LogFactoryUtil.getLog(JournalFolderServiceSoap.class);
450    }