Journal Entries: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Created page with '=Introduction= A Journal entry the metadata (e.g. decription, title, tags, color) and optionally a preview. Furthermore an entry contains of a data file in most of the cases. For…')
 
(new place of storage directory)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>{{TOCright}}
=Introduction=
[[Category:Journal]]
A Journal entry the metadata (e.g. decription, title, tags, color) and optionally a preview. Furthermore an entry contains of a data file in most of the cases. For example a .odt file in Write. The entry for a Memorize Game has no file associated with it, only the metadata and a preview (there is no state saved).
</noinclude>
<big><big>Introduction</big></big>


A Journal entry contains metadata (e.g. decription, title, tags, color) and optionally a preview. Furthermore an entry contains a data file in most of the cases. For example a ''.odt'' file in Write. Another example is an entry of a Memorize Game that has no file associated with it, only the metadata and a preview (there is no state saved).
In 0.82 when you copied a Journal entry to a storage device (e.g. USB) the files where stored in the root directory of the device and the metadata and preview was stored in a hidden folder called .olpc.store. You can that go to another machine and copy those entries over or use the stick as backup and copy back the entries to your Journal later. The entries on the device do have the color of the creator of the entries. Other files on the stick are shown in black and white.

In 0.82 when you copied a Journal entry to a storage device (e.g. USB) the files where stored in the root directory of the device and the metadata and preview was stored in a hidden folder called ''.olpc.store''. You could then go to another machine and copy those entries over or use the stick as backup and copy back the entries to your Journal later. The entries on the device did have the color of the creator of the entries. Other files on the stick were shown in black and white.


The datastore has changed significantly from 0.82 to 0.84 and therefore the old entries are not handled by the new datastore. Furthermore the copying to a storage device did only copy the data file over and the metadata and preview were omitted.
The datastore has changed significantly from 0.82 to 0.84 and therefore the old entries are not handled by the new datastore. Furthermore the copying to a storage device did only copy the data file over and the metadata and preview were omitted.


The new patches in [http://dev.laptop.org/ticket/9657 9657] and [http://dev.laptop.org/ticket/9658 9658] do handle now both cases. Details below.

==Convert Journal entries that have been saved to a storage device in 0.82==
In 10.1.2 the new Journal can not read Journal entries that have been saved to a storage device (e.g. USB key).
==Sharing/Backup Journal entries using a storage device [http://dev.laptop.org/ticket/9657 9657]==
The new code will store the metadata and preview in a hidden folder like in 0.82. The folder will be named ''.Sugar_Metadata''. There will be two files per entry, one for the metadata named ''filename''.metadata and one for the preview (if exists) named ''filename''.preview. The data files will be stored in the root folder of the device. Like in 0.82 the entries will be colored in the creator's color.

Note: Entries that do not contain a data file can not be copied to a storage device anymore in 0.84 (this was possible in 0.82), an alert is displayed to the learner in those cases. This change has been independent of these patches.

The code is written defensive. If the metadata/preview is corrupted or has been removed it will be skipped, so the deletion of a data file on the device is handled gracefully.

The learner has now the options to: backup the Journal entry to a storage device and copy it back to his own Journal later, share his entry with another learner over a storage device and use the file on a non Sugar machine (showing a picture to your friend on his computer).

==Convert Journal entries that have been saved to a storage device in 0.82 [http://dev.laptop.org/ticket/9658 9658] ==
This code will convert the old Journal entries to the new scheme described above. When a device containing a folder ''.olpc.store'' is plugged into the machine the conversion will happen automatically in the background. Files that have the metadata converted already from a previous run will be omitted from the conversion. The ''.olpc.store'' won't be removed after completion to be able to restore if anything goes wrong during conversion.

Note: Entries that do not contain a data file can not be copied to a storage device anymore in 0.84 (this was possible in 0.82), for code simplification we do not restore those entries from 0.82.

The conversion code is written defensive. If an entry can not be converted it will be skipped, if the database is broken the conversion is skipped etc. So the deletion of a data file on the device or any corruption to the ''.olpc.store'' should not cause a crash to Sugar.

==How to test==
You can test it with a latest [http://build.laptop.org/10.1.3/ 10.1.3] build. For now you need to install a patched rpm from [http://dev.laptop.org/~erikos/F11_rpms/sugar-0.84.25-2.fc11.i586.rpm sugar-0.84.25-2.fc11.i586.rpm]. We are interested particularly in the conversion of 0.82 entries. You can get a 0.82 image from [http://download.laptop.org/xo-1/custom/g1g1/gg-802-1/ gg-802-1].


==New place of datastore==
/home/olpc/.sugar/default/datastore/store
[http://wiki.laptop.org/go/Journal_Activity#Datastore]

==Pictures==
[[File:.olpc.store.png|thumb|none|800px|The .olpc.store folder containing the converted file.]]


[[File:.Sugar_metadata.png|thumb|none|800px|The .Sugar_metadata folder with the metadata and preview files for each entry.]]
We have added now code that converts those entries to a
http://dev.laptop.org/ticket/9658


[[File:Journal_Entries.png|thumb|none|800px|The view of a storage device containing Journal entries of to different users.]]
== ==
Journal Entry storage / sharing via USB stick doesn't work
http://dev.laptop.org/ticket/9657

Latest revision as of 09:41, 11 May 2012

Introduction

A Journal entry contains metadata (e.g. decription, title, tags, color) and optionally a preview. Furthermore an entry contains a data file in most of the cases. For example a .odt file in Write. Another example is an entry of a Memorize Game that has no file associated with it, only the metadata and a preview (there is no state saved).

In 0.82 when you copied a Journal entry to a storage device (e.g. USB) the files where stored in the root directory of the device and the metadata and preview was stored in a hidden folder called .olpc.store. You could then go to another machine and copy those entries over or use the stick as backup and copy back the entries to your Journal later. The entries on the device did have the color of the creator of the entries. Other files on the stick were shown in black and white.

The datastore has changed significantly from 0.82 to 0.84 and therefore the old entries are not handled by the new datastore. Furthermore the copying to a storage device did only copy the data file over and the metadata and preview were omitted.

The new patches in 9657 and 9658 do handle now both cases. Details below.

Sharing/Backup Journal entries using a storage device 9657

The new code will store the metadata and preview in a hidden folder like in 0.82. The folder will be named .Sugar_Metadata. There will be two files per entry, one for the metadata named filename.metadata and one for the preview (if exists) named filename.preview. The data files will be stored in the root folder of the device. Like in 0.82 the entries will be colored in the creator's color.

Note: Entries that do not contain a data file can not be copied to a storage device anymore in 0.84 (this was possible in 0.82), an alert is displayed to the learner in those cases. This change has been independent of these patches.

The code is written defensive. If the metadata/preview is corrupted or has been removed it will be skipped, so the deletion of a data file on the device is handled gracefully.

The learner has now the options to: backup the Journal entry to a storage device and copy it back to his own Journal later, share his entry with another learner over a storage device and use the file on a non Sugar machine (showing a picture to your friend on his computer).

Convert Journal entries that have been saved to a storage device in 0.82 9658

This code will convert the old Journal entries to the new scheme described above. When a device containing a folder .olpc.store is plugged into the machine the conversion will happen automatically in the background. Files that have the metadata converted already from a previous run will be omitted from the conversion. The .olpc.store won't be removed after completion to be able to restore if anything goes wrong during conversion.

Note: Entries that do not contain a data file can not be copied to a storage device anymore in 0.84 (this was possible in 0.82), for code simplification we do not restore those entries from 0.82.

The conversion code is written defensive. If an entry can not be converted it will be skipped, if the database is broken the conversion is skipped etc. So the deletion of a data file on the device or any corruption to the .olpc.store should not cause a crash to Sugar.

How to test

You can test it with a latest 10.1.3 build. For now you need to install a patched rpm from sugar-0.84.25-2.fc11.i586.rpm. We are interested particularly in the conversion of 0.82 entries. You can get a 0.82 image from gg-802-1.


New place of datastore

/home/olpc/.sugar/default/datastore/store

[1]

Pictures

The .olpc.store folder containing the converted file.
The .Sugar_metadata folder with the metadata and preview files for each entry.
The view of a storage device containing Journal entries of to different users.