adding support for calendar quickadd. quickadd lets you add an event to a
calendar just using natural language, processed on the server-side.
diff --git a/src/com/google/wireless/gdata/calendar/data/EventEntry.java b/src/com/google/wireless/gdata/calendar/data/EventEntry.java
index 0542cb0..f7e06a3 100644
--- a/src/com/google/wireless/gdata/calendar/data/EventEntry.java
+++ b/src/com/google/wireless/gdata/calendar/data/EventEntry.java
@@ -78,6 +78,7 @@
private String where = null;
private String commentsUri = null;
private Hashtable extendedProperties = null;
+ private boolean quickAdd = false;
/**
* Creates a new empty event entry.
@@ -104,6 +105,7 @@
where = null;
commentsUri = null;
extendedProperties = null;
+ quickAdd = false;
}
/**
@@ -280,6 +282,14 @@
this.commentsUri = commentsUri;
}
+ public boolean isQuickAdd() {
+ return quickAdd;
+ }
+
+ public void setQuickAdd(boolean quickAdd) {
+ this.quickAdd = quickAdd;
+ }
+
public void toString(StringBuffer sb) {
super.toString(sb);
sb.append("STATUS: " + status + "\n");
@@ -289,7 +299,7 @@
appendIfNotNull(sb, "ORIGINAL_EVENT_ID", originalEventId);
appendIfNotNull(sb, "ORIGINAL_START_TIME", originalEventStartTime);
-
+ sb.append("QUICK_ADD: " + (quickAdd ? "true" : "false"));
sb.append("SEND_EVENT_NOTIFICATIONS: " + (sendEventNotifications ? "true" : "false"));
Enumeration whos = this.attendees.elements();
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 eae45fd..1081756 100644
--- a/src/com/google/wireless/gdata/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
+++ b/src/com/google/wireless/gdata/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
@@ -99,6 +99,8 @@
serializeExtendedProperty(serializer, propertyName, propertyValue);
}
}
+
+ serializeQuickAdd(serializer, entry.isQuickAdd());
}
private static void serializeEventStatus(XmlSerializer serializer,
@@ -401,4 +403,13 @@
serializer.attribute(null /* ns */, "value", value);
serializer.endTag(XmlGDataParser.NAMESPACE_GD_URI, "extendedProperty");
}
+
+ private static void serializeQuickAdd(XmlSerializer serializer,
+ boolean quickAdd) throws IOException {
+ if (quickAdd) {
+ serializer.startTag(NAMESPACE_GCAL, "quickadd");
+ serializer.attribute(null /* ns */, "value", "true");
+ serializer.endTag(NAMESPACE_GCAL, "quickadd");
+ }
+ }
}
diff --git a/src/com/google/wireless/gdata2/calendar/data/EventEntry.java b/src/com/google/wireless/gdata2/calendar/data/EventEntry.java
index c0bf75f..e5a5f9c 100644
--- a/src/com/google/wireless/gdata2/calendar/data/EventEntry.java
+++ b/src/com/google/wireless/gdata2/calendar/data/EventEntry.java
@@ -77,6 +77,7 @@
private String where = null;
private String commentsUri = null;
private Hashtable extendedProperties = null;
+ private boolean quickAdd = false;
/**
* Creates a new empty event entry.
@@ -102,6 +103,7 @@
where = null;
commentsUri = null;
extendedProperties = null;
+ quickAdd = false;
}
/**
@@ -270,6 +272,14 @@
this.commentsUri = commentsUri;
}
+ public boolean isQuickAdd() {
+ return quickAdd;
+ }
+
+ public void setQuickAdd(boolean quickAdd) {
+ this.quickAdd = quickAdd;
+ }
+
public void toString(StringBuffer sb) {
super.toString(sb);
sb.append("STATUS: " + status + "\n");
@@ -280,6 +290,8 @@
appendIfNotNull(sb, "ORIGINAL_EVENT_ID", originalEventId);
appendIfNotNull(sb, "ORIGINAL_START_TIME", originalEventStartTime);
+ sb.append("QUICK_ADD: " + (quickAdd ? "true" : "false"));
+
Enumeration whos = this.attendees.elements();
while (whos.hasMoreElements()) {
Who who = (Who) whos.nextElement();
diff --git a/src/com/google/wireless/gdata2/calendar/serializer/xml/XmlEventEntryGDataSerializer.java b/src/com/google/wireless/gdata2/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
index f16eb5d..ce16a77 100644
--- a/src/com/google/wireless/gdata2/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
+++ b/src/com/google/wireless/gdata2/calendar/serializer/xml/XmlEventEntryGDataSerializer.java
@@ -94,6 +94,8 @@
serializeExtendedProperty(serializer, propertyName, propertyValue);
}
}
+
+ serializeQuickAdd(serializer, entry.isQuickAdd());
}
private static void serializeEventStatus(XmlSerializer serializer,
@@ -396,4 +398,13 @@
serializer.attribute(null /* ns */, "value", value);
serializer.endTag(XmlGDataParser.NAMESPACE_GD_URI, "extendedProperty");
}
+
+ private static void serializeQuickAdd(XmlSerializer serializer,
+ boolean quickAdd) throws IOException {
+ if (quickAdd) {
+ serializer.startTag(NAMESPACE_GCAL, "quickadd");
+ serializer.attribute(null /* ns */, "value", "true");
+ serializer.endTag(NAMESPACE_GCAL, "quickadd");
+ }
+ }
}