~ubuntu-branches/ubuntu/natty/libgdata/natty-updates

« back to all changes in this revision

Viewing changes to gdata/services/contacts/gdata-contacts-group.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-01-05 11:09:00 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20110105110900-gkjnbslnr18s45us
Tags: 0.8.0-0ubuntu1
* New upstream release
* debian/control:
  - Use gir1.2 packages
  - Use standards version 3.9.1
  - Add Vcs-Bzr link
  - Rename libgdata10 to libgdata11
* debian/rules:
  - Drop simple-patchsys.mk
* debian/source:
  - Use source version 3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 * gdata_contacts_group_get_extended_property(), are provided as a method of storing client-specific data which shouldn't be seen or be editable
38
38
 * by the user, such as IDs and cache times.
39
39
 *
 
40
 * <example>
 
41
 *      <title>Adding a New Group</title>
 
42
 *      <programlisting>
 
43
 *      GDataContactsService *service;
 
44
 *      GDataContactsGroup *group, *updated_group;
 
45
 *      GDataContactsContact *contact, *updated_contact;
 
46
 *      GError *error = NULL;
 
47
 *
 
48
 *      /<!-- -->* Create a service and return a contact to add to the new group. *<!-- -->/
 
49
 *      service = create_contacts_service ();
 
50
 *      contact = query_user_for_contact (service);
 
51
 *
 
52
 *      /<!-- -->* Create the new group *<!-- -->/
 
53
 *      group = gdata_contacts_group_new (NULL);
 
54
 *      gdata_entry_set_title (GDATA_ENTRY (group), "Group Name");
 
55
 *
 
56
 *      /<!-- -->* Insert the group on the server *<!-- -->/
 
57
 *      updated_group = gdata_contacts_service_insert_group (service, group, NULL, &error);
 
58
 *
 
59
 *      g_object_unref (group);
 
60
 *
 
61
 *      if (error != NULL) {
 
62
 *              g_error ("Error adding a group: %s", error->message);
 
63
 *              g_error_free (error);
 
64
 *              g_object_unref (contact);
 
65
 *              g_object_unref (service);
 
66
 *              return;
 
67
 *      }
 
68
 *
 
69
 *      /<!-- -->* Add the contact to the new group. *<!-- -->/
 
70
 *      gdata_contacts_contact_add_group (contact, gdata_entry_get_id (GDATA_ENTRY (updated_group)));
 
71
 *
 
72
 *      g_object_unref (updated_group);
 
73
 *
 
74
 *      /<!-- -->* Update the contact on the server *<!-- -->/
 
75
 *      updated_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error));
 
76
 *
 
77
 *      g_object_unref (contact);
 
78
 *      g_object_unref (service);
 
79
 *
 
80
 *      if (error != NULL) {
 
81
 *              g_error ("Error updating contact: %s", error->message);
 
82
 *              g_error_free (error);
 
83
 *              return;
 
84
 *      }
 
85
 *
 
86
 *      /<!-- -->* Do something with the updated contact, such as update them in the UI, or store their ID for future use. *<!-- -->/
 
87
 *
 
88
 *      g_object_unref (updated_contact);
 
89
 *      </programlisting>
 
90
 * </example>
 
91
 *
40
92
 * Since: 0.7.0
41
93
 **/
42
94
 
354
406
static void
355
407
get_extended_property_xml_cb (const gchar *name, const gchar *value, GString *xml_string)
356
408
{
357
 
        /* TODO */
358
 
        g_string_append_printf (xml_string, "<gd:extendedProperty name='%s'>%s</gd:extendedProperty>", name, value);
 
409
        /* Note that the value *isn't* escaped (see http://code.google.com/apis/gdata/docs/2.0/elements.html#gdExtendedProperty) */
 
410
        gdata_parser_string_append_escaped (xml_string, "<gd:extendedProperty name='", name, "'>");
 
411
        g_string_append_printf (xml_string, "%s</gd:extendedProperty>", value);
359
412
}
360
413
 
361
414
static void