we currently cannot come up with an elegant solution supporting it directly in 
the API/SPI.

if a project needs this feature it can be implemented in project-specific code 
by implementing a thread local for getting the current request, and passing it 
into a custom ConfigurationResourceResolvingStrategy.

stefan

p.s. the title of this thread is misleading - configuraiton resource resolving 
strategy is meant instead of context path strategy.


>-----Original Message-----
>From: Stefan Seifert [mailto:sseif...@pro-vision.de]
>Sent: Friday, September 30, 2016 3:24 PM
>To: dev@sling.apache.org
>Subject: [context-aware config] context path strategy depending on request
>information?
>
>on the adaptTo() conference there was feedback from one participant after
>my talk [1]:
>- he asked if it is possible to provide different context-aware
>configuration for different hostnames, but with the same content path
>- i assume this is some tenant-specific solution where all tenants share
>the same content, but display different personalization
>
>technically speaking we would need to extend the methods in the
>ConfigurationResourceResolvingStrategy interface [2] with an additional
>SlingServletRequest parameter to support detecting the matching config path
>based on information from there e.g. domain name.
>
>but this would only be possible if we extend the
>ConfigurationResolver/Builder API as well and pass in the current request -
>otherwise we have no means to get it (or only via a unloved threadlocal
>hack). we have to make it optional, because in most cases the request will
>not be needed. but then applications requiring request-based configuration
>solution always need to make sure they provide this additional parameter.
>it also gets difficult to provide configuration editor GUI support in this
>case, because the domain names are not known in the author instance,
>mapping only takes place on the publish instances.
>
>WDYT - should we add support for it? not sure if this is really a common
>usecase.
>
>stefan
>
>[1] https://adapt.to/2016/en/schedule/sling-context-aware-
>configuration.html
>[2]
>https://github.com/apache/sling/blob/trunk/contrib/extensions/contextaware-
>config/spi/src/main/java/org/apache/sling/contextaware/config/resource/spi/
>ConfigurationResourceResolvingStrategy.java
>
>


Reply via email to