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.service.UserServiceUtil;
026:
027: import java.rmi.RemoteException;
028:
029: /**
030: * <a href="UserServiceSoap.java.html"><b><i>View Source</i></b></a>
031: *
032: * <p>
033: * ServiceBuilder generated this class. Modifications in this class will be
034: * overwritten the next time is generated.
035: * </p>
036: *
037: * <p>
038: * This class provides a SOAP utility for the
039: * <code>com.liferay.portal.service.UserServiceUtil</code> service
040: * utility. The static methods of this class calls the same methods of the
041: * service utility. However, the signatures are different because it is
042: * difficult for SOAP to support certain types.
043: * </p>
044: *
045: * <p>
046: * ServiceBuilder follows certain rules in translating the methods. For example,
047: * if the method in the service utility returns a <code>java.util.List</code>,
048: * that is translated to an array of
049: * <code>com.liferay.portal.model.UserSoap</code>. If the method in the
050: * service utility returns a <code>com.liferay.portal.model.User</code>,
051: * that is translated to a <code>com.liferay.portal.model.UserSoap</code>.
052: * Methods that SOAP cannot safely wire are skipped.
053: * </p>
054: *
055: * <p>
056: * The benefits of using the SOAP utility is that it is cross platform
057: * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
058: * even Perl, to call the generated services. One drawback of SOAP is that it is
059: * slow because it needs to serialize all calls into a text format (XML).
060: * </p>
061: *
062: * <p>
063: * You can see a list of services at
064: * http://localhost:8080/tunnel-web/secure/axis. Set the property
065: * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
066: * security.
067: * </p>
068: *
069: * <p>
070: * The SOAP utility is only generated for remote services.
071: * </p>
072: *
073: * @author Brian Wing Shun Chan
074: *
075: * @see com.liferay.portal.service.UserServiceUtil
076: * @see com.liferay.portal.service.http.UserServiceHttp
077: * @see com.liferay.portal.service.model.UserSoap
078: *
079: */
080: public class UserServiceSoap {
081: public static void addGroupUsers(long groupId, long[] userIds)
082: throws RemoteException {
083: try {
084: UserServiceUtil.addGroupUsers(groupId, userIds);
085: } catch (Exception e) {
086: _log.error(e, e);
087:
088: throw new RemoteException(e.getMessage());
089: }
090: }
091:
092: public static void addOrganizationUsers(long organizationId,
093: long[] userIds) throws RemoteException {
094: try {
095: UserServiceUtil.addOrganizationUsers(organizationId,
096: userIds);
097: } catch (Exception e) {
098: _log.error(e, e);
099:
100: throw new RemoteException(e.getMessage());
101: }
102: }
103:
104: public static void addPasswordPolicyUsers(long passwordPolicyId,
105: long[] userIds) throws RemoteException {
106: try {
107: UserServiceUtil.addPasswordPolicyUsers(passwordPolicyId,
108: userIds);
109: } catch (Exception e) {
110: _log.error(e, e);
111:
112: throw new RemoteException(e.getMessage());
113: }
114: }
115:
116: public static void addRoleUsers(long roleId, long[] userIds)
117: throws RemoteException {
118: try {
119: UserServiceUtil.addRoleUsers(roleId, userIds);
120: } catch (Exception e) {
121: _log.error(e, e);
122:
123: throw new RemoteException(e.getMessage());
124: }
125: }
126:
127: public static void addUserGroupUsers(long userGroupId,
128: long[] userIds) throws RemoteException {
129: try {
130: UserServiceUtil.addUserGroupUsers(userGroupId, userIds);
131: } catch (Exception e) {
132: _log.error(e, e);
133:
134: throw new RemoteException(e.getMessage());
135: }
136: }
137:
138: public static com.liferay.portal.model.UserSoap addUser(
139: long companyId, boolean autoPassword,
140: java.lang.String password1, java.lang.String password2,
141: boolean autoScreenName, java.lang.String screenName,
142: java.lang.String emailAddress, String locale,
143: java.lang.String firstName, java.lang.String middleName,
144: java.lang.String lastName, int prefixId, int suffixId,
145: boolean male, int birthdayMonth, int birthdayDay,
146: int birthdayYear, java.lang.String jobTitle,
147: long[] organizationIds, boolean sendEmail)
148: throws RemoteException {
149: try {
150: com.liferay.portal.model.User returnValue = UserServiceUtil
151: .addUser(companyId, autoPassword, password1,
152: password2, autoScreenName, screenName,
153: emailAddress, new java.util.Locale(locale),
154: firstName, middleName, lastName, prefixId,
155: suffixId, male, birthdayMonth, birthdayDay,
156: birthdayYear, jobTitle, organizationIds,
157: sendEmail);
158:
159: return com.liferay.portal.model.UserSoap
160: .toSoapModel(returnValue);
161: } catch (Exception e) {
162: _log.error(e, e);
163:
164: throw new RemoteException(e.getMessage());
165: }
166: }
167:
168: public static void deleteRoleUser(long roleId, long userId)
169: throws RemoteException {
170: try {
171: UserServiceUtil.deleteRoleUser(roleId, userId);
172: } catch (Exception e) {
173: _log.error(e, e);
174:
175: throw new RemoteException(e.getMessage());
176: }
177: }
178:
179: public static void deleteUser(long userId) throws RemoteException {
180: try {
181: UserServiceUtil.deleteUser(userId);
182: } catch (Exception e) {
183: _log.error(e, e);
184:
185: throw new RemoteException(e.getMessage());
186: }
187: }
188:
189: public static long getDefaultUserId(long companyId)
190: throws RemoteException {
191: try {
192: long returnValue = UserServiceUtil
193: .getDefaultUserId(companyId);
194:
195: return returnValue;
196: } catch (Exception e) {
197: _log.error(e, e);
198:
199: throw new RemoteException(e.getMessage());
200: }
201: }
202:
203: public static com.liferay.portal.model.UserSoap[] getGroupUsers(
204: long groupId) throws RemoteException {
205: try {
206: java.util.List returnValue = UserServiceUtil
207: .getGroupUsers(groupId);
208:
209: return com.liferay.portal.model.UserSoap
210: .toSoapModels(returnValue);
211: } catch (Exception e) {
212: _log.error(e, e);
213:
214: throw new RemoteException(e.getMessage());
215: }
216: }
217:
218: public static com.liferay.portal.model.UserSoap[] getRoleUsers(
219: long roleId) throws RemoteException {
220: try {
221: java.util.List returnValue = UserServiceUtil
222: .getRoleUsers(roleId);
223:
224: return com.liferay.portal.model.UserSoap
225: .toSoapModels(returnValue);
226: } catch (Exception e) {
227: _log.error(e, e);
228:
229: throw new RemoteException(e.getMessage());
230: }
231: }
232:
233: public static com.liferay.portal.model.UserSoap getUserByEmailAddress(
234: long companyId, java.lang.String emailAddress)
235: throws RemoteException {
236: try {
237: com.liferay.portal.model.User returnValue = UserServiceUtil
238: .getUserByEmailAddress(companyId, emailAddress);
239:
240: return com.liferay.portal.model.UserSoap
241: .toSoapModel(returnValue);
242: } catch (Exception e) {
243: _log.error(e, e);
244:
245: throw new RemoteException(e.getMessage());
246: }
247: }
248:
249: public static com.liferay.portal.model.UserSoap getUserById(
250: long userId) throws RemoteException {
251: try {
252: com.liferay.portal.model.User returnValue = UserServiceUtil
253: .getUserById(userId);
254:
255: return com.liferay.portal.model.UserSoap
256: .toSoapModel(returnValue);
257: } catch (Exception e) {
258: _log.error(e, e);
259:
260: throw new RemoteException(e.getMessage());
261: }
262: }
263:
264: public static com.liferay.portal.model.UserSoap getUserByScreenName(
265: long companyId, java.lang.String screenName)
266: throws RemoteException {
267: try {
268: com.liferay.portal.model.User returnValue = UserServiceUtil
269: .getUserByScreenName(companyId, screenName);
270:
271: return com.liferay.portal.model.UserSoap
272: .toSoapModel(returnValue);
273: } catch (Exception e) {
274: _log.error(e, e);
275:
276: throw new RemoteException(e.getMessage());
277: }
278: }
279:
280: public static long getUserIdByEmailAddress(long companyId,
281: java.lang.String emailAddress) throws RemoteException {
282: try {
283: long returnValue = UserServiceUtil.getUserIdByEmailAddress(
284: companyId, emailAddress);
285:
286: return returnValue;
287: } catch (Exception e) {
288: _log.error(e, e);
289:
290: throw new RemoteException(e.getMessage());
291: }
292: }
293:
294: public static long getUserIdByScreenName(long companyId,
295: java.lang.String screenName) throws RemoteException {
296: try {
297: long returnValue = UserServiceUtil.getUserIdByScreenName(
298: companyId, screenName);
299:
300: return returnValue;
301: } catch (Exception e) {
302: _log.error(e, e);
303:
304: throw new RemoteException(e.getMessage());
305: }
306: }
307:
308: public static boolean hasGroupUser(long groupId, long userId)
309: throws RemoteException {
310: try {
311: boolean returnValue = UserServiceUtil.hasGroupUser(groupId,
312: userId);
313:
314: return returnValue;
315: } catch (Exception e) {
316: _log.error(e, e);
317:
318: throw new RemoteException(e.getMessage());
319: }
320: }
321:
322: public static boolean hasRoleUser(long roleId, long userId)
323: throws RemoteException {
324: try {
325: boolean returnValue = UserServiceUtil.hasRoleUser(roleId,
326: userId);
327:
328: return returnValue;
329: } catch (Exception e) {
330: _log.error(e, e);
331:
332: throw new RemoteException(e.getMessage());
333: }
334: }
335:
336: public static void setRoleUsers(long roleId, long[] userIds)
337: throws RemoteException {
338: try {
339: UserServiceUtil.setRoleUsers(roleId, userIds);
340: } catch (Exception e) {
341: _log.error(e, e);
342:
343: throw new RemoteException(e.getMessage());
344: }
345: }
346:
347: public static void setUserGroupUsers(long userGroupId,
348: long[] userIds) throws RemoteException {
349: try {
350: UserServiceUtil.setUserGroupUsers(userGroupId, userIds);
351: } catch (Exception e) {
352: _log.error(e, e);
353:
354: throw new RemoteException(e.getMessage());
355: }
356: }
357:
358: public static void unsetGroupUsers(long groupId, long[] userIds)
359: throws RemoteException {
360: try {
361: UserServiceUtil.unsetGroupUsers(groupId, userIds);
362: } catch (Exception e) {
363: _log.error(e, e);
364:
365: throw new RemoteException(e.getMessage());
366: }
367: }
368:
369: public static void unsetOrganizationUsers(long organizationId,
370: long[] userIds) throws RemoteException {
371: try {
372: UserServiceUtil.unsetOrganizationUsers(organizationId,
373: userIds);
374: } catch (Exception e) {
375: _log.error(e, e);
376:
377: throw new RemoteException(e.getMessage());
378: }
379: }
380:
381: public static void unsetPasswordPolicyUsers(long passwordPolicyId,
382: long[] userIds) throws RemoteException {
383: try {
384: UserServiceUtil.unsetPasswordPolicyUsers(passwordPolicyId,
385: userIds);
386: } catch (Exception e) {
387: _log.error(e, e);
388:
389: throw new RemoteException(e.getMessage());
390: }
391: }
392:
393: public static void unsetRoleUsers(long roleId, long[] userIds)
394: throws RemoteException {
395: try {
396: UserServiceUtil.unsetRoleUsers(roleId, userIds);
397: } catch (Exception e) {
398: _log.error(e, e);
399:
400: throw new RemoteException(e.getMessage());
401: }
402: }
403:
404: public static void unsetUserGroupUsers(long userGroupId,
405: long[] userIds) throws RemoteException {
406: try {
407: UserServiceUtil.unsetUserGroupUsers(userGroupId, userIds);
408: } catch (Exception e) {
409: _log.error(e, e);
410:
411: throw new RemoteException(e.getMessage());
412: }
413: }
414:
415: public static com.liferay.portal.model.UserSoap updateActive(
416: long userId, boolean active) throws RemoteException {
417: try {
418: com.liferay.portal.model.User returnValue = UserServiceUtil
419: .updateActive(userId, active);
420:
421: return com.liferay.portal.model.UserSoap
422: .toSoapModel(returnValue);
423: } catch (Exception e) {
424: _log.error(e, e);
425:
426: throw new RemoteException(e.getMessage());
427: }
428: }
429:
430: public static com.liferay.portal.model.UserSoap updateAgreedToTermsOfUse(
431: long userId, boolean agreedToTermsOfUse)
432: throws RemoteException {
433: try {
434: com.liferay.portal.model.User returnValue = UserServiceUtil
435: .updateAgreedToTermsOfUse(userId,
436: agreedToTermsOfUse);
437:
438: return com.liferay.portal.model.UserSoap
439: .toSoapModel(returnValue);
440: } catch (Exception e) {
441: _log.error(e, e);
442:
443: throw new RemoteException(e.getMessage());
444: }
445: }
446:
447: public static com.liferay.portal.model.UserSoap updateLockout(
448: long userId, boolean lockout) throws RemoteException {
449: try {
450: com.liferay.portal.model.User returnValue = UserServiceUtil
451: .updateLockout(userId, lockout);
452:
453: return com.liferay.portal.model.UserSoap
454: .toSoapModel(returnValue);
455: } catch (Exception e) {
456: _log.error(e, e);
457:
458: throw new RemoteException(e.getMessage());
459: }
460: }
461:
462: public static void updateOrganizations(long userId,
463: long[] organizationIds) throws RemoteException {
464: try {
465: UserServiceUtil
466: .updateOrganizations(userId, organizationIds);
467: } catch (Exception e) {
468: _log.error(e, e);
469:
470: throw new RemoteException(e.getMessage());
471: }
472: }
473:
474: public static com.liferay.portal.model.UserSoap updatePassword(
475: long userId, java.lang.String password1,
476: java.lang.String password2, boolean passwordReset)
477: throws RemoteException {
478: try {
479: com.liferay.portal.model.User returnValue = UserServiceUtil
480: .updatePassword(userId, password1, password2,
481: passwordReset);
482:
483: return com.liferay.portal.model.UserSoap
484: .toSoapModel(returnValue);
485: } catch (Exception e) {
486: _log.error(e, e);
487:
488: throw new RemoteException(e.getMessage());
489: }
490: }
491:
492: public static void updatePortrait(long userId, byte[] bytes)
493: throws RemoteException {
494: try {
495: UserServiceUtil.updatePortrait(userId, bytes);
496: } catch (Exception e) {
497: _log.error(e, e);
498:
499: throw new RemoteException(e.getMessage());
500: }
501: }
502:
503: public static com.liferay.portal.model.UserSoap updateUser(
504: long userId, java.lang.String oldPassword,
505: boolean passwordReset, java.lang.String screenName,
506: java.lang.String emailAddress, java.lang.String languageId,
507: java.lang.String timeZoneId, java.lang.String greeting,
508: java.lang.String comments, java.lang.String firstName,
509: java.lang.String middleName, java.lang.String lastName,
510: int prefixId, int suffixId, boolean male,
511: int birthdayMonth, int birthdayDay, int birthdayYear,
512: java.lang.String smsSn, java.lang.String aimSn,
513: java.lang.String icqSn, java.lang.String jabberSn,
514: java.lang.String msnSn, java.lang.String skypeSn,
515: java.lang.String ymSn, java.lang.String jobTitle,
516: long[] organizationIds) throws RemoteException {
517: try {
518: com.liferay.portal.model.User returnValue = UserServiceUtil
519: .updateUser(userId, oldPassword, passwordReset,
520: screenName, emailAddress, languageId,
521: timeZoneId, greeting, comments, firstName,
522: middleName, lastName, prefixId, suffixId,
523: male, birthdayMonth, birthdayDay,
524: birthdayYear, smsSn, aimSn, icqSn,
525: jabberSn, msnSn, skypeSn, ymSn, jobTitle,
526: organizationIds);
527:
528: return com.liferay.portal.model.UserSoap
529: .toSoapModel(returnValue);
530: } catch (Exception e) {
531: _log.error(e, e);
532:
533: throw new RemoteException(e.getMessage());
534: }
535: }
536:
537: public static com.liferay.portal.model.UserSoap updateUser(
538: long userId, java.lang.String oldPassword,
539: java.lang.String newPassword1,
540: java.lang.String newPassword2, boolean passwordReset,
541: java.lang.String screenName, java.lang.String emailAddress,
542: java.lang.String languageId, java.lang.String timeZoneId,
543: java.lang.String greeting, java.lang.String comments,
544: java.lang.String firstName, java.lang.String middleName,
545: java.lang.String lastName, int prefixId, int suffixId,
546: boolean male, int birthdayMonth, int birthdayDay,
547: int birthdayYear, java.lang.String smsSn,
548: java.lang.String aimSn, java.lang.String icqSn,
549: java.lang.String jabberSn, java.lang.String msnSn,
550: java.lang.String skypeSn, java.lang.String ymSn,
551: java.lang.String jobTitle, long[] organizationIds)
552: throws RemoteException {
553: try {
554: com.liferay.portal.model.User returnValue = UserServiceUtil
555: .updateUser(userId, oldPassword, newPassword1,
556: newPassword2, passwordReset, screenName,
557: emailAddress, languageId, timeZoneId,
558: greeting, comments, firstName, middleName,
559: lastName, prefixId, suffixId, male,
560: birthdayMonth, birthdayDay, birthdayYear,
561: smsSn, aimSn, icqSn, jabberSn, msnSn,
562: skypeSn, ymSn, jobTitle, organizationIds);
563:
564: return com.liferay.portal.model.UserSoap
565: .toSoapModel(returnValue);
566: } catch (Exception e) {
567: _log.error(e, e);
568:
569: throw new RemoteException(e.getMessage());
570: }
571: }
572:
573: private static Log _log = LogFactoryUtil
574: .getLog(UserServiceSoap.class);
575: }
|