1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.documentlibrary.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.ListUtil;
20  
21  import com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil;
22  
23  import java.rmi.RemoteException;
24  
25  /**
26   * <a href="DLFolderServiceSoap.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides a SOAP utility for the
35   * {@link com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil} service utility. The
36   * static methods of this class calls the same methods of the service utility.
37   * However, the signatures are different because it is difficult for SOAP to
38   * support certain types.
39   * </p>
40   *
41   * <p>
42   * ServiceBuilder follows certain rules in translating the methods. For example,
43   * if the method in the service utility returns a {@link java.util.List}, that
44   * is translated to an array of {@link com.liferay.portlet.documentlibrary.model.DLFolderSoap}.
45   * If the method in the service utility returns a
46   * {@link com.liferay.portlet.documentlibrary.model.DLFolder}, that is translated to a
47   * {@link com.liferay.portlet.documentlibrary.model.DLFolderSoap}. Methods that SOAP cannot
48   * safely wire are skipped.
49   * </p>
50   *
51   * <p>
52   * The benefits of using the SOAP utility is that it is cross platform
53   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
54   * even Perl, to call the generated services. One drawback of SOAP is that it is
55   * slow because it needs to serialize all calls into a text format (XML).
56   * </p>
57   *
58   * <p>
59   * You can see a list of services at
60   * http://localhost:8080/tunnel-web/secure/axis. Set the property
61   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
62   * security.
63   * </p>
64   *
65   * <p>
66   * The SOAP utility is only generated for remote services.
67   * </p>
68   *
69   * @author    Brian Wing Shun Chan
70   * @see       DLFolderServiceHttp
71   * @see       com.liferay.portlet.documentlibrary.model.DLFolderSoap
72   * @see       com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil
73   * @generated
74   */
75  public class DLFolderServiceSoap {
76      public static com.liferay.portlet.documentlibrary.model.DLFolderSoap addFolder(
77          long groupId, long parentFolderId, java.lang.String name,
78          java.lang.String description,
79          com.liferay.portal.service.ServiceContext serviceContext)
80          throws RemoteException {
81          try {
82              com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.addFolder(groupId,
83                      parentFolderId, name, description, serviceContext);
84  
85              return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
86          }
87          catch (Exception e) {
88              _log.error(e, e);
89  
90              throw new RemoteException(e.getMessage());
91          }
92      }
93  
94      public static com.liferay.portlet.documentlibrary.model.DLFolderSoap copyFolder(
95          long groupId, long sourceFolderId, long parentFolderId,
96          java.lang.String name, java.lang.String description,
97          com.liferay.portal.service.ServiceContext serviceContext)
98          throws RemoteException {
99          try {
100             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.copyFolder(groupId,
101                     sourceFolderId, parentFolderId, name, description,
102                     serviceContext);
103 
104             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
105         }
106         catch (Exception e) {
107             _log.error(e, e);
108 
109             throw new RemoteException(e.getMessage());
110         }
111     }
112 
113     public static void deleteFolder(long folderId) throws RemoteException {
114         try {
115             DLFolderServiceUtil.deleteFolder(folderId);
116         }
117         catch (Exception e) {
118             _log.error(e, e);
119 
120             throw new RemoteException(e.getMessage());
121         }
122     }
123 
124     public static void deleteFolder(long groupId, long parentFolderId,
125         java.lang.String name) throws RemoteException {
126         try {
127             DLFolderServiceUtil.deleteFolder(groupId, parentFolderId, name);
128         }
129         catch (Exception e) {
130             _log.error(e, e);
131 
132             throw new RemoteException(e.getMessage());
133         }
134     }
135 
136     public static int getFileEntriesAndFileShortcutsCount(long groupId,
137         Long[] folderIds, int status) throws RemoteException {
138         try {
139             int returnValue = DLFolderServiceUtil.getFileEntriesAndFileShortcutsCount(groupId,
140                     ListUtil.toList(folderIds), status);
141 
142             return returnValue;
143         }
144         catch (Exception e) {
145             _log.error(e, e);
146 
147             throw new RemoteException(e.getMessage());
148         }
149     }
150 
151     public static int getFileEntriesAndFileShortcutsCount(long groupId,
152         long folderId, int status) throws RemoteException {
153         try {
154             int returnValue = DLFolderServiceUtil.getFileEntriesAndFileShortcutsCount(groupId,
155                     folderId, status);
156 
157             return returnValue;
158         }
159         catch (Exception e) {
160             _log.error(e, e);
161 
162             throw new RemoteException(e.getMessage());
163         }
164     }
165 
166     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap getFolder(
167         long folderId) throws RemoteException {
168         try {
169             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.getFolder(folderId);
170 
171             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
172         }
173         catch (Exception e) {
174             _log.error(e, e);
175 
176             throw new RemoteException(e.getMessage());
177         }
178     }
179 
180     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap getFolder(
181         long groupId, long parentFolderId, java.lang.String name)
182         throws RemoteException {
183         try {
184             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.getFolder(groupId,
185                     parentFolderId, name);
186 
187             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
188         }
189         catch (Exception e) {
190             _log.error(e, e);
191 
192             throw new RemoteException(e.getMessage());
193         }
194     }
195 
196     public static long getFolderId(long groupId, long parentFolderId,
197         java.lang.String name) throws RemoteException {
198         try {
199             long returnValue = DLFolderServiceUtil.getFolderId(groupId,
200                     parentFolderId, name);
201 
202             return returnValue;
203         }
204         catch (Exception e) {
205             _log.error(e, e);
206 
207             throw new RemoteException(e.getMessage());
208         }
209     }
210 
211     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap[] getFolders(
212         long groupId, long parentFolderId) throws RemoteException {
213         try {
214             java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> returnValue =
215                 DLFolderServiceUtil.getFolders(groupId, parentFolderId);
216 
217             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModels(returnValue);
218         }
219         catch (Exception e) {
220             _log.error(e, e);
221 
222             throw new RemoteException(e.getMessage());
223         }
224     }
225 
226     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap[] getFolders(
227         long groupId, long parentFolderId, int start, int end)
228         throws RemoteException {
229         try {
230             java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> returnValue =
231                 DLFolderServiceUtil.getFolders(groupId, parentFolderId, start,
232                     end);
233 
234             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModels(returnValue);
235         }
236         catch (Exception e) {
237             _log.error(e, e);
238 
239             throw new RemoteException(e.getMessage());
240         }
241     }
242 
243     public static int getFoldersAndFileEntriesAndFileShortcutsCount(
244         long groupId, Long[] folderIds, int status) throws RemoteException {
245         try {
246             int returnValue = DLFolderServiceUtil.getFoldersAndFileEntriesAndFileShortcutsCount(groupId,
247                     ListUtil.toList(folderIds), status);
248 
249             return returnValue;
250         }
251         catch (Exception e) {
252             _log.error(e, e);
253 
254             throw new RemoteException(e.getMessage());
255         }
256     }
257 
258     public static int getFoldersAndFileEntriesAndFileShortcutsCount(
259         long groupId, long folderId, int status) throws RemoteException {
260         try {
261             int returnValue = DLFolderServiceUtil.getFoldersAndFileEntriesAndFileShortcutsCount(groupId,
262                     folderId, status);
263 
264             return returnValue;
265         }
266         catch (Exception e) {
267             _log.error(e, e);
268 
269             throw new RemoteException(e.getMessage());
270         }
271     }
272 
273     public static int getFoldersCount(long groupId, long parentFolderId)
274         throws RemoteException {
275         try {
276             int returnValue = DLFolderServiceUtil.getFoldersCount(groupId,
277                     parentFolderId);
278 
279             return returnValue;
280         }
281         catch (Exception e) {
282             _log.error(e, e);
283 
284             throw new RemoteException(e.getMessage());
285         }
286     }
287 
288     public static void getSubfolderIds(Long[] folderIds, long groupId,
289         long folderId) throws RemoteException {
290         try {
291             DLFolderServiceUtil.getSubfolderIds(ListUtil.toList(folderIds),
292                 groupId, folderId);
293         }
294         catch (Exception e) {
295             _log.error(e, e);
296 
297             throw new RemoteException(e.getMessage());
298         }
299     }
300 
301     public static boolean hasInheritableLock(long folderId)
302         throws RemoteException {
303         try {
304             boolean returnValue = DLFolderServiceUtil.hasInheritableLock(folderId);
305 
306             return returnValue;
307         }
308         catch (Exception e) {
309             _log.error(e, e);
310 
311             throw new RemoteException(e.getMessage());
312         }
313     }
314 
315     public static void unlockFolder(long groupId, long folderId,
316         java.lang.String lockUuid) throws RemoteException {
317         try {
318             DLFolderServiceUtil.unlockFolder(groupId, folderId, lockUuid);
319         }
320         catch (Exception e) {
321             _log.error(e, e);
322 
323             throw new RemoteException(e.getMessage());
324         }
325     }
326 
327     public static void unlockFolder(long groupId, long parentFolderId,
328         java.lang.String name, java.lang.String lockUuid)
329         throws RemoteException {
330         try {
331             DLFolderServiceUtil.unlockFolder(groupId, parentFolderId, name,
332                 lockUuid);
333         }
334         catch (Exception e) {
335             _log.error(e, e);
336 
337             throw new RemoteException(e.getMessage());
338         }
339     }
340 
341     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap updateFolder(
342         long folderId, long parentFolderId, java.lang.String name,
343         java.lang.String description,
344         com.liferay.portal.service.ServiceContext serviceContext)
345         throws RemoteException {
346         try {
347             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.updateFolder(folderId,
348                     parentFolderId, name, description, serviceContext);
349 
350             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
351         }
352         catch (Exception e) {
353             _log.error(e, e);
354 
355             throw new RemoteException(e.getMessage());
356         }
357     }
358 
359     public static boolean verifyInheritableLock(long folderId,
360         java.lang.String lockUuid) throws RemoteException {
361         try {
362             boolean returnValue = DLFolderServiceUtil.verifyInheritableLock(folderId,
363                     lockUuid);
364 
365             return returnValue;
366         }
367         catch (Exception e) {
368             _log.error(e, e);
369 
370             throw new RemoteException(e.getMessage());
371         }
372     }
373 
374     private static Log _log = LogFactoryUtil.getLog(DLFolderServiceSoap.class);
375 }