Package com.google.gdata.data.contacts

Examples of com.google.gdata.data.contacts.ContactGroupEntry


   */
  private void deleteEntry(ContactsExampleParameters parameters)
      throws IOException, ServiceException {
    if (parameters.isGroupFeed()) {
      // get the Group then delete it
      ContactGroupEntry group = getGroupInternal(parameters.getId());
      if (group == null) {
        System.err.println("No Group found with id: " + parameters.getId());
        return;
      }
      group.delete();
    } else {
      // get the contact then delete them
      ContactEntry contact = getContactInternal(parameters.getId());
      if (contact == null) {
        System.err.println("No contact found with id: " + parameters.getId());
View Full Code Here


   * @param parameters parameters storing updated contact values.
   */
  public void updateEntry(ContactsExampleParameters parameters)
      throws IOException, ServiceException {
    if (parameters.isGroupFeed()) {
      ContactGroupEntry group = buildGroup(parameters);
      // get the group then update it
      ContactGroupEntry canonicalGroup = getGroupInternal(parameters.getId());
 
      canonicalGroup.setTitle(group.getTitle());
      canonicalGroup.setContent(group.getContent());
      // update fields
      List<ExtendedProperty> extendedProperties =
          canonicalGroup.getExtendedProperties();
      extendedProperties.clear();
      if (group.hasExtendedProperties()) {
        extendedProperties.addAll(group.getExtendedProperties());
      }
      printGroup(canonicalGroup.update());
    } else {
      ContactEntry contact = buildContact(parameters);
      // get the contact then update it
      ContactEntry canonicalContact = getContactInternal(parameters.getId());
      ElementHelper.updateContact(canonicalContact, contact);
View Full Code Here

   * @param parameters parameters for contact adding
   */
  private void addEntry(ContactsExampleParameters parameters)
      throws IOException, ServiceException {
    if (parameters.isGroupFeed()) {
      ContactGroupEntry addedGroup =
          service.insert(feedUrl, buildGroup(parameters));
      printGroup(addedGroup);
      lastAddedId = addedGroup.getId();
    } else {
      ContactEntry addedContact =
          service.insert(feedUrl, buildContact(parameters));
      printContact(addedContact);
      // Store id of the added contact so that scripts can use it in next steps
View Full Code Here

   * @param parameters ContactExamplParameters
   * @return GroupEntry Object
   */
  private static ContactGroupEntry buildGroup(
      ContactsExampleParameters parameters) {
    ContactGroupEntry groupEntry = new ContactGroupEntry();
    ElementHelper.buildGroup(groupEntry, parameters.getElementDesc());
    return groupEntry;
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.contacts.ContactGroupEntry

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.