Discussion:
[turba] Managing Turba objects
Luca Bertoncello
2018-07-15 16:44:20 UTC
Permalink
Hi list!

Since I have the problem to manage vCards with many attributes, that Horde
does __NOT__ manage, I decided to write a little PHP-Script to sync data
between Horde and DAV, maintaining the extra attributes on the DAV-Server.

Well, I wrote the script and I can test it with some files, but now I need to
continue my work using the contacts I saved in Horde.

Unfortunately I really can't understand how to manage the contacts... :(
The functions are mostly uncommented, no words about Objects, API and so on,
no downloadable API documentation (all links redirect to download of the
source code?!?).
The Horde-Framework is really complex, and I can't invest two months to try
understanding how it works without any documentation...

So my question: can someone help me?

I need:
- searching for a Turba Object
- save an object (new one or already present)
- delete an object
- load an object
- parse the object
- retrieve a vCard of the object

Thanks a lot for all can help me with example, docs and encouragement... ;)
I'll send the script the ML as OpenSource as soon it will be complete and
almost tested.

Bye
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Sebastian Birnbach
2018-07-15 20:38:20 UTC
Permalink
Luca,

I share your grief with hard-to-get Horde documentation - at large.
In this case, however, all the information you need seems to be readily
available:
https://fossies.org/dox/horde-groupware-5.2.22/classTurba__Api.html
The fossies server is of course just for showing off the doxygen tool. You
probably want to start with building your local documentation for whichever
Horde version you have.

Good luck to you

birnbacs
Post by Luca Bertoncello
Hi list!
Since I have the problem to manage vCards with many attributes, that Horde
does __NOT__ manage, I decided to write a little PHP-Script to sync data
between Horde and DAV, maintaining the extra attributes on the DAV-Server.
Well, I wrote the script and I can test it with some files, but now I need to
continue my work using the contacts I saved in Horde.
Unfortunately I really can't understand how to manage the contacts... :(
The functions are mostly uncommented, no words about Objects, API and so on,
no downloadable API documentation (all links redirect to download of the
source code?!?).
The Horde-Framework is really complex, and I can't invest two months to try
understanding how it works without any documentation...
So my question: can someone help me?
- searching for a Turba Object
- save an object (new one or already present)
- delete an object
- load an object
- parse the object
- retrieve a vCard of the object
Thanks a lot for all can help me with example, docs and encouragement... ;)
I'll send the script the ML as OpenSource as soon it will be complete and
almost tested.
Bye
Luca Bertoncello
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Luca Bertoncello
2018-07-16 11:29:40 UTC
Permalink
Zitat von Sebastian Birnbach <***@gmail.com>:

Hi Sebastian,
Post by Sebastian Birnbach
I share your grief with hard-to-get Horde documentation - at large.
In this case, however, all the information you need seems to be readily
https://fossies.org/dox/horde-groupware-5.2.22/classTurba__Api.html
The fossies server is of course just for showing off the doxygen tool. You
probably want to start with building your local documentation for whichever
Horde version you have.
Thank you very much for your answer.

Maybe can you help me again...

I wrote a little test script to retrieve all contacts in an addressbook.
Problem: I can only get some data using:

$results = $registry->call('contacts/listUids', array('sources' =>
array('wwjt5jzQBHOo8sUGli7BkdQ')));

But so I get a list of UIDs...
Unfortunately, to get the contact data I need the "objectId", not the
"objectUid", and I didn't found any function to convert it or to
search the contacts using the UID...
Do you have a suggestion what can I do?

My little code:

$results = $registry->call('contacts/listUids', array('sources' =>
array('wwjt5jzQBHOo8sUGli7BkdQ')));
foreach($results as $r)
{
$x = $registry->call('contacts/getContact', array('source' =>
'wwjt5jzQBHOo8sUGli7BkdQ', 'objectUid' => $r));
}

What works is:

$x = $registry->call('contacts/getContact', array('source' =>
'wwjt5jzQBHOo8sUGli7BkdQ', 'objectId' => '29dx3S0htUR7YLA6o3cnquN'));

the last parameter is the objectId of the contact, but I can't "find"
it using the API...

Thanks for your help!
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Michael J Rubinsky
2018-07-16 12:04:55 UTC
Permalink
Post by Luca Bertoncello
Hi Sebastian,
Post by Sebastian Birnbach
I share your grief with hard-to-get Horde documentation - at large.
In this case, however, all the information you need seems to be readily
https://fossies.org/dox/horde-groupware-5.2.22/classTurba__Api.html
The fossies server is of course just for showing off the doxygen tool. You
probably want to start with building your local documentation for whichever
Horde version you have.
Thank you very much for your answer.
Maybe can you help me again...
I wrote a little test script to retrieve all contacts in an addressbook.
$results = $registry->call('contacts/listUids', array('sources' =>
array('wwjt5jzQBHOo8sUGli7BkdQ')));
But so I get a list of UIDs...
Unfortunately, to get the contact data I need the "objectId", not
the "objectUid", and I didn't found any function to convert it or to
search the contacts using the UID...
Do you have a suggestion what can I do?
$results = $registry->call('contacts/listUids', array('sources' =>
array('wwjt5jzQBHOo8sUGli7BkdQ')));
foreach($results as $r)
{
$x = $registry->call('contacts/getContact', array('source' =>
'wwjt5jzQBHOo8sUGli7BkdQ', 'objectUid' => $r));
}
$x = $registry->call('contacts/getContact', array('source' =>
'wwjt5jzQBHOo8sUGli7BkdQ', 'objectId' => '29dx3S0htUR7YLA6o3cnquN'));
the last parameter is the objectId of the contact, but I can't
"find" it using the API...
Use can use either contacts/getContacts (note the plural) to retrieve
all contacts from a single source, OR you can use contacts/export to
get a contact by UID - set $contentType to 'array' to retrieve a hash
of contact properties - unless of course you want one of the other
formats.
Post by Luca Bertoncello
Thanks for your help!
Luca Bertoncello
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
--
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
Luca Bertoncello
2018-07-16 12:22:22 UTC
Permalink
Zitat von Michael J Rubinsky <***@horde.org>:

Hi Michael,
Post by Michael J Rubinsky
Use can use either contacts/getContacts (note the plural) to
retrieve all contacts from a single source, OR you can use
contacts/export to get a contact by UID - set $contentType to
'array' to retrieve a hash of contact properties - unless of course
you want one of the other formats.
Ach! Now it works!!!

Thanks a lot!
Now I can continue my script!

Regards
Luca Bertoncello
(***@lucabert.de)
--
turba mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: turba-***@lists.horde.org
Loading...