You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2012/11/14 17:04:12 UTC

[jira] [Commented] (SLING-2662) Enhance run mode handling

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

Carsten Ziegeler commented on SLING-2662:
-----------------------------------------

I've taken a slightly different approach which is easier to configure but provides the same feature:

There two new configuration properties "sling.run.mode.options" and "sling.run.mode.install.options" - they basically work the same and take a list of run mode options.
A run mode option is a list of run modes which is comma separated like a,b,c. Several options are separeted by '|', so for example:
sling.run.mode.options=a,b|c,d,e

Once an option is defined exactly one of this run mode will be active. If none of the listed run modes is specified, the first one in the list is activated. If one is specified, this is active, if several are specified, the first specified from the list is used.
Examples with above definition:
User Defines -> Result:
-    -> a,c
a   -> a,c
b   -> b,c
a,b -> a,c
a,d -> a,d
a,e,f -> a,e

"sling.run.mode.install.options" works exactly the same with the difference that this is only evaluated at first start - for a restart the values from the first startup are taken! So if user specified b,c on first startup and a,f on a restart b,c are still the active ones.


                
> Enhance run mode handling
> -------------------------
>
>                 Key: SLING-2662
>                 URL: https://issues.apache.org/jira/browse/SLING-2662
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: Extensions Settings 1.1.0
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Extensions Settings 1.1.2
>
>
> Often there is a need to provide different features where the user might have the ability to choose whether a feature should be installed or not.
> This can easily be done with a run mode, so a feature is put into a run mode, and if the run mode is activated by the user, the feature is installed.
> However, there are cases where two features might be concurrent, so either feature A or feature B should be installed. Still run modes can be used by defining two run modes A and B - but in this case if the user does not choose one of the run modes, nothing is installed - or if the user selects both run modes, both are installed.
> We could support such use cases with some configuration properties for the settings service:
> a) we define a property which contains run modes that are usually always active
> b) in addition, we define a property which contains whether a run mode is active unless another run mode is active.
> So for the above use case, we define run mode A as always active and also set the second property to define that A is not active once B is activated by the user
> We could also define a third property which contains a set of run modes that are only choosable on the first startup of the installation, so in the in the example above, if this property is defined for A and B, the user selection of the first startup is preserved

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira