1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portlet.documentlibrary.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.MethodHandler;
20  import com.liferay.portal.kernel.util.MethodKey;
21  import com.liferay.portal.security.auth.HttpPrincipal;
22  import com.liferay.portal.service.http.TunnelUtil;
23  
24  import com.liferay.portlet.documentlibrary.service.DLFileShortcutServiceUtil;
25  
26  /**
27   * <a href="DLFileShortcutServiceHttp.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides a HTTP utility for the
36   * {@link com.liferay.portlet.documentlibrary.service.DLFileShortcutServiceUtil} service utility. The
37   * static methods of this class calls the same methods of the service utility.
38   * However, the signatures are different because it requires an additional
39   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
40   * </p>
41   *
42   * <p>
43   * The benefits of using the HTTP utility is that it is fast and allows for
44   * tunneling without the cost of serializing to text. The drawback is that it
45   * only works with Java.
46   * </p>
47   *
48   * <p>
49   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
50   * configure security.
51   * </p>
52   *
53   * <p>
54   * The HTTP utility is only generated for remote services.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       DLFileShortcutServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.documentlibrary.service.DLFileShortcutServiceUtil
61   * @generated
62   */
63  public class DLFileShortcutServiceHttp {
64      public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
65          HttpPrincipal httpPrincipal, long folderId, long toFolderId,
66          java.lang.String toName, boolean addCommunityPermissions,
67          boolean addGuestPermissions)
68          throws com.liferay.portal.PortalException,
69              com.liferay.portal.SystemException {
70          try {
71              MethodKey methodKey = new MethodKey(DLFileShortcutServiceUtil.class.getName(),
72                      "addFileShortcut", _addFileShortcutParameterTypes0);
73  
74              MethodHandler methodHandler = new MethodHandler(methodKey,
75                      folderId, toFolderId, toName, addCommunityPermissions,
76                      addGuestPermissions);
77  
78              Object returnObj = null;
79  
80              try {
81                  returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
82              }
83              catch (Exception e) {
84                  if (e instanceof com.liferay.portal.PortalException) {
85                      throw (com.liferay.portal.PortalException)e;
86                  }
87  
88                  if (e instanceof com.liferay.portal.SystemException) {
89                      throw (com.liferay.portal.SystemException)e;
90                  }
91  
92                  throw new com.liferay.portal.SystemException(e);
93              }
94  
95              return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
96          }
97          catch (com.liferay.portal.SystemException se) {
98              _log.error(se, se);
99  
100             throw se;
101         }
102     }
103 
104     public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
105         HttpPrincipal httpPrincipal, long folderId, long toFolderId,
106         java.lang.String toName,
107         com.liferay.portal.service.ServiceContext serviceContext)
108         throws com.liferay.portal.PortalException,
109             com.liferay.portal.SystemException {
110         try {
111             MethodKey methodKey = new MethodKey(DLFileShortcutServiceUtil.class.getName(),
112                     "addFileShortcut", _addFileShortcutParameterTypes1);
113 
114             MethodHandler methodHandler = new MethodHandler(methodKey,
115                     folderId, toFolderId, toName, serviceContext);
116 
117             Object returnObj = null;
118 
119             try {
120                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
121             }
122             catch (Exception e) {
123                 if (e instanceof com.liferay.portal.PortalException) {
124                     throw (com.liferay.portal.PortalException)e;
125                 }
126 
127                 if (e instanceof com.liferay.portal.SystemException) {
128                     throw (com.liferay.portal.SystemException)e;
129                 }
130 
131                 throw new com.liferay.portal.SystemException(e);
132             }
133 
134             return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
135         }
136         catch (com.liferay.portal.SystemException se) {
137             _log.error(se, se);
138 
139             throw se;
140         }
141     }
142 
143     public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
144         HttpPrincipal httpPrincipal, long folderId, long toFolderId,
145         java.lang.String toName, java.lang.String[] communityPermissions,
146         java.lang.String[] guestPermissions)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException {
149         try {
150             MethodKey methodKey = new MethodKey(DLFileShortcutServiceUtil.class.getName(),
151                     "addFileShortcut", _addFileShortcutParameterTypes2);
152 
153             MethodHandler methodHandler = new MethodHandler(methodKey,
154                     folderId, toFolderId, toName, communityPermissions,
155                     guestPermissions);
156 
157             Object returnObj = null;
158 
159             try {
160                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
161             }
162             catch (Exception e) {
163                 if (e instanceof com.liferay.portal.PortalException) {
164                     throw (com.liferay.portal.PortalException)e;
165                 }
166 
167                 if (e instanceof com.liferay.portal.SystemException) {
168                     throw (com.liferay.portal.SystemException)e;
169                 }
170 
171                 throw new com.liferay.portal.SystemException(e);
172             }
173 
174             return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
175         }
176         catch (com.liferay.portal.SystemException se) {
177             _log.error(se, se);
178 
179             throw se;
180         }
181     }
182 
183     public static void deleteFileShortcut(HttpPrincipal httpPrincipal,
184         long fileShortcutId)
185         throws com.liferay.portal.PortalException,
186             com.liferay.portal.SystemException {
187         try {
188             MethodKey methodKey = new MethodKey(DLFileShortcutServiceUtil.class.getName(),
189                     "deleteFileShortcut", _deleteFileShortcutParameterTypes3);
190 
191             MethodHandler methodHandler = new MethodHandler(methodKey,
192                     fileShortcutId);
193 
194             try {
195                 TunnelUtil.invoke(httpPrincipal, methodHandler);
196             }
197             catch (Exception e) {
198                 if (e instanceof com.liferay.portal.PortalException) {
199                     throw (com.liferay.portal.PortalException)e;
200                 }
201 
202                 if (e instanceof com.liferay.portal.SystemException) {
203                     throw (com.liferay.portal.SystemException)e;
204                 }
205 
206                 throw new com.liferay.portal.SystemException(e);
207             }
208         }
209         catch (com.liferay.portal.SystemException se) {
210             _log.error(se, se);
211 
212             throw se;
213         }
214     }
215 
216     public static com.liferay.portlet.documentlibrary.model.DLFileShortcut getFileShortcut(
217         HttpPrincipal httpPrincipal, long fileShortcutId)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         try {
221             MethodKey methodKey = new MethodKey(DLFileShortcutServiceUtil.class.getName(),
222                     "getFileShortcut", _getFileShortcutParameterTypes4);
223 
224             MethodHandler methodHandler = new MethodHandler(methodKey,
225                     fileShortcutId);
226 
227             Object returnObj = null;
228 
229             try {
230                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
231             }
232             catch (Exception e) {
233                 if (e instanceof com.liferay.portal.PortalException) {
234                     throw (com.liferay.portal.PortalException)e;
235                 }
236 
237                 if (e instanceof com.liferay.portal.SystemException) {
238                     throw (com.liferay.portal.SystemException)e;
239                 }
240 
241                 throw new com.liferay.portal.SystemException(e);
242             }
243 
244             return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
245         }
246         catch (com.liferay.portal.SystemException se) {
247             _log.error(se, se);
248 
249             throw se;
250         }
251     }
252 
253     public static com.liferay.portlet.documentlibrary.model.DLFileShortcut updateFileShortcut(
254         HttpPrincipal httpPrincipal, long fileShortcutId, long folderId,
255         long toFolderId, java.lang.String toName)
256         throws com.liferay.portal.PortalException,
257             com.liferay.portal.SystemException {
258         try {
259             MethodKey methodKey = new MethodKey(DLFileShortcutServiceUtil.class.getName(),
260                     "updateFileShortcut", _updateFileShortcutParameterTypes5);
261 
262             MethodHandler methodHandler = new MethodHandler(methodKey,
263                     fileShortcutId, folderId, toFolderId, toName);
264 
265             Object returnObj = null;
266 
267             try {
268                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
269             }
270             catch (Exception e) {
271                 if (e instanceof com.liferay.portal.PortalException) {
272                     throw (com.liferay.portal.PortalException)e;
273                 }
274 
275                 if (e instanceof com.liferay.portal.SystemException) {
276                     throw (com.liferay.portal.SystemException)e;
277                 }
278 
279                 throw new com.liferay.portal.SystemException(e);
280             }
281 
282             return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
283         }
284         catch (com.liferay.portal.SystemException se) {
285             _log.error(se, se);
286 
287             throw se;
288         }
289     }
290 
291     public static com.liferay.portlet.documentlibrary.model.DLFileShortcut updateFileShortcut(
292         HttpPrincipal httpPrincipal, long fileShortcutId, long folderId,
293         long toFolderId, java.lang.String toName,
294         com.liferay.portal.service.ServiceContext serviceContext)
295         throws com.liferay.portal.PortalException,
296             com.liferay.portal.SystemException {
297         try {
298             MethodKey methodKey = new MethodKey(DLFileShortcutServiceUtil.class.getName(),
299                     "updateFileShortcut", _updateFileShortcutParameterTypes6);
300 
301             MethodHandler methodHandler = new MethodHandler(methodKey,
302                     fileShortcutId, folderId, toFolderId, toName, serviceContext);
303 
304             Object returnObj = null;
305 
306             try {
307                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
308             }
309             catch (Exception e) {
310                 if (e instanceof com.liferay.portal.PortalException) {
311                     throw (com.liferay.portal.PortalException)e;
312                 }
313 
314                 if (e instanceof com.liferay.portal.SystemException) {
315                     throw (com.liferay.portal.SystemException)e;
316                 }
317 
318                 throw new com.liferay.portal.SystemException(e);
319             }
320 
321             return (com.liferay.portlet.documentlibrary.model.DLFileShortcut)returnObj;
322         }
323         catch (com.liferay.portal.SystemException se) {
324             _log.error(se, se);
325 
326             throw se;
327         }
328     }
329 
330     private static Log _log = LogFactoryUtil.getLog(DLFileShortcutServiceHttp.class);
331     private static final Class<?>[] _addFileShortcutParameterTypes0 = new Class[] {
332             long.class, long.class, java.lang.String.class, boolean.class,
333             boolean.class
334         };
335     private static final Class<?>[] _addFileShortcutParameterTypes1 = new Class[] {
336             long.class, long.class, java.lang.String.class,
337             com.liferay.portal.service.ServiceContext.class
338         };
339     private static final Class<?>[] _addFileShortcutParameterTypes2 = new Class[] {
340             long.class, long.class, java.lang.String.class,
341             java.lang.String[].class, java.lang.String[].class
342         };
343     private static final Class<?>[] _deleteFileShortcutParameterTypes3 = new Class[] {
344             long.class
345         };
346     private static final Class<?>[] _getFileShortcutParameterTypes4 = new Class[] {
347             long.class
348         };
349     private static final Class<?>[] _updateFileShortcutParameterTypes5 = new Class[] {
350             long.class, long.class, long.class, java.lang.String.class
351         };
352     private static final Class<?>[] _updateFileShortcutParameterTypes6 = new Class[] {
353             long.class, long.class, long.class, java.lang.String.class,
354             com.liferay.portal.service.ServiceContext.class
355         };
356 }