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.DLFileEntryServiceUtil;
26  
27  import java.rmi.RemoteException;
28  
29  /**
30   * <a href="DLFileEntryServiceSoap.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.DLFileEntryServiceUtil</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.DLFileEntrySoap</code>. If the method in the
50   * service utility returns a <code>com.liferay.portlet.documentlibrary.model.DLFileEntry</code>,
51   * that is translated to a <code>com.liferay.portlet.documentlibrary.model.DLFileEntrySoap</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.DLFileEntrySoap
76   * @see com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil
77   * @see com.liferay.portlet.documentlibrary.service.http.DLFileEntryServiceHttp
78   *
79   */
80  public class DLFileEntryServiceSoap {
81      public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap addFileEntry(
82          long folderId, java.lang.String name, java.lang.String title,
83          java.lang.String description, java.lang.String extraSettings,
84          byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
85          throws RemoteException {
86          try {
87              com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(folderId,
88                      name, title, description, extraSettings, bytes,
89                      serviceContext);
90  
91              return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
92          }
93          catch (Exception e) {
94              _log.error(e, e);
95  
96              throw new RemoteException(e.getMessage());
97          }
98      }
99  
100     public static void deleteFileEntry(long folderId, java.lang.String name)
101         throws RemoteException {
102         try {
103             DLFileEntryServiceUtil.deleteFileEntry(folderId, name);
104         }
105         catch (Exception e) {
106             _log.error(e, e);
107 
108             throw new RemoteException(e.getMessage());
109         }
110     }
111 
112     public static void deleteFileEntry(long folderId, java.lang.String name,
113         double version) throws RemoteException {
114         try {
115             DLFileEntryServiceUtil.deleteFileEntry(folderId, name, version);
116         }
117         catch (Exception e) {
118             _log.error(e, e);
119 
120             throw new RemoteException(e.getMessage());
121         }
122     }
123 
124     public static void deleteFileEntryByTitle(long folderId,
125         java.lang.String titleWithExtension) throws RemoteException {
126         try {
127             DLFileEntryServiceUtil.deleteFileEntryByTitle(folderId,
128                 titleWithExtension);
129         }
130         catch (Exception e) {
131             _log.error(e, e);
132 
133             throw new RemoteException(e.getMessage());
134         }
135     }
136 
137     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap[] getFileEntries(
138         long folderId) throws RemoteException {
139         try {
140             java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
141                 DLFileEntryServiceUtil.getFileEntries(folderId);
142 
143             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModels(returnValue);
144         }
145         catch (Exception e) {
146             _log.error(e, e);
147 
148             throw new RemoteException(e.getMessage());
149         }
150     }
151 
152     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap getFileEntry(
153         long folderId, java.lang.String name) throws RemoteException {
154         try {
155             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntry(folderId,
156                     name);
157 
158             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(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 getFileEntryByTitle(
168         long folderId, java.lang.String titleWithExtension)
169         throws RemoteException {
170         try {
171             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntryByTitle(folderId,
172                     titleWithExtension);
173 
174             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
175         }
176         catch (Exception e) {
177             _log.error(e, e);
178 
179             throw new RemoteException(e.getMessage());
180         }
181     }
182 
183     public static boolean hasFileEntryLock(long folderId, java.lang.String name)
184         throws RemoteException {
185         try {
186             boolean returnValue = DLFileEntryServiceUtil.hasFileEntryLock(folderId,
187                     name);
188 
189             return returnValue;
190         }
191         catch (Exception e) {
192             _log.error(e, e);
193 
194             throw new RemoteException(e.getMessage());
195         }
196     }
197 
198     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
199         java.lang.String name) throws RemoteException {
200         try {
201             com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.lockFileEntry(folderId,
202                     name);
203 
204             return returnValue;
205         }
206         catch (Exception e) {
207             _log.error(e, e);
208 
209             throw new RemoteException(e.getMessage());
210         }
211     }
212 
213     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
214         java.lang.String name, java.lang.String owner, long expirationTime)
215         throws RemoteException {
216         try {
217             com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.lockFileEntry(folderId,
218                     name, owner, expirationTime);
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 refreshFileEntryLock(
230         java.lang.String lockUuid, long expirationTime)
231         throws RemoteException {
232         try {
233             com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.refreshFileEntryLock(lockUuid,
234                     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 void unlockFileEntry(long folderId, java.lang.String name)
246         throws RemoteException {
247         try {
248             DLFileEntryServiceUtil.unlockFileEntry(folderId, name);
249         }
250         catch (Exception e) {
251             _log.error(e, e);
252 
253             throw new RemoteException(e.getMessage());
254         }
255     }
256 
257     public static void unlockFileEntry(long folderId, java.lang.String name,
258         java.lang.String lockUuid) throws RemoteException {
259         try {
260             DLFileEntryServiceUtil.unlockFileEntry(folderId, name, lockUuid);
261         }
262         catch (Exception e) {
263             _log.error(e, e);
264 
265             throw new RemoteException(e.getMessage());
266         }
267     }
268 
269     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap updateFileEntry(
270         long folderId, long newFolderId, java.lang.String name,
271         java.lang.String sourceFileName, java.lang.String title,
272         java.lang.String description, java.lang.String extraSettings,
273         byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
274         throws RemoteException {
275         try {
276             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.updateFileEntry(folderId,
277                     newFolderId, name, sourceFileName, title, description,
278                     extraSettings, bytes, serviceContext);
279 
280             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
281         }
282         catch (Exception e) {
283             _log.error(e, e);
284 
285             throw new RemoteException(e.getMessage());
286         }
287     }
288 
289     public static boolean verifyFileEntryLock(long folderId,
290         java.lang.String name, java.lang.String lockUuid)
291         throws RemoteException {
292         try {
293             boolean returnValue = DLFileEntryServiceUtil.verifyFileEntryLock(folderId,
294                     name, lockUuid);
295 
296             return returnValue;
297         }
298         catch (Exception e) {
299             _log.error(e, e);
300 
301             throw new RemoteException(e.getMessage());
302         }
303     }
304 
305     private static Log _log = LogFactoryUtil.getLog(DLFileEntryServiceSoap.class);
306 }