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.LongWrapper;
20  import com.liferay.portal.kernel.util.MethodWrapper;
21  import com.liferay.portal.kernel.util.NullWrapper;
22  import com.liferay.portal.security.auth.HttpPrincipal;
23  import com.liferay.portal.service.http.TunnelUtil;
24  
25  import com.liferay.portlet.documentlibrary.service.DLFileVersionServiceUtil;
26  
27  /**
28   * <a href="DLFileVersionServiceHttp.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be
32   * overwritten the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This class provides a HTTP utility for the
37   * {@link com.liferay.portlet.documentlibrary.service.DLFileVersionServiceUtil} service utility. The
38   * static methods of this class calls the same methods of the service utility.
39   * However, the signatures are different because it requires an additional
40   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
41   * </p>
42   *
43   * <p>
44   * The benefits of using the HTTP utility is that it is fast and allows for
45   * tunneling without the cost of serializing to text. The drawback is that it
46   * only works with Java.
47   * </p>
48   *
49   * <p>
50   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
51   * configure security.
52   * </p>
53   *
54   * <p>
55   * The HTTP utility is only generated for remote services.
56   * </p>
57   *
58   * @author    Brian Wing Shun Chan
59   * @see       DLFileVersionServiceSoap
60   * @see       com.liferay.portal.security.auth.HttpPrincipal
61   * @see       com.liferay.portlet.documentlibrary.service.DLFileVersionServiceUtil
62   * @generated
63   */
64  public class DLFileVersionServiceHttp {
65      public static com.liferay.portlet.documentlibrary.model.DLFileVersion updateDescription(
66          HttpPrincipal httpPrincipal, long fileVersionId,
67          java.lang.String description)
68          throws com.liferay.portal.PortalException,
69              com.liferay.portal.SystemException {
70          try {
71              Object paramObj0 = new LongWrapper(fileVersionId);
72  
73              Object paramObj1 = description;
74  
75              if (description == null) {
76                  paramObj1 = new NullWrapper("java.lang.String");
77              }
78  
79              MethodWrapper methodWrapper = new MethodWrapper(DLFileVersionServiceUtil.class.getName(),
80                      "updateDescription", new Object[] { paramObj0, paramObj1 });
81  
82              Object returnObj = null;
83  
84              try {
85                  returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
86              }
87              catch (Exception e) {
88                  if (e instanceof com.liferay.portal.PortalException) {
89                      throw (com.liferay.portal.PortalException)e;
90                  }
91  
92                  if (e instanceof com.liferay.portal.SystemException) {
93                      throw (com.liferay.portal.SystemException)e;
94                  }
95  
96                  throw new com.liferay.portal.SystemException(e);
97              }
98  
99              return (com.liferay.portlet.documentlibrary.model.DLFileVersion)returnObj;
100         }
101         catch (com.liferay.portal.SystemException se) {
102             _log.error(se, se);
103 
104             throw se;
105         }
106     }
107 
108     private static Log _log = LogFactoryUtil.getLog(DLFileVersionServiceHttp.class);
109 }