You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Grzegorz Kossakowski <gk...@apache.org> on 2008/01/27 23:32:28 UTC
Re: svn commit: r615662 - /cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
reinhard@apache.org pisze:
> Author: reinhard
> Date: Sun Jan 27 14:12:34 2008
> New Revision: 615662
>
> URL: http://svn.apache.org/viewvc?rev=615662&view=rev
> Log:
> switch to new expression language implementation in sitemaps
Thanks Reinhard for taking care of it. I intended to make this today but I was stopped by failing IT
tests:
Failed tests:
testReadingResourceWithImplicitMimeType(org.apache.cocoon.micro.it.ReaderTest)
testSettingStatusCode(org.apache.cocoon.micro.it.SaxPipelineTest)
They are failing due to COCOON-2150 bug which was annoying enough to get my attention, finally.
I have seen you adding more ITs. I'm curious how do you run them if others are failing?
BTW. Isn't it a good idea to setup Continuum to monitor Micro Cocoon once we have all tests passing?
I only wonder how we satisfy all the SNAPSHOT dependencies...
PS. It's only now I realize how your IT framework flick is. Really nice work!! :-)
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
Re: svn commit: r615662 - /cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Grzegorz Kossakowski pisze:
> PS. It's only now I realize how your IT framework flick is. Really nice work!! :-)
I meant *slick* ;-)
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
Re: New expression language usage
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Reinhard Poetz pisze:
> Grzegorz Kossakowski wrote:
>> Reinhard Poetz pisze:
>>
>> No problem.
>>
>> Are you looking at me as at the one possibly implementing this? :-)
>
> ;-)
Done in r615994 and r615999. I registered implementation of map: language and created simple IT
test. Everything passes here. :-)
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
Re: New expression language usage
Posted by Reinhard Poetz <re...@apache.org>.
Grzegorz Kossakowski wrote:
> Reinhard Poetz pisze:
>> Grzegorz Kossakowski wrote:
>>> Expressions above look quite nasty so I think we'll need to get map:
>>> language done pretty quickly.
>>> (I think it should be easy)
>>>
>>> If you can't make this work, write a IT for it and I'll have a look ASAP.
>> I think that I will wait until COCOON-2118 will be implemented ;-)
>
> No problem.
>
> Are you looking at me as at the one possibly implementing this? :-)
;-)
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair reinhard@apache.org
_________________________________________________________________________
Re: New expression language usage
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Reinhard Poetz pisze:
> Grzegorz Kossakowski wrote:
>> Reinhard Poetz pisze:
>>
>> Oh gosh, you stumbled upon COCOON-2118[1] issue. Fortunately enough,
>> at least COCOON-2117 is
>> resolved so we can find this value in ObjectModel. Using XPath it
>> should be something like:
>>
>> all/sitemap[position() = last()]/*[name()='1']
>>
>> or:
>>
>> all/sitemap[position() = last()]/*[name()='$named$']/*[name()='1']
>>
>> I don't remember if $named$ part is necessary. I must put here a BIG
>> warning, I tested this only
>> casually so this part of EL might have bugs.
>>
>> Expressions above look quite nasty so I think we'll need to get map:
>> language done pretty quickly.
>> (I think it should be easy)
>>
>> If you can't make this work, write a IT for it and I'll have a look ASAP.
>
> I think that I will wait until COCOON-2118 will be implemented ;-)
No problem.
Are you looking at me as at the one possibly implementing this? :-)
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
Re: New expression language usage
Posted by Reinhard Poetz <re...@apache.org>.
Grzegorz Kossakowski wrote:
> Reinhard Poetz pisze:
>> can you help me with following (simple) pipeline:
>>
>> <map:pipeline>
>> <map:match pattern="matching/*">
>> <map:generate src="sax-pipeline/[???].xml"/>
>> <map:serialize type="xml"/>
>> </map:match>
>> </map:pipeline>
>>
>> What do I have to put instead of [???] if I want ro refer to the first
>> match of
>> the wildcard matcher?
>
> Oh gosh, you stumbled upon COCOON-2118[1] issue. Fortunately enough, at least COCOON-2117 is
> resolved so we can find this value in ObjectModel. Using XPath it should be something like:
>
> all/sitemap[position() = last()]/*[name()='1']
>
> or:
>
> all/sitemap[position() = last()]/*[name()='$named$']/*[name()='1']
>
> I don't remember if $named$ part is necessary. I must put here a BIG warning, I tested this only
> casually so this part of EL might have bugs.
>
> Expressions above look quite nasty so I think we'll need to get map: language done pretty quickly.
> (I think it should be easy)
>
> If you can't make this work, write a IT for it and I'll have a look ASAP.
I think that I will wait until COCOON-2118 will be implemented ;-)
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair reinhard@apache.org
_________________________________________________________________________
Re: New expression language usage
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Torsten Curdt pisze:
>
> On 28.01.2008, at 00:53, Grzegorz Kossakowski wrote:
>
>> Reinhard Poetz pisze:
>>
>
> <snip type="complicated expressions"/>
>
> Have my cocoon skills gone so rusty or did I just not get the question?
> What's wrong with the good old ways to referring to first match?
>
> <map:match pattern="matching/*">
> <map:generate src="sax-pipeline/{1}.xml"/>
>
> <map:match pattern="matching/*">
> <map:generate src="sax-pipeline/{\1}.xml"/>
>
> <map:match pattern="matching/*" name="root">
> <map:generate src="sax-pipeline/{#root:1}.xml"/>
Hi Torsten! :)
It's nothing wrong with old syntax and your skills are not gone so rusty but as usual, the devil's
in the detail. Over the last summer I've been working on unification of expression handling in
Cocoon. The main goal was to unified expression language API and Object Model so you could write:
{$cocoon/request/parameters/param1}
in a jx template as well as in a sitemap being sure always get the same result (it's not the case in
2.1.x and it was a pain for our users). With a new API, we support different languages like JXPath,
JEXL or Javascript. In order to support old syntax for referring sitemap variables we just need to
provide an implementation of map: expression language (that will be set as default in sitemap)
compatible with new API.
It's a task tracked by COCOON-2118 (there you find more technical details if you wish to read).
I hope I reassured you a little bit. :-)
[1] https://issues.apache.org/jira/browse/COCOON-2118
Best regards.
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
Re: New expression language usage
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Reinhard Poetz pisze:
> Torsten Curdt wrote:
>>
>> On 28.01.2008, at 00:53, Grzegorz Kossakowski wrote:
>>
>>
>> <snip type="complicated expressions"/>
>>
>> Have my cocoon skills gone so rusty or did I just not get the
>> question? What's wrong with the good old ways to referring to first
>> match?
>>
>> <map:match pattern="matching/*">
>> <map:generate src="sax-pipeline/{1}.xml"/>
>>
>> <map:match pattern="matching/*">
>> <map:generate src="sax-pipeline/{\1}.xml"/>
>>
>> <map:match pattern="matching/*" name="root">
>> <map:generate src="sax-pipeline/{#root:1}.xml"/>
>
> Grek, what's the suggested new syntax for these three use cases?
The same as above; the plan is to reuse existing code. It maybe quite troublesome since the second
and third syntax is new for me...
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
Re: New expression language usage
Posted by Reinhard Poetz <re...@apache.org>.
Torsten Curdt wrote:
>
> On 28.01.2008, at 00:53, Grzegorz Kossakowski wrote:
>
>> Reinhard Poetz pisze:
>>> can you help me with following (simple) pipeline:
>>>
>>> <map:pipeline>
>>> <map:match pattern="matching/*">
>>> <map:generate src="sax-pipeline/[???].xml"/>
>>> <map:serialize type="xml"/>
>>> </map:match>
>>> </map:pipeline>
>>>
>>> What do I have to put instead of [???] if I want ro refer to the first
>>> match of
>>> the wildcard matcher?
>>
>
> <snip type="complicated expressions"/>
>
> Have my cocoon skills gone so rusty or did I just not get the question?
> What's wrong with the good old ways to referring to first match?
>
> <map:match pattern="matching/*">
> <map:generate src="sax-pipeline/{1}.xml"/>
>
> <map:match pattern="matching/*">
> <map:generate src="sax-pipeline/{\1}.xml"/>
>
> <map:match pattern="matching/*" name="root">
> <map:generate src="sax-pipeline/{#root:1}.xml"/>
Grek, what's the suggested new syntax for these three use cases?
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair reinhard@apache.org
_________________________________________________________________________
Re: New expression language usage
Posted by Torsten Curdt <tc...@apache.org>.
On 28.01.2008, at 00:53, Grzegorz Kossakowski wrote:
> Reinhard Poetz pisze:
>> can you help me with following (simple) pipeline:
>>
>> <map:pipeline>
>> <map:match pattern="matching/*">
>> <map:generate src="sax-pipeline/[???].xml"/>
>> <map:serialize type="xml"/>
>> </map:match>
>> </map:pipeline>
>>
>> What do I have to put instead of [???] if I want ro refer to the
>> first
>> match of
>> the wildcard matcher?
>
<snip type="complicated expressions"/>
Have my cocoon skills gone so rusty or did I just not get the
question? What's wrong with the good old ways to referring to first
match?
<map:match pattern="matching/*">
<map:generate src="sax-pipeline/{1}.xml"/>
<map:match pattern="matching/*">
<map:generate src="sax-pipeline/{\1}.xml"/>
<map:match pattern="matching/*" name="root">
<map:generate src="sax-pipeline/{#root:1}.xml"/>
cheers
--
Torsten
Re: New expression language usage
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Grzegorz Kossakowski pisze:
>
> I get something like this:
>
> testSettingStatusCode(org.apache.cocoon.micro.it.SaxPipelineTest) Time elapsed: 0.037 sec <<< FAILURE!
> junit.framework.ComparisonFailure: expected:<10[30]> but was:<10[24]>
> at junit.framework.Assert.assertEquals(Assert.java:81)
> at junit.framework.Assert.assertEquals(Assert.java:87)
> at org.apache.cocoon.micro.it.SaxPipelineTest.testSettingStatusCode(SaxPipelineTest.java:69)
> at org.apache.cocoon.micro.it.SaxPipelineTest.testSettingStatusCode(SaxPipelineTest.java:69)
It turned out that it wasn't caused by COCOON-2150 but I think nobody minds it fixed. ;)
Anyway, it looks like some issue with length of files. I've just committed values that do work for
me. Could you test them now? I fear it's going to be OS issue...
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
Re: New expression language usage
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Reinhard Poetz pisze:
> can you help me with following (simple) pipeline:
>
> <map:pipeline>
> <map:match pattern="matching/*">
> <map:generate src="sax-pipeline/[???].xml"/>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
>
> What do I have to put instead of [???] if I want ro refer to the first
> match of
> the wildcard matcher?
Oh gosh, you stumbled upon COCOON-2118[1] issue. Fortunately enough, at least COCOON-2117 is
resolved so we can find this value in ObjectModel. Using XPath it should be something like:
all/sitemap[position() = last()]/*[name()='1']
or:
all/sitemap[position() = last()]/*[name()='$named$']/*[name()='1']
I don't remember if $named$ part is necessary. I must put here a BIG warning, I tested this only
casually so this part of EL might have bugs.
Expressions above look quite nasty so I think we'll need to get map: language done pretty quickly.
(I think it should be easy)
If you can't make this work, write a IT for it and I'll have a look ASAP.
> hmm, they work for me. Nontheless, you can always run a single test from
> within
> your IDE.
I get something like this:
testSettingStatusCode(org.apache.cocoon.micro.it.SaxPipelineTest) Time elapsed: 0.037 sec <<< FAILURE!
junit.framework.ComparisonFailure: expected:<10[30]> but was:<10[24]>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at org.apache.cocoon.micro.it.SaxPipelineTest.testSettingStatusCode(SaxPipelineTest.java:69)
at org.apache.cocoon.micro.it.SaxPipelineTest.testSettingStatusCode(SaxPipelineTest.java:69)
>
> they will be gone as soon as the spring-configurator and
> servlet-service-impl
> are released.
Right.
[1] https://issues.apache.org/jira/browse/COCOON-2118
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
New expression language usage
Posted by Reinhard Poetz <re...@apache.org>.
Grzegorz Kossakowski wrote:
> reinhard@apache.org pisze:
>> Author: reinhard Date: Sun Jan 27 14:12:34 2008 New Revision: 615662
>>
>> URL: http://svn.apache.org/viewvc?rev=615662&view=rev Log: switch to new
>> expression language implementation in sitemaps
>
> Thanks Reinhard for taking care of it.
can you help me with following (simple) pipeline:
<map:pipeline>
<map:match pattern="matching/*">
<map:generate src="sax-pipeline/[???].xml"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
What do I have to put instead of [???] if I want ro refer to the first match of
the wildcard matcher?
> I intended to make this today but I was stopped by failing IT tests: Failed
> tests:
> testReadingResourceWithImplicitMimeType(org.apache.cocoon.micro.it.ReaderTest)
> testSettingStatusCode(org.apache.cocoon.micro.it.SaxPipelineTest)
>
> They are failing due to COCOON-2150 bug which was annoying enough to get my
> attention, finally.
>
> I have seen you adding more ITs. I'm curious how do you run them if others
> are failing?
hmm, they work for me. Nontheless, you can always run a single test from within
your IDE.
> BTW. Isn't it a good idea to setup Continuum to monitor Micro Cocoon once we
> have all tests passing?
yes
> I only wonder how we satisfy all the SNAPSHOT dependencies...
they will be gone as soon as the spring-configurator and servlet-service-impl
are released.
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair reinhard@apache.org
_________________________________________________________________________