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,
87          com.liferay.portal.service.ServiceContext serviceContext)
88          throws RemoteException {
89          try {
90              com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.addFolder(groupId,
91                      parentFolderId, name, description, serviceContext);
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 copyFolder(
103         long groupId, long sourceFolderId, long parentFolderId,
104         java.lang.String name, java.lang.String description,
105         com.liferay.portal.service.ServiceContext serviceContext)
106         throws RemoteException {
107         try {
108             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.copyFolder(groupId,
109                     sourceFolderId, parentFolderId, name, description,
110                     serviceContext);
111 
112             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
113         }
114         catch (Exception e) {
115             _log.error(e, e);
116 
117             throw new RemoteException(e.getMessage());
118         }
119     }
120 
121     public static void deleteFolder(long folderId) throws RemoteException {
122         try {
123             DLFolderServiceUtil.deleteFolder(folderId);
124         }
125         catch (Exception e) {
126             _log.error(e, e);
127 
128             throw new RemoteException(e.getMessage());
129         }
130     }
131 
132     public static void deleteFolder(long groupId, long parentFolderId,
133         java.lang.String name) throws RemoteException {
134         try {
135             DLFolderServiceUtil.deleteFolder(groupId, parentFolderId, name);
136         }
137         catch (Exception e) {
138             _log.error(e, e);
139 
140             throw new RemoteException(e.getMessage());
141         }
142     }
143 
144     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap getFolder(
145         long folderId) throws RemoteException {
146         try {
147             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.getFolder(folderId);
148 
149             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
150         }
151         catch (Exception e) {
152             _log.error(e, e);
153 
154             throw new RemoteException(e.getMessage());
155         }
156     }
157 
158     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap getFolder(
159         long groupId, long parentFolderId, java.lang.String name)
160         throws RemoteException {
161         try {
162             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.getFolder(groupId,
163                     parentFolderId, name);
164 
165             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
166         }
167         catch (Exception e) {
168             _log.error(e, e);
169 
170             throw new RemoteException(e.getMessage());
171         }
172     }
173 
174     public static long getFolderId(long groupId, long parentFolderId,
175         java.lang.String name) throws RemoteException {
176         try {
177             long returnValue = DLFolderServiceUtil.getFolderId(groupId,
178                     parentFolderId, name);
179 
180             return returnValue;
181         }
182         catch (Exception e) {
183             _log.error(e, e);
184 
185             throw new RemoteException(e.getMessage());
186         }
187     }
188 
189     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap[] getFolders(
190         long groupId, long parentFolderId) throws RemoteException {
191         try {
192             java.util.List<com.liferay.portlet.documentlibrary.model.DLFolder> returnValue =
193                 DLFolderServiceUtil.getFolders(groupId, parentFolderId);
194 
195             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModels(returnValue);
196         }
197         catch (Exception e) {
198             _log.error(e, e);
199 
200             throw new RemoteException(e.getMessage());
201         }
202     }
203 
204     public static boolean hasInheritableLock(long folderId)
205         throws RemoteException {
206         try {
207             boolean returnValue = DLFolderServiceUtil.hasInheritableLock(folderId);
208 
209             return 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.lock.model.Lock lockFolder(long folderId)
219         throws RemoteException {
220         try {
221             com.liferay.lock.model.Lock returnValue = DLFolderServiceUtil.lockFolder(folderId);
222 
223             return 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.lock.model.Lock lockFolder(long folderId,
233         java.lang.String owner, boolean inheritable, long expirationTime)
234         throws RemoteException {
235         try {
236             com.liferay.lock.model.Lock returnValue = DLFolderServiceUtil.lockFolder(folderId,
237                     owner, inheritable, expirationTime);
238 
239             return returnValue;
240         }
241         catch (Exception e) {
242             _log.error(e, e);
243 
244             throw new RemoteException(e.getMessage());
245         }
246     }
247 
248     public static com.liferay.lock.model.Lock refreshFolderLock(
249         java.lang.String lockUuid, long expirationTime)
250         throws RemoteException {
251         try {
252             com.liferay.lock.model.Lock returnValue = DLFolderServiceUtil.refreshFolderLock(lockUuid,
253                     expirationTime);
254 
255             return returnValue;
256         }
257         catch (Exception e) {
258             _log.error(e, e);
259 
260             throw new RemoteException(e.getMessage());
261         }
262     }
263 
264     public static void reIndexSearch(long companyId) throws RemoteException {
265         try {
266             DLFolderServiceUtil.reIndexSearch(companyId);
267         }
268         catch (Exception e) {
269             _log.error(e, e);
270 
271             throw new RemoteException(e.getMessage());
272         }
273     }
274 
275     public static void unlockFolder(long folderId, java.lang.String lockUuid)
276         throws RemoteException {
277         try {
278             DLFolderServiceUtil.unlockFolder(folderId, lockUuid);
279         }
280         catch (Exception e) {
281             _log.error(e, e);
282 
283             throw new RemoteException(e.getMessage());
284         }
285     }
286 
287     public static void unlockFolder(long groupId, long parentFolderId,
288         java.lang.String name, java.lang.String lockUuid)
289         throws RemoteException {
290         try {
291             DLFolderServiceUtil.unlockFolder(groupId, parentFolderId, name,
292                 lockUuid);
293         }
294         catch (Exception e) {
295             _log.error(e, e);
296 
297             throw new RemoteException(e.getMessage());
298         }
299     }
300 
301     public static com.liferay.portlet.documentlibrary.model.DLFolderSoap updateFolder(
302         long folderId, long parentFolderId, java.lang.String name,
303         java.lang.String description,
304         com.liferay.portal.service.ServiceContext serviceContext)
305         throws RemoteException {
306         try {
307             com.liferay.portlet.documentlibrary.model.DLFolder returnValue = DLFolderServiceUtil.updateFolder(folderId,
308                     parentFolderId, name, description, serviceContext);
309 
310             return com.liferay.portlet.documentlibrary.model.DLFolderSoap.toSoapModel(returnValue);
311         }
312         catch (Exception e) {
313             _log.error(e, e);
314 
315             throw new RemoteException(e.getMessage());
316         }
317     }
318 
319     public static boolean verifyInheritableLock(long folderId,
320         java.lang.String lockUuid) throws RemoteException {
321         try {
322             boolean returnValue = DLFolderServiceUtil.verifyInheritableLock(folderId,
323                     lockUuid);
324 
325             return returnValue;
326         }
327         catch (Exception e) {
328             _log.error(e, e);
329 
330             throw new RemoteException(e.getMessage());
331         }
332     }
333 
334     private static Log _log = LogFactoryUtil.getLog(DLFolderServiceSoap.class);
335 }