Journal entry bundles: Difference between revisions
(zeltrtrz) |
m (Reverted edits by 201.6.3.241 (Talk) to last version by Tomeu) |
||
Line 9: | Line 9: | ||
By bundling journal entries in single files, we can share entries between XO's and retrieve entries from the web (for example downloading from an http server that manages our backups). |
By bundling journal entries in single files, we can share entries between XO's and retrieve entries from the web (for example downloading from an http server that manages our backups). |
||
== Bundle Structure == |
|||
The journal entry bundle is a directory named after the original entry ID. Each activity bundle must contain a file named "_metadata.json", and following a special format. For example: |
|||
15b114ad-1eed-461f-9315-129bba41ce2d/ |
|||
_metadata.json |
|||
15b114ad-1eed-461f-9315-129bba41ce2d |
|||
preview/ |
|||
15b114ad-1eed-461f-9315-129bba41ce2d |
|||
; _metadata.json |
|||
Metadata is stored in this file as a [http://www.faqs.org/rfcs/rfc4627.html JSON-encoded] dictionary containing each property as a key-value pair: |
|||
{"activity_id":"67d38ab406143c6b6b023896e9efa8fc7706ff57", |
|||
"title_set_by_user":"0", |
|||
"uid":"15b114ad-1eed-461f-9315-129bba41ce2d", |
|||
"vid":"1.0", |
|||
"title":"Paint Activity", |
|||
"timestamp":"1192547469", |
|||
"activity":"org.laptop.Oficina", |
|||
"filename":"", |
|||
"icon-color":"#00588C,#00EA11", |
|||
"mtime":"2007-10-16T17:11:09", |
|||
"mountpoint":"18d7246f-72a4-4089-b7dc-2dbdf2b81aa6", |
|||
"keep":"0", |
|||
"mime_type":"image/png", |
|||
"preview":"15b114ad-1eed-461f-9315-129bba41ce2d"} |
|||
The <code>preview</code> property is an external property, and as such, its value is the name of a file inside a directory with the property name inside the bundle directory (<code>preview/15b114ad-1eed-461f-9315-129bba41ce2d</code>) |
|||
; 15b114ad-1eed-461f-9315-129bba41ce2d |
|||
File named following the ID of the original journal entry. Contains data opaque to the Journal in the format specified by the <code>mime_type</code> metadata property. |
|||
; preview |
|||
Directory containing a single file that in turn contains the data for that property. This is meant for external properties, which can include an amount of data bigger than what can be stored in the _metadata.json file. |
|||
== Package == |
== Package == |
Latest revision as of 06:57, 5 December 2008
Please copy/paste "{{Translationlist | xx | origlang=en | translated={{{translated}}}}}" (where xx is ISO 639 language code for your translation) to Journal entry bundles/translations | HowTo [ID# 184371] +/- |
Introduction
Entries in the Journal are composed by opaque data stored in one file and metadata properties about that data. For retrieving entries from one XO's Journal to another, all that information about an entry needs to be bundled in a single file. This file is called a 'journal entry bundle'.
Rationale
By bundling journal entries in single files, we can share entries between XO's and retrieve entries from the web (for example downloading from an http server that manages our backups).
Bundle Structure
The journal entry bundle is a directory named after the original entry ID. Each activity bundle must contain a file named "_metadata.json", and following a special format. For example:
15b114ad-1eed-461f-9315-129bba41ce2d/ _metadata.json 15b114ad-1eed-461f-9315-129bba41ce2d preview/ 15b114ad-1eed-461f-9315-129bba41ce2d
- _metadata.json
Metadata is stored in this file as a JSON-encoded dictionary containing each property as a key-value pair:
{"activity_id":"67d38ab406143c6b6b023896e9efa8fc7706ff57", "title_set_by_user":"0", "uid":"15b114ad-1eed-461f-9315-129bba41ce2d", "vid":"1.0", "title":"Paint Activity", "timestamp":"1192547469", "activity":"org.laptop.Oficina", "filename":"", "icon-color":"#00588C,#00EA11", "mtime":"2007-10-16T17:11:09", "mountpoint":"18d7246f-72a4-4089-b7dc-2dbdf2b81aa6", "keep":"0", "mime_type":"image/png", "preview":"15b114ad-1eed-461f-9315-129bba41ce2d"}
The preview
property is an external property, and as such, its value is the name of a file inside a directory with the property name inside the bundle directory (preview/15b114ad-1eed-461f-9315-129bba41ce2d
)
- 15b114ad-1eed-461f-9315-129bba41ce2d
File named following the ID of the original journal entry. Contains data opaque to the Journal in the format specified by the mime_type
metadata property.
- preview
Directory containing a single file that in turn contains the data for that property. This is meant for external properties, which can include an amount of data bigger than what can be stored in the _metadata.json file.
Package
Journal entry bundles should be packaged as zip files with the ".xoj" extension. The mime type of the file is 'application/vnd.olpc-journal-entry'.