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