branch feature/7549-2 created (now 15182a5)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7549-2 in repository observe. See http://git.codelutin.com/observe.git at 15182a5 debut d'implementation des la tâche de creation (raf : selection des données à importer) (refs #7549) This branch includes the following new commits: new 15182a5 debut d'implementation des la tâche de creation (raf : selection des données à importer) (refs #7549) 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 15182a5f913fa927c72a761489fa91f3177dc340 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Oct 5 09:55:16 2015 +0200 debut d'implementation des la tâche de creation (raf : selection des données à importer) (refs #7549) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7549-2 in repository observe. See http://git.codelutin.com/observe.git commit 15182a5f913fa927c72a761489fa91f3177dc340 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon Oct 5 09:55:16 2015 +0200 debut d'implementation des la tâche de creation (raf : selection des données à importer) (refs #7549) --- .../ird/observe/ui/storage/StorageUIHandler.java | 3 +- .../ird/observe/ui/storage/StorageUILauncher.java | 53 +++++++++++++++++++- .../fr/ird/observe/ui/storage/StorageUIModel.java | 58 ++++++++++++++++------ .../ird/observe/ui/storage/tabs/ConfigDataUI.css | 31 ++++++++++++ .../ird/observe/ui/storage/tabs/ConfigDataUI.jaxx | 35 +++++++++++++ .../ui/storage/tabs/ConfigReferentielUI.css | 29 +++++++++++ .../ui/storage/tabs/ConfigReferentielUI.jaxx | 36 ++++++++++++++ .../ui/storage/tabs/StorageTabUIHandler.java | 33 ++++++++---- .../observe-application-swing_en_GB.properties | 4 ++ .../observe-application-swing_es_ES.properties | 4 ++ .../observe-application-swing_fr_FR.properties | 8 ++- .../fr/ird/observe/services/ObserveJdbcHelper.java | 6 +-- .../services/service/DataSourceServiceTopia.java | 9 +++- 13 files changed, 278 insertions(+), 31 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java index 7a47fa6..a4eb1b8 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java @@ -260,8 +260,9 @@ public class StorageUIHandler { if (StorageStep.SELECT_DATA == newStep && mustRecompute) { + DataSelectionModel selectDataModel = model.getSelectDataModel(); if (ObstunaAdminAction.CREATE == ui.getModel().getAdminAction() - && model.getSelectDataModel().isEmpty()) { + && (selectDataModel == null || selectDataModel.isEmpty())) { // récupération des données possibles à importer initSelectData(ui); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUILauncher.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUILauncher.java index 1095c7f..6d2aff3 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUILauncher.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUILauncher.java @@ -23,6 +23,7 @@ package fr.ird.observe.ui.storage; import fr.ird.observe.ObserveSwingApplicationContext; import fr.ird.observe.configuration.ObserveSwingApplicationConfig; +import fr.ird.observe.db.constantes.ConnexionStatus; import fr.ird.observe.db.constantes.DbMode; import fr.ird.observe.ui.ObserveMainUIHandler; import fr.ird.observe.ui.UIHelper; @@ -209,6 +210,49 @@ public class StorageUILauncher extends WizardUILancher<StorageStep, StorageUIMod Window mainUI, final StorageUIModel model) { + obtainConnexion(context, mainUI, model, DbMode.USE_REMOTE); + + } + + /** + * Méthode pour lancer l'action de connexion à un serveir distant. + * <p/> + * Cette méthode doit être appelée avant toute action avec une base distante + * : + * <p/> + * synchronisation, récupération du référentiel distant... + * + * @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 obtainServerConnexion(final JAXXContext context, + Window mainUI, + final StorageUIModel model) { + + obtainConnexion(context, mainUI, model, DbMode.USE_SERVER); + + } + + /** + * Méthode pour lancer l'action de connexion à une base distante. + * <p/> + * Cette méthode doit être appelée avant toute action avec une base distante + * : + * <p/> + * synchronisation, récupération du référentiel distant... + * + * @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 obtainConnexion(final JAXXContext context, + Window mainUI, + final StorageUIModel model, + final DbMode dbmode) { + if (mainUI == null) { mainUI = ObserveSwingApplicationContext.get().getObserveMainUI(); } @@ -240,7 +284,7 @@ public class StorageUILauncher extends WizardUILancher<StorageStep, StorageUIMod model.setSteps(StorageStep.CONFIG); model.updateUniverse(); - model.setDbMode(DbMode.USE_REMOTE); + model.setDbMode(dbmode); } @Override @@ -269,6 +313,13 @@ public class StorageUILauncher extends WizardUILancher<StorageStep, StorageUIMod ui.getModel().copyTo(model); model.validate(); } + + @Override + protected void doCancel(StorageUI ui) { + super.doCancel(ui); + model.setConnexionStatus(ConnexionStatus.UNTESTED); + model.validate(); + } }; launcher.start(); diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java index b82e454..2a591d5 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java @@ -293,6 +293,7 @@ public class StorageUIModel extends WizardModel<StorageStep> { addPropertyChangeListener(REMOTE_PASSWORD_PROPERTY_NAME, clearStatus); addPropertyChangeListener(SERVER_DATABASE_PROPERTY_NAME, clearStatus); addPropertyChangeListener(USE_SSL_PROPERTY_NAME, clearStatus); + addPropertyChangeListener(DB_MODE_PROPERTY_NAME, clearStatus); } /** @@ -916,17 +917,17 @@ public class StorageUIModel extends WizardModel<StorageStep> { validate = ConnexionStatus.SUCCESS.equals(getConnexionStatus()); //FIXME Il faut savoir si l'utilisateur est le //FIXME propriétaire de la base - if (validate) { - if (getAdminAction() != null) { - - // il faut des droits rw sur la base distante - validate = dataSourceInformation != null && - dataSourceInformation.canReadReferential() && - dataSourceInformation.canWriteReferential() && - dataSourceInformation.canWriteData() && - dataSourceInformation.canReadData(); - } - } +// if (validate) { +// if (getAdminAction() != null) { +// +// // il faut des droits rw sur la base distante +// validate = dataSourceInformation != null && +// dataSourceInformation.canReadReferential() && +// dataSourceInformation.canWriteReferential() && +// dataSourceInformation.canWriteData() && +// dataSourceInformation.canReadData(); +// } +// } } break; case CONFIG_REFERENTIEL: @@ -1014,7 +1015,7 @@ public class StorageUIModel extends WizardModel<StorageStep> { break; case SELECT_DATA: // chemit 20100525 : aucune contrainte dans ce cas - validate = !selectDataModel.isEmpty(); + validate = selectDataModel != null && !selectDataModel.isEmpty(); break; case ROLES: @@ -1092,7 +1093,7 @@ public class StorageUIModel extends WizardModel<StorageStep> { break; case USE_REMOTE: case USE_SERVER: - result = ObstunaAdminAction.UPDATE.equals(adminAction); + result = ObstunaAdminAction.UPDATE.equals(adminAction) || ObstunaAdminAction.CREATE.equals(adminAction) ; break; } } @@ -1217,6 +1218,15 @@ public class StorageUIModel extends WizardModel<StorageStep> { oldValue, referentielImportMode); + switch (referentielImportMode) { + case IMPORT_SERVER_STORAGE: + centralSourceModel.setDbMode(DbMode.USE_SERVER); + break; + case IMPORT_REMOTE_STORAGE: + centralSourceModel.setDbMode(DbMode.USE_REMOTE); + break; + } + if (oldValue != referentielImportMode) { updateUniverse(); } @@ -1229,6 +1239,16 @@ public class StorageUIModel extends WizardModel<StorageStep> { firePropertyChange(DATA_IMPORT_MODE_PROPERTY_NAME, oldValue, dataImportMode); + + switch (dataImportMode) { + case IMPORT_SERVER_STORAGE: + dataSourceModel.setDbMode(DbMode.USE_SERVER); + break; + case IMPORT_REMOTE_STORAGE: + dataSourceModel.setDbMode(DbMode.USE_REMOTE); + break; + } + if (oldValue != dataImportMode) { // reset selected data to import @@ -1504,6 +1524,10 @@ public class StorageUIModel extends WizardModel<StorageStep> { public void fromStorageConfig(ObserveDataSourceConfigurationRest sourceConfig) { setDbMode(DbMode.USE_SERVER); restConfig = sourceConfig; + URL serverUrl = sourceConfig.getServerUrl(); + if (serverUrl != null) { + this.serverUrl = serverUrl.toString(); + } } public DataSourceCreateConfigurationDto getCreationConfigurationDto() throws IOException, DatabaseConnexionNotAuthorizedException, DatabaseNotFoundException, BabModelVersionException { @@ -1611,7 +1635,6 @@ public class StorageUIModel extends WizardModel<StorageStep> { protected void copyTo(StorageUIModel dst) { dst.setLocalStorageExist(isLocalStorageExist()); - dst.setDbMode(getDbMode()); dst.setBackupFile(getBackupFile()); dst.setDoBackup(isDoBackup()); dst.setStoreRemoteConfig(isStoreRemoteConfig()); @@ -1623,9 +1646,12 @@ public class StorageUIModel extends WizardModel<StorageStep> { dst.fromStorageConfig(h2Config); dst.fromStorageConfig(pgConfig); dst.fromStorageConfig(restConfig); + dst.setDbMode(getDbMode()); dst.setSelectDataModel(getSelectDataModel()); dst.setSecurityModel(getSecurityModel()); dst.setAdminAction(getAdminAction()); + dst.setConnexionStatus(getConnexionStatus()); + dst.setDataSourceInformation(getDataSourceInformation()); } public void firePgConfigChanged(String propertyName, @@ -1906,4 +1932,8 @@ public class StorageUIModel extends WizardModel<StorageStep> { public ObserveDataSourceInformation getDataSourceInformation() { return dataSourceInformation; } + + public void setDataSourceInformation(ObserveDataSourceInformation dataSourceInformation) { + this.dataSourceInformation = dataSourceInformation; + } } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.css b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.css index cfa946c..de57f5b 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.css +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.css @@ -52,6 +52,12 @@ selected:{model.getDataImportMode() == CreationMode.IMPORT_REMOTE_STORAGE}; } +#importDataFromServer { + value:{CreationMode.IMPORT_SERVER_STORAGE}; + text:"observe.synchro.import.data.fromServerStorage"; + selected:{model.getDataImportMode() == CreationMode.IMPORT_SERVER_STORAGE}; +} + #noImportDataConfig { enabled: false; text:"observe.storage.noImportData.config"; @@ -80,6 +86,31 @@ text:"observe.synchro.config.export.required.read.data"; } +#centralSourceServerLabel { + _no:{n("observe.synchro.no.server.storage")}; + text:{getHandler().updateStorageLabel(centralSourceModel, centralSourceModel.isValid(), centralSourceLabel)}; +} + +#configureCentralSourceServer { + text:"observe.action.configure"; + actionIcon:"config"; +} + +#centralSourceServerStatus { + icon:{(Icon) getClientProperty(centralSourceModel.isValid() ? "successIcon" : "failedIcon")}; +} + +#centralSourceServerPolicy { + text:{getHandler().updateDataSourcePolicy(centralSourceModel, centralSourceModel.isValid())} +} + +#centralSourceServerInfoLabel { + actionIcon:"information"; + text:"observe.synchro.config.export.required.read.data"; +} + + + #fileChooserAction { actionIcon:"fileChooser"; } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.jaxx b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.jaxx index a84758a..b0fece1 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.jaxx +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigDataUI.jaxx @@ -64,6 +64,7 @@ public void init() { <JRadioButton id="noImportData" styleClass='creationMode'/> <JRadioButton id="importDataFromBackup" styleClass='creationMode'/> <JRadioButton id="importDataFromRemote" styleClass='creationMode'/> + <JRadioButton id="importDataFromServer" styleClass='creationMode'/> </JPanel> </cell> </row> @@ -131,6 +132,40 @@ public void init() { </cell> </row> </Table> + + <!-- importer les données a partir d'un server distant --> + <Table id='IMPORT_SERVER_STORAGE' fill="both" + constraints='"IMPORT_SERVER_STORAGE"'> + <row> + <cell> + <JLabel + text='observe.storage.importServerStorageData.config'/> + </cell> + </row> + <row> + <cell weightx='1' fill='both'> + <JLabel id='centralSourceServerLabel'/> + </cell> + <cell> + <JButton id='configureCentralSourceServer' + onActionPerformed='getHandler().obtainServerConnexion(this)'/> + </cell> + <cell anchor='east'> + <JLabel id='centralSourceServerStatus'/> + </cell> + </row> + <row> + <cell fill='both' columns="2"> + <JLabel id='centralSourceServerPolicy'/> + </cell> + </row> + <row> + <cell fill='both' columns="2"> + <JLabel id='centralSourceServerInfoLabel'/> + </cell> + </row> + </Table> + </JPanel> </cell> </row> diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.css b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.css index 715d1d8..fde4874 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.css +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.css @@ -52,6 +52,12 @@ selected:{model.getReferentielImportMode() == CreationMode.IMPORT_REMOTE_STORAGE}; } +#importReferentielFromServer { + value:{CreationMode.IMPORT_SERVER_STORAGE}; + text:{CreationMode.IMPORT_SERVER_STORAGE.getLabel()}; + selected:{model.getReferentielImportMode() == CreationMode.IMPORT_SERVER_STORAGE}; +} + #noImportReferentielConfig { enabled: false; text:"observe.storage.noImportReferentiel.config"; @@ -80,6 +86,29 @@ text:"observe.synchro.config.export.required.read.referentiel"; } +#centralSourceServerLabel { + _no:{n("observe.synchro.no.server.storage")}; + text:{getHandler().updateStorageLabel(centralSourceModel, centralSourceModel.isValid(), centralSourceLabel)}; +} + +#configureCentralSourceServer { + text:"observe.action.configure"; + actionIcon:"config"; +} + +#centralSourceServerStatus { + icon:{(Icon) getClientProperty(centralSourceModel.isValid() ? "successIcon" : "failedIcon")}; +} + +#centralSourceServerPolicy { + text:{getHandler().updateDataSourcePolicy(centralSourceModel, centralSourceModel.isValid())} +} + +#centralSourceServerInfoLabel { + actionIcon:"information"; + text:"observe.synchro.config.export.required.read.referentiel"; +} + #fileChooserAction { actionIcon:"fileChooser"; } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.jaxx b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.jaxx index fa263fe..c5d001e 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.jaxx +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/ConfigReferentielUI.jaxx @@ -67,6 +67,8 @@ public void init() { styleClass='creationMode'/> <JRadioButton id="importReferentielFromRemote" styleClass='creationMode'/> + <JRadioButton id="importReferentielFromServer" + styleClass='creationMode'/> </JPanel> </cell> </row> @@ -136,6 +138,40 @@ public void init() { </cell> </row> </Table> + + <!-- importer le référentiel a partir d'un Server distant --> + <Table id='IMPORT_SERVER_STORAGE' fill="both" + constraints='"IMPORT_SERVER_STORAGE"'> + <row> + <cell> + <JLabel + text='observe.storage.importServerStorageReferentiel.config'/> + </cell> + </row> + <row> + <cell weightx='1' fill='both'> + <JLabel id='centralSourceServerLabel'/> + </cell> + <cell> + <JButton id='configureCentralSourceServer' + onActionPerformed='getHandler().obtainServerConnexion(this)'/> + </cell> + <cell anchor='east'> + <JLabel id='centralSourceServerStatus'/> + </cell> + </row> + <row> + <cell fill='both' columns="2"> + <JLabel id='centralSourceServerPolicy'/> + </cell> + </row> + <row> + <cell fill='both' columns="2"> + <JLabel id='centralSourceServerInfoLabel'/> + </cell> + </row> + </Table> + </JPanel> </cell> </row> diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/StorageTabUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/StorageTabUIHandler.java index b644e28..c91192c 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/StorageTabUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/tabs/StorageTabUIHandler.java @@ -28,7 +28,6 @@ import fr.ird.observe.db.ObserveSwingDataSource; import fr.ird.observe.db.constantes.ConnexionStatus; import fr.ird.observe.db.constantes.CreationMode; import fr.ird.observe.db.constantes.DbMode; -import fr.ird.observe.services.configuration.ObserveDataSourceConfiguration; import fr.ird.observe.ui.UIHelper; import fr.ird.observe.ui.storage.StorageStep; import fr.ird.observe.ui.storage.StorageUILauncher; @@ -420,10 +419,18 @@ public class StorageTabUIHandler { sourceModel ); - // on recopie la configuration de la source d'import - ObserveDataSourceConfiguration config = sourceModel.toPGStorageConfig("Import référentiel"); - //Fixme - //ui.getModel().getCreationConfigurationDto().setImportReferentialDataSourceConfiguration(config); + sourceModel.validate(StorageStep.CONFIG); + + ui.getModel().validate(); + } + + public void obtainServerConnexion(ConfigReferentielUI ui) { + StorageUIModel sourceModel = ui.getCentralSourceModel(); + StorageUILauncher.obtainServerConnexion( + ui.getDelegateContext(), + ui.getParentContainer(Window.class), + sourceModel + ); sourceModel.validate(StorageStep.CONFIG); @@ -438,10 +445,18 @@ public class StorageTabUIHandler { sourceModel ); - // on recopie la configuration de la source d'import - ObserveDataSourceConfiguration config = sourceModel.toPGStorageConfig("Import référentiel"); - // Fixme - //ui.getModel().getCreationConfigurationDto().setImportDataConfiguration(config, ImmutableSet.<String>of()); + sourceModel.validate(StorageStep.CONFIG); + + ui.getModel().validate(); + } + + public void obtainServerConnexion(ConfigDataUI ui) { + StorageUIModel sourceModel = ui.getCentralSourceModel(); + StorageUILauncher.obtainServerConnexion( + ui.getDelegateContext(), + ui.getParentContainer(Window.class), + sourceModel + ); sourceModel.validate(StorageStep.CONFIG); diff --git a/observe-application-swing/src/main/resources/i18n/observe-application-swing_en_GB.properties b/observe-application-swing/src/main/resources/i18n/observe-application-swing_en_GB.properties index 04b9ede..b53695c 100644 --- a/observe-application-swing/src/main/resources/i18n/observe-application-swing_en_GB.properties +++ b/observe-application-swing/src/main/resources/i18n/observe-application-swing_en_GB.properties @@ -1804,6 +1804,8 @@ observe.storage.importRemoteStorageData.config= observe.storage.importRemoteStorageReferentiel.config= observe.storage.importServerStorage.config= observe.storage.importServerStorage.description= +observe.storage.importServerStorageData.config= +observe.storage.importServerStorageReferentiel.config= observe.storage.internalDump.last.modified= observe.storage.internalDump.not.exist= observe.storage.label.backup= @@ -1944,6 +1946,7 @@ observe.synchro.configuration= observe.synchro.continue.with.no.save.report= observe.synchro.import.data.fromBackup= observe.synchro.import.data.fromRemoteStorage= +observe.synchro.import.data.fromServerStorage= observe.synchro.importGPS.invalidIntervals.list= observe.synchro.message.all.obsolete.entities.fixed= observe.synchro.message.need.save.for.synchro.operation= @@ -1956,6 +1959,7 @@ observe.synchro.no.data.import= observe.synchro.no.local.storage= observe.synchro.no.referentiel.import= observe.synchro.no.remote.storage= +observe.synchro.no.server.storage= observe.synchro.obsolete.entities.list= observe.synchro.obsolete.entity.fix= observe.synchro.obsolete.entity.label= diff --git a/observe-application-swing/src/main/resources/i18n/observe-application-swing_es_ES.properties b/observe-application-swing/src/main/resources/i18n/observe-application-swing_es_ES.properties index a7a9db4..e08639b 100644 --- a/observe-application-swing/src/main/resources/i18n/observe-application-swing_es_ES.properties +++ b/observe-application-swing/src/main/resources/i18n/observe-application-swing_es_ES.properties @@ -1806,6 +1806,8 @@ observe.storage.importRemoteStorageData.config= observe.storage.importRemoteStorageReferentiel.config=Escoja la base remota que contenga el referencial a importar observe.storage.importServerStorage.config= observe.storage.importServerStorage.description= +observe.storage.importServerStorageData.config= +observe.storage.importServerStorageReferentiel.config= observe.storage.internalDump.last.modified=(última importación \: %1$td/%1$tm/%1$tY à %1$tH\:%1$tM) observe.storage.internalDump.not.exist=No hay base de embarque. observe.storage.label.backup=Base temporal para backup @@ -1946,6 +1948,7 @@ observe.synchro.configuration=Configuración de las operaciones observe.synchro.continue.with.no.save.report=Continuar sin guardar el informe observe.synchro.import.data.fromBackup= observe.synchro.import.data.fromRemoteStorage= +observe.synchro.import.data.fromServerStorage= observe.synchro.importGPS.invalidIntervals.list=Lista de los intervalos de puntos gps no usables observe.synchro.message.all.obsolete.entities.fixed=No hay mas referencias a los objetos obsoletos. observe.synchro.message.need.save.for.synchro.operation=La operación de sincronización de referenciales ha generado cambios @@ -1958,6 +1961,7 @@ observe.synchro.no.data.import= observe.synchro.no.local.storage=No hay base origen definida observe.synchro.no.referentiel.import=No importar el referencial observe.synchro.no.remote.storage=No hay base de referencia definida +observe.synchro.no.server.storage= observe.synchro.obsolete.entities.list=La lista de entidades de referenciales está obsoleta observe.synchro.obsolete.entity.fix=Cambiar las referencias del objeto seleccionado observe.synchro.obsolete.entity.label=%1$s \: "%2$s" diff --git a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties index a39efaa..99124f7 100644 --- a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties +++ b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties @@ -1803,8 +1803,10 @@ observe.storage.importRemoteStorage.config=Sélection de la base distante à imp observe.storage.importRemoteStorage.description=Veuillez configurer la connexion vers une base distante.\nAvant de pouvoir poursuivre, vous devez valider la connexion. observe.storage.importRemoteStorageData.config=Choisir la base distante contenant les données à importer observe.storage.importRemoteStorageReferentiel.config=Choisir la base distante contenant le référentiel à importer -observe.storage.importServerStorage.config= -observe.storage.importServerStorage.description= +observe.storage.importServerStorage.config=Sélection du serveur distant à importer +observe.storage.importServerStorage.description=Veuillez configurer la connexion vers un serveur distant.\nAvant de pouvoir poursuivre, vous devez valider la connexion. +observe.storage.importServerStorageData.config=Choisir le serveur distant contenant les données à importer +observe.storage.importServerStorageReferentiel.config=Choisir le serveur distant contenant le référentiel à importer observe.storage.internalDump.last.modified=(dernier import \: %1$td/%1$tm/%1$tY à %1$tH\:%1$tM) observe.storage.internalDump.not.exist=Pas de base embarquée. observe.storage.label.backup=Base temporaire pour backup @@ -1944,6 +1946,7 @@ observe.synchro.configuration=Configuration des opérations observe.synchro.continue.with.no.save.report=Continuer sans sauver de rapport observe.synchro.import.data.fromBackup=Importer les données depuis une sauvegarde de base locale (*.sql.gz) observe.synchro.import.data.fromRemoteStorage=Importer les données depuis une base distante +observe.synchro.import.data.fromServerStorage=Importer les données depuis un serveur distant observe.synchro.importGPS.invalidIntervals.list=Liste des intervalles de points gps non utilisables observe.synchro.message.all.obsolete.entities.fixed=Il n'y a plus de références sur des objets obsolètes. observe.synchro.message.need.save.for.synchro.operation=L'opération de synchronisation du référentiel a engendrée des modifications. @@ -1956,6 +1959,7 @@ observe.synchro.no.data.import=Ne pas importer de données observe.synchro.no.local.storage=Aucune base source définie observe.synchro.no.referentiel.import=Ne pas importer de référentiel observe.synchro.no.remote.storage=Aucune base de référence définie +observe.synchro.no.server.storage=Aucun serveur de référence defini observe.synchro.obsolete.entities.list=Liste des entités du référentiel obsolètes observe.synchro.obsolete.entity.fix=Changer les références sur l'objet sélectionné observe.synchro.obsolete.entity.label=%1$s \: "%2$s" diff --git a/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveJdbcHelper.java b/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveJdbcHelper.java index 1efa7bf..4814778 100644 --- a/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveJdbcHelper.java +++ b/observe-services-topia/src/main/java/fr/ird/observe/services/ObserveJdbcHelper.java @@ -86,15 +86,15 @@ public class ObserveJdbcHelper extends JdbcHelper { version = Versions.valueOf(versionStr); } - return version; - } catch (SQLException e) { - throw new RuntimeException(e); + // si la table n'existe pas on renvoie la version 0 } finally { closeQuietly(preparedStatement); closeQuietly(connection); } + return version; + } public List<ObserveDbUserDto> getUsers() { diff --git a/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java b/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java index 4f3713d..840eb07 100644 --- a/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java +++ b/observe-services-topia/src/main/java/fr/ird/observe/services/service/DataSourceServiceTopia.java @@ -395,7 +395,14 @@ public class DataSourceServiceTopia extends ObserveServiceTopia implements DataS version = observeJdbcHelper.getVersion(); - if (dataSourceConfiguration.isH2Database()) { + if (Version.VZERO.equals(version)) { + + readReferential = false; + writeReferential = false; + readData = false; + writeData = false; + + } else if (dataSourceConfiguration.isH2Database()) { // Sur une base H2, on a le droit de tout lire, mais uniquement d'écrire les données readReferential = true; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm