You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by SETIssl <se...@hlsw.org> on 2007/06/17 21:01:10 UTC
DatabaseSelectAction and results using
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