You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ivan Latysh <iv...@gmail.com> on 2009/05/29 23:15:26 UTC

Webapp structure

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: 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