Package de.circleofcontacts.server.model

Examples of de.circleofcontacts.server.model.Contact


     * Updates an existing contact.
     * @param basicData contact data
     * @return
     */
  private String updateExistingContact(ContactSummaryView basicData) {
    Contact prevContact = getContact(basicData.getIdentifier());
    Contact newContact = prevContact.clone();
    prevContact.setRecent(false);
    persistenceManager.makePersistent(prevContact);
    newContact.setVersion(prevContact.getVersion() + 1);
    return KeyFactory.keyToString(persistenceManager.makePersistent(newContact).getKey());
  }
View Full Code Here


   * Saves a new contact.
   * @param basicData contact data
   * @return
   */
  private String saveNewContact(ContactSummaryView basicData) {
    Contact c = new Contact();
    c.setFirstName(basicData.getFirstName());
    c.setLastName(basicData.getLastName());
    c.setTitle(basicData.getTitle());
    Key key = persistenceManager.makePersistent(c).getKey();
    c.setMainContactId(key);
    return KeyFactory.keyToString(key);
  }
View Full Code Here

   * @param contactId contact ID
   * @param groupId group ID
   */
  public void addContactToGroup(String contactId, String groupId) {
    ContactGroup contactGroup = getContactGroup(groupId);
    Contact contact = (Contact)persistenceManager.getObjectById(Contact.class, KeyFactory.stringToKey(contactId));
    addContactToGroup(contact, contactGroup);
  }
View Full Code Here

   * @param contactId contact ID
   * @param groupId group ID
   */
  public void removeContactFromGroup(String contactId, String groupId) {
    ContactGroup contactGroup = getContactGroup(groupId);
    Contact contact = getContact(contactId);
    removeContactFromGroup(contact, contactGroup);
  }
View Full Code Here

TOP

Related Classes of de.circleofcontacts.server.model.Contact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.