[ 
https://issues.apache.org/jira/browse/SLING-7768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17013030#comment-17013030
 ] 

Carsten Ziegeler commented on SLING-7768:
-----------------------------------------

I had a brief look at the PR. I think we don't need an interface, there 
shouldn't be a need to make the interpolation pluggable.
>From a syntax point of view, it would be nice if we could support the same 
>syntax as the configuration admin interpolation plugin which is 
{noformat}
 $[proptype:propname]
 $[proptype:propname;default=foo]
{noformat}
where proptype can be secret, env, or prop - we probably don't need to support 
"secret", env gets a value from the named env variable and prop from the bundle 
context. If no proptype prefix is used it could fallback to the provided 
configuration.

Not sure if we can use square brackets in JCR node names; if we can't we need 
to stick with angle brackets.
But we should support the proptype and default values

> Add String Interpolation support to /etc/map
> --------------------------------------------
>
>                 Key: SLING-7768
>                 URL: https://issues.apache.org/jira/browse/SLING-7768
>             Project: Sling
>          Issue Type: Improvement
>          Components: ResourceResolver
>         Environment: Sling 11-SNAPSHOT, JDK 1.8
>            Reporter: Andreas Schaefer
>            Priority: Major
>         Attachments: Screenshot 2018-07-06 11.41.58.png, Screenshot 
> 2018-07-06 11.42.41.png, Screenshot 2018-07-06 11.43.34.png
>
>
> Having worked on migrations of a Sling derivate Ruben & I ran into issues 
> where the /etc/map would map to production instead of testing environment.
>  Many big customer have extensive /etc/maps and also many different 
> environments like dev, qa, staging, prod etc.
>  It would be great to have a tool where for example items like the host name 
> or external links in /etc/map could be configured outside so that just one 
> entry has to adjusted rather than creating a full copy of the /etc/map tree.
>   
>  Example:
>   
>  /etc/map/http/{{{{phv.fq.host.name}}}}.8080
>   
>  Placeholder provides:
>  DEV: phv.fq.host.name=localhost
>  QA: phv.fq.host.name=qa.author.acme.com
>  STAGING: 
> phv.fq.host.name=[staging.author.acme.com|http://staging.author.acme.com/]
>  PROD: phv.fq.host.name=[acme.com|http://acme.com/]
>   
>  At runtime these are the resolved values:
>  DEV: http/localhost.8080
>  QA: http/qa.author.acme.com.8080
>  STAGING: http/[staging.author.acme.com|http://staging.author.acme.com/].8080
>  PROD: http/[acme.com|http://acme.com/].8080
>   
>  Not only does that make it easier and faster to create new test environments 
> but it also cuts down on the chance of copy-n-paste errors.
>   
>  I have a working POC with an PlaceholderProvider OSGi service and an 
> enhanced MapEntries that resolved any placeholders if found.
>   
>  Attached are 3 screenshots:
>  1. OSGi Placeholder Provider Configuration
>  2. /etc/map (Composum)
>  3. Result of [http://andreass.local:8080/] call



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to