sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konrad Windszus <konra...@gmx.de>
Subject Re: [hackathon] externalization / resource mapping / rewriter
Date Thu, 16 Jan 2020 14:00:54 GMT
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: https://issues.apache.org/jira/browse/SLING-9005
<https://issues.apache.org/jira/browse/SLING-9005>

Konrad

> On 5. Sep 2019, at 17:54, Jason E Bailey <jason.bailey@24601.org> wrote:
> 
> Specifically with regard to the re-writer
> 
> I'm working on a replacement for this which I'm currently calling the transformer ->
https://github.com/apache/sling-whiteboard/tree/master/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 wcm.io 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] https://wcm.io/handler/url/
>> 
>> 
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message