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.DLFileEntryServiceUtil;
22  
23  import java.rmi.RemoteException;
24  
25  /**
26   * <a href="DLFileEntryServiceSoap.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.DLFileEntryServiceUtil} 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.DLFileEntrySoap}.
45   * If the method in the service utility returns a
46   * {@link com.liferay.portlet.documentlibrary.model.DLFileEntry}, that is translated to a
47   * {@link com.liferay.portlet.documentlibrary.model.DLFileEntrySoap}. 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       DLFileEntryServiceHttp
71   * @see       com.liferay.portlet.documentlibrary.model.DLFileEntrySoap
72   * @see       com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil
73   * @generated
74   */
75  public class DLFileEntryServiceSoap {
76      public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap addFileEntry(
77          long groupId, long folderId, java.lang.String name,
78          java.lang.String title, java.lang.String description,
79          java.lang.String versionDescription, java.lang.String extraSettings,
80          byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
81          throws RemoteException {
82          try {
83              com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(groupId,
84                      folderId, name, title, description, versionDescription,
85                      extraSettings, bytes, serviceContext);
86  
87              return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
88          }
89          catch (Exception e) {
90              _log.error(e, e);
91  
92              throw new RemoteException(e.getMessage());
93          }
94      }
95  
96      public static void deleteFileEntry(long groupId, long folderId,
97          java.lang.String name) throws RemoteException {
98          try {
99              DLFileEntryServiceUtil.deleteFileEntry(groupId, folderId, name);
100         }
101         catch (Exception e) {
102             _log.error(e, e);
103 
104             throw new RemoteException(e.getMessage());
105         }
106     }
107 
108     public static void deleteFileEntry(long groupId, long folderId,
109         java.lang.String name, java.lang.String version)
110         throws RemoteException {
111         try {
112             DLFileEntryServiceUtil.deleteFileEntry(groupId, folderId, name,
113                 version);
114         }
115         catch (Exception e) {
116             _log.error(e, e);
117 
118             throw new RemoteException(e.getMessage());
119         }
120     }
121 
122     public static void deleteFileEntryByTitle(long groupId, long folderId,
123         java.lang.String titleWithExtension) throws RemoteException {
124         try {
125             DLFileEntryServiceUtil.deleteFileEntryByTitle(groupId, folderId,
126                 titleWithExtension);
127         }
128         catch (Exception e) {
129             _log.error(e, e);
130 
131             throw new RemoteException(e.getMessage());
132         }
133     }
134 
135     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap[] getFileEntries(
136         long groupId, long folderId) throws RemoteException {
137         try {
138             java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
139                 DLFileEntryServiceUtil.getFileEntries(groupId, folderId);
140 
141             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModels(returnValue);
142         }
143         catch (Exception e) {
144             _log.error(e, e);
145 
146             throw new RemoteException(e.getMessage());
147         }
148     }
149 
150     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap[] getFileEntries(
151         long groupId, long folderId, int start, int end)
152         throws RemoteException {
153         try {
154             java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
155                 DLFileEntryServiceUtil.getFileEntries(groupId, folderId, start,
156                     end);
157 
158             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModels(returnValue);
159         }
160         catch (Exception e) {
161             _log.error(e, e);
162 
163             throw new RemoteException(e.getMessage());
164         }
165     }
166 
167     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap[] getFileEntries(
168         long groupId, long folderId, int start, int end,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws RemoteException {
171         try {
172             java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
173                 DLFileEntryServiceUtil.getFileEntries(groupId, folderId, start,
174                     end, obc);
175 
176             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModels(returnValue);
177         }
178         catch (Exception e) {
179             _log.error(e, e);
180 
181             throw new RemoteException(e.getMessage());
182         }
183     }
184 
185     public static int getFileEntriesCount(long groupId, long folderId)
186         throws RemoteException {
187         try {
188             int returnValue = DLFileEntryServiceUtil.getFileEntriesCount(groupId,
189                     folderId);
190 
191             return returnValue;
192         }
193         catch (Exception e) {
194             _log.error(e, e);
195 
196             throw new RemoteException(e.getMessage());
197         }
198     }
199 
200     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap getFileEntry(
201         long groupId, long folderId, java.lang.String name)
202         throws RemoteException {
203         try {
204             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntry(groupId,
205                     folderId, name);
206 
207             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
208         }
209         catch (Exception e) {
210             _log.error(e, e);
211 
212             throw new RemoteException(e.getMessage());
213         }
214     }
215 
216     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap getFileEntryByTitle(
217         long groupId, long folderId, java.lang.String titleWithExtension)
218         throws RemoteException {
219         try {
220             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntryByTitle(groupId,
221                     folderId, titleWithExtension);
222 
223             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
224         }
225         catch (Exception e) {
226             _log.error(e, e);
227 
228             throw new RemoteException(e.getMessage());
229         }
230     }
231 
232     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap getFileEntryByUuidAndGroupId(
233         java.lang.String uuid, long groupId) throws RemoteException {
234         try {
235             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntryByUuidAndGroupId(uuid,
236                     groupId);
237 
238             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
239         }
240         catch (Exception e) {
241             _log.error(e, e);
242 
243             throw new RemoteException(e.getMessage());
244         }
245     }
246 
247     public static int getFoldersFileEntriesCount(long groupId,
248         Long[] folderIds, int status) throws RemoteException {
249         try {
250             int returnValue = DLFileEntryServiceUtil.getFoldersFileEntriesCount(groupId,
251                     ListUtil.toList(folderIds), status);
252 
253             return returnValue;
254         }
255         catch (Exception e) {
256             _log.error(e, e);
257 
258             throw new RemoteException(e.getMessage());
259         }
260     }
261 
262     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap[] getGroupFileEntries(
263         long groupId, long userId, int start, int end)
264         throws RemoteException {
265         try {
266             java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
267                 DLFileEntryServiceUtil.getGroupFileEntries(groupId, userId,
268                     start, end);
269 
270             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModels(returnValue);
271         }
272         catch (Exception e) {
273             _log.error(e, e);
274 
275             throw new RemoteException(e.getMessage());
276         }
277     }
278 
279     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap[] getGroupFileEntries(
280         long groupId, long userId, int start, int end,
281         com.liferay.portal.kernel.util.OrderByComparator obc)
282         throws RemoteException {
283         try {
284             java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
285                 DLFileEntryServiceUtil.getGroupFileEntries(groupId, userId,
286                     start, end, obc);
287 
288             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModels(returnValue);
289         }
290         catch (Exception e) {
291             _log.error(e, e);
292 
293             throw new RemoteException(e.getMessage());
294         }
295     }
296 
297     public static int getGroupFileEntriesCount(long groupId, long userId)
298         throws RemoteException {
299         try {
300             int returnValue = DLFileEntryServiceUtil.getGroupFileEntriesCount(groupId,
301                     userId);
302 
303             return returnValue;
304         }
305         catch (Exception e) {
306             _log.error(e, e);
307 
308             throw new RemoteException(e.getMessage());
309         }
310     }
311 
312     public static boolean hasFileEntryLock(long groupId, long folderId,
313         java.lang.String name) throws RemoteException {
314         try {
315             boolean returnValue = DLFileEntryServiceUtil.hasFileEntryLock(groupId,
316                     folderId, name);
317 
318             return returnValue;
319         }
320         catch (Exception e) {
321             _log.error(e, e);
322 
323             throw new RemoteException(e.getMessage());
324         }
325     }
326 
327     public static void unlockFileEntry(long groupId, long folderId,
328         java.lang.String name) throws RemoteException {
329         try {
330             DLFileEntryServiceUtil.unlockFileEntry(groupId, folderId, name);
331         }
332         catch (Exception e) {
333             _log.error(e, e);
334 
335             throw new RemoteException(e.getMessage());
336         }
337     }
338 
339     public static void unlockFileEntry(long groupId, long folderId,
340         java.lang.String name, java.lang.String lockUuid)
341         throws RemoteException {
342         try {
343             DLFileEntryServiceUtil.unlockFileEntry(groupId, folderId, name,
344                 lockUuid);
345         }
346         catch (Exception e) {
347             _log.error(e, e);
348 
349             throw new RemoteException(e.getMessage());
350         }
351     }
352 
353     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap updateFileEntry(
354         long groupId, long folderId, long newFolderId, java.lang.String name,
355         java.lang.String sourceFileName, java.lang.String title,
356         java.lang.String description, java.lang.String versionDescription,
357         boolean majorVersion, java.lang.String extraSettings, byte[] bytes,
358         com.liferay.portal.service.ServiceContext serviceContext)
359         throws RemoteException {
360         try {
361             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.updateFileEntry(groupId,
362                     folderId, newFolderId, name, sourceFileName, title,
363                     description, versionDescription, majorVersion,
364                     extraSettings, bytes, serviceContext);
365 
366             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
367         }
368         catch (Exception e) {
369             _log.error(e, e);
370 
371             throw new RemoteException(e.getMessage());
372         }
373     }
374 
375     public static boolean verifyFileEntryLock(long groupId, long folderId,
376         java.lang.String name, java.lang.String lockUuid)
377         throws RemoteException {
378         try {
379             boolean returnValue = DLFileEntryServiceUtil.verifyFileEntryLock(groupId,
380                     folderId, name, lockUuid);
381 
382             return 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(DLFileEntryServiceSoap.class);
392 }