Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-249

Add possibility to override local component/extension configuration if config file is present

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major Major
    • 2.8.4
    • 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;
      

            Unassigned Unassigned
            yabon Sébastien Launay (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: