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