Mailing List Archive

How to combine multiple calendars into one collection?
Hello,

I'm trying to build a collection of several calendars. I want it to show
the events of all participating calendars. The fact, that this
collection is read-only, is fine.

I've found a brief description in this mailing list with the subject
"Re: [Davical-general] Merging calendars on server side?" of 2012-07-16
21:20:47:

> There is a trick you can do which is as follows:
>
> 1) Create a normal collection (not a calendar or addressbook) in your
> wife's account.
>
> 2) BIND each of the collections to be merged into that collection
> (there's been discussion about BIND on this mailing list before).
>
> 3) Enable the 'get_includes_subcollections' configuration option.

Up to now, I have two calendars:

1) /christopher.etz/calendar/: the standard DAViCal calendar

2) /christopher.etz/BCScalendar/: an externally bound calendar (via
/.external/<generatedID>)

As step 1 describes, I created a collection
"/christopher.etz/allcalendars/", neither calendar nor addressbook.

I'm lost on step 2, cannot find the discussion mentioned there, and the
Wiki only covers external binds. Step 3 is already done.

All trials (quite some) to bind any of the two calendars to the new
collection failed. I tried this in the web interface of DAViCal. I'
expect to enter "/christopher.etz/calendar/" into the field "Bound As"
and "/christopher.etz/allcalendars/" into the field "To Collection". But
this results in the error "A resource already exists at the destination."

DAViCal is version 1.1.8, running in Apache with mod_php and all
required PHP components. setup.php shows all dependencies fulfilled.

Can anyone help me with that (hopefully simple) problem?

Additional question: Can I make freebusy.php aware of the new
collection, i.e. it should return"busy", if there is an event in any of
the calendars of the collection?

Regards,
Christopher Etz




_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: How to combine multiple calendars into one collection? [ In reply to ]
Hi Christopher,

You need to send some especially crafted XML to create the bind. See:
http://wiki.davical.org/index.php/External_Bind

I have a shell script for doing this, save this as dav_bind.sh:

-- Begin --
#!/bin/bash

BASE="$1"
USER="$2"
RESOURCE="$3"
NAME="${4:-${3##*/}}"

URL="$BASE/caldav.php/$USER/"


REQUEST=`cat <<EOF
<?xml version="1.0" encoding="utf-8"?>
<bind xmlns="DAV:">
<segment>$NAME</segment>
<href>$RESOURCE</href>
</bind>
EOF`

echo $REQUEST | curl -k -d @- -X BIND -u $USER \
-H "content-type: text/xml charset=\"UTF-8\"" \
-H "user-agent: bind-script" $URL
-- END --

Cheers,
Andrew


On Fri, 2019-07-05 at 14:33 +0200, Christopher Etz wrote:
> Hello,
>
> I'm trying to build a collection of several calendars. I want it to
> show
> the events of all participating calendars. The fact, that this
> collection is read-only, is fine.
>
> I've found a brief description in this mailing list with the subject
> "Re: [Davical-general] Merging calendars on server side?" of 2012-07-
> 16
> 21:20:47:
>
> > There is a trick you can do which is as follows:
> >
> > 1) Create a normal collection (not a calendar or addressbook) in
> > your
> > wife's account.
> >
> > 2) BIND each of the collections to be merged into that collection
> > (there's been discussion about BIND on this mailing list before).
> >
> > 3) Enable the 'get_includes_subcollections' configuration option.
>
> Up to now, I have two calendars:
>
> 1) /christopher.etz/calendar/: the standard DAViCal calendar
>
> 2) /christopher.etz/BCScalendar/: an externally bound calendar (via
> /.external/<generatedID>)
>
> As step 1 describes, I created a collection
> "/christopher.etz/allcalendars/", neither calendar nor addressbook.
>
> I'm lost on step 2, cannot find the discussion mentioned there, and
> the
> Wiki only covers external binds. Step 3 is already done.
>
> All trials (quite some) to bind any of the two calendars to the new
> collection failed. I tried this in the web interface of DAViCal. I'
> expect to enter "/christopher.etz/calendar/" into the field "Bound
> As"
> and "/christopher.etz/allcalendars/" into the field "To Collection".
> But
> this results in the error "A resource already exists at the
> destination."
>
> DAViCal is version 1.1.8, running in Apache with mod_php and all
> required PHP components. setup.php shows all dependencies fulfilled.
>
> Can anyone help me with that (hopefully simple) problem?
>
> Additional question: Can I make freebusy.php aware of the new
> collection, i.e. it should return"busy", if there is an event in any
> of
> the calendars of the collection?
>
> Regards,
> Christopher Etz
>
>
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general
>
--
Andrew Ruthven, Wellington, New Zealand
andrew@etc.gen.nz | linux.conf.au 2020, Gold Coast, AU
https://catalystcloud.nz | https://lca2020.linux.org.au



_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: How to combine multiple calendars into one collection? [ In reply to ]
Hi Andrew and all others,

my mistake was that I expected a collection to comprise several
calendars. But instead, a collection seems to collect similar items only
(events or addresses). To combine calendars for some external access,
they have to reside under a common location, such as
.../caldav.php/<username>/, and $c->get_includes_subcollections has to
be set to true.

I hope, this understanding is now correct.

Regards,
Christopher

------------------------------------------------------------------------
Am 09.07.2019 um 06:15 schrieb Andrew Ruthven:
> Hi Christopher,
>
> You need to send some especially crafted XML to create the bind. See:
> http://wiki.davical.org/index.php/External_Bind
>
> I have a shell script for doing this, save this as dav_bind.sh:
>
> -- Begin --
> #!/bin/bash
>
> BASE="$1"
> USER="$2"
> RESOURCE="$3"
> NAME="${4:-${3##*/}}"
>
> URL="$BASE/caldav.php/$USER/"
>
>
> REQUEST=`cat <<EOF
> <?xml version="1.0" encoding="utf-8"?>
> <bind xmlns="DAV:">
> <segment>$NAME</segment>
> <href>$RESOURCE</href>
> </bind>
> EOF`
>
> echo $REQUEST | curl -k -d @- -X BIND -u $USER \
> -H "content-type: text/xml charset=\"UTF-8\"" \
> -H "user-agent: bind-script" $URL
> -- END --
>
> Cheers,
> Andrew
>
>
> On Fri, 2019-07-05 at 14:33 +0200, Christopher Etz wrote:
>> Hello,
>>
>> I'm trying to build a collection of several calendars. I want it to
>> show
>> the events of all participating calendars. The fact, that this
>> collection is read-only, is fine.
>>
>> I've found a brief description in this mailing list with the subject
>> "Re: [Davical-general] Merging calendars on server side?" of 2012-07-
>> 16
>> 21:20:47:
>>
>>> There is a trick you can do which is as follows:
>>>
>>> 1) Create a normal collection (not a calendar or addressbook) in
>>> your
>>> wife's account.
>>>
>>> 2) BIND each of the collections to be merged into that collection
>>> (there's been discussion about BIND on this mailing list before).
>>>
>>> 3) Enable the 'get_includes_subcollections' configuration option.
>> Up to now, I have two calendars:
>>
>> 1) /christopher.etz/calendar/: the standard DAViCal calendar
>>
>> 2) /christopher.etz/BCScalendar/: an externally bound calendar (via
>> /.external/<generatedID>)
>>
>> As step 1 describes, I created a collection
>> "/christopher.etz/allcalendars/", neither calendar nor addressbook.
>>
>> I'm lost on step 2, cannot find the discussion mentioned there, and
>> the
>> Wiki only covers external binds. Step 3 is already done.
>>
>> All trials (quite some) to bind any of the two calendars to the new
>> collection failed. I tried this in the web interface of DAViCal. I'
>> expect to enter "/christopher.etz/calendar/" into the field "Bound
>> As"
>> and "/christopher.etz/allcalendars/" into the field "To Collection".
>> But
>> this results in the error "A resource already exists at the
>> destination."
>>
>> DAViCal is version 1.1.8, running in Apache with mod_php and all
>> required PHP components. setup.php shows all dependencies fulfilled.
>>
>> Can anyone help me with that (hopefully simple) problem?
>>
>> Additional question: Can I make freebusy.php aware of the new
>> collection, i.e. it should return"busy", if there is an event in any
>> of
>> the calendars of the collection?
>>
>> Regards,
>> Christopher Etz
>>
>>
>>
>>
>> _______________________________________________
>> Davical-general mailing list
>> Davical-general@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/davical-general
>>