[OGo-XML-RPC] project.fetchJobs alternative?
Adam Tauno Williams
xmlrpc@opengroupware.org
Thu, 08 Feb 2007 09:01:15 -0500
--=-K7zbKRB4+LCzfnpLfVi8
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
> > What is the
> > best way if i want to have all jobs assigned to a project?
> > I have no idea to get the relationship between a job and a project.
#!/usr/bin/env python
import xmlrpclib,pprint
server =3D xmlrpclib.Server('http://adam:*******@gourd-amber/RPC2')
person =3D server.person.getById(10100)
fetchSpec =3D {}
fetchSpec['qualifier'] =3D "projectId =3D 115100"
result =3D server.person.fetchJobs(10100, fetchSpec)
#Tried this too
#result =3D server.person.fetchJobs(person, fetchSpec)
pprint.pprint(result)
This returns nothing. I suspect this is because it is going through the
SkyPersonJobDataSource from the Document API; which is not an terribly
smart chunk of code.
I think the only fetch specs supported through the jobs related
functions of the XML-RPC API are:
fetchSpec['qualifier'] =3D "type =3D 'toDoJob'"
fetchSpec['qualifier'] =3D "type =3D 'controlJob'"
fetchSpec['qualifier'] =3D "type =3D 'delegatedJob'"
fetchSpec['qualifier'] =3D "type =3D 'archivedJob'"
fetchSpec['qualifier'] =3D "type =3D 'palmJob'"
There is a SkyProjectJobDataSource object, but it doesn't seem to get
used anywhere in the XML-RPC API.
Using ZOGI (http://code.google.com/p/zogi/) your should be able to:
#!/usr/bin/env python
import xmlrpclib,pprint
server =3D
xmlrpclib.Server('http://awilliam:*****@gourd-amber/zidestore/so/awilliam/'=
)
pprint.pprint(server.zogi.getObjectById(115100, 4096))
And get all the tasks for project 115100, in the _TASKS key.
--=-K7zbKRB4+LCzfnpLfVi8
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQBFyy0rLRePpNle04MRAkkeAJ42aWqsZl77p2TKUNWT95b1gtLMEwCfbA8s
oSsvBhG41R4m6aPHvHXeoog=
=ztoJ
-----END PGP SIGNATURE-----
--=-K7zbKRB4+LCzfnpLfVi8--