[Seaside] Pier backup + Calendar question

Lukas Renggli renggli at gmail.com
Sun May 28 14:57:33 UTC 2006


Begin forwarded message:

From: "Philippe Marschall" <philippe.marschall at gmail.com>
Date: 28 May 2006 13:20:20 GMT+02:00
To: "SmallWiki, Magritte, Pier and Related Tools ..." <smallwiki at iam.unibe.ch>
Subject: Re: [Seaside] Pier backup + Calendar question
Reply-To: "SmallWiki, Magritte, Pier and Related Tools ..."
<smallwiki at iam.unibe.ch>

Hi

You are absolutely right about StellDichEin it has no good way of
dealing with multiple events.

For searching I think the Pier search engine should work because the
way I understood it is that it works on any kind of (Magritte
described) structure, not only pages.
Note that you can link to events the same way you can link to pages.

A sorted list of events should be quite simple with the help of an
MAReport. Either by creating a new kind of structure or adding a new
ViewCommand.

The calendar view is actually the biggest problem (and the nicest to
have). I see several ways to do this.
One is to port the rendering code of SW2Calendar
(http://www.squeaksource.com/SW2Calendar/) done by David Röthlisberger
and Vera Fischer. This code actually worked some time ago (about a
year) when Pier was called SmallWiki 2.
A second would be to nag Avi into making his calendar rendering code public ;)

An other option would be to write a magrittefied interface to the
Google Calendar (http://code.google.com/apis/gdata/calendar.html) and
embed it into Pier.
This should not be so hard, because the protocol is REST + POX (Well
there is of course the problem with HTTP clients in Squeak) (makes you
wonder why they didn't use iCal for that, but oh well). But then
events would no longer be structures and Google would be responsible
for the storage. You would probably still want to use the iCal package
for the creation and editing of objects and the Magritte UI before you
convert them to XML.

There is actually some kind of Documentation about Magritte and Pier
http://smallwiki.unibe.ch/smallwiki/pier
http://lukas-renggli.ch/smalltalk/magritte
http://lukas-renggli.ch/smalltalk/pier
The last thing I heard is that Lukas should/must/... be finished with
his master thesis pretty damn soon. ;) This - although it probably
will be a bit lengthy - should also help.

About StellDichEin:
The SDE* classes are basically wrappers about the iCal classes (mostly
ICEvent and ICTodo modeled very close to the iCal spec
http://www.ietf.org/rfc/rfc2445.txt). Form within Squeak you can talk
to them using normal messages. The user interface is built with
Magritte (descriptions are provided with the ICalMagritte package).
Export to iCal is done by creating an ICCalendar add what you need and
pass it to an ICCalendarExporter.

More specific questions would help me to give more specific answers ;)

Cheers
Philippe

2006/5/26, Dmitry Dorofeev <dima-sender-3c337a at yasp.com>:
Hi all,

Thanks for information. It sounds positive. So I feel I can use it and
have my backups done.

My goal is to have an application to store a list of events
for public view and search. While I have Pier-Forms and StellDichEin installed,
still can not see how to have a list of events sorted by date, or a nice
calendar view with my events. Creating events as separate pages would be ok,
but overall navigation become a complete mess after a month.

I am very new to Magritte and Pier and was unable to find any good docs
about it. I would program my own interface to event calendar (if such
does not exist),
but need some intro or good hints where to look and how to start.
Quite impressed
that I can have (in theory) an iCal compatible output for offline processing.

Please help,

-Dmitry.

David T. Lewis wrote:
Dmitry,

I mentioned in another reply in this thread that (for a unix based system)
you can back up your entire image with "UnixProcess
saveImageInBackgroundNicely".

You could probably do something very similar to implement Brian's
ReferenceStream
approach in the background so that you would not need to show 'Sorry, Pier
back up in action, please wait ...".

The approach would be:

 - Fork a headless Squeak (exact copy of your running Pier application)
   using #forkHeadlessSqueakAndDoThenQuit.
 - In the child Squeak image (the headless copy of your real server),
   do whatever is necessary to stop serving, so your child Squeak does
   not try to compete with the real one that is serving your users.
 - In the child Squeak, do the ReferenceStream save as described by
   Brian.

You can think of the #forkSqueak as producing an instantanious copy
of your running image (using the Unix fork() system call). You can
use this copy (the headless child Squeak image) to do all of your
backup work without impacting the real Pier server image.
This should permit you to guarantee that Pier is not being changed
while you do backup, and it also should prevent the backup from
having any noticeable effect on your users.

If you want to try this, I suggest as a starting point to use
UnixProcess class >>saveImageInBackground:nice: as an example.
Change it to use #forkHeadlessSqueakAndDoThenQuit: instead of
#forkHeadlessSqueakAndDo:, and replace the code that does the
image save with whatever you need to pause the Pier server and
do the save with ReferenceStream.

HTH,
Dave


On Fri, May 26, 2006 at 12:54:45PM +0400, Dmitry Dorofeev wrote:

Nice and easy, thanks.

The only question left unresolved is to how ensure that nobody
change Pier pages while I do backup. It is not quite necessary for
me personally. But would be nice to have a backup/restore functionality
embedded into Pier. That may show nice message like 'Sorry, Pier back up is
action,
please wait and try to edit this page later.' to the user who updates the
page.

Just an idea.

-Dmitry.

Brian Chapados wrote:

This topic has come up before on the Pier (smallwiki) mailing list.  Check
these links:

# save/restore all data from a pier instance
http://www.iam.unibe.ch/pipermail/smallwiki/2006-March/001773.html
http://www.iam.unibe.ch/pipermail/smallwiki/2004-May/000615.html
http://minnow.cc.gatech.edu/squeak/2318

I use ReferenceStreams as follows:

" save Pier kernel instance "
stream := ReferenceStream fileNamed: 'pier-export.obj'.
stream nextPut: (PRKernel instanceNamed: 'mykernelname') root.
stream close.

" load Pier kernel from stored objects "
stream := ReferenceStream fileNamed: 'pier-export.obj'.
(PRKernel instanceNamed: 'mykernelname') root: stream next.
stream close.

Brian



Hi all,

The only thing which stops me to run personal wiki on Pier is the

chances


that I
can have my image corrupted. Is there any way to make a backup of Pier

content


and full restore ? If I can run it daily would be nice.

Thanks.
-Dmitry.






_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the Seaside mailing list