1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
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.service.UserServiceUtil;
28  
29  import java.rmi.RemoteException;
30  
31  /**
32   * <a href="UserServiceSoap.java.html"><b><i>View Source</i></b></a>
33   *
34   * <p>
35   * ServiceBuilder generated this class. Modifications in this class will be
36   * overwritten the next time is generated.
37   * </p>
38   *
39   * <p>
40   * This class provides a SOAP utility for the
41   * <code>com.liferay.portal.service.UserServiceUtil</code> service
42   * utility. The static methods of this class calls the same methods of the
43   * service utility. However, the signatures are different because it is
44   * difficult for SOAP to support certain types.
45   * </p>
46   *
47   * <p>
48   * ServiceBuilder follows certain rules in translating the methods. For example,
49   * if the method in the service utility returns a <code>java.util.List</code>,
50   * that is translated to an array of
51   * <code>com.liferay.portal.model.UserSoap</code>. If the method in the
52   * service utility returns a <code>com.liferay.portal.model.User</code>,
53   * that is translated to a <code>com.liferay.portal.model.UserSoap</code>.
54   * Methods that SOAP cannot safely wire are skipped.
55   * </p>
56   *
57   * <p>
58   * The benefits of using the SOAP utility is that it is cross platform
59   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
60   * even Perl, to call the generated services. One drawback of SOAP is that it is
61   * slow because it needs to serialize all calls into a text format (XML).
62   * </p>
63   *
64   * <p>
65   * You can see a list of services at
66   * http://localhost:8080/tunnel-web/secure/axis. Set the property
67   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
68   * security.
69   * </p>
70   *
71   * <p>
72   * The SOAP utility is only generated for remote services.
73   * </p>
74   *
75   * @author Brian Wing Shun Chan
76   *
77   * @see com.liferay.portal.model.UserSoap
78   * @see com.liferay.portal.service.UserServiceUtil
79   * @see com.liferay.portal.service.http.UserServiceHttp
80   *
81   */
82  public class UserServiceSoap {
83      public static void addGroupUsers(long groupId, long[] userIds)
84          throws RemoteException {
85          try {
86              UserServiceUtil.addGroupUsers(groupId, userIds);
87          }
88          catch (Exception e) {
89              _log.error(e, e);
90  
91              throw new RemoteException(e.getMessage());
92          }
93      }
94  
95      public static void addOrganizationUsers(long organizationId, long[] userIds)
96          throws RemoteException {
97          try {
98              UserServiceUtil.addOrganizationUsers(organizationId, userIds);
99          }
100         catch (Exception e) {
101             _log.error(e, e);
102 
103             throw new RemoteException(e.getMessage());
104         }
105     }
106 
107     public static void addPasswordPolicyUsers(long passwordPolicyId,
108         long[] userIds) throws RemoteException {
109         try {
110             UserServiceUtil.addPasswordPolicyUsers(passwordPolicyId, userIds);
111         }
112         catch (Exception e) {
113             _log.error(e, e);
114 
115             throw new RemoteException(e.getMessage());
116         }
117     }
118 
119     public static void addRoleUsers(long roleId, long[] userIds)
120         throws RemoteException {
121         try {
122             UserServiceUtil.addRoleUsers(roleId, userIds);
123         }
124         catch (Exception e) {
125             _log.error(e, e);
126 
127             throw new RemoteException(e.getMessage());
128         }
129     }
130 
131     public static void addUserGroupUsers(long userGroupId, long[] userIds)
132         throws RemoteException {
133         try {
134             UserServiceUtil.addUserGroupUsers(userGroupId, userIds);
135         }
136         catch (Exception e) {
137             _log.error(e, e);
138 
139             throw new RemoteException(e.getMessage());
140         }
141     }
142 
143     public static com.liferay.portal.model.UserSoap addUser(long companyId,
144         boolean autoPassword, java.lang.String password1,
145         java.lang.String password2, boolean autoScreenName,
146         java.lang.String screenName, java.lang.String emailAddress,
147         String locale, java.lang.String firstName, java.lang.String middleName,
148         java.lang.String lastName, int prefixId, int suffixId, boolean male,
149         int birthdayMonth, int birthdayDay, int birthdayYear,
150         java.lang.String jobTitle, long[] organizationIds, boolean sendEmail)
151         throws RemoteException {
152         try {
153             com.liferay.portal.model.User returnValue = UserServiceUtil.addUser(companyId,
154                     autoPassword, password1, password2, autoScreenName,
155                     screenName, emailAddress, new java.util.Locale(locale),
156                     firstName, middleName, lastName, prefixId, suffixId, male,
157                     birthdayMonth, birthdayDay, birthdayYear, jobTitle,
158                     organizationIds, sendEmail);
159 
160             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
161         }
162         catch (Exception e) {
163             _log.error(e, e);
164 
165             throw new RemoteException(e.getMessage());
166         }
167     }
168 
169     public static void deleteRoleUser(long roleId, long userId)
170         throws RemoteException {
171         try {
172             UserServiceUtil.deleteRoleUser(roleId, userId);
173         }
174         catch (Exception e) {
175             _log.error(e, e);
176 
177             throw new RemoteException(e.getMessage());
178         }
179     }
180 
181     public static void deleteUser(long userId) throws RemoteException {
182         try {
183             UserServiceUtil.deleteUser(userId);
184         }
185         catch (Exception e) {
186             _log.error(e, e);
187 
188             throw new RemoteException(e.getMessage());
189         }
190     }
191 
192     public static long getDefaultUserId(long companyId)
193         throws RemoteException {
194         try {
195             long returnValue = UserServiceUtil.getDefaultUserId(companyId);
196 
197             return returnValue;
198         }
199         catch (Exception e) {
200             _log.error(e, e);
201 
202             throw new RemoteException(e.getMessage());
203         }
204     }
205 
206     public static com.liferay.portal.model.UserSoap getUserByEmailAddress(
207         long companyId, java.lang.String emailAddress)
208         throws RemoteException {
209         try {
210             com.liferay.portal.model.User returnValue = UserServiceUtil.getUserByEmailAddress(companyId,
211                     emailAddress);
212 
213             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
214         }
215         catch (Exception e) {
216             _log.error(e, e);
217 
218             throw new RemoteException(e.getMessage());
219         }
220     }
221 
222     public static com.liferay.portal.model.UserSoap getUserById(long userId)
223         throws RemoteException {
224         try {
225             com.liferay.portal.model.User returnValue = UserServiceUtil.getUserById(userId);
226 
227             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
228         }
229         catch (Exception e) {
230             _log.error(e, e);
231 
232             throw new RemoteException(e.getMessage());
233         }
234     }
235 
236     public static com.liferay.portal.model.UserSoap getUserByScreenName(
237         long companyId, java.lang.String screenName) throws RemoteException {
238         try {
239             com.liferay.portal.model.User returnValue = UserServiceUtil.getUserByScreenName(companyId,
240                     screenName);
241 
242             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
243         }
244         catch (Exception e) {
245             _log.error(e, e);
246 
247             throw new RemoteException(e.getMessage());
248         }
249     }
250 
251     public static long getUserIdByEmailAddress(long companyId,
252         java.lang.String emailAddress) throws RemoteException {
253         try {
254             long returnValue = UserServiceUtil.getUserIdByEmailAddress(companyId,
255                     emailAddress);
256 
257             return returnValue;
258         }
259         catch (Exception e) {
260             _log.error(e, e);
261 
262             throw new RemoteException(e.getMessage());
263         }
264     }
265 
266     public static long getUserIdByScreenName(long companyId,
267         java.lang.String screenName) throws RemoteException {
268         try {
269             long returnValue = UserServiceUtil.getUserIdByScreenName(companyId,
270                     screenName);
271 
272             return returnValue;
273         }
274         catch (Exception e) {
275             _log.error(e, e);
276 
277             throw new RemoteException(e.getMessage());
278         }
279     }
280 
281     public static boolean hasGroupUser(long groupId, long userId)
282         throws RemoteException {
283         try {
284             boolean returnValue = UserServiceUtil.hasGroupUser(groupId, userId);
285 
286             return returnValue;
287         }
288         catch (Exception e) {
289             _log.error(e, e);
290 
291             throw new RemoteException(e.getMessage());
292         }
293     }
294 
295     public static boolean hasRoleUser(long roleId, long userId)
296         throws RemoteException {
297         try {
298             boolean returnValue = UserServiceUtil.hasRoleUser(roleId, userId);
299 
300             return returnValue;
301         }
302         catch (Exception e) {
303             _log.error(e, e);
304 
305             throw new RemoteException(e.getMessage());
306         }
307     }
308 
309     public static void setRoleUsers(long roleId, long[] userIds)
310         throws RemoteException {
311         try {
312             UserServiceUtil.setRoleUsers(roleId, userIds);
313         }
314         catch (Exception e) {
315             _log.error(e, e);
316 
317             throw new RemoteException(e.getMessage());
318         }
319     }
320 
321     public static void setUserGroupUsers(long userGroupId, long[] userIds)
322         throws RemoteException {
323         try {
324             UserServiceUtil.setUserGroupUsers(userGroupId, userIds);
325         }
326         catch (Exception e) {
327             _log.error(e, e);
328 
329             throw new RemoteException(e.getMessage());
330         }
331     }
332 
333     public static void unsetGroupUsers(long groupId, long[] userIds)
334         throws RemoteException {
335         try {
336             UserServiceUtil.unsetGroupUsers(groupId, userIds);
337         }
338         catch (Exception e) {
339             _log.error(e, e);
340 
341             throw new RemoteException(e.getMessage());
342         }
343     }
344 
345     public static void unsetOrganizationUsers(long organizationId,
346         long[] userIds) throws RemoteException {
347         try {
348             UserServiceUtil.unsetOrganizationUsers(organizationId, userIds);
349         }
350         catch (Exception e) {
351             _log.error(e, e);
352 
353             throw new RemoteException(e.getMessage());
354         }
355     }
356 
357     public static void unsetPasswordPolicyUsers(long passwordPolicyId,
358         long[] userIds) throws RemoteException {
359         try {
360             UserServiceUtil.unsetPasswordPolicyUsers(passwordPolicyId, userIds);
361         }
362         catch (Exception e) {
363             _log.error(e, e);
364 
365             throw new RemoteException(e.getMessage());
366         }
367     }
368 
369     public static void unsetRoleUsers(long roleId, long[] userIds)
370         throws RemoteException {
371         try {
372             UserServiceUtil.unsetRoleUsers(roleId, userIds);
373         }
374         catch (Exception e) {
375             _log.error(e, e);
376 
377             throw new RemoteException(e.getMessage());
378         }
379     }
380 
381     public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
382         throws RemoteException {
383         try {
384             UserServiceUtil.unsetUserGroupUsers(userGroupId, userIds);
385         }
386         catch (Exception e) {
387             _log.error(e, e);
388 
389             throw new RemoteException(e.getMessage());
390         }
391     }
392 
393     public static com.liferay.portal.model.UserSoap updateActive(long userId,
394         boolean active) throws RemoteException {
395         try {
396             com.liferay.portal.model.User returnValue = UserServiceUtil.updateActive(userId,
397                     active);
398 
399             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
400         }
401         catch (Exception e) {
402             _log.error(e, e);
403 
404             throw new RemoteException(e.getMessage());
405         }
406     }
407 
408     public static com.liferay.portal.model.UserSoap updateAgreedToTermsOfUse(
409         long userId, boolean agreedToTermsOfUse) throws RemoteException {
410         try {
411             com.liferay.portal.model.User returnValue = UserServiceUtil.updateAgreedToTermsOfUse(userId,
412                     agreedToTermsOfUse);
413 
414             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
415         }
416         catch (Exception e) {
417             _log.error(e, e);
418 
419             throw new RemoteException(e.getMessage());
420         }
421     }
422 
423     public static com.liferay.portal.model.UserSoap updateLockout(long userId,
424         boolean lockout) throws RemoteException {
425         try {
426             com.liferay.portal.model.User returnValue = UserServiceUtil.updateLockout(userId,
427                     lockout);
428 
429             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
430         }
431         catch (Exception e) {
432             _log.error(e, e);
433 
434             throw new RemoteException(e.getMessage());
435         }
436     }
437 
438     public static void updateOrganizations(long userId, long[] organizationIds)
439         throws RemoteException {
440         try {
441             UserServiceUtil.updateOrganizations(userId, organizationIds);
442         }
443         catch (Exception e) {
444             _log.error(e, e);
445 
446             throw new RemoteException(e.getMessage());
447         }
448     }
449 
450     public static com.liferay.portal.model.UserSoap updatePassword(
451         long userId, java.lang.String password1, java.lang.String password2,
452         boolean passwordReset) throws RemoteException {
453         try {
454             com.liferay.portal.model.User returnValue = UserServiceUtil.updatePassword(userId,
455                     password1, password2, passwordReset);
456 
457             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
458         }
459         catch (Exception e) {
460             _log.error(e, e);
461 
462             throw new RemoteException(e.getMessage());
463         }
464     }
465 
466     public static void updatePortrait(long userId, byte[] bytes)
467         throws RemoteException {
468         try {
469             UserServiceUtil.updatePortrait(userId, bytes);
470         }
471         catch (Exception e) {
472             _log.error(e, e);
473 
474             throw new RemoteException(e.getMessage());
475         }
476     }
477 
478     public static void updateScreenName(long userId, java.lang.String screenName)
479         throws RemoteException {
480         try {
481             UserServiceUtil.updateScreenName(userId, screenName);
482         }
483         catch (Exception e) {
484             _log.error(e, e);
485 
486             throw new RemoteException(e.getMessage());
487         }
488     }
489 
490     public static void updateOpenId(long userId, java.lang.String openId)
491         throws RemoteException {
492         try {
493             UserServiceUtil.updateOpenId(userId, openId);
494         }
495         catch (Exception e) {
496             _log.error(e, e);
497 
498             throw new RemoteException(e.getMessage());
499         }
500     }
501 
502     public static com.liferay.portal.model.UserSoap updateUser(long userId,
503         java.lang.String oldPassword, boolean passwordReset,
504         java.lang.String screenName, java.lang.String emailAddress,
505         java.lang.String languageId, java.lang.String timeZoneId,
506         java.lang.String greeting, java.lang.String comments,
507         java.lang.String firstName, java.lang.String middleName,
508         java.lang.String lastName, int prefixId, int suffixId, boolean male,
509         int birthdayMonth, int birthdayDay, int birthdayYear,
510         java.lang.String smsSn, java.lang.String aimSn,
511         java.lang.String facebookSn, java.lang.String icqSn,
512         java.lang.String jabberSn, java.lang.String msnSn,
513         java.lang.String mySpaceSn, java.lang.String skypeSn,
514         java.lang.String twitterSn, java.lang.String ymSn,
515         java.lang.String jobTitle, long[] organizationIds)
516         throws RemoteException {
517         try {
518             com.liferay.portal.model.User returnValue = UserServiceUtil.updateUser(userId,
519                     oldPassword, passwordReset, screenName, emailAddress,
520                     languageId, timeZoneId, greeting, comments, firstName,
521                     middleName, lastName, prefixId, suffixId, male,
522                     birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
523                     facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn,
524                     twitterSn, ymSn, jobTitle, organizationIds);
525 
526             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
527         }
528         catch (Exception e) {
529             _log.error(e, e);
530 
531             throw new RemoteException(e.getMessage());
532         }
533     }
534 
535     public static com.liferay.portal.model.UserSoap updateUser(long userId,
536         java.lang.String oldPassword, java.lang.String newPassword1,
537         java.lang.String newPassword2, boolean passwordReset,
538         java.lang.String screenName, java.lang.String emailAddress,
539         java.lang.String languageId, java.lang.String timeZoneId,
540         java.lang.String greeting, java.lang.String comments,
541         java.lang.String firstName, java.lang.String middleName,
542         java.lang.String lastName, int prefixId, int suffixId, boolean male,
543         int birthdayMonth, int birthdayDay, int birthdayYear,
544         java.lang.String smsSn, java.lang.String aimSn,
545         java.lang.String facebookSn, java.lang.String icqSn,
546         java.lang.String jabberSn, java.lang.String msnSn,
547         java.lang.String mySpaceSn, java.lang.String skypeSn,
548         java.lang.String twitterSn, java.lang.String ymSn,
549         java.lang.String jobTitle, long[] organizationIds)
550         throws RemoteException {
551         try {
552             com.liferay.portal.model.User returnValue = UserServiceUtil.updateUser(userId,
553                     oldPassword, newPassword1, newPassword2, passwordReset,
554                     screenName, emailAddress, languageId, timeZoneId, greeting,
555                     comments, firstName, middleName, lastName, prefixId,
556                     suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
557                     smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn,
558                     mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle,
559                     organizationIds);
560 
561             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
562         }
563         catch (Exception e) {
564             _log.error(e, e);
565 
566             throw new RemoteException(e.getMessage());
567         }
568     }
569 
570     private static Log _log = LogFactoryUtil.getLog(UserServiceSoap.class);
571 }