[OGo-Developer] Object Properties Question
Helge Hess
developer@opengroupware.org
Fri, 9 Feb 2007 11:52:30 +0100
On Feb 9, 2007, at 05:17, Adam Tauno Williams wrote:
> I can get a dictionary of object properties using -
> [[[self getCTX] propertyManager] propertiesForGlobalID:eo];
> - in which case the property name as in
> "{http://www.opengroupware.org/properties/ext-attr}Color" is the
> key and
> the value is the value (as in "Blue").
>
> However I would very much like to have the object property id (the
> obj_property_id column of obj_property) and the "preferredType" (the
> preferred_type column in obj_property). I see these attributes dealt
> with in the propertyManager (SkyObjectPropertyManager.m) but no way to
> get them.
Ahm, yes. Because those fields are internal. Properties are not
object but simple key=value pairs.
> The property id would provide a unique numeric id making it very
> easy to
> automatically map the data into a client-side database cache; I've
> been
> able to provide a numeric objectId for everything else in ZOGI.
I can't see why a name is any harder.
> The preferredType would be necessary for client applications to
> determine how to display/manage the property value. Otherwise it is
> impossible to tell a string from a BLOB encoded as a string, for
> instance.
Yes, properties do not have a type. However, when you retrieve a
property you can derive some information from the type of the value
object you got (NSData for blobs, NSNumber for numbers, NSString for
strings, etc).
Summary: works as expected ;-) Do not attempt to put more features
into properties, they are supposed to be the database equivalent of
property lists attached to an object.
Greets,
Helge
--
Helge Hess
http://www.helgehess.eu/