1
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.BooleanWrapper;
28 import com.liferay.portal.kernel.util.IntegerWrapper;
29 import com.liferay.portal.kernel.util.LongWrapper;
30 import com.liferay.portal.kernel.util.MethodWrapper;
31 import com.liferay.portal.kernel.util.NullWrapper;
32 import com.liferay.portal.security.auth.HttpPrincipal;
33 import com.liferay.portal.service.WebsiteServiceUtil;
34 import com.liferay.portal.service.http.TunnelUtil;
35
36
73 public class WebsiteServiceHttp {
74 public static com.liferay.portal.model.Website addWebsite(
75 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
76 java.lang.String url, int typeId, boolean primary)
77 throws com.liferay.portal.SystemException,
78 com.liferay.portal.PortalException {
79 try {
80 Object paramObj0 = className;
81
82 if (className == null) {
83 paramObj0 = new NullWrapper("java.lang.String");
84 }
85
86 Object paramObj1 = new LongWrapper(classPK);
87 Object paramObj2 = url;
88
89 if (url == null) {
90 paramObj2 = new NullWrapper("java.lang.String");
91 }
92
93 Object paramObj3 = new IntegerWrapper(typeId);
94 Object paramObj4 = new BooleanWrapper(primary);
95 MethodWrapper methodWrapper = new MethodWrapper(WebsiteServiceUtil.class.getName(),
96 "addWebsite",
97 new Object[] {
98 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
99 });
100 Object returnObj = null;
101
102 try {
103 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
104 }
105 catch (Exception e) {
106 if (e instanceof com.liferay.portal.SystemException) {
107 throw (com.liferay.portal.SystemException)e;
108 }
109
110 if (e instanceof com.liferay.portal.PortalException) {
111 throw (com.liferay.portal.PortalException)e;
112 }
113
114 throw new com.liferay.portal.SystemException(e);
115 }
116
117 return (com.liferay.portal.model.Website)returnObj;
118 }
119 catch (com.liferay.portal.SystemException se) {
120 _log.error(se, se);
121 throw se;
122 }
123 }
124
125 public static void deleteWebsite(HttpPrincipal httpPrincipal, long websiteId)
126 throws com.liferay.portal.SystemException,
127 com.liferay.portal.PortalException {
128 try {
129 Object paramObj0 = new LongWrapper(websiteId);
130 MethodWrapper methodWrapper = new MethodWrapper(WebsiteServiceUtil.class.getName(),
131 "deleteWebsite", new Object[] { paramObj0 });
132
133 try {
134 TunnelUtil.invoke(httpPrincipal, methodWrapper);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.SystemException) {
138 throw (com.liferay.portal.SystemException)e;
139 }
140
141 if (e instanceof com.liferay.portal.PortalException) {
142 throw (com.liferay.portal.PortalException)e;
143 }
144
145 throw new com.liferay.portal.SystemException(e);
146 }
147 }
148 catch (com.liferay.portal.SystemException se) {
149 _log.error(se, se);
150 throw se;
151 }
152 }
153
154 public static com.liferay.portal.model.Website getWebsite(
155 HttpPrincipal httpPrincipal, long websiteId)
156 throws com.liferay.portal.SystemException,
157 com.liferay.portal.PortalException {
158 try {
159 Object paramObj0 = new LongWrapper(websiteId);
160 MethodWrapper methodWrapper = new MethodWrapper(WebsiteServiceUtil.class.getName(),
161 "getWebsite", new Object[] { paramObj0 });
162 Object returnObj = null;
163
164 try {
165 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
166 }
167 catch (Exception e) {
168 if (e instanceof com.liferay.portal.SystemException) {
169 throw (com.liferay.portal.SystemException)e;
170 }
171
172 if (e instanceof com.liferay.portal.PortalException) {
173 throw (com.liferay.portal.PortalException)e;
174 }
175
176 throw new com.liferay.portal.SystemException(e);
177 }
178
179 return (com.liferay.portal.model.Website)returnObj;
180 }
181 catch (com.liferay.portal.SystemException se) {
182 _log.error(se, se);
183 throw se;
184 }
185 }
186
187 public static java.util.List getWebsites(HttpPrincipal httpPrincipal,
188 java.lang.String className, long classPK)
189 throws com.liferay.portal.SystemException,
190 com.liferay.portal.PortalException {
191 try {
192 Object paramObj0 = className;
193
194 if (className == null) {
195 paramObj0 = new NullWrapper("java.lang.String");
196 }
197
198 Object paramObj1 = new LongWrapper(classPK);
199 MethodWrapper methodWrapper = new MethodWrapper(WebsiteServiceUtil.class.getName(),
200 "getWebsites", new Object[] { paramObj0, paramObj1 });
201 Object returnObj = null;
202
203 try {
204 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
205 }
206 catch (Exception e) {
207 if (e instanceof com.liferay.portal.SystemException) {
208 throw (com.liferay.portal.SystemException)e;
209 }
210
211 if (e instanceof com.liferay.portal.PortalException) {
212 throw (com.liferay.portal.PortalException)e;
213 }
214
215 throw new com.liferay.portal.SystemException(e);
216 }
217
218 return (java.util.List)returnObj;
219 }
220 catch (com.liferay.portal.SystemException se) {
221 _log.error(se, se);
222 throw se;
223 }
224 }
225
226 public static com.liferay.portal.model.Website updateWebsite(
227 HttpPrincipal httpPrincipal, long websiteId, java.lang.String url,
228 int typeId, boolean primary)
229 throws com.liferay.portal.SystemException,
230 com.liferay.portal.PortalException {
231 try {
232 Object paramObj0 = new LongWrapper(websiteId);
233 Object paramObj1 = url;
234
235 if (url == null) {
236 paramObj1 = new NullWrapper("java.lang.String");
237 }
238
239 Object paramObj2 = new IntegerWrapper(typeId);
240 Object paramObj3 = new BooleanWrapper(primary);
241 MethodWrapper methodWrapper = new MethodWrapper(WebsiteServiceUtil.class.getName(),
242 "updateWebsite",
243 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
244 Object returnObj = null;
245
246 try {
247 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
248 }
249 catch (Exception e) {
250 if (e instanceof com.liferay.portal.SystemException) {
251 throw (com.liferay.portal.SystemException)e;
252 }
253
254 if (e instanceof com.liferay.portal.PortalException) {
255 throw (com.liferay.portal.PortalException)e;
256 }
257
258 throw new com.liferay.portal.SystemException(e);
259 }
260
261 return (com.liferay.portal.model.Website)returnObj;
262 }
263 catch (com.liferay.portal.SystemException se) {
264 _log.error(se, se);
265 throw se;
266 }
267 }
268
269 private static Log _log = LogFactoryUtil.getLog(WebsiteServiceHttp.class);
270 }