aboutsummaryrefslogtreecommitdiffstats
path: root/lib/caldav/request
diff options
context:
space:
mode:
Diffstat (limited to 'lib/caldav/request')
-rw-r--r--lib/caldav/request/calendar_query.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/caldav/request/calendar_query.js b/lib/caldav/request/calendar_query.js
index 6ee1ec4..0d48788 100644
--- a/lib/caldav/request/calendar_query.js
+++ b/lib/caldav/request/calendar_query.js
@@ -1,8 +1,7 @@
(function(module, ns) {
var Propfind = ns.require('request/propfind');
- var CalendarData = ns.require('templates/calendar_data');
- var CalendarFilter = ns.require('templates/calendar_filter');
+ var Builder = ns.require('query_builder');
/**
* Creates a calendar query request.
@@ -17,10 +16,19 @@
this.xhr.headers['Depth'] = this.depth || 1;
this.xhr.method = 'REPORT';
- this.fields = new CalendarData();
- this.filters = new CalendarFilter();
this.template.rootTag = ['caldav', 'calendar-query'];
+
+ this.data = new Builder({
+ template: this.template
+ });
+
+ this.filter = new Builder({
+ template: this.template,
+ tag: ['caldav', 'filter'],
+ propTag: ['caldav', 'prop-filter'],
+ compTag: ['caldav', 'comp-filter']
+ });
}
CalendarQuery.prototype = {
@@ -32,14 +40,14 @@
props = this._props.join('');
- if (this.fields) {
- props += this.fields.render(this.template);
+ if (this.data) {
+ props += this.data.toString();
}
content = this.template.tag('prop', props);
- if (this.filters) {
- content += this.filters.render(this.template);
+ if (this.filter) {
+ content += this.filter.toString();
}
return this.template.render(content);