You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Rudolph, Dirk" <Di...@t-systems.com> on 2013/04/10 10:34:27 UTC

Configure rewriter pipeline per runmode

Hi all,

 

currently I'm working with the Apache Sling rewriter bundle to build a pipeline for post-rendering link manipulation. I had a look on the source code and have seen, that the pipeline configuration path is fix (/config/rewriter) below my application directory (/apps/appname). Now my question is: What is the common way to configure different pipelines for different runmodes? E.g. I have a runmode "publish" that should use /apps/appname/config.publish/rewriter and one called "author" that should use /apps/appname/config.author/rewriter.

 

Thanks alot,

Dirk Rudolph  




T-Systems Multimedia Solutions GmbH 
Organisationseinheit CCS
Dirk Rudolph
Software-Entwicklung, OCJP

Hausanschrift: Riesaer Straße 5, 01129 Dresden 
Postanschrift: Postfach 10 02 24, 01072 Dresden 
+49 351 2820-5363       (Tel)  
E-Mail: Dirk.Rudolph@t-systems.com <ma...@t-systems-mms.com> 
Internet: http://www.t-systems-mms.com <http://www.t-systems-mms.de/> 

T-Systems Multimedia Solutions GmbH 

Aufsichtsrat: Klaus Werner (Vorsitzender)
Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl 
Handelsregister: Amtsgericht Dresden HRB 11433 
Sitz der Gesellschaft: Dresden 
Ust-IdNr.: DE 811 807 949 

 

 


Configure rewriter pipeline per runmode

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thursday, April 11, 2013, Rudolph, Dirk wrote:

> ...What is the preferred way for storing configurations in Apache Sling -
OSGI or JCR? Due
> to "everything is content" I assume storing the configuration in the
content repository is
> more welcome than OSGI-Service configurations?...

In this case you want to benefit from runmodes and factory configurations
so you'll need OSGi configurations.

Those can be managed as repository content anyway via the Sling installer.

-Bertrand

AW: Configure rewriter pipeline per runmode

Posted by "Rudolph, Dirk" <Di...@t-systems.com>.
As I understood, you want to implement all the ProcessorConfiguration objects based on an OSGI configuration? I will create an feature request ticket in JIRA and create a patch maybe this weekend.

What is the preferred way for storing configurations in Apache Sling - OSGI or JCR? Due to "everything is content" I assume storing the configuration in the content repository is more welcome than OSGI-Service configurations?

Dirk

-----Ursprüngliche Nachricht-----
Von: Carsten Ziegeler [mailto:cziegeler@apache.org] 
Gesendet: Mittwoch, 10. April 2013 16:36
An: users@sling.apache.org
Betreff: Re: Configure rewriter pipeline per runmode

2013/4/10 Rudolph, Dirk <Di...@t-systems.com>

> Thanks a lot for your feedback. The described way is also present in 
> the current (CQ5.5) implementation for the LinkCheckerTransformer 
> (LinkCheckerSettingsProvider or so) and I will use this approach in my 
> implementation too.
>
> But what to do when I want to use a special Transformer (an therefor a 
> separated pipeline) on any publish instance but not on any author instance?
> Well the solution could be to introduce an "enabled" flag but is this 
> the best solution? Wouldn't it make sense to obtain different 
> configurations per runmode in the ProcessorManagerImpl directly (that 
> is also a OSGI Service implementing the ProcessorManager interface)?
>

That's what I suggested with leveraging OSGi configurations

Carsten


>
> Again,  thanks a lot,
> Dirk
>
> -----Ursprüngliche Nachricht-----
> Von: Carsten Ziegeler [mailto:cziegeler@apache.org]
> Gesendet: Mittwoch, 10. April 2013 14:36
> An: users@sling.apache.org
> Betreff: Re: Configure rewriter pipeline per runmode
>
> What about having rewriter configurations as OSGi configurations?
> This should be not too hard to implement. However as an OSGi 
> configuration is a simple map, defining how to handle configuration 
> props might not look that nice.
>
> Carsten
>
> 2013/4/10 Ryan Lunka <ry...@gmail.com>
>
> > Interesting timing...I actually just wrote a blog post on this topic:
> > http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-
> > ad
> > obe-experience-manager.html
> > .
> >
> > However the specific answer to you question is that you use a 
> > factory class that actually creates your pipeline component. That 
> > factory class will be an OSGi service which can be configured 
> > differently per run mode, by using the typical OsgiConfig node type. 
> > The actual class that does the work of the pipeline component is 
> > just a class, not an OSGi service. The factory class/OSGi service 
> > knows which pipeline component object to build and has a 
> > "pipeline.type" property specified that effectively registers is it with Sling.
> >
> > Make sense?
> >
> > --
> >
> > Ryan D. Lunka
> >
> >
> >
> >
> >
> > On Apr 10, 2013, at 4:34 AM, "Rudolph, Dirk"
> > <Di...@t-systems.com>
> > wrote:
> >
> > > Hi all,
> > >
> > >
> > >
> > > currently I'm working with the Apache Sling rewriter bundle to 
> > > build a
> > pipeline for post-rendering link manipulation. I had a look on the 
> > source code and have seen, that the pipeline configuration path is 
> > fix
> > (/config/rewriter) below my application directory (/apps/appname). 
> > Now my question is: What is the common way to configure different 
> > pipelines for different runmodes? E.g. I have a runmode "publish" 
> > that should use /apps/appname/config.publish/rewriter and one called 
> > "author" that should use /apps/appname/config.author/rewriter.
> > >
> > >
> > >
> > > Thanks alot,
> > >
> > > Dirk Rudolph
> > >
> > >
> > >
> > >
> > > T-Systems Multimedia Solutions GmbH Organisationseinheit CCS Dirk 
> > > Rudolph Software-Entwicklung, OCJP
> > >
> > > Hausanschrift: Riesaer Straße 5, 01129 Dresden
> > > Postanschrift: Postfach 10 02 24, 01072 Dresden
> > > +49 351 2820-5363       (Tel)
> > > E-Mail: Dirk.Rudolph@t-systems.com <mailto:
> > mDirk.Rudolph@t-systems-mms.com>
> > > Internet: http://www.t-systems-mms.com 
> > > <http://www.t-systems-mms.de/>
> > >
> > > T-Systems Multimedia Solutions GmbH
> > >
> > > Aufsichtsrat: Klaus Werner (Vorsitzender)
> > > Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl
> > > Handelsregister: Amtsgericht Dresden HRB 11433 Sitz der
> > > Gesellschaft: Dresden
> > > Ust-IdNr.: DE 811 807 949
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>



--
Carsten Ziegeler
cziegeler@apache.org

Re: Configure rewriter pipeline per runmode

Posted by Carsten Ziegeler <cz...@apache.org>.
2013/4/10 Rudolph, Dirk <Di...@t-systems.com>

> Thanks a lot for your feedback. The described way is also present in the
> current (CQ5.5) implementation for the LinkCheckerTransformer
> (LinkCheckerSettingsProvider or so) and I will use this approach in my
> implementation too.
>
> But what to do when I want to use a special Transformer (an therefor a
> separated pipeline) on any publish instance but not on any author instance?
> Well the solution could be to introduce an "enabled" flag but is this the
> best solution? Wouldn't it make sense to obtain different configurations
> per runmode in the ProcessorManagerImpl directly (that is also a OSGI
> Service implementing the ProcessorManager interface)?
>

That's what I suggested with leveraging OSGi configurations

Carsten


>
> Again,  thanks a lot,
> Dirk
>
> -----Ursprüngliche Nachricht-----
> Von: Carsten Ziegeler [mailto:cziegeler@apache.org]
> Gesendet: Mittwoch, 10. April 2013 14:36
> An: users@sling.apache.org
> Betreff: Re: Configure rewriter pipeline per runmode
>
> What about having rewriter configurations as OSGi configurations?
> This should be not too hard to implement. However as an OSGi configuration
> is a simple map, defining how to handle configuration props might not look
> that nice.
>
> Carsten
>
> 2013/4/10 Ryan Lunka <ry...@gmail.com>
>
> > Interesting timing...I actually just wrote a blog post on this topic:
> > http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-ad
> > obe-experience-manager.html
> > .
> >
> > However the specific answer to you question is that you use a factory
> > class that actually creates your pipeline component. That factory
> > class will be an OSGi service which can be configured differently per
> > run mode, by using the typical OsgiConfig node type. The actual class
> > that does the work of the pipeline component is just a class, not an
> > OSGi service. The factory class/OSGi service knows which pipeline
> > component object to build and has a "pipeline.type" property specified
> > that effectively registers is it with Sling.
> >
> > Make sense?
> >
> > --
> >
> > Ryan D. Lunka
> >
> >
> >
> >
> >
> > On Apr 10, 2013, at 4:34 AM, "Rudolph, Dirk"
> > <Di...@t-systems.com>
> > wrote:
> >
> > > Hi all,
> > >
> > >
> > >
> > > currently I'm working with the Apache Sling rewriter bundle to build
> > > a
> > pipeline for post-rendering link manipulation. I had a look on the
> > source code and have seen, that the pipeline configuration path is fix
> > (/config/rewriter) below my application directory (/apps/appname). Now
> > my question is: What is the common way to configure different
> > pipelines for different runmodes? E.g. I have a runmode "publish" that
> > should use /apps/appname/config.publish/rewriter and one called
> > "author" that should use /apps/appname/config.author/rewriter.
> > >
> > >
> > >
> > > Thanks alot,
> > >
> > > Dirk Rudolph
> > >
> > >
> > >
> > >
> > > T-Systems Multimedia Solutions GmbH
> > > Organisationseinheit CCS
> > > Dirk Rudolph
> > > Software-Entwicklung, OCJP
> > >
> > > Hausanschrift: Riesaer Straße 5, 01129 Dresden
> > > Postanschrift: Postfach 10 02 24, 01072 Dresden
> > > +49 351 2820-5363       (Tel)
> > > E-Mail: Dirk.Rudolph@t-systems.com <mailto:
> > mDirk.Rudolph@t-systems-mms.com>
> > > Internet: http://www.t-systems-mms.com
> > > <http://www.t-systems-mms.de/>
> > >
> > > T-Systems Multimedia Solutions GmbH
> > >
> > > Aufsichtsrat: Klaus Werner (Vorsitzender)
> > > Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl
> > > Handelsregister: Amtsgericht Dresden HRB 11433 Sitz der
> > > Gesellschaft: Dresden
> > > Ust-IdNr.: DE 811 807 949
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>



-- 
Carsten Ziegeler
cziegeler@apache.org

AW: Configure rewriter pipeline per runmode

Posted by "Rudolph, Dirk" <Di...@t-systems.com>.
Thanks a lot for your feedback. The described way is also present in the current (CQ5.5) implementation for the LinkCheckerTransformer (LinkCheckerSettingsProvider or so) and I will use this approach in my implementation too.

But what to do when I want to use a special Transformer (an therefor a separated pipeline) on any publish instance but not on any author instance? Well the solution could be to introduce an "enabled" flag but is this the best solution? Wouldn't it make sense to obtain different configurations per runmode in the ProcessorManagerImpl directly (that is also a OSGI Service implementing the ProcessorManager interface)?

Again,  thanks a lot,
Dirk

-----Ursprüngliche Nachricht-----
Von: Carsten Ziegeler [mailto:cziegeler@apache.org] 
Gesendet: Mittwoch, 10. April 2013 14:36
An: users@sling.apache.org
Betreff: Re: Configure rewriter pipeline per runmode

What about having rewriter configurations as OSGi configurations?
This should be not too hard to implement. However as an OSGi configuration is a simple map, defining how to handle configuration props might not look that nice.

Carsten

2013/4/10 Ryan Lunka <ry...@gmail.com>

> Interesting timing...I actually just wrote a blog post on this topic:
> http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-ad
> obe-experience-manager.html
> .
>
> However the specific answer to you question is that you use a factory 
> class that actually creates your pipeline component. That factory 
> class will be an OSGi service which can be configured differently per 
> run mode, by using the typical OsgiConfig node type. The actual class 
> that does the work of the pipeline component is just a class, not an 
> OSGi service. The factory class/OSGi service knows which pipeline 
> component object to build and has a "pipeline.type" property specified 
> that effectively registers is it with Sling.
>
> Make sense?
>
> --
>
> Ryan D. Lunka
>
>
>
>
>
> On Apr 10, 2013, at 4:34 AM, "Rudolph, Dirk" 
> <Di...@t-systems.com>
> wrote:
>
> > Hi all,
> >
> >
> >
> > currently I'm working with the Apache Sling rewriter bundle to build 
> > a
> pipeline for post-rendering link manipulation. I had a look on the 
> source code and have seen, that the pipeline configuration path is fix
> (/config/rewriter) below my application directory (/apps/appname). Now 
> my question is: What is the common way to configure different 
> pipelines for different runmodes? E.g. I have a runmode "publish" that 
> should use /apps/appname/config.publish/rewriter and one called 
> "author" that should use /apps/appname/config.author/rewriter.
> >
> >
> >
> > Thanks alot,
> >
> > Dirk Rudolph
> >
> >
> >
> >
> > T-Systems Multimedia Solutions GmbH
> > Organisationseinheit CCS
> > Dirk Rudolph
> > Software-Entwicklung, OCJP
> >
> > Hausanschrift: Riesaer Straße 5, 01129 Dresden
> > Postanschrift: Postfach 10 02 24, 01072 Dresden
> > +49 351 2820-5363       (Tel)
> > E-Mail: Dirk.Rudolph@t-systems.com <mailto:
> mDirk.Rudolph@t-systems-mms.com>
> > Internet: http://www.t-systems-mms.com 
> > <http://www.t-systems-mms.de/>
> >
> > T-Systems Multimedia Solutions GmbH
> >
> > Aufsichtsrat: Klaus Werner (Vorsitzender)
> > Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl
> > Handelsregister: Amtsgericht Dresden HRB 11433 Sitz der 
> > Gesellschaft: Dresden
> > Ust-IdNr.: DE 811 807 949
> >
> >
> >
> >
> >
>
>


--
Carsten Ziegeler
cziegeler@apache.org

Re: Configure rewriter pipeline per runmode

Posted by Carsten Ziegeler <cz...@apache.org>.
What about having rewriter configurations as OSGi configurations?
This should be not too hard to implement. However as an OSGi configuration
is a simple map, defining how to handle configuration props might not look
that nice.

Carsten

2013/4/10 Ryan Lunka <ry...@gmail.com>

> Interesting timing…I actually just wrote a blog post on this topic:
> http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-adobe-experience-manager.html
> .
>
> However the specific answer to you question is that you use a factory
> class that actually creates your pipeline component. That factory class
> will be an OSGi service which can be configured differently per run mode,
> by using the typical OsgiConfig node type. The actual class that does the
> work of the pipeline component is just a class, not an OSGi service. The
> factory class/OSGi service knows which pipeline component object to build
> and has a "pipeline.type" property specified that effectively registers is
> it with Sling.
>
> Make sense?
>
> --
>
> Ryan D. Lunka
>
>
>
>
>
> On Apr 10, 2013, at 4:34 AM, "Rudolph, Dirk" <Di...@t-systems.com>
> wrote:
>
> > Hi all,
> >
> >
> >
> > currently I'm working with the Apache Sling rewriter bundle to build a
> pipeline for post-rendering link manipulation. I had a look on the source
> code and have seen, that the pipeline configuration path is fix
> (/config/rewriter) below my application directory (/apps/appname). Now my
> question is: What is the common way to configure different pipelines for
> different runmodes? E.g. I have a runmode "publish" that should use
> /apps/appname/config.publish/rewriter and one called "author" that should
> use /apps/appname/config.author/rewriter.
> >
> >
> >
> > Thanks alot,
> >
> > Dirk Rudolph
> >
> >
> >
> >
> > T-Systems Multimedia Solutions GmbH
> > Organisationseinheit CCS
> > Dirk Rudolph
> > Software-Entwicklung, OCJP
> >
> > Hausanschrift: Riesaer Straße 5, 01129 Dresden
> > Postanschrift: Postfach 10 02 24, 01072 Dresden
> > +49 351 2820-5363       (Tel)
> > E-Mail: Dirk.Rudolph@t-systems.com <mailto:
> mDirk.Rudolph@t-systems-mms.com>
> > Internet: http://www.t-systems-mms.com <http://www.t-systems-mms.de/>
> >
> > T-Systems Multimedia Solutions GmbH
> >
> > Aufsichtsrat: Klaus Werner (Vorsitzender)
> > Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl
> > Handelsregister: Amtsgericht Dresden HRB 11433
> > Sitz der Gesellschaft: Dresden
> > Ust-IdNr.: DE 811 807 949
> >
> >
> >
> >
> >
>
>


-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Configure rewriter pipeline per runmode

Posted by Ryan Lunka <ry...@gmail.com>.
Interesting timing…I actually just wrote a blog post on this topic: http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-adobe-experience-manager.html.

However the specific answer to you question is that you use a factory class that actually creates your pipeline component. That factory class will be an OSGi service which can be configured differently per run mode, by using the typical OsgiConfig node type. The actual class that does the work of the pipeline component is just a class, not an OSGi service. The factory class/OSGi service knows which pipeline component object to build and has a "pipeline.type" property specified that effectively registers is it with Sling.

Make sense?

--

Ryan D. Lunka





On Apr 10, 2013, at 4:34 AM, "Rudolph, Dirk" <Di...@t-systems.com> wrote:

> Hi all,
> 
> 
> 
> currently I'm working with the Apache Sling rewriter bundle to build a pipeline for post-rendering link manipulation. I had a look on the source code and have seen, that the pipeline configuration path is fix (/config/rewriter) below my application directory (/apps/appname). Now my question is: What is the common way to configure different pipelines for different runmodes? E.g. I have a runmode "publish" that should use /apps/appname/config.publish/rewriter and one called "author" that should use /apps/appname/config.author/rewriter.
> 
> 
> 
> Thanks alot,
> 
> Dirk Rudolph  
> 
> 
> 
> 
> T-Systems Multimedia Solutions GmbH 
> Organisationseinheit CCS
> Dirk Rudolph
> Software-Entwicklung, OCJP
> 
> Hausanschrift: Riesaer Straße 5, 01129 Dresden 
> Postanschrift: Postfach 10 02 24, 01072 Dresden 
> +49 351 2820-5363       (Tel)  
> E-Mail: Dirk.Rudolph@t-systems.com <ma...@t-systems-mms.com> 
> Internet: http://www.t-systems-mms.com <http://www.t-systems-mms.de/> 
> 
> T-Systems Multimedia Solutions GmbH 
> 
> Aufsichtsrat: Klaus Werner (Vorsitzender)
> Geschäftsführung: Peter Klingenburg, Dr. Jens Nebendahl 
> Handelsregister: Amtsgericht Dresden HRB 11433 
> Sitz der Gesellschaft: Dresden 
> Ust-IdNr.: DE 811 807 949 
> 
> 
> 
> 
>