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