Hello Yanni,

The idea of the Pier-FilesystemPersistence package is to have an export/import and persistence mechanism that stores the tree of PRStructure objects in a directory tree. Each instance of a subclass of PRStructure is represented by a single xml file. The xml file contains something like this:

<PRPage name="about">
    <title>About this website</title>
    <document>bla bla bla</document>
    ....
</PRPage>

With the current version you can export a Pier website to such a directory tree. Or a zip file containing such a tree. I am still working on using this functionality as a persistence mechanism. A few commands are already implemented but not all. And I haven't figured out yet how to handle the change history. One of the ideas I want to try out is to manage the directory tree with a SCM like subversion.


On Tue, Nov 9, 2010 at 7:42 PM, Yanni Chiu <yanni@rogers.com> wrote:
I've been looking at Pier-FilesystemPersistence, and have a few questions.

The version comments seem to indicate it is still a work in progress. What work remains to be done?

It looks like the change history is not persisted. What's a good way to do that - individual xml files, or a change log?

The usage scenario seems to be: start image, import kernel, save pages. Would it be possible to do a lazy read of the kernel, instead of reading it in entirely, at image start up?

Not yet. I think something like this can be implemented but it will require some changes to the Pier code. You need some kind of hook in the childrenDecoration od a PRStructure.
 
How does it compare with SIXX persistence done for VA Smalltalk?

I don't know SIXX very well but I think it is a generic serialization mechanism for Smalltalk objects to XML. You don't have control over the xml schema with SIXX. And I'm not sure if it is possible with SIXX to store groups of related Smalltalk object in separate files.

Pier-FilesystemPersistence uses the package Magritte-XMLBinding. WIth this package you can control the way Magritte objects (like PRStructure) are serialized to xml.

So it is still work in progress. If you want to have a look at it, you can load it using the following Gofer script (I use a Pier2 image from the build server of Lukas Renggli as a base image):

"XML Support"
Gofer new
squeaksource: 'XMLSupport';
package: 'XML-Parser';
load.

"Load Filesystem"
Gofer new
renggli: 'fs';
package: 'Filesystem';
load.

Gofer new
renggli: 'magritte2addons';
package: 'Magritte-XMLBinding';
load.

Gofer new
renggli: 'pier2addons';
package: 'Pier-FilesystemPersistence';
load.

Jan.