[
https://issues.apache.org/jira/browse/SLING-6021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15454385#comment-15454385
]
Carsten Ziegeler commented on SLING-6021:
-----------------------------------------
Hi [~ivoleitao]
I think there are two possibilities:
You could use the ResourceTransformer and return a new configuration with the
values replaced through the input stream
or
you handle this in the InstallTaskFactory when the task for adding or updating
the configuration is created and replace the placeholders right before the
dictionary is passed to config admin. I think this might be a little bit easier.
However, both solutions have a problem: the configuration ending up in config
admin is not the same as the one stored on the file system or in JCR - however,
this is important for the write back feature of the OSGi installer: the
configuration admin informs the provider (file or JCR) about a change in config
admin, that provider compares the configuration which what it has read and will
find out that it differs due to the variables being replaced. It will then
overwrite the configuration with the new values. Which then means that if you
share this configuration with several instances having different file paths for
sling.home, it will fail. I'm not sure yet how to solve this
> Supporting variable substitution in sling installer configuration factory
> -------------------------------------------------------------------------
>
> Key: SLING-6021
> URL: https://issues.apache.org/jira/browse/SLING-6021
> Project: Sling
> Issue Type: New Feature
> Components: Installer
> Affects Versions: Installer Configuration Factory 1.0.14
> Reporter: Ivo Leitão
> Priority: Minor
>
> I'm not completely sure if this is a new feature or not but I've not find any
> documentation that explains how to perform variable transformation in
> configuration resources.
> In my use case I want to configure Apache Aries Transaction manager (snippet
> bellow) and I would like to use the ${sling.home} environment variable
> aries.transaction.recoverable=true
> aries.transaction.timeout=600
> aries.transaction.howl.maxBlocksPerFile=513
> aries.transaction.howl.maxLogFiles=2
> aries.transaction.howl.logFileDir=${sling.home}
> aries.transaction.howl.bufferSizeKBytes=4
> Is it possible or this is a completly new feature ? (I' ve tested and it does
> not work)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)