+1

Vincent Massol wrote:
> Hi,
> 
> I'd like to modify the configuration module so that it can support  
> adding dynamic configuration data (located in XWikiPreferences,  
> WebPreferences or other).
> 
> I'd like to propose:
> * We remove the notion of ConfigurationManager
> * We make ConfigurationSource components
> * We create a XWikiPropertiesConfigurationSource (hint =  
> "xwikiproperties")
> * (future) We create XWikiPreferencesDocumentConfigurationSource,  
> SpacePreferencesDocumentConfigurationSource,  
> UserPreferencesDocumentConfigurationSource components
> * Create a DefaultConfigurationSource component (hint = "default")  
> which has @Requirement("xwikiproperties") (and other sources later  
> on). It's a composite ConfigurationSource which calls the various  
> internal sources in the right order.
> 
> In term of usage here's what you'd write. For example for  
> DefaultRenderingConfiguration:
> 
> @Component
> public class DefaultRendernigConfiguration implements  
> RenderingConfiguration
> {
>      @Requirement
>      ConfigurationSource source;
> 
>      private static final String PREFIX = "rendering.";
> 
>      private static final String DEFAULT_LINK_LABEL_FORMAT = "%p";
> 
>      public String getLinkLabelFormat()
>      {
>          return (String) this.source.getProperty(PREFIX +  
> "linkLabelFormat", DEFAULT_LINK_LABEL_FORMAT);
>      }
> }
> 
> WDYT?
> 
> Thanks
> -Vincent
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to