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