<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY 
style="WORD-WRAP: break-word; webkit-nbsp-mode: space; webkit-line-break: after-white-space">
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=015575502-20112007>Hey Robert,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=015575502-20112007></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=015575502-20112007>&nbsp;&nbsp;&nbsp; Is not Magma directly related case. 
I think that is from the package with addons for Seaside that Keith Hodges made. 
I'm sure you can ask him on the Seaside list,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=015575502-20112007></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=015575502-20112007>&nbsp;&nbsp;&nbsp; cheers,</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=left><SPAN class=250542422-20122006>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=left><?xml:namespace prefix 
= st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName 
ProductID="Sebastian Sastre&#13;" w:st="on"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Sebastian 
Sastre<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" 
/><o:p></o:p></SPAN></st1:PersonName></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"></SPAN><FONT face="Trebuchet MS" 
color=#0000ff size=2></FONT><BR></P></DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>De:</B> magma-bounces@lists.squeakfoundation.org 
  [mailto:magma-bounces@lists.squeakfoundation.org] <B>En nombre de </B>Robert 
  Schwarz<BR><B>Enviado el:</B> Lunes, 19 de Noviembre de 2007 
  19:15<BR><B>Para:</B> magma@lists.squeakfoundation.org<BR><B>Asunto:</B> 
  Tutorial<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV>Error: Magma helper not selected in application configuration.</DIV>
  <DIV>When I add the WAMagmaConfiguration I see the Magma configuration group 
  but I didn't found any drop down menu where I can select WAMagma.&nbsp;</DIV>
  <DIV><BR class=webkit-block-placeholder></DIV>
  <DIV>How can I configure my application for the Magma helper?</DIV>
  <DIV><BR class=webkit-block-placeholder></DIV>
  <DIV>Robert</DIV><BR>
  <DIV>
  <DIV>Am 28.10.2007 um 06:57 schrieb Keith Hodges:</DIV><BR 
  class=Apple-interchange-newline>
  <BLOCKQUOTE type="cite">
    <DIV text="#000000" bgcolor="#ffffff">There have been calls for a Magma 
    tutorial to go into the Seaside tutorial in the persistency chapter. This 
    chapter already includes Glorp and GOODS.<BR><BR>Just in case someone is 
    already, or thinking of doing this, I have already written such a mini 
    tutorial.<BR><BR>In order to make Magma even easier to use, I have begun 
    rewriting "Magma seaside" to take advantage of my new Seaside Session 
    Helpers interface, which I released yesterday.<BR><BR>The idea being that 
    you can now use Magma, without a specialized Seaside Session class. This 
    should make it easier for users to adopt Magma for their existing 
    applications.<BR><BR>I am a little unsure as to how you are supposed to 
    obtain an exact match of a unique item from the database. <BR>This is how I 
    would do it (althought I know MagmaCollections dont actually implement 
    #firstOrNil)<BR><BR>^ (self users where: [ :each | each email = anEmail ]) 
    firstOrNil<BR><BR>Is there a better way to obtain a unique 
    value?<BR><BR>cheers<BR><BR>Keith<BR><BR>p.s. the wiki page that I refer to 
    on MagmaCollections is a bit out of date.<BR>----<BR><BR>so far... 
    <BR><BR><B>Saving all data in an object-oriented database: 
    Magma</B><BR><BR>Another option to make your data persistent is to use an 
    object-oriented database like Magma.<BR><BR><B>Installing the Magma 
    Database</B><BR><BR>Magma is written entirely in Squeak, so there is no need 
    to install a separate server application. Both Magma and Seaside can run in 
    the same image. To install (into a 3.10 based image) just execute the 
    following. (This may take a while)<BR><BR><TT>Installer universes install: 
    'Magma seasideHelper'.</TT><BR><B><BR>Configuring your application to use 
    Magma</B><BR><BR>In the configuration for the 'todo' application you will 
    need to add WAMagmaConfiguration to the configuration "ancestry". Select it 
    from the drop down menu and click "Add". As soon as you do this, a new group 
    of configuration options will appear. You will need to select the "WAMagma", 
    helper class from the drop down menu.<BR><BR>The WAMagma class provides the 
    basic interface between Magma Sessions and Seaside Sessions. Subclasses 
    provide specialised session management such as shared or pooled sessions. 
    <BR><BR><B>Using Magma</B><BR><BR>Magma is very easy to use with seaside. To 
    obtain and use a database session helper, simply send <TT>#magma</TT> to the 
    current session. For example the code "<TT>self session magma"</TT> will 
    work within all seaside components.<BR><BR>To use Magma in this application 
    in a similar manner to the way we have connected to databases in other 
    examples we need to create an interfacing class, to which we can add our 
    specialized querying methods.<BR><BR><TT>Dictionary subclass: 
    #StMagmaDatabase<BR>&nbsp;&nbsp;&nbsp; instanceVariableNames: 
    ''<BR>&nbsp;&nbsp;&nbsp; classVariableNames: ''<BR>&nbsp;&nbsp;&nbsp; 
    poolDictionaries: ''<BR>&nbsp;&nbsp;&nbsp; category: 
    'STTutTodoApp'<BR><BR>StSession-#initialize<BR>&nbsp;&nbsp;&nbsp; super 
    initialize.<BR>&nbsp;&nbsp;&nbsp; self db: (self magma rootAs: 
    StMagmaDatabase)<BR></TT><BR>The tutorial application accesses the database 
    via the <TT>#db </TT>accessor. Here we define this using the <TT>#rootAs: 
    </TT>helper method, which does everything we need, both to initialize the 
    database, and to provide us the interface that we want to it.<BR><BR>To 
    initialize our users collection we define the initialization on our root 
    object, and we need a method to return the users from the database, to add a 
    new user, and to find a 
    user.<BR><BR><TT>StMagmaDatabase-#initialize<BR>&nbsp;&nbsp;&nbsp; | users 
    |<BR>&nbsp;&nbsp;&nbsp; users := OrderedCollection 
    new.<BR>&nbsp;&nbsp;&nbsp; self at: #users put: 
    users.<BR><BR>StMagmaDatabase-#users<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; ^ self at: #users&nbsp; <BR><BR>StMagmaDatabase-#addUser: 
    newUser<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ^ self users add: 
    newUser<BR><BR>StMagmaDatabase-#findUserByEmail: 
    anEmail<BR>&nbsp;&nbsp;&nbsp; ^ self users <BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; detect: [:each | each email = anEmail] 
    <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifNone:[]<BR></TT><BR>Notice how 
    for basic usage we have not needed any database specific code! If our 
    userbase is going to grow to a significant size it makes sense to re 
    implement the above using some database features, so we introduce a 
    MagmaCollection which you can read about in detail here: <A 
    class=moz-txt-link-freetext 
    href="http://wiki.squeak.org/squeak/2639">http://wiki.squeak.org/squeak/2639</A><BR><BR><TT>initialize<BR>&nbsp;&nbsp;&nbsp; 
    | users |<BR>&nbsp;&nbsp;&nbsp; users := MagmaCollection 
    new.<BR>&nbsp;&nbsp;&nbsp; users addIndex: (MaSearchStringIndex attribute: 
    #userName) beAscii.<BR>&nbsp;&nbsp;&nbsp; users addIndex: 
    (MaSearchStringIndex attribute: #email) beAscii.<BR>&nbsp;&nbsp;&nbsp; self 
    at: #users put: users<BR><BR>StMagmaDatabase-#users<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; ^ self at: #users&nbsp; <BR><BR>StMagmaDatabase-#addUser: 
    newUser<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ^ self users add: 
    newUser<BR><BR>StMagmaDatabase-#findUserByEmail: 
    anEmail<BR>&nbsp;&nbsp;&nbsp; ^ (self users where: [ :each | each email = 
    anEmail ]) firstOrNil</TT><BR><BR>... need to explain how committing 
    works... 
    etc<BR><BR><BR><BR><BR>&nbsp;<BR></DIV>_______________________________________________<BR>Magma 
    mailing list<BR><A 
    href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</A><BR>http://lists.squeakfoundation.org/mailman/listinfo/magma<BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>