cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SETIssl <s...@hlsw.org>
Subject DatabaseSelectAction and results using
Date Sun, 17 Jun 2007 19:01:10 GMT
ok, since i couldn't find any example or understandable description on how  
to get a simple DatabaseSelectAction to work, i'll try here, maybe someone  
came across this before :>

deskriptor-file ""database.xml":
<?xml version="1.0" encoding="ISO-8859-1"?>
<root>
    <connection>testdb</connection>
    <table name="documents">
       <keys><key param="documents" dbcol="id" type="int"  
autoincrement="true" mode="manual"/></keys>
       <values>
         <value param="documents" dbcol="name" type="varchar"></value>
         <value param="documents" dbcol="type_id" type="int"></value>
       </values>
    </table>
</root>

Do i have to list all table coloums here, or just the one(s) i need for  
the select, to get data from?
Must the Select-Request be embbeded in this file or in the action inside  
the pipeline?


Action-Usage in the Sitemap/Pipeline:
<map:act type="select-typeid">
   <map:parameter name="descriptor" value="database.xml"/>
   <!-- select query parameters -->
   <map:parameter name="table" value="documents"/>
   <map:parameter name="name" value="type_id"/>
   <!-- {3} = docname - third input from pipeline matcher -->
   <map:parameter name="key" value="name = {3}"/>
   <map:parameter name="output" value="type_id"/>

   <!-- use the select-action-result as select-parameter -->
   <map:select type="parameter">
     <map:parameter name="parameter-selector-test"  
value="{request-attr:output}"/>

       <map:when test="2">...</map:when>
       <map:when test="3">...</map:when>
       <map:otherwise>...</map:otherwise>
     </map:select>
   </map:act>

So, i want to get the type_id from the documents-table, in the row, where  
"name"  {3} (document name).
This result should be used as a select-parameter, for different  
proceedings for every id.Ho

How should the Queryparameterpart in the Action look like? Something like  
the part, i tried? :>
How to pass the action-result to the select-parameter?
Can i get a log output or whatever of the select-result?

thx for all useful answers
SETIssl

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


Mime
View raw message