Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DAViCal: General

How to use inc caldav-client.php

 

 

DAViCal general RSS feed   Index | Next | Previous | View Threaded


luca at bitrade

Mar 21, 2012, 6:12 AM

Post #1 of 5 (1344 views)
Permalink
How to use inc caldav-client.php

Hi to all!
I'm a young developer and i'm trying to manage how to connect to an alredy existing CALDAV server with a WEB page. Looking aorund i found your project and, more specifically, i found the file in object.

I make some test with it and i manage to retrive information without problem. Now i'm trying to write on remote server. Looking into this class i found the method "DoPUTRequest", but when i try to use it i receive a "404" error.


The complete error code is:

HTTP/1.1 404 Not found Date: Wed, 21 Mar 2012 12:49:16 GMT content-length: 208 content-type: text/html; charset="iso-8859-1" Connection: close
An error occurred during object publishing

the requested object could not be found!



The method sign is:

function DoPUTRequest( $relative_url, $icalendar, $etag = null )

To use the method above i use the same object that make the correct request.

I left blank $relative_url, use the above string as $icalendar:

$icalInfo = "
BEGIN:VEVENT\n
SUMMARY:Riunione di prova\n
CLASS:PRIVATE\n
DTSTART;TZID=Europe/Rome:20120322T090000\n
DTEND;TZID=Europe/Rome:20120322T100000\n
PRIORITY:5\n
SEQUENCE:0\n
LAST-MODIFIED:20120322T120257Z\n
X-FUNAMBOL-ALLDAY:0\n
X-EPOCAGENDAENTRYTYPE:APPOINTMENT\n
X-METHOD:NONE\n
END:VEVENT";


And finally i use as $etag "*".

I hope i was clear enough!

Thanks in advice for any help!

Regards

Lerry

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general


andrew at morphoss

Mar 22, 2012, 8:15 PM

Post #2 of 5 (1317 views)
Permalink
Re: How to use inc_caldav-client.php [In reply to]

Well, the general answer is: you shouldn't.

There is a newer include caldav-client-v2.php which is more useful, but
to use either of these you really need to have some kind of
understanding of how CalDAV works.

On the other hand if you just want a CalDAV client in a web page there
are some already existing ones, and one of the easiest to install is
'jqcaldav' which is written using JQuery.

Cheers,
Andrew.

On Wed, 2012-03-21 at 14:12 +0100, luca cerri wrote:
> Hi to all!
> I'm a young developer and i'm trying to manage how to connect to an
> alredy existing CALDAV server with a WEB page. Looking aorund i found
> your project and, more specifically, i found the file in object.
>
> I make some test with it and i manage to retrive information without
> problem. Now i'm trying to write on remote server. Looking into this
> class i found the method "DoPUTRequest", but when i try to use it i
> receive a "404" error.
>
>
> The complete error code is:
>
> HTTP/1.1 404 Not found Date: Wed, 21 Mar 2012 12:49:16 GMT
> content-length: 208 content-type: text/html; charset="iso-8859-1"
> Connection: close
> An error occurred during object publishing
>
> the requested object could not be found!
>
>
>
> The method sign is:
>
> function DoPUTRequest( $relative_url, $icalendar, $etag = null )
>
> To use the method above i use the same object that make the correct request.
>
> I left blank $relative_url, use the above string as $icalendar:
>
> $icalInfo = "
> BEGIN:VEVENT\n
> SUMMARY:Riunione di prova\n
> CLASS:PRIVATE\n
> DTSTART;TZID=Europe/Rome:20120322T090000\n
> DTEND;TZID=Europe/Rome:20120322T100000\n
> PRIORITY:5\n
> SEQUENCE:0\n
> LAST-MODIFIED:20120322T120257Z\n
> X-FUNAMBOL-ALLDAY:0\n
> X-EPOCAGENDAENTRYTYPE:APPOINTMENT\n
> X-METHOD:NONE\n
> END:VEVENT";
>
>
> And finally i use as $etag "*".
>
> I hope i was clear enough!
>
> Thanks in advice for any help!


--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
Creditor, n.:
A man who has a better memory than a debtor.
------------------------------------------------------------------------
Attachments: signature.asc (0.82 KB)


luca at bitrade

Mar 23, 2012, 3:33 AM

Post #3 of 5 (1489 views)
Permalink
Re: How to use inc caldav-client.php [In reply to]

Thanks for your help Andrew, but what i really need is a server-side script. Maybe a little backgroud to exlain why can be useful.
I alredy have a CalDAV server, it works well and it have his own web gui. Some days ago my boss has bought a new management software that can export appointments in ical. What he asked me is to make a script that can be scheduled to take these ical file and import them into our CalDAV server.

Because we alredy have an internal web server i'm looking for a PHP class that can handle CalDAV, scheduling its execution with cron and wget.

I think it was the easy way, maybe there is a easiest way?

Can you pointing me to some CalDAV manual?

Thanks again for your help!

Regards

Luca


Il giorno Venerdi, 23 Marzo, 2012 04:15 CET, Andrew McMillan <andrew [at] morphoss> ha scritto:
> Well, the general answer is: you shouldn't.
>
> There is a newer include caldav-client-v2.php which is more useful, but
> to use either of these you really need to have some kind of
> understanding of how CalDAV works.
>
> On the other hand if you just want a CalDAV client in a web page there
> are some already existing ones, and one of the easiest to install is
> 'jqcaldav' which is written using JQuery.
>
> Cheers,
> Andrew.
>
> On Wed, 2012-03-21 at 14:12 +0100, luca cerri wrote:
> > Hi to all!
> > I'm a young developer and i'm trying to manage how to connect to an
> > alredy existing CALDAV server with a WEB page. Looking aorund i found
> > your project and, more specifically, i found the file in object.
> >
> > I make some test with it and i manage to retrive information without
> > problem. Now i'm trying to write on remote server. Looking into this
> > class i found the method "DoPUTRequest", but when i try to use it i
> > receive a "404" error.
> >
> >
> > The complete error code is:
> >
> > HTTP/1.1 404 Not found Date: Wed, 21 Mar 2012 12:49:16 GMT
> > content-length: 208 content-type: text/html; charset="iso-8859-1"
> > Connection: close
> > An error occurred during object publishing
> >
> > the requested object could not be found!
> >
> >
> >
> > The method sign is:
> >
> > function DoPUTRequest( $relative_url, $icalendar, $etag = null )
> >
> > To use the method above i use the same object that make the correct request.
> >
> > I left blank $relative_url, use the above string as $icalendar:
> >
> > $icalInfo = "
> > BEGIN:VEVENT\n
> > SUMMARY:Riunione di prova\n
> > CLASS:PRIVATE\n
> > DTSTART;TZID=Europe/Rome:20120322T090000\n
> > DTEND;TZID=Europe/Rome:20120322T100000\n
> > PRIORITY:5\n
> > SEQUENCE:0\n
> > LAST-MODIFIED:20120322T120257Z\n
> > X-FUNAMBOL-ALLDAY:0\n
> > X-EPOCAGENDAENTRYTYPE:APPOINTMENT\n
> > X-METHOD:NONE\n
> > END:VEVENT";
> >
> >
> > And finally i use as $etag "*".
> >
> > I hope i was clear enough!
> >
> > Thanks in advice for any help!
>
>
> --
> ------------------------------------------------------------------------
> andrew (AT) morphoss (DOT) com +64(272)DEBIAN
> Creditor, n.:
> A man who has a better memory than a debtor.
> ------------------------------------------------------------------------
>




------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general


andrew at morphoss

Mar 26, 2012, 10:39 AM

Post #4 of 5 (1323 views)
Permalink
Re: How to use inc_caldav-client.php [In reply to]

On Fri, 2012-03-23 at 11:33 +0100, luca cerri wrote:
> Thanks for your help Andrew, but what i really need is a server-side
> script. Maybe a little backgroud to exlain why can be useful.
> I alredy have a CalDAV server, it works well and it have his own web
> gui. Some days ago my boss has bought a new management software that
> can export appointments in ical. What he asked me is to make a script
> that can be scheduled to take these ical file and import them into our
> CalDAV server.

Hi Luca,

Is your CalDAV server DAViCal? If so there is both (a) a command-line
script that you can use to import an iCalendar file of events into a
calendar, and (b) you can do a "PUT" of the whole calendar file to the
calendar URL in DAViCal to import an entire calendar.

The script is not in any released version, but it should still work with
1.0.2 - you can download it from the DAViCal Git repository in the
scripts directory.

To use the PUT approach, which has always been possible in DAViCal you
need to set $c->readonly_webdav_collections = false; in your
configuration file. You can also add a "?mode=append" onto the calendar
URL used for the PUT if you want to add new events, rather than
overwrite the whole calendar.


> Because we alredy have an internal web server i'm looking for a PHP
> class that can handle CalDAV, scheduling its execution with cron and
> wget.
>
> I think it was the easy way, maybe there is a easiest way?
>
> Can you pointing me to some CalDAV manual?

CalDAV is defined in RFC4791.


> Thanks again for your help!

Well, I hope it is useful :-)

Cheers,
Andrew.
>
> Regards
>
> Luca
>
>
> Il giorno Venerdi, 23 Marzo, 2012 04:15 CET, Andrew McMillan <andrew [at] morphoss> ha scritto:
> > Well, the general answer is: you shouldn't.
> >
> > There is a newer include caldav-client-v2.php which is more useful, but
> > to use either of these you really need to have some kind of
> > understanding of how CalDAV works.
> >
> > On the other hand if you just want a CalDAV client in a web page there
> > are some already existing ones, and one of the easiest to install is
> > 'jqcaldav' which is written using JQuery.
> >
> > Cheers,
> > Andrew.
> >
> > On Wed, 2012-03-21 at 14:12 +0100, luca cerri wrote:
> > > Hi to all!
> > > I'm a young developer and i'm trying to manage how to connect to an
> > > alredy existing CALDAV server with a WEB page. Looking aorund i found
> > > your project and, more specifically, i found the file in object.
> > >
> > > I make some test with it and i manage to retrive information without
> > > problem. Now i'm trying to write on remote server. Looking into this
> > > class i found the method "DoPUTRequest", but when i try to use it i
> > > receive a "404" error.
> > >
> > >
> > > The complete error code is:
> > >
> > > HTTP/1.1 404 Not found Date: Wed, 21 Mar 2012 12:49:16 GMT
> > > content-length: 208 content-type: text/html; charset="iso-8859-1"
> > > Connection: close
> > > An error occurred during object publishing
> > >
> > > the requested object could not be found!
> > >
> > >
> > >
> > > The method sign is:
> > >
> > > function DoPUTRequest( $relative_url, $icalendar, $etag = null )
> > >
> > > To use the method above i use the same object that make the correct request.
> > >
> > > I left blank $relative_url, use the above string as $icalendar:
> > >
> > > $icalInfo = "
> > > BEGIN:VEVENT\n
> > > SUMMARY:Riunione di prova\n
> > > CLASS:PRIVATE\n
> > > DTSTART;TZID=Europe/Rome:20120322T090000\n
> > > DTEND;TZID=Europe/Rome:20120322T100000\n
> > > PRIORITY:5\n
> > > SEQUENCE:0\n
> > > LAST-MODIFIED:20120322T120257Z\n
> > > X-FUNAMBOL-ALLDAY:0\n
> > > X-EPOCAGENDAENTRYTYPE:APPOINTMENT\n
> > > X-METHOD:NONE\n
> > > END:VEVENT";
> > >
> > >
> > > And finally i use as $etag "*".
> > >
> > > I hope i was clear enough!
> > >
> > > Thanks in advice for any help!
> >
> >
> > --
> > ------------------------------------------------------------------------
> > andrew (AT) morphoss (DOT) com +64(272)DEBIAN
> > Creditor, n.:
> > A man who has a better memory than a debtor.
> > ------------------------------------------------------------------------
> >
>
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Davical-general mailing list
> Davical-general [at] lists
> https://lists.sourceforge.net/lists/listinfo/davical-general
>

--
------------------------------------------------------------------------
andrew (AT) morphoss (DOT) com +64(272)DEBIAN
There is no proverb that is not true.
-- Cervantes
------------------------------------------------------------------------
Attachments: signature.asc (0.82 KB)


luca at bitrade

Mar 29, 2012, 12:30 AM

Post #5 of 5 (1317 views)
Permalink
Re: How to use inc caldav-client.php [In reply to]

Hi andrew,
No, we didn't use a DAViCal server, but your suggestion pointing me to the right direction! I have modified a shell script that invoke the upload page to subimit new ical events to the server.

Thanks for your help!

Luca


Il giorno Lunedi, 26 Marzo, 2012 19:39 CEST, Andrew McMillan <andrew [at] morphoss> ha scritto:

> On Fri, 2012-03-23 at 11:33 +0100, luca cerri wrote:
> > Thanks for your help Andrew, but what i really need is a server-side
> > script. Maybe a little backgroud to exlain why can be useful.
> > I alredy have a CalDAV server, it works well and it have his own web
> > gui. Some days ago my boss has bought a new management software that
> > can export appointments in ical. What he asked me is to make a script
> > that can be scheduled to take these ical file and import them into our
> > CalDAV server.
>
> Hi Luca,
>
> Is your CalDAV server DAViCal? If so there is both (a) a command-line
> script that you can use to import an iCalendar file of events into a
> calendar, and (b) you can do a "PUT" of the whole calendar file to the
> calendar URL in DAViCal to import an entire calendar.
>
> The script is not in any released version, but it should still work with
> 1.0.2 - you can download it from the DAViCal Git repository in the
> scripts directory.
>
> To use the PUT approach, which has always been possible in DAViCal you
> need to set $c->readonly_webdav_collections = false; in your
> configuration file. You can also add a "?mode=append" onto the calendar
> URL used for the PUT if you want to add new events, rather than
> overwrite the whole calendar.
>
>
> > Because we alredy have an internal web server i'm looking for a PHP
> > class that can handle CalDAV, scheduling its execution with cron and
> > wget.
> >
> > I think it was the easy way, maybe there is a easiest way?
> >
> > Can you pointing me to some CalDAV manual?
>
> CalDAV is defined in RFC4791.
>
>
> > Thanks again for your help!
>
> Well, I hope it is useful :-)
>
> Cheers,
> Andrew.
> >
> > Regards
> >
> > Luca
> >
> >
> > Il giorno Venerdi, 23 Marzo, 2012 04:15 CET, Andrew McMillan <andrew [at] morphoss> ha scritto:
> > > Well, the general answer is: you shouldn't.
> > >
> > > There is a newer include caldav-client-v2.php which is more useful, but
> > > to use either of these you really need to have some kind of
> > > understanding of how CalDAV works.
> > >
> > > On the other hand if you just want a CalDAV client in a web page there
> > > are some already existing ones, and one of the easiest to install is
> > > 'jqcaldav' which is written using JQuery.
> > >
> > > Cheers,
> > > Andrew.
> > >
> > > On Wed, 2012-03-21 at 14:12 +0100, luca cerri wrote:
> > > > Hi to all!
> > > > I'm a young developer and i'm trying to manage how to connect to an
> > > > alredy existing CALDAV server with a WEB page. Looking aorund i found
> > > > your project and, more specifically, i found the file in object.
> > > >
> > > > I make some test with it and i manage to retrive information without
> > > > problem. Now i'm trying to write on remote server. Looking into this
> > > > class i found the method "DoPUTRequest", but when i try to use it i
> > > > receive a "404" error.
> > > >
> > > >
> > > > The complete error code is:
> > > >
> > > > HTTP/1.1 404 Not found Date: Wed, 21 Mar 2012 12:49:16 GMT
> > > > content-length: 208 content-type: text/html; charset="iso-8859-1"
> > > > Connection: close
> > > > An error occurred during object publishing
> > > >
> > > > the requested object could not be found!
> > > >
> > > >
> > > >
> > > > The method sign is:
> > > >
> > > > function DoPUTRequest( $relative_url, $icalendar, $etag = null )
> > > >
> > > > To use the method above i use the same object that make the correct request.
> > > >
> > > > I left blank $relative_url, use the above string as $icalendar:
> > > >
> > > > $icalInfo = "
> > > > BEGIN:VEVENT\n
> > > > SUMMARY:Riunione di prova\n
> > > > CLASS:PRIVATE\n
> > > > DTSTART;TZID=Europe/Rome:20120322T090000\n
> > > > DTEND;TZID=Europe/Rome:20120322T100000\n
> > > > PRIORITY:5\n
> > > > SEQUENCE:0\n
> > > > LAST-MODIFIED:20120322T120257Z\n
> > > > X-FUNAMBOL-ALLDAY:0\n
> > > > X-EPOCAGENDAENTRYTYPE:APPOINTMENT\n
> > > > X-METHOD:NONE\n
> > > > END:VEVENT";
> > > >
> > > >
> > > > And finally i use as $etag "*".
> > > >
> > > > I hope i was clear enough!
> > > >
> > > > Thanks in advice for any help!
> > >
> > >
> > >


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general

DAViCal general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.