You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by 321 Los <32...@googlemail.com> on 2006/05/25 10:10:12 UTC

Modify AJAX Carselector sample to work with mysql

Hi,

I was just reading through the Ajax Carselector Sample at
http://localhost:8080/cocoon/samples/blocks/forms/carselector . In my case,
I want to modify the car-db.xml, so that it takes its values from a mysql
database. For now, the car-db.xml looks like that:

<?xml version="1.0"?>

<cars>
  <make name="Audi">
    <type name="A2">
      <model name="1.4 75"/>
      <model name="1.4 TDI"/>
     </type>
    <type name="A3">
      <model name="1.6 Attration 102"/>
      <model name="2.0 FSI Ambition Luxe 150"/>
    </type>
  </make>
  <make name="Volkswagen">
    <type name="Golf">
      <model name="1.6 Trendline 101"/>
      <model name="2.0 FSI Comfortline 150"/>
    </type>
    <type name="Passat">
       <model name="2.0 Turbo FSI Sportline 189"/>
       <model name="1.9 TDI Highline 102"/>
    </type>
    <type name="Bora">
       <model name="1.6 Trendline 101"/>
       <model name="2.0 FSI Comfortline 150"/>
    </type>
  </make>
</cars>


Where it now says <make name="Audi"> or <make name="Volkswagen">, I want
something like <make name= results from 'select distinct kategorie1 from
Objekt'>

where it now says A2, I want 'select distinct kategorie2 from Objekt where
kategorie1='Audi'' and where it says Golf I want 'select distinct kategorie2
from Objekt where kategorie1='Volkswagen''

where it now says '1.4 75' I want 'select distinct kategorie3 from Objekt
where kategorie1='Audi' and kategorie2='A2' ......and so on

Does anyone have an idea how I can do that.

Thank you very much

Marco

Re: Modify AJAX Carselector sample to work with mysql

Posted by ko...@gmail.com.
All thumps up to Simone. Thank you very much. Problem solved
Marco


2006/5/25, Simone Gianni <s....@thebug.it>:
>
> Hi Marco,
> as you can see, the form loads the selection lists with cocoon:/cars
> pipelines. You can simply change this pipelines so that they does not
> generate from a static XML file, but from a query on the DB using the
> SQLTransformer followed by an XSL to transform the SQL XML output to
> what you need.
>
> Hope this helps,
> Simone
>
> 321 Los wrote:
>
> > Hi,
> >
> > I was just reading through the Ajax Carselector Sample at
> > http://localhost:8080/cocoon/samples/blocks/forms/carselector
> > <http://localhost:8080/cocoon/samples/blocks/forms/carselector> . In
> > my case, I want to modify the car-db.xml, so that it takes its values
> > from a mysql database. For now, the car-db.xml looks like that:
> >
> > <?xml version="1.0"?>
> >
> > <cars>
> >   <make name="Audi">
> >     <type name="A2">
> >       <model name="1.4 75"/>
> >       <model name="1.4 TDI"/>
> >      </type>
> >     <type name="A3">
> >       <model name="1.6 Attration 102"/>
> >       <model name="2.0 FSI Ambition Luxe 150"/>
> >     </type>
> >   </make>
> >   <make name="Volkswagen">
> >     <type name="Golf">
> >       <model name="1.6 Trendline 101"/>
> >       <model name="2.0 FSI Comfortline 150"/>
> >     </type>
> >     <type name="Passat">
> >        <model name="2.0 Turbo FSI Sportline 189"/>
> >        <model name="1.9 TDI Highline 102"/>
> >     </type>
> >     <type name="Bora">
> >        <model name="1.6 Trendline 101"/>
> >        <model name="2.0 FSI Comfortline 150"/>
> >     </type>
> >   </make>
> > </cars>
> >
> >
> > Where it now says <make name="Audi"> or <make name="Volkswagen">, I
> > want something like <make name= results from 'select distinct
> > kategorie1 from Objekt'>
> >
> > where it now says A2, I want 'select distinct kategorie2 from Objekt
> > where kategorie1='Audi'' and where it says Golf I want 'select
> > distinct kategorie2 from Objekt where kategorie1='Volkswagen''
> >
> > where it now says '1.4 75' I want 'select distinct kategorie3 from
> > Objekt where kategorie1='Audi' and kategorie2='A2' ......and so on
> >
> > Does anyone have an idea how I can do that.
> >
> > Thank you very much
> >
> > Marco
>
> --
> Simone Gianni
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Modify AJAX Carselector sample to work with mysql

Posted by Simone Gianni <s....@thebug.it>.
Hi Marco,
as you can see, the form loads the selection lists with cocoon:/cars
pipelines. You can simply change this pipelines so that they does not
generate from a static XML file, but from a query on the DB using the
SQLTransformer followed by an XSL to transform the SQL XML output to
what you need.

Hope this helps,
Simone

321 Los wrote:

> Hi,
>
> I was just reading through the Ajax Carselector Sample at
> http://localhost:8080/cocoon/samples/blocks/forms/carselector
> <http://localhost:8080/cocoon/samples/blocks/forms/carselector> . In
> my case, I want to modify the car-db.xml, so that it takes its values
> from a mysql database. For now, the car-db.xml looks like that:
>
> <?xml version="1.0"?>
>
> <cars>
>   <make name="Audi">
>     <type name="A2">
>       <model name="1.4 75"/>
>       <model name="1.4 TDI"/>
>      </type>
>     <type name="A3">
>       <model name="1.6 Attration 102"/>
>       <model name="2.0 FSI Ambition Luxe 150"/>
>     </type>
>   </make>
>   <make name="Volkswagen">
>     <type name="Golf">
>       <model name="1.6 Trendline 101"/>
>       <model name="2.0 FSI Comfortline 150"/>
>     </type>
>     <type name="Passat">
>        <model name="2.0 Turbo FSI Sportline 189"/>
>        <model name="1.9 TDI Highline 102"/>
>     </type>
>     <type name="Bora">
>        <model name="1.6 Trendline 101"/>
>        <model name="2.0 FSI Comfortline 150"/>
>     </type>
>   </make>
> </cars>
>
>
> Where it now says <make name="Audi"> or <make name="Volkswagen">, I
> want something like <make name= results from 'select distinct
> kategorie1 from Objekt'>
>
> where it now says A2, I want 'select distinct kategorie2 from Objekt
> where kategorie1='Audi'' and where it says Golf I want 'select
> distinct kategorie2 from Objekt where kategorie1='Volkswagen''
>
> where it now says '1.4 75' I want 'select distinct kategorie3 from
> Objekt where kategorie1='Audi' and kategorie2='A2' ......and so on
>
> Does anyone have an idea how I can do that.
>
> Thank you very much
>
> Marco

-- 
Simone Gianni

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org