You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2007/11/20 12:52:32 UTC

Provide hook to override default publication pipelines?

Hi Lenya devs,

in a custom publication I'm facing the situation that I have to override 
single pipelines from the default publication sitemap. Since the 
pipelines are called using cocoon:/ (with a single slash), I can't use 
the common pattern of mounting the default publication sitemap at the 
end of my custom sitemap.

I think a quite convenient solution would be to mount a custom sitemap 
at the beginning of the default publication sitemap:

     <map:pipeline>
       <map:select type="resource-exists">
         <map:when test="{fallback:custom.xmap}">
           <map:mount src="{fallback:custom.xmap}" pass-through="true"/>
         </map:when>
       </map:select>
     </map:pipeline>

Maybe we can provide something like this in 2.0.1.

WDYT?

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Provide hook to override default publication pipelines?

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Tue, 2007-11-20 at 12:52 +0100, Andreas Hartmann wrote:
> Hi Lenya devs,
> 
> in a custom publication I'm facing the situation that I have to override 
> single pipelines from the default publication sitemap. Since the 
> pipelines are called using cocoon:/ (with a single slash), I can't use 
> the common pattern of mounting the default publication sitemap at the 
> end of my custom sitemap.
> 
> I think a quite convenient solution would be to mount a custom sitemap 
> at the beginning of the default publication sitemap:
> 
>      <map:pipeline>
>        <map:select type="resource-exists">
>          <map:when test="{fallback:custom.xmap}">
>            <map:mount src="{fallback:custom.xmap}" pass-through="true"/>
>          </map:when>
>        </map:select>
>      </map:pipeline>
> 
> Maybe we can provide something like this in 2.0.1.
> 
> WDYT?

Sounds good.

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Provide hook to override default publication pipelines?

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Wed, 2007-11-21 at 17:41 +0100, Jörn Nettingsmeier wrote:
> Andreas Hartmann wrote:
> > Jörn Nettingsmeier schrieb:
> > OK, so how should this issue be addressed?
> > 
> >> let's provide a real basic publication instead that doesn't have so 
> >> much cruft and can be used as a template for both the default and any 
> >> custom publication.
> > 
> > Hmmm - how would that solve the problem that I want to override single 
> > pipelines? Or do you mean that the basic publication should be so basic 
> > that it contains virtually no pipelines which could be worth overriding?
> 
> more or less, yes. i still think that no important functionality should 
> be embedded in the default publication sitemap. ideally, i'd like to be 
> able to create a publication directory with just a config dir in it, and 
>   all central lenya features should be there.

Well, I must disagree. I had the same problem as Andreas have back in
the days.

To override just a pipe is much more efficient then copy one thing to
another place.

MORE if we talking about parent publications. The idea is to implement
all pipes that are needed in the parent and allow children to override
just a few of them.

To put it in java terms the default pub should be an abstract class and
every pub that extends the default pub should have the possibility to
override super.

salu2

> 
> for now, you could just copy the default sitemap over, throw out all 
> matchers that you don't need and alter it as necessary.
> eventually, a feature as you describe might be interesting, but first we 
> should clean up and get a feeling for a nice minimal set of pipelines 
> that needs to be in a publication sitemap. to me, neither bxe nor dav 
> nor rss stuff qualifies.
> 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Provide hook to override default publication pipelines?

Posted by Jörn Nettingsmeier <ne...@apache.org>.
Andreas Hartmann wrote:
> Jörn Nettingsmeier schrieb:
> OK, so how should this issue be addressed?
> 
>> let's provide a real basic publication instead that doesn't have so 
>> much cruft and can be used as a template for both the default and any 
>> custom publication.
> 
> Hmmm - how would that solve the problem that I want to override single 
> pipelines? Or do you mean that the basic publication should be so basic 
> that it contains virtually no pipelines which could be worth overriding?

more or less, yes. i still think that no important functionality should 
be embedded in the default publication sitemap. ideally, i'd like to be 
able to create a publication directory with just a config dir in it, and 
  all central lenya features should be there.

for now, you could just copy the default sitemap over, throw out all 
matchers that you don't need and alter it as necessary.
eventually, a feature as you describe might be interesting, but first we 
should clean up and get a feeling for a nice minimal set of pipelines 
that needs to be in a publication sitemap. to me, neither bxe nor dav 
nor rss stuff qualifies.

-- 
Jörn Nettingsmeier

"One of my most productive days was throwing away 1000 lines of code."
   - Ken Thompson.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Provide hook to override default publication pipelines?

Posted by Andreas Hartmann <an...@apache.org>.
Jörn Nettingsmeier schrieb:
> Andreas Hartmann wrote:
>> Hi Lenya devs,
>>
>> in a custom publication I'm facing the situation that I have to 
>> override single pipelines from the default publication sitemap. Since 
>> the pipelines are called using cocoon:/ (with a single slash), I can't 
>> use the common pattern of mounting the default publication sitemap at 
>> the end of my custom sitemap.
>>
>> I think a quite convenient solution would be to mount a custom sitemap 
>> at the beginning of the default publication sitemap:
>>
>>     <map:pipeline>
>>       <map:select type="resource-exists">
>>         <map:when test="{fallback:custom.xmap}">
>>           <map:mount src="{fallback:custom.xmap}" pass-through="true"/>
>>         </map:when>
>>       </map:select>
>>     </map:pipeline>
>>
>> Maybe we can provide something like this in 2.0.1.
>>
>> WDYT?
> 
> i don't like that. cruft and bad modularization should be cleaned up, 
> not painted over with another hook or layer of indirection. this is one 
> more thing that will make lenya mysterious for newbies.

OK, so how should this issue be addressed?

> let's provide a real basic publication instead that doesn't have so much 
> cruft and can be used as a template for both the default and any custom 
> publication.

Hmmm - how would that solve the problem that I want to override single 
pipelines? Or do you mean that the basic publication should be so basic 
that it contains virtually no pipelines which could be worth overriding?

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: Provide hook to override default publication pipelines?

Posted by Jörn Nettingsmeier <ne...@apache.org>.
Andreas Hartmann wrote:
> Hi Lenya devs,
> 
> in a custom publication I'm facing the situation that I have to override 
> single pipelines from the default publication sitemap. Since the 
> pipelines are called using cocoon:/ (with a single slash), I can't use 
> the common pattern of mounting the default publication sitemap at the 
> end of my custom sitemap.
> 
> I think a quite convenient solution would be to mount a custom sitemap 
> at the beginning of the default publication sitemap:
> 
>     <map:pipeline>
>       <map:select type="resource-exists">
>         <map:when test="{fallback:custom.xmap}">
>           <map:mount src="{fallback:custom.xmap}" pass-through="true"/>
>         </map:when>
>       </map:select>
>     </map:pipeline>
> 
> Maybe we can provide something like this in 2.0.1.
> 
> WDYT?

i don't like that. cruft and bad modularization should be cleaned up, 
not painted over with another hook or layer of indirection. this is one 
more thing that will make lenya mysterious for newbies.

let's provide a real basic publication instead that doesn't have so much 
cruft and can be used as a template for both the default and any custom 
publication.

(in fact, i never use the default publication as a template in my custom 
stuff, because i don't need all the DAV and BXE stuff that clutters the 
default.)


-- 
Jörn Nettingsmeier

"One of my most productive days was throwing away 1000 lines of code."
   - Ken Thompson.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org