You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stéphane Delort <de...@free.fr> on 2004/03/29 23:45:09 UTC
[postgresql & databaseAddAction] is it possible to ... ?
Hello,
I use a postgresql DB, and would like to insert field thanks to
databaseAddAction but I have such an horrible error message when I try
to process.
Here is my database :
Table «public.document»
Colonne | Type | Modificateurs
------------------+-----------------+---------------
doc_id | integer | not null default
nextval('public.document_doc_id_seq'::text)
doc_title | character(1024) |
Index :
«document_pkey» primary key, btree (doc_id)
**************************************
In my cocoon.xconf:
...
<component-instance logger="core.modules.auto" name="psql-auto"
class="org.apache.cocoon.components.modules.database.PgsqlAutoIncrementModule"/>
...
**************************************
My sitemap :
...
<map:action name="mod-db-add"
src="org.apache.cocoon.acting.modular.DatabaseAddAction">
<descriptor>database_pfe.xml</descriptor>
<throw-exception>true</throw-exception>
<autoincrement>psql-auto</autoincrement>
</map:action>
...
<map:act type="mod-db-add">
<map:parameter name="document.doc_id" value="12"/> <!-- another
piece of test -->
<map:parameter name="document.doc_title" value="thisIsATest"/>
...
</map:act>
..
**************************************
my descriptor :
<root>
<parameter name="document.doc_id" type="int" nullable="no" />
<constraint-set name="add">
<validate name="document.doc_id"/>
</constraint-set>
<connection>public-users</connection>
<table name="document">
<keys>
<key name="doc_id" type="int" autoincrement="true">
<mode name="psql-auto" type="autoincr"/>
</key>
</keys>
<values>
<value name="doc_title" type="string"/>
</values>
</table>
</root>
**************************************
It took me two days before resigning myself to wrote this email, could
be great to be solved the way I could start sleeping :)
Thanks in advance,
Stephane
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
[postgresql & databaseAddAction] parameters ?
Posted by Stéphane Delort <de...@free.fr>.
<OK>
I solve a part of my problem using
<mode name="psql-auto" type="autoincr"/>
instead of : <mode name="auto" type="autoincr"/>
(psql-auto is the name i gave to the postgresqlAutoIncrementAction in
cocoon.xconf (take a look at my previous email for further details))
</OK>
<NOT OK>
But there is still a problem with sitemap parameters;
It apppears that passing parameters (fields to insert in the DB) this
way, does not work :
<map:act type="mod-db-add">
<map:parameter name="documents.doc_title"
value="ThisIsATest"/>
<NOT OK>
Stephane
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org