1   /**
2    * Copyright (c) 2000-2007 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.base;
24  
25  import com.liferay.portal.SystemException;
26  import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
27  import com.liferay.portal.model.User;
28  import com.liferay.portal.model.impl.UserImpl;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.persistence.UserUtil;
31  
32  import java.util.List;
33  
34  /**
35   * <a href="UserLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
36   *
37   * @author Brian Wing Shun Chan
38   *
39   */
40  public abstract class UserLocalServiceBaseImpl implements UserLocalService {
41      public User addUser(User model) throws SystemException {
42          User user = new UserImpl();
43          user.setNew(true);
44          user.setUserId(model.getUserId());
45          user.setCompanyId(model.getCompanyId());
46          user.setCreateDate(model.getCreateDate());
47          user.setModifiedDate(model.getModifiedDate());
48          user.setDefaultUser(model.getDefaultUser());
49          user.setContactId(model.getContactId());
50          user.setPassword(model.getPassword());
51          user.setPasswordEncrypted(model.getPasswordEncrypted());
52          user.setPasswordReset(model.getPasswordReset());
53          user.setPasswordModifiedDate(model.getPasswordModifiedDate());
54          user.setGraceLoginCount(model.getGraceLoginCount());
55          user.setScreenName(model.getScreenName());
56          user.setEmailAddress(model.getEmailAddress());
57          user.setPortraitId(model.getPortraitId());
58          user.setLanguageId(model.getLanguageId());
59          user.setTimeZoneId(model.getTimeZoneId());
60          user.setGreeting(model.getGreeting());
61          user.setComments(model.getComments());
62          user.setLoginDate(model.getLoginDate());
63          user.setLoginIP(model.getLoginIP());
64          user.setLastLoginDate(model.getLastLoginDate());
65          user.setLastLoginIP(model.getLastLoginIP());
66          user.setLastFailedLoginDate(model.getLastFailedLoginDate());
67          user.setFailedLoginAttempts(model.getFailedLoginAttempts());
68          user.setLockout(model.getLockout());
69          user.setLockoutDate(model.getLockoutDate());
70          user.setAgreedToTermsOfUse(model.getAgreedToTermsOfUse());
71          user.setActive(model.getActive());
72  
73          return UserUtil.update(user);
74      }
75  
76      public List dynamicQuery(DynamicQueryInitializer queryInitializer)
77          throws SystemException {
78          return UserUtil.findWithDynamicQuery(queryInitializer);
79      }
80  
81      public List dynamicQuery(DynamicQueryInitializer queryInitializer,
82          int begin, int end) throws SystemException {
83          return UserUtil.findWithDynamicQuery(queryInitializer, begin, end);
84      }
85  
86      public User updateUser(User model) throws SystemException {
87          User user = new UserImpl();
88          user.setNew(false);
89          user.setUserId(model.getUserId());
90          user.setCompanyId(model.getCompanyId());
91          user.setCreateDate(model.getCreateDate());
92          user.setModifiedDate(model.getModifiedDate());
93          user.setDefaultUser(model.getDefaultUser());
94          user.setContactId(model.getContactId());
95          user.setPassword(model.getPassword());
96          user.setPasswordEncrypted(model.getPasswordEncrypted());
97          user.setPasswordReset(model.getPasswordReset());
98          user.setPasswordModifiedDate(model.getPasswordModifiedDate());
99          user.setGraceLoginCount(model.getGraceLoginCount());
100         user.setScreenName(model.getScreenName());
101         user.setEmailAddress(model.getEmailAddress());
102         user.setPortraitId(model.getPortraitId());
103         user.setLanguageId(model.getLanguageId());
104         user.setTimeZoneId(model.getTimeZoneId());
105         user.setGreeting(model.getGreeting());
106         user.setComments(model.getComments());
107         user.setLoginDate(model.getLoginDate());
108         user.setLoginIP(model.getLoginIP());
109         user.setLastLoginDate(model.getLastLoginDate());
110         user.setLastLoginIP(model.getLastLoginIP());
111         user.setLastFailedLoginDate(model.getLastFailedLoginDate());
112         user.setFailedLoginAttempts(model.getFailedLoginAttempts());
113         user.setLockout(model.getLockout());
114         user.setLockoutDate(model.getLockoutDate());
115         user.setAgreedToTermsOfUse(model.getAgreedToTermsOfUse());
116         user.setActive(model.getActive());
117 
118         return UserUtil.update(user);
119     }
120 }