branch feature/24 created (now 686fd96)
This is an automated email from the git hooks/post-receive script. New change to branch feature/24 in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git at 686fd96 Clean code + Impossible de se connecter à un serveur distant (closes #24) This branch includes the following new commits: new 686fd96 Clean code + Impossible de se connecter à un serveur distant (closes #24) 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 686fd96eedc55aedd6e11ddc08880d7119e9c643 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Dec 24 10:27:41 2016 +0100 Clean code + Impossible de se connecter à un serveur distant (closes #24) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/24 in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 686fd96eedc55aedd6e11ddc08880d7119e9c643 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Dec 24 10:27:41 2016 +0100 Clean code + Impossible de se connecter à un serveur distant (closes #24) --- .../swing/ui/storage/StorageUIHandler.java | 10 --- .../swing/ui/storage/StorageUILauncher.java | 95 ---------------------- .../ObserveWebSecurityApplicationContext.java | 3 + 3 files changed, 3 insertions(+), 105 deletions(-) diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUIHandler.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUIHandler.java index c436a5a..809a01d 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUIHandler.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUIHandler.java @@ -664,16 +664,6 @@ public class StorageUIHandler implements UIHandler<StorageUI> { } }); -// // initialisation des onglets -// ui.CHOOSE_DB_MODE.init(); -// ui.CONFIG.init(); -// ui.CONFIG_REFERENTIEL.init(); -// ui.CONFIG_DATA.init(); -// ui.BACKUP.init(); -// ui.SELECT_DATA.init(); -// ui.ROLES.init(); -// ui.CONFIRM.init(); - // recuperation de la source de données en cours d'utilisation ObserveDataSourceConfiguration dataSourceConfiguration = ui.getContextValue(ObserveDataSourceConfiguration.class); diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUILauncher.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUILauncher.java index 0c1bd1b..4e1e923 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUILauncher.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/storage/StorageUILauncher.java @@ -288,101 +288,6 @@ public class StorageUILauncher extends WizardUILancher<StorageStep, StorageUIMod } /** - * Méthode pour lancer l'action de connexion à une base locale. - * - * @param context le context applicatif - * @param mainUI la fenetre principale parent (peut etre null) - * @param model le modèle de source de données à utiliser - * @see StorageUI - */ - public static void obtainLocalConnexion(final JAXXContext context, - Window mainUI, - final StorageUIModel model) { - - if (mainUI == null) { - mainUI = ObserveSwingApplicationContext.get().getMainUI(); - } - - StorageUILauncher launcher = new StorageUILauncher( - context, - mainUI, - model, - t("observe.title.connect.localDB")) { - - @Override - protected StorageUI createUI(JAXXContext context, - Window mainUI, - Class<StorageUI> storageUIClass, - Class<StorageUIModel> modelClass, - StorageUIModel model) throws Exception { - if (!(mainUI instanceof JAXXObject)) { - // sinon on a pas de context propagé... - mainUI = null; - } - return super.createUI(context, mainUI, storageUIClass, modelClass, model); - } - - @Override - protected void init(StorageUI ui) { - StorageUIModel model = ui.getModel(); - - int nbModes = 0; - - DbMode mode = null; - if (model.isCanCreateLocalService()) { - nbModes++; - mode = DbMode.CREATE_LOCAL; - } - if (model.isCanUseLocalService()) { - nbModes++; - mode = DbMode.USE_LOCAL; - } - if (model.isCanUseRemoteService()) { - nbModes++; - mode = DbMode.USE_REMOTE; - } - if (model.isCanUseServerService()) { - nbModes++; - mode = DbMode.USE_SERVER; - } - - if (nbModes == 1) { - - if (log.isDebugEnabled()) { - log.debug("Only one mode available [" + mode + - "], set it in model"); - } - - // un seul mode possible, on le sélectionne - model.setDbMode(mode); - } - - // on supprime des étapes - model.setExcludeSteps(Arrays.asList( - StorageStep.BACKUP, - StorageStep.CONFIG_REFERENTIEL, - StorageStep.CONFIG_DATA, - StorageStep.SELECT_DATA, - StorageStep.CONFIRM)); - - model.updateUniverse(); - } - - @Override - protected void doAction(StorageUI ui) { - super.doAction(ui); - if (log.isDebugEnabled()) { - log.debug("Apply new local connexion to " + model); - } - ui.getModel().copyTo(model); - model.validate(); - } - }; - - launcher.start(); - } - - /** * Méthode pour lancer l'action de connexion à une base locale ou distante. * * @param context le context applicatif diff --git a/application-web/src/main/java/fr/ird/observe/application/web/security/ObserveWebSecurityApplicationContext.java b/application-web/src/main/java/fr/ird/observe/application/web/security/ObserveWebSecurityApplicationContext.java index 7501317..8ff317f 100644 --- a/application-web/src/main/java/fr/ird/observe/application/web/security/ObserveWebSecurityApplicationContext.java +++ b/application-web/src/main/java/fr/ird/observe/application/web/security/ObserveWebSecurityApplicationContext.java @@ -213,6 +213,9 @@ public class ObserveWebSecurityApplicationContext implements Closeable { if (!Objects.equals(user.getPassword(), userPassword)) { throw new BadObserveWebUserPasswordException(userLogin, userPassword); } + if (optionalDatabaseName == null) { + optionalDatabaseName = defaultDatabaseName; + } return getDataSourceConfiguration(userLogin, optionalDatabaseName); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm