You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Nicola Ken Barozzi <ni...@apache.org> on 2004/08/30 08:53:12 UTC

[Proposal] Add pass-through capability to mounted pipelines

Summary:

Developing Forrest, I seem to have stumbled in the need of mounted
pipelines that do not halt processing if a match is not found.

Thus I propose that we add the pass through='true|[false]' attribute to 
make it possible for mounts not to necessarily halt processing if no 
match is found.

                             -=--=--=--=--=-
Rationale:

It's typical to use the URL space to partition *processing*; because of 
this it's natural to match a URL in the base sitemap and delegate 
subURLs to mounted sitemaps.

In Forrest we have decided not to do this, and to keep the whole URI 
space free for uses to fill with their semantical partitionings. To 
decide how to process a file we use file extensions and eventually
peek inside to take a look at the DTD.  This makes it impractical to
partition the sitemap in several mounted sitemaps.

It shifted from impractical to impossible as soon we tried to make it 
possible for users to add their sitemap to the processing. There is no 
clean way i know of ATM for me to delegate a part of the matches to an 
external sitemap without giving away a whole URL space. ATM we are 
asking users to *copy* the sitemap they want to use and change it, but 
it has already proved over time to be extremely fragile for updates. We 
do not want to keep such a lame contract with our users.

I hoped that calling the user pipeline with the cocoon: protocol and 
using a resource-exists could route round the issue, but it's still not 
ok. If a match is found, I have to process the pipeline two times, or 
rely on caching, which is not always possible or desirable.

So it seems that the only viable solution is to make it possible for 
mounted pipelines to not fail processing if a match is not found, and 
have the base sitemap resume processing. This is in line with what 
resources do now (in an unwanted but nevertheless welcome and happily 
used bug). James also has a similar thing in the mail pipeline matches, 
that can <passThrough>.

Thus:

I propose that we add the passthrough='true|[false]' attribute to make 
it possible for mounts not to necessarily halt processing if no match is 
found.

The proposed element for it is the <mount> node, so that the base 
sitemap has the say on whether it wants to make the subsitemap 
completely responsible or not of the subsequent processing. The default 
behavior would be identical to what we have now.

WDOT?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Miles Elam wrote:
> Just to add noise to the discussion...  ;-)  This passthrough (or 
> whatever it's ultimately called) could also be used to make Cocoon 
> installation and first setup easier.

Welcome to Forrest, a prebuilt and ready to go Cocoon distribution :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by Miles Elam <mi...@pcextremist.com>.
Just to add noise to the discussion...  ;-)  This passthrough (or 
whatever it's ultimately called) could also be used to make Cocoon 
installation and first setup easier.

For example, let's say you have your Cocoon installation ready to go on 
the filesystem.  After configuring the servlet container, the next step 
is usually to edit the main sitemap.  This can be daunting for new 
users (it was for me the first few times) as the default sitemap is not 
exactly a five-liner.

But what if you split it off a la Forrest?  In the main sitemap, you 
have all of the basic configurations and component definitions 
(including or excluding based on the block inclusion or exclusion in 
many cases as is the case now with compilation), all of the samples, 
tutorials, documentation, etc.  However, you also have a "pass-through" 
sitemap mount that matches everything going to mysite.xmap (or 
whatever) with a bare, minimal sitemap.  It would be this minimal 
sitemap that folks would start out with and add their matchers to and 
get familiar with the system.

Adding this baby step keeps folks from getting turned away from excess 
complexity (or at least hiding it for a while), allows them to learn 
the basic skills, and when the time comes that they need to edit the 
main sitemap.xmap, they will already have a firm grounding in the basic 
building blocks of how Cocoon works.  It also provides a means for 
people to have their own sitemap without having to make large edits 
when a new Cocoon build is made.  The pipes vs. pipelines change comes 
to mind where I simply tried to copy my customized sitemap onto a new 
build, and (surprise) it failed.  I ended up having to do a line by 
line comparison of the default and customized sitemaps to find the 
problem.  Similar problems have cropped up as components have been 
added/removed/renamed over the years.

If, on the other hand, my customizations were in its own file where I 
could know/assume that the base sitemap was correct (because I copied 
it directly from a build), debugging problems becomes a lot easier.

Currently I have such a setup where the main, default sitemap is kept 
pretty much intact while my changes are simply mounted in a single 
line.  The pass-through proposal makes it possible to do this in the 
general case however.

WDYT?

- Miles Elam


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by David Crossley <cr...@apache.org>.
Nicola Ken Barozzi wrote:
> 
> In any case, the best one that will seem ok to me will go in there... 
> after all it's the functionality we need, not the name ;-) (*)

It sure is great to see someone doing the work. The names are
important to convey true meaning, yet they do need to be easy
to type. Go for it - you are good with words.

--David

> -- 
> Nicola Ken Barozzi                   nicolaken@apache.org
>      - (*)  verba volant, scripta manent -
>   (discussions get forgotten, just code remains)


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by Nicola Ken Barozzi <ni...@apache.org>.
David Crossley wrote:
...
> +1 for the ability to return for subsequent processing.
> I like the explicit name "return-no-match".

The fact is that it's not necessarily true that it will be only matches 
that it fails to find. The "contract" is simply that it will continue if 
no xml pipeline (gen-[transf]-ser) is executed.

'passthrough' is the same used in James (actually it's passThrough).

An option could be "return" (IOW come back) or "delegate" (give 
processing responsinility to the parent).

In any case, the best one that will seem ok to me will go in there... 
after all it's the functionality we need, not the name ;-) (*)

> The default should ideally be true, but does that
> sit okay with back-compatibility?

The default must be backward compatible, IOW false.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
       - (*)  verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


RE: [Proposal] Add pass-through capability to mounted pipelines

Posted by Carsten Ziegeler <cz...@apache.org>.
David Crossley wrote:

> +1 for the ability to return for subsequent processing.
> I like the explicit name "return-no-match".
> The default should ideally be true, but does that sit okay 
> with back-compatibility?
> 
No :) The default should be "false".
I'm not a native speaker (obviously) and don't want to be *too* picky,
but "return-no-match" sounds a little bit wrong to me.
I think something like "return-on-no-match" or so would
be better, no?

Carsten


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by David Crossley <cr...@apache.org>.
Glen Ezkovich wrote:
> Giacomo Pati wrote:
> Sylvain Wallez wrote:
> >> Nicola Ken Barozzi wrote:
> >>
> >> <snip/>
> >>
> >>> I propose that we add the passthrough='true|[false]' attribute to 
> >>> make it possible for mounts not to necessarily halt processing if no 
> >>> match is found.
> >>> The proposed element for it is the <mount> node, so that the base 
> >>> sitemap has the say on whether it wants to make the subsitemap 
> >>> completely responsible or not of the subsequent processing. The 
> >>> default behavior would be identical to what we have now.
> >>
> >> +1, but the "passthrough" name doesn't seem clear to me.
> >>
> >> Other names that come to mind, but aren't satisfying either are 
> >> "come-back", "delegate", "allow-return"...
> >
> > How about "final".
> 
> To much like Java's final.
> 
> maybe return-on-fail or return-no-match

+1 for the ability to return for subsequent processing.
I like the explicit name "return-no-match".
The default should ideally be true, but does that
sit okay with back-compatibility?

-- 
David Crossley


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by Glen Ezkovich <gl...@hard-bop.com>.
On Aug 30, 2004, at 12:19 PM, Giacomo Pati wrote:

> On Mon, 30 Aug 2004, Sylvain Wallez wrote:
>
>> Nicola Ken Barozzi wrote:
>>
>> <snip/>
>>
>>> I propose that we add the passthrough='true|[false]' attribute to 
>>> make it possible for mounts not to necessarily halt processing if no 
>>> match is found.
>>> The proposed element for it is the <mount> node, so that the base 
>>> sitemap has the say on whether it wants to make the subsitemap 
>>> completely responsible or not of the subsequent processing. The 
>>> default behavior would be identical to what we have now.
>>
>>
>> +1, but the "passthrough" name doesn't seem clear to me.
>>
>> Other names that come to mind, but aren't satisfying either are 
>> "come-back", "delegate", "allow-return"...
>
> How about "final".

To much like Java's final.

maybe return-on-fail or return-no-match


>
> -- 
> Giacomo Pati
> Otego AG, Switzerland - http://www.otego.com
> Orixo, the XML business alliance - http://www.orixo.com
>
>
>

Glen Ezkovich
HardBop Consulting
glen at hard-bop.com
http://www.hard-bop.com - new and improved site coming soon



A Proverb for Paranoids:
"If they can get you asking the wrong questions, they don't have to 
worry about answers."
- Thomas Pynchon Gravity's Rainbow


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by Giacomo Pati <gi...@apache.org>.
On Mon, 30 Aug 2004, Sylvain Wallez wrote:

> Nicola Ken Barozzi wrote:
>
> <snip/>
>
>> I propose that we add the passthrough='true|[false]' attribute to make it 
>> possible for mounts not to necessarily halt processing if no match is 
>> found.
>> 
>> The proposed element for it is the <mount> node, so that the base sitemap 
>> has the say on whether it wants to make the subsitemap completely 
>> responsible or not of the subsequent processing. The default behavior 
>> would be identical to what we have now.
>
>
> +1, but the "passthrough" name doesn't seem clear to me.
>
> Other names that come to mind, but aren't satisfying either are "come-back", 
> "delegate", "allow-return"...

How about "final".

-- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com

Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by Sylvain Wallez <sy...@apache.org>.
Nicola Ken Barozzi wrote:

<snip/>

> I propose that we add the passthrough='true|[false]' attribute to make 
> it possible for mounts not to necessarily halt processing if no match 
> is found.
>
> The proposed element for it is the <mount> node, so that the base 
> sitemap has the say on whether it wants to make the subsitemap 
> completely responsible or not of the subsequent processing. The 
> default behavior would be identical to what we have now.


+1, but the "passthrough" name doesn't seem clear to me.

Other names that come to mind, but aren't satisfying either are 
"come-back", "delegate", "allow-return"...

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: [Proposal] Add pass-through capability to mounted pipelines

Posted by Stefano Mazzocchi <st...@apache.org>.
Nicola Ken Barozzi wrote:

> 
> Summary:
> 
> Developing Forrest, I seem to have stumbled in the need of mounted
> pipelines that do not halt processing if a match is not found.
> 
> Thus I propose that we add the pass through='true|[false]' attribute to 
> make it possible for mounts not to necessarily halt processing if no 
> match is found.
> 
>                             -=--=--=--=--=-
> Rationale:
> 
> It's typical to use the URL space to partition *processing*; because of 
> this it's natural to match a URL in the base sitemap and delegate 
> subURLs to mounted sitemaps.
> 
> In Forrest we have decided not to do this, and to keep the whole URI 
> space free for uses to fill with their semantical partitionings. To 
> decide how to process a file we use file extensions and eventually
> peek inside to take a look at the DTD.  This makes it impractical to
> partition the sitemap in several mounted sitemaps.
> 
> It shifted from impractical to impossible as soon we tried to make it 
> possible for users to add their sitemap to the processing. There is no 
> clean way i know of ATM for me to delegate a part of the matches to an 
> external sitemap without giving away a whole URL space. ATM we are 
> asking users to *copy* the sitemap they want to use and change it, but 
> it has already proved over time to be extremely fragile for updates. We 
> do not want to keep such a lame contract with our users.
> 
> I hoped that calling the user pipeline with the cocoon: protocol and 
> using a resource-exists could route round the issue, but it's still not 
> ok. If a match is found, I have to process the pipeline two times, or 
> rely on caching, which is not always possible or desirable.
> 
> So it seems that the only viable solution is to make it possible for 
> mounted pipelines to not fail processing if a match is not found, and 
> have the base sitemap resume processing. This is in line with what 
> resources do now (in an unwanted but nevertheless welcome and happily 
> used bug). James also has a similar thing in the mail pipeline matches, 
> that can <passThrough>.
> 
> Thus:
> 
> I propose that we add the passthrough='true|[false]' attribute to make 
> it possible for mounts not to necessarily halt processing if no match is 
> found.
> 
> The proposed element for it is the <mount> node, so that the base 
> sitemap has the say on whether it wants to make the subsitemap 
> completely responsible or not of the subsequent processing. The default 
> behavior would be identical to what we have now.
> 
> WDOT?

+1, makes sense and works well with real blocks too.

-- 
Stefano.