sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Henzler <>
Subject Re: [hackathon] externalization / resource mapping / rewriter
Date Fri, 17 Jan 2020 09:45:50 GMT
Hi Konrad, 

I think SLING-9005 is a good idea, but that is independent.

My idea idea was to leave unchanged (as there is a lot of code using
it out there, also it makes conceptually sense as is). Rather I‘d like to provide an SPI
that allows to customize the way of the behavior of - I‘m thinking
of a ranked list of ResourceMapper services (default one being today’s behavior). Robert
also has done some work into this direction already, I‘d like to extend on that.

I‘m currently on vacation but I have it on my list for when I‘m back.


> On 16. Jan 2020, at 15:01, Konrad Windszus <> wrote:
> I would like to revive this. 
> @Georg: IIRC you wanted to come up with a proposal for a externalizer API. Are you working
on this?
> Can we start by creating a JIRA ticket?
> There has been a related ticket opened today:
> Konrad
>> On 5. Sep 2019, at 17:54, Jason E Bailey <> wrote:
>> Specifically with regard to the re-writer
>> I'm working on a replacement for this which I'm currently calling the transformer
>> 1. It uses an HTML tokenizer that was added to the HTML utilities to generate a stream
of  elements that can be modified and recombined. It's much faster then tagsoup or jsoup since
it's not trying to build a valid document. This also means that it supports anything that
you write out in html. HTML4,5+
>> 2. It uses services with an ordering priority and does pattern matching so that you
can fine tune when the transformer is applied
>> 3. The specific use case I was working on is creating a CSP header with a nonce or
hash attribute to lock down the javascript that's on the page. 
>> It's currently working but it's not finished.
>> Are there other problems with the rewriter that I haven't addressed?
>> --
>> Jason
>>> On Thu, Sep 5, 2019, at 10:34 AM, Stefan Seifert wrote:
>>> - resource mapping
>>> - add a new SPI to define the mapping
>>> - add a default impl that reads the mapping from /etc/map as it is 
>>> done today
>>> - possible to override with service ranking
>>> - but: there is already the ResourceMapper interface
>>>   - introduced 1-2 years ago, use case was to get all existing 
>>> mappings
>>>   - with this it's currently possible to replace mapping completely 
>>> with new logic
>>> - maybe add a support to "contribute" additional mappings via a 
>>> service interface additional to this
>>> - generic externalizer API
>>> - naming not fixed yet, should not named "link" as this is too 
>>> specific. probably "URL".
>>> - needs a java API for using, and an SPI for hooking in special rules
>>> - then add mappings for views in HTL*, JSP, model exporter/JSON
>>>   * probably starting with a sling-only HTL extension for try-out, 
>>> add it later to the spec when design is validated
>>> - might be inspired by the basic features for URL handler [1]
>>> - rewriter pipeline
>>> - should be deprecated and no longer be used - especially not for 
>>> link externalization via postprocessing
>>> - it may still be in use out there for more exotic use cases like PDF 
>>> generation
>>> - should probably removed from sling starter
>>> stefan
>>> [1]

View raw message