1. Take a Squeak 3.8 (3.7 or 3.9 should also work)
2. Install Magritte from SqueakMap. It will ask you if you would like
to install Seaside as well, do so.
3. Install OmniBrowser from SqueakMap.
3. Add the following repository to Monticello and load SmallWiki2-All
MCHttpRepository
location: 'http://mc.lukas-renggli.ch/smallwiki2'
user: ''
password: ''
Soon I will add another package for SmallWiki to SqueakMap, this will
pull in all the required packages including Magritte and its
dependencies.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
Hi Damien,
your approach is certainly very interesting. Congratulations, you are
the first one to use Magritte together with a relational database!
I was thinking about similar things, especially using Magritte (maybe
together with ROE) to do relational object mapping. Having a generic
framework like this would be very cool.
Basically Magritte descriptions can be directly mapped to a
relational-database:
- MAConatiner --> Table (that automatically alter the tables as soon
as the containing descriptions change)
- MAElementDescription --> Column
- MAStringDescription -> VARCHAR
- MANumberDescription -> INT
- MADateDescription -> DATE
- ...
- MAeRelationship --> Foreign Key
- MAOneToOneRelationship -> 1:1 mapping
- MAOneToManyRelationship -> 1:n mapping
You are using the MAAssociationDescription to do the mapping from the
db-id to the object? I think a database-layer should be as
transparent as possible and not require the programmer to think about
ids and primary-keys, etc. But yeah, this is not an easy problem ;-)
I am interested to see a demo of your code!
Lukas
On 9 Nov 2005, at 08:00, Damien Cassou wrote:
> Hi Lukas,
>
> I found a problem and a solution what do you think about it ?
>
> My project works with DB. I have a Table State which stores
> different stats (Switzerland, France, Espana...). I have a table
> Person with a field for the orign state (where the person was borned).
> When I edit a person, I want a SingleOptionComponent representing
> the different states in the DB (the state names). And when I save
> the form, I want the Id of the state, not its name (because the
> Person table use a foreing key to the state table).
>
> My Solution :
>
> - Add a new field for MADescription named : #withId (and implement
> isWithId, beWithId...)
> - Create an AssociationDescription with a #kind method returning
> the class Association. AssociationDescription inherit from
> MAElementDescription.
> - Add a description to the person with:
> options: (MADynamicObject on: [GISQL
> getNamesCollectionFrom: 'Select Id, Name FROM State ORDER BY Name']);
> reference: GIAssociationDescription new;
>
> #getNamesCollectionFrom returns an association collection of type
> Id->Name
>
> When I want to get the Id of the model with the description I use :
>
> value := description accessor read: aDescribedObject.
> description isWithId ifTrue: [ value := value key ].
>
>
> It works great. What is your opinion about this ?
>
> Thanks
--
Lukas Renggli
http://www.lukas-renggli.ch
Hi everybody,
I needed to make a private folder in SmallWiki, for
students but also for me and other participants at the
wiki. I developped an extension of SmallWiki that
allows to create personal and private
folders/pages/resources and manage (private) users.
It works good and very simply.
For more informations :
http://decomp.ulb.ac.be/frdricpluquet/personalstuff/.
Any questions or remarks, please reply this email.
Fréd
---------------------
Frédéric Pluquet
Assistant at Université Libre de Bruxelles (Brussel)
email : fpluquet(a)ulb.ac.be
[
___________________________________________________________________________
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com
Hi,
at this end of the installation, the following squeak code is executed :
SW2Kernel>>defaultInfoLicense
^ SW2Page new
title: 'License';
contents: '!' , self class license.
The method SW2Kernel class>>licence does not exist.
--
Damien
Hi
=<?xml version="1.0" encoding="UTF-8"?>
=<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
="http://www.apple.com/DTDs/PropertyList-1.0.dtd">
=<plist version="1.0">
=<dict>
=<key>DISPLAY</key>
=<string>localhost:0.0</string>
=</dict>
=</plist>
=</pre>
does not render the text without =
Stef