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[] tagsEntries,
84          java.lang.String extraSettings, byte[] bytes,
85          boolean addCommunityPermissions, boolean addGuestPermissions)
86          throws RemoteException {
87          try {
88              com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(folderId,
89                      name, title, description, tagsEntries, extraSettings,
90                      bytes, addCommunityPermissions, addGuestPermissions);
91  
92              return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
93          }
94          catch (Exception e) {
95              _log.error(e, e);
96  
97              throw new RemoteException(e.getMessage());
98          }
99      }
100 
101     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap addFileEntry(
102         long folderId, java.lang.String name, java.lang.String title,
103         java.lang.String description, java.lang.String[] tagsEntries,
104         java.lang.String extraSettings, byte[] bytes,
105         java.lang.String[] communityPermissions,
106         java.lang.String[] guestPermissions) throws RemoteException {
107         try {
108             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(folderId,
109                     name, title, description, tagsEntries, extraSettings,
110                     bytes, communityPermissions, guestPermissions);
111 
112             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.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 deleteFileEntry(long folderId, java.lang.String name)
122         throws RemoteException {
123         try {
124             DLFileEntryServiceUtil.deleteFileEntry(folderId, name);
125         }
126         catch (Exception e) {
127             _log.error(e, e);
128 
129             throw new RemoteException(e.getMessage());
130         }
131     }
132 
133     public static void deleteFileEntry(long folderId, java.lang.String name,
134         double version) throws RemoteException {
135         try {
136             DLFileEntryServiceUtil.deleteFileEntry(folderId, name, version);
137         }
138         catch (Exception e) {
139             _log.error(e, e);
140 
141             throw new RemoteException(e.getMessage());
142         }
143     }
144 
145     public static void deleteFileEntryByTitle(long folderId,
146         java.lang.String titleWithExtension) throws RemoteException {
147         try {
148             DLFileEntryServiceUtil.deleteFileEntryByTitle(folderId,
149                 titleWithExtension);
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.DLFileEntrySoap[] getFileEntries(
159         long folderId) throws RemoteException {
160         try {
161             java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
162                 DLFileEntryServiceUtil.getFileEntries(folderId);
163 
164             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModels(returnValue);
165         }
166         catch (Exception e) {
167             _log.error(e, e);
168 
169             throw new RemoteException(e.getMessage());
170         }
171     }
172 
173     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap getFileEntry(
174         long folderId, java.lang.String name) throws RemoteException {
175         try {
176             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntry(folderId,
177                     name);
178 
179             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
180         }
181         catch (Exception e) {
182             _log.error(e, e);
183 
184             throw new RemoteException(e.getMessage());
185         }
186     }
187 
188     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap getFileEntryByTitle(
189         long folderId, java.lang.String titleWithExtension)
190         throws RemoteException {
191         try {
192             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntryByTitle(folderId,
193                     titleWithExtension);
194 
195             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
196         }
197         catch (Exception e) {
198             _log.error(e, e);
199 
200             throw new RemoteException(e.getMessage());
201         }
202     }
203 
204     public static com.liferay.lock.model.Lock getFileEntryLock(long folderId,
205         java.lang.String name) throws RemoteException {
206         try {
207             com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.getFileEntryLock(folderId,
208                     name);
209 
210             return returnValue;
211         }
212         catch (Exception e) {
213             _log.error(e, e);
214 
215             throw new RemoteException(e.getMessage());
216         }
217     }
218 
219     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
220         java.lang.String name) throws RemoteException {
221         try {
222             com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.lockFileEntry(folderId,
223                     name);
224 
225             return returnValue;
226         }
227         catch (Exception e) {
228             _log.error(e, e);
229 
230             throw new RemoteException(e.getMessage());
231         }
232     }
233 
234     public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
235         java.lang.String name, java.lang.String owner, long expirationTime)
236         throws RemoteException {
237         try {
238             com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.lockFileEntry(folderId,
239                     name, owner, expirationTime);
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 refreshFileEntryLock(
251         java.lang.String lockUuid, long expirationTime)
252         throws RemoteException {
253         try {
254             com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.refreshFileEntryLock(lockUuid,
255                     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 void unlockFileEntry(long folderId, java.lang.String name)
267         throws RemoteException {
268         try {
269             DLFileEntryServiceUtil.unlockFileEntry(folderId, name);
270         }
271         catch (Exception e) {
272             _log.error(e, e);
273 
274             throw new RemoteException(e.getMessage());
275         }
276     }
277 
278     public static void unlockFileEntry(long folderId, java.lang.String name,
279         java.lang.String lockUuid) throws RemoteException {
280         try {
281             DLFileEntryServiceUtil.unlockFileEntry(folderId, name, lockUuid);
282         }
283         catch (Exception e) {
284             _log.error(e, e);
285 
286             throw new RemoteException(e.getMessage());
287         }
288     }
289 
290     public static com.liferay.portlet.documentlibrary.model.DLFileEntrySoap updateFileEntry(
291         long folderId, long newFolderId, java.lang.String name,
292         java.lang.String sourceFileName, java.lang.String title,
293         java.lang.String description, java.lang.String[] tagsEntries,
294         java.lang.String extraSettings, byte[] bytes) throws RemoteException {
295         try {
296             com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.updateFileEntry(folderId,
297                     newFolderId, name, sourceFileName, title, description,
298                     tagsEntries, extraSettings, bytes);
299 
300             return com.liferay.portlet.documentlibrary.model.DLFileEntrySoap.toSoapModel(returnValue);
301         }
302         catch (Exception e) {
303             _log.error(e, e);
304 
305             throw new RemoteException(e.getMessage());
306         }
307     }
308 
309     private static Log _log = LogFactoryUtil.getLog(DLFileEntryServiceSoap.class);
310 }