You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2007/01/07 00:35:28 UTC

blocks-fw samples etc. (was Re: What is the deal with "blocks")

On Dec 28, 2006, at 10:00 AM, Reinhard Poetz wrote:

>> Also: how do I run the sample/demo from cocoon-blocks-fw?
>
> Haven't tried it for some time but if you follow the getting started 
> guide at 
> http://cocoon.zones.apache.org/daisy/cdocs-site-main/g2/1159.html and 
> add the sample block as further dependency to the myWebapp module 
> (make sure that you have installed them to the local Maven repo 
> before), you should be able to run them.

OK, thanks... but I need a little more know-how here:

1) Exactly which blocks do I need to add?

2) How do I install them to my local Maven repo?

thx,
—ml—


Re: blocks-fw samples etc. (was Re: What is the deal with "blocks")

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 8, 2007, at 2:14 PM, Reinhard Poetz wrote:

> Mark Lundquist wrote:
> [...]
>> in cocoon-blocks-fw, but yesterday I figured out that all the samples 
>> are wired this way too... :-)
>
> hmmm, which samples do you mean?

E.g., cocoon-core-main-sample-blockServlet.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd">
   <bean id="org.apache.cocoon.core.main.block" 
class="org.apache.cocoon.blocks.BlockServlet">
     <property name="mountPath" value="/cocoon-core-main-sample"/>
     <property name="servletClass" 
value="org.apache.cocoon.sitemap.SitemapServlet"/>
     <property name="blockContextURL" 
value="blockcontext:/cocoon-core-main-sample/"/>
   </bean>
</beans>

—ml—


Re: blocks-fw samples etc. (was Re: What is the deal with "blocks")

Posted by Reinhard Poetz <re...@apache.org>.
Mark Lundquist wrote:
[...]
> in cocoon-blocks-fw, but yesterday I figured out that all the samples 
> are wired this way too... :-)

hmmm, which samples do you mean?

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: blocks-fw samples etc. (was Re: What is the deal with "blocks")

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 8, 2007, at 10:36 AM, Daniel Fagerstrom wrote:

> [clue impartation snipped...]

OK, it looks like cocoon-blocks-fw-sample is working perfectly for me 
now.  Hopefully this will help me to figure out what this is all about. 
  One thing I realized, also: I had been under the impression that the 
only place to see the servlet services stuff in action was the examples 
in cocoon-blocks-fw, but yesterday I figured out that all the samples 
are wired this way too... :-)

thx for the help,
—ml—


Re: blocks-fw samples etc. (was Re: What is the deal with "blocks")

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 8, 2007, at 10:36 AM, Daniel Fagerstrom wrote:

> context path + servlet path (for the dispatcher servlet) + mountPath 
> (for the block servlet) + path info

Perfect, thx a lot for the explanation.  The servlet path is the 
component I was missing.

—ml—


Re: blocks-fw samples etc. (was Re: What is the deal with "blocks")

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Mark Lundquist skrev:
...
> yes... and, it turns out that the -sample and -demo* are now included in 
> the dependencies for cocoon-webapp.  So, I had them all along.  However, 
> I have no clue what URI to request to access these samples.  I poked 
> around for a long time trying to figure it out, but with no luck (I'm 
> still just trying to figure out all this stuff, and learn Maven in the 
> process etc.).  Any clues for me?

context path + servlet path (for the dispatcher servlet) + mountPath 
(for the block servlet) + path info

In this case that is:

http://localhost:8888 + /blocks-test/* + /cocoon-blocks-fw-sample1 + /test
=
http://localhost:8888/blocks-test/cocoon-blocks-fw-sample1/test

for the first rule in the sitemap in 
cocoon-blocks-sample/src/main/resources/COB-INF/test1

The servlet path part is defined in WEB-INF/web.xml in cocoon-webapp 
(and will normally be defined to be /* ).

The mount path is defined in 
cocoon-blocks-sample/src/main/resources/META-INF/cocoon/spring/cocoon-blocks-fw-sample-blockServlet.xml

/Daniel

Re: blocks-fw samples etc. (was Re: What is the deal with "blocks")

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jan 7, 2007, at 6:30 AM, Reinhard Poetz wrote:

> Mark Lundquist wrote:
>> On Dec 28, 2006, at 10:00 AM, Reinhard Poetz wrote:
>>>> Also: how do I run the sample/demo from cocoon-blocks-fw?
>>>
>>> Haven't tried it for some time but if you follow the getting started 
>>> guide at 
>>> http://cocoon.zones.apache.org/daisy/cdocs-site-main/g2/1159.html 
>>> and add the sample block as further dependency to the myWebapp 
>>> module (make sure that you have installed them to the local Maven 
>>> repo before), you should be able to run them.

I don't think so, now that I know the archetypes are for 
1.0.0-M2-SNAPSHOT (or something like that...)?  But see below...

> I'm not sure what the difference between cocoon-blocks-fw-sample, 
> cocoon-blocks-fw-demo1 and cocoon-blocks-fw-demo2 is. 
> cocoon-blocks-fw-sample contains three service servlets with a 
> 'parent/child' and a 'uses' connection.

I look at them a little bit.  -sample is as you described, and where 
for each of the three services the embedded servlet is a 
SitemapServlet.  In the case of -demo*, the embedded servlets are 
custom extensions of HttpServlet.  -demo1 depends on -demo2 and has a 
connection to it.

But anyway...

>
>> 2) How do I install them to my local Maven repo?
>
> Use 'mvn install'.

OK, that's all you meant :-)

> If you invoke the Maven build from cocoon/trunk, the demos should 
> already be part of it.

yes... and, it turns out that the -sample and -demo* are now included 
in the dependencies for cocoon-webapp.  So, I had them all along.  
However, I have no clue what URI to request to access these samples.  I 
poked around for a long time trying to figure it out, but with no luck 
(I'm still just trying to figure out all this stuff, and learn Maven in 
the process etc.).  Any clues for me?

thx,
—ml—


Re: blocks-fw samples etc. (was Re: What is the deal with "blocks")

Posted by Reinhard Poetz <re...@apache.org>.
Mark Lundquist wrote:
> 
> On Dec 28, 2006, at 10:00 AM, Reinhard Poetz wrote:
> 
>>> Also: how do I run the sample/demo from cocoon-blocks-fw?
>>
>> Haven't tried it for some time but if you follow the getting started 
>> guide at 
>> http://cocoon.zones.apache.org/daisy/cdocs-site-main/g2/1159.html and 
>> add the sample block as further dependency to the myWebapp module 
>> (make sure that you have installed them to the local Maven repo 
>> before), you should be able to run them.
> 
> OK, thanks... but I need a little more know-how here:
> 
> 1) Exactly which blocks do I need to add?

I'm not sure what the difference between cocoon-blocks-fw-sample, 
cocoon-blocks-fw-demo1 and cocoon-blocks-fw-demo2 is. cocoon-blocks-fw-sample 
contains three service servlets with a 'parent/child' and a 'uses' connection.

> 
> 2) How do I install them to my local Maven repo?

Use 'mvn install'. If you invoke the Maven build from cocoon/trunk, the demos 
should already be part of it. You can also change to 
cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-sample and call 'mvn 
install' from there.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de