summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/google/wireless/gdata/calendar/data/EventEntry.java12
-rw-r--r--src/com/google/wireless/gdata/calendar/parser/xml/XmlEventsGDataParser.java8
-rw-r--r--src/com/google/wireless/gdata/calendar/serializer/xml/XmlEventEntryGDataSerializer.java5
-rw-r--r--src/com/google/wireless/gdata/client/HttpQueryParams.java4
-rw-r--r--src/com/google/wireless/gdata2/contacts/data/ContactEntry.java70
-rw-r--r--src/com/google/wireless/gdata2/contacts/data/GeoPt.java2
-rw-r--r--src/com/google/wireless/gdata2/contacts/data/GroupEntry.java2
-rw-r--r--src/com/google/wireless/gdata2/contacts/data/GroupMembershipInfo.java2
-rw-r--r--src/com/google/wireless/gdata2/contacts/data/GroupsFeed.java2
-rw-r--r--src/com/google/wireless/gdata2/contacts/parser/xml/XmlGroupEntryGDataParser.java2
-rw-r--r--src/com/google/wireless/gdata2/contacts/serializer/xml/XmlGroupEntryGDataSerializer.java2
-rw-r--r--src/com/google/wireless/gdata2/data/ExtendedProperty.java2
-rw-r--r--src/com/google/wireless/gdata2/data/MediaEntry.java2
-rw-r--r--src/com/google/wireless/gdata2/parser/xml/SimplePullParser.java6
-rw-r--r--src/com/google/wireless/gdata2/parser/xml/XmlMediaEntryGDataParser.java2
15 files changed, 84 insertions, 39 deletions
diff --git a/src/com/google/wireless/gdata/calendar/data/EventEntry.java b/src/com/google/wireless/gdata/calendar/data/EventEntry.java
index 5f2f271..0542cb0 100644
--- a/src/com/google/wireless/gdata/calendar/data/EventEntry.java
+++ b/src/com/google/wireless/gdata/calendar/data/EventEntry.java
@@ -70,6 +70,7 @@ public class EventEntry extends Entry {
private byte visibility = VISIBILITY_DEFAULT;
private byte transparency = TRANSPARENCY_OPAQUE;
private Vector attendees = new Vector();
+ private boolean sendEventNotifications = false;
private Vector whens = new Vector();
private Vector reminders = null;
private String originalEventId = null;
@@ -94,6 +95,7 @@ public class EventEntry extends Entry {
recurrence = null;
visibility = VISIBILITY_DEFAULT;
transparency = TRANSPARENCY_OPAQUE;
+ sendEventNotifications = false;
attendees.removeAllElements();
whens.removeAllElements();
reminders = null;
@@ -160,6 +162,14 @@ public class EventEntry extends Entry {
this.visibility = visibility;
}
+ public boolean getSendEventNotifications() {
+ return sendEventNotifications;
+ }
+
+ public void setSendEventNotifications(boolean sendEventNotifications) {
+ this.sendEventNotifications = sendEventNotifications;
+ }
+
public void clearAttendees() {
attendees.clear();
}
@@ -280,6 +290,8 @@ public class EventEntry extends Entry {
appendIfNotNull(sb, "ORIGINAL_EVENT_ID", originalEventId);
appendIfNotNull(sb, "ORIGINAL_START_TIME", originalEventStartTime);
+ sb.append("SEND_EVENT_NOTIFICATIONS: " + (sendEventNotifications ? "true" : "false"));
+
Enumeration whos = this.attendees.elements();
while (whos.hasMoreElements()) {
Who who = (Who) whos.nextElement();
diff --git a/src/com/google/wireless/gdata/calendar/parser/xml/XmlEventsGDataParser.java b/src/com/google/wireless/gdata/calendar/parser/xml/XmlEventsGDataParser.java
index 7ec447e..920a8d5 100644
--- a/src/com/google/wireless/gdata/calendar/parser/xml/XmlEventsGDataParser.java
+++ b/src/com/google/wireless/gdata/calendar/parser/xml/XmlEventsGDataParser.java
@@ -152,7 +152,13 @@ public class XmlEventsGDataParser extends XmlGDataParser {
eventEntry.setVisibility(visibility);
} else if ("who".equals(name)) {
handleWho(eventEntry);
- } else if ("when".equals(name)) {
+ } else if ("sendEventNotifications".equals(name)) {
+ // TODO: check that the namespace is gCal
+ String value = parser.getAttributeValue(null /* ns */, "value");
+ if ("true".equals(value)) {
+ eventEntry.setSendEventNotifications(true);
+ }
+ } else if ("when".equals(name)) {
handleWhen(eventEntry);
} else if ("reminder".equals(name)) {
if (!hasSeenReminder) {
diff --git a/src/com/google/wireless/gdata/calendar/serializer/xml/XmlEventEntryGDataSerializer.java b/src/com/google/wireless/gdata/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
index ccb701f..eae45fd 100644
--- a/src/com/google/wireless/gdata/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
+++ b/src/com/google/wireless/gdata/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
@@ -54,6 +54,11 @@ public class XmlEventEntryGDataSerializer extends XmlEntryGDataSerializer {
serializeEventStatus(serializer, entry.getStatus());
serializeTransparency(serializer, entry.getTransparency());
serializeVisibility(serializer, entry.getVisibility());
+ if (entry.getSendEventNotifications()) {
+ serializer.startTag(NAMESPACE_GCAL_URI, "sendEventNotifications");
+ serializer.attribute(null /* ns */, "value", "true");
+ serializer.endTag(NAMESPACE_GCAL_URI, "sendEventNotifications");
+ }
Enumeration attendees = entry.getAttendees().elements();
while (attendees.hasMoreElements()) {
Who attendee = (Who) attendees.nextElement();
diff --git a/src/com/google/wireless/gdata/client/HttpQueryParams.java b/src/com/google/wireless/gdata/client/HttpQueryParams.java
index 4878002..e391e27 100644
--- a/src/com/google/wireless/gdata/client/HttpQueryParams.java
+++ b/src/com/google/wireless/gdata/client/HttpQueryParams.java
@@ -43,8 +43,10 @@ public class HttpQueryParams extends QueryParams {
url.append('&');
}
String name = (String) names.elementAt(i);
+ String value = getParamValue(name);
+ if (value == null) continue;
url.append(client.encodeUri(name)).append('=');
- url.append(client.encodeUri(getParamValue(name)));
+ url.append(client.encodeUri(value));
}
return url.toString();
}
diff --git a/src/com/google/wireless/gdata2/contacts/data/ContactEntry.java b/src/com/google/wireless/gdata2/contacts/data/ContactEntry.java
index ea24ab1..2763862 100644
--- a/src/com/google/wireless/gdata2/contacts/data/ContactEntry.java
+++ b/src/com/google/wireless/gdata2/contacts/data/ContactEntry.java
@@ -59,7 +59,7 @@ public class ContactEntry extends Entry {
public static final byte TYPE_SENSITIVITY_PERSONAL = 3;
public static final byte TYPE_SENSITIVITY_PRIVATE = 4;
private byte sensitivity = TypedElement.TYPE_NONE;
-
+
private Name name;
/**
@@ -149,7 +149,7 @@ public class ContactEntry extends Entry {
public Vector getCalendarLinks() {
return calendarLinks;
}
-
+
/**
* Adds a new member to the CalendarLink collection
*/
@@ -163,7 +163,7 @@ public class ContactEntry extends Entry {
public Vector getEvents() {
return events;
}
-
+
/**
* Adds a new member to the Event collection
*/
@@ -171,7 +171,7 @@ public class ContactEntry extends Entry {
events.addElement(event);
}
-
+
/**
* Accessor to the ExternalId Collection
@@ -179,7 +179,7 @@ public class ContactEntry extends Entry {
public Vector getExternalIds() {
return externalIds;
}
-
+
/**
* Adds a new member to the ExternalId collection
*/
@@ -193,7 +193,7 @@ public class ContactEntry extends Entry {
public Vector getHobbies() {
return hobbies;
}
-
+
/**
* Adds a new member to the Hobbies collection
*/
@@ -207,7 +207,7 @@ public class ContactEntry extends Entry {
public Vector getJots() {
return jots;
}
-
+
/**
* Adds a new member to the Jot collection
*/
@@ -221,7 +221,7 @@ public class ContactEntry extends Entry {
public Vector getLanguages() {
return languages;
}
-
+
/**
* Adds a new member to the Language collection
*/
@@ -235,7 +235,7 @@ public class ContactEntry extends Entry {
public Vector getRelations() {
return relations;
}
-
+
/**
* Adds a new member to the Relation collection
*/
@@ -249,7 +249,7 @@ public class ContactEntry extends Entry {
public Vector getUserDefinedFields() {
return userDefinedFields;
}
-
+
/**
* Adds a new member to the UserDefinedField collection
*/
@@ -263,23 +263,23 @@ public class ContactEntry extends Entry {
public Vector getWebSites() {
return webSites;
}
-
+
/**
* Adds a new member to the WebSite collection
*/
public void addWebSite(WebSite webSite) {
webSites.addElement(webSite);
}
-
+
/**
- * Directory server associated with the contact
+ * Directory server associated with the contact
*/
public String getDirectoryServer() {
return this.directoryServer;
}
/**
- * Directory server associated with the contact
+ * Directory server associated with the contact
*/
public void setDirectoryServer(String directoryServer) {
this.directoryServer = directoryServer;
@@ -291,7 +291,7 @@ public class ContactEntry extends Entry {
public String getGender() {
return this.gender;
}
-
+
/**
* Gender associated with the contact.
*/
@@ -305,7 +305,7 @@ public class ContactEntry extends Entry {
public String getInitials() {
return this.initials;
}
-
+
/**
* Contact's initials.
*/
@@ -319,7 +319,7 @@ public class ContactEntry extends Entry {
public String getMaidenName() {
return this.maidenName;
}
-
+
/**
* Maiden name associated with the contact.
*/
@@ -333,7 +333,7 @@ public class ContactEntry extends Entry {
public String getMileage() {
return this.mileage;
}
-
+
/**
* Mileage associated with the contact.
*/
@@ -347,7 +347,7 @@ public class ContactEntry extends Entry {
public String getNickname() {
return this.nickname;
}
-
+
/**
* Nickname associated with this Contact
*/
@@ -361,7 +361,7 @@ public class ContactEntry extends Entry {
public String getOccupation() {
return this.occupation;
}
-
+
/**
* Occupation associated with this Contact
*/
@@ -375,25 +375,25 @@ public class ContactEntry extends Entry {
public byte getPriority() {
return this.priority;
}
-
+
/**
* Priority associated with this Contact
*/
- public void setPriority(byte type) {
+ public void setPriority(byte priority) {
this.priority = priority;
}
/**
- * Specifies contact's sensitivity. Can be either confidential,
- * normal, personal or private.
+ * Specifies contact's sensitivity. Can be either confidential,
+ * normal, personal or private.
*/
public byte getSensitivity() {
return this.sensitivity;
}
-
+
/**
- * Specifies contact's sensitivity. Can be either confidential,
- * normal, personal or private.
+ * Specifies contact's sensitivity. Can be either confidential,
+ * normal, personal or private.
*/
public void setSensitivity(byte sensitiviy) {
this.sensitivity = sensitiviy;
@@ -405,7 +405,7 @@ public class ContactEntry extends Entry {
public String getShortName() {
return this.shortName;
}
-
+
/**
* ShortName associated with this Contact
*/
@@ -419,7 +419,7 @@ public class ContactEntry extends Entry {
public String getSubject() {
return this.subject;
}
-
+
/**
* Subject associated with this Contact
*/
@@ -433,7 +433,7 @@ public class ContactEntry extends Entry {
public Name getName() {
return this.name;
}
-
+
/**
* Name associated with this Contact
*/
@@ -447,7 +447,7 @@ public class ContactEntry extends Entry {
public String getBirthday() {
return this.birthday;
}
-
+
/**
* Birthday associated with this Contact
*/
@@ -461,14 +461,14 @@ public class ContactEntry extends Entry {
public String getBillingInformation() {
return this.billingInformation;
}
-
+
/**
* BillingInformation associated with this Contact
*/
public void setBillingInformation(String billingInformation) {
this.billingInformation = billingInformation;
}
-
+
/*
* (non-Javadoc)
* @see com.google.wireless.gdata2.data.Entry#clear()
@@ -544,9 +544,9 @@ public class ContactEntry extends Entry {
sb.append(" occupaton:").append(occupation);
}
sb.append(" priority:").append(priority);
-
+
sb.append(" sensitivity:").append(sensitivity);
-
+
if (!StringUtils.isEmpty(shortName)) {
sb.append(" shortName:").append(shortName);
}
diff --git a/src/com/google/wireless/gdata2/contacts/data/GeoPt.java b/src/com/google/wireless/gdata2/contacts/data/GeoPt.java
index 3cd6225..cb509d3 100644
--- a/src/com/google/wireless/gdata2/contacts/data/GeoPt.java
+++ b/src/com/google/wireless/gdata2/contacts/data/GeoPt.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.contacts.data;
/**
diff --git a/src/com/google/wireless/gdata2/contacts/data/GroupEntry.java b/src/com/google/wireless/gdata2/contacts/data/GroupEntry.java
index b2999a2..09b0ccc 100644
--- a/src/com/google/wireless/gdata2/contacts/data/GroupEntry.java
+++ b/src/com/google/wireless/gdata2/contacts/data/GroupEntry.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.contacts.data;
import com.google.wireless.gdata2.data.Entry;
diff --git a/src/com/google/wireless/gdata2/contacts/data/GroupMembershipInfo.java b/src/com/google/wireless/gdata2/contacts/data/GroupMembershipInfo.java
index 1e852e5..70136d0 100644
--- a/src/com/google/wireless/gdata2/contacts/data/GroupMembershipInfo.java
+++ b/src/com/google/wireless/gdata2/contacts/data/GroupMembershipInfo.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.contacts.data;
import com.google.wireless.gdata2.data.StringUtils;
diff --git a/src/com/google/wireless/gdata2/contacts/data/GroupsFeed.java b/src/com/google/wireless/gdata2/contacts/data/GroupsFeed.java
index eb606d3..6f6511d 100644
--- a/src/com/google/wireless/gdata2/contacts/data/GroupsFeed.java
+++ b/src/com/google/wireless/gdata2/contacts/data/GroupsFeed.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.contacts.data;
import com.google.wireless.gdata2.data.Feed;
diff --git a/src/com/google/wireless/gdata2/contacts/parser/xml/XmlGroupEntryGDataParser.java b/src/com/google/wireless/gdata2/contacts/parser/xml/XmlGroupEntryGDataParser.java
index c663e71..943eb41 100644
--- a/src/com/google/wireless/gdata2/contacts/parser/xml/XmlGroupEntryGDataParser.java
+++ b/src/com/google/wireless/gdata2/contacts/parser/xml/XmlGroupEntryGDataParser.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.contacts.parser.xml;
import com.google.wireless.gdata2.contacts.data.GroupEntry;
diff --git a/src/com/google/wireless/gdata2/contacts/serializer/xml/XmlGroupEntryGDataSerializer.java b/src/com/google/wireless/gdata2/contacts/serializer/xml/XmlGroupEntryGDataSerializer.java
index e8d1efb..52d955b 100644
--- a/src/com/google/wireless/gdata2/contacts/serializer/xml/XmlGroupEntryGDataSerializer.java
+++ b/src/com/google/wireless/gdata2/contacts/serializer/xml/XmlGroupEntryGDataSerializer.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.contacts.serializer.xml;
import com.google.wireless.gdata2.contacts.data.GroupEntry;
diff --git a/src/com/google/wireless/gdata2/data/ExtendedProperty.java b/src/com/google/wireless/gdata2/data/ExtendedProperty.java
index 09b4a4b..7e2b0db 100644
--- a/src/com/google/wireless/gdata2/data/ExtendedProperty.java
+++ b/src/com/google/wireless/gdata2/data/ExtendedProperty.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.data;
import com.google.wireless.gdata2.parser.ParseException;
diff --git a/src/com/google/wireless/gdata2/data/MediaEntry.java b/src/com/google/wireless/gdata2/data/MediaEntry.java
index fefe001..851fffb 100644
--- a/src/com/google/wireless/gdata2/data/MediaEntry.java
+++ b/src/com/google/wireless/gdata2/data/MediaEntry.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.data;
/**
diff --git a/src/com/google/wireless/gdata2/parser/xml/SimplePullParser.java b/src/com/google/wireless/gdata2/parser/xml/SimplePullParser.java
index 44fb921..7c573c9 100644
--- a/src/com/google/wireless/gdata2/parser/xml/SimplePullParser.java
+++ b/src/com/google/wireless/gdata2/parser/xml/SimplePullParser.java
@@ -290,11 +290,13 @@ public class SimplePullParser {
}
public ParseException(String message, Throwable cause) {
- super(message, cause);
+ // constructor Exception(String, Throwable) is not supported in J2ME
+ super(message + ", Cause: " + String.valueOf(cause));
}
public ParseException(Throwable cause) {
- super(cause);
+ // constructor Exception(Throwable) is not supported in J2ME
+ super("Cause: " + String.valueOf(cause));
}
}
}
diff --git a/src/com/google/wireless/gdata2/parser/xml/XmlMediaEntryGDataParser.java b/src/com/google/wireless/gdata2/parser/xml/XmlMediaEntryGDataParser.java
index 60cc147..d15f906 100644
--- a/src/com/google/wireless/gdata2/parser/xml/XmlMediaEntryGDataParser.java
+++ b/src/com/google/wireless/gdata2/parser/xml/XmlMediaEntryGDataParser.java
@@ -1,3 +1,5 @@
+// Copyright 2009 The Android Open Source Project
+
package com.google.wireless.gdata2.parser.xml;
import com.google.wireless.gdata2.data.MediaEntry;