1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.documentlibrary.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  
28  import com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil;
29  
30  import java.rmi.RemoteException;
31  
32  /**
33   * <a href="DLFolderServiceSoap.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * <p>
41   * This class provides a SOAP utility for the
42   * <code>com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil</code> service
43   * utility. The static methods of this class calls the same methods of the
44   * service utility. However, the signatures are different because it is
45   * difficult for SOAP to support certain types.
46   * </p>
47   *
48   * <p>
49   * ServiceBuilder follows certain rules in translating the methods. For example,
50   * if the method in the service utility returns a <code>java.util.List</code>,
51   * that is translated to an array of
52   * <code>com.liferay.portlet.documentlibrary.model.DLFolderSoap</code>. If the method in the
53   * service utility returns a <code>com.liferay.portlet.documentlibrary.model.DLFolder</code>,
54   * that is translated to a <code>com.liferay.portlet.documentlibrary.model.DLFolderSoap</code>.
55   * Methods that SOAP cannot safely wire are skipped.
56   * </p>
57   *
58   * <p>
59   * The benefits of using the SOAP utility is that it is cross platform
60   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
61   * even Perl, to call the generated services. One drawback of SOAP is that it is
62   * slow because it needs to serialize all calls into a text format (XML).
63   * </p>
64   *
65   * <p>
66   * You can see a list of services at
67   * http://localhost:8080/tunnel-web/secure/axis. Set the property
68   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
69   * security.
70   * </p>
71   *
72   * <p>
73   * The SOAP utility is only generated for remote services.
74   * </p>
75   *
76   * @author Brian Wing Shun Chan
77   *
78   * @see com.liferay.portlet.documentlibrary.model.DLFolderSoap
79   * @see com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil
80   * @see com.liferay.portlet.documentlibrary.service.http.DLFolderServiceHttp
81   *
82   */
83  public class DLFolderServiceSoap {
84      public static com.liferay.portlet.documentlibrary.model.DLFolderSoap addFolder(
85          long groupId, long parentFolderId, java.lang.String name,
86          java.lang.String description, boolean addCommunityPermissions,
87          boolean addGuestPermissions) throws RemoteException {
88          try {
89              com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.addFolder(groupId,
90                      parentFolderId, name, description, addCommunityPermissions,
91                      addGuestPermissions);
92  
93              return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
94          }
95          catch (Exception e) {
96              _log.error(e, e);
97  
98              throw new RemoteException(e.getMessage());
99          }
100     }
101 
102     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap addFolder(
103         long groupId, long parentFolderId, java.lang.String name,
104         java.lang.String description, java.lang.String[] communityPermissions,
105         java.lang.String[] guestPermissions) throws RemoteException {
106         try {
107             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.addFolder(groupId,
108                     parentFolderId, name, description, communityPermissions,
109                     guestPermissions);
110 
111             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
112         }
113         catch (Exception e) {
114             _log.error(e, e);
115 
116             throw new RemoteException(e.getMessage());
117         }
118     }
119 
120     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap copyFolder(
121         long groupId, long sourceFolderId, long parentFolderId,
122         java.lang.String name, java.lang.String description,
123         boolean addCommunityPermissions, boolean addGuestPermissions)
124         throws RemoteException {
125         try {
126             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.copyFolder(groupId,
127                     sourceFolderId, parentFolderId, name, description,
128                     addCommunityPermissions, addGuestPermissions);
129 
130             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.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 void deleteFolder(long folderId) throws RemoteException {
140         try {
141             DLFolderServiceUtil.deleteFolder(folderId);
142         }
143         catch (Exception e) {
144             _log.error(e, e);
145 
146             throw new RemoteException(e.getMessage());
147         }
148     }
149 
150     public static void deleteFolder(long groupId, long parentFolderId,
151         java.lang.String name) throws RemoteException {
152         try {
153             DLFolderServiceUtil.deleteFolder(groupId, parentFolderId, name);
154         }
155         catch (Exception e) {
156             _log.error(e, e);
157 
158             throw new RemoteException(e.getMessage());
159         }
160     }
161 
162     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap getFolder(
163         long folderId) throws RemoteException {
164         try {
165             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.getFolder(folderId);
166 
167             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
168         }
169         catch (Exception e) {
170             _log.error(e, e);
171 
172             throw new RemoteException(e.getMessage());
173         }
174     }
175 
176     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap getFolder(
177         long groupId, long parentFolderId, java.lang.String name)
178         throws RemoteException {
179         try {
180             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.getFolder(groupId,
181                     parentFolderId, name);
182 
183             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
184         }
185         catch (Exception e) {
186             _log.error(e, e);
187 
188             throw new RemoteException(e.getMessage());
189         }
190     }
191 
192     public static long getFolderId(long groupId, long parentFolderId,
193         java.lang.String name) throws RemoteException {
194         try {
195             long returnValue = DLFolderServiceUtil.getFolderId(groupId,
196                     parentFolderId, name);
197 
198             return returnValue;
199         }
200         catch (Exception e) {
201             _log.error(e, e);
202 
203             throw new RemoteException(e.getMessage());
204         }
205     }
206 
207     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap[] getFolders(
208         long groupId, long parentFolderId) throws RemoteException {
209         try {
210             java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> returnValue =
211                 DLFolderServiceUtil.getFolders(groupId, parentFolderId);
212 
213             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModels(returnValue);
214         }
215         catch (Exception e) {
216             _log.error(e, e);
217 
218             throw new RemoteException(e.getMessage());
219         }
220     }
221 
222     public static boolean hasInheritableLock(long folderId)
223         throws RemoteException {
224         try {
225             boolean returnValue = DLFolderServiceUtil.hasInheritableLock(folderId);
226 
227             return returnValue;
228         }
229         catch (Exception e) {
230             _log.error(e, e);
231 
232             throw new RemoteException(e.getMessage());
233         }
234     }
235 
236     public static com.liferay.lock.model.Lock lockFolder(long folderId)
237         throws RemoteException {
238         try {
239             com.liferay.lock.model.Lock returnValue = DLFolderServiceUtil.lockFolder(folderId);
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 com.liferay.lock.model.Lock lockFolder(long folderId,
251         java.lang.String owner, boolean inheritable, long expirationTime)
252         throws RemoteException {
253         try {
254             com.liferay.lock.model.Lock returnValue = DLFolderServiceUtil.lockFolder(folderId,
255                     owner, inheritable, expirationTime);
256 
257             return returnValue;
258         }
259         catch (Exception e) {
260             _log.error(e, e);
261 
262             throw new RemoteException(e.getMessage());
263         }
264     }
265 
266     public static com.liferay.lock.model.Lock refreshFolderLock(
267         java.lang.String lockUuid, long expirationTime)
268         throws RemoteException {
269         try {
270             com.liferay.lock.model.Lock returnValue = DLFolderServiceUtil.refreshFolderLock(lockUuid,
271                     expirationTime);
272 
273             return returnValue;
274         }
275         catch (Exception e) {
276             _log.error(e, e);
277 
278             throw new RemoteException(e.getMessage());
279         }
280     }
281 
282     public static void reIndexSearch(long companyId) throws RemoteException {
283         try {
284             DLFolderServiceUtil.reIndexSearch(companyId);
285         }
286         catch (Exception e) {
287             _log.error(e, e);
288 
289             throw new RemoteException(e.getMessage());
290         }
291     }
292 
293     public static void unlockFolder(long folderId, java.lang.String lockUuid)
294         throws RemoteException {
295         try {
296             DLFolderServiceUtil.unlockFolder(folderId, lockUuid);
297         }
298         catch (Exception e) {
299             _log.error(e, e);
300 
301             throw new RemoteException(e.getMessage());
302         }
303     }
304 
305     public static void unlockFolder(long groupId, long parentFolderId,
306         java.lang.String name, java.lang.String lockUuid)
307         throws RemoteException {
308         try {
309             DLFolderServiceUtil.unlockFolder(groupId, parentFolderId, name,
310                 lockUuid);
311         }
312         catch (Exception e) {
313             _log.error(e, e);
314 
315             throw new RemoteException(e.getMessage());
316         }
317     }
318 
319     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap updateFolder(
320         long folderId, long parentFolderId, java.lang.String name,
321         java.lang.String description) throws RemoteException {
322         try {
323             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.updateFolder(folderId,
324                     parentFolderId, name, description);
325 
326             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
327         }
328         catch (Exception e) {
329             _log.error(e, e);
330 
331             throw new RemoteException(e.getMessage());
332         }
333     }
334 
335     public static boolean verifyInheritableLock(long folderId,
336         java.lang.String lockUuid) throws RemoteException {
337         try {
338             boolean returnValue = DLFolderServiceUtil.verifyInheritableLock(folderId,
339                     lockUuid);
340 
341             return returnValue;
342         }
343         catch (Exception e) {
344             _log.error(e, e);
345 
346             throw new RemoteException(e.getMessage());
347         }
348     }
349 
350     private static Log _log = LogFactoryUtil.getLog(DLFolderServiceSoap.class);
351 }