[#8338] missing 'uid' in turba_browse
Summary missing 'uid' in turba_browse
Queue Turba
Queue Version 2.3.1
Type Bug
State Not A Bug
Priority 2. Medium
Owners jan@horde.org
Requester rpolli@babel.it
Created 2009-06-10 (3749 days ago)
Due
Updated 2009-08-13 (3685 days ago)
Assigned 2009-06-12 (3747 days ago)
Resolved 2009-06-12 (3747 days ago)
Milestone
Patch No

Comments
rpolli@babel.it 2009-06-10 12:30:37
missing 'uid' in turba_browse properties.

note: if contact->getValue issues a call instead of a simple attribute 
retrieval from an object, it could be optimized with a function like:

if  ! defined(item[guid]):

    item[guid] = item.getValue('_uid')



return item[guid]



Patch follows. The same in kronolith and maybe in all other modules...



@@ -580,6 +584,9 @@

              if (in_array('created', $properties)) {

                  $results[$key]['created'] = 
_turba_getActionTimestamp($contact->getValue('__uid'), 'add');

              }

+           if (in_array('uid', $properties)) { // rpolli .,+2

+               $results[$key]['uid'] = $contact->getValue('__uid');

+           }

          }



          return $results;



Chuck Hagenbuch <chuck@horde.org> 2009-06-12 15:41:54
When you say missing, what would mean that the UID should be present 
here? I don't know what it would mean for webdav, for example, and I 
don't see it in any of our other _browse method implementations.

rpolli@babel.it 2009-06-12 18:03:21
> When you say missing, what would mean that the UID should be present

> here?

yes. As the calendar.import method returns the UID of the item, it's 
an important information to retrieve.



> I don't know what it would mean for webdav, for example, and I

> don't see it in any of our other _browse method implementations.

uid should be return on demand, not by default, like the "modified", 
"created" fields..

let me know if you need some examples..









Chuck Hagenbuch <chuck@horde.org> 2009-06-12 21:05:21
Jan, am I missing something here?



Also, what relevance do the calendar methods have to the Turba 
(address book) API? Though all the _browse ones should be as 
consistent as possible...

Jan Schneider <jan@horde.org> 2009-06-12 21:11:42
The purpose of the browse methods is to provide directory-like listing 
for directory services like WebDAV, obrowser, etc. Objects are 
identified by their IDs, not their UIDs in those contexts. It's *not* 
there to list complete objects, use the list* and export methods for 
that.

rpolli@babel.it 2009-06-14 09:37:55
> Objects

> are identified by their IDs, not their UIDs in those contexts.

so, is there a way to retrieve objects data by ID? (ex. export, 
getActionTimestamp, ..)

All webservice methods are UID-oriented but this one..to me it's quite 
confusing :)



Thx for your time,

R.





Jan Schneider <jan@horde.org> 2009-06-16 10:22:06
It's confusing because there are currently two ways to identify and 
retrieve objects, for historical reasons. UIDs are used for any 
synchronization purposes i.e. for external data exchange, IDs are used 
for internal exchange.

rpolli@babel.it 2009-06-16 10:48:51
> It's confusing because there are currently two ways to identify and

> retrieve objects, for historical reasons.

are you going to leave one out in future releases?



> UIDs are used for any

> synchronization purposes i.e. for external data exchange,

so why not to expose methods to show a map of <uid, ..properties..> ?

It enables webservices to be a replacement of sql access.



if I create a cached browser for horde contacts/calendar, I got 
browsing data <Id, modified, ..> but when i insert an item, the ws 
returns the uid..

As cache checks etag/timestamp to (in)validate the item, actual horde 
ws behavior makes impossible to create a "fast" cache, forcing to 
continuously use getActionTimestamp on each item (with the overhead 
due to the amount of ws call - about 1sec each).



> IDs are used for internal exchange.

and webdav



Thx,

R.

turbagurl@hotmail.com 2009-08-13 13:30:59
we r missing inbox mail for the other broswer