-
New Feature
-
Resolution: Duplicate
-
Major
-
1.1.8
-
None
In order to change the local configuration (the XML configuration nested in a component/extension declaration) we must
deactivate the feature and then duplicate the component/extension declaration.
I propose to use the config attribute only if the config file is present, otherwise local configuration is used.
This allow handy configuration overriding (typically for changing default value found in the configuration).
The proposed patch:
Index: main/kernel/src/org/ametys/runtime/plugin/PluginsManager.java =================================================================== --- main/kernel/src/org/ametys/runtime/plugin/PluginsManager.java (revision 494) +++ main/kernel/src/org/ametys/runtime/plugin/PluginsManager.java (working copy) @@ -1155,13 +1155,20 @@ if (is == null) { - throw new IllegalArgumentException("The config file '" + configPath + "' does not exist"); + throw new FileNotFoundException("File not found: " + configPath); } } } return new DefaultConfigurationBuilder().build(is, configPath); } + catch (FileNotFoundException e) + { + if (_logger.isDebugEnabled()) + { + _logger.debug("Configuration not found at URI: '" + config + "', using initial configuration.", e); + } + } catch (Exception ex) { String errorMessage = "Unable to load external configuration defined in the plugin " + pluginName;
- Duplique
-
RUNTIME-750 Makes config attribute not exclusive in component declarations
- Closed