[OGo-XML-RPC] LSDBObjectCommandException - no participants set
Adam Tauno Williams
xmlrpc@opengroupware.org
Fri, 20 Jan 2006 09:55:39 -0500
--=-O5oo4Dd9rRApLSVysd1F
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
On Wed, 2006-01-18 at 20:51 +0100, Alejandro Mart=C3=ADnez Marcos wrote:
> Hello,
>=20
> we have an application based on OpenGroupware XML-RPC
> interface that sets and gets contacts, appointments and tasks on Ogo.
> We are using OpenGroupware version OGo-1.0beta.1-r1175.0. We are
> unable to create appointments at all, though all the rest of the
> operations we need work fine The result is always the same:
>=20
> xmlrpclib.Fault: <Fault 0: 'LSDBObjectCommandException:
> appointment::new failed: no participants set !'>
>=20
> But the appointment I have prepared does contain participants.
I just looked at my POGI code, and to change the participants of an
appointment you need to call appointment.setParticipants, for instance
we have a method like -
function setParticipants($_ap) {
$this->traceMessage('@OGoAppointmentManager:setParticipants');
$list =3D array();
foreach($_ap->getParticipants() as $participant)
array_push($list, new XML_RPC_Value($participant->getShortId(),
"string"));
$params =3D array(new XML_RPC_Value($_ap->getShortId(), "string"),
new XML_RPC_Value($list, "array"));
$response =3D $this->server->rpc_call('appointment.setParticipants',
$params);
list($quality, $content) =3D $this->server->result_value($response);
return $quality;
}
- where _ap is an appointment object. This gathers the participant
subkeys off the appointment object and submits them to setParticipants.
So for a new appointment: (1) create the appointment [ the response in
an appointment object ] then (2) add participants and call
setParticipants. For an existing appointment (1) request the
appointment (2) add/remove participants (3) call setParticipants
> This is a very simple python script that I have tried, I see
> everything correct in it:
> #!/usr/bin/env python
> import xmlrpclib
> server =3D xmlrpclib.Server('http://.../RPC2',login=3D'user1',password=3D=
'...')
> import xmlrpclib,time
> dateStringStart =3D "20040116T10:10:10"
> dateStringEnd =3D "20040116T11:15:10"
> startDate =3D xmlrpclib.DateTime(time.mktime(time.strptime(dateStringStar=
t,"%Y%m%dT%H:%M:%S")))
> endDate =3D xmlrpclib.DateTime(time.mktime(time.strptime(dateStringEnd,"%=
Y%m%dT%H:%M:%S")))
> print startDate
> print endDate
> dict =3D {}
> dict['startDate'] =3D startDate
> dict['endDate'] =3D endDate
> dict['title'] =3D 'Cita1'
> # We search for a participant, myself
> person=3Dserver.person.fetch("login like '*user1*'")
> print person
> dict['participants'] =3D person
> print dict
> result =3D server.appointment.insert(dict)
> print result
>=20
>=20
>=20
> And this is the result of the script:
>=20
> (These come from print startDate and print endDate:)
> <DateTime 20040116T10:10:10 at -481d2854>
> <DateTime 20040116T11:15:10 at -4827f6d4>
>=20
>=20
> (It comes from "print person")
> [{'extendedAttrs': {'email1': '...'}, 'number': 'OGo18010',
> 'addresses': {'mailing': {'type': 'mailing', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/18050', 'name1':
> '...'}, 'location': {'type': 'location', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/18060'},
> 'private': {'type': 'private', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/18040'}},
> 'extendedKeys': ['email1', 'email2', 'email3', 'job_title',
> 'other_title1', 'other_title2'], 'url': '', 'phones':
> {'15_fax_private': {'telephoneId': 18120, 'info': '', 'type':
> '15_fax_private', 'number': ''}, '02_tel': {'telephoneId': 18080,
> 'info': '', 'type': '02_tel', 'number': ''}, '01_tel': {'telephoneId':
> 18070, 'info': '', 'type': '01_tel', 'number': ''}, '05_tel_private':
> {'telephoneId': 18100, 'info': '', 'type': '05_tel_private', 'number':
> ''}, '10_fax': {'telephoneId': 18110, 'info': '', 'type': '10_fax',
> 'number': ''}, '03_tel_funk': {'telephoneId': 18090, 'info': '',
> 'type': '03_tel_funk', 'number': ''}}, 'phoneTypes': ['01_tel',
> '02_tel', '03_tel_funk', '05_tel_private', '10_fax',
> '15_fax_private'], 'objectVersion': 3, 'isComplete': <Boolean True at
> -481dd4f4>, 'isPrivate': <Boolean False at -481dd4d4>, 'isAccount':
> <Boolean True at -481dd4f4>, 'owner': {'login': '...(my ogo root
> user)...', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/10000'},
> 'login': 'user1', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/18010', 'name':
> '...I'}]
>=20
>=20
>=20
>=20
> (It comes from "print dict")
> {'startDate': <DateTime 20040116T10:10:10 at -481d2854>,
> 'participants': [{'extendedAttrs': {'email1': 'test@yaco.es'},
> 'number': 'OGo18010', 'addresses': {'mailing': {'type': 'mailing',
> 'id': 'skyrix://localhost.localdomain/localhost.localdomain/18050',
> 'name1': '...'}, 'location': {'type': 'location', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/18060'},
> 'private': {'type': 'private', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/18040'}},
> 'extendedKeys': ['email1', 'email2', 'email3', 'job_title',
> 'other_title1', 'other_title2'], 'url': '', 'phones':
> {'15_fax_private': {'telephoneId': 18120, 'info': '', 'type':
> '15_fax_private', 'number': ''}, '02_tel': {'telephoneId': 18080,
> 'info': '', 'type': '02_tel', 'number': ''}, '01_tel': {'telephoneId':
> 18070, 'info': '', 'type': '01_tel', 'number': ''}, '05_tel_private':
> {'telephoneId': 18100, 'info': '', 'type': '05_tel_private', 'number':
> ''}, '10_fax': {'telephoneId': 18110, 'info': '', 'type': '10_fax',
> 'number': ''}, '03_tel_funk': {'telephoneId': 18090, 'info': '',
> 'type': '03_tel_funk', 'number': ''}}, 'phoneTypes': ['01_tel',
> '02_tel', '03_tel_funk', '05_tel_private', '10_fax',
> '15_fax_private'], 'objectVersion': 3, 'isComplete': <Boolean True at
> -481dd4f4>, 'isPrivate': <Boolean False at -481dd4d4>, 'isAccount':
> <Boolean True at -481dd4f4>, 'owner': {'login': '...(my root
> user)...', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/10000'},
> 'login': 'user1', 'id':
> 'skyrix://localhost.localdomain/localhost.localdomain/18010', 'name':
> '...'}], 'endDate': <DateTime 20040116T11:15:10 at -4827f6d4>,
> 'title': 'Cita1'}
>=20
>=20
> And this is the exception, from "result =3D server.appointment.insert(dic=
t):"
>=20
> Traceback (most recent call last):
> File "./crear_cita.con.participante.py", line 21, in ?
> result =3D server.appointment.insert(dict)
> File "/home/.../xmlrpclib.py", line 830, in __call__
> return self.__send(self.__name, args)
> File "/home/.../xmlrpclib.py", line 996, in __request
> verbose=3Dself.__verbose
> File "/home/.../xmlrpclib.py", line 867, in request
> return self.parse_response(h.getfile())
> File "/home/.../xmlrpclib.py", line 916, in parse_response
> return u.close()
> File "/home/.../xmlrpclib.py", line 579, in close
> raise apply(Fault, (), self._stack[0])
> xmlrpclib.Fault: <Fault 0: 'LSDBObjectCommandException:
> appointment::new failed: no participants set !'>
>=20
> Do you see anything wrong in my script? Does exist any workaround?
>=20
> Thanks in advance,
>=20
> Alejandro Mart=C3=ADnez
--=-O5oo4Dd9rRApLSVysd1F
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQBD0PnrLRePpNle04MRAiV0AJ4+xrpT1JeYOIQ7cYqeiDXzbsb2pwCfcui4
hhulmuxApxOYON3PqJ+mou4=
=d3L6
-----END PGP SIGNATURE-----
--=-O5oo4Dd9rRApLSVysd1F--