You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Arne Jensen <ar...@msri.org> on 2009/05/29 00:38:33 UTC

Lenya and database

Hello,

I am getting an error when trying to run a query.

error: unknown element "execute-query" from namespace 
"http://apache.org/cocoon/SQL/2.0"

I've following the example for here:
http://cocoon.apache.org/2.1/userdocs/sql-transformer.html

Do I have the wrong namespace?

We are running Lenya 2.0.1 and connecting to MySQL 5.0.51a

Thanks,

Arne Jensen
Senior Network Engineer
Mathematical Sciences Research Institute
Shiing-Shen Chern Hall
17 Gauss Way
Berkeley, CA  94720-5070
510-643-6070

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


Re: Webapp structure

Posted by Ivan Latysh <iv...@gmail.com>.
Mansour Al Akeel wrote:
> Ivan:
> 
> Here's a sample web application. A web application in cocoon is a container for other blocks. 
> This application contains a hello block  hello-block-1.0-SNAPSHOT.jar 

Thank you, it clears a few things for me.

-- 
Ivan Latysh
IvanLatysh@gmail.com

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


Re: Webapp structure

Posted by Mansour Al Akeel <ma...@gmail.com>.
Ivan:

Here's a sample web application. A web application in cocoon is a container for other blocks. 
This application contains a hello block  hello-block-1.0-SNAPSHOT.jar 

/myProject
|-- META-INF
`-- WEB-INF
    |-- applicationContext.xml
    |-- classes
    |   `-- META-INF
    |       `-- cocoon
    |           `-- properties
    |               `-- contents.properties
    |-- lib
    |   |-- aopalliance-1.0.jar
    |   |-- avalon-framework-api-4.3.1.jar
    |   |-- avalon-framework-impl-4.3.1.jar
    |   |-- cocoon-configuration-api-1.0.2.jar
    |   |-- cocoon-core-2.2.0.jar
    |   |-- cocoon-expression-language-api-1.0.0.jar
    |   |-- cocoon-expression-language-impl-1.0.0.jar
    |   |-- cocoon-flowscript-impl-1.0.0.jar
    |   |-- cocoon-linkrewriter-impl-1.0.0.jar
    |   |-- cocoon-pipeline-api-1.0.0.jar
    |   |-- cocoon-pipeline-components-1.0.0.jar
    |   |-- cocoon-pipeline-impl-1.0.0.jar
    |   |-- cocoon-servlet-service-components-1.0.0.jar
    |   |-- cocoon-servlet-service-impl-1.0.0.jar
    |   |-- cocoon-sitemap-api-1.0.0.jar
    |   |-- cocoon-sitemap-components-1.0.0.jar
    |   |-- cocoon-sitemap-impl-1.0.0.jar
    |   |-- cocoon-spring-configurator-1.0.2.jar
    |   |-- cocoon-store-impl-1.0.0.jar
    |   |-- cocoon-template-impl-1.1.0.jar
    |   |-- cocoon-thread-api-1.0.0.jar
    |   |-- cocoon-thread-impl-1.0.0.jar
    |   |-- cocoon-util-1.0.0.jar
    |   |-- cocoon-xml-api-1.0.0.jar
    |   |-- cocoon-xml-impl-1.0.0.jar
    |   |-- cocoon-xml-resolver-1.0.0.jar
    |   |-- cocoon-xml-util-1.0.0.jar
    |   |-- commons-collections-3.2.jar
    |   |-- commons-io-1.3.1.jar
    |   |-- commons-jexl-1.0.jar
    |   |-- commons-jxpath-1.2.jar
    |   |-- commons-lang-2.3.jar
    |   |-- commons-logging-1.1.jar
    |   |-- concurrent-1.3.4.jar
    |   |-- contents-block-1.0-SNAPSHOT.jar
    |   |-- ehcache-1.2.4.jar
    |   |-- excalibur-instrument-api-2.2.1.jar
    |   |-- excalibur-logger-2.2.1.jar
    |   |-- excalibur-pool-api-2.2.1.jar
    |   |-- excalibur-sourceresolve-2.2.3.jar
    |   |-- excalibur-store-2.2.1.jar
    |   |-- excalibur-xmlutil-2.2.1.jar
    |   |-- hello-block-1.0-SNAPSHOT.jar
    |   |-- jakarta-regexp-1.4.jar
    |   |-- js-1.6R7.jar
    |   |-- junit-3.8.jar
    |   |-- log4j-1.2.14.jar
    |   |-- spring-aop-2.5.1.jar
    |   |-- spring-beans-2.5.1.jar
    |   |-- spring-context-2.5.1.jar
    |   |-- spring-core-2.5.1.jar
    |   |-- spring-web-2.5.1.jar
    |   |-- xalan-2.7.0.jar
    |   |-- xercesImpl-2.8.1.jar
    |   |-- xml-apis-1.3.02.jar
    |   `-- xml-resolver-1.2.jar
    |-- log4j.xml
    `-- web.xml


I hope this helps. 


On Sat May 30,2009 06:31 pm, Ivan Latysh wrote:
> Mansour Al Akeel wrote:
>
> [skipped]
>> Since you have a directory called COB-INF, I would say this is a cocoon
>> block.
> These are directories from a simple webapp that suppose to have a single 
> cocoon (exploded) module.
>
>> Check this:  http://wiki.apache.org/cocoon/BlocksDefinition
> Thank you, checked the page, it talks about a cocoon block structure, and 
> say nothing about a webapp, or a deployment options.
>
> Can anybody share a simple `hello world` war with a single cocoon module ?
>
>>> =======================
>>>  WEB-INF
>>>  + classes
>>>  | + com
>>>  | + COB-INF
>>>  | | + demo
>>>  | |   + spring-bean.jx.xml
>>>  | |   + welcome.xml
>>>  | + META-INF
>>>  |   + cocoon
>>>  |     + spring
>>>  |       + block-servlet-service.xml
>>>  |       + demo-application-context.xml
>>>  + lib
>>>  + applicationContext.xml
>>>  + log4j.xml
>>>  + web.xml
>>> index.jsp
>>> =======================
>
>
> -- 
> Ivan Latysh
> IvanLatysh@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

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


Re: Webapp structure

Posted by Ivan Latysh <iv...@gmail.com>.
Robby Pelssers wrote:
> It's quite easy and if you read http://cocoon.apache.org/1370_1_1.html
> (getting started) you should be able to follow what's going on.
I went through it all.

> When you talk about war.. you mean creating a cocoon-archetype-webapp by
> running 
> mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org  and
> selecting option 3.
It does not create a war, but rather an exploded jetty server with integrated webapp.
And I do have it up and running, but again it demonstrates on how to use Maven to run sample webapp.

> Then you get following structure:
> 
> mywebapproject
>   -src
>     -main
>       -resources
>       -webapp
>         -WEB-INF
>           -applicationContext.xml
>           -log4j.xml
>           -web.xml
Again it is a project structure, not a war structure, when I translate resources from option 2+3 of a maven build script 
into a war it does not work.

> If you had selected option 2 or 1, you would have gotten the structure
> like you mentioned. But the packaging of such a project is 'jar' like
> mentioned earlier in the thread.  So typically, that jar would go into
> the WEB-INF/lib folder if you declare a dependency in 
> 'mywebappproject' on that cocoon block.
I am looking to run exploded cocoon module in the webapp.
In the other words cocoon module is not jarred, and it is running in the webapp.

P.S. It is essential to any open source web project to have a simple war accompanied with a good description that can be 
dropped into a container and evaluated. It does not matter how it has been built or what is the project structure at 
this point. And this is exactly what I am looking for.

-- 
Ivan Latysh
IvanLatysh@gmail.com

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


RE: Webapp structure

Posted by Robby Pelssers <ro...@ciber.nl>.
It's quite easy and if you read http://cocoon.apache.org/1370_1_1.html
(getting started) you should be able to follow what's going on.

When you talk about war.. you mean creating a cocoon-archetype-webapp by
running 
mvn archetype:generate -DarchetypeCatalog=http://cocoon.apache.org  and
selecting option 3.

Then you get following structure:

mywebapproject
  -src
    -main
      -resources
      -webapp
        -WEB-INF
          -applicationContext.xml
          -log4j.xml
          -web.xml

If you had selected option 2 or 1, you would have gotten the structure
like you mentioned. But the packaging of such a project is 'jar' like
mentioned earlier in the thread.  So typically, that jar would go into
the WEB-INF/lib folder if you declare a dependency in 
'mywebappproject' on that cocoon block.  

Hope that helps a bit.

Cheers,
Robby Pelssers


-----Original Message-----
From: Ivan Latysh [mailto:ivanlatysh@gmail.com] 
Sent: Sunday, May 31, 2009 12:32 AM
To: users@cocoon.apache.org
Subject: Re: Webapp structure

Mansour Al Akeel wrote:

[skipped]
> Since you have a directory called COB-INF, I would say this is a
cocoon
> block.
These are directories from a simple webapp that suppose to have a single
cocoon (exploded) module.

> Check this:  http://wiki.apache.org/cocoon/BlocksDefinition
Thank you, checked the page, it talks about a cocoon block structure,
and say nothing about a webapp, or a deployment 
options.

Can anybody share a simple `hello world` war with a single cocoon module
?

>> =======================
>>  WEB-INF
>>  + classes
>>  | + com
>>  | + COB-INF
>>  | | + demo
>>  | |   + spring-bean.jx.xml
>>  | |   + welcome.xml
>>  | + META-INF
>>  |   + cocoon
>>  |     + spring
>>  |       + block-servlet-service.xml
>>  |       + demo-application-context.xml
>>  + lib
>>  + applicationContext.xml
>>  + log4j.xml
>>  + web.xml
>> index.jsp
>> =======================


-- 
Ivan Latysh
IvanLatysh@gmail.com

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


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


Re: Webapp structure

Posted by Ivan Latysh <iv...@gmail.com>.
Mansour Al Akeel wrote:

[skipped]
> Since you have a directory called COB-INF, I would say this is a cocoon
> block.
These are directories from a simple webapp that suppose to have a single cocoon (exploded) module.

> Check this:  http://wiki.apache.org/cocoon/BlocksDefinition
Thank you, checked the page, it talks about a cocoon block structure, and say nothing about a webapp, or a deployment 
options.

Can anybody share a simple `hello world` war with a single cocoon module ?

>> =======================
>>  WEB-INF
>>  + classes
>>  | + com
>>  | + COB-INF
>>  | | + demo
>>  | |   + spring-bean.jx.xml
>>  | |   + welcome.xml
>>  | + META-INF
>>  |   + cocoon
>>  |     + spring
>>  |       + block-servlet-service.xml
>>  |       + demo-application-context.xml
>>  + lib
>>  + applicationContext.xml
>>  + log4j.xml
>>  + web.xml
>> index.jsp
>> =======================


-- 
Ivan Latysh
IvanLatysh@gmail.com

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


Re: Webapp structure

Posted by Mansour Al Akeel <ma...@gmail.com>.
Hello Ivan:

Let me clarify few terminologies base on the way I understand them.

Cocoon block, is wrapped in a jar file, and provides specific
functionality to other blocks or to the webapp.

A cocoon web application, consists of one or more blocks, that colaborate
together to deliver the over all functionality. The web app is the 
"war" file that can be deployed to a servlet container like tomcat. All
the needed blocks are contained in the war file. 

This way you can create blocks and test them separately. Once they are
what you need, you can deploy them to your application.

Since you have a directory called COB-INF, I would say this is a cocoon
block.

Check this:  http://wiki.apache.org/cocoon/BlocksDefinition



On Fri May 29,2009 05:15 pm, Ivan Latysh wrote:
> Hello All!
>
>  Can anybody share a simple Cocoon webapp structure. I checked the 
> tutorials, but strangely they explain how to use Maven instead of how to 
> create a Cocoon webapp.
>
> So far I have got:
>
> =======================
>  WEB-INF
>  + classes
>  | + com
>  | + COB-INF
>  | | + demo
>  | |   + spring-bean.jx.xml
>  | |   + welcome.xml
>  | + META-INF
>  |   + cocoon
>  |     + spring
>  |       + block-servlet-service.xml
>  |       + demo-application-context.xml
>  + lib
>  + applicationContext.xml
>  + log4j.xml
>  + web.xml
> index.jsp
> =======================
>
> But it looks like I am missing something.
>
> -- 
> Ivan Latysh
> IvanLatysh@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

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


Webapp structure

Posted by Ivan Latysh <iv...@gmail.com>.
Hello All!

  Can anybody share a simple Cocoon webapp structure. I checked the tutorials, but strangely they explain how to use 
Maven instead of how to create a Cocoon webapp.

So far I have got:

=======================
  WEB-INF
  + classes
  | + com
  | + COB-INF
  | | + demo
  | |   + spring-bean.jx.xml
  | |   + welcome.xml
  | + META-INF
  |   + cocoon
  |     + spring
  |       + block-servlet-service.xml
  |       + demo-application-context.xml
  + lib
  + applicationContext.xml
  + log4j.xml
  + web.xml
index.jsp
=======================

But it looks like I am missing something.

-- 
Ivan Latysh
IvanLatysh@gmail.com

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


Re: Lenya and database

Posted by Jann Forrer <ja...@id.uzh.ch>.
Hi Arne
>
> Thanks, yes we have activated the SQL Transformer in our sitemap.
>
> In the <map:pipelines> section we added:
>
>      <map:transform type="sql">
>         <map:parameter name="use-connection" value="MyPoolName"/>
>         <map:parameter name="show-nr-of-rows" value="true"/>
>         <map:parameter name="clob-encoding" value="UTF-8"/>
>         <map:parameter name="namespace-uri"
> value="http://apache.org/cocoon/SQL/2.0"/>
>       </map:transform>
>
Not sure where the problem is. For testing purpose i added the following
entries to the sitemap:

1. Add the SqlTransformer to the list of transformers:
  <map:transformer name="sql" logger="sitemap.transformer.sql"
src="org.apache.cocoon.transformation.SQLTransformer"/>

2. <map:match pattern="sqlquery">
  <map:generate type="file" src="lenya/content/databases/mysqltest.xml"/>
  <map:transform type="sql" label="raw">
    <map:parameter name="use-connection" value="mysqlPool"/>
  </map:transform>
  <map:transform src="lenya/xslt/databases/sql2html.xsl"/>
  <map:serialize type="html"/>
</map:match>

3. The important entry in mysqltest.xml looks as follows:
   <page xmlns:sql="http://apache.org/cocoon/SQL/2.0">

  <title>Db Connection Test</title>
  <content>
    <sql:execute-query xmlns="http://apache.org/cocoon/SQL/2.0">
       <sql:query>SELECT * FROM software order by kat;</sql:query>
    </sql:execute-query>
  </content>
</page>

That's it basically. Of course you have to define the mysql connection
parameters (for the mysqlPool) in e.g. cocoon.xconf.

HTH

Jann
 
> --Arne
>
> Jann Forrer wrote:
>> Hi Arne
>>> I am getting an error when trying to run a query.
>>>
>>> error: unknown element "execute-query" from namespace
>>> "http://apache.org/cocoon/SQL/2.0"
>>>
>>> I've following the example for here:
>>> http://cocoon.apache.org/2.1/userdocs/sql-transformer.html
>>>
>>> Do I have the wrong namespace?
>>>
>>> We are running Lenya 2.0.1 and connecting to MySQL 5.0.51a
>>>
>> Did you activate the SQL Transformer in your sitemap?
>>
>> <map:transformer name="sql" logger="sitemap.transformer.sql"
>> src="org.apache.cocoon.transformation.SQLTransformer">
>>
>> We use the SQL Transfomrer in lenya 1.2 and it works fine.
>>
>> Jann
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>> !DSPAM:7,4a1f834e38661859910370!
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Jann Forrer
Informatikdienste
Universität Zürich
Winterthurerstr. 190
CH-8057 Zürich

oooO   mail:  jann.forrer@id.uzh.ch
(  )   phone: +41 1 63 56772
 \ (   fax:   +41 1 63 54505
  \_)  http://www.id.uzh.ch



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


Re: Lenya and database

Posted by Arne Jensen <ar...@msri.org>.
Hi Jann,

Thanks, yes we have activated the SQL Transformer in our sitemap.

In the <map:pipelines> section we added:

      <map:transform type="sql">
         <map:parameter name="use-connection" value="MyPoolName"/>
         <map:parameter name="show-nr-of-rows" value="true"/>
         <map:parameter name="clob-encoding" value="UTF-8"/>
         <map:parameter name="namespace-uri" 
value="http://apache.org/cocoon/SQL/2.0"/>
       </map:transform>

--Arne

Jann Forrer wrote:
> Hi Arne
>> I am getting an error when trying to run a query.
>>
>> error: unknown element "execute-query" from namespace
>> "http://apache.org/cocoon/SQL/2.0"
>>
>> I've following the example for here:
>> http://cocoon.apache.org/2.1/userdocs/sql-transformer.html
>>
>> Do I have the wrong namespace?
>>
>> We are running Lenya 2.0.1 and connecting to MySQL 5.0.51a
>>
> Did you activate the SQL Transformer in your sitemap?
> 
> <map:transformer name="sql" logger="sitemap.transformer.sql"
> src="org.apache.cocoon.transformation.SQLTransformer">
> 
> We use the SQL Transfomrer in lenya 1.2 and it works fine.
> 
> Jann
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> !DSPAM:7,4a1f834e38661859910370!
> 
> 

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


Re: Lenya and database

Posted by Jann Forrer <ja...@id.uzh.ch>.
Hi Arne
>
> I am getting an error when trying to run a query.
>
> error: unknown element "execute-query" from namespace
> "http://apache.org/cocoon/SQL/2.0"
>
> I've following the example for here:
> http://cocoon.apache.org/2.1/userdocs/sql-transformer.html
>
> Do I have the wrong namespace?
>
> We are running Lenya 2.0.1 and connecting to MySQL 5.0.51a
>
Did you activate the SQL Transformer in your sitemap?

<map:transformer name="sql" logger="sitemap.transformer.sql"
src="org.apache.cocoon.transformation.SQLTransformer">

We use the SQL Transfomrer in lenya 1.2 and it works fine.

Jann


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