001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 getFoldersCount(long groupId, long parentFolderId)
281                    throws RemoteException {
282                    try {
283                            int returnValue = JournalFolderServiceUtil.getFoldersCount(groupId,
284                                            parentFolderId);
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                    int status) throws RemoteException {
297                    try {
298                            int returnValue = JournalFolderServiceUtil.getFoldersCount(groupId,
299                                            parentFolderId, status);
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            /**
311            * @deprecated As of 7.0.0, replaced by {@link #getSubfolderIds(List, long,
312            long, boolean)}
313            */
314            public static void getSubfolderIds(Long[] folderIds, long groupId,
315                    long folderId) throws RemoteException {
316                    try {
317                            JournalFolderServiceUtil.getSubfolderIds(ListUtil.toList(folderIds),
318                                    groupId, folderId);
319                    }
320                    catch (Exception e) {
321                            _log.error(e, e);
322    
323                            throw new RemoteException(e.getMessage());
324                    }
325            }
326    
327            public static void getSubfolderIds(Long[] folderIds, long groupId,
328                    long folderId, boolean recurse) throws RemoteException {
329                    try {
330                            JournalFolderServiceUtil.getSubfolderIds(ListUtil.toList(folderIds),
331                                    groupId, folderId, recurse);
332                    }
333                    catch (Exception e) {
334                            _log.error(e, e);
335    
336                            throw new RemoteException(e.getMessage());
337                    }
338            }
339    
340            public static java.lang.Long[] getSubfolderIds(long groupId, long folderId,
341                    boolean recurse) throws RemoteException {
342                    try {
343                            java.util.List<java.lang.Long> returnValue = JournalFolderServiceUtil.getSubfolderIds(groupId,
344                                            folderId, recurse);
345    
346                            return returnValue.toArray(new java.lang.Long[returnValue.size()]);
347                    }
348                    catch (Exception e) {
349                            _log.error(e, e);
350    
351                            throw new RemoteException(e.getMessage());
352                    }
353            }
354    
355            public static com.liferay.portlet.journal.model.JournalFolderSoap moveFolder(
356                    long folderId, long parentFolderId,
357                    com.liferay.portal.service.ServiceContext serviceContext)
358                    throws RemoteException {
359                    try {
360                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.moveFolder(folderId,
361                                            parentFolderId, serviceContext);
362    
363                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
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.journal.model.JournalFolderSoap moveFolderFromTrash(
373                    long folderId, long parentFolderId,
374                    com.liferay.portal.service.ServiceContext serviceContext)
375                    throws RemoteException {
376                    try {
377                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.moveFolderFromTrash(folderId,
378                                            parentFolderId, serviceContext);
379    
380                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
381                    }
382                    catch (Exception e) {
383                            _log.error(e, e);
384    
385                            throw new RemoteException(e.getMessage());
386                    }
387            }
388    
389            public static com.liferay.portlet.journal.model.JournalFolderSoap moveFolderToTrash(
390                    long folderId) throws RemoteException {
391                    try {
392                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.moveFolderToTrash(folderId);
393    
394                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
395                    }
396                    catch (Exception e) {
397                            _log.error(e, e);
398    
399                            throw new RemoteException(e.getMessage());
400                    }
401            }
402    
403            public static void restoreFolderFromTrash(long folderId)
404                    throws RemoteException {
405                    try {
406                            JournalFolderServiceUtil.restoreFolderFromTrash(folderId);
407                    }
408                    catch (Exception e) {
409                            _log.error(e, e);
410    
411                            throw new RemoteException(e.getMessage());
412                    }
413            }
414    
415            public static com.liferay.portlet.journal.model.JournalFolderSoap updateFolder(
416                    long folderId, long parentFolderId, java.lang.String name,
417                    java.lang.String description, boolean mergeWithParentFolder,
418                    com.liferay.portal.service.ServiceContext serviceContext)
419                    throws RemoteException {
420                    try {
421                            com.liferay.portlet.journal.model.JournalFolder returnValue = JournalFolderServiceUtil.updateFolder(folderId,
422                                            parentFolderId, name, description, mergeWithParentFolder,
423                                            serviceContext);
424    
425                            return com.liferay.portlet.journal.model.JournalFolderSoap.toSoapModel(returnValue);
426                    }
427                    catch (Exception e) {
428                            _log.error(e, e);
429    
430                            throw new RemoteException(e.getMessage());
431                    }
432            }
433    
434            private static Log _log = LogFactoryUtil.getLog(JournalFolderServiceSoap.class);
435    }