001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.http;
022:
023: import com.liferay.portal.kernel.log.Log;
024: import com.liferay.portal.kernel.log.LogFactoryUtil;
025: import com.liferay.portal.kernel.util.BooleanWrapper;
026: import com.liferay.portal.kernel.util.LongWrapper;
027: import com.liferay.portal.kernel.util.MethodWrapper;
028: import com.liferay.portal.kernel.util.NullWrapper;
029: import com.liferay.portal.security.auth.HttpPrincipal;
030: import com.liferay.portal.service.CompanyServiceUtil;
031:
032: /**
033: * <a href="CompanyServiceHttp.java.html"><b><i>View Source</i></b></a>
034: *
035: * <p>
036: * ServiceBuilder generated this class. Modifications in this class will be
037: * overwritten the next time is generated.
038: * </p>
039: *
040: * <p>
041: * This class provides a HTTP utility for the
042: * <code>com.liferay.portal.service.CompanyServiceUtil</code> service
043: * utility. The static methods of this class calls the same methods of the
044: * service utility. However, the signatures are different because it requires an
045: * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
046: * parameter.
047: * </p>
048: *
049: * <p>
050: * The benefits of using the HTTP utility is that it is fast and allows for
051: * tunneling without the cost of serializing to text. The drawback is that it
052: * only works with Java.
053: * </p>
054: *
055: * <p>
056: * Set the property <code>tunnel.servlet.hosts.allowed</code> in
057: * portal.properties to configure security.
058: * </p>
059: *
060: * <p>
061: * The HTTP utility is only generated for remote services.
062: * </p>
063: *
064: * @author Brian Wing Shun Chan
065: *
066: * @see com.liferay.portal.security.auth.HttpPrincipal
067: * @see com.liferay.portal.service.CompanyServiceUtil
068: * @see com.liferay.portal.service.http.CompanyServiceSoap
069: *
070: */
071: public class CompanyServiceHttp {
072: public static com.liferay.portal.model.Company addCompany(
073: HttpPrincipal httpPrincipal, java.lang.String webId,
074: java.lang.String virtualHost, java.lang.String mx)
075: throws com.liferay.portal.SystemException,
076: com.liferay.portal.PortalException {
077: try {
078: Object paramObj0 = webId;
079:
080: if (webId == null) {
081: paramObj0 = new NullWrapper("java.lang.String");
082: }
083:
084: Object paramObj1 = virtualHost;
085:
086: if (virtualHost == null) {
087: paramObj1 = new NullWrapper("java.lang.String");
088: }
089:
090: Object paramObj2 = mx;
091:
092: if (mx == null) {
093: paramObj2 = new NullWrapper("java.lang.String");
094: }
095:
096: MethodWrapper methodWrapper = new MethodWrapper(
097: CompanyServiceUtil.class.getName(), "addCompany",
098: new Object[] { paramObj0, paramObj1, paramObj2 });
099:
100: Object returnObj = null;
101:
102: try {
103: returnObj = TunnelUtil.invoke(httpPrincipal,
104: methodWrapper);
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.Company) returnObj;
118: } catch (com.liferay.portal.SystemException se) {
119: _log.error(se, se);
120:
121: throw se;
122: }
123: }
124:
125: public static com.liferay.portal.model.Company updateCompany(
126: HttpPrincipal httpPrincipal, long companyId,
127: java.lang.String virtualHost, java.lang.String mx)
128: throws com.liferay.portal.SystemException,
129: com.liferay.portal.PortalException {
130: try {
131: Object paramObj0 = new LongWrapper(companyId);
132:
133: Object paramObj1 = virtualHost;
134:
135: if (virtualHost == null) {
136: paramObj1 = new NullWrapper("java.lang.String");
137: }
138:
139: Object paramObj2 = mx;
140:
141: if (mx == null) {
142: paramObj2 = new NullWrapper("java.lang.String");
143: }
144:
145: MethodWrapper methodWrapper = new MethodWrapper(
146: CompanyServiceUtil.class.getName(),
147: "updateCompany", new Object[] { paramObj0,
148: paramObj1, paramObj2 });
149:
150: Object returnObj = null;
151:
152: try {
153: returnObj = TunnelUtil.invoke(httpPrincipal,
154: methodWrapper);
155: } catch (Exception e) {
156: if (e instanceof com.liferay.portal.SystemException) {
157: throw (com.liferay.portal.SystemException) e;
158: }
159:
160: if (e instanceof com.liferay.portal.PortalException) {
161: throw (com.liferay.portal.PortalException) e;
162: }
163:
164: throw new com.liferay.portal.SystemException(e);
165: }
166:
167: return (com.liferay.portal.model.Company) returnObj;
168: } catch (com.liferay.portal.SystemException se) {
169: _log.error(se, se);
170:
171: throw se;
172: }
173: }
174:
175: public static com.liferay.portal.model.Company updateCompany(
176: HttpPrincipal httpPrincipal, long companyId,
177: java.lang.String virtualHost, java.lang.String mx,
178: java.lang.String name, java.lang.String legalName,
179: java.lang.String legalId, java.lang.String legalType,
180: java.lang.String sicCode, java.lang.String tickerSymbol,
181: java.lang.String industry, java.lang.String type,
182: java.lang.String size)
183: throws com.liferay.portal.SystemException,
184: com.liferay.portal.PortalException {
185: try {
186: Object paramObj0 = new LongWrapper(companyId);
187:
188: Object paramObj1 = virtualHost;
189:
190: if (virtualHost == null) {
191: paramObj1 = new NullWrapper("java.lang.String");
192: }
193:
194: Object paramObj2 = mx;
195:
196: if (mx == null) {
197: paramObj2 = new NullWrapper("java.lang.String");
198: }
199:
200: Object paramObj3 = name;
201:
202: if (name == null) {
203: paramObj3 = new NullWrapper("java.lang.String");
204: }
205:
206: Object paramObj4 = legalName;
207:
208: if (legalName == null) {
209: paramObj4 = new NullWrapper("java.lang.String");
210: }
211:
212: Object paramObj5 = legalId;
213:
214: if (legalId == null) {
215: paramObj5 = new NullWrapper("java.lang.String");
216: }
217:
218: Object paramObj6 = legalType;
219:
220: if (legalType == null) {
221: paramObj6 = new NullWrapper("java.lang.String");
222: }
223:
224: Object paramObj7 = sicCode;
225:
226: if (sicCode == null) {
227: paramObj7 = new NullWrapper("java.lang.String");
228: }
229:
230: Object paramObj8 = tickerSymbol;
231:
232: if (tickerSymbol == null) {
233: paramObj8 = new NullWrapper("java.lang.String");
234: }
235:
236: Object paramObj9 = industry;
237:
238: if (industry == null) {
239: paramObj9 = new NullWrapper("java.lang.String");
240: }
241:
242: Object paramObj10 = type;
243:
244: if (type == null) {
245: paramObj10 = new NullWrapper("java.lang.String");
246: }
247:
248: Object paramObj11 = size;
249:
250: if (size == null) {
251: paramObj11 = new NullWrapper("java.lang.String");
252: }
253:
254: MethodWrapper methodWrapper = new MethodWrapper(
255: CompanyServiceUtil.class.getName(),
256: "updateCompany", new Object[] { paramObj0,
257: paramObj1, paramObj2, paramObj3, paramObj4,
258: paramObj5, paramObj6, paramObj7, paramObj8,
259: paramObj9, paramObj10, paramObj11 });
260:
261: Object returnObj = null;
262:
263: try {
264: returnObj = TunnelUtil.invoke(httpPrincipal,
265: methodWrapper);
266: } catch (Exception e) {
267: if (e instanceof com.liferay.portal.SystemException) {
268: throw (com.liferay.portal.SystemException) e;
269: }
270:
271: if (e instanceof com.liferay.portal.PortalException) {
272: throw (com.liferay.portal.PortalException) e;
273: }
274:
275: throw new com.liferay.portal.SystemException(e);
276: }
277:
278: return (com.liferay.portal.model.Company) returnObj;
279: } catch (com.liferay.portal.SystemException se) {
280: _log.error(se, se);
281:
282: throw se;
283: }
284: }
285:
286: public static void updateDisplay(HttpPrincipal httpPrincipal,
287: long companyId, java.lang.String languageId,
288: java.lang.String timeZoneId)
289: throws com.liferay.portal.SystemException,
290: com.liferay.portal.PortalException {
291: try {
292: Object paramObj0 = new LongWrapper(companyId);
293:
294: Object paramObj1 = languageId;
295:
296: if (languageId == null) {
297: paramObj1 = new NullWrapper("java.lang.String");
298: }
299:
300: Object paramObj2 = timeZoneId;
301:
302: if (timeZoneId == null) {
303: paramObj2 = new NullWrapper("java.lang.String");
304: }
305:
306: MethodWrapper methodWrapper = new MethodWrapper(
307: CompanyServiceUtil.class.getName(),
308: "updateDisplay", new Object[] { paramObj0,
309: paramObj1, paramObj2 });
310:
311: try {
312: TunnelUtil.invoke(httpPrincipal, methodWrapper);
313: } catch (Exception e) {
314: if (e instanceof com.liferay.portal.SystemException) {
315: throw (com.liferay.portal.SystemException) e;
316: }
317:
318: if (e instanceof com.liferay.portal.PortalException) {
319: throw (com.liferay.portal.PortalException) e;
320: }
321:
322: throw new com.liferay.portal.SystemException(e);
323: }
324: } catch (com.liferay.portal.SystemException se) {
325: _log.error(se, se);
326:
327: throw se;
328: }
329: }
330:
331: public static void updateLogo(HttpPrincipal httpPrincipal,
332: long companyId, java.io.File file)
333: throws com.liferay.portal.SystemException,
334: com.liferay.portal.PortalException {
335: try {
336: Object paramObj0 = new LongWrapper(companyId);
337:
338: Object paramObj1 = file;
339:
340: if (file == null) {
341: paramObj1 = new NullWrapper("java.io.File");
342: }
343:
344: MethodWrapper methodWrapper = new MethodWrapper(
345: CompanyServiceUtil.class.getName(), "updateLogo",
346: new Object[] { paramObj0, paramObj1 });
347:
348: try {
349: TunnelUtil.invoke(httpPrincipal, methodWrapper);
350: } catch (Exception e) {
351: if (e instanceof com.liferay.portal.SystemException) {
352: throw (com.liferay.portal.SystemException) e;
353: }
354:
355: if (e instanceof com.liferay.portal.PortalException) {
356: throw (com.liferay.portal.PortalException) e;
357: }
358:
359: throw new com.liferay.portal.SystemException(e);
360: }
361: } catch (com.liferay.portal.SystemException se) {
362: _log.error(se, se);
363:
364: throw se;
365: }
366: }
367:
368: public static void updateSecurity(HttpPrincipal httpPrincipal,
369: long companyId, java.lang.String authType,
370: boolean autoLogin, boolean sendPassword, boolean strangers,
371: boolean strangersWithMx, boolean strangersVerify,
372: boolean communityLogo)
373: throws com.liferay.portal.SystemException,
374: com.liferay.portal.PortalException {
375: try {
376: Object paramObj0 = new LongWrapper(companyId);
377:
378: Object paramObj1 = authType;
379:
380: if (authType == null) {
381: paramObj1 = new NullWrapper("java.lang.String");
382: }
383:
384: Object paramObj2 = new BooleanWrapper(autoLogin);
385:
386: Object paramObj3 = new BooleanWrapper(sendPassword);
387:
388: Object paramObj4 = new BooleanWrapper(strangers);
389:
390: Object paramObj5 = new BooleanWrapper(strangersWithMx);
391:
392: Object paramObj6 = new BooleanWrapper(strangersVerify);
393:
394: Object paramObj7 = new BooleanWrapper(communityLogo);
395:
396: MethodWrapper methodWrapper = new MethodWrapper(
397: CompanyServiceUtil.class.getName(),
398: "updateSecurity", new Object[] { paramObj0,
399: paramObj1, paramObj2, paramObj3, paramObj4,
400: paramObj5, paramObj6, paramObj7 });
401:
402: try {
403: TunnelUtil.invoke(httpPrincipal, methodWrapper);
404: } catch (Exception e) {
405: if (e instanceof com.liferay.portal.SystemException) {
406: throw (com.liferay.portal.SystemException) e;
407: }
408:
409: if (e instanceof com.liferay.portal.PortalException) {
410: throw (com.liferay.portal.PortalException) e;
411: }
412:
413: throw new com.liferay.portal.SystemException(e);
414: }
415: } catch (com.liferay.portal.SystemException se) {
416: _log.error(se, se);
417:
418: throw se;
419: }
420: }
421:
422: private static Log _log = LogFactoryUtil
423: .getLog(CompanyServiceHttp.class);
424: }
|