You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dominic Tootell <do...@bbc.co.uk> on 2008/05/30 16:17:15 UTC

Cocoon 2.2 resources outside of a Block

Hi all,

Apologies if this has been sent around before.

I'm trying to figure out how I can access resources outside of a Block
jar's, just from a directory within the Webapp:

For example:

I have the simple pipe line: 

<map:pipeline>
	<map:match pattern="static/*.shtml">
		<map:generate src="content/{1}.xml"/>
		<map:serialize type="xml"/>
	</map:match>
</map:pipeline>


This is part of the block called Homepage.   In Homepage block, I have
/src/main/resources/COB-INF/content/index.xml.  This is all fine, when
access the block via jetty and tomcat, the content/index.xml file is
served from COB-INF in the Homepage.jar.

However, I don't want to have to store my xslt,  xml and all other
static files in a jar.  I don't want to have to re-jar the block and
redeploy it to tomcat or start up jetty each time I make a small change
an xslt.

I want a directory content/ within my webapp, where index.xml is read
from there. i.e.:


webapps/Homepage
                              content/index.xml   <---- serve this .xml
file so I can make changes to it quickly and see the results
                              WEB-INF/lib/Homepage.jar    <--- don't
look at COB-INF/content/index.xml, if the above exists.


This is so I can do RAD development on my local development environment.
This was possible in 2.1, but it seems in 2.2 I can't find any
documentation on how this is possible.  It seems like a simple thing....

Can anyone help?

Thanks in advance,
/dom

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

RE: Cocoon 2.2 resources outside of a Block

Posted by Robin Rigby <ro...@gondolier.org.uk>.
Hi

To extend this a little further, my main data resource is a largish XML file
which is edited, updated, mainatined by a user, Mary.  She works on a local
copy and uploads via plain old FTP.  She has _no_ interest in the other
parts of the application.

In 2.1 I was able to make the Cocoon generator read the copy in ~mary/data/
directly.  Otherwise, there was a risk that in redeploying the application I
might overwrite Mary's live data with my test data included in the resource
structure.  I make a distinction between user resources, which Mary
maintains, and application resources which I maintain.   I had to copy the
linux directory structure on my Windows PC for development and use relative
paths. 

I have been considering doing the same with 2.2 but the block structure
seems to make it harder.  What do other people do?  

Thanks
 
Robin
 

-----Original Message-----
From: Zbigniew Bomert OP [mailto:zbomert@dominikanie.pl] 
Sent: 31 May 2008 09:02
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.2 resources outside of a Block

Grzegorz pisze:
> Your resources should be always (or almost always) stored in a block. 
> For RAD purposes we have created special helper plug-in[1] for Maven.

Hi Grzegorz,

consider a simple case. My application is working well, deployed in tomcat;
I 
don't need maven plugin for RAD anymore. Now, I want only to change margin
size of 
a table defined in a css stylesheet. In cocoon 2.1 I could simply edit css
file. 
In 2.2 the css file is zipped in a jar and I need to redeploy the block. And
what 
about the content served by the application? Should it be in a database?
This make 
it impossible to use 2.2 as _simple_ XML publishing framework.

Is there really no way to have the content (css files, content xml files)
outside 
zipped block? Don't close the door for non-java guys, please...


Zbigniew

---------------------------------------------------------------------
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: Cocoon 2.2 resources outside of a Block

Posted by Zbigniew Bomert OP <zb...@dominikanie.pl>.
Grzegorz pisze:
> Your resources should be always (or almost always) stored in a block. 
> For RAD purposes we have created special helper plug-in[1] for Maven.

Hi Grzegorz,

consider a simple case. My application is working well, deployed in tomcat; I 
don't need maven plugin for RAD anymore. Now, I want only to change margin size of 
a table defined in a css stylesheet. In cocoon 2.1 I could simply edit css file. 
In 2.2 the css file is zipped in a jar and I need to redeploy the block. And what 
about the content served by the application? Should it be in a database? This make 
it impossible to use 2.2 as _simple_ XML publishing framework.

Is there really no way to have the content (css files, content xml files) outside 
zipped block? Don't close the door for non-java guys, please...


Zbigniew

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


RE: Cocoon 2.2 resources outside of a Block

Posted by Derek Hohls <DH...@csir.co.za>.
Have to add in my 1/2c as well - as someone who has found 2.1 perfect
for development with (heavy duty) programming, and for whom issues like
packing, maintenance,  asynchronous development, change management 
control production environments have never actually been issues 
(I am now wondering what it is I should have been worrying about all 
those years!!)  C2.1  allows me to focus on delivering an application, 
rather than on messing around with debugging, building, deploying etc etc.  
That's what make it rapid!  

I am now wondering if 2.1 will maintained at all, or if its time to start 
looking around for alternatives... (though I doubt anything will be as 
easy as what we have now)

Derek 

>>> On 2008/06/02 at 10:44, in message <EA...@bbcxues10.national.core.bbc.co.uk>, "Dominic Tootell" <do...@bbc.co.uk> wrote:
Hi Grzegorz,

Apologies for cross posting; although it did finally yet me an answer
;-).

I'll take a look at the tutorial you posted.  However, I have to agree
with the other's on this list.  Having to go to your ide (eclipse),
re-package the block jar, and re-deploy it to the application server
(sometimes you can't use jetty - i.e. you have apache tunnelling
requests though mod_jk to tomcat for instance and need to test it);
isn't pain free Rapid Application Development, especially for a css or
xml change.  This is probably one of the great things in 2.1; that
people are now struggling with in 2.2; and could actually make the
difference between upgrading and not.  

Although, for a packing, maintenance, splitting up of concerns,
asynchronous development, change management control production
environments, etc; blocks are the way forward.

.... etc.


-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: Cocoon 2.2 resources outside of a Block

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Dominic Tootell pisze:
> Hi Grzegorz
> 
>>> Dominic, you would better have watched my video before posting
> anything here. ;-) 
> 
> Actually I have watched and, I know the plugin works and you have a
> reloadable classloader to read modifications to a java classes.  But, as
> I did say in my post, you can't use jetty at times; expecially if you
> are trying to get developers to test code on an environment that is as
> like live/production as possible, to reduce the round trip time in
> testing:
> 	
> 	"(sometimes you can't use jetty - i.e. you have apache
> tunnelling requests though mod_jk to tomcat for instance and need to
> test it)"

Dominic, I apologize you. I've been in a hurry when responding to your e-mail and missed that part.

(sometimes I'm wondering if it's better to stay quiet and give no response or risk blunder like this)

> Your video is a walk through of the 3 step tutorial which is on the
> Cocoon 2.2 site, more-or-less, which I've been through.  Does the RCL
> work away from jetty? i.e for an application server such as tomcat?  

In theory: RCL should work with any servlet container (at least: I don't see any obvious blockers). 
You should do this:

mvn clean cocoon:prepare

then you will find full (unpacked) webapp in target/rcl/webapp. This webapp should work with Tomcat 
but nobody has tried it yet.

Are you interested in trying it out and reporting back to us if it works? We could improve our 
documentation then.

> Sorry if I have somehow caused tension, by asking a question.....

No problem, really!

-- 
Grzegorz Kossakowski

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


RE: Cocoon 2.2 resources outside of a Block

Posted by Dominic Tootell <do...@bbc.co.uk>.
Hi Grzegorz

>> Dominic, you would better have watched my video before posting
anything here. ;-) 

Actually I have watched and, I know the plugin works and you have a
reloadable classloader to read modifications to a java classes.  But, as
I did say in my post, you can't use jetty at times; expecially if you
are trying to get developers to test code on an environment that is as
like live/production as possible, to reduce the round trip time in
testing:
	
	"(sometimes you can't use jetty - i.e. you have apache
tunnelling requests though mod_jk to tomcat for instance and need to
test it)"


Your video is a walk through of the 3 step tutorial which is on the
Cocoon 2.2 site, more-or-less, which I've been through.  Does the RCL
work away from jetty? i.e for an application server such as tomcat?  



Sorry if I have somehow caused tension, by asking a question.....

Thanks
/dom






-----Original Message-----
From: Grzegorz Kossakowski [mailto:grek@tuffmail.com] 
Sent: 02 June 2008 11:57
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.2 resources outside of a Block


>>Dominic, you would better have watched my video before posting
anything here. ;-) Actually, what you described >>above is what our RCL
(Maven plug-in) does but it does it in much convenient way with more
features and 
>>multi-block support...
>>
>>The video shows how you can modify Java classes and Spring
configuration and see changes immediately but >>(obviously) the same
applies to other block resources like XML files, sitemaps, CSS etc.
>>
>>
>>After seeing all these e-mails complaining about some non-existing
problems of C2.2 I think it's right time to >>prepare "Top 10
misconceptions on Cocoon 2.2".
>>Something to worth consideration...

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

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


Re: Problems or Misconceptions ? on Cocoon 2.2

Posted by Vyacheslav Sedov <vy...@gmail.com>.
by the way - where i can find sample where xml transformed by xslt
generated by other xslt from some xml
(it is Schematron workflow)

with best wishes,
Slav

On Mon, Jun 2, 2008 at 4:11 PM, Ken Starks <ke...@lampsacos.demon.co.uk> wrote:
> was 'Re: Cocoon 2.2 resources outside of a Block'  in which
> Grzegorz Kossakowski wrote:
>>
>> Dominic Tootell wrote:
>>
>>>
>>> Hi Grzegorz,
>>>
>>> <snip>
>>>
>
>> Dominic, you would better have watched my video before posting anything
>> here. ;-)
>> Actually, what you described above is what our RCL (Maven plug-in) does
>> but it does it in much convenient way with more features and multi-block
>> support...
>>
>> The video shows how you can modify Java classes and Spring configuration
>> and see changes immediately but (obviously) the same applies to other
>> block resources like XML files, sitemaps, CSS etc.
>>
>>
>> After seeing all these e-mails complaining about some non-existing
>> problems of C2.2 I think it's right time to prepare "Top 10
>> misconceptions on Cocoon 2.2".
>> Something to worth consideration...
>>
>>
>
> If people have these misconceptions, it can only be because the
> documentation is
> misleading or otherwise flawed. Don't try to push the blame onto the users
> for
> not understanding it just because they are not so immersed in Java and the
> whole gamut of Apache projects as you are.
>
> To me the intr
>
> So don't use:  Existing documentation + Top 10 misconceptions
>
> Do use:
>  Rewritten documentation
>
> -------------------------------------------------
>
> In my opinion, it is very off-putting that the FIRST example
> includes a 'Spring Bean'. Any use whatever of Java
> should be in the 'advanced' examples.
>
> No. 1)  should serve a static page
> No. 2)  should have a single XML->(XSLT)->HTML  pipeline
> No. 3)  should have  XML  inputs and a few outputs
> No. 4)  should be similar in functionality to the 'Hello World' samples
>
>
> +++++++++++++++++++++++++++++++++
>
> I liked the video, as I said before, but so far I have not been able to get
> my
> system to behave the same way.  Firstly, I don't (yet) have the RCL plug-in.
> Actually, I was looking for an eclipse plug-in.
>
> +++++++++++++++++++++++++++++++++
>
> Secondly, neither the modified Spring Bean nor the original one seem
> to work. (Maven is compiling the new version, which I confirmed by
> deleting its class file and seeing it reappear ). But the output  of
>
> http://localhost:8888/myBlock1/spring-bean
>
> remains the same:
>
> <demo>
> <module>com.mycompany:myBlock1</module>
> <spring>#message</spring>
> </demo>
>
> Do I need to install the Spring Framework, or what ?
>
> ++++++++++++++++++++++++++++++++++++
>
> Thirdly, will I be able to get a modified Cocoon project
> to auto-run under Tomcat rather than jetty?
> (XML-modified, not Java-modified so it does
> not need a compile stage)
>
> I am not used to having a separate 'deploy to Tomcat'
> stage once I have the basics working, and just want to
> make minor adjustments. In fact, I have NEVER used
> jetty since I first installed Cocoon several years ago.
> And I don't normally have two versions of a project,
> I just modify things in place, in the Tomcat webapps
> directories. I don't need to stop and restart Cocoon.
>
> +++++++++++++++++++++++++++++++++++++
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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


Problems or Misconceptions ? on Cocoon 2.2

Posted by Ken Starks <ke...@lampsacos.demon.co.uk>.
was 'Re: Cocoon 2.2 resources outside of a Block'  in which
Grzegorz Kossakowski wrote:
> Dominic Tootell wrote:
>   
>> Hi Grzegorz,
>>
>> <snip>
>>     

> Dominic, you would better have watched my video before posting anything
> here. ;-)
> Actually, what you described above is what our RCL (Maven plug-in) does
> but it does it in much convenient way with more features and multi-block
> support...
>
> The video shows how you can modify Java classes and Spring configuration
> and see changes immediately but (obviously) the same applies to other
> block resources like XML files, sitemaps, CSS etc.
>
>
> After seeing all these e-mails complaining about some non-existing
> problems of C2.2 I think it's right time to prepare "Top 10
> misconceptions on Cocoon 2.2".
> Something to worth consideration...
>
>   

If people have these misconceptions, it can only be because the 
documentation is
misleading or otherwise flawed. Don't try to push the blame onto the 
users for
not understanding it just because they are not so immersed in Java and the
whole gamut of Apache projects as you are.

To me the intr

So don't use: 
  Existing documentation + Top 10 misconceptions

Do use:
  Rewritten documentation

-------------------------------------------------

In my opinion, it is very off-putting that the FIRST example
includes a 'Spring Bean'. Any use whatever of Java
should be in the 'advanced' examples.

No. 1)  should serve a static page
No. 2)  should have a single XML->(XSLT)->HTML  pipeline
No. 3)  should have  XML  inputs and a few outputs
No. 4)  should be similar in functionality to the 'Hello World' samples


+++++++++++++++++++++++++++++++++

I liked the video, as I said before, but so far I have not been able to 
get my
system to behave the same way.  Firstly, I don't (yet) have the RCL plug-in.
Actually, I was looking for an eclipse plug-in.

+++++++++++++++++++++++++++++++++

Secondly, neither the modified Spring Bean nor the original one seem
to work. (Maven is compiling the new version, which I confirmed by
deleting its class file and seeing it reappear ). But the output  of

http://localhost:8888/myBlock1/spring-bean

remains the same:

<demo>
<module>com.mycompany:myBlock1</module>
<spring>#message</spring>
</demo>

Do I need to install the Spring Framework, or what ?

++++++++++++++++++++++++++++++++++++

Thirdly, will I be able to get a modified Cocoon project
to auto-run under Tomcat rather than jetty?
(XML-modified, not Java-modified so it does
not need a compile stage)

I am not used to having a separate 'deploy to Tomcat'
stage once I have the basics working, and just want to
make minor adjustments. In fact, I have NEVER used
jetty since I first installed Cocoon several years ago.
And I don't normally have two versions of a project,
I just modify things in place, in the Tomcat webapps
directories. I don't need to stop and restart Cocoon.

+++++++++++++++++++++++++++++++++++++






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


Re: Cocoon 2.2 resources outside of a Block

Posted by Reinhard Haller <re...@interactive-net.de>.
Hi Grzegorz,

Grzegorz Kossakowski schrieb:
>
> After seeing all these e-mails complaining about some non-existing
> problems of C2.2 I think it's right time to prepare "Top 10
> misconceptions on Cocoon 2.2".
> Something to worth consideration...
>   
is it a misconception to understand "separation of concerns" as 
separation of content, design,
behaviour and programming?

I used separate global directories for static content, css, ad's etc. 
and referenced them via
global variables for the whole website. Does cocoon 2.2 block structure 
suggest to keep
this information separate for any block involved?

Greetings
Reinhard


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


Re: Cocoon 2.2 resources outside of a Block

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Dominic Tootell wrote:
> Hi Grzegorz,
>
> Apologies for cross posting; although it did finally yet me an answer
> ;-).
>
> I'll take a look at the tutorial you posted.  However, I have to agree
> with the other's on this list.  Having to go to your ide (eclipse),
> re-package the block jar, and re-deploy it to the application server
> (sometimes you can't use jetty - i.e. you have apache tunnelling
> requests though mod_jk to tomcat for instance and need to test it);
> isn't pain free Rapid Application Development, especially for a css or
> xml change.  This is probably one of the great things in 2.1; that
> people are now struggling with in 2.2; and could actually make the
> difference between upgrading and not.  
>
> Although, for a packing, maintenance, splitting up of concerns,
> asynchronous development, change management control production
> environments, etc; blocks are the way forward.
>
>
>
> One of the things I was thinking of doing, is introducing a property in
> the block's sitemap, which resolved to my local development directory.
> i.e.:
>
> 	<map:generate src="${local.block.resources}content/{1}.xml"/>
>
> Resolves to:
>
> 	<map:generate
> src="file://d:/projects/development/metadata_services/cocoon/cocoon2-2-s
> table-projects/Search/Homepage/src/main/resources/COB-INF/content/{1}.xm
> l"/>
>
>
>
> At at deployment/packaging time have maven filter this property in the
> sitemap. i.e:
>
> <build>
> 	<filters>
> 	
> <filter>src/main/filter/filter-${env}.properties</filter>
> 	</filters>
> 	<resources>
> 		<resource>
> 			<directory>src/main/COB-INF</directory>
> 			<filtering>true</filtering>
> 		</resource>
> 	</resources>
> </build>
>
>
> filter-dev.properties contains:
>
> 	
> local.block.resources=file://d:/projects/development/metadata_services/c
> ocoon/cocoon2-2-stable-projects/Search/Homepage/src/main/resources/COB-I
> NF/
>
> filter-prod.properties contains <purposely blank so it can use the
> block's jar versions on live):
>
> 	local.block.resources=
>
>
>
> In my local settings.xml define a profile for dev, integration, qa, prod
> (see
> http://sujitpal.blogspot.com/2006/10/maven2-multi-environment-filter-set
> up.html for more details)
>
> <!-- default environment -->
> <properties>
>   <env>dev</env>
> </properties>
> <profiles>
>   <profile>
>     <id>dev</id>
>     <properties>
>       <env>dev</env>
>     </properties>
>   </profile>
>   <profile>
>     <id>integration</id>
>     <properties>
>       <env>integration</env>
>     </properties>
>   </profile>
> ....
>
>
> This means I can then edit my resoures in COB-INF in eclipse
> (stylesheets, css, xml, etc) and have them picked up without redeploy
> etc.  The only downside is; you can only work on one block at a time;
> which actually really enforces the separation of concerns that Block's
> represent.  And perhaps more of a concern, that you can't edit the
> sitemap.xmap in the block.  This would still require a package and
> deployment.
>
>
> At the moment, the above is one half-solution to easing development; but
> is a bit of a maintenance nightmare.  It's also just thinking off the
> top of my Head and yet to be tested.  Would be nice if it was just
> supported in 2.2.
>
>
> I could always you the "context://" protocol:
>
>
> 	<map:generate src="context://contents/{1}.xml"/>
>
> Which means I can copy the contents of COB-INF manually to
> webapps/<MainWebApp>, but you lose the block structure and you have to
> manually copy over the COB-INF.
>
>
> Maybe others have some better ideas?
> /dom

Dominic, you would better have watched my video before posting anything
here. ;-)
Actually, what you described above is what our RCL (Maven plug-in) does
but it does it in much convenient way with more features and multi-block
support...

The video shows how you can modify Java classes and Spring configuration
and see changes immediately but (obviously) the same applies to other
block resources like XML files, sitemaps, CSS etc.


After seeing all these e-mails complaining about some non-existing
problems of C2.2 I think it's right time to prepare "Top 10
misconceptions on Cocoon 2.2".
Something to worth consideration...

-- 
Grzegorz Kossakowski

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


RE: Cocoon 2.2 resources outside of a Block

Posted by Dominic Tootell <do...@bbc.co.uk>.
Hi Grzegorz,

Apologies for cross posting; although it did finally yet me an answer
;-).

I'll take a look at the tutorial you posted.  However, I have to agree
with the other's on this list.  Having to go to your ide (eclipse),
re-package the block jar, and re-deploy it to the application server
(sometimes you can't use jetty - i.e. you have apache tunnelling
requests though mod_jk to tomcat for instance and need to test it);
isn't pain free Rapid Application Development, especially for a css or
xml change.  This is probably one of the great things in 2.1; that
people are now struggling with in 2.2; and could actually make the
difference between upgrading and not.  

Although, for a packing, maintenance, splitting up of concerns,
asynchronous development, change management control production
environments, etc; blocks are the way forward.



One of the things I was thinking of doing, is introducing a property in
the block's sitemap, which resolved to my local development directory.
i.e.:

	<map:generate src="${local.block.resources}content/{1}.xml"/>

Resolves to:

	<map:generate
src="file://d:/projects/development/metadata_services/cocoon/cocoon2-2-s
table-projects/Search/Homepage/src/main/resources/COB-INF/content/{1}.xm
l"/>



At at deployment/packaging time have maven filter this property in the
sitemap. i.e:

<build>
	<filters>
	
<filter>src/main/filter/filter-${env}.properties</filter>
	</filters>
	<resources>
		<resource>
			<directory>src/main/COB-INF</directory>
			<filtering>true</filtering>
		</resource>
	</resources>
</build>


filter-dev.properties contains:

	
local.block.resources=file://d:/projects/development/metadata_services/c
ocoon/cocoon2-2-stable-projects/Search/Homepage/src/main/resources/COB-I
NF/

filter-prod.properties contains <purposely blank so it can use the
block's jar versions on live):

	local.block.resources=



In my local settings.xml define a profile for dev, integration, qa, prod
(see
http://sujitpal.blogspot.com/2006/10/maven2-multi-environment-filter-set
up.html for more details)

<!-- default environment -->
<properties>
  <env>dev</env>
</properties>
<profiles>
  <profile>
    <id>dev</id>
    <properties>
      <env>dev</env>
    </properties>
  </profile>
  <profile>
    <id>integration</id>
    <properties>
      <env>integration</env>
    </properties>
  </profile>
....


This means I can then edit my resoures in COB-INF in eclipse
(stylesheets, css, xml, etc) and have them picked up without redeploy
etc.  The only downside is; you can only work on one block at a time;
which actually really enforces the separation of concerns that Block's
represent.  And perhaps more of a concern, that you can't edit the
sitemap.xmap in the block.  This would still require a package and
deployment.


At the moment, the above is one half-solution to easing development; but
is a bit of a maintenance nightmare.  It's also just thinking off the
top of my Head and yet to be tested.  Would be nice if it was just
supported in 2.2.


I could always you the "context://" protocol:


	<map:generate src="context://contents/{1}.xml"/>

Which means I can copy the contents of COB-INF manually to
webapps/<MainWebApp>, but you lose the block structure and you have to
manually copy over the COB-INF.


Maybe others have some better ideas?
/dom




-----Original Message-----
From: Grzegorz Kossakowski [mailto:grek@tuffmail.com] 
Sent: 30 May 2008 23:17
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.2 resources outside of a Block

Dominic Tootell pisze:
> Hi all,
> 
> Apologies if this has been sent around before.

Hi Dominic,

Actually, if you was going to apologize for anything cross-posting to
two lists would be my first choice. ;-)

> I'm trying to figure out how I can access resources outside of a Block

> jar's, just from a directory within the Webapp:
> 
> For example:
> 
> I have the simple pipe line:
> 
> <map:pipeline>
>         <map:match pattern="static/*.shtml">
>                 <map:generate src="content/{1}.xml"/>
>                 <map:serialize type="xml"/>
>         </map:match>
> </map:pipeline>
> 
> 
> This is part of the block called Homepage.   In Homepage block, I have

> /src/main/resources/COB-INF/content/index.xml.  This is all fine, when

> access the block via jetty and tomcat, the content/index.xml file is 
> served from COB-INF in the Homepage.jar.
> 
> However, I don't want to have to store my xslt,  xml and all other 
> static files in a jar.  I don't want to have to re-jar the block and 
> redeploy it to tomcat or start up jetty each time I make a small 
> change an xslt.
> 
> I want a directory content/ within my webapp, where index.xml is read 
> from there. i.e.:
> 
> 
> webapps/Homepage
>                               content/index.xml   <---- serve this
.xml 
> file so I can make changes to it quickly and see the results
> 
>                               WEB-INF/lib/Homepage.jar    <--- don't 
> look at COB-INF/content/index.xml, if the above exists.
> 
> 
> This is so I can do RAD development on my local development 
> environment.  This was possible in 2.1, but it seems in 2.2 I can't 
> find any documentation on how this is possible.  It seems like a
simple thing....

Your resources should be always (or almost always) stored in a block.
For RAD purposes we have created special helper plug-in[1] for Maven.

You can see it in action here:
http://people.apache.org/~gkossakowski/cocoon-tutorial-rcl-2.html

Oh gosh, I forgot that I promised to publish it officially on our site.
I'll try to do it over this weekend.

[1]
http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1295_1_1.htm
l


--
Grzegorz Kossakowski

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


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					

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


Re: Cocoon 2.2 resources outside of a Block

Posted by Ken Starks <ke...@lampsacos.demon.co.uk>.
Grzegorz Kossakowski wrote:
> Dominic Tootell pisze:
>> Hi all,
>>
>> Apologies if this has been sent around before.
>
> Hi Dominic,
>
> Actually, if you was going to apologize for anything cross-posting to 
> two lists would be my first choice. ;-)
>
>> I'm trying to figure out how I can access resources outside of a 
>> Block jar's, just from a directory within the Webapp:
>>
>> For example:
>>
>> I have the simple pipe line:
>>
>> <map:pipeline>
>>         <map:match pattern="static/*.shtml">
>>                 <map:generate src="content/{1}.xml"/>
>>                 <map:serialize type="xml"/>
>>         </map:match>
>> </map:pipeline>
>>
>>
>> This is part of the block called Homepage.   In Homepage block, I 
>> have /src/main/resources/COB-INF/content/index.xml.  This is all 
>> fine, when access the block via jetty and tomcat, the 
>> content/index.xml file is served from COB-INF in the Homepage.jar.
>>
>> However, I don't want to have to store my xslt,  xml and all other 
>> static files in a jar.  I don't want to have to re-jar the block and 
>> redeploy it to tomcat or start up jetty each time I make a small 
>> change an xslt.
>>
>> I want a directory content/ within my webapp, where index.xml is read 
>> from there. i.e.:
>>
>>
>> webapps/Homepage
>>                               content/index.xml   <---- serve this 
>> .xml file so I can make changes to it quickly and see the results
>>
>>                               WEB-INF/lib/Homepage.jar    <--- don't 
>> look at COB-INF/content/index.xml, if the above exists.
>>
>>
>> This is so I can do RAD development on my local development 
>> environment.  This was possible in 2.1, but it seems in 2.2 I can't 
>> find any documentation on how this is possible.  It seems like a 
>> simple thing….
>
> Your resources should be always (or almost always) stored in a block. 
> For RAD purposes we have created special helper plug-in[1] for Maven.
>
> You can see it in action here:
> http://people.apache.org/~gkossakowski/cocoon-tutorial-rcl-2.html
>
> Oh gosh, I forgot that I promised to publish it officially on our 
> site. I'll try to do it over this weekend.
>
> [1] 
> http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1295_1_1.html
>
>
Thanks for the tutorial video. The more of these the better for those of 
us who don't yet know
Java, Maven, Eclipse, ...

BUT... at the end of the video you say "Isn't that really really RAPID 
development?"

My answer is "No, not compared with editing  the sitemap or other static 
file and pressing
refresh in my Browser.  That's been my working method for several years 
of Cocoon use."

OK, so this is more like minor tweaking than 'development' but that's 
the way I like
to do things.

Please make this possible again, or if it already is possible, tell us how.


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


Re: Cocoon 2.2 resources outside of a Block

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Dominic Tootell pisze:
> Hi all,
> 
> Apologies if this has been sent around before.

Hi Dominic,

Actually, if you was going to apologize for anything cross-posting to two lists would be my first 
choice. ;-)

> I'm trying to figure out how I can access resources outside of a Block 
> jar's, just from a directory within the Webapp:
> 
> For example:
> 
> I have the simple pipe line:
> 
> <map:pipeline>
>         <map:match pattern="static/*.shtml">
>                 <map:generate src="content/{1}.xml"/>
>                 <map:serialize type="xml"/>
>         </map:match>
> </map:pipeline>
> 
> 
> This is part of the block called Homepage.   In Homepage block, I have 
> /src/main/resources/COB-INF/content/index.xml.  This is all fine, when 
> access the block via jetty and tomcat, the content/index.xml file is 
> served from COB-INF in the Homepage.jar.
> 
> However, I don't want to have to store my xslt,  xml and all other 
> static files in a jar.  I don't want to have to re-jar the block and 
> redeploy it to tomcat or start up jetty each time I make a small change 
> an xslt.
> 
> I want a directory content/ within my webapp, where index.xml is read 
> from there. i.e.:
> 
> 
> webapps/Homepage
>                               content/index.xml   <---- serve this .xml 
> file so I can make changes to it quickly and see the results
> 
>                               WEB-INF/lib/Homepage.jar    <--- don't 
> look at COB-INF/content/index.xml, if the above exists.
> 
> 
> This is so I can do RAD development on my local development 
> environment.  This was possible in 2.1, but it seems in 2.2 I can't find 
> any documentation on how this is possible.  It seems like a simple thing….

Your resources should be always (or almost always) stored in a block. For RAD purposes we have 
created special helper plug-in[1] for Maven.

You can see it in action here:
http://people.apache.org/~gkossakowski/cocoon-tutorial-rcl-2.html

Oh gosh, I forgot that I promised to publish it officially on our site. I'll try to do it over this 
weekend.

[1] http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/1295_1_1.html


-- 
Grzegorz Kossakowski

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