EventsSpec

Contents

  1. Events stored by Ubuntu One into Zeitgest
    1. Directory Synchronization
      1. Directory was created locally, syncdaemon creating it on the server
      2. Directory was created on the server, syncdaemon creating it locally
      3. Directory was deleted locally, syncdaemon deleting it on the server
      4. Directory was deleted on the server, syncdaemon deleting it locally
      5. Directory synchronization conflict
    2. File Synchronization
      1. File was created locally, syncdaemon creating on the server
      2. File was created on the server, syncdaemon creating locally
      3. File was deleted locally, syncdaemon deleting on the server
      4. File was deleted on the server, syncdaemon deleting locally
      5. File was modified locally, syncdaemon updating it at the server
      6. File was modified on the server, syncdaemon updating it locally
      7. File synchronization conflict
    3. Folder Sharing
      1. Folder was shared by the user to another user
      2. Shared Folder was deleted by local user
      3. Folder was offered by another user
      4. Folder offered by another user was rejected by the local user
      5. Folder offered by another user was accepted by the local user
      6. Folder offered by another user was unaccepted (so it won't sync anymore) by the local user
    4. User Defined Folders (UDFs)
      1. The user created a UDF
      2. The user deleted a UDF
      3. The user subscribed to a UDF
      4. The user subscribed to a UDF which folder already existed in the local disk (notify that folder content will be merged)
      5. The user unsubscribed from a UDF
    5. Publishing
      1. File was published by the user
      2. File was unpublished by the user
    6. Quota notifications from the server
      1. Current user ran out of quota
      2. Folder shared by another user ran out of quota
    7. CouchDB replication events
      1. A given Couch database was synchronized with other host
    8. Tomboy replication events
      1. A given Tomboy note was synchronized with the server
    9. Music store transactions
      1. A media file was synchronized
    10. Account status events
      1. The user subscription was renewed
      2. The subscription expired

Events stored by Ubuntu One into Zeitgest

This is a spec of the events that will be stored in Zeitgeist by Ubuntu One.

All the following events have in common the "timestamp" and the "actor" fields. The latter is set to "dbus://com.ubuntuone.SyncDaemon.service" for File Synchronization, Folder Sharing, Publishing and Quota events.

Directory Synchronization

Directories will have "inode/directory" set as the mimetype.

Warning /!\ The volume_uuid is not yet stored into zeitgeist; a cursory glance shows that all zeitgeist data provider put an empty string in this fiels. Ideally it should be the uuid of the local hard disk partition where the referenced folders or files are located.

Directory was created locally, syncdaemon creating it on the server

  • directory = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=REMOTE_DATA_OBJECT, origin="file:///local_path", storage="net")

  • Event(interpretation=CREATE_EVENT, manifestation=SCHEDULED_ACTIVITY, subjects=[directory])

Directory was created on the server, syncdaemon creating it locally

  • directory = Subject(uri="file:///local_path", interpretation=FOLDER, manifestation=FILE_DATA_OBJECT, origin="ubuntuone:uuid", storage=volume_uuid)

  • Event(interpretation=CREATE_EVENT, manifestation=WORLD_ACTIVITY, subjects=[directory])

Directory was deleted locally, syncdaemon deleting it on the server

  • directory = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=DELETED_RESOURCE, origin="file:///local_path", storage="deleted")

  • Event(interpretation=DELETE_EVENT, manifestation=SCHEDULED_ACTIVITY, subjects=[directory])

    Info (!) Beware that Zeitgeist does not currently have a 100% satisfactory way of dealing with deletions and there may be some changes to this in the short- to mid term future. That said I think the treatment described here makes sense -- kamstrup 2010-11-23 19:35:36

Directory was deleted on the server, syncdaemon deleting it locally

  • directory = Subject(uri="file:///local_path", interpretation=FOLDER, manifestation=DELETED_RESOURCE, origin="ubuntuone:uuid", storage="deleted")

  • Event(interpretation=DELETE_EVENT, manifestation=WORLD_ACTIVITY, subjects=[directory])

Directory synchronization conflict

A synchronization conflict renames a local directory with a ".u1conflict" extension.

  • local_directory = Subject(uri="file:///local_path.u1conflict", interpretation=FOLDER, manifestation=FILE_DATA_OBJECT, origin="file:///local_path", storage=volume_uuid)

  • Event(interpretation="u1://ConflictRename", manifestation=WORLD_ACTIVITY, subjects=[local_directory])

File Synchronization

The file interpretation is always got from the file's mimetype, by using zeitgeist.mimetype.get_interpretation_for_mimetype()

File was created locally, syncdaemon creating on the server

  • file = Subject(uri="ubuntuone:uuid", manifestation=REMOTE_DATA_OBJECT, origin="file:///local_path", storage="net")

  • Event(interpretation=CREATE_EVENT, manifestation=SCHEDULED_ACTIVITY, subjects=[file])

File was created on the server, syncdaemon creating locally

  • file = Subject(uri="file:///local_path", manifestation=FILE_DATA_OBJECT, origin="ubuntuone:uuid", storage=volume_uuid)

  • Event(interpretation=CREATE_EVENT, manifestation=WORLD_ACTIVITY, subjects=[file])

File was deleted locally, syncdaemon deleting on the server

  • file = Subject(uri="ubuntuone:uuid", manifestation=DELETED_RESOURCE, origin="file:///local_path", storage="deleted")

  • Event(interpretation=DELETE_EVENT, manifestation=SCHEDULED_ACTIVITY, subjects=[file])

File was deleted on the server, syncdaemon deleting locally

  • file = Subject(uri="file:///local_path", manifestation=DELETED_RESOURCE, origin="ubuntuone:uuid", storage="deleted")

  • Event(interpretation=DELETE_EVENT, manifestation=WORLD_ACTIVITY, subjects=[file])

File was modified locally, syncdaemon updating it at the server

  • file = Subject(uri="ubuntuone:uuid", manifestation=REMOTE_DATA_OBJECT, origin="file:///local_path", storage="net")

  • Event(interpretation=MODIFY_EVENT, manifestation=SCHEDULED_ACTIVITY, subjects=[file])

File was modified on the server, syncdaemon updating it locally

  • file = Subject(uri="file:///local_path", manifestation=FILE_DATA_OBJECT, origin="ubuntuone:uuid", storage=volume_uuid)

  • Event(interpretation=MODIFY_EVENT, manifestation=WORLD_ACTIVITY, subjects=[file])

File synchronization conflict

A synchronization conflict renames a local file with a ".u1conflict" extension.

  • local_file = Subject(uri="file:///local_path.u1conflict", manifestation=FILE_DATA_OBJECT, origin="file:///local_path", storage=volume_uuid)

  • Event(interpretation="u1://ConflictRename", manifestation=WORLD_ACTIVITY, subjects=[local_file])

    Info (!) If you are in need of custom events please take it up with the Zeitgeist team. If we include them properly in the ontologies they will integrate well with our type-hierarchy-aware query system -- kamstrup 2010-11-23 19:35:36

Folder Sharing

NOTE: there's no appropriate subject interpretation defined in zeitgeist for a remote user or contact. The Zeitgeist telepathy plugin currently uses the freeform text field on the subject. We suggest instead creating a new subject interpretation named Contact and a subject manifestation named ContactDataObject, as used below.

  • Info (!) There are already a few contact/people ontologies we can choose to adapt for Zeitgeist. But note that we intentionally avoided the Nepomuk PIM ontology because it was simply to massively scoped for our taste -- kamstrup 2010-11-23 19:35:36

Folder was shared by the user to another user

  • folder = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=REMOTE_DATA_OBJECT, origin="file:///local_path", storage="net")

  • other_user = Subject(uri="mailto:user_email", interpretation=u1://Contact, manifestation=u1://ContactDataObject, origin=N/A, storage=N/A)

  • Event(interpretation="u1://FolderShared", manifestation=USER_ACTIVITY, subjects=[folder, other_user])

Shared Folder was deleted by local user

  • folder = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=REMOTE_DATA_OBJECT, origin="file:///local_path", storage="net")

  • other_user = Subject(uri="mailto:user_email", interpretation=u1://Contact, manifestation=u1://ContactDataObject, origin=N/A, storage=N/A)

  • Event(interpretation="u1://FolderUnshared", manifestation=USER_ACTIVITY, subjects=[folder, other_user])

Folder was offered by another user

(X) Not implemented: Never happens when sharing by email (only by username)

Folder offered by another user was rejected by the local user

(X) Not implemented: There's no UI action to reject shares, only one button to accept them.

Folder offered by another user was accepted by the local user

  • folder = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=REMOTE_DATA_OBJECT, origin="ubuntuone:uuid", storage="net", text="other_user_email")
  • Event(interpretation="u1://ShareAccepted", manifestation=USER_ACTIVITY, subjects=[folder])

Folder offered by another user was unaccepted (so it won't sync anymore) by the local user

  • folder = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=REMOTE_DATA_OBJECT, origin="ubuntuone:uuid", storage="net", text="other_user_email")
  • Event(interpretation="u1://ShareUnaccepted", manifestation=USER_ACTIVITY, subjects=[folder])

User Defined Folders (UDFs)

The user created a UDF

  • folder = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=REMOTE_DATA_OBJECT, origin="file://localpath", storage="net")

  • Event(interpretation="u1://UserFolderCreated", manifestation=USER_ACTIVITY, subjects=[folder])

The user deleted a UDF

  • folder = Subject(uri="ubuntuone:uuid", interpretation=FOLDER, manifestation=DELETED_RESOURCE, origin="file://localpath", storage="deleted")

  • Event(interpretation="u1://UserFolderDeleted", manifestation=USER_ACTIVITY, subjects=[folder])

The user subscribed to a UDF

  • folder = Subject(uri="file://localpath", interpretation=FOLDER, manifestation=FILE_DATA_OBJECT, origin="ubuntuone:uuid", storage=volume_uuid)

  • Event(interpretation="u1://UserFolderSubscribed", manifestation=USER_ACTIVITY, subjects=[folder])

The user subscribed to a UDF which folder already existed in the local disk (notify that folder content will be merged)

(X) Not implemented yet

The user unsubscribed from a UDF

  • folder = Subject(uri="file://localpath", interpretation=FOLDER, manifestation=DELETED_RESOURCE, origin="ubuntuone:uuid", storage="deleted")

  • Event(interpretation="u1://UserFolderUnsubscribed", manifestation=USER_ACTIVITY, subjects=[folder])

Publishing

File was published by the user

  • file = Subject(uri="http://ubuntuone.com/p/newfile.txt", manifestation=REMOTE_DATA_OBJECT, origin="ubuntuone:uuid", storage="net")

  • Event(interpretation=CREATE_EVENT, manifestation=USER_ACTIVITY, subjects=[file])

File was unpublished by the user

  • file = Subject(uri="http://ubuntuone.com/p/newfile.txt", manifestation=DELETED_RESOURCE, origin="ubuntuone:uuid", storage="deleted")

  • Event(interpretation=DELETE_EVENT, manifestation=USER_ACTIVITY, subjects=[file])

Quota notifications from the server

NOTE: Should we add new event types here?

Current user ran out of quota

Syncdaemon found out about this while uploading file

  • remaining space

(X) Not implemented yet

Folder shared by another user ran out of quota

Syncdaemon found out about this while uploading file

  • remaining space
  • other_user

(X) Not implemented yet

CouchDB replication events

The "actor" field is set to "dbus://org.desktopcouch.CouchDB.service"

A given Couch database was synchronized with other host

  • remote_database = Subject(uri="http://remote_host/path/db", interpretation=DOCUMENT, manifestation=REMOTE_DATA_OBJECT, origin="desktopcouch://localhost/~username/db", storage="net")

  • Event(interpretation="u1://DatabaseSynchronized", manifestation=SCHEDULED_ACTIVITY, subjects=[remote_database])

(X) Not implemented yet

Tomboy replication events

The "actor" field is set to "application://tomboy.desktop"

A given Tomboy note was synchronized with the server

  • Note title

(X) Not implemented yet

Music store transactions

The "actor" field is set to "application://Ubuntuone.rhythmbox-plugin.desktop" or "application://UbuntuOne.banshee-plugin.desktop" accordingly.

A media file was synchronized

  • file = Subject(uri="file:///local_path", manifestation=FILE_DATA_OBJECT, origin="ubuntuone:uuid", storage=volume_uuid, text="artist/album/title")

  • Event(interpretation=CREATE_EVENT, manifestation=WORLD_ACTIVITY, subjects=[file])

(X) Not implemented yet

Account status events

(Implementing this requires account status events that are not sent from the server yet)

NOTE: Just like Quota: Should we add new event types here?

The user subscription was renewed

(X) Not implemented yet

The subscription expired

(X) Not implemented yet


UbuntuOne/Specs/ZeitgeistIntegration

UbuntuOne/Specs/ZeitgeistIntegration/EventsSpec (last edited 2010-12-17 16:17:49 by alecu)