Using POGI to get appointments out of OGo
Timo Springmann <[email protected]> Tue, 20 Sep 2005 13:57:45 +0200
| Newsgroups | gmane.comp.cms.opengroupware.xmlrpc.devel |
|---|---|
| Organization | Linet Services |
| Message-ID | <[email protected]> |
Hi list,
I'm trying to use POGI to get appointments out of OGo onto my webpage, but
everything I get is this error from the xmlrpcd:
---------------------------------------------------------------
localhost - - [20/Sep/2005:11:53:19 GMT] "POST /RPC2 HTTP/1.0" 200 314 0.002 -
- 0
Sep 20 11:53:19 ogo-xmlrpcd-1.0a [28338]: >DirectAction> turn exception into
fault: (Exception name:LSDBObjectCommandException
class:LSDBObjectCommandException reason:appointment::query failed: invalid
date range info:<nil>)
localhost - - [20/Sep/2005:11:53:19 GMT] "POST /RPC2 HTTP/1.0" 200 313 0.004 -
- 0
localhost - - [20/Sep/2005:11:53:20 GMT] "POST /RPC2 HTTP/1.0" 200 314 0.002 -
- 0
Sep 20 11:53:20 ogo-xmlrpcd-1.0a [28338]: >DirectAction> turn exception into
fault: (Exception name:LSDBObjectCommandException
class:LSDBObjectCommandException reason:appointment::query failed: invalid
date range info:<nil>)
localhost - - [20/Sep/2005:11:53:20 GMT] "POST /RPC2 HTTP/1.0" 200 313 0.004 -
- 0
---------------------------------------------------------------
I started the xmlrpcd with this command: /usr/sbin/ogo-xmlrpcd-1.0a -WOPort
23000
Here's the relevant PHP code:
---------------------------------------------------------------
function showOGoAppointments() {
ini_set("include_path", ".:/path/to/POGI/:/usr/share/php");
require_once("OGoAppointment.php");
$server = new OGoServer("localhost", "/RPC2", 23000);
// Set you user credentials - username, password
$server->login("<user>", "<password>");
$appointmentManager = $server->getAppointmentManager();
$today = date("Y-m-d");
$yesterday = "2005-09-19";
$appointments = $appointmentManager->getBetween($today,$yesterday);
if(is_array($appointments)) {
foreach($appointments as $appointment) {
echo $appointment->getShortId();
echo $appointment->getShortId();
echo $appointment->getTitle();
echo $appointment->getStartDate();
echo $appointment->getEndDate();
}
}
}
---------------------------------------------------------------
I am not sure if this php code should work, but I think I just copied most
parts out of the example scripts. I'm using POGI 0.17 as 0.18 had no source
directory in the downloaded tar.gz archive.
Any hints?
Timo
--
OpenGroupware.org XML-RPC
[email protected]
http://mail.opengroupware.org/mailman/listinfo/xmlrpc