1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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   * {@link com.liferay.portal.service.UserServiceUtil} service utility. The
42   * static methods of this class calls the same methods of the service utility.
43   * However, the signatures are different because it is difficult for SOAP to
44   * 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 {@link java.util.List}, that
50   * is translated to an array of {@link com.liferay.portal.model.UserSoap}.
51   * If the method in the service utility returns a
52   * {@link com.liferay.portal.model.User}, that is translated to a
53   * {@link com.liferay.portal.model.UserSoap}. Methods that SOAP cannot
54   * 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   * <b>tunnel.servlet.hosts.allowed</b> 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   * @see       UserServiceHttp
77   * @see       com.liferay.portal.model.UserSoap
78   * @see       com.liferay.portal.service.UserServiceUtil
79   * @generated
80   */
81  public class UserServiceSoap {
82      public static void addGroupUsers(long groupId, long[] userIds)
83          throws RemoteException {
84          try {
85              UserServiceUtil.addGroupUsers(groupId, userIds);
86          }
87          catch (Exception e) {
88              _log.error(e, e);
89  
90              throw new RemoteException(e.getMessage());
91          }
92      }
93  
94      public static void addOrganizationUsers(long organizationId, long[] userIds)
95          throws RemoteException {
96          try {
97              UserServiceUtil.addOrganizationUsers(organizationId, userIds);
98          }
99          catch (Exception e) {
100             _log.error(e, e);
101 
102             throw new RemoteException(e.getMessage());
103         }
104     }
105 
106     public static void addPasswordPolicyUsers(long passwordPolicyId,
107         long[] userIds) throws RemoteException {
108         try {
109             UserServiceUtil.addPasswordPolicyUsers(passwordPolicyId, userIds);
110         }
111         catch (Exception e) {
112             _log.error(e, e);
113 
114             throw new RemoteException(e.getMessage());
115         }
116     }
117 
118     public static void addRoleUsers(long roleId, long[] userIds)
119         throws RemoteException {
120         try {
121             UserServiceUtil.addRoleUsers(roleId, userIds);
122         }
123         catch (Exception e) {
124             _log.error(e, e);
125 
126             throw new RemoteException(e.getMessage());
127         }
128     }
129 
130     public static void addUserGroupUsers(long userGroupId, long[] userIds)
131         throws RemoteException {
132         try {
133             UserServiceUtil.addUserGroupUsers(userGroupId, userIds);
134         }
135         catch (Exception e) {
136             _log.error(e, e);
137 
138             throw new RemoteException(e.getMessage());
139         }
140     }
141 
142     public static com.liferay.portal.model.UserSoap addUser(long companyId,
143         boolean autoPassword, java.lang.String password1,
144         java.lang.String password2, boolean autoScreenName,
145         java.lang.String screenName, java.lang.String emailAddress,
146         String locale, java.lang.String firstName, java.lang.String middleName,
147         java.lang.String lastName, int prefixId, int suffixId, boolean male,
148         int birthdayMonth, int birthdayDay, int birthdayYear,
149         java.lang.String jobTitle, long[] organizationIds, boolean sendEmail)
150         throws RemoteException {
151         try {
152             com.liferay.portal.model.User returnValue = UserServiceUtil.addUser(companyId,
153                     autoPassword, password1, password2, autoScreenName,
154                     screenName, emailAddress, new java.util.Locale(locale),
155                     firstName, middleName, lastName, prefixId, suffixId, male,
156                     birthdayMonth, birthdayDay, birthdayYear, jobTitle,
157                     organizationIds, sendEmail);
158 
159             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
160         }
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         }
173         catch (Exception e) {
174             _log.error(e, e);
175 
176             throw new RemoteException(e.getMessage());
177         }
178     }
179 
180     public static void deleteUser(long userId) throws RemoteException {
181         try {
182             UserServiceUtil.deleteUser(userId);
183         }
184         catch (Exception e) {
185             _log.error(e, e);
186 
187             throw new RemoteException(e.getMessage());
188         }
189     }
190 
191     public static long getDefaultUserId(long companyId)
192         throws RemoteException {
193         try {
194             long returnValue = UserServiceUtil.getDefaultUserId(companyId);
195 
196             return returnValue;
197         }
198         catch (Exception e) {
199             _log.error(e, e);
200 
201             throw new RemoteException(e.getMessage());
202         }
203     }
204 
205     public static long[] getGroupUserIds(long groupId)
206         throws RemoteException {
207         try {
208             long[] returnValue = UserServiceUtil.getGroupUserIds(groupId);
209 
210             return returnValue;
211         }
212         catch (Exception e) {
213             _log.error(e, e);
214 
215             throw new RemoteException(e.getMessage());
216         }
217     }
218 
219     public static long[] getOrganizationUserIds(long organizationId)
220         throws RemoteException {
221         try {
222             long[] returnValue = UserServiceUtil.getOrganizationUserIds(organizationId);
223 
224             return returnValue;
225         }
226         catch (Exception e) {
227             _log.error(e, e);
228 
229             throw new RemoteException(e.getMessage());
230         }
231     }
232 
233     public static long[] getRoleUserIds(long roleId) throws RemoteException {
234         try {
235             long[] returnValue = UserServiceUtil.getRoleUserIds(roleId);
236 
237             return returnValue;
238         }
239         catch (Exception e) {
240             _log.error(e, e);
241 
242             throw new RemoteException(e.getMessage());
243         }
244     }
245 
246     public static com.liferay.portal.model.UserSoap getUserByEmailAddress(
247         long companyId, java.lang.String emailAddress)
248         throws RemoteException {
249         try {
250             com.liferay.portal.model.User returnValue = UserServiceUtil.getUserByEmailAddress(companyId,
251                     emailAddress);
252 
253             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
254         }
255         catch (Exception e) {
256             _log.error(e, e);
257 
258             throw new RemoteException(e.getMessage());
259         }
260     }
261 
262     public static com.liferay.portal.model.UserSoap getUserById(long userId)
263         throws RemoteException {
264         try {
265             com.liferay.portal.model.User returnValue = UserServiceUtil.getUserById(userId);
266 
267             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
268         }
269         catch (Exception e) {
270             _log.error(e, e);
271 
272             throw new RemoteException(e.getMessage());
273         }
274     }
275 
276     public static com.liferay.portal.model.UserSoap getUserByScreenName(
277         long companyId, java.lang.String screenName) throws RemoteException {
278         try {
279             com.liferay.portal.model.User returnValue = UserServiceUtil.getUserByScreenName(companyId,
280                     screenName);
281 
282             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
283         }
284         catch (Exception e) {
285             _log.error(e, e);
286 
287             throw new RemoteException(e.getMessage());
288         }
289     }
290 
291     public static long getUserIdByEmailAddress(long companyId,
292         java.lang.String emailAddress) throws RemoteException {
293         try {
294             long returnValue = UserServiceUtil.getUserIdByEmailAddress(companyId,
295                     emailAddress);
296 
297             return returnValue;
298         }
299         catch (Exception e) {
300             _log.error(e, e);
301 
302             throw new RemoteException(e.getMessage());
303         }
304     }
305 
306     public static long getUserIdByScreenName(long companyId,
307         java.lang.String screenName) throws RemoteException {
308         try {
309             long returnValue = UserServiceUtil.getUserIdByScreenName(companyId,
310                     screenName);
311 
312             return returnValue;
313         }
314         catch (Exception e) {
315             _log.error(e, e);
316 
317             throw new RemoteException(e.getMessage());
318         }
319     }
320 
321     public static boolean hasGroupUser(long groupId, long userId)
322         throws RemoteException {
323         try {
324             boolean returnValue = UserServiceUtil.hasGroupUser(groupId, userId);
325 
326             return returnValue;
327         }
328         catch (Exception e) {
329             _log.error(e, e);
330 
331             throw new RemoteException(e.getMessage());
332         }
333     }
334 
335     public static boolean hasRoleUser(long roleId, long userId)
336         throws RemoteException {
337         try {
338             boolean returnValue = UserServiceUtil.hasRoleUser(roleId, userId);
339 
340             return returnValue;
341         }
342         catch (Exception e) {
343             _log.error(e, e);
344 
345             throw new RemoteException(e.getMessage());
346         }
347     }
348 
349     public static boolean hasRoleUser(long companyId, java.lang.String name,
350         long userId, boolean inherited) throws RemoteException {
351         try {
352             boolean returnValue = UserServiceUtil.hasRoleUser(companyId, name,
353                     userId, inherited);
354 
355             return returnValue;
356         }
357         catch (Exception e) {
358             _log.error(e, e);
359 
360             throw new RemoteException(e.getMessage());
361         }
362     }
363 
364     public static void setRoleUsers(long roleId, long[] userIds)
365         throws RemoteException {
366         try {
367             UserServiceUtil.setRoleUsers(roleId, userIds);
368         }
369         catch (Exception e) {
370             _log.error(e, e);
371 
372             throw new RemoteException(e.getMessage());
373         }
374     }
375 
376     public static void setUserGroupUsers(long userGroupId, long[] userIds)
377         throws RemoteException {
378         try {
379             UserServiceUtil.setUserGroupUsers(userGroupId, userIds);
380         }
381         catch (Exception e) {
382             _log.error(e, e);
383 
384             throw new RemoteException(e.getMessage());
385         }
386     }
387 
388     public static void unsetGroupUsers(long groupId, long[] userIds)
389         throws RemoteException {
390         try {
391             UserServiceUtil.unsetGroupUsers(groupId, userIds);
392         }
393         catch (Exception e) {
394             _log.error(e, e);
395 
396             throw new RemoteException(e.getMessage());
397         }
398     }
399 
400     public static void unsetOrganizationUsers(long organizationId,
401         long[] userIds) throws RemoteException {
402         try {
403             UserServiceUtil.unsetOrganizationUsers(organizationId, userIds);
404         }
405         catch (Exception e) {
406             _log.error(e, e);
407 
408             throw new RemoteException(e.getMessage());
409         }
410     }
411 
412     public static void unsetPasswordPolicyUsers(long passwordPolicyId,
413         long[] userIds) throws RemoteException {
414         try {
415             UserServiceUtil.unsetPasswordPolicyUsers(passwordPolicyId, userIds);
416         }
417         catch (Exception e) {
418             _log.error(e, e);
419 
420             throw new RemoteException(e.getMessage());
421         }
422     }
423 
424     public static void unsetRoleUsers(long roleId, long[] userIds)
425         throws RemoteException {
426         try {
427             UserServiceUtil.unsetRoleUsers(roleId, userIds);
428         }
429         catch (Exception e) {
430             _log.error(e, e);
431 
432             throw new RemoteException(e.getMessage());
433         }
434     }
435 
436     public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
437         throws RemoteException {
438         try {
439             UserServiceUtil.unsetUserGroupUsers(userGroupId, userIds);
440         }
441         catch (Exception e) {
442             _log.error(e, e);
443 
444             throw new RemoteException(e.getMessage());
445         }
446     }
447 
448     public static com.liferay.portal.model.UserSoap updateActive(long userId,
449         boolean active) throws RemoteException {
450         try {
451             com.liferay.portal.model.User returnValue = UserServiceUtil.updateActive(userId,
452                     active);
453 
454             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
455         }
456         catch (Exception e) {
457             _log.error(e, e);
458 
459             throw new RemoteException(e.getMessage());
460         }
461     }
462 
463     public static com.liferay.portal.model.UserSoap updateAgreedToTermsOfUse(
464         long userId, boolean agreedToTermsOfUse) throws RemoteException {
465         try {
466             com.liferay.portal.model.User returnValue = UserServiceUtil.updateAgreedToTermsOfUse(userId,
467                     agreedToTermsOfUse);
468 
469             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
470         }
471         catch (Exception e) {
472             _log.error(e, e);
473 
474             throw new RemoteException(e.getMessage());
475         }
476     }
477 
478     public static com.liferay.portal.model.UserSoap updateLockout(long userId,
479         boolean lockout) throws RemoteException {
480         try {
481             com.liferay.portal.model.User returnValue = UserServiceUtil.updateLockout(userId,
482                     lockout);
483 
484             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
485         }
486         catch (Exception e) {
487             _log.error(e, e);
488 
489             throw new RemoteException(e.getMessage());
490         }
491     }
492 
493     public static void updateOpenId(long userId, java.lang.String openId)
494         throws RemoteException {
495         try {
496             UserServiceUtil.updateOpenId(userId, openId);
497         }
498         catch (Exception e) {
499             _log.error(e, e);
500 
501             throw new RemoteException(e.getMessage());
502         }
503     }
504 
505     public static void updateOrganizations(long userId, long[] organizationIds)
506         throws RemoteException {
507         try {
508             UserServiceUtil.updateOrganizations(userId, organizationIds);
509         }
510         catch (Exception e) {
511             _log.error(e, e);
512 
513             throw new RemoteException(e.getMessage());
514         }
515     }
516 
517     public static com.liferay.portal.model.UserSoap updatePassword(
518         long userId, java.lang.String password1, java.lang.String password2,
519         boolean passwordReset) throws RemoteException {
520         try {
521             com.liferay.portal.model.User returnValue = UserServiceUtil.updatePassword(userId,
522                     password1, password2, passwordReset);
523 
524             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
525         }
526         catch (Exception e) {
527             _log.error(e, e);
528 
529             throw new RemoteException(e.getMessage());
530         }
531     }
532 
533     public static void updatePortrait(long userId, byte[] bytes)
534         throws RemoteException {
535         try {
536             UserServiceUtil.updatePortrait(userId, bytes);
537         }
538         catch (Exception e) {
539             _log.error(e, e);
540 
541             throw new RemoteException(e.getMessage());
542         }
543     }
544 
545     public static void updateScreenName(long userId, java.lang.String screenName)
546         throws RemoteException {
547         try {
548             UserServiceUtil.updateScreenName(userId, screenName);
549         }
550         catch (Exception e) {
551             _log.error(e, e);
552 
553             throw new RemoteException(e.getMessage());
554         }
555     }
556 
557     public static com.liferay.portal.model.UserSoap updateUser(long userId,
558         java.lang.String oldPassword, boolean passwordReset,
559         java.lang.String screenName, java.lang.String emailAddress,
560         java.lang.String languageId, java.lang.String timeZoneId,
561         java.lang.String greeting, java.lang.String comments,
562         java.lang.String firstName, java.lang.String middleName,
563         java.lang.String lastName, int prefixId, int suffixId, boolean male,
564         int birthdayMonth, int birthdayDay, int birthdayYear,
565         java.lang.String smsSn, java.lang.String aimSn,
566         java.lang.String facebookSn, java.lang.String icqSn,
567         java.lang.String jabberSn, java.lang.String msnSn,
568         java.lang.String mySpaceSn, java.lang.String skypeSn,
569         java.lang.String twitterSn, java.lang.String ymSn,
570         java.lang.String jobTitle, long[] organizationIds)
571         throws RemoteException {
572         try {
573             com.liferay.portal.model.User returnValue = UserServiceUtil.updateUser(userId,
574                     oldPassword, passwordReset, screenName, emailAddress,
575                     languageId, timeZoneId, greeting, comments, firstName,
576                     middleName, lastName, prefixId, suffixId, male,
577                     birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
578                     facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn,
579                     twitterSn, ymSn, jobTitle, organizationIds);
580 
581             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
582         }
583         catch (Exception e) {
584             _log.error(e, e);
585 
586             throw new RemoteException(e.getMessage());
587         }
588     }
589 
590     public static com.liferay.portal.model.UserSoap updateUser(long userId,
591         java.lang.String oldPassword, java.lang.String newPassword1,
592         java.lang.String newPassword2, boolean passwordReset,
593         java.lang.String screenName, java.lang.String emailAddress,
594         java.lang.String languageId, java.lang.String timeZoneId,
595         java.lang.String greeting, java.lang.String comments,
596         java.lang.String firstName, java.lang.String middleName,
597         java.lang.String lastName, int prefixId, int suffixId, boolean male,
598         int birthdayMonth, int birthdayDay, int birthdayYear,
599         java.lang.String smsSn, java.lang.String aimSn,
600         java.lang.String facebookSn, java.lang.String icqSn,
601         java.lang.String jabberSn, java.lang.String msnSn,
602         java.lang.String mySpaceSn, java.lang.String skypeSn,
603         java.lang.String twitterSn, java.lang.String ymSn,
604         java.lang.String jobTitle, long[] organizationIds)
605         throws RemoteException {
606         try {
607             com.liferay.portal.model.User returnValue = UserServiceUtil.updateUser(userId,
608                     oldPassword, newPassword1, newPassword2, passwordReset,
609                     screenName, emailAddress, languageId, timeZoneId, greeting,
610                     comments, firstName, middleName, lastName, prefixId,
611                     suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
612                     smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn,
613                     mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle,
614                     organizationIds);
615 
616             return com.liferay.portal.model.UserSoap.toSoapModel(returnValue);
617         }
618         catch (Exception e) {
619             _log.error(e, e);
620 
621             throw new RemoteException(e.getMessage());
622         }
623     }
624 
625     private static Log _log = LogFactoryUtil.getLog(UserServiceSoap.class);
626 }