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.Contact;
28  import com.liferay.portal.model.impl.ContactImpl;
29  import com.liferay.portal.service.ContactLocalService;
30  import com.liferay.portal.service.persistence.ContactUtil;
31  
32  import java.util.List;
33  
34  /**
35   * <a href="ContactLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
36   *
37   * @author Brian Wing Shun Chan
38   *
39   */
40  public abstract class ContactLocalServiceBaseImpl implements ContactLocalService {
41      public Contact addContact(Contact model) throws SystemException {
42          Contact contact = new ContactImpl();
43          contact.setNew(true);
44          contact.setContactId(model.getContactId());
45          contact.setCompanyId(model.getCompanyId());
46          contact.setUserId(model.getUserId());
47          contact.setUserName(model.getUserName());
48          contact.setCreateDate(model.getCreateDate());
49          contact.setModifiedDate(model.getModifiedDate());
50          contact.setAccountId(model.getAccountId());
51          contact.setParentContactId(model.getParentContactId());
52          contact.setFirstName(model.getFirstName());
53          contact.setMiddleName(model.getMiddleName());
54          contact.setLastName(model.getLastName());
55          contact.setPrefixId(model.getPrefixId());
56          contact.setSuffixId(model.getSuffixId());
57          contact.setMale(model.getMale());
58          contact.setBirthday(model.getBirthday());
59          contact.setSmsSn(model.getSmsSn());
60          contact.setAimSn(model.getAimSn());
61          contact.setIcqSn(model.getIcqSn());
62          contact.setJabberSn(model.getJabberSn());
63          contact.setMsnSn(model.getMsnSn());
64          contact.setSkypeSn(model.getSkypeSn());
65          contact.setYmSn(model.getYmSn());
66          contact.setEmployeeStatusId(model.getEmployeeStatusId());
67          contact.setEmployeeNumber(model.getEmployeeNumber());
68          contact.setJobTitle(model.getJobTitle());
69          contact.setJobClass(model.getJobClass());
70          contact.setHoursOfOperation(model.getHoursOfOperation());
71  
72          return ContactUtil.update(contact);
73      }
74  
75      public List dynamicQuery(DynamicQueryInitializer queryInitializer)
76          throws SystemException {
77          return ContactUtil.findWithDynamicQuery(queryInitializer);
78      }
79  
80      public List dynamicQuery(DynamicQueryInitializer queryInitializer,
81          int begin, int end) throws SystemException {
82          return ContactUtil.findWithDynamicQuery(queryInitializer, begin, end);
83      }
84  
85      public Contact updateContact(Contact model) throws SystemException {
86          Contact contact = new ContactImpl();
87          contact.setNew(false);
88          contact.setContactId(model.getContactId());
89          contact.setCompanyId(model.getCompanyId());
90          contact.setUserId(model.getUserId());
91          contact.setUserName(model.getUserName());
92          contact.setCreateDate(model.getCreateDate());
93          contact.setModifiedDate(model.getModifiedDate());
94          contact.setAccountId(model.getAccountId());
95          contact.setParentContactId(model.getParentContactId());
96          contact.setFirstName(model.getFirstName());
97          contact.setMiddleName(model.getMiddleName());
98          contact.setLastName(model.getLastName());
99          contact.setPrefixId(model.getPrefixId());
100         contact.setSuffixId(model.getSuffixId());
101         contact.setMale(model.getMale());
102         contact.setBirthday(model.getBirthday());
103         contact.setSmsSn(model.getSmsSn());
104         contact.setAimSn(model.getAimSn());
105         contact.setIcqSn(model.getIcqSn());
106         contact.setJabberSn(model.getJabberSn());
107         contact.setMsnSn(model.getMsnSn());
108         contact.setSkypeSn(model.getSkypeSn());
109         contact.setYmSn(model.getYmSn());
110         contact.setEmployeeStatusId(model.getEmployeeStatusId());
111         contact.setEmployeeNumber(model.getEmployeeNumber());
112         contact.setJobTitle(model.getJobTitle());
113         contact.setJobClass(model.getJobClass());
114         contact.setHoursOfOperation(model.getHoursOfOperation());
115 
116         return ContactUtil.update(contact);
117     }
118 }