branch feature/GIT updated (e8d7430 -> c61442e)
This is an automated email from the git hooks/post-receive script. New change to branch feature/GIT in repository scmwebeditor. See http://git.nuiton.org/scmwebeditor.git from e8d7430 Use of the providers for the UI to make it more modular new c61442e Changed the configuration file: 1 SCM provider per line The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit c61442e663b83b5345cdd04121bc5db09bc9141e Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Tue May 5 16:34:03 2015 +0200 Changed the configuration file: 1 SCM provider per line Summary of changes: .../org/nuiton/scmwebeditor/ScmWebEditorConfig.java | 20 +++++++++++--------- .../scmwebeditor/ScmWebEditorConfigOption.java | 4 +--- src/main/resources/scmwebeditor.properties | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/GIT in repository scmwebeditor. See http://git.nuiton.org/scmwebeditor.git commit c61442e663b83b5345cdd04121bc5db09bc9141e Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Tue May 5 16:34:03 2015 +0200 Changed the configuration file: 1 SCM provider per line --- .../org/nuiton/scmwebeditor/ScmWebEditorConfig.java | 20 +++++++++++--------- .../scmwebeditor/ScmWebEditorConfigOption.java | 4 +--- src/main/resources/scmwebeditor.properties | 3 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java b/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java index f1b2d41..c9a3b3d 100644 --- a/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java +++ b/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java @@ -29,6 +29,7 @@ import org.nuiton.config.ArgumentsParserException; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; public class ScmWebEditorConfig { @@ -71,16 +72,17 @@ public class ScmWebEditorConfig { String key = ScmWebEditorConfigOption.PROVIDERS.getKey(); Map<String, String> providers = new HashMap<String, String>(); - List<String> options = getConfig().getOptionAsList(key).getOption(); + Properties properties = getConfig().getOptions(); - for (String option : options) { - String[] nameClass = option.split(":"); - if (nameClass.length == 2) { - providers.put(nameClass[0], nameClass[1]); - } else { - if (log.isErrorEnabled()) { - log.error("Can not read option : " + option); - } + for (String propertyName : properties.stringPropertyNames()) { + + // getting the properties about the providers only + if (propertyName.startsWith(key)) { + + String providerKey = propertyName.substring(propertyName.lastIndexOf('.') + 1); + String providerClass = getConfig().getOption(propertyName); + + providers.put(providerKey, providerClass); } } diff --git a/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java b/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java index dca0634..e80b92b 100644 --- a/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java +++ b/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java @@ -24,15 +24,13 @@ package org.nuiton.scmwebeditor; import org.nuiton.config.ApplicationConfig; import org.nuiton.config.ConfigOptionDef; -import java.util.List; - public enum ScmWebEditorConfigOption implements ConfigOptionDef { CONFIG_FILE(ApplicationConfig.CONFIG_FILE_NAME, "The file name", "scmwebeditor.properties", String.class, false, false), EDITABLE_FILES("swe.editableFiles", "description", "Files types that are editable", String.class, true, true), COOKIES_PRIVATE_KEY("swe.cookiePrivateKey", "Private key for cookies", null, String.class, true, true), LOCAL_REPOSITORIES_PATH("swe.localRepositoriesPath", "The path where the local repositories will be stored", "/var/local/swe", String.class, false, true), - PROVIDERS("swe.providers", "The SCMs that can be used", null, List.class, false, true); + PROVIDERS("swe.provider", "The SCMs that can be used", null, String.class, false, true); private final String key; diff --git a/src/main/resources/scmwebeditor.properties b/src/main/resources/scmwebeditor.properties index 2f19baf..a6b78a7 100644 --- a/src/main/resources/scmwebeditor.properties +++ b/src/main/resources/scmwebeditor.properties @@ -22,4 +22,5 @@ swe.editableFiles=text,xml,javascript,sh,x-tex,x-java swe.cookiePrivateKey=ZvcCyhfRTVZoQz3B/IpYdw== swe.localRepositoriesPath=/var/local/swe -swe.providers=SVN:org.nuiton.scmwebeditor.SvnProvider,Git:org.nuiton.scmwebeditor.GitProvider +swe.provider.SVN=org.nuiton.scmwebeditor.SvnProvider +swe.provider.Git=org.nuiton.scmwebeditor.GitProvider -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm