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