First (alpha!) release of Pier running with Magma Persistency.
Image available from ftp.seasidehosting.st
User: preloaded Password: squeak
enjoy
Keith
------
Image Use Instructions
In pier configuration click on 'Magma Control Panel', which will inform
you that the repository does not exist. If you have placed this image on
seasidehosting then you will have to manually create the repository
directory. Given the list of options as to what repository to create,
click the 'create' button (and wait). The existing pier kernel should
appear in the list with a 'persist' button next to it, click 'persist'.
Then try it and see!
------
------
Detailed Log of Image Creation Steps (alternative title: "monticello
tutorial")
This image was prepared as follows:
Beginning with Squeak3.8-6555full
Initial start asks for updates: select "do not ask again" - this is
important should you wish to deploy. Headless servers (e.g.
seasidehosting) cannot handle user interaction and will stop at this point.
From "world menu > open.... > Monticello Browser"
Browser opens with (Monticello....)
Click the "+Repository Button", select "HTTP" as the repository type,
and enter
MCHttpRepository
location: 'http://www.squeaksource.com/Seaside'
user: ''
password: ''
as the repository info (if you have a login on Squeaksource then you can
enter your initials
as the 'user' above.)
Add the following repository for Monticello.
MCHttpRepository
location: 'http://www.squeaksource.com/Monticello'
user: ''
password: ''
Add the following repository for Magma.
MCHttpRepository
location: 'http://www.squeaksource.com/MagmaTester'
user: ''
password: ''
and the following two repositories for Magritte and Pier
MCHttpRepository
location: 'http://mc.lukas-renggli.ch/magritte'
user: ''
password: ''
MCHttpRepository
location: 'http://mc.lukas-renggli.ch/pier'
user: ''
password: ''
also:
MCHttpRepository
location: 'http://www.squeaksource.com/OmniBrowser'
user: ''
password: ''
(to edit this information:
click the menu button in the right hand pane of the Monticello Browser)
----
Loading Latest Monticello.
More recent versions of Monticello provide better feedback as to which
packages are currently loaded.
Select the http://www.squeaksource.com/Monticello repository, click
"open", select the latest package (Monticello-avi.279) from the main
"Monticello" branch, and click "load".
Select the Monticello package on the left hand pane, and the
squeaksource/Monticello repository in the right hand pane. Click 'open'.
In the repository browser, click on the latest version
(Monticello-avi.279.mcz) and click 'Load'.
----
Loading Seaside
Select "world menu > open... SqueakMap"... and a dialog will ask if you
wish to upgrade SqueakMap. Which you do. Notice that SMBase, SMLoader
packages appeaer in the Monticello browser, since the upgrade is
performed by loading Monticello packages.
In SqueakMap, select the ever so convenient "Seaside Installer" which
should load in the whole of seaside with its dependencies in one go. To
do this select the left had pane menu button, "install". (Part way
through the install you will be prompted to enter an admin username
(seaside) and password (admin))
(if SqueakMap doesnt work it is being knobbled by a more recent
package-cache, remove it and try again)
Select the seaside repositoryClick the "open" and the repository browser
will open.
Select Seaside2.6b1 which is the current latest. In the right hand pane
are the releases. Releases may be made by anyone and they may be small
branches off from the main stream. Periodically an effort will be made
to ensure that all changes are merged. Click the history button in order
to browse the history of this package to get some idea of what is going
on. Look at the ancestors of a package to see if one version is being
sequentially built on the next, or whether any branching is occurring.
Seaside is fairly mature and changes infrequent, therefore it is likely
to be safe to grab the latest version.
Loaded Seaside2.6b1-mb.79
Loaded Scriptaculous-lr.137
To start Seaside doit:
WAKom startOn: 8080.
( Or use the "beach flags" SeasideMorph
available from: http://minnow.cc.gatech.edu/squeak/5862 )
To test if everything is running, check the following url in your normal
web browser.
http://localhost:8080/seaside/config
you should be prompted for you username and password (as given earlier).
----
Loading Magma
Back to the Monticello Browser. Deselect the selected package by
clicking on it once. This should re-reveal all of the registered
repositories.
(It is worth saving this. In the right hand side pane menu button there
is a menu item: "Save Repositories", which writes a simple configuration
script to the working directory.)
Select the http://www.squeaksource.com/MagmaTester repository, and click
"open".
Select MagmaServerLoader, and click "load". (it takes a while!)
loaded MagmaServerLoader-cmm.21
loaded Ma client server-cmm.123
loaded Ma exception handling-cmm.22
loaded Ma time objects-cmm.37
----
Load Magma Seaside Integration Package
Select "Magma Seaside" (lhs) and the latest package and click "load",
loaded Magma Seaside-kph.18
----
Load Magma Seaside Sushi Store Demo fixes
loaded Seaside-Examples-Store-Magma.kph-11
----
Before using Magma may need to execute the following.
MagmaSession initialize.
MagmaRepositoryController initialize.
useful snippets
MagmaSession allInstances cleanUp.
MagmaSession disconnectAndCloseAllConnectedSessions.
----
Load Magritte
loaded Magritte-All-lr.171
Load Pier
loaded Pier-All-lr.109
Load OmniBrowser
loaded OmniBrowser-avi.258
loaded Pier-OmniBrowser-lr.19
----
Latest Pier-Magma code
loaded Pier-Model-kph.80
loaded Pier-Seaside-kph.80
loaded Pier-Magma-kph.1
----
Pre-upload actions:
Monticello Browser - "flush cached versions".
----
Release Preloaded Image as Sqk3.8f-smp.image
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
Hello all,
I am building a form that consists of two components, e.g. House and
Person. For each of these, when a new one is created I register it.
I have a manager class that displays these using:
MAToManyRelationDescription new
classes: (Array with: House);
label: 'Houses';
accessor: (MASelectorAccessor new
readSelector: #houses;
writeSelector: nil;
yourself);
default: Array new;
priority: 20;
yourself
People is similar. The Manager class is a form, but with no buttons
as it is only needed to let the add buttons work on these relation
descriptions. The accessor shown here, houses just calls "House
instances" to get currently registered houses. I subclass
MACheckedMemento and create a custom memento that simply overrides the
#push: method to see if the object is new (no members will be set) and
if so, registers the object after called "super push:".
Everything is fine except for Houses, after I create a new hause the
main display always shows 2. If I leave the page and visit new I see
only one. I have looked around but I dont see how this is happening.
Any ideas?
I came accross a situation in which an MAValidationError was raised
having a tag = nil.
Exception returns messageText from #tag in this case which being a
string does not respond to #label.
MAValidationError-#label
^ self tag label ifNil: [ self tag asString ]
Keith
I am struggling to write a command which edits a model, rather than the
command instance itself. I am trying to do it this way since the model
class and description may change whereas the command class does not.
PREditUser-asComponent
| component |
component := self model asComponent.
^ component addValidatedForm: (Array with: self saveButton with:
self cancelButton);
onAnswer: [ :value |
[ self execute ] on: Error do: [:err | ^ component errors
add: err. ].
value storeOnDB.
self context: self answer "<<<does not work" ];
yourself.
The problem that I am having is that the standard onAnswer: for commands
is implemented by the containing Contents Widget somewhere else and I
cant see any way of overriding it.
Thanks in advance for any ideas
Keith
Hi,
I am trying to make ImagePersistency with seasidehosting, but it does
not work, because the code seems to try to access '/' instead of the
directory of the image. I know that at least seaside.st is on
seasidehosting, and I was wondering how did you solve this issue.
I attached here the debug log I got.
Doru
--
www.tudorgirba.comwww.tudorgirba.com/blog
"From an abstract enough point of view, any two things are similar."
Two detail changes…
- I made pier-math generate transparent PNGs (imperfectly but that's
dvipng not doing what its man page says)
- individual blog posts are now wrapped in the same <div class="post">
as in the blog view… but I suspect this design intentional, for the
RSS feed… ?
PS. NetNewsWire gets Doru's feed but not the one from my local image.
Vienna seems to accept both, but an online validator wasn't too happy
with the feed…
--
Damien Pollet
type less, do more [ | ] http://typo.cdlm.fasmz.org
Hi,
When editing a structure, accessors are called via Magritte but there
is no way for the structure to reinitialize itself before any accessor
is called, or to re-establish its invariant after all accessors have
been called.
I thought I'd wrap PRCommand>>doExecute with something like self
structure willEdit and self structure didEdit, would that make sense?
I also saw PRStructure>>validateCommand which shouldn't modify the
structure, but in my case (Citezen) validating means parsing that
takes time and I'd prefer not to repeat that work when committing the
edition to the structure.
I think writing this helped me see a solution:
- validation does the heavy parsing and stores result in (an adhoc
subclass of) the edit command
- executing the command stores parsed data in the structure and resets
the final data
- a lazy accessor for the final data builds it and ditches the parsed data
hopefully that was clear… if you have suggestions…
--
Damien Pollet
type less, do more [ | ] http://typo.cdlm.fasmz.org
Hello,
At present magritte is a little limited when you have two form fields
which are related in some way. I have come up with a scheme which works,
suggestions are of course very welcome.
Here is an example from the top....
description0020ServiceType
^ MASingleOptionDescription new
accessor: ((#serviceType asAccessor) update:
#serviceTypeChangedTo:);
reference: MAClassDescription new;
options: [ DTIServiceTypes allSubclasses ] asDynamicObject;
default: DTIDeliveryWholesale;
componentClass: MASelectListComponentSU ;
beRequired;
bePersisted;
yourself
Service type is select list which changes the values in other fields in
the form, when the users switches it.
1. The first innovation is the setting of the priority in the method
selector name. I have used this for 3 days and it works really well.
(Enhancement available in Magritte-CustomBuilder package)
2. The second innovation is ((#serviceType asAccessor) update:
#serviceTypeChangedTo:) This is shorthand for...
(MASelectorAccessor read: #serviceType write: #serviceType:)
propertyAt: #update put: (MASelectorAccessor write:
#serviceTypeChangedFix:)
So we have normal access to the datamodel via the reading and writing
accessors, this is the sort of accessing that persisting (and mementos)
would use, but GUI elements can use additional optional update accessor.
#serviceTypeChangedTo: will modify other fields in the model. (Well
actually the model's memento but we will come to that).
Where GUI elements used to write to objects using the standard
Object-#write:using: there is now an #Object-#update:using: which uses
the update accessor if present.
3. RealMementos
The problem with the way that the Gui does mementos now is that it
operates on a dictionary of the models data. The mementos have no
awareness of the model itself. Enter MARealMemento... This uses a
dictionary checks as before BUT importantly read/writes from the GUI are
performed upon a real copy of the model, which is returned upon commit/save.
It also has methods (not yet used) #snapshot, and
#hasChangedSinceSnapshot, which the gui can us in order to only up date
items which have changed since the previous update.
This means that the update methods can modify the values in other fields
and the GUI will see these changes if it is re-rendered using Scriptaculous.
Two caveats are that items being edited by an InternalEditor will will
need to a) have an MAStraitMemento so that they operate directly on the
same model (since they are in the same UI) and (b) the internally edited
objects must be modified not replaced (since the InternalEditor
currently has and is likely to keep a reference to the object itself)
4. MASelectListComponentSU
The scriptaculous addition to the standard select list component, calls
the #update: accessor when the users changes the selection, and it
renders updateContentOn: of the containing MAContainerComponent. So the
display of all fields is refreshed.
I have one other refinement... (not yet implemented in this form)
5. Modifying readonly isVisible
accessor: ((#check asAccessor) readonly: #isCheckDisabled);
accessor: ((#check asAccessor) visible: #isCheckVisible);
The code so far is available in Magritte-RealMemento ,
Magritte-Scriptaculous, Magritte-CustomBuilder
I think that this potentially moves magritte up a level in
user-interactivity
enjoy
Keith
Hi,
I have the following problem with CSS and Firefox
On http://moose.unibe.ch I have a CSS file that is pointed to as
stylesheet from the root page. On Safari 3.0 and on Internet Explorer
it looks Ok, but on Firefox it looks as if the CSS cannot be found.
What could the problem be?
Cheers,
Doru
--
www.tudorgirba.comwww.tudorgirba.com/blog
"Next time you see your life passing by, say 'hi' and get to know her."