Sven,
you can change the logkit.xconf and add the set the logger for your
transformer to debug.
Let's say for instance that you would have the transformer defined in
your sitemap like this:
<map:components>
<map:transformers default="xslt">
<map:transformer name="sql"
src="org.apache.cocoon.transformation.SQLTransformer"
logger="sitemap.transformer.sql"/>
</map:transformers>
</map:components>
You will notice the logger attribute on the SQLTransformer declaration.
Now in your logkit.xconf you need to follow the category structure.
You need to seek the sitemap logger category. It should look something
like below and it could already contain some other categories.
<category log-level="WARN" name="sitemap">
<log-target id-ref="sitemap"/>
<log-target id-ref="error"/>
</category>
To define the DEBUG level for the SQLTransformer you can add a child
category to the sitemap category.
<category log-level="WARN" name="sitemap">
<log-target id-ref="sitemap"/>
<log-target id-ref="error"/>
<category log-level="DEBUG" name="transformer.sql">
<log-target id-ref="sitemap"/>
<log-target id-ref="error"/>
</category>
</category>
Note that the name of the category should equal the logger attribute
based on the hierarchy.
That should do it.
Regards,
Jeroen Reijn
sven goosen wrote:
Hi,
I can't find anything in the logs. how can i set the debug level of the
transformer?
Sven
Jeroen Reijn schreef:
Hi Sven,
your code seems fine and the insert should work. Did you try to look
in the cocoon logs? If not, you could try to set the debug level of
the sql transformer to debug.
Kind regards,
Jeroen Reijn
sven goosen wrote:
Hi Jeroen,
Thanks for the hint.
It seems to work when i got a select query.
But when I do the exact same thing, on a insert query. it doesn't
seem to insert the data into the database.
I don't think I need to handle an insert query different, do I?
Here is the relevant sitemap:
<map:match pattern="savedb.jx">
<map:generate src="scripts/savedb.jx" type="jx"></map:generate>
<map:transform type="sql">
<map:parameter name="use-connection"
value="ledenSysDB"></map:parameter>
</map:transform>
<map:serialize type="xml"></map:serialize>
</map:match>
And here is the relevant sql-part of the savedb.jx file:
<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<sql:query name="test">INSERT INTO testTable (value1, value2)
VALUES ('test1', 'test2')</sql:query>
</sql:execute-query>
When I paste the query into the mysql client, it inserts the row, so
query is correct.
Also, when I replase the insert with an select, I get data from the db.
I really don't get why it doesn't work..
Sven
Jeroen Reijn schreef:
Hi Sven,
yes this can be done! You should be able to do this by just adding
the SQL transformer behind the jx generator.
Like this:
<map:match pattern="foo.jx">
<map:generate src="scripts/foo.jx" type="jx"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="ledenSysDB"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
Kind regards,
Jeroen Reijn
sven goosen wrote:
Hi,
Once again on my quest to using Cocoon, i have a question.
Can I use the output of a flowscript, in a page that is using the
SQL transformer?
So, can i put a transformer like:
<map:transform type="sql">
<map:parameter name="use-connection" value="ledenSysDB"/>
</map:transform>
In a match like this:
<map:match pattern="foo.jx">
<map:generate src="scripts/foo.jx" type="jx"/>
<map:serialize type="xml"/>
</map:match>
And, can i then use the sql:query, with some vars that i got from a
jx script like this:
<sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<sql:query name="test">SELECT * FROM myTable WHERE id =
${id}</sql:query>
</sql:execute-query>
Can this be done? If so, what should be the correct sitemap in my
situation?
Kind regards,
Sven Goosen
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]