[sugar] Journal Object metadata

Bert Freudenberg bert at freudenbergs.de
Sat Mar 1 07:12:15 EST 2008


On Mar 1, 2008, at 6:44 , Benjamin M. Schwartz wrote:

> I have read all the documents I could find, and also the Sugar  
> source, and
> I am still confused:
>
> How can an activity get an object representing all the metadata for  
> its
> current datastore object?
>
> I ask because I am writing a trivial "Distribute" Activity, whose  
> purpose
> is to copy journal entries from one XO to another by sharing.  This is
> working, but since the copy does not have any metadata, like MIME  
> type, it
> cannot be opened from the Journal interface by any Activity except
> Distribute, which created it.
>
> Ideally, I would like to acquire the metadata as a dbus object, so  
> that I
> may simply shove it over a DBus Tube and then pass it on to the  
> receiver's
> datastore.

I'm not entirely sure what you are asking. All meta data for a  
datastore object is retrieved by the get_properties(object_id) call,  
the associated file (if any) by get_filename(object_id). This is  
documented at

	http://wiki.laptop.org/go/Low-level_Activity_API#Datastore

Anyway, get_properties() returns a DBus dictionary with all the  
metadata, that should be trivial to send on via a DBus tube.

There is no such thing as an activity's "current datastore object",  
at least as far as Sugar is concerned. Each activity holds onto its  
own current object_id, it's up to the activity how to do that. Your  
activity would presumably open one or more datastore entries, without  
it becoming its "current" object, right?

- Bert -




More information about the Sugar mailing list