sabredav_client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.rspec +1 -0
- data/CHANGELOG.rdoc +8 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +46 -0
- data/README.md +131 -0
- data/Rakefile +6 -0
- data/lib/sabredav_client/calendar.rb +111 -0
- data/lib/sabredav_client/client.rb +57 -0
- data/lib/sabredav_client/errors/errors.rb +38 -0
- data/lib/sabredav_client/events.rb +97 -0
- data/lib/sabredav_client/format.rb +54 -0
- data/lib/sabredav_client/net.rb +15 -0
- data/lib/sabredav_client/principal.rb +36 -0
- data/lib/sabredav_client/request.rb +97 -0
- data/lib/sabredav_client/version.rb +3 -0
- data/lib/sabredav_client/xml_request_builder/base.rb +17 -0
- data/lib/sabredav_client/xml_request_builder/mkcalendar.rb +25 -0
- data/lib/sabredav_client/xml_request_builder/mkcol_principal.rb +28 -0
- data/lib/sabredav_client/xml_request_builder/post_sharing.rb +41 -0
- data/lib/sabredav_client/xml_request_builder/propfind_calendar.rb +41 -0
- data/lib/sabredav_client/xml_request_builder/propfind_owner.rb +19 -0
- data/lib/sabredav_client/xml_request_builder/proppatch_owner.rb +23 -0
- data/lib/sabredav_client/xml_request_builder/report_event_changes.rb +22 -0
- data/lib/sabredav_client/xml_request_builder/report_vevent.rb +30 -0
- data/lib/sabredav_client/xml_request_builder/report_vtodo.rb +20 -0
- data/lib/sabredav_client/xml_request_builder.rb +6 -0
- data/lib/sabredav_client.rb +12 -0
- data/sabredav_client.gemspec +33 -0
- data/spec/fixtures/calendar_fetch_changes.xml +26 -0
- data/spec/fixtures/calendar_info.xml +14 -0
- data/spec/fixtures/event.ics +23 -0
- data/spec/fixtures/events_find_multiple.xml +51 -0
- data/spec/fixtures/events_owner.xml +12 -0
- data/spec/fixtures/xml_request_builder/mkcalendar.xml +9 -0
- data/spec/fixtures/xml_request_builder/mkcol_principal.xml +12 -0
- data/spec/fixtures/xml_request_builder/post_sharing.xml +18 -0
- data/spec/fixtures/xml_request_builder/propfind_calendar/all_properties.xml +8 -0
- data/spec/fixtures/xml_request_builder/propfind_owner.xml +6 -0
- data/spec/fixtures/xml_request_builder/proppatch_owner.xml +8 -0
- data/spec/fixtures/xml_request_builder/report_event_changes.xml +8 -0
- data/spec/sabredav_client/calendar_spec.rb +101 -0
- data/spec/sabredav_client/client_spec.rb +41 -0
- data/spec/sabredav_client/events_spec.rb +91 -0
- data/spec/sabredav_client/principal_spec.rb +38 -0
- data/spec/sabredav_client/request_spec.rb +55 -0
- data/spec/sabredav_client/xml_request_builder_specs/base_spec.rb +30 -0
- data/spec/sabredav_client/xml_request_builder_specs/mkcalendar_spec.rb +13 -0
- data/spec/sabredav_client/xml_request_builder_specs/mkcol_principal_spec.rb +13 -0
- data/spec/sabredav_client/xml_request_builder_specs/post_sharing_spec.rb +15 -0
- data/spec/sabredav_client/xml_request_builder_specs/propfind_calendar_spec.rb +24 -0
- data/spec/sabredav_client/xml_request_builder_specs/propfind_owner_spec.rb +14 -0
- data/spec/sabredav_client/xml_request_builder_specs/proppatch_owner_spec.rb +14 -0
- data/spec/sabredav_client/xml_request_builder_specs/report_event_changes_spec.rb +15 -0
- data/spec/spec.opts +5 -0
- data/spec/spec_helper.rb +8 -0
- metadata +185 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
class Request
|
3
|
+
attr_accessor :path
|
4
|
+
attr_reader :client, :request, :http
|
5
|
+
|
6
|
+
def initialize(method, client, path)
|
7
|
+
@client = client
|
8
|
+
@path = "#{client.base_path}/#{path}"
|
9
|
+
@http = build_http
|
10
|
+
@request = build_request(method)
|
11
|
+
|
12
|
+
add_auth
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_body(body)
|
16
|
+
request.body = body
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_header(data)
|
20
|
+
request['Content-Length'] = data[:content_length] if data[:content_length]
|
21
|
+
request['If-Match'] = data[:if_match] if data[:if_match]
|
22
|
+
request['Content-Type'] = data[:content_type] if data[:content_type]
|
23
|
+
request['DAV'] = data[:dav] if data[:dav]
|
24
|
+
end
|
25
|
+
|
26
|
+
def run
|
27
|
+
@http.request(request)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def build_http
|
33
|
+
unless client.proxy_uri
|
34
|
+
http = Net::HTTP.new(client.host, client.port)
|
35
|
+
else
|
36
|
+
http = Net::HTTP.new(client.host, client.port, client.proxy_host, client.proxy_port)
|
37
|
+
end
|
38
|
+
|
39
|
+
if client.ssl
|
40
|
+
http.use_ssl = client.ssl
|
41
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
42
|
+
end
|
43
|
+
|
44
|
+
http
|
45
|
+
end
|
46
|
+
|
47
|
+
def build_request(method)
|
48
|
+
case method
|
49
|
+
when :get
|
50
|
+
Net::HTTP::Get.new(path)
|
51
|
+
when :post
|
52
|
+
Net::HTTP::Post.new(path)
|
53
|
+
when :put
|
54
|
+
Net::HTTP::Put.new(path)
|
55
|
+
when :delete
|
56
|
+
Net::HTTP::Delete.new(path)
|
57
|
+
when :propfind
|
58
|
+
Net::HTTP::Propfind.new(path)
|
59
|
+
when :proppatch
|
60
|
+
Net::HTTP::Proppatch.new(path)
|
61
|
+
when :report
|
62
|
+
Net::HTTP::Report.new(path)
|
63
|
+
when :mkcalendar
|
64
|
+
Net::HTTP::Mkcalendar.new(path)
|
65
|
+
when :mkcol
|
66
|
+
Net::HTTP::Mkcol.new(path)
|
67
|
+
else
|
68
|
+
raise SabredavClient::Errors::HTTPMethodNotSupportedError, method
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def add_auth
|
73
|
+
unless client.authtype == 'digest'
|
74
|
+
request.basic_auth client.user, client.password
|
75
|
+
else
|
76
|
+
request.add_field 'Authorization', digestauth(method.to_s.upcase)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def digestauth
|
81
|
+
h = Net::HTTP.new client.duri.host, client.duri.port
|
82
|
+
|
83
|
+
if client.ssl
|
84
|
+
h.use_ssl = client.ssl
|
85
|
+
h.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
86
|
+
end
|
87
|
+
|
88
|
+
req = Net::HTTP::Get.new client.duri.request_uri
|
89
|
+
res = h.request req
|
90
|
+
# res is a 401 response with a WWW-Authenticate header
|
91
|
+
|
92
|
+
auth = client.digest_auth.auth_header client.duri, res['www-authenticate'], method
|
93
|
+
|
94
|
+
return auth
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
NAMESPACE = {"xmlns:d" => 'DAV:'}
|
5
|
+
C_NAMESPACES = {"xmlns:d" => 'DAV:', "xmlns:c" => "urn:ietf:params:xml:ns:caldav"}
|
6
|
+
CS_NAMESPACES = {"xmlns:d" => 'DAV:', "xmlns:cs" => "http://calendarserver.org/ns/"}
|
7
|
+
SB_NAMESPACES = {"xmlns:d" => 'DAV:', "xmlns:sb" => "http://sabredav.org/ns"}
|
8
|
+
|
9
|
+
class Base
|
10
|
+
def initialize
|
11
|
+
@xml = Builder::XmlMarkup.new(indent: 2)
|
12
|
+
@xml.instruct!
|
13
|
+
end
|
14
|
+
attr :xml
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
class Mkcalendar < Base
|
5
|
+
attr_accessor :displayname, :description
|
6
|
+
|
7
|
+
def initialize(displayname = nil, description = nil)
|
8
|
+
@displayname = displayname
|
9
|
+
@description = description
|
10
|
+
super()
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_xml
|
14
|
+
xml.c :mkcalendar, C_NAMESPACES do
|
15
|
+
xml.d :set do
|
16
|
+
xml.d :prop do
|
17
|
+
xml.d :displayname, displayname unless displayname.to_s.empty?
|
18
|
+
xml.tag! "c:calendar-description", description, "xml:lang" => "en" unless description.to_s.empty?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
class MkcolPrincipal < Base
|
5
|
+
attr_accessor :email, :displayname
|
6
|
+
|
7
|
+
def initialize(email,displayname)
|
8
|
+
@email = email
|
9
|
+
@displayname = displayname
|
10
|
+
super()
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_xml
|
14
|
+
xml.d :mkcol, SB_NAMESPACES do
|
15
|
+
xml.d :set do
|
16
|
+
xml.d :prop do
|
17
|
+
xml.d :resourcetype do
|
18
|
+
xml.d :principal
|
19
|
+
end
|
20
|
+
xml.d :displayname, displayname unless displayname.to_s.empty?
|
21
|
+
xml.tag! "sb:email-address", email
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
class PostSharing < Base
|
5
|
+
attr_accessor :adds, :removes, :summary, :privilege, :common_name
|
6
|
+
|
7
|
+
def initialize(adds, summary, common_name, privilege, removes)
|
8
|
+
@adds = adds
|
9
|
+
@summary = summary
|
10
|
+
@privilege = privilege
|
11
|
+
@common_name = common_name
|
12
|
+
@removes = removes
|
13
|
+
super()
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_xml
|
17
|
+
xml.cs :share, CS_NAMESPACES do
|
18
|
+
unless adds.empty?
|
19
|
+
adds.each do |add|
|
20
|
+
add = "mailto:#{add}"
|
21
|
+
xml.cs :set do
|
22
|
+
xml.d :href, add
|
23
|
+
xml.cs :summary, summary unless summary.nil?
|
24
|
+
xml.tag! "cs:common-name", common_name unless common_name.nil?
|
25
|
+
xml.tag! "cs:#{privilege}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
unless removes.empty?
|
30
|
+
removes.each do |remove|
|
31
|
+
remove = "mailto:#{remove}"
|
32
|
+
xml.cs :remove do
|
33
|
+
xml.d :href, remove
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
class PROPFINDCalendar < Base
|
4
|
+
attr_reader :properties
|
5
|
+
|
6
|
+
PROPERTIES = {
|
7
|
+
displayname: :d,
|
8
|
+
getctag: :cs,
|
9
|
+
sync_token: :d
|
10
|
+
}
|
11
|
+
|
12
|
+
def initialize(properties:)
|
13
|
+
@properties = properties
|
14
|
+
super()
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_xml
|
18
|
+
xml.d :propfind, CS_NAMESPACES do
|
19
|
+
xml.d :prop do
|
20
|
+
build_properties
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def build_properties
|
26
|
+
properties.each do |property|
|
27
|
+
raise SabredavClient::Errors::PropertyNotSupportedError, "Known properties are #{PROPERTIES}" unless PROPERTIES.keys.include?(property)
|
28
|
+
|
29
|
+
readable_property = property.to_s.gsub('_', '-').to_sym
|
30
|
+
|
31
|
+
case PROPERTIES[property]
|
32
|
+
when :d
|
33
|
+
xml.d readable_property
|
34
|
+
when :cs
|
35
|
+
xml.cs readable_property
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
class PropfindOwner < Base
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
super()
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_xml
|
11
|
+
xml.d :propfind, NAMESPACE do
|
12
|
+
xml.d :prop do
|
13
|
+
xml.d :objectOwner
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
class ProppatchOwner < Base
|
5
|
+
attr_accessor :owner
|
6
|
+
|
7
|
+
def initialize(owner)
|
8
|
+
@owner = owner
|
9
|
+
super()
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_xml
|
13
|
+
xml.d :propertyupdate, NAMESPACE do
|
14
|
+
xml.d :set do
|
15
|
+
xml.d :prop do
|
16
|
+
xml.d :objectOwner, owner
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
class ReportEventChanges < Base
|
4
|
+
attr_accessor :sync_token
|
5
|
+
|
6
|
+
def initialize(sync_token)
|
7
|
+
@sync_token = sync_token
|
8
|
+
super()
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_xml
|
12
|
+
xml.tag! "d:sync-collection", NAMESPACE do
|
13
|
+
xml.tag! "d:sync-token", sync_token
|
14
|
+
xml.tag! "d:sync-level", "1"
|
15
|
+
xml.d :prop do
|
16
|
+
xml.d :getetag
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
class ReportVEVENT < Base
|
5
|
+
attr_accessor :tstart, :tend
|
6
|
+
|
7
|
+
def initialize( tstart=nil, tend=nil )
|
8
|
+
@tstart = tstart
|
9
|
+
@tend = tend
|
10
|
+
super()
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_xml
|
14
|
+
xml.c 'calendar-query'.intern, C_NAMESPACES do
|
15
|
+
xml.d :prop do
|
16
|
+
xml.d :getetag
|
17
|
+
xml.c 'calendar-data'.intern
|
18
|
+
end
|
19
|
+
xml.c :filter do
|
20
|
+
xml.c 'comp-filter'.intern, :name=> 'VCALENDAR' do
|
21
|
+
xml.c 'comp-filter'.intern, :name=> 'VEVENT' do
|
22
|
+
xml.c 'time-range'.intern, :start=> "#{tstart}Z", :end=> "#{tend}Z"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module SabredavClient
|
2
|
+
module XmlRequestBuilder
|
3
|
+
|
4
|
+
class ReportVTODO < Base
|
5
|
+
def to_xml
|
6
|
+
xml.c 'calendar-query'.intern, C_NAMESPACES do
|
7
|
+
xml.d :prop do
|
8
|
+
xml.d :getetag
|
9
|
+
xml.c 'calendar-data'.intern
|
10
|
+
end
|
11
|
+
xml.c :filter do
|
12
|
+
xml.c 'comp-filter'.intern, :name=> 'VCALENDAR' do
|
13
|
+
xml.c 'comp-filter'.intern, :name=> 'VTODO'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
require 'builder'
|
2
|
+
|
3
|
+
['base.rb', 'propfind_calendar.rb', 'mkcalendar.rb', 'post_sharing.rb', 'report_vevent.rb', 'report_vtodo.rb', 'mkcol_principal.rb',
|
4
|
+
'report_event_changes.rb', 'propfind_owner.rb', 'proppatch_owner.rb'].each do |f|
|
5
|
+
require File.join( File.dirname(__FILE__), 'xml_request_builder', f )
|
6
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
require 'net/http/digest_auth'
|
3
|
+
require 'uuid'
|
4
|
+
require 'rexml/document'
|
5
|
+
require 'rexml/xpath'
|
6
|
+
require 'icalendar'
|
7
|
+
require 'time'
|
8
|
+
require 'date'
|
9
|
+
|
10
|
+
['errors/errors.rb','xml_request_builder.rb', 'client.rb', 'request.rb', 'net.rb', 'format.rb', "calendar.rb", "events.rb", "principal.rb"].each do |f|
|
11
|
+
require File.join( File.dirname(__FILE__), 'sabredav_client', f )
|
12
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require File.expand_path('../lib/sabredav_client/version', __FILE__)
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "sabredav_client"
|
7
|
+
s.version = SabredavClient::VERSION
|
8
|
+
s.summary = "Ruby SabreDAV client"
|
9
|
+
s.description = "A great Ruby client for SabreDAV Servers."
|
10
|
+
|
11
|
+
s.required_ruby_version = '>= 1.9.2'
|
12
|
+
|
13
|
+
s.license = 'MIT'
|
14
|
+
|
15
|
+
s.homepage = %q{https://github.com/njiuko/sabredav_client}
|
16
|
+
s.authors = [%q{Nicolas Schwartau}]
|
17
|
+
s.email = [%q{n.schwartau@gmail.com}]
|
18
|
+
|
19
|
+
s.add_runtime_dependency 'icalendar', '~> 2.4'
|
20
|
+
s.add_runtime_dependency 'uuid', '~> 2.3'
|
21
|
+
s.add_runtime_dependency 'builder', '~> 3.2'
|
22
|
+
s.add_runtime_dependency 'net-http-digest_auth', '~> 1.4'
|
23
|
+
|
24
|
+
s.add_development_dependency 'rspec', '~> 3.5'
|
25
|
+
s.add_development_dependency 'fakeweb', '~> 1.3'
|
26
|
+
|
27
|
+
s.description = <<-DESC
|
28
|
+
sabredav_client is a great Ruby client for SabreDAV servers. It is based on the agcaldav gem.
|
29
|
+
DESC
|
30
|
+
|
31
|
+
s.files = `git ls-files`.split("\n")
|
32
|
+
s.require_paths = ["lib"]
|
33
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
2
|
+
<d:multistatus xmlns:d="DAV:">
|
3
|
+
<d:response>
|
4
|
+
<d:href>/calendars/johndoe/home/newevent.ics</d:href>
|
5
|
+
<d:propstat>
|
6
|
+
<d:prop>
|
7
|
+
<d:getetag>"1"</d:getetag>
|
8
|
+
</d:prop>
|
9
|
+
<d:status>HTTP/1.1 200 OK</d:status>
|
10
|
+
</d:propstat>
|
11
|
+
</d:response>
|
12
|
+
<d:response>
|
13
|
+
<d:href>/calendars/johndoe/home/updatedevent.ics</d:href>
|
14
|
+
<d:propstat>
|
15
|
+
<d:prop>
|
16
|
+
<d:getetag>"2"</d:getetag>
|
17
|
+
</d:prop>
|
18
|
+
<d:status>HTTP/1.1 200 OK</d:status>
|
19
|
+
</d:propstat>
|
20
|
+
</d:response>
|
21
|
+
<d:response>
|
22
|
+
<d:href>/calendars/johndoe/home/deletedevent.ics</d:href>
|
23
|
+
<d:status>HTTP/1.1 404 Not Found</d:status>
|
24
|
+
</d:response>
|
25
|
+
<d:sync-token>http://sabredav.org/ns/sync/5001</d:sync-token>
|
26
|
+
</d:multistatus>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
|
3
|
+
<d:response>
|
4
|
+
<d:href>/caldav/server.php/calendars/foo/test_calendar/</d:href>
|
5
|
+
<d:propstat>
|
6
|
+
<d:prop>
|
7
|
+
<d:displayname>Test Calendar</d:displayname>
|
8
|
+
<cs:getctag>http://sabre.io/ns/sync/15</cs:getctag>
|
9
|
+
<d:sync-token>http://sabre.io/ns/sync/15</d:sync-token>
|
10
|
+
</d:prop>
|
11
|
+
<d:status>HTTP/1.1 200 OK</d:status>
|
12
|
+
</d:propstat>
|
13
|
+
</d:response>
|
14
|
+
</d:multistatus>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
BEGIN:VCALENDAR
|
2
|
+
VERSION:2.0
|
3
|
+
PRODID:-//Apple Inc.//Mac OS X 10.10.5//EN
|
4
|
+
CALSCALE:GREGORIAN
|
5
|
+
BEGIN:VEVENT
|
6
|
+
CREATED:20160818T130939Z
|
7
|
+
UID:896BD78E-5DC1-495D-BB81-6BF3F3A67D64
|
8
|
+
DTEND;VALUE=DATE:20160818
|
9
|
+
TRANSP:TRANSPARENT
|
10
|
+
SUMMARY:alllllll day neww Event
|
11
|
+
DTSTART;VALUE=DATE:20160817
|
12
|
+
DTSTAMP:20160818T130939Z
|
13
|
+
SEQUENCE:0
|
14
|
+
BEGIN:VALARM
|
15
|
+
X-WR-ALARMUID:47732F70-1793-47B3-80FA-57E3C5ECA0E5
|
16
|
+
UID:47732F70-1793-47B3-80FA-57E3C5ECA0E5
|
17
|
+
TRIGGER:-PT15H
|
18
|
+
X-APPLE-DEFAULT-ALARM:TRUE
|
19
|
+
ATTACH;VALUE=URI:Basso
|
20
|
+
ACTION:AUDIO
|
21
|
+
END:VALARM
|
22
|
+
END:VEVENT
|
23
|
+
END:VCALENDAR
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
|
3
|
+
<response>
|
4
|
+
<href>/user/calendar/960232b0-371c-0130-9e6b-001999638982.ics</href>
|
5
|
+
<propstat>
|
6
|
+
<prop>
|
7
|
+
<getetag>"-5984324385549365166"</getetag>
|
8
|
+
<C:calendar-data>BEGIN:VCALENDAR
|
9
|
+
PRODID:-//Radicale//NONSGML Radicale Server//EN
|
10
|
+
VERSION:2.0
|
11
|
+
BEGIN:VEVENT
|
12
|
+
DESCRIPTION:12345 12345
|
13
|
+
DTEND:20010202T120000
|
14
|
+
DTSTAMP:20130102T161119
|
15
|
+
DTSTART:20010202T080000
|
16
|
+
SEQUENCE:0
|
17
|
+
SUMMARY:6789
|
18
|
+
UID:960232b0-371c-0130-9e6b-001999638982
|
19
|
+
X-RADICALE-NAME:960232b0-371c-0130-9e6b-001999638982.ics
|
20
|
+
END:VEVENT
|
21
|
+
END:VCALENDAR
|
22
|
+
</C:calendar-data>
|
23
|
+
</prop>
|
24
|
+
<status>HTTP/1.1 200 OK</status>
|
25
|
+
</propstat>
|
26
|
+
</response>
|
27
|
+
<response>
|
28
|
+
<href>/user/calendar/98f067a0-371c-0130-9e6c-001999638982.ics</href>
|
29
|
+
<propstat>
|
30
|
+
<prop>
|
31
|
+
<getetag>"3611068816283260390"</getetag>
|
32
|
+
<C:calendar-data>BEGIN:VCALENDAR
|
33
|
+
PRODID:-//Radicale//NONSGML Radicale Server//EN
|
34
|
+
VERSION:2.0
|
35
|
+
BEGIN:VEVENT
|
36
|
+
DESCRIPTION:12345 12345
|
37
|
+
DTEND:20010203T120000
|
38
|
+
DTSTAMP:20130102T161124
|
39
|
+
DTSTART:20010203T080000
|
40
|
+
SEQUENCE:0
|
41
|
+
SUMMARY:6789
|
42
|
+
UID:98f067a0-371c-0130-9e6c-001999638982
|
43
|
+
X-RADICALE-NAME:98f067a0-371c-0130-9e6c-001999638982.ics
|
44
|
+
END:VEVENT
|
45
|
+
END:VCALENDAR
|
46
|
+
</C:calendar-data>
|
47
|
+
</prop>
|
48
|
+
<status>HTTP/1.1 200 OK</status>
|
49
|
+
</propstat>
|
50
|
+
</response>
|
51
|
+
</multistatus>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
|
3
|
+
<d:response>
|
4
|
+
<d:href>http://localhost:5232/user/calendar/event.ics</d:href>
|
5
|
+
<d:propstat>
|
6
|
+
<d:prop>
|
7
|
+
<d:objectOwner>principals/usertest</d:objectOwner>
|
8
|
+
</d:prop>
|
9
|
+
<d:status>HTTP/1.1 200 OK</d:status>
|
10
|
+
</d:propstat>
|
11
|
+
</d:response>
|
12
|
+
</d:multistatus>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<c:mkcalendar xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
|
3
|
+
<d:set>
|
4
|
+
<d:prop>
|
5
|
+
<d:displayname>name</d:displayname>
|
6
|
+
<c:calendar-description xml:lang="en">description</c:calendar-description>
|
7
|
+
</d:prop>
|
8
|
+
</d:set>
|
9
|
+
</c:mkcalendar>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<d:mkcol xmlns:d="DAV:" xmlns:sb="http://sabredav.org/ns">
|
3
|
+
<d:set>
|
4
|
+
<d:prop>
|
5
|
+
<d:resourcetype>
|
6
|
+
<d:principal/>
|
7
|
+
</d:resourcetype>
|
8
|
+
<d:displayname>usertest</d:displayname>
|
9
|
+
<sb:email-address>test@test.de</sb:email-address>
|
10
|
+
</d:prop>
|
11
|
+
</d:set>
|
12
|
+
</d:mkcol>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<cs:share xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
|
3
|
+
<cs:set>
|
4
|
+
<d:href>mailto:add1@test.de</d:href>
|
5
|
+
<cs:summary>title</cs:summary>
|
6
|
+
<cs:common-name>common_name</cs:common-name>
|
7
|
+
<cs:read-write/>
|
8
|
+
</cs:set>
|
9
|
+
<cs:set>
|
10
|
+
<d:href>mailto:add2@test.de</d:href>
|
11
|
+
<cs:summary>title</cs:summary>
|
12
|
+
<cs:common-name>common_name</cs:common-name>
|
13
|
+
<cs:read-write/>
|
14
|
+
</cs:set>
|
15
|
+
<cs:remove>
|
16
|
+
<d:href>mailto:remove@test.de</d:href>
|
17
|
+
</cs:remove>
|
18
|
+
</cs:share>
|