1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  import com.liferay.portal.kernel.util.LongWrapper;
28  import com.liferay.portal.kernel.util.MethodWrapper;
29  import com.liferay.portal.security.auth.HttpPrincipal;
30  import com.liferay.portal.service.ThemeServiceUtil;
31  
32  /**
33   * <a href="ThemeServiceHttp.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * <p>
41   * This class provides a HTTP utility for the
42   * {@link com.liferay.portal.service.ThemeServiceUtil} service utility. The
43   * static methods of this class calls the same methods of the service utility.
44   * However, the signatures are different because it requires an additional
45   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
46   * </p>
47   *
48   * <p>
49   * The benefits of using the HTTP utility is that it is fast and allows for
50   * tunneling without the cost of serializing to text. The drawback is that it
51   * only works with Java.
52   * </p>
53   *
54   * <p>
55   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
56   * configure security.
57   * </p>
58   *
59   * <p>
60   * The HTTP utility is only generated for remote services.
61   * </p>
62   *
63   * @author    Brian Wing Shun Chan
64   * @see       ThemeServiceSoap
65   * @see       com.liferay.portal.security.auth.HttpPrincipal
66   * @see       com.liferay.portal.service.ThemeServiceUtil
67   * @generated
68   */
69  public class ThemeServiceHttp {
70      public static java.util.List<com.liferay.portal.model.Theme> getThemes(
71          HttpPrincipal httpPrincipal, long companyId)
72          throws com.liferay.portal.SystemException {
73          try {
74              Object paramObj0 = new LongWrapper(companyId);
75  
76              MethodWrapper methodWrapper = new MethodWrapper(ThemeServiceUtil.class.getName(),
77                      "getThemes", new Object[] { paramObj0 });
78  
79              Object returnObj = null;
80  
81              try {
82                  returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
83              }
84              catch (Exception e) {
85                  throw new com.liferay.portal.SystemException(e);
86              }
87  
88              return (java.util.List<com.liferay.portal.model.Theme>)returnObj;
89          }
90          catch (com.liferay.portal.SystemException se) {
91              _log.error(se, se);
92  
93              throw se;
94          }
95      }
96  
97      public static com.liferay.portal.kernel.json.JSONArray getWARThemes(
98          HttpPrincipal httpPrincipal) throws com.liferay.portal.SystemException {
99          try {
100             MethodWrapper methodWrapper = new MethodWrapper(ThemeServiceUtil.class.getName(),
101                     "getWARThemes", new Object[0]);
102 
103             Object returnObj = null;
104 
105             try {
106                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
107             }
108             catch (Exception e) {
109                 throw new com.liferay.portal.SystemException(e);
110             }
111 
112             return (com.liferay.portal.kernel.json.JSONArray)returnObj;
113         }
114         catch (com.liferay.portal.SystemException se) {
115             _log.error(se, se);
116 
117             throw se;
118         }
119     }
120 
121     private static Log _log = LogFactoryUtil.getLog(ThemeServiceHttp.class);
122 }