[OGo-Users] can't search for "my contacts"

Adam Tauno Williams users@opengroupware.org
Wed, 17 Oct 2007 10:50:52 -0400


--=-H6edwUJJDwVBjDFOPmmh
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

> Using svn2041 a contact "advanced search" for "My Contacts" or "Created=20
> by me" returns nothing. Am I supposed to enter a pattern in addition to=20
> checking theses boxes?

Hrm,  just checking "Created by me" results in a query like:
SELECT DISTINCT t1.company_id FROM  person t1 WHERE 1=3D2
Which obviously returns nothing.  "My Contacts" does the same thing.
Seems kind of brain damaged.

Perhaps these values (limitByOwner, limitByContact) aren't bound to code
anywhere (LSWPersonAdvancedSearch.m)?  Please file a bug report.

> I just want ogo to return a list of all my contacts for import into=20
> another software. How should I do that?

If you actually want to export port them to some kind of file this
should be pretty simple from a scripting language like Python.

#!/usr/bin/env python
import xmlrpclib

server =3D
  xmlrpclib.Server('http://{USER}:{PASS}@{HOST}/zidestore/so/{USER}/')
criteria =3D { }
criteria['conjunction'] =3D 'AND'
criteria['key'] =3D 'ownerObjectId'
criteria['value'] =3D 10100
criteria['expression'] =3D 'EQUALS'
query =3D [ criteria ]
flags =3D { 'limit' : 2 }
result =3D server.zogi.searchForObjects('Contact', query, 32768, flags)
for contact in result:
  print "ObjectId#%d (%s, %s)" % (
    contact['objectId'],
    contact['lastName'],
    contact['firstName'])

Then you can generate whatever kind of format file the other software
package needs.



--=-H6edwUJJDwVBjDFOPmmh
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)

iD8DBQBHFiFMLRePpNle04MRAm8CAJ43vmJ30CQviX4CHFfkpSOhzDrQugCfVXKB
4duwwPsu1x30LTQH6ry0Zj4=
=MXrm
-----END PGP SIGNATURE-----

--=-H6edwUJJDwVBjDFOPmmh--