Magma First Steps

Chris Cunnington brasspen at gmail.com
Fri Feb 20 01:09:31 UTC 2009


Hi Milan,

Thanks for the instructions. They were great. I gave it a run through on
Workspace. I didn't have any problems. Each part worked quite well.

Chris


1. From SqueakMap Package Loader, I installed (by menu-clicking on the item
and selecting "install"):
- Magma Server v 4.1.1
- Magma Client v 4.1.1
- Magma Tester v 4.1.1


2. From squeaksource I installed (these are NOT required but provide some
examples, especially Lava tests)


- ToDo-lr.10.mcz : MCHttpRepository location: '
http://www.squeaksource.com/SeaBookToDo' user: '' password: ''
- SeabookToDoPlusMagma-cmm.1.mcz : MCHttpRepository location: '
http://www.squeaksource.com/SeabookToDoPlusMagma' user: '' password: ''
'http://www.squeaksource.com/MagmaTester' user: '' password: ''
- Lava-brp.36.mcz + Lava testing.brp.34.mcz : MCHttpRepository location: '
http://www.squeaksource.com/Lava' user: '' password: ''


Steps followed for each item above:
- open Monticello Browser
- nothing highlighted in left or right pane,
- click +Repository,
- select HTTP, type in MCHttprepository location: ...
- on the right, the new repository is highlighted, blue click (middle) on
it, select 'Open Repository' - a Repository Browser will appear.
- In the repository browser, huighlight a MCZ package on the right, select
'load' in the menu, type in login and password, new window will popup
- select mcz you want to load (e.g. Lava-brp.36.mcz), and click on 'Load'


3. I have accumulated some links as to how to use Magma. Apart from the
Seaside tutorial,


http://wiki.squeak.org/squeak/2689
http://wiki.squeak.org/squeak/2661


I think the first is the only link one really needs when starting with
Magma. I would suggest to ignore the "multi user mode" - just do the single
user mode connect. Steps to create a database and use it in single-user mode
are something like this (you can paste all steps 1-5 in one workspace and
run Alt-D as a test):


"1. create a repository"

myRootTable := Dictionary new.

MagmaRepositoryController
create: 'c:\myMagmaFolder'
root: myRootTable.


"You need to run the above only once, unless you delete the repository.
myRootTable is root object of the repository. This is the root of your
domain object."


"2. open a single-user session (put this at the beginning of your
application, for example Seaside session start. That way, it runs every time
the application starts)"


myMagmaSession := MagmaSession openLocal: 'c:\myMagmaFolder'.

myMagmaSession connectAs: 'chris'
.


"3. Add data, for example "


myMagmaSession commit:
[ myMagmaSession root
at: 'persons'
put: (OrderedCollection with: (Object new)) ]



"4. If you inspect (Alt-I in workspace)"

myMagmaSession root.

"you should see one Object there, the Object you added above. This is not
realistic, obviously you wold be adding Persons there, for which you would
need a Person class. All objects connected to the Person object you add will
be stored. Next time you start, you will still have them available via "

"5. close the session when done (at the end of your application)"


myMagmaSession disconnect; closeRepository
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/magma/attachments/20090219/aa7c6ce8/attachment.htm


More information about the Magma mailing list