You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Hay (JIRA)" <ji...@apache.org> on 2010/10/14 22:38:34 UTC

[jira] Created: (FELIX-2663) Allow ConfigInstaller to perform placeholder substitution from framework properties

Allow ConfigInstaller to perform placeholder substitution from framework properties
-----------------------------------------------------------------------------------

                 Key: FELIX-2663
                 URL: https://issues.apache.org/jira/browse/FELIX-2663
             Project: Felix
          Issue Type: Improvement
          Components: File Install
    Affects Versions: fileinstall-3.0.2
            Reporter: David Hay


The ConfigInstaller class will perform placeholder substitution using configuration values defined elsewhere in the .cfg file or using System properties.  Would be nice if it could also use properties defined by the framework (i.e. BundleContext.getProperty())

The use case is this:  As part of the OSGi framework initialization, some properties are set on the framework that define things such as a "home" directory.  The various configuration files could then refer to resources relative to this "home" directory.  For example:

props.setProperty("app.home", homeDir); // homeDir provided by JNDI config, env variable, etc.
frameworkFactory.newFramework(props);

...

Then, in a configuration file read by the FileInstall bundle, it would be nice to be able to do:

data.directory=${app.home}/data/


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2663) Allow ConfigInstaller to perform placeholder substitution from framework properties

Posted by "David Hay (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Hay updated FELIX-2663:
-----------------------------

    Attachment: felix-fileinstall-context-properties.patch

Attaching a patch that implements this feature.  Pass the BundleContext into Util.substVars and Util.performSubstitution and use the 'getProperty' method to look up properties not found in the immediate Dictionary of properties.

> Allow ConfigInstaller to perform placeholder substitution from framework properties
> -----------------------------------------------------------------------------------
>
>                 Key: FELIX-2663
>                 URL: https://issues.apache.org/jira/browse/FELIX-2663
>             Project: Felix
>          Issue Type: Improvement
>          Components: File Install
>    Affects Versions: fileinstall-3.0.2
>            Reporter: David Hay
>         Attachments: felix-fileinstall-context-properties.patch
>
>
> The ConfigInstaller class will perform placeholder substitution using configuration values defined elsewhere in the .cfg file or using System properties.  Would be nice if it could also use properties defined by the framework (i.e. BundleContext.getProperty())
> The use case is this:  As part of the OSGi framework initialization, some properties are set on the framework that define things such as a "home" directory.  The various configuration files could then refer to resources relative to this "home" directory.  For example:
> props.setProperty("app.home", homeDir); // homeDir provided by JNDI config, env variable, etc.
> frameworkFactory.newFramework(props);
> ...
> Then, in a configuration file read by the FileInstall bundle, it would be nice to be able to do:
> data.directory=${app.home}/data/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-2663) Allow ConfigInstaller to perform placeholder substitution from framework properties

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved FELIX-2663.
------------------------------------

       Resolution: Fixed
    Fix Version/s: fileinstall-3.1.0
         Assignee: Guillaume Nodet

Committing to https://svn.apache.org/repos/asf/felix/trunk ...
	M	fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
	M	fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
	M	utils/src/main/java/org/apache/felix/utils/properties/InterpolationHelper.java
	M	utils/src/test/java/org/apache/felix/utils/properties/InterpolationHelperTest.java
	A	utils/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java
Committed r1027382


> Allow ConfigInstaller to perform placeholder substitution from framework properties
> -----------------------------------------------------------------------------------
>
>                 Key: FELIX-2663
>                 URL: https://issues.apache.org/jira/browse/FELIX-2663
>             Project: Felix
>          Issue Type: Improvement
>          Components: File Install
>    Affects Versions: fileinstall-3.0.2
>            Reporter: David Hay
>            Assignee: Guillaume Nodet
>             Fix For: fileinstall-3.1.0
>
>         Attachments: felix-fileinstall-context-properties.patch
>
>
> The ConfigInstaller class will perform placeholder substitution using configuration values defined elsewhere in the .cfg file or using System properties.  Would be nice if it could also use properties defined by the framework (i.e. BundleContext.getProperty())
> The use case is this:  As part of the OSGi framework initialization, some properties are set on the framework that define things such as a "home" directory.  The various configuration files could then refer to resources relative to this "home" directory.  For example:
> props.setProperty("app.home", homeDir); // homeDir provided by JNDI config, env variable, etc.
> frameworkFactory.newFramework(props);
> ...
> Then, in a configuration file read by the FileInstall bundle, it would be nice to be able to do:
> data.directory=${app.home}/data/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2663) Allow ConfigInstaller to perform placeholder substitution from framework properties

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921115#action_12921115 ] 

Richard S. Hall commented on FELIX-2663:
----------------------------------------

File Install just needs to use BundleContext.getProperty() for its property lookup instead of calling System.getProperty() directly, since the former already exposes system properties unless they are overwritten by configuration properties.

> Allow ConfigInstaller to perform placeholder substitution from framework properties
> -----------------------------------------------------------------------------------
>
>                 Key: FELIX-2663
>                 URL: https://issues.apache.org/jira/browse/FELIX-2663
>             Project: Felix
>          Issue Type: Improvement
>          Components: File Install
>    Affects Versions: fileinstall-3.0.2
>            Reporter: David Hay
>
> The ConfigInstaller class will perform placeholder substitution using configuration values defined elsewhere in the .cfg file or using System properties.  Would be nice if it could also use properties defined by the framework (i.e. BundleContext.getProperty())
> The use case is this:  As part of the OSGi framework initialization, some properties are set on the framework that define things such as a "home" directory.  The various configuration files could then refer to resources relative to this "home" directory.  For example:
> props.setProperty("app.home", homeDir); // homeDir provided by JNDI config, env variable, etc.
> frameworkFactory.newFramework(props);
> ...
> Then, in a configuration file read by the FileInstall bundle, it would be nice to be able to do:
> data.directory=${app.home}/data/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.