Pier-Magma

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pier-Magma

keith1y
The Second Chapter
=============

Configuring Pier to work with Magma

Step 1. Add WAMagmaConfiguration to your pier app
   - In /seaside/config application, click on the 'configure' link next
to your pier application.
   - From the drop down menu named 'Add Ancestor', select
'WAMagmaConfiguration' and click the 'Add' button.
   - (optional step) to be tidy, click the '(remove)' link next to
'WARenderLoopConfiguration', since WAMagmaConfiguration includes this
anyway.

Step 2. Set the session class to 'WAMagmaSharedSession'
   - In the general config section, in the line entitled 'Session
Class' click the 'overide' link.
   - From the drop down menu which appears next to 'Session Class'
select 'WAMagmaSharedSession'.

Step 3. (optionally) Set the location of the magma repository.
   - The default is set to use a directory named 'magma' in the image
default directory.
   - overriding this setting to choose an alternative directory, or a
remote magma server.

Step 4.  Save Changes and Close.
   - click the 'Save' button at the bottom of the configuration page.
   - click the 'Close' button to return to the dispatcher editor.

Notice the appearance of a link next to the 'pier' application, 'magma'!

Step 5. Create the magma repository for pier.

Enter the control panel for magma using the 'magma' link next to your
pier app.

The top panel should report an error, (i.e. there is no database yet)
*    Repository path setting: *magma
*    Error: /media/hda1/squeak/pr_gsoc/magma/objects not found.*

At present this magma control panel is application agnostic, it doesnt
know anything about pier, hence you have to explicitly choose what class
of root object the database should be created with. (Some magma-seaside
users e.g. Gjallar, just have the app initialize the database
automatically when it is not found)

- To create a repository for pier in the directory specified, choose the
class of the desired repository, in this case a 'PRMagmaRepository',
click the 'create' button.

On returning you will see something like this.
Repository Path Setting: magma (delete)
Persisted Objects Count: 569
Session Id: 2
Cached Object Count: 670
ReadStrategy: a WAMagmaReadStrategyDefault
Root Object: a PRMagmaRepository (explore)
 
The 'delete' link will delete the repository and start again.
The 'explore' link, is similar to the seaside 'debug' link, it opens an
explorer in squeak on the root db object.

Step 6.
 
Returning to the seaside/config app, click the 'pier' link to obtain the pier persistency manager. There you will find a ui for changing which kernel is served* and its persistency scheme.
 
*the 'serve all kernels' option needs the class PRMainAllKernels which is not loaded

Switching from PRNullPersistency to PRMagmaPersistency is all that is required.
Then click the 'migrate' button, and later 'commit' the change.









_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Pier-Magma

Rajeev Lochan


On 4/20/07, Keith Hodges <[hidden email]> wrote:
The Second Chapter
=============

Configuring Pier to work with Magma

Step 1. Add WAMagmaConfiguration to your pier app
   - In /seaside/config application, click on the 'configure' link next
to your pier application.
   - From the drop down menu named 'Add Ancestor', select
'WAMagmaConfiguration' and click the 'Add' button.
   - (optional step) to be tidy, click the '(remove)' link next to
'WARenderLoopConfiguration', since WAMagmaConfiguration includes this
anyway.

Step 2. Set the session class to 'WAMagmaSharedSession'
   - In the general config section, in the line entitled 'Session
Class' click the 'overide' link.
   - From the drop down menu which appears next to 'Session Class'
select 'WAMagmaSharedSession'.

Step 3. (optionally) Set the location of the magma repository.
   - The default is set to use a directory named 'magma' in the image
default directory.
   - overriding this setting to choose an alternative directory, or a
remote magma server.

Step 4.  Save Changes and Close.
   - click the 'Save' button at the bottom of the configuration page.
   - click the 'Close' button to return to the dispatcher editor.

Notice the appearance of a link next to the 'pier' application, 'magma'!

Step 5. Create the magma repository for pier.

Enter the control panel for magma using the 'magma' link next to your
pier app.

The top panel should report an error, (i.e. there is no database yet)
*    Repository path setting: *magma
*    Error: /media/hda1/squeak/pr_gsoc/magma/objects not found.*

At present this magma control panel is application agnostic, it doesnt
know anything about pier, hence you have to explicitly choose what class
of root object the database should be created with. (Some magma-seaside
users e.g. Gjallar, just have the app initialize the database
automatically when it is not found)

- To create a repository for pier in the directory specified, choose the
class of the desired repository, in this case a 'PRMagmaRepository',
click the 'create' button.

On returning you will see something like this.
Repository Path Setting: magma <a title="delete the repository from disk" href="http://localhost:8080/seaside/config?_k=NWNtlOJe&amp;_s=lklgPNPlHkbrjqJQ&amp;2" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> (delete)
Persisted Objects Count: 569
Session Id: 2
Cached Object Count: 670
ReadStrategy: a WAMagmaReadStrategyDefault
Root Object: a PRMagmaRepository <a title="open explorer in squeak" href="http://localhost:8080/seaside/config?_k=NWNtlOJe&amp;_s=lklgPNPlHkbrjqJQ&amp;3" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> (explore)
 
The 'delete' link will delete the repository and start again.
The 'explore' link, is similar to the seaside 'debug' link, it opens an
explorer in squeak on the root db object.

Step 6.
 
Returning to the seaside/config app, click the 'pier' link to obtain the pier persistency manager. There you will find a ui for changing which kernel is served* and its persistency scheme.
 
*the 'serve all kernels' option needs the class PRMainAllKernels which is not loaded

Switching from PRNullPersistency to PRMagmaPersistency is all that is required.
Then click the 'migrate' button, and later 'commit' the change.









_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://www.iam.unibe.ch/mailman/listinfo/smallwiki" target="_blank"> https://www.iam.unibe.ch/mailman/listinfo/smallwiki




Dear Keith,

I followed the steps told by you. I had web -image of  Damien Cassao. While  going through the steps told in  Chapter 1, I executed from the WorkSpace. There were a couple of errors, I went with proceed to see where it stops.

In chapter 2, I configured from Config space and the last step is not working
Step 6.
 
"Returning to the seaside/config app, click the 'pier' link to obtain the pier persistency manager. There you will find a ui for changing which kernel is served* and its persistency scheme.
 
*the 'serve all kernels' option needs the class PRMainAllKernels which is not loaded

Switching from PRNullPersistency to PRMagmaPersistency is all that is required.
Then click the 'migrate' button, and later 'commit' the change."


When I change the Persistency from PRNullPersistency to PRMagmaPersistency, the following error message is displayed, any clues on where I am going wrong ??

Internal Error

MessageNotUnderstood: UndefinedObject>>headerAt:ifAbsent:


WAUrl>>takeServerParametersFromRequest:
WAMagmaSharedSession(WASession)>>actionUrlForKey:
WAMagmaSharedSession(WASession)>>actionUrlForContinuation:
[] in WAMagmaSharedSession(WASession)>>respond: {[:cc | url := self actionUrlForContinuation: cc. response := responseBlock...]}
ResponseContinuation class(Continuation class)>>currentDo:
WAMagmaSharedSession(WASession)>>respond:
WARender>>render
[] in WARender>>go {[self render]}
BlockContext>>on:do:
WARender>>withRenderNowHandler:
[] in WARender>>go {[self withRenderNowHandler: [self render]. self shouldRedirect ifTrue: ...]}
BlockContext>>on:do:
WARender>>withPageExpiredHandler:
WARender>>go
[] in WARenderLoop>>run {[(WARender new root: root) go]}
BlockContext>>repeat
WARenderLoop>>run
WARenderLoop>>call:withToolFrame:
WAWalkbackErrorHandler>>handleError:
WAWalkbackErrorHandler class(WAErrorHandler class)>>handleError:











--
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9212090622 (Gurgaon)
080 65355873 (Bangalore)

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Pier-Magma

keith1y
Tragic to fall at the last hurdle!

Just to let the world know how to switch persistence scheme
programmatically with the Pier-PersistencyManager loaded. This provides
the migration-between-schemes functionality, as well as the web-gui.

| kernel |

kernel := PRKernel instanceNamed: 'MyPierKernel'.

kernel persistency: (kernel persistency exportTo: PRMagmaPersistency new).
 
.....

Unfortunately I think that the stack trace you provided was too short to
find out what component was broken.

I will have a go with the dev image myself over the weekend.

best regards

Keith

> Dear Keith,
>
> I followed the steps told by you. I had web -image of  Damien Cassao.
> While  going through the steps told in  Chapter 1, I executed from the
> WorkSpace. There were a couple of errors, I went with proceed to see
> where it stops.
>
It would be helpful to know what those errors were?

 

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