~jamalta/zeitgeist-project-website/new-content

« back to all changes in this revision

Viewing changes to static/docs/0.3.2/_sources/dbus_api.txt

  • Committer: zeitgeist
  • Date: 2010-01-26 17:13:35 UTC
  • Revision ID: zeitgeist@red1-20100126171335-sbexi3tcltqbqebi
added docs for 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. module:: _zeitgeist.engine.remote
 
2
 
 
3
========
 
4
DBus API
 
5
========
 
6
 
 
7
This is the raw DBus API for the Zeitgeist engine. Applications written in
 
8
Python are encouraged to use the
 
9
:class:`ZeitgeistClient <zeitgeist.client.ZeitgeistClient>` API instead.
 
10
 
 
11
.. _event_serialization_format:
 
12
.. index:: Event Serialization Format
 
13
 
 
14
Event Serialization Format
 
15
++++++++++++++++++++++++++
 
16
 
 
17
The wire representation of events is central to the DBus API of the
 
18
Zeitgeist engine. An event has DBus signature :const:`asaasay`. The
 
19
Python client library includes an :class:`Event <zeitgeist.datamodel.Event>`
 
20
class that conforms, without manual mashalling, to the DBus wire format
 
21
described here.
 
22
 
 
23
The first array of strings, :const:`as`, contains the `event metadata` at the
 
24
following offsets:
 
25
 
 
26
 0. Event id, which is guaranteed to be an unsigned integer. Applications
 
27
    must never set this field, it is an error to do so. The field will be
 
28
    filled out when you ask for events from the Zeitgeist engine.
 
29
 1. Timestamp in milliseconds since the Unix Epoch
 
30
 2. Interpretation - the abstract notion of "what happened" defined by a formal
 
31
    URI. There is a predefined set of event interpretations in the
 
32
    :class:`zeitgeist.datamodel.Interpretation` class
 
33
 3. Manifestation - the abstract notion of "how did this happen" defined by a
 
34
    formal URI. There is a predefined set of event manifestations in the
 
35
    :class:`zeitgeist.datamodel.Manifestation` class
 
36
 4. Actor - a URI defining the entity spawning the event. In most cases this
 
37
    will be an application. The URI of an application is defined as
 
38
    the :const:`app://` URI-scheme with the base filename of the application's
 
39
    .desktop file (with the extension). Fx
 
40
    Firefox with .desktop file :const:`/usr/share/applications/firefox.desktop`
 
41
    will have an actor URI of :const:`app://firefox.desktop`.
 
42
     
 
43
The second component in the event datastructure is the `list of subjects`,
 
44
:const:`aas`, each subject being an :const:`as`. Note that an event can have
 
45
more than one subject - fx. when deleting a collection of files with one
 
46
click in the file manager. The subject metadata is defined
 
47
with the following offsets:
 
48
 
 
49
 0. URI - eg. :const:`http://example.com/myfile.pdf` or :const:`file:///tmp/my.txt`
 
50
 1. Interpretation - the abstract notion of what the subject is,
 
51
    eg. "this is a document" or "this is an image". The interpretation is formally
 
52
    represented by a URI. The :class:`zeitgeist.datamodel.Interpretation` class
 
53
    contains a collection of predefined subject interpretations. It is
 
54
    otherwise recommended to use 
 
55
    `Nepomuk Information Elements <http://www.semanticdesktop.org/ontologies/nie/#InformationElement>`_
 
56
    to describe subject interpretations.
 
57
 2. Manifestation - the abstract notion of how the subject is stored or available,
 
58
    eg. "this is file" or "this is a webpage". The manifestation is formally
 
59
    represented by a URI. The :class:`zeitgeist.datamodel.Manifestation` class
 
60
    contains a collection of predefined subject manifestations. It is
 
61
    otherwise recommended to use 
 
62
    `Nepomuk Data Objects <http://www.semanticdesktop.org/ontologies/nie/#DataObject>`_
 
63
    to describe subject manifestations.
 
64
 3. Origin - the URI where the user accessed the subject from
 
65
 4. Mimetype - The mimetype of the subject, eg. :const:`text/plain`
 
66
 5. Text - A short textual representation of the subject suitable for display
 
67
 6. Storage - the id storage device the subject is. For files this would be
 
68
    the UUID of the volume, for subjects requiring a network interface use the
 
69
    string "net". If the subject has been deleted use the string "deleted".
 
70
    The storage id of the subject is used internally in the
 
71
    Zeitgeist engine to keep track of subject availability. This way clients
 
72
    can request hits only on subjects that are currently available.
 
73
 
 
74
The third an last component of the event data structure is an array of bytes,
 
75
:const:`ay`, called the `payload`. The payload can be used to hold any kind of
 
76
free form data and its intent and purpose is entirely up to the entity inserting
 
77
the event into the log.
 
78
 
 
79
.. index:: org.gnome.zeitgeist.Log
 
80
 
 
81
org.gnome.zeitgeist.Log
 
82
+++++++++++++++++++++++
 
83
 
 
84
.. autoclass:: RemoteInterface
 
85
    :members: InsertEvents, GetEvents, FindEventIds, FindRelatedUris, DeleteEvents, DeleteLog, Quit, InstallMonitor, RemoveMonitor
 
86
 
 
87
.. _org_gnome_zeitgeist_Monitor:
 
88
.. index:: org.gnome.zeitgeist.Monitor
 
89
 
 
90
org.gnome.zeitgeist.Monitor
 
91
+++++++++++++++++++++++++++
 
92
 
 
93
.. autoclass:: zeitgeist.client.Monitor
 
94
    :members: NotifyInsert, NotifyDelete
 
95
    
 
96
.. _org_gnome_zeitgeist_Blacklist:
 
97
.. index:: org.gnome.zeitgeist.Blacklist
 
98
 
 
99
org.gnome.zeitgeist.Blacklist
 
100
+++++++++++++++++++++++++++++
 
101
 
 
102
.. autoclass:: _zeitgeist.engine.extensions.blacklist.Blacklist
 
103
    :members: SetBlacklist, GetBlacklist