You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@s-und-n.de> on 2002/01/03 13:31:56 UTC
Allowed Sitemap Constructs
Hi,
I currently run into the problem that I created pipelines which I
thought were possible, but currently are not support by Cocoon:
It is not possible to nest anything other than a map:part into
a map:aggregate, so the following doesn't work:
<map:aggregate>
<map:select type="test">
<map:when test="a">
<map:part src="a"/>
</map:when>
<map:otherwise>
<map:part src="b"/>
</map:otherwise>
</map:select>
<map:part src="constant"/>
</map:aggregate>
Is this a bug or is this by design?
My personal opinion is, that this should be possible.
Another restriction we currently have is already entered as a bug with
the number 4357: An Action is not possible as a root element inside
a map:pipeline, only map:match can be a used as a root element.
So here again, is this by design?
I think we shouldn't make such restrictions. But at least if we make
these restrictions we should document them.
Regards,
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Stefano Mazzocchi wrote:
>Vadim Gritsenko wrote:
>
>>you have product catalog sub-sitemap:
>>
>> <!-- high precedence URL patterns -->
>> <map:match>...</map:match>
>>
>> <!-- process request parameters productId=xxx&addToComparison=yes -->
>> <map:act type="add-to-comparison"/>
>>
>> <map:act type="product-selection">
>> <map:generate/>
>> <map:serialize/>
>> </map:act>
>>
>> <!-- low precedence URL patterns -->
>> <map:match>...</map:match>
>>
>>Example might be not perfect, but it gives an idea...
>>
>
>Yeah, gives me the idea that the whole concept is screwed and can
>potentially be very harmful in the future!
>
>>>From the above fragment, the low precedence URL patterns are
>unreachable!
>
>I have the perception that allowing actions (that are *always* executed)
>to happen side by side to matchers (which are not always executed) can
>lead to potentially dangerous results, like your example above!
>
>if a cocoon developer can make such a mistake, imagine what a cocoon
>newbie can do!
>
I think a few simple rules, even if they potentially open the door to
dummy constructs, are better than a bigger set of complicated rules that
try to allow only good constructs. KISS : keep it simple & stupid !
Carsten's description of sitemap behaviour is simple and almost complete
(aggregation and error-handlers are missing). With these rules, even a
newbie can understand why a post-match action isn't executed if there
was a match.
The only problematic rule in this description - which originated this
discussion - is that only matchers are allowed as top-level pipeline
elements. I'd like to recall that this was only a bad side-effect of the
patch overcoming the 64kbyte limit for large sitemaps. Before this
patch, any element was allowed as top-level element. Had this patch
taken care of that, this discussion would never have happened.
Introducing complicated rules has IMHO more drawbacks than benefits :
- they allow only what we subjectively define as "good constructs"
- it's hard for everybody to agree with these rules : see the number of
messages in this thread :)
- they're hard to document clearly and thus hard to understand by newbies
- their implementation can be bug-prone
So what about simply removing the limitation on top-level elements, and
add Carsten's description (with the few missing rules) to the docs ?
Sylvain
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Peter Royal <pr...@managingpartners.com>.
On Monday 07 January 2002 02:46 pm, Vadim Gritsenko wrote:
> It's not even nice; it is better then nice. There are things out there
> not
> possible without selectors.
Yes, I realized after I posted that I was gravely mistaken :)
-pete
--
peter royal -> proyal@managingpartners.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Peter Royal [mailto:proyal@managingpartners.com]
>
> On Monday 07 January 2002 11:33 am, Nicola Ken Barozzi wrote:
> >
> > Maybe repeating things already said but, now, is there a real
semantic need
> > of matchers *and* selectors?
>
> A matcher is nothing more than a selector that operates on the
requested URI.
Matchers do operate on whatever you want: request parameters, request
attributes, session attributes, request headers, cookies, wind direction
and boss's attitude. Last two are not written yet though ;)
(same holds true for selectors)
> You are correct, there is not a great need for the duplication, other
than
> syntactical sugar, which is nice sometimes.
It's not even nice; it is better then nice. There are things out there
not
possible without selectors.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Peter Royal <pr...@managingpartners.com>.
On Monday 07 January 2002 11:33 am, Nicola Ken Barozzi wrote:
> ----- Original Message -----
> Maybe repeating things already said but, now, is there a real semantic need
> of matchers *and* selectors?
A matcher is nothing more than a selector that operates on the requested URI.
You are correct, there is not a great need for the duplication, other than
syntactical sugar, which is nice sometimes.
-pete
--
peter royal -> proyal@managingpartners.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Judson Lester <ju...@irev2.com>.
On Monday 07 January 2002 01:03 pm, Nicola Ken Barozzi wrote:
> ----- Original Message -----
> From: "Vadim Gritsenko" <va...@verizon.net>
> To: <co...@xml.apache.org>; "'Nicola Ken Barozzi'"
> <ba...@nicolaken.com>
> Sent: Monday, January 07, 2002 7:31 PM
> Subject: RE: Allowed Sitemap Constructs
>
> > <map:select>
> > <map:when test="XX">
> > <map:generate/>
> > </map:when>
> > <map:when test="YY">
> > <map:generate/>
> > </map:when>
> > <map:otherwise>
> > <map:generate/>
> > </map:otherwise>
> > </map:select>
> > <map:serialize/>
> >
> > Try to convert to matchers - you will fail :)
>
> This fails? :-o ;-)
>
> <map:match>
> <map:match pattern="XX">
> <map:generate/>
> </map:match>
> <map:match pattern="YY">
> <map:generate/>
> </map:match>
> <map:match pattern="**">
> <map:generate/>
> </map:match>
> </map:match>
> <map:serialize/>
>
The select structure does one generate (for XX, YY or in all other cases) and
one serialize, while the match version generates once or twice (XX & the **,
YY & **, or in all other cases **), and one serialize.
> I haven't tried it, so I don't know if it really fails, but it seems there
> is an overlap between matchers and selectors which is dangerous IMHO.
> With no overlap it's easy to decide what to use, but they seem so similar
> it's difficult to really see how to use them. Actions complicate this
Can it be successfully argued that match and select can't be fused?
Recollect the C++ usage of struct and class. A struct is public by default,
so a C struct behaves as it should. So, map:select might accept a
returns-map="true" attribute,
Thus, map:match could be retained, but be converted always into an
equivalent select statement.
Why not?
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Peter Royal <pr...@managingpartners.com>.
On Monday 07 January 2002 02:03 pm, Nicola Ken Barozzi wrote:
> - must Actions have nested elements? It pollutes the selection concept.
I like actions with nested elements. This allows for such things as actions
that do security checks, and the contents of the action tag execute if the
action "passes" (returns a non-null map), or continues after the action if it
"fails" (returns null).
-pete
--
peter royal -> proyal@managingpartners.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Nicola Ken Barozzi [mailto:barozzi@nicolaken.com]
>
> This fails? :-o ;-)
>
> <map:match>
> <map:match pattern="XX">
> <map:generate/>
> </map:match>
> <map:match pattern="YY">
> <map:generate/>
> </map:match>
> <map:match pattern="**">
> <map:generate/>
new ProcessingException("Generator is already set") right here
if "XX" or "YY" has matched.
> </map:match>
> </map:match>
> <map:serialize/>
<snip>
>
> I suggest we have only atomic actions.
>
When to pop the map returned by an action?
Also, we should limit changes to only backward-compatible ones.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Nicola Ken Barozzi <ba...@nicolaken.com>.
----- Original Message -----
From: "Vadim Gritsenko" <va...@verizon.net>
To: <co...@xml.apache.org>; "'Nicola Ken Barozzi'"
<ba...@nicolaken.com>
Sent: Monday, January 07, 2002 7:31 PM
Subject: RE: Allowed Sitemap Constructs
> <map:select>
> <map:when test="XX">
> <map:generate/>
> </map:when>
> <map:when test="YY">
> <map:generate/>
> </map:when>
> <map:otherwise>
> <map:generate/>
> </map:otherwise>
> </map:select>
> <map:serialize/>
>
> Try to convert to matchers - you will fail :)
This fails? :-o ;-)
<map:match>
<map:match pattern="XX">
<map:generate/>
</map:match>
<map:match pattern="YY">
<map:generate/>
</map:match>
<map:match pattern="**">
<map:generate/>
</map:match>
</map:match>
<map:serialize/>
I haven't tried it, so I don't know if it really fails, but it seems there
is an overlap between matchers and selectors which is dangerous IMHO.
With no overlap it's easy to decide what to use, but they seem so similar
it's difficult to really see how to use them. Actions complicate this matter
too, because they can have nested elements.
I suggest we have only atomic actions.
Then flow can be done with a selector that can select based on what the
Action has done to the objectModel.
Is there a need for non-atomic Actions?
It also seems matchers are before sitemap gen-trans-ser while selectors can
be intermingled.
Which makes me think thar matchers seem to belong to flowmaps while
selectors to sitemaps.
But on the other hand selectors are needed for atomic actions, which makes
them go into the flowmap.
I think that overlap should be avoided if possible.
So what I would like to know is:
- why are there matchers and selectors?
- are they unitable in a single selection component?
- must Actions have nested elements? It pollutes the selection concept.
Ken
--
Nicola Ken Barozzi xml-cocoon@nicolaken.com
These are the days of miracle and wonder...
...so don't cry baby, don't cry...
Paul Simon
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Nicola Ken Barozzi [mailto:barozzi@nicolaken.com]
>
> From: "Vadim Gritsenko" <va...@verizon.net>
>
> > There is couple of differences between matchers and selectors:
> > 1. Matchers do return map to the sitemap, selectors - don't.
> > You can't emulate matchers using selector.
>
> What is the real need of inhibiting a selector to return a map?
Don't know - I'm not an author of original concept... Guess
Stefano could clear up this thing for us :)
> > 2. Selectors have <otherwise>, matchers - don't.
> > And you can't emulate selector's <otherwise> using matchers.
>
> IMHO a last match with "**" has the same use of map:otherwise.
No, not exactly. Example snippet:
<map:select>
<map:when>
<map:generate/>
</map:when>
<map:when>
<map:generate/>
</map:when>
<map:otherwise>
<map:generate/>
</map:otherwise>
</map:select>
<map:serialize/>
Try to convert to matchers - you will fail :)
> Also, taken from
> http://xml.apache.org/cocoon/userdocs/concepts/matchers_selectors.html
> "Obviously, this could have been done with matchers as well. Decide on
> yourself, what appears clearer to you in a specific situation."
I do not see how example from this page could be restated in matchers.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Nicola Ken Barozzi <ba...@nicolaken.com>.
----- Original Message -----
From: "Vadim Gritsenko" <va...@verizon.net>
To: <co...@xml.apache.org>; "'Nicola Ken Barozzi'"
<ba...@nicolaken.com>
Sent: Monday, January 07, 2002 5:56 PM
Subject: RE: Allowed Sitemap Constructs
> > From: Nicola Ken Barozzi [mailto:barozzi@nicolaken.com]
> > Maybe repeating things already said but, now, is there a real semantic
> > need of matchers *and* selectors?
> > It seems that it's taken from the xsl:template and xsl:choose stuff.
> > But here there is no real semantic gain... or is there?
>
> There is couple of differences between matchers and selectors:
> 1. Matchers do return map to the sitemap, selectors - don't.
> You can't emulate matchers using selector.
What is the real need of inhibiting a selector to return a map?
> 2. Selectors have <otherwise>, matchers - don't.
> And you can't emulate selector's <otherwise> using matchers.
IMHO a last match with "**" has the same use of map:otherwise.
Also, taken from
http://xml.apache.org/cocoon/userdocs/concepts/matchers_selectors.html
"Obviously, this could have been done with matchers as well. Decide on
yourself, what appears clearer to you in a specific situation."
Are we just using two component types out of need or maybe design
considerations have changed since the original spec?
--
Nicola Ken Barozzi xml-cocoon@nicolaken.com
These are the days of miracle and wonder...
...so don't cry baby, don't cry...
Paul Simon
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Nicola Ken Barozzi [mailto:barozzi@nicolaken.com]
>
> From: "Berin Loritsch" <bl...@apache.org>
>
> > I see a Matcher kind of like a massive SELECT architecture.
>
> Maybe repeating things already said but, now, is there a real semantic
need
> of matchers *and* selectors?
<snip>
> It seems that it's taken from the xsl:template and xsl:choose stuff.
> But here there is no real semantic gain... or is there?
There is couple of differences between matchers and selectors:
1. Matchers do return map to the sitemap, selectors - don't.
You can't emulate matchers using selector.
2. Selectors have <otherwise>, matchers - don't.
And you can't emulate selector's <otherwise> using matchers.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Nicola Ken Barozzi <ba...@nicolaken.com>.
----- Original Message -----
From: "Berin Loritsch" <bl...@apache.org>
To: <co...@xml.apache.org>
Sent: Monday, January 07, 2002 3:36 PM
Subject: Re: Allowed Sitemap Constructs
> I see a Matcher kind of like a massive SELECT architecture.
Maybe repeating things already said but, now, is there a real semantic need
of matchers *and* selectors?
Couldn't
<map:match>
<map:match type="XX">
<map:generate>
<map:transform>
<map:serialize>
</map:match>
<map:match type="YY">
<map:generate>
<map:transform>
<map:serialize>
</map:match>
</map:match>
be used instead of
<map:match>
<map:select type="XX">
<map:when test="wap">
<map:generate>
<map:transform>
<map:serialize>
</map:when>
<map:when type="YY">
<map:generate>
<map:transform>
<map:serialize>
</map:when>
</map:select>
</map:match>
It seems that it's taken from the xsl:template and xsl:choose stuff.
But here there is no real semantic gain... or is there?
--
Nicola Ken Barozzi xml-cocoon@nicolaken.com
These are the days of miracle and wonder...
...so don't cry baby, don't cry...
Paul Simon
Re: Allowed Sitemap Constructs
Posted by Berin Loritsch <bl...@apache.org>.
Stefano Mazzocchi wrote:
>
> Also, and more important, if a matcher doesn't have a
> mount|serializer|reader, it's an error. The sitemap shouldn't even be
> loaded.
Stefano, I agreed with everything you wrote except for this.
I see a Matcher kind of like a massive SELECT architecture. While it is
more correct for a construct like this to have a definite break point,
it should not limit you. For example:
select (foo)
{
case TEST1:
// do stuff
break;
case TEST2:
// fall through
case TEST3:
// do stuff
break;
}
Granted it is more complicated that that in real life--however, the concept is
similar.
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Stefano Mazzocchi wrote:
>
>
> Also, and more important, if a matcher doesn't have a
> mount|serializer|reader, it's an error. The sitemap shouldn't even be
> loaded.
>
Really? I thought something like:
<match pattern="documents/*.html">
<generate src="docs/{1}.xml"/>
</match>
<match pattern="documents/*.xml">
<generate src="{1}.xml">
</match>
<match pattern="**">
<transform src="stylesheet"/>
</match>
<match pattern="**.html">
<map:serialize type="html"/>
</match>
<match pattern="**.xml">
<map:serialize type="xml"/>
</match>
is possible! I have currently no real-world example handy, but
I think you can guess from the example the idea behind this.
I know, there are of course better solutions for the above
problem - this should be modelled completely different, but this
is not the point here.
If it is right, that a map:match must always have a serializer or
a reader than we have a big bug!
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by giacomo <gi...@apache.org>.
On Mon, 7 Jan 2002, Stefano Mazzocchi wrote:
> Vadim Gritsenko wrote:
>
> > Not exactly correct... they are reachable...
> >
> > >
> > > <pipeline>
> > > <act>
> > > <match>
> > > <act>
> > > <match>
> > > <act>
> > > </pipeline>
> > >
> > > the third one is never reached.
> >
> > It *is* reached if none of the matchers are matched *or* if matched
> > matchers had no <map:serialize|mount>. In these cases, last actions is
> > executed right before <map:handle-errors/>.
>
> Gosh, if this is your vision, we have a problem.
>
> The original design was that 'handle-errors' should be sort of a
> try/catch statement, not a procedural call that you can assume to be
> called at the end. It's not *at the end* of the pipeline. It could be
> explicitly written on top or in between, things shouldn't change.
Sefano is right! The <handle-error> *is* implemented as a try/catch
statement.
> Also, and more important, if a matcher doesn't have a
> mount|serializer|reader, it's an error. The sitemap shouldn't even be
> loaded.
But this isn't the case today. You can code
<match pattern="a*">
<generate type="a" .../>
</match>
<match pattern="b*">
<generate type="b" .../>
</match>
<match pattern="*foo">
<transform .../>
<serialize .../>
</match>
which results in a pipeline of
url="afoo": G(a)->T->S
url="bfoo": G(b)->T->S
> At the same time, I see your point: the post-action can be executed if
> no matcher is entered... and we can't forbid this to happen unless we
> force the creation of a new semantic like 'default-match', which I
> think, sucks.
Big time. Today it will result a ResourceNotFound
Giacomo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Vadim Gritsenko wrote:
> > Gosh, if this is your vision, we have a problem.
>
> No, that's not my vision: that's the reality we live in.
>
> 1. Quoting Carsten:
> - the sitemap is processed top-down, the processing stops:
> * when a serialize is reached
> * when a reader is reached
> * when the end is reached
>
> It exactly means that this last <act> will be executed when mentioned
> conditions are met.
I'm not questioning reality, I'm questioning design.
> My vision was that map:pipeline *must* have at least one generator and
> serializer (or reader, or mount), and any number of transformers. And
> map:match is one of the tools allowing to choose them depending on the
> environment.
>
> Here is an example to clarify this...
>
> <map:match>
> <map:generate>
> <map:transform>
> <map:serialize>
> </map:match>
>
> This *is* legal. Now, is this leagal or not:
>
> Root:
> <map:match>
> <map:mount>
> </map:match>
> Sub:
> <map:generate>
> <map:transform>
> <map:serialize>
>
> It is semantically identical, but broken on two physical pieces. If you
> merge these two physical pieces into one entity, it would not differ
> from
> previous example. Tell me why this second example is wrong and not
> legal.
The 'mount' semantic where designed to mount 'sub-sitemaps' not
'sup-pipelines'.
This because we thought that 'sitemaps' should be modularized, not
pipelines.
Whether this is a good design choice or not, it's up to discussion. No
problem with that.
In fact, in the following email I will start this discussion myself.
> > At the same time, I see your point: the post-action can be executed if
> > no matcher is entered... and we can't forbid this to happen unless we
> > force the creation of a new semantic like 'default-match', which I
> > think, sucks.
> >
> > So, yeah, I was wrong, there is a possibility when these post-actions
> > are reachable, but only when no matchers are found, the other example
> > you provide should not be possible.
>
> Ok. Now let's hear your opinion why other example is not possible ;)
Reading both Berin's and your comment, I started thinking that some of
my original design ideas might be too limiting and not really necessary.
See my next email on the subject.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
>
> Vadim Gritsenko wrote:
>
> > Not exactly correct... they are reachable...
> >
> > >
> > > <pipeline>
> > > <act>
> > > <match>
> > > <act>
> > > <match>
> > > <act>
> > > </pipeline>
> > >
> > > the third one is never reached.
> >
> > It *is* reached if none of the matchers are matched *or* if matched
> > matchers had no <map:serialize|mount>. In these cases, last actions
is
> > executed right before <map:handle-errors/>.
>
> Gosh, if this is your vision, we have a problem.
No, that's not my vision: that's the reality we live in.
1. Quoting Carsten:
- the sitemap is processed top-down, the processing stops:
* when a serialize is reached
* when a reader is reached
* when the end is reached
It exactly means that this last <act> will be executed when mentioned
conditions are met.
2. Quoting current sitemap.xsl:
try {
<xsl:for-each select="map:match"> //This is to be changed on:
//"map:match|map:select|map:act"
...
</xsl:for-each>
<xsl:if test="position() = last()">
throw new ResourceNotFoundException("No pipeline matched request:
" + environment.getURIPrefix()+'/'+environment.getURI());
</xsl:if>
} catch (...Exception e) {
// Error handling goes here...
}
> The original design was that 'handle-errors' should be sort of a
> try/catch statement, not a procedural call that you can assume to be
> called at the end. It's not *at the end* of the pipeline. It could be
> explicitly written on top or in between, things shouldn't change.
That's how it is done currently. Feel free to put it on top of the
sitemap.
Our opinions do not differ here.
> Also, and more important, if a matcher doesn't have a
> mount|serializer|reader, it's an error. The sitemap shouldn't even be
> loaded.
My vision was that map:pipeline *must* have at least one generator and
serializer (or reader, or mount), and any number of transformers. And
map:match is one of the tools allowing to choose them depending on the
environment.
Here is an example to clarify this...
<map:match>
<map:generate>
<map:transform>
<map:serialize>
</map:match>
This *is* legal. Now, is this leagal or not:
Root:
<map:match>
<map:mount>
</map:match>
Sub:
<map:generate>
<map:transform>
<map:serialize>
It is semantically identical, but broken on two physical pieces. If you
merge these two physical pieces into one entity, it would not differ
from
previous example. Tell me why this second example is wrong and not
legal.
> At the same time, I see your point: the post-action can be executed if
> no matcher is entered... and we can't forbid this to happen unless we
> force the creation of a new semantic like 'default-match', which I
> think, sucks.
>
> So, yeah, I was wrong, there is a possibility when these post-actions
> are reachable, but only when no matchers are found, the other example
> you provide should not be possible.
Ok. Now let's hear your opinion why other example is not possible ;)
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Vadim Gritsenko wrote:
> Not exactly correct... they are reachable...
>
> >
> > <pipeline>
> > <act>
> > <match>
> > <act>
> > <match>
> > <act>
> > </pipeline>
> >
> > the third one is never reached.
>
> It *is* reached if none of the matchers are matched *or* if matched
> matchers had no <map:serialize|mount>. In these cases, last actions is
> executed right before <map:handle-errors/>.
Gosh, if this is your vision, we have a problem.
The original design was that 'handle-errors' should be sort of a
try/catch statement, not a procedural call that you can assume to be
called at the end. It's not *at the end* of the pipeline. It could be
explicitly written on top or in between, things shouldn't change.
Also, and more important, if a matcher doesn't have a
mount|serializer|reader, it's an error. The sitemap shouldn't even be
loaded.
At the same time, I see your point: the post-action can be executed if
no matcher is entered... and we can't forbid this to happen unless we
force the creation of a new semantic like 'default-match', which I
think, sucks.
So, yeah, I was wrong, there is a possibility when these post-actions
are reachable, but only when no matchers are found, the other example
you provide should not be possible.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
>
> Vadim Gritsenko wrote:
>
> > you have product catalog sub-sitemap:
> >
> > <!-- high precedence URL patterns -->
> > <map:match>...</map:match>
> >
> > <!-- process request parameters productId=xxx&addToComparison=yes
-->
> > <map:act type="add-to-comparison"/>
> >
> > <map:act type="product-selection">
> > <map:generate/>
> > <map:serialize/>
> > </map:act>
> >
> > <!-- low precedence URL patterns -->
> > <map:match>...</map:match>
> >
> > Example might be not perfect, but it gives an idea...
>
> Yeah, gives me the idea that the whole concept is screwed and can
> potentially be very harmful in the future!
Not sure that I see what you see... Could you re-do this fragment so it
is not screwed? It would help me understand your vision.
> > From the above fragment, the low precedence URL patterns are
> > unreachable!
>
> I have the perception that allowing actions (that are *always*
executed)
> to happen side by side to matchers (which are not always executed) can
> lead to potentially dangerous results, like your example above!
>
> if a cocoon developer can make such a mistake, imagine what a cocoon
> newbie can do!
Please, explain what is so dangerous here - so I would not make same
mistake in the future ;)
> > > The "theme-selection" action above can be either
> > > pre/intra/post-matching
> > > depending on the precedence order of URL patterns. An
intra-matching
> > > example :
> > >
> > > <!-- non-themed high precedence URL patterns -->
> > > <map:match>...</map:match>
> > >
> > > <!-- themed URL patterns -->
> > > <map:act type="theme-selection">
> > > <map:match>...</map:match>
> > > <map:match>...</map:match>
> > > </map:act>
> > >
> > > <!-- non-themed low precedence URL patterns -->
> > > <map:match>...</map:match>
> > >
> > > With this new criteria :
> > > +1 for pre/intra/post-matching non-empty actions
> > > +1 for pre-matching empty actions : this can be used to setup some
> > > application-level context
> >
> > Fully agree with you here.
> >
> > > -0 for intra/post-matching empty actions : I don't see any real
> > > usefullness for them.
> >
> > May be you can change your mind at least for +0? ;)
>
> Thinking about it more, I'd be in favor of:
>
> 1) allowing empty actions to live at the same level of matchers.
>
> 2) non-empty actions at the matching level *must* contain a matcher.
>
> It is impossible to change the semantics of 'getting out of the
sitemap'
> without creating back incompatibilities, so this states that 'post'
> match-level action are never reacheable.
Not exactly correct... they are reachable...
>
> <pipeline>
> <act>
> <match>
> <act>
> <match>
> <act>
> </pipeline>
>
> the third one is never reached.
It *is* reached if none of the matchers are matched *or* if matched
matchers had no <map:serialize|mount>. In these cases, last actions is
executed right before <map:handle-errors/>.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Vadim Gritsenko wrote:
> you have product catalog sub-sitemap:
>
> <!-- high precedence URL patterns -->
> <map:match>...</map:match>
>
> <!-- process request parameters productId=xxx&addToComparison=yes -->
> <map:act type="add-to-comparison"/>
>
> <map:act type="product-selection">
> <map:generate/>
> <map:serialize/>
> </map:act>
>
> <!-- low precedence URL patterns -->
> <map:match>...</map:match>
>
> Example might be not perfect, but it gives an idea...
Yeah, gives me the idea that the whole concept is screwed and can
potentially be very harmful in the future!
>>From the above fragment, the low precedence URL patterns are
unreachable!
I have the perception that allowing actions (that are *always* executed)
to happen side by side to matchers (which are not always executed) can
lead to potentially dangerous results, like your example above!
if a cocoon developer can make such a mistake, imagine what a cocoon
newbie can do!
> >
> > The "theme-selection" action above can be either
> pre/intra/post-matching
> > depending on the precedence order of URL patterns. An intra-matching
> > example :
> >
> > <!-- non-themed high precedence URL patterns -->
> > <map:match>...</map:match>
> >
> > <!-- themed URL patterns -->
> > <map:act type="theme-selection">
> > <map:match>...</map:match>
> > <map:match>...</map:match>
> > </map:act>
> >
> > <!-- non-themed low precedence URL patterns -->
> > <map:match>...</map:match>
> >
> > With this new criteria :
> > +1 for pre/intra/post-matching non-empty actions
> > +1 for pre-matching empty actions : this can be used to setup some
> > application-level context
>
> Fully agree with you here.
>
> > -0 for intra/post-matching empty actions : I don't see any real
> > usefullness for them.
>
> May be you can change your mind at least for +0? ;)
Thinking about it more, I'd be in favor of:
1) allowing empty actions to live at the same level of matchers.
2) non-empty actions at the matching level *must* contain a matcher.
It is impossible to change the semantics of 'getting out of the sitemap'
without creating back incompatibilities, so this states that 'post'
match-level action are never reacheable.
<pipeline>
<act>
<match>
<act>
<match>
<act>
</pipeline>
the third one is never reached.
I personally don't think this is a problem unless somebody changes my
mind.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Sylvain Wallez [mailto:sylvain.wallez@anyware-tech.com]
>
> Stefano Mazzocchi a écrit :
> >
> > Berin Loritsch wrote:
> >
<examples of useful unmatched actions from Berin go here>
> > Ok, I think Berin identified the need for unmatched actions, now,
let's
> > get a little deeper, please, answer these questions:
> >
> > do you see the need for 'pre/post' matching actions?
> >
> > do you see the need for 'intra-matching' actions?
>
> Another criteria that should be taken in to account is : does the
action
> have pipeline-building children or not ?
Please, do not use such criteria. Empty actions could be useful also.
Say,
you have product catalog sub-sitemap:
<!-- high precedence URL patterns -->
<map:match>...</map:match>
<!-- process request parameters productId=xxx&addToComparison=yes -->
<map:act type="add-to-comparison"/>
<map:act type="product-selection">
<map:generate/>
<map:serialize/>
</map:act>
<!-- low precedence URL patterns -->
<map:match>...</map:match>
Example might be not perfect, but it gives an idea...
>
> The "theme-selection" action above can be either
pre/intra/post-matching
> depending on the precedence order of URL patterns. An intra-matching
> example :
>
> <!-- non-themed high precedence URL patterns -->
> <map:match>...</map:match>
>
> <!-- themed URL patterns -->
> <map:act type="theme-selection">
> <map:match>...</map:match>
> <map:match>...</map:match>
> </map:act>
>
> <!-- non-themed low precedence URL patterns -->
> <map:match>...</map:match>
>
> With this new criteria :
> +1 for pre/intra/post-matching non-empty actions
> +1 for pre-matching empty actions : this can be used to setup some
> application-level context
Fully agree with you here.
> -0 for intra/post-matching empty actions : I don't see any real
> usefullness for them.
May be you can change your mind at least for +0? ;)
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Summorizing Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
>
> Vadim Gritsenko wrote:
> >
> > > From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> > >
> > > - only match is allowed as top-level element
> >
> > It is not correct.
>
> No, it *is* correct. You are proposing to change what the original
> design was (which is totally fair) but it's wrong to state that the
> above is incorrect.
Ok, yes, it might be correct - do not remember original design
in much details :)
What I meant is it looks to me like it is not logical.
> > I propose to allow following constructs:
> > * map:match
> > * map:select
> > * map:act
> > I'm +5 on this, and can help implement this if everybody agrees.
>
> ok, for act, but select?
Actually, I'm surprised that people are to add actions first, not
selectors.
Selectors look like first and obvious choice for promoting them as
first-class
sitemap citizens: I do not see lots of difference between them and
matchers.
Consider an example of root sitemap:
<map:select type="host">
<map:when test="www">
<map:mount/>
<map:when/>
<map:when test="one">
<map:mount/>
<map:when/>
<map:when test="two">
<map:mount/>
<map:when/>
<map:otherwise>
<map:mount/>
<map:otherwise/>
</map:select>
And creating WildcardURISelector and RegexpURISelector does not look
like
a challenge.
Don't you think that matchers and selectors should have same rights?
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Summorizing Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Vadim Gritsenko wrote:
>
> > From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> >
> > Hi,
>
> Hi Carsten and all,
>
> >
> > before we continue discussion things like pre/intra/post-matching
> actions,
> > can someone summarize the current semantics of the sitemap as it
> *should*
> > be? I can only describe it, as it is currently implemented:
>
> It seems to me - and to others on the list too - that we have some bugs
> in
> current sitemap implementation. I will put my suggestions below.
>
> >
> > - only match is allowed as top-level element
>
> It is not correct.
No, it *is* correct. You are proposing to change what the original
design was (which is totally fair) but it's wrong to state that the
above is incorrect.
> I propose to allow following constructs:
> * map:match
> * map:select
> * map:act
> I'm +5 on this, and can help implement this if everybody agrees.
ok, for act, but select?
> Allowing map:generate, map:transform, map:serialize, and map:read looks
> like
> overkill to me, but sometimes can be useful (especially in subsitemaps).
> I'm
> somewhere around -0.5 on this.
-1 verbosity sometimes is useful, provides context and
autodocumentation.
> > - the sitemap is processed top-down, the processing stops:
> > * when a serialize is reached
> > * when a reader is reached
> > * when the end is reached
> > - match: if match successful, processing continues inside
> > - select: if a test is successful, processing continues inside this
> test
> > else processing continues in otherwise
> > - act: action is executed. If it returns something, processing
> > is executed inside the element
> > - generate: generator is added to pipeline
> > - transform: transformer is added to pipeline
> > - serialize: serializer is added to pipeline, processing ends
> > - reader: reader is added to pipeline, processing ends
>
> This looks Ok to me; any changes here will break compatibility.
>
> Another construct which is left behind is map:aggregate. Do we allow
> matches/selectors/actions inside map:aggregate? We need to agree on what
> we allow under map:aggregate:
>
> Already there:
> * map:part
> Other possible candidates:
> * map:match
> * map:act
> * map:select
> I'm +1 on these additions.
Agreed.
> Vote -1 goes to:
> * map:generate/map:serialize/map:transform/map:read
Same here, it would make pipelines too complex and would inhibit the use
of internal redirection (cocoon: protocol) which is a good way, IMO, to
suggest the use of SoC patterns inside your URI space.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Summorizing Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
>
> Hi,
Hi Carsten and all,
>
> before we continue discussion things like pre/intra/post-matching
actions,
> can someone summarize the current semantics of the sitemap as it
*should*
> be? I can only describe it, as it is currently implemented:
It seems to me - and to others on the list too - that we have some bugs
in
current sitemap implementation. I will put my suggestions below.
>
> - only match is allowed as top-level element
It is not correct. I propose to allow following constructs:
* map:match
* map:select
* map:act
I'm +5 on this, and can help implement this if everybody agrees.
Allowing map:generate, map:transform, map:serialize, and map:read looks
like
overkill to me, but sometimes can be useful (especially in subsitemaps).
I'm
somewhere around -0.5 on this.
> - the sitemap is processed top-down, the processing stops:
> * when a serialize is reached
> * when a reader is reached
> * when the end is reached
> - match: if match successful, processing continues inside
> - select: if a test is successful, processing continues inside this
test
> else processing continues in otherwise
> - act: action is executed. If it returns something, processing
> is executed inside the element
> - generate: generator is added to pipeline
> - transform: transformer is added to pipeline
> - serialize: serializer is added to pipeline, processing ends
> - reader: reader is added to pipeline, processing ends
This looks Ok to me; any changes here will break compatibility.
Another construct which is left behind is map:aggregate. Do we allow
matches/selectors/actions inside map:aggregate? We need to agree on what
we allow under map:aggregate:
Already there:
* map:part
Other possible candidates:
* map:match
* map:act
* map:select
I'm +1 on these additions.
Vote -1 goes to:
* map:generate/map:serialize/map:transform/map:read
>
> So the first question to answer is: is this the semantics wanted for
2.0?
> Or do we have any bugs?
I see that some of us agree that we have bugs. Let's identify bugs which
we
are going to fix. Please place your comments/votes.
Regards,
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by giacomo <gi...@apache.org>.
On Fri, 4 Jan 2002, Carsten Ziegeler wrote:
> Hi,
>
> before we continue discussion things like pre/intra/post-matching actions,
> can someone summarize the current semantics of the sitemap as it *should*
> be? I can only describe it, as it is currently implemented:
>
> - only match is allowed as top-level element
Correct.
> - the sitemap is processed top-down, the processing stops:
> * when a serialize is reached
> * when a reader is reached
> * when the end is reached
Yup.
> - match: if match successful, processing continues inside
But it can fall out the match if no reader/serializer was selected
inside.
> - select: if a test is successful, processing continues inside this test
> else processing continues in otherwise
Ja.
> - act: action is executed. If it returns something, processing
> is executed inside the element
Giusto.
> - generate: generator is added to pipeline
Yes.
> - transform: transformer is added to pipeline
Oui (now I'm running out of words, will use symbols :)
> - serialize: serializer is added to pipeline, processing ends
+
> - reader: reader is added to pipeline, processing ends
++
> So the first question to answer is: is this the semantics wanted for 2.0?
I think it is exaclty as it was discussed and is implemented.
> Or do we have any bugs?
?
Giacomo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi,
before we continue discussion things like pre/intra/post-matching actions,
can someone summarize the current semantics of the sitemap as it *should*
be? I can only describe it, as it is currently implemented:
- only match is allowed as top-level element
- the sitemap is processed top-down, the processing stops:
* when a serialize is reached
* when a reader is reached
* when the end is reached
- match: if match successful, processing continues inside
- select: if a test is successful, processing continues inside this test
else processing continues in otherwise
- act: action is executed. If it returns something, processing
is executed inside the element
- generate: generator is added to pipeline
- transform: transformer is added to pipeline
- serialize: serializer is added to pipeline, processing ends
- reader: reader is added to pipeline, processing ends
So the first question to answer is: is this the semantics wanted for 2.0?
Or do we have any bugs?
Nice weekend,
Carsten
<snip all>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Stefano Mazzocchi a écrit :
>
> Berin Loritsch wrote:
>
> > > The real question is: are those unmatched action useful in real life?
> >
> > Yes. Here are two examples:
> >
> > 1) Themed Site
> > The Action will determine what theme to apply to the site (I did this using
> > session to maintain the theme once the user selected it). Currently, I have
> > that Action as the root of every single <map:match> in the sitemap. It would
> > be more usefull to have this:
> >
> > <map:act type="theme-selector">
> > <map:match>...</map:match>
> > <map:match>...</map:match>
> > <map:match>...</map:match>
> > <map:match>...</map:match>
> > </map:act>
> >
> > 2) Authenticated Site
> > It would be useful (especially for child sitemaps) to have an authentication
> > action happen before any protected resource can be selected. In many corporate
> > webapps, the entire site must be protected.
>
> Makes perfect sense.
>
> Ok, I think Berin identified the need for unmatched actions, now, let's
> get a little deeper, please, answer these questions:
>
> do you see the need for 'pre/post' matching actions?
>
> do you see the need for 'intra-matching' actions?
Another criteria that should be taken in to account is : does the action
have pipeline-building children or not ?
The "theme-selection" action above can be either pre/intra/post-matching
depending on the precedence order of URL patterns. An intra-matching
example :
<!-- non-themed high precedence URL patterns -->
<map:match>...</map:match>
<!-- themed URL patterns -->
<map:act type="theme-selection">
<map:match>...</map:match>
<map:match>...</map:match>
</map:act>
<!-- non-themed low precedence URL patterns -->
<map:match>...</map:match>
With this new criteria :
+1 for pre/intra/post-matching non-empty actions
+1 for pre-matching empty actions : this can be used to setup some
application-level context
-0 for intra/post-matching empty actions : I don't see any real
usefullness for them.
Sylvain
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Berin Loritsch wrote:
> > The real question is: are those unmatched action useful in real life?
>
> Yes. Here are two examples:
>
> 1) Themed Site
> The Action will determine what theme to apply to the site (I did this using
> session to maintain the theme once the user selected it). Currently, I have
> that Action as the root of every single <map:match> in the sitemap. It would
> be more usefull to have this:
>
> <map:act type="theme-selector">
> <map:match>...</map:match>
> <map:match>...</map:match>
> <map:match>...</map:match>
> <map:match>...</map:match>
> </map:act>
>
> 2) Authenticated Site
> It would be useful (especially for child sitemaps) to have an authentication
> action happen before any protected resource can be selected. In many corporate
> webapps, the entire site must be protected.
Makes perfect sense.
Ok, I think Berin identified the need for unmatched actions, now, let's
get a little deeper, please, answer these questions:
do you see the need for 'pre/post' matching actions?
do you see the need for 'intra-matching' actions?
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Berin Loritsch <bl...@apache.org>.
Stefano Mazzocchi wrote:
>
> 3) make it illegal to have intra-matching actions
>
> [the option of allowing intra-matching actions is, IMO, wrong by design]
>
> The real question is: are those unmatched action useful in real life?
Yes. Here are two examples:
1) Themed Site
The Action will determine what theme to apply to the site (I did this using
session to maintain the theme once the user selected it). Currently, I have
that Action as the root of every single <map:match> in the sitemap. It would
be more usefull to have this:
<map:act type="theme-selector">
<map:match>...</map:match>
<map:match>...</map:match>
<map:match>...</map:match>
<map:match>...</map:match>
</map:act>
2) Authenticated Site
It would be useful (especially for child sitemaps) to have an authentication
action happen before any protected resource can be selected. In many corporate
webapps, the entire site must be protected.
--
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
John Morrison wrote:
>>Agreed. -1 as well. Well, until somebody comes up with the need for an
>>action to be executed *after* a serializer.
>>
>
>How about this one: if the serializer doesn't throw an exception then
>you *know(?)* the client recieved the request. An action after
>serialization maybe to log the fact that they got it perhap for usage
>charging...?
>
>J.
>
Don't forget that the sitemap is a regular component (in HEAD, not in
2.0). So such accounting could be also done at Processor level : just
add this feature to a subclass/wrapper of SitemapHandler (or soon
TreeProcessor ?) and list that component in cocoon.xconf.
Sylvain
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
John Morrison wrote:
> > Agreed. -1 as well. Well, until somebody comes up with the need for an
> > action to be executed *after* a serializer.
>
> How about this one: if the serializer doesn't throw an exception then
> you *know(?)* the client recieved the request. An action after
> serialization maybe to log the fact that they got it perhap for usage
> charging...?
Clever example, but the question mark you used is the key: there is no
way to tell if the fact that serialization was complete automatically
implies that the browser really received that data.
User complains will force you to turn it into a subscription-based
format, where validation (and payment) is performed *before* the page is
viewed.
Also, micropayments will never work no matter what technology powers its
security because the amount of 'frustration' intrinsic the act of
'buying' (measuring the relefance of a choice) is not linearly
proportional with the amount of money exchanged. For example. flat rates
are percieved as less expensive, because they reduce the amount of
frustration at one big choice instead of a miriad of small ones.
Anyway, since exceptions can be logged, it would be pretty easy to
post-process the logs for charging even without the need for a specific
action.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by John Morrison <jo...@ntlworld.com>.
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
> Carsten Ziegeler wrote:
> > Stefano Mazzocchi wrote:
<snip/>
> > For b) I'm not sure. It might make sense to execute actions after
> > the xml pipeline is executed. But changing this is incompatible!
> > Existing sitemaps would then be executed differently than before.
> > For example, if you have
> > <match>
> > <generate/>
> > <serialize/>
> > </match>
> > <act/>
> > the action is currently only executed, if the match is not successful.
> > Changing this would execute the action always!
> > So I'm -0.5 on this.
>
> Agreed. -1 as well. Well, until somebody comes up with the need for an
> action to be executed *after* a serializer.
How about this one: if the serializer doesn't throw an exception then
you *know(?)* the client recieved the request. An action after
serialization maybe to log the fact that they got it perhap for usage
charging...?
J.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Carsten Ziegeler wrote:
>
> Stefano Mazzocchi wrote:
> >
> > <snip>
> >
> > -0 for allowing this change before the flowmap semantics are being
> > worked on. I mean: if you allow something like
> >
> > <pipeline>
> > <act name="pre-matching"/>
> > <match>...</match>
> > <match>...</match>
> > <match>...</match>
> > </pipeline>
> >
> > people start doing
> >
> > <pipeline>
> > <act name="pre-matching"/>
> > <match>...</match>
> > <match>...</match>
> > <match>...</match>
> > <act name="post-matching"/>
> > </pipeline>
> >
> > and then
> >
> > <pipeline>
> > <act name="pre-matching"/>
> > <match>...</match>
> > <act name="intra-matching"/>
> > <match>...</match>
> > <match>...</match>
> > <act name="post-matching"/>
> > </pipeline>
> >
> > but then the question is: is "intra-matching" performed if the first
> > match is successful?
> >
> > Placing map:act at the same level of map:match can be perceived as a
> > design mistake, but might not be since 'matcher' and 'actions' are not
> > pipeline components since they don't work on the pipeline directly.
> >
>
> The current semantics of the sitemap stops executing the sitemap, if
> a reader of a serializer is found. So any other component following
> in the sitemap regardless if it is an action, a matcher or a generator
> is ignored.
>
> So a simple:
> <match>
> <generate/>
> <serialize/>
> <act/>
> </match>
>
> reveals the same problem!
Damn, you're right. Gosh I much I hate actions! :)
> I think these are two different things:
> a) Are only matchers allowed as top level elements?
> b) When does the executing of the sitemap stop? Is the example
> from above wanted?
>
> I think we should answer a) with a yes. We saw several examples in
> this thread, that a top-level action does make sense. And it would
> not break compatibility.
I tend to agree.
> For b) I'm not sure. It might make sense to execute actions after
> the xml pipeline is executed. But changing this is incompatible!
> Existing sitemaps would then be executed differently than before.
> For example, if you have
> <match>
> <generate/>
> <serialize/>
> </match>
> <act/>
> the action is currently only executed, if the match is not successful.
> Changing this would execute the action always!
> So I'm -0.5 on this.
Agreed. -1 as well. Well, until somebody comes up with the need for an
action to be executed *after* a serializer.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
>
> Vadim Gritsenko wrote:
>
<snip/>
> > -10 on changing current sitemap semantics. It's even worse then
breaking
> > compatibility. For before pipeline execution / after pipeline
execution
> > actions, it is better to have another kind of component, which is
> > similar to actions, but with different semantics and name (e.g.,
> > "pipeline-action"; current actions could be thought as
> > "sitemap-action").
>
> -100000 on breaking back compatibility for this.
>
> -1 on having two different semantics for a component that has the very
> same behavior but just happens to live in different places.
Actually, "actions" that are executed before/in the middle/after
pipeline
execution remind me of transformers with some side effects (environment
modifications). Think of LogTransformer as of pipeline action, which is
executed on every element. If one needs pre/post pipeline "actions", he
can do this by implementing transformer...
(that's my thoughts about it, I never had a desire of such actions)
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Vadim Gritsenko wrote:
> But you can rephrase this:
>
> <pipeline>
> <match pattern="**"><act name="pre-matching"/></match>
> <match>...</match>
> <match pattern="**"><act name="intra-matching"/></match>
> <match>...</match>
> <match>...</match>
> <match pattern="**"><act name="post-matching"/></match>
> </pipeline>
>
> This is perfectly legal now and leaves possibility for the same
> questions.
> So it does not make sense to disable this functionality (unmatched
> actions)
> because of such argument.
ok
<snip/>
> -10 on changing current sitemap semantics. It's even worse then breaking
> compatibility. For before pipeline execution / after pipeline execution
> actions, it is better to have another kind of component, which is
> similar to actions, but with different semantics and name (e.g.,
> "pipeline-action"; current actions could be thought as
> "sitemap-action").
-100000 on breaking back compatibility for this.
-1 on having two different semantics for a component that has the very
same behavior but just happens to live in different places.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
>
> Stefano Mazzocchi wrote:
> >
<snip>
> > <pipeline>
> > <act name="pre-matching"/>
> > <match>...</match>
> > <act name="intra-matching"/>
> > <match>...</match>
> > <match>...</match>
> > <act name="post-matching"/>
> > </pipeline>
> >
> > but then the question is: is "intra-matching" performed if the first
> > match is successful?
But you can rephrase this:
<pipeline>
<match pattern="**"><act name="pre-matching"/></match>
<match>...</match>
<match pattern="**"><act name="intra-matching"/></match>
<match>...</match>
<match>...</match>
<match pattern="**"><act name="post-matching"/></match>
</pipeline>
This is perfectly legal now and leaves possibility for the same
questions.
So it does not make sense to disable this functionality (unmatched
actions)
because of such argument.
> >
> > Placing map:act at the same level of map:match can be perceived as a
> > design mistake, but might not be since 'matcher' and 'actions' are
not
> > pipeline components since they don't work on the pipeline directly.
> >
>
> The current semantics of the sitemap stops executing the sitemap, if
> a reader of a serializer is found. So any other component following
> in the sitemap regardless if it is an action, a matcher or a generator
> is ignored.
>
> So a simple:
> <match>
> <generate/>
> <serialize/>
> <act/>
> </match>
>
> reveals the same problem! I think these are two different things:
> a) Are only matchers allowed as top level elements?
> b) When does the executing of the sitemap stop? Is the example
> from above wanted?
>
> I think we should answer a) with a yes. We saw several examples in
> this thread, that a top-level action does make sense. And it would
> not break compatibility.
Did you meant "No, not only matchers"?
>
> For b) I'm not sure. It might make sense to execute actions after
> the xml pipeline is executed. But changing this is incompatible!
> Existing sitemaps would then be executed differently than before.
> For example, if you have
> <match>
> <generate/>
> <serialize/>
> </match>
> <act/>
> the action is currently only executed, if the match is not successful.
> Changing this would execute the action always!
> So I'm -0.5 on this.
-10 on changing current sitemap semantics. It's even worse then breaking
compatibility. For before pipeline execution / after pipeline execution
actions, it is better to have another kind of component, which is
similar to
actions, but with different semantics and name (e.g., "pipeline-action";
current actions could be thought as "sitemap-action").
Vadim
>
> Carsten
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Allowed Sitemap Constructs
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Stefano Mazzocchi wrote:
>
> <snip>
>
> -0 for allowing this change before the flowmap semantics are being
> worked on. I mean: if you allow something like
>
> <pipeline>
> <act name="pre-matching"/>
> <match>...</match>
> <match>...</match>
> <match>...</match>
> </pipeline>
>
> people start doing
>
> <pipeline>
> <act name="pre-matching"/>
> <match>...</match>
> <match>...</match>
> <match>...</match>
> <act name="post-matching"/>
> </pipeline>
>
> and then
>
> <pipeline>
> <act name="pre-matching"/>
> <match>...</match>
> <act name="intra-matching"/>
> <match>...</match>
> <match>...</match>
> <act name="post-matching"/>
> </pipeline>
>
> but then the question is: is "intra-matching" performed if the first
> match is successful?
>
> Placing map:act at the same level of map:match can be perceived as a
> design mistake, but might not be since 'matcher' and 'actions' are not
> pipeline components since they don't work on the pipeline directly.
>
The current semantics of the sitemap stops executing the sitemap, if
a reader of a serializer is found. So any other component following
in the sitemap regardless if it is an action, a matcher or a generator
is ignored.
So a simple:
<match>
<generate/>
<serialize/>
<act/>
</match>
reveals the same problem! I think these are two different things:
a) Are only matchers allowed as top level elements?
b) When does the executing of the sitemap stop? Is the example
from above wanted?
I think we should answer a) with a yes. We saw several examples in
this thread, that a top-level action does make sense. And it would
not break compatibility.
For b) I'm not sure. It might make sense to execute actions after
the xml pipeline is executed. But changing this is incompatible!
Existing sitemaps would then be executed differently than before.
For example, if you have
<match>
<generate/>
<serialize/>
</match>
<act/>
the action is currently only executed, if the match is not successful.
Changing this would execute the action always!
So I'm -0.5 on this.
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Stefano Mazzocchi <st...@apache.org>.
Carsten Ziegeler wrote:
>
> Hi,
>
> I currently run into the problem that I created pipelines which I
> thought were possible, but currently are not support by Cocoon:
>
> It is not possible to nest anything other than a map:part into
> a map:aggregate, so the following doesn't work:
> <map:aggregate>
> <map:select type="test">
> <map:when test="a">
> <map:part src="a"/>
> </map:when>
> <map:otherwise>
> <map:part src="b"/>
> </map:otherwise>
> </map:select>
> <map:part src="constant"/>
> </map:aggregate>
>
> Is this a bug or is this by design?
I didn't partecipate in the design of the 'aggregating' semantics of the
sitemap, but I would think the above is a bug. I don't see why it
shouldn't be possible to use the above since it would be useful in many
situations.
> My personal opinion is, that this should be possible.
I tend to resonate with your vision.
> Another restriction we currently have is already entered as a bug with
> the number 4357: An Action is not possible as a root element inside
> a map:pipeline, only map:match can be a used as a root element.
> So here again, is this by design?
oh, god, this is a big one.
Here the restriction is by design, but I do see the need to question it.
My perception is that this might open to door to a shitload of semantic
changes to adapt to the required flow-map like semantics.
But at the same time, I do see the need for use of match-less actions:
the question is how much of a 'hack' this is.
> I think we shouldn't make such restrictions. But at least if we make
> these restrictions we should document them.
+1 for documenting all the restriction. This is obvious.
-0 for allowing this change before the flowmap semantics are being
worked on. I mean: if you allow something like
<pipeline>
<act name="pre-matching"/>
<match>...</match>
<match>...</match>
<match>...</match>
</pipeline>
people start doing
<pipeline>
<act name="pre-matching"/>
<match>...</match>
<match>...</match>
<match>...</match>
<act name="post-matching"/>
</pipeline>
and then
<pipeline>
<act name="pre-matching"/>
<match>...</match>
<act name="intra-matching"/>
<match>...</match>
<match>...</match>
<act name="post-matching"/>
</pipeline>
but then the question is: is "intra-matching" performed if the first
match is successful?
Placing map:act at the same level of map:match can be perceived as a
design mistake, but might not be since 'matcher' and 'actions' are not
pipeline components since they don't work on the pipeline directly.
So, the options I see are:
1) make it illegal to have unmatched actions
2) encapsulate unmatched actions in defined places
<pipeline>
<pre-matching>
<act>
</pre-matching>
<match>...</match>
<match>...</match>
<match>...</match>
<post-matching>
<act>
</post-matching>
</pipeline>
3) make it illegal to have intra-matching actions
[the option of allowing intra-matching actions is, IMO, wrong by design]
The real question is: are those unmatched action useful in real life?
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Carsten Ziegeler a écrit :
>
> Sylvain Wallez wrote:
> >
> > Carsten Ziegeler a écrit :
> > >
> > > Hi,
> > >
> > > I currently run into the problem that I created pipelines which I
> > > thought were possible, but currently are not support by Cocoon:
> > >
> > > It is not possible to nest anything other than a map:part into
> > > a map:aggregate, so the following doesn't work:
> > > <map:aggregate>
> > > <map:select type="test">
> > > <map:when test="a">
> > > <map:part src="a"/>
> > > </map:when>
> > > <map:otherwise>
> > > <map:part src="b"/>
> > > </map:otherwise>
> > > </map:select>
> > > <map:part src="constant"/>
> > > </map:aggregate>
> > >
> > > Is this a bug or is this by design?
> > > My personal opinion is, that this should be possible.
> >
> > I guess this is by design. The above can be written as follows :
> >
> > <map:match pattern="variablepart.xml">
> > <map:select type="test">
> > <map:when test="a">
> > <map:generate src="a"/>
> > </map:when>
> > <map:otherwise>
> > <map:generate src="b"/>
> > </map:otherwise>
> > </map:select>
> > <map:serialize/>
> > </map:match>
> >
> > <map:match pattern="...">
> > <map:aggregate>
> > <map:part src="cocoon:/variablepart.xml"/>
> > <map:part src="constant"/>
> > </map:aggregate>
> > </map:match>
> >
> > It is sure less readable, but if we allow statements other than
> > <map:part> in <map:aggregate>, people will certainly soon ask for
> > <map:generate> or <map:transform> inside <map:part> !
> >
> Yes, this workaround is possible - but with the extra cost of internal
> processing which I wanted to avoid with my example above.
> To be honest, if I think about this, yes, a map:generate would be
> much better as a map:part! It would avoid some internal processings as well.
> Hmm, a map:transform - yes why not! Ok, just kidding.
> Yes, of course you're right that people always wanted more than
> is available. But I think this is not a reason why we should forbid
> putting a map:select inside a map:aggregate. Because if we forbid this,
> sometime people will ask for this and we are in the same situation.
OK. I see your point : you want to avoid the costly "cocoon:" recursive
call just for using a selector. We could allow "non-pipeline" statements
(i.e. match/select/act) and map:part as children of map:aggregate.
But allowing map:generate in map:part won't avoid a coslty part of
"cocoon:" which is the lookup of new pipelines. Also, this promotes
pipeline reuse (if you aggregate, the parts are likely to be reused).
> > > Another restriction we currently have is already entered as a bug with
> > > the number 4357: An Action is not possible as a root element inside
> > > a map:pipeline, only map:match can be a used as a root element.
> > > So here again, is this by design?
> >
> > This was allowed before we faced the 64 kbytes bytecode limit in the
> > generated class. IIRC, you were the one that faced this ;)
> >
> Hey, very good memory!
;)
> > We then decided to break the generated code into submethods based on
> > map:pipeline/map:match which as a side effect forbids any other
> > top-level construct.
> >
> > So this restriction is not "by design", but "by implementation" ! The
> > TreeProcessor (still have to write views for it to be finished) doesn't
> > have this limitation.
> >
> Yes, I noticed this when I looked at the sitemap.xsl. As far as I saw
> it should really be very easy to allow actions on the top-level again.
> So, I'm +1 on removing this restriction!
+1 also.
> Carsten
>
> > > I think we shouldn't make such restrictions. But at least if we make
> > > these restrictions we should document them.
> > >
> > > Regards,
> > > Carsten
> > >
> >
> > Sylvain
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 4:16 pm +0100 3/1/02, Nicola Ken Barozzi wrote:
>The imperative is KISS (keep it simple, stupid) against the FS (flexibility
>syndrome).
Ha Ha!
This message got filtered into the wrong mailbox, my diving rebreather is
called a KISS!!! see <http://www.hrc.wmin.ac.uk/KISS/> (Cocoon 1 site at
the moment).
I only ever came across this acronym in diving circles before ;)
regards Jeremy
--
___________________________________________________________________
Jeremy Quinn Karma Divers
webSpace Design
HyperMedia Research Centre
<ma...@mac.com> <http://www.media.demon.co.uk>
<phone:+44.[0].20.7737.6831> <pa...@vizzavi.net>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Nicola Ken Barozzi <ba...@nicolaken.com>.
----- Original Message -----
From: "Carsten Ziegeler" <cz...@s-und-n.de>
To: <co...@xml.apache.org>
Sent: Thursday, January 03, 2002 3:49 PM
Subject: RE: Allowed Sitemap Constructs
> Yes, of course you're right that people always wanted more than
> is available. But I think this is not a reason why we should forbid
> putting a map:select inside a map:aggregate. Because if we forbid this,
> sometime people will ask for this and we are in the same situation.
I remember discussion at the ApacheCon in London on what constructs to allow
in the sitemap.
I remember very well that many asked for "returns" in the sitemap (loops)
and forking of outputs, and it was decided that they weren't strictly
necessary, a bad as a programming practice and difficult to control and
fine-tune in implementation.
The imperative is KISS (keep it simple, stupid) against the FS (flexibility
syndrome).
Stefano exposed a very clear (and convincing) view on this and can be more
precise than me on the reasons that lead to this implementation.
The idea was basically that aggregation is part of content generation, so it
must deal only with xml content.
It was not meant to be a generic mean of aggregating pipelines but content
AFAIK.
Is this view correct?
How good is Cocoon in answering the needs that can be solved with selects in
aggregate?
People will ask for it only if they don't see a valid alternative.
What's the alternative? Is it valid, intuitive and easy enough?
Ken
--
Nicola Ken Barozzi xml-cocoon@nicolaken.com
These are the days of miracle and wonder...
...so don't cry baby, don't cry...
Paul Simon
RE: Allowed Sitemap Constructs
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Sylvain Wallez wrote:
>
> Carsten Ziegeler a écrit :
> >
> > Hi,
> >
> > I currently run into the problem that I created pipelines which I
> > thought were possible, but currently are not support by Cocoon:
> >
> > It is not possible to nest anything other than a map:part into
> > a map:aggregate, so the following doesn't work:
> > <map:aggregate>
> > <map:select type="test">
> > <map:when test="a">
> > <map:part src="a"/>
> > </map:when>
> > <map:otherwise>
> > <map:part src="b"/>
> > </map:otherwise>
> > </map:select>
> > <map:part src="constant"/>
> > </map:aggregate>
> >
> > Is this a bug or is this by design?
> > My personal opinion is, that this should be possible.
>
> I guess this is by design. The above can be written as follows :
>
> <map:match pattern="variablepart.xml">
> <map:select type="test">
> <map:when test="a">
> <map:generate src="a"/>
> </map:when>
> <map:otherwise>
> <map:generate src="b"/>
> </map:otherwise>
> </map:select>
> <map:serialize/>
> </map:match>
>
> <map:match pattern="...">
> <map:aggregate>
> <map:part src="cocoon:/variablepart.xml"/>
> <map:part src="constant"/>
> </map:aggregate>
> </map:match>
>
> It is sure less readable, but if we allow statements other than
> <map:part> in <map:aggregate>, people will certainly soon ask for
> <map:generate> or <map:transform> inside <map:part> !
>
Yes, this workaround is possible - but with the extra cost of internal
processing which I wanted to avoid with my example above.
To be honest, if I think about this, yes, a map:generate would be
much better as a map:part! It would avoid some internal processings as well.
Hmm, a map:transform - yes why not! Ok, just kidding.
Yes, of course you're right that people always wanted more than
is available. But I think this is not a reason why we should forbid
putting a map:select inside a map:aggregate. Because if we forbid this,
sometime people will ask for this and we are in the same situation.
> > Another restriction we currently have is already entered as a bug with
> > the number 4357: An Action is not possible as a root element inside
> > a map:pipeline, only map:match can be a used as a root element.
> > So here again, is this by design?
>
> This was allowed before we faced the 64 kbytes bytecode limit in the
> generated class. IIRC, you were the one that faced this ;)
>
Hey, very good memory!
> We then decided to break the generated code into submethods based on
> map:pipeline/map:match which as a side effect forbids any other
> top-level construct.
>
> So this restriction is not "by design", but "by implementation" ! The
> TreeProcessor (still have to write views for it to be finished) doesn't
> have this limitation.
>
Yes, I noticed this when I looked at the sitemap.xsl. As far as I saw
it should really be very easy to allow actions on the top-level again.
So, I'm +1 on removing this restriction!
Carsten
> > I think we shouldn't make such restrictions. But at least if we make
> > these restrictions we should document them.
> >
> > Regards,
> > Carsten
> >
>
> Sylvain
>
> --
> Sylvain Wallez
> Anyware Technologies - http://www.anyware-tech.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by giacomo <gi...@apache.org>.
On Thu, 3 Jan 2002, Sylvain Wallez wrote:
>
>
> Carsten Ziegeler a écrit :
> >
> > Hi,
> >
> > I currently run into the problem that I created pipelines which I
> > thought were possible, but currently are not support by Cocoon:
> >
> > It is not possible to nest anything other than a map:part into
> > a map:aggregate, so the following doesn't work:
> > <map:aggregate>
> > <map:select type="test">
> > <map:when test="a">
> > <map:part src="a"/>
> > </map:when>
> > <map:otherwise>
> > <map:part src="b"/>
> > </map:otherwise>
> > </map:select>
> > <map:part src="constant"/>
> > </map:aggregate>
> >
> > Is this a bug or is this by design?
> > My personal opinion is, that this should be possible.
>
> I guess this is by design. The above can be written as follows :
>
> <map:match pattern="variablepart.xml">
> <map:select type="test">
> <map:when test="a">
> <map:generate src="a"/>
> </map:when>
> <map:otherwise>
> <map:generate src="b"/>
> </map:otherwise>
> </map:select>
> <map:serialize/>
> </map:match>
>
> <map:match pattern="...">
> <map:aggregate>
> <map:part src="cocoon:/variablepart.xml"/>
> <map:part src="constant"/>
> </map:aggregate>
> </map:match>
>
> It is sure less readable, but if we allow statements other than
> <map:part> in <map:aggregate>, people will certainly soon ask for
> <map:generate> or <map:transform> inside <map:part> !
Yes, this is a point to take care!
Giacomo
> > Another restriction we currently have is already entered as a bug with
> > the number 4357: An Action is not possible as a root element inside
> > a map:pipeline, only map:match can be a used as a root element.
> > So here again, is this by design?
>
> This was allowed before we faced the 64 kbytes bytecode limit in the
> generated class. IIRC, you were the one that faced this ;)
>
> We then decided to break the generated code into submethods based on
> map:pipeline/map:match which as a side effect forbids any other
> top-level construct.
>
> So this restriction is not "by design", but "by implementation" ! The
> TreeProcessor (still have to write views for it to be finished) doesn't
> have this limitation.
>
> > I think we shouldn't make such restrictions. But at least if we make
> > these restrictions we should document them.
> >
> > Regards,
> > Carsten
> >
>
> Sylvain
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Torsten Curdt a écrit :
>
<snip/>
> > We then decided to break the generated code into submethods based on
> > map:pipeline/map:match which as a side effect forbids any other
> > top-level construct.
> >
> > So this restriction is not "by design", but "by implementation" ! The
> > TreeProcessor (still have to write views for it to be finished) doesn't
> > have this limitation.
>
> Cool! I'm really looking forward for this thing :)
You can try it out now : all is functionnal but views. Compile
scratchpad, and remplace the <sitemap> element in cocoon.xconf by
<sitemap class="org.apache.cocoon.treeprocessor.TreeProcessor">
Some sitemap loading speed tests on my 600 Mhz Win98 home PC :
- initial load of the main sitemap : about 5 secs
- reloading of the main sitemap : 0.9 secs (the difference is the cost
of cocoon warmup)
- loading of i18n sitemap : 0.2 secs
I didn't made request-handling speed test, but it is carefully optimized
: one-time lookup of ThreadSafe components, no variable replacement
scans in strings that don't have a {}, etc.
Enjoy !
Sylvain
> --
> Torsten
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Torsten Curdt <tc...@dff.st>.
> Carsten Ziegeler a �crit :
> >
> > Hi,
> >
> > I currently run into the problem that I created pipelines which I
> > thought were possible, but currently are not support by Cocoon:
> >
> > It is not possible to nest anything other than a map:part into
> > a map:aggregate, so the following doesn't work:
> > <map:aggregate>
> > <map:select type="test">
> > <map:when test="a">
> > <map:part src="a"/>
> > </map:when>
> > <map:otherwise>
> > <map:part src="b"/>
> > </map:otherwise>
> > </map:select>
> > <map:part src="constant"/>
> > </map:aggregate>
> >
> > Is this a bug or is this by design?
> > My personal opinion is, that this should be possible.
>
> I guess this is by design. The above can be written as follows :
>
> <map:match pattern="variablepart.xml">
> <map:select type="test">
> <map:when test="a">
> <map:generate src="a"/>
> </map:when>
> <map:otherwise>
> <map:generate src="b"/>
> </map:otherwise>
> </map:select>
> <map:serialize/>
> </map:match>
>
> <map:match pattern="...">
> <map:aggregate>
> <map:part src="cocoon:/variablepart.xml"/>
> <map:part src="constant"/>
> </map:aggregate>
> </map:match>
>
> It is sure less readable, but if we allow statements other than
> <map:part> in <map:aggregate>, people will certainly soon ask for
> <map:generate> or <map:transform> inside <map:part> !
I already did some while ago ;) and I'm still not quite convinced why this
is supposed to be bad (as the structure feels quite straight forward)
The current way bloats the sitemap unnecessarily losing
the demand of minimum verbosity (IMHO)
> > Another restriction we currently have is already entered as a bug with
> > the number 4357: An Action is not possible as a root element inside
> > a map:pipeline, only map:match can be a used as a root element.
> > So here again, is this by design?
>
> This was allowed before we faced the 64 kbytes bytecode limit in the
> generated class. IIRC, you were the one that faced this ;)
>
> We then decided to break the generated code into submethods based on
> map:pipeline/map:match which as a side effect forbids any other
> top-level construct.
>
> So this restriction is not "by design", but "by implementation" ! The
> TreeProcessor (still have to write views for it to be finished) doesn't
> have this limitation.
Cool! I'm really looking forward for this thing :)
--
Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Carsten Ziegeler a écrit :
>
> Hi,
>
> I currently run into the problem that I created pipelines which I
> thought were possible, but currently are not support by Cocoon:
>
> It is not possible to nest anything other than a map:part into
> a map:aggregate, so the following doesn't work:
> <map:aggregate>
> <map:select type="test">
> <map:when test="a">
> <map:part src="a"/>
> </map:when>
> <map:otherwise>
> <map:part src="b"/>
> </map:otherwise>
> </map:select>
> <map:part src="constant"/>
> </map:aggregate>
>
> Is this a bug or is this by design?
> My personal opinion is, that this should be possible.
I guess this is by design. The above can be written as follows :
<map:match pattern="variablepart.xml">
<map:select type="test">
<map:when test="a">
<map:generate src="a"/>
</map:when>
<map:otherwise>
<map:generate src="b"/>
</map:otherwise>
</map:select>
<map:serialize/>
</map:match>
<map:match pattern="...">
<map:aggregate>
<map:part src="cocoon:/variablepart.xml"/>
<map:part src="constant"/>
</map:aggregate>
</map:match>
It is sure less readable, but if we allow statements other than
<map:part> in <map:aggregate>, people will certainly soon ask for
<map:generate> or <map:transform> inside <map:part> !
> Another restriction we currently have is already entered as a bug with
> the number 4357: An Action is not possible as a root element inside
> a map:pipeline, only map:match can be a used as a root element.
> So here again, is this by design?
This was allowed before we faced the 64 kbytes bytecode limit in the
generated class. IIRC, you were the one that faced this ;)
We then decided to break the generated code into submethods based on
map:pipeline/map:match which as a side effect forbids any other
top-level construct.
So this restriction is not "by design", but "by implementation" ! The
TreeProcessor (still have to write views for it to be finished) doesn't
have this limitation.
> I think we shouldn't make such restrictions. But at least if we make
> these restrictions we should document them.
>
> Regards,
> Carsten
>
Sylvain
--
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Allowed Sitemap Constructs
Posted by giacomo <gi...@apache.org>.
On Thu, 3 Jan 2002, Carsten Ziegeler wrote:
> Hi,
>
> I currently run into the problem that I created pipelines which I
> thought were possible, but currently are not support by Cocoon:
>
> It is not possible to nest anything other than a map:part into
> a map:aggregate, so the following doesn't work:
> <map:aggregate>
> <map:select type="test">
> <map:when test="a">
> <map:part src="a"/>
> </map:when>
> <map:otherwise>
> <map:part src="b"/>
> </map:otherwise>
> </map:select>
> <map:part src="constant"/>
> </map:aggregate>
>
> Is this a bug or is this by design?
It is by design but IMO nothing prevents us from having your proposed
extension.
> My personal opinion is, that this should be possible.
>
> Another restriction we currently have is already entered as a bug with
> the number 4357: An Action is not possible as a root element inside
> a map:pipeline, only map:match can be a used as a root element.
> So here again, is this by design?
Yes, this is by design. The root elements inside a map:pipeline is a
map:match element.
We solved this by
<map:pipeline>
<map:match pattern="**">
<map:act type="..."/>
...
</map:match>
</map:pipeline>
> I think we shouldn't make such restrictions. But at least if we make
> these restrictions we should document them.
I thought it was documented, that there must be map:match-es as
direct children of map:pipeline (at least I though so).
Giacomo
>
> Regards,
> Carsten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org