Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
13 changed files:
- client/src/main/java/fr/ird/observe/client/ui/admin/AdminTabUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/admin/export/ExportModel.java
- client/src/main/java/fr/ird/observe/client/ui/admin/export/ExportUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/admin/export/ExportUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/admin/export/ExportUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/admin/synchronize/data/DataSynchroModel.java
- client/src/main/java/fr/ird/observe/client/ui/admin/synchronize/data/DataSynchroUI.jaxx
- client/src/main/java/fr/ird/observe/client/ui/admin/synchronize/data/DataSynchroUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/admin/synchronize/data/DataSynchroUIHandler.java
- client/src/main/resources/i18n/client_en_GB.properties
- client/src/main/resources/i18n/client_es_ES.properties
- client/src/main/resources/i18n/client_fr_FR.properties
- dto/src/main/java/fr/ird/observe/dto/decoration/DecoratorService.java
Changes:
| ... | ... | @@ -25,10 +25,16 @@ import fr.ird.observe.client.ObserveRunner; |
| 25 | 25 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 26 | 26 |
import fr.ird.observe.client.db.ObserveSwingDataSource;
|
| 27 | 27 |
import fr.ird.observe.client.ui.admin.resume.ShowResumeUI;
|
| 28 |
+import fr.ird.observe.client.ui.content.ref.usage.UsageForDisplayUI;
|
|
| 29 |
+import fr.ird.observe.client.ui.util.ProgressModel;
|
|
| 30 |
+import fr.ird.observe.client.ui.util.UIHelper;
|
|
| 28 | 31 |
import fr.ird.observe.dto.I18nEnumHelper;
|
| 29 | 32 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 33 |
+import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper;
|
|
| 30 | 34 |
import fr.ird.observe.dto.decoration.decorators.ReferentialReferenceDecorator;
|
| 31 | 35 |
import fr.ird.observe.dto.reference.DataDtoReference;
|
| 36 |
+import fr.ird.observe.dto.reference.DtoReference;
|
|
| 37 |
+import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
|
| 32 | 38 |
import fr.ird.observe.dto.referential.ProgramReference;
|
| 33 | 39 |
import fr.ird.observe.services.service.BabModelVersionException;
|
| 34 | 40 |
import fr.ird.observe.services.service.DatabaseConnexionNotAuthorizedException;
|
| ... | ... | @@ -36,14 +42,23 @@ import fr.ird.observe.services.service.DatabaseNotFoundException; |
| 36 | 42 |
import fr.ird.observe.services.service.data.DeleteTripResult;
|
| 37 | 43 |
import fr.ird.observe.services.service.data.ExportTripResult;
|
| 38 | 44 |
import fr.ird.observe.services.service.data.ImportTripResult;
|
| 45 |
+import fr.ird.observe.services.service.referential.MissingReferentialRequest;
|
|
| 46 |
+import fr.ird.observe.services.service.referential.MissingReferentialResult;
|
|
| 47 |
+import fr.ird.observe.services.service.referential.ReferentialService;
|
|
| 48 |
+import fr.ird.observe.spi.map.ImmutableSetDtoMap;
|
|
| 49 |
+import fr.ird.observe.spi.map.ImmutableSetStringMap;
|
|
| 39 | 50 |
import org.apache.commons.lang3.StringUtils;
|
| 40 |
-import org.apache.logging.log4j.Logger;
|
|
| 41 | 51 |
import org.apache.logging.log4j.LogManager;
|
| 52 |
+import org.apache.logging.log4j.Logger;
|
|
| 53 |
+import org.nuiton.decorator.Decorator;
|
|
| 42 | 54 |
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| 43 | 55 |
import org.nuiton.util.StringUtil;
|
| 44 | 56 |
|
| 57 |
+import javax.swing.JOptionPane;
|
|
| 45 | 58 |
import java.io.PrintWriter;
|
| 46 | 59 |
import java.io.StringWriter;
|
| 60 |
+import java.util.Collection;
|
|
| 61 |
+import java.util.Set;
|
|
| 47 | 62 |
import java.util.concurrent.Callable;
|
| 48 | 63 |
|
| 49 | 64 |
import static org.nuiton.i18n.I18n.n;
|
| ... | ... | @@ -65,7 +80,7 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 65 | 80 |
protected AdminUI parentUI;
|
| 66 | 81 |
|
| 67 | 82 |
/** Service de decoration. */
|
| 68 |
- private DecoratorService decoratorService;
|
|
| 83 |
+ protected DecoratorService decoratorService;
|
|
| 69 | 84 |
|
| 70 | 85 |
public void beforeInit(U ui) {
|
| 71 | 86 |
this.ui = ui;
|
| ... | ... | @@ -181,12 +196,13 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 181 | 196 |
}
|
| 182 | 197 |
|
| 183 | 198 |
protected void logExportResult(String i18nKey,
|
| 199 |
+ String sourceLabel,
|
|
| 184 | 200 |
ExportTripResult tripResult,
|
| 185 | 201 |
ReferentialReferenceDecorator programDecorator,
|
| 186 | 202 |
ProgramReference program,
|
| 187 | 203 |
DataDtoReference trip) {
|
| 188 | 204 |
|
| 189 |
- String message = sendLogResultMessage(i18nKey, programDecorator, program, trip, tripResult.getTime());
|
|
| 205 |
+ String message = sendLogResultMessage(i18nKey, sourceLabel, programDecorator, program, trip, tripResult.getTime());
|
|
| 190 | 206 |
if (log.isInfoEnabled()) {
|
| 191 | 207 |
log.info(message);
|
| 192 | 208 |
}
|
| ... | ... | @@ -196,6 +212,7 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 196 | 212 |
|
| 197 | 213 |
protected void logImportResult(String importI18nKey,
|
| 198 | 214 |
String deleteI18nKey,
|
| 215 |
+ String sourceLabel,
|
|
| 199 | 216 |
ImportTripResult tripResult,
|
| 200 | 217 |
ReferentialReferenceDecorator programDecorator,
|
| 201 | 218 |
ProgramReference program,
|
| ... | ... | @@ -203,7 +220,7 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 203 | 220 |
|
| 204 | 221 |
if (tripResult.isDeleted()) {
|
| 205 | 222 |
|
| 206 |
- String message = sendLogResultMessage(deleteI18nKey, programDecorator, program, trip, tripResult.getDeleteTime());
|
|
| 223 |
+ String message = sendLogResultMessage(deleteI18nKey, sourceLabel, programDecorator, program, trip, tripResult.getDeleteTime());
|
|
| 207 | 224 |
if (log.isInfoEnabled()) {
|
| 208 | 225 |
log.info(message);
|
| 209 | 226 |
}
|
| ... | ... | @@ -212,7 +229,7 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 212 | 229 |
|
| 213 | 230 |
if (tripResult.isImported()) {
|
| 214 | 231 |
|
| 215 |
- String message = sendLogResultMessage(importI18nKey, programDecorator, program, trip, tripResult.getImportTime());
|
|
| 232 |
+ String message = sendLogResultMessage(importI18nKey, sourceLabel, programDecorator, program, trip, tripResult.getImportTime());
|
|
| 216 | 233 |
if (log.isInfoEnabled()) {
|
| 217 | 234 |
log.info(message);
|
| 218 | 235 |
}
|
| ... | ... | @@ -222,12 +239,13 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 222 | 239 |
}
|
| 223 | 240 |
|
| 224 | 241 |
protected void logDeleteResult(String deleteI18nKey,
|
| 242 |
+ String sourceLabel,
|
|
| 225 | 243 |
DeleteTripResult tripResult,
|
| 226 | 244 |
ReferentialReferenceDecorator programDecorator,
|
| 227 | 245 |
ProgramReference program,
|
| 228 | 246 |
DataDtoReference trip) {
|
| 229 | 247 |
|
| 230 |
- String message = sendLogResultMessage(deleteI18nKey, programDecorator, program, trip, tripResult.getTime());
|
|
| 248 |
+ String message = sendLogResultMessage(deleteI18nKey, sourceLabel, programDecorator, program, trip, tripResult.getTime());
|
|
| 231 | 249 |
if (log.isInfoEnabled()) {
|
| 232 | 250 |
log.info(message);
|
| 233 | 251 |
}
|
| ... | ... | @@ -235,7 +253,7 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 235 | 253 |
}
|
| 236 | 254 |
|
| 237 | 255 |
protected String sendLogResultMessage(String i18nKey,
|
| 238 |
- ReferentialReferenceDecorator programDecorator,
|
|
| 256 |
+ String sourceLabel, ReferentialReferenceDecorator programDecorator,
|
|
| 239 | 257 |
ProgramReference program,
|
| 240 | 258 |
DataDtoReference trip,
|
| 241 | 259 |
long time) {
|
| ... | ... | @@ -244,9 +262,60 @@ public class AdminTabUIHandler<U extends AdminTabUI> { |
| 244 | 262 |
String programStr = programDecorator.toString(program);
|
| 245 | 263 |
String tripStr = decoratorService.getDataReferenceDecorator(trip.getReferenceType()).toString(trip);
|
| 246 | 264 |
String timeStr = StringUtil.convertTime(time);
|
| 247 |
- String message = StringUtils.leftPad(timeStr, 20) + " - " + t(i18nKey, programStr, tripStr);
|
|
| 265 |
+ String message = StringUtils.leftPad(timeStr, 20) + " - " + t(i18nKey, sourceLabel, programStr, tripStr);
|
|
| 248 | 266 |
sendMessage(message);
|
| 249 | 267 |
return message;
|
| 250 | 268 |
}
|
| 251 | 269 |
|
| 270 |
+ protected WizardState prepareCopy(ProgressModel progressModel, ObserveSwingDataSource centralSource, String centralSourceLabel, ObserveSwingDataSource targetSource, String targetSourceLabel, Collection<String> idsToCopy) {
|
|
| 271 |
+ |
|
| 272 |
+ progressModel.incrementsCurrentStep();
|
|
| 273 |
+ |
|
| 274 |
+ ReferentialService targetReferentialService = targetSource.getReferentialService();
|
|
| 275 |
+ ImmutableSetStringMap targetSourceReferential = targetReferentialService.getReferentialIds();
|
|
| 276 |
+ MissingReferentialRequest missingReferentialRequest = MissingReferentialRequest.of(targetSourceReferential, idsToCopy.toArray(new String[0]));
|
|
| 277 |
+ MissingReferentialResult missingReferentialResult = centralSource.getReferentialService().computeMissingReferential(missingReferentialRequest);
|
|
| 278 |
+ |
|
| 279 |
+ progressModel.incrementsCurrentStep();
|
|
| 280 |
+ |
|
| 281 |
+ if (missingReferentialResult == null) {
|
|
| 282 |
+ progressModel.incrementsCurrentStep();
|
|
| 283 |
+ return WizardState.SUCCESSED;
|
|
| 284 |
+ }
|
|
| 285 |
+ |
|
| 286 |
+ // there is some referential to add to target source
|
|
| 287 |
+ |
|
| 288 |
+ String message = t("observe.message.show.usage.for.missingReferentials2", centralSourceLabel, targetSourceLabel);
|
|
| 289 |
+ |
|
| 290 |
+ ImmutableSetDtoMap<ReferentialDtoReference> usages = centralSource.getReferentialMap(missingReferentialResult.getMissingIds());
|
|
| 291 |
+ UsageForDisplayUI usagesUI = UsageForDisplayUI.build(message, usages);
|
|
| 292 |
+ |
|
| 293 |
+ int response = UIHelper.askUser(null,
|
|
| 294 |
+ t("observe.title.can.not.export.data2", targetSourceLabel),
|
|
| 295 |
+ usagesUI,
|
|
| 296 |
+ JOptionPane.WARNING_MESSAGE,
|
|
| 297 |
+ new Object[]{
|
|
| 298 |
+ t("observe.choice.confirm.insert"),
|
|
| 299 |
+ t("observe.choice.cancel")},
|
|
| 300 |
+ 0);
|
|
| 301 |
+ |
|
| 302 |
+ if (response != 0) {
|
|
| 303 |
+ return WizardState.CANCELED;
|
|
| 304 |
+ }
|
|
| 305 |
+ |
|
| 306 |
+ log.info(String.format("Base «%s» - Insertion des référentiels manquants.", targetSourceLabel));
|
|
| 307 |
+ |
|
| 308 |
+ for (Class<? extends ReferentialDtoReference> key : usages.referentialReferenceTypes()) {
|
|
| 309 |
+ Set<? extends ReferentialDtoReference> references = usages.get(key);
|
|
| 310 |
+ String type = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(key));
|
|
| 311 |
+ sendMessage(t("observe.actions.exportData.message.add.missing.referentials2", targetSourceLabel, references.size(), type));
|
|
| 312 |
+ Decorator decorator = decoratorService.getReferenceDecorator(key);
|
|
| 313 |
+ for (DtoReference reference : references) {
|
|
| 314 |
+ sendMessage(t("observe.actions.exportData.message.add.missing.referential", decorator.toString(reference)));
|
|
| 315 |
+ }
|
|
| 316 |
+ }
|
|
| 317 |
+ progressModel.incrementsCurrentStep();
|
|
| 318 |
+ targetReferentialService.insertMissingReferential(missingReferentialResult.getSqlCode());
|
|
| 319 |
+ return WizardState.SUCCESSED;
|
|
| 320 |
+ }
|
|
| 252 | 321 |
}
|
| ... | ... | @@ -61,7 +61,6 @@ public class ExportModel extends AdminActionModel { |
| 61 | 61 |
|
| 62 | 62 |
protected ObserveSwingDataSource centralSource;
|
| 63 | 63 |
|
| 64 |
- protected boolean insertMissingReferentials;
|
|
| 65 | 64 |
private final ProgressModel progressModel = new ProgressModel();
|
| 66 | 65 |
|
| 67 | 66 |
public ExportModel() {
|
| ... | ... | @@ -129,15 +128,6 @@ public class ExportModel extends AdminActionModel { |
| 129 | 128 |
|
| 130 | 129 |
}
|
| 131 | 130 |
|
| 132 |
- public boolean isInsertMissingReferentials() {
|
|
| 133 |
- return insertMissingReferentials;
|
|
| 134 |
- }
|
|
| 135 |
- |
|
| 136 |
- public void setInsertMissingReferentials(boolean insertMissingReferentials) {
|
|
| 137 |
- this.insertMissingReferentials = insertMissingReferentials;
|
|
| 138 |
- firePropertyChange("insertMissingReferential", null, insertMissingReferentials);
|
|
| 139 |
- }
|
|
| 140 |
- |
|
| 141 | 131 |
public boolean validate(AdminUIModel uiModel) {
|
| 142 | 132 |
return uiModel.validate(AdminStep.SELECT_DATA) && uiModel.getStepState(step) == WizardState.SUCCESSED;
|
| 143 | 133 |
}
|
| ... | ... | @@ -64,9 +64,6 @@ public void updateState(WizardState newState) { |
| 64 | 64 |
|
| 65 | 65 |
<JPanel id='NEED_FIX_content'>
|
| 66 | 66 |
|
| 67 |
- <JCheckBox id="insertMissingReferentials" constraints='BorderLayout.NORTH'
|
|
| 68 |
- onStateChanged='getStepModel().setInsertMissingReferentials(((JCheckBox)event.getSource()).isSelected())'/>
|
|
| 69 |
- |
|
| 70 | 67 |
<!-- la liste des trips -->
|
| 71 | 68 |
<JScrollPane id='tripPane' constraints='BorderLayout.CENTER'>
|
| 72 | 69 |
<JTable id='trips'/>
|
| ... | ... | @@ -46,8 +46,3 @@ |
| 46 | 46 |
columnHeaderView:{trips.getTableHeader()};
|
| 47 | 47 |
verticalScrollBarPolicy:{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED};
|
| 48 | 48 |
}
|
| 49 |
- |
|
| 50 |
-#insertMissingReferentials {
|
|
| 51 |
- text:"observe.action.export.requiredInsertMissingReferentials";
|
|
| 52 |
- selected:{stepModel.isInsertMissingReferentials()};
|
|
| 53 |
-}
|
| ... | ... | @@ -6,15 +6,15 @@ |
| 6 | 6 |
* %%
|
| 7 | 7 |
* This program is free software: you can redistribute it and/or modify
|
| 8 | 8 |
* it under the terms of the GNU General Public License as
|
| 9 |
- * published by the Free Software Foundation, either version 3 of the
|
|
| 9 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 10 | 10 |
* License, or (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 17 |
- * You should have received a copy of the GNU General Public
|
|
| 16 |
+ *
|
|
| 17 |
+ * You should have received a copy of the GNU General Public
|
|
| 18 | 18 |
* License along with this program. If not, see
|
| 19 | 19 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 |
* #L%
|
| ... | ... | @@ -27,46 +27,35 @@ import fr.ird.observe.client.ui.ObserveKeyStrokes; |
| 27 | 27 |
import fr.ird.observe.client.ui.admin.AdminStep;
|
| 28 | 28 |
import fr.ird.observe.client.ui.admin.AdminTabUIHandler;
|
| 29 | 29 |
import fr.ird.observe.client.ui.admin.AdminUIModel;
|
| 30 |
+import fr.ird.observe.client.ui.admin.config.ConfigModel;
|
|
| 30 | 31 |
import fr.ird.observe.client.ui.admin.config.ConfigUI;
|
| 31 |
-import fr.ird.observe.client.ui.content.ref.usage.UsageForDisplayUI;
|
|
| 32 | 32 |
import fr.ird.observe.client.ui.tree.selection.SelectionTreeModel;
|
| 33 | 33 |
import fr.ird.observe.client.ui.util.ProgressModel;
|
| 34 | 34 |
import fr.ird.observe.client.ui.util.UIHelper;
|
| 35 | 35 |
import fr.ird.observe.dto.data.longline.TripLonglineReference;
|
| 36 | 36 |
import fr.ird.observe.dto.data.seine.TripSeineReference;
|
| 37 | 37 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 38 |
-import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper;
|
|
| 39 | 38 |
import fr.ird.observe.dto.decoration.decorators.DataReferenceDecorator;
|
| 40 | 39 |
import fr.ird.observe.dto.decoration.decorators.ReferentialReferenceDecorator;
|
| 41 |
-import fr.ird.observe.dto.reference.DtoReference;
|
|
| 42 |
-import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
|
| 43 | 40 |
import fr.ird.observe.dto.referential.ProgramReference;
|
| 44 | 41 |
import fr.ird.observe.services.service.data.ExportTripRequest;
|
| 45 | 42 |
import fr.ird.observe.services.service.data.ExportTripResult;
|
| 46 | 43 |
import fr.ird.observe.services.service.data.ImportTripRequest;
|
| 47 | 44 |
import fr.ird.observe.services.service.data.ImportTripResult;
|
| 48 | 45 |
import fr.ird.observe.services.service.data.TripManagementService;
|
| 49 |
-import fr.ird.observe.services.service.referential.MissingReferentialRequest;
|
|
| 50 |
-import fr.ird.observe.services.service.referential.MissingReferentialResult;
|
|
| 51 |
-import fr.ird.observe.services.service.referential.ReferentialService;
|
|
| 52 |
-import fr.ird.observe.spi.map.ImmutableSetDtoMap;
|
|
| 53 |
-import fr.ird.observe.spi.map.ImmutableSetStringMap;
|
|
| 54 | 46 |
import org.apache.commons.collections4.CollectionUtils;
|
| 55 | 47 |
import org.apache.logging.log4j.LogManager;
|
| 56 | 48 |
import org.apache.logging.log4j.Logger;
|
| 57 |
-import org.nuiton.decorator.Decorator;
|
|
| 58 | 49 |
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 59 | 50 |
import org.nuiton.jaxx.runtime.swing.editor.MyDefaultCellEditor;
|
| 60 | 51 |
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| 61 | 52 |
|
| 62 |
-import javax.swing.JOptionPane;
|
|
| 63 | 53 |
import javax.swing.JTable;
|
| 64 | 54 |
import javax.swing.table.DefaultTableCellRenderer;
|
| 65 | 55 |
import java.awt.event.MouseAdapter;
|
| 66 | 56 |
import java.awt.event.MouseEvent;
|
| 67 | 57 |
import java.util.Date;
|
| 68 | 58 |
import java.util.List;
|
| 69 |
-import java.util.Set;
|
|
| 70 | 59 |
import java.util.stream.Collectors;
|
| 71 | 60 |
|
| 72 | 61 |
import static org.nuiton.i18n.I18n.n;
|
| ... | ... | @@ -157,18 +146,14 @@ public class ExportUIHandler extends AdminTabUIHandler<ExportUI> implements UIHa |
| 157 | 146 |
}
|
| 158 | 147 |
}
|
| 159 | 148 |
|
| 160 |
- public void doPrepareAction() {
|
|
| 161 |
- |
|
| 149 |
+ void doPrepareAction() {
|
|
| 162 | 150 |
addAdminWorker(ui.getPrepareAction().getToolTipText(), this::doPrepareAction0);
|
| 163 | 151 |
}
|
| 164 | 152 |
|
| 165 | 153 |
public void doStartAction() {
|
| 166 |
- |
|
| 167 | 154 |
int[] rows = ui.getTripsModel().getSelected();
|
| 168 | 155 |
ui.getModel().getExportModel().setExportDataSelectedIndex(rows);
|
| 169 |
- |
|
| 170 | 156 |
addAdminWorker(ui.getStartAction().getToolTipText(), this::doStartAction0);
|
| 171 |
- |
|
| 172 | 157 |
}
|
| 173 | 158 |
|
| 174 | 159 |
private WizardState doPrepareAction0() throws Exception {
|
| ... | ... | @@ -232,8 +217,9 @@ public class ExportUIHandler extends AdminTabUIHandler<ExportUI> implements UIHa |
| 232 | 217 |
|
| 233 | 218 |
AdminUIModel model = ui.getModel();
|
| 234 | 219 |
ExportModel stepModel = model.getExportModel();
|
| 235 |
- |
|
| 236 |
- boolean insertMissingReferentials = stepModel.isInsertMissingReferentials();
|
|
| 220 |
+ ConfigModel configModel = model.getConfigModel();
|
|
| 221 |
+ String sourceSourceLabel = configModel.getLocalSourceModel().getLabelWithUrl().substring(configModel.getLocalSourceModel().getLabel().length());
|
|
| 222 |
+ String centralSourceLabel = configModel.getCentralSourceModel().getLabelWithUrl().substring(configModel.getCentralSourceModel().getLabel().length());
|
|
| 237 | 223 |
|
| 238 | 224 |
// on filtre les marées sélectionnées pour export
|
| 239 | 225 |
List<TripEntry> tripEntries = stepModel.getSelectedTrips();
|
| ... | ... | @@ -243,10 +229,7 @@ public class ExportUIHandler extends AdminTabUIHandler<ExportUI> implements UIHa |
| 243 | 229 |
DecoratorService decoratorService = getDecoratorService();
|
| 244 | 230 |
ReferentialReferenceDecorator<ProgramReference> programDecorator = decoratorService.getReferentialReferenceDecorator(ProgramReference.class);
|
| 245 | 231 |
|
| 246 |
- int stepCount = 2 + 2 * tripEntries.size();
|
|
| 247 |
- if (insertMissingReferentials) {
|
|
| 248 |
- stepCount++;
|
|
| 249 |
- }
|
|
| 232 |
+ int stepCount = 4 + 2 * tripEntries.size();
|
|
| 250 | 233 |
|
| 251 | 234 |
ProgressModel progressModel = stepModel.getProgressModel();
|
| 252 | 235 |
progressModel.setStepsCount(stepCount);
|
| ... | ... | @@ -261,71 +244,11 @@ public class ExportUIHandler extends AdminTabUIHandler<ExportUI> implements UIHa |
| 261 | 244 |
|
| 262 | 245 |
TripManagementService centralTripManagementService = centralDataSource.getTripManagementService();
|
| 263 | 246 |
|
| 264 |
- ReferentialService centralReferentialService = centralDataSource.getReferentialService();
|
|
| 265 |
- |
|
| 266 |
- // chargement du référentiel de la base centrale
|
|
| 267 |
- if (log.isInfoEnabled()) {
|
|
| 268 |
- log.info("Chargement du réferentiel de la base centrale.");
|
|
| 269 |
- }
|
|
| 270 |
- ImmutableSetStringMap centralSourceReferential = centralReferentialService.getReferentialIds();
|
|
| 271 |
- |
|
| 272 | 247 |
List<String> tripIds = tripEntries.stream().map(TripEntry::getTripId).collect(Collectors.toList());
|
| 273 | 248 |
|
| 274 |
- // génération du code sql pour les référentiels manquants
|
|
| 275 |
- if (log.isInfoEnabled()) {
|
|
| 276 |
- log.info("Chargement de l'enveloppe de référentiels pour les " + tripIds.size() + " marée(s).");
|
|
| 277 |
- }
|
|
| 278 |
- MissingReferentialRequest missingReferentialRequest = MissingReferentialRequest.of(centralSourceReferential, tripIds.toArray(new String[0]));
|
|
| 279 |
- MissingReferentialResult result =
|
|
| 280 |
- localDataSource.getReferentialService().computeMissingReferential(missingReferentialRequest);
|
|
| 281 |
- |
|
| 282 |
- if (!insertMissingReferentials && result != null) {
|
|
| 283 |
- |
|
| 284 |
- // l'export n'est pas possible
|
|
| 285 |
- UIHelper.displayWarning(t("observe.title.can.not.export.data"), t("observe.actions.exportData.error.missingReferentialsId"));
|
|
| 286 |
- sendMessage(t("observe.actions.exportData.error.missingReferentialsId"));
|
|
| 287 |
- return WizardState.CANCELED;
|
|
| 288 |
- }
|
|
| 289 |
- |
|
| 290 |
- if (insertMissingReferentials && result != null) {
|
|
| 291 |
- |
|
| 292 |
- String message = t("observe.message.show.usage.for.missingReferentials");
|
|
| 293 |
- |
|
| 294 |
- ImmutableSetDtoMap<ReferentialDtoReference> usages = localDataSource.getReferentialMap(result.getMissingIds());
|
|
| 295 |
- UsageForDisplayUI usagesUI = UsageForDisplayUI.build(message, usages);
|
|
| 296 |
- |
|
| 297 |
- int reponse = UIHelper.askUser(null,
|
|
| 298 |
- t("observe.title.can.not.export.data"),
|
|
| 299 |
- usagesUI,
|
|
| 300 |
- JOptionPane.WARNING_MESSAGE,
|
|
| 301 |
- new Object[]{
|
|
| 302 |
- t("observe.choice.confirm.insert"),
|
|
| 303 |
- t("observe.choice.cancel")},
|
|
| 304 |
- 0);
|
|
| 305 |
- |
|
| 306 |
- if (reponse != 0) {
|
|
| 307 |
- |
|
| 308 |
- return WizardState.CANCELED;
|
|
| 309 |
- }
|
|
| 310 |
- |
|
| 311 |
- // insertion des référentiels manquants dans la base centrale
|
|
| 312 |
- if (log.isInfoEnabled()) {
|
|
| 313 |
- log.info("Insertion dans la base centrale des référentiels manquants.");
|
|
| 314 |
- }
|
|
| 315 |
- |
|
| 316 |
- for (Class<? extends ReferentialDtoReference> key : usages.referentialReferenceTypes()) {
|
|
| 317 |
- Set<? extends ReferentialDtoReference> references = usages.get(key);
|
|
| 318 |
- String type = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(key));
|
|
| 319 |
- sendMessage(t("observe.actions.exportData.message.add.missing.referentials", type, references.size()));
|
|
| 320 |
- Decorator decorator = decoratorService.getReferenceDecorator(key);
|
|
| 321 |
- for (DtoReference reference : references) {
|
|
| 322 |
- sendMessage(t("observe.actions.exportData.message.add.missing.referential", decorator.toString(reference)));
|
|
| 323 |
- }
|
|
| 324 |
- }
|
|
| 325 |
- |
|
| 326 |
- progressModel.incrementsCurrentStep();
|
|
| 327 |
- centralReferentialService.insertMissingReferential(result.getSqlCode());
|
|
| 328 |
- |
|
| 249 |
+ WizardState result = prepareCopy(progressModel, localDataSource, sourceSourceLabel, centralDataSource, centralSourceLabel, tripIds);
|
|
| 250 |
+ if (WizardState.CANCELED.equals(result)) {
|
|
| 251 |
+ return result;
|
|
| 329 | 252 |
}
|
| 330 | 253 |
|
| 331 | 254 |
for (TripEntry tripEntry : tripEntries) {
|
| ... | ... | @@ -333,7 +256,8 @@ public class ExportUIHandler extends AdminTabUIHandler<ExportUI> implements UIHa |
| 333 | 256 |
progressModel.incrementsCurrentStep();
|
| 334 | 257 |
ExportTripRequest exportTripRequest = new ExportTripRequest(false, tripEntry.getProgramId(), tripEntry.getTripId());
|
| 335 | 258 |
ExportTripResult exportTripResult = localTripManagementService.exportTrip(exportTripRequest);
|
| 336 |
- logExportResult(n("observe.actions.exportData.message.result.export.trip"),
|
|
| 259 |
+ logExportResult(n("observe.actions.synchro.data.result.export.trip"),
|
|
| 260 |
+ sourceSourceLabel,
|
|
| 337 | 261 |
exportTripResult,
|
| 338 | 262 |
programDecorator,
|
| 339 | 263 |
tripEntry.getProgram(),
|
| ... | ... | @@ -342,8 +266,9 @@ public class ExportUIHandler extends AdminTabUIHandler<ExportUI> implements UIHa |
| 342 | 266 |
progressModel.incrementsCurrentStep();
|
| 343 | 267 |
ImportTripRequest importTripRequest = new ImportTripRequest(exportTripResult);
|
| 344 | 268 |
ImportTripResult importTripResult = centralTripManagementService.importTrip(importTripRequest);
|
| 345 |
- logImportResult(n("observe.actions.exportData.message.result.import.trip"),
|
|
| 346 |
- n("observe.actions.exportData.message.result.delete.trip"),
|
|
| 269 |
+ logImportResult(n("observe.actions.synchro.data.result.import.trip"),
|
|
| 270 |
+ n("observe.actions.synchro.data.result.delete.trip"),
|
|
| 271 |
+ centralSourceLabel,
|
|
| 347 | 272 |
importTripResult,
|
| 348 | 273 |
programDecorator,
|
| 349 | 274 |
tripEntry.getProgram(),
|
| ... | ... | @@ -64,7 +64,7 @@ public class DataSynchroModel extends AdminActionModel { |
| 64 | 64 |
|
| 65 | 65 |
/** les données sélectionnées sur le panneau de droite. */
|
| 66 | 66 |
protected SelectionTreeModel rightSelectionDataModel;
|
| 67 |
- protected boolean insertMissingReferentials;
|
|
| 67 |
+ |
|
| 68 | 68 |
protected final DefaultListModel<DataSynchronizeTaskSupport> tasks;
|
| 69 | 69 |
|
| 70 | 70 |
private final ProgressModel progressModel = new ProgressModel();
|
| ... | ... | @@ -131,14 +131,6 @@ public class DataSynchroModel extends AdminActionModel { |
| 131 | 131 |
return rightSelectionDataModel;
|
| 132 | 132 |
}
|
| 133 | 133 |
|
| 134 |
- public boolean isInsertMissingReferentials() {
|
|
| 135 |
- return insertMissingReferentials;
|
|
| 136 |
- }
|
|
| 137 |
- |
|
| 138 |
- public void setInsertMissingReferentials(boolean insertMissingReferentials) {
|
|
| 139 |
- this.insertMissingReferentials = insertMissingReferentials;
|
|
| 140 |
- }
|
|
| 141 |
- |
|
| 142 | 134 |
public void populateLeftSelectionModel() {
|
| 143 | 135 |
populateSelectionModel(leftSource, leftSelectionDataModel, LEFT_SELECTION_MODEL_CHANGED_PROPERTY_NAME);
|
| 144 | 136 |
}
|
| ... | ... | @@ -49,9 +49,6 @@ |
| 49 | 49 |
</Table>
|
| 50 | 50 |
</JPanel>
|
| 51 | 51 |
<JPanel id='NEED_FIX_content'>
|
| 52 |
- <JCheckBox id="insertMissingReferentials" constraints='BorderLayout.NORTH'
|
|
| 53 |
- onStateChanged='getStepModel().setInsertMissingReferentials(((JCheckBox)event.getSource()).isSelected())'/>
|
|
| 54 |
- |
|
| 55 | 52 |
<JSplitPane id="contentSplitPane" constraints='BorderLayout.CENTER'>
|
| 56 | 53 |
<Table id='contentNorth' fill="both" weighty="1">
|
| 57 | 54 |
<row>
|
| ... | ... | @@ -45,11 +45,6 @@ |
| 45 | 45 |
mnemonic:Q;
|
| 46 | 46 |
}
|
| 47 | 47 |
|
| 48 |
-#insertMissingReferentials {
|
|
| 49 |
- text:"observe.action.export.requiredInsertMissingReferentials";
|
|
| 50 |
- selected:{stepModel.isInsertMissingReferentials()};
|
|
| 51 |
-}
|
|
| 52 |
- |
|
| 53 | 48 |
#leftTree {
|
| 54 | 49 |
minimumSize:{UIHelper.newMinDimension()};
|
| 55 | 50 |
font-size:11;
|
| ... | ... | @@ -33,17 +33,12 @@ import fr.ird.observe.client.ui.admin.synchronize.data.task.CopyToRightDataSynch |
| 33 | 33 |
import fr.ird.observe.client.ui.admin.synchronize.data.task.DataSynchronizeTaskSupport;
|
| 34 | 34 |
import fr.ird.observe.client.ui.admin.synchronize.data.task.DeleteFromLeftDataSynchronizeTask;
|
| 35 | 35 |
import fr.ird.observe.client.ui.admin.synchronize.data.task.DeleteFromRightDataSynchronizeTask;
|
| 36 |
-import fr.ird.observe.client.ui.content.ref.usage.UsageForDisplayUI;
|
|
| 37 | 36 |
import fr.ird.observe.client.ui.tree.selection.SelectionTree;
|
| 38 | 37 |
import fr.ird.observe.client.ui.tree.selection.SelectionTreeModel;
|
| 39 | 38 |
import fr.ird.observe.client.ui.util.ProgressModel;
|
| 40 |
-import fr.ird.observe.client.ui.util.UIHelper;
|
|
| 41 | 39 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 42 |
-import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper;
|
|
| 43 | 40 |
import fr.ird.observe.dto.decoration.decorators.ReferentialReferenceDecorator;
|
| 44 | 41 |
import fr.ird.observe.dto.reference.DataDtoReference;
|
| 45 |
-import fr.ird.observe.dto.reference.DtoReference;
|
|
| 46 |
-import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
|
| 47 | 42 |
import fr.ird.observe.dto.referential.ProgramReference;
|
| 48 | 43 |
import fr.ird.observe.services.service.data.DeleteTripRequest;
|
| 49 | 44 |
import fr.ird.observe.services.service.data.DeleteTripResult;
|
| ... | ... | @@ -52,19 +47,12 @@ import fr.ird.observe.services.service.data.ExportTripResult; |
| 52 | 47 |
import fr.ird.observe.services.service.data.ImportTripRequest;
|
| 53 | 48 |
import fr.ird.observe.services.service.data.ImportTripResult;
|
| 54 | 49 |
import fr.ird.observe.services.service.data.TripManagementService;
|
| 55 |
-import fr.ird.observe.services.service.referential.MissingReferentialRequest;
|
|
| 56 |
-import fr.ird.observe.services.service.referential.MissingReferentialResult;
|
|
| 57 |
-import fr.ird.observe.services.service.referential.ReferentialService;
|
|
| 58 |
-import fr.ird.observe.spi.map.ImmutableSetDtoMap;
|
|
| 59 |
-import fr.ird.observe.spi.map.ImmutableSetStringMap;
|
|
| 60 | 50 |
import org.apache.logging.log4j.LogManager;
|
| 61 | 51 |
import org.apache.logging.log4j.Logger;
|
| 62 |
-import org.nuiton.decorator.Decorator;
|
|
| 63 | 52 |
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 64 | 53 |
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| 65 | 54 |
|
| 66 | 55 |
import javax.swing.DefaultListModel;
|
| 67 |
-import javax.swing.JOptionPane;
|
|
| 68 | 56 |
import javax.swing.border.TitledBorder;
|
| 69 | 57 |
import java.awt.Color;
|
| 70 | 58 |
import java.util.LinkedHashSet;
|
| ... | ... | @@ -84,6 +72,8 @@ import static org.nuiton.i18n.I18n.t; |
| 84 | 72 |
public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> implements UIHandler<DataSynchroUI> {
|
| 85 | 73 |
|
| 86 | 74 |
private static final Logger log = LogManager.getLogger(DataSynchroUIHandler.class);
|
| 75 |
+ private String leftSourceLabel;
|
|
| 76 |
+ private String rightSourceLabel;
|
|
| 87 | 77 |
|
| 88 | 78 |
@Override
|
| 89 | 79 |
public void afterInit(DataSynchroUI ui) {
|
| ... | ... | @@ -143,7 +133,7 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 143 | 133 |
addAdminWorker(getUi().getStartAction().getToolTipText(), this::doStartAction0);
|
| 144 | 134 |
}
|
| 145 | 135 |
|
| 146 |
- public void addCopyToLeftTasks() {
|
|
| 136 |
+ void addCopyToLeftTasks() {
|
|
| 147 | 137 |
SelectionTreeModel rightSelectionDataModel = getStepModel().getRightSelectionDataModel();
|
| 148 | 138 |
SelectionTreeModel leftSelectionDataModel = getStepModel().getLeftSelectionDataModel();
|
| 149 | 139 |
Map<ProgramReference, List<DataDtoReference<?, ?>>> selectedDataByProgram = rightSelectionDataModel.getSelectedDataByProgram();
|
| ... | ... | @@ -160,7 +150,7 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 160 | 150 |
}
|
| 161 | 151 |
}
|
| 162 | 152 |
|
| 163 |
- public void addCopyToRightTasks() {
|
|
| 153 |
+ void addCopyToRightTasks() {
|
|
| 164 | 154 |
SelectionTreeModel leftSelectionDataModel = getStepModel().getLeftSelectionDataModel();
|
| 165 | 155 |
SelectionTreeModel rightSelectionDataModel = getStepModel().getRightSelectionDataModel();
|
| 166 | 156 |
Map<ProgramReference, List<DataDtoReference<?, ?>>> selectedDataByProgram = leftSelectionDataModel.getSelectedDataByProgram();
|
| ... | ... | @@ -177,7 +167,7 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 177 | 167 |
}
|
| 178 | 168 |
}
|
| 179 | 169 |
|
| 180 |
- public void addDeleteFromLeftTasks() {
|
|
| 170 |
+ void addDeleteFromLeftTasks() {
|
|
| 181 | 171 |
SelectionTreeModel selectionDataModel = getStepModel().getLeftSelectionDataModel();
|
| 182 | 172 |
Map<ProgramReference, List<DataDtoReference<?, ?>>> selectedDataByProgram = selectionDataModel.getSelectedDataByProgram();
|
| 183 | 173 |
selectionDataModel.removeAllSelectedData();
|
| ... | ... | @@ -189,7 +179,7 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 189 | 179 |
}
|
| 190 | 180 |
}
|
| 191 | 181 |
|
| 192 |
- public void addDeleteFromRightTasks() {
|
|
| 182 |
+ void addDeleteFromRightTasks() {
|
|
| 193 | 183 |
SelectionTreeModel selectionDataModel = getStepModel().getRightSelectionDataModel();
|
| 194 | 184 |
Map<ProgramReference, List<DataDtoReference<?, ?>>> selectedDataByProgram = selectionDataModel.getSelectedDataByProgram();
|
| 195 | 185 |
selectionDataModel.removeAllSelectedData();
|
| ... | ... | @@ -201,7 +191,24 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 201 | 191 |
}
|
| 202 | 192 |
}
|
| 203 | 193 |
|
| 204 |
- public void doExecuteAction() {
|
|
| 194 |
+ public String getLeftSourceLabel() {
|
|
| 195 |
+ if (leftSourceLabel == null) {
|
|
| 196 |
+ ConfigModel configModel = getModel().getConfigModel();
|
|
| 197 |
+ leftSourceLabel = configModel.getLocalSourceModel().getLabelWithUrl().substring(configModel.getLocalSourceModel().getLabel().length());
|
|
| 198 |
+ }
|
|
| 199 |
+ return leftSourceLabel;
|
|
| 200 |
+ }
|
|
| 201 |
+ |
|
| 202 |
+ public String getRightSourceLabel() {
|
|
| 203 |
+ if (rightSourceLabel == null) {
|
|
| 204 |
+ ConfigModel configModel = getModel().getConfigModel();
|
|
| 205 |
+ rightSourceLabel = configModel.getCentralSourceModel().getLabelWithUrl().substring(configModel.getCentralSourceModel().getLabel().length());
|
|
| 206 |
+ }
|
|
| 207 |
+ return rightSourceLabel;
|
|
| 208 |
+ }
|
|
| 209 |
+ |
|
| 210 |
+ void doExecuteAction() {
|
|
| 211 |
+ leftSourceLabel = rightSourceLabel = null;
|
|
| 205 | 212 |
addAdminWorker(getUi().getStartAction().getToolTipText(), this::doExecuteAction0);
|
| 206 | 213 |
}
|
| 207 | 214 |
|
| ... | ... | @@ -211,6 +218,9 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 211 | 218 |
DataSynchroModel stepModel = getStepModel();
|
| 212 | 219 |
ConfigUI configUI = (ConfigUI) parentUI.getStepUI(AdminStep.CONFIG);
|
| 213 | 220 |
|
| 221 |
+ String leftSourceLabel = getLeftSourceLabel();
|
|
| 222 |
+ String rightSourceLabel = getRightSourceLabel();
|
|
| 223 |
+ |
|
| 214 | 224 |
ConfigModel configModel = getModel().getConfigModel();
|
| 215 | 225 |
|
| 216 | 226 |
ObserveSwingDataSource leftSource = configModel.getSafeLocalSource(true);
|
| ... | ... | @@ -220,10 +230,9 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 220 | 230 |
stepModel.setRightSource(rightSource);
|
| 221 | 231 |
|
| 222 | 232 |
stepModel.populateLeftSelectionModel();
|
| 223 |
- String leftLabelWithUrl = configModel.getLocalSourceModel().getLabelWithUrl();
|
|
| 224 |
- sendMessage(t("observe.actions.synchro.data.message.data.loaded", leftLabelWithUrl));
|
|
| 233 |
+ sendMessage(t("observe.actions.synchro.data.message.data.loaded", leftSourceLabel));
|
|
| 225 | 234 |
|
| 226 |
- TitledBorder leftBorder = new TitledBorder(leftLabelWithUrl);
|
|
| 235 |
+ TitledBorder leftBorder = new TitledBorder(leftSourceLabel);
|
|
| 227 | 236 |
boolean leftCanWriteData = configModel.getLocalSourceModel().getDataSourceInformation().canWriteData();
|
| 228 | 237 |
leftBorder.setTitleColor(leftCanWriteData ? Color.GREEN : Color.RED);
|
| 229 | 238 |
tabUI.getLeftTreePane().setBorder(leftBorder);
|
| ... | ... | @@ -234,10 +243,9 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 234 | 243 |
configUI.getLocalSourceConfig().setBorder(leftBorder);
|
| 235 | 244 |
|
| 236 | 245 |
stepModel.populateRightSelectionModel();
|
| 237 |
- String rightLabelWithUrl = configModel.getCentralSourceModel().getLabelWithUrl();
|
|
| 238 |
- sendMessage(t("observe.actions.synchro.data.message.data.loaded", rightLabelWithUrl));
|
|
| 246 |
+ sendMessage(t("observe.actions.synchro.data.message.data.loaded", rightSourceLabel));
|
|
| 239 | 247 |
|
| 240 |
- TitledBorder rightBorder = new TitledBorder(rightLabelWithUrl);
|
|
| 248 |
+ TitledBorder rightBorder = new TitledBorder(rightSourceLabel);
|
|
| 241 | 249 |
boolean rightCanWriteData = configModel.getCentralSourceModel().getDataSourceInformation().canWriteData();
|
| 242 | 250 |
rightBorder.setTitleColor(rightCanWriteData ? Color.GREEN : Color.RED);
|
| 243 | 251 |
tabUI.getRightTreePane().setBorder(rightBorder);
|
| ... | ... | @@ -254,9 +262,11 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 254 | 262 |
private WizardState doExecuteAction0() {
|
| 255 | 263 |
|
| 256 | 264 |
ObserveSwingDataSource leftSource = getStepModel().getLeftSource();
|
| 257 |
- |
|
| 258 | 265 |
ObserveSwingDataSource rightSource = getStepModel().getRightSource();
|
| 259 | 266 |
|
| 267 |
+ String leftSourceLabel = getLeftSourceLabel();
|
|
| 268 |
+ String rightSourceLabel = getRightSourceLabel();
|
|
| 269 |
+ |
|
| 260 | 270 |
DefaultListModel<DataSynchronizeTaskSupport> tasks = getStepModel().getTasks();
|
| 261 | 271 |
int size = tasks.size();
|
| 262 | 272 |
|
| ... | ... | @@ -289,131 +299,19 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 289 | 299 |
progressModel.setStepsCount(stepsCount);
|
| 290 | 300 |
|
| 291 | 301 |
DecoratorService decoratorService = getDecoratorService();
|
| 292 |
- boolean insertMissingReferentials = getStepModel().isInsertMissingReferentials();
|
|
| 293 | 302 |
if (copyToLeft) {
|
| 294 |
- |
|
| 295 | 303 |
// generate add missing referential to left
|
| 296 |
- |
|
| 297 |
- progressModel.incrementsCurrentStep();
|
|
| 298 |
- |
|
| 299 |
- ReferentialService leftReferentialService = leftSource.getReferentialService();
|
|
| 300 |
- ImmutableSetStringMap leftSourceReferential = leftReferentialService.getReferentialIds();
|
|
| 301 |
- MissingReferentialRequest leftMissingReferentialRequest = MissingReferentialRequest.of(leftSourceReferential, idsToCopyToLeft.toArray(new String[0]));
|
|
| 302 |
- MissingReferentialResult leftMissingReferentialResult =
|
|
| 303 |
- rightSource.getReferentialService().computeMissingReferential(leftMissingReferentialRequest);
|
|
| 304 |
- |
|
| 305 |
- progressModel.incrementsCurrentStep();
|
|
| 306 |
- |
|
| 307 |
- if (!insertMissingReferentials && leftMissingReferentialResult != null) {
|
|
| 308 |
- |
|
| 309 |
- // l'export n'est pas possible
|
|
| 310 |
- UIHelper.displayWarning(t("observe.title.can.not.export.data.left"), t("observe.actions.exportData.error.missingReferentialsId.left"));
|
|
| 311 |
- sendMessage(t("observe.actions.exportData.error.missingReferentialsId.left"));
|
|
| 312 |
- return WizardState.CANCELED;
|
|
| 313 |
- }
|
|
| 314 |
- |
|
| 315 |
- if (leftMissingReferentialResult == null) {
|
|
| 316 |
- progressModel.incrementsCurrentStep();
|
|
| 317 |
- } else {
|
|
| 318 |
- |
|
| 319 |
- // there is some referential to add to left source
|
|
| 320 |
- |
|
| 321 |
- String message = t("observe.message.show.usage.for.missingReferentials.left");
|
|
| 322 |
- |
|
| 323 |
- ImmutableSetDtoMap<ReferentialDtoReference> usages = rightSource.getReferentialMap(leftMissingReferentialResult.getMissingIds());
|
|
| 324 |
- UsageForDisplayUI usagesUI = UsageForDisplayUI.build(message, usages);
|
|
| 325 |
- |
|
| 326 |
- int reponse = UIHelper.askUser(null,
|
|
| 327 |
- t("observe.title.can.not.export.data.left"),
|
|
| 328 |
- usagesUI,
|
|
| 329 |
- JOptionPane.WARNING_MESSAGE,
|
|
| 330 |
- new Object[]{
|
|
| 331 |
- t("observe.choice.confirm.insert"),
|
|
| 332 |
- t("observe.choice.cancel")},
|
|
| 333 |
- 0);
|
|
| 334 |
- |
|
| 335 |
- if (reponse != 0) {
|
|
| 336 |
- |
|
| 337 |
- return WizardState.CANCELED;
|
|
| 338 |
- }
|
|
| 339 |
- |
|
| 340 |
- // insertion des référentiels manquants dans la base centrale
|
|
| 341 |
- log.info("Insertion dans la base de gauche des référentiels manquants.");
|
|
| 342 |
- |
|
| 343 |
- for (Class<? extends ReferentialDtoReference> key : usages.referentialReferenceTypes()) {
|
|
| 344 |
- Set<? extends ReferentialDtoReference> references = usages.get(key);
|
|
| 345 |
- String type = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(key));
|
|
| 346 |
- sendMessage(t("observe.actions.exportData.message.add.missing.referentials.left", references.size(), type));
|
|
| 347 |
- Decorator decorator = decoratorService.getReferenceDecorator(key);
|
|
| 348 |
- for (DtoReference reference : references) {
|
|
| 349 |
- sendMessage(t("observe.actions.exportData.message.add.missing.referential", decorator.toString(reference)));
|
|
| 350 |
- }
|
|
| 351 |
- }
|
|
| 352 |
- progressModel.incrementsCurrentStep();
|
|
| 353 |
- leftReferentialService.insertMissingReferential(leftMissingReferentialResult.getSqlCode());
|
|
| 304 |
+ WizardState result = prepareCopy(progressModel, rightSource, rightSourceLabel, leftSource, leftSourceLabel, idsToCopyToLeft);
|
|
| 305 |
+ if (WizardState.CANCELED.equals(result)) {
|
|
| 306 |
+ return result;
|
|
| 354 | 307 |
}
|
| 355 | 308 |
}
|
| 356 | 309 |
|
| 357 | 310 |
if (copyToRight) {
|
| 358 |
- |
|
| 359 | 311 |
// generate add missing referential to right
|
| 360 |
- |
|
| 361 |
- progressModel.incrementsCurrentStep();
|
|
| 362 |
- |
|
| 363 |
- ReferentialService rightReferentialService = rightSource.getReferentialService();
|
|
| 364 |
- ImmutableSetStringMap rightSourceReferential = rightReferentialService.getReferentialIds();
|
|
| 365 |
- MissingReferentialRequest rightMissingReferentialRequest = MissingReferentialRequest.of(rightSourceReferential, idsToCopyToRight.toArray(new String[0]));
|
|
| 366 |
- MissingReferentialResult rightMissingReferentialResult =
|
|
| 367 |
- leftSource.getReferentialService().computeMissingReferential(rightMissingReferentialRequest);
|
|
| 368 |
- |
|
| 369 |
- progressModel.incrementsCurrentStep();
|
|
| 370 |
- |
|
| 371 |
- if (!insertMissingReferentials && rightMissingReferentialResult != null) {
|
|
| 372 |
- |
|
| 373 |
- // l'export n'est pas possible
|
|
| 374 |
- UIHelper.displayWarning(t("observe.title.can.not.export.data.right"), t("observe.actions.exportData.error.missingReferentialsId.right"));
|
|
| 375 |
- sendMessage(t("observe.actions.exportData.error.missingReferentialsId.right"));
|
|
| 376 |
- return WizardState.CANCELED;
|
|
| 377 |
- }
|
|
| 378 |
- |
|
| 379 |
- if (rightMissingReferentialResult == null) {
|
|
| 380 |
- progressModel.incrementsCurrentStep();
|
|
| 381 |
- } else {
|
|
| 382 |
- |
|
| 383 |
- // there is some referential to add to left source
|
|
| 384 |
- |
|
| 385 |
- String message = t("observe.message.show.usage.for.missingReferentials.right");
|
|
| 386 |
- |
|
| 387 |
- ImmutableSetDtoMap<ReferentialDtoReference> usages = leftSource.getReferentialMap(rightMissingReferentialResult.getMissingIds());
|
|
| 388 |
- UsageForDisplayUI usagesUI = UsageForDisplayUI.build(message, usages);
|
|
| 389 |
- |
|
| 390 |
- int reponse = UIHelper.askUser(null,
|
|
| 391 |
- t("observe.title.can.not.export.data.right"),
|
|
| 392 |
- usagesUI,
|
|
| 393 |
- JOptionPane.WARNING_MESSAGE,
|
|
| 394 |
- new Object[]{
|
|
| 395 |
- t("observe.choice.confirm.insert"),
|
|
| 396 |
- t("observe.choice.cancel")},
|
|
| 397 |
- 0);
|
|
| 398 |
- |
|
| 399 |
- if (reponse != 0) {
|
|
| 400 |
- |
|
| 401 |
- return WizardState.CANCELED;
|
|
| 402 |
- }
|
|
| 403 |
- |
|
| 404 |
- log.info("Insertion dans la base de droite des référentiels manquants.");
|
|
| 405 |
- |
|
| 406 |
- for (Class<? extends ReferentialDtoReference> key : usages.referentialReferenceTypes()) {
|
|
| 407 |
- Set<? extends ReferentialDtoReference> references = usages.get(key);
|
|
| 408 |
- String type = t(ObserveI18nDecoratorHelper.getTypePluralI18nKey(key));
|
|
| 409 |
- sendMessage(t("observe.actions.exportData.message.add.missing.referentials.right", references.size(), type));
|
|
| 410 |
- Decorator decorator = decoratorService.getReferenceDecorator(key);
|
|
| 411 |
- for (DtoReference reference : references) {
|
|
| 412 |
- sendMessage(t("observe.actions.exportData.message.add.missing.referential", decorator.toString(reference)));
|
|
| 413 |
- }
|
|
| 414 |
- }
|
|
| 415 |
- progressModel.incrementsCurrentStep();
|
|
| 416 |
- rightReferentialService.insertMissingReferential(rightMissingReferentialResult.getSqlCode());
|
|
| 312 |
+ WizardState result = prepareCopy(progressModel, leftSource, leftSourceLabel, rightSource, rightSourceLabel, idsToCopyToRight);
|
|
| 313 |
+ if (WizardState.CANCELED.equals(result)) {
|
|
| 314 |
+ return result;
|
|
| 417 | 315 |
}
|
| 418 | 316 |
}
|
| 419 | 317 |
|
| ... | ... | @@ -427,105 +325,34 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 427 | 325 |
DataSynchronizeTaskSupport task = tasks.getElementAt(i);
|
| 428 | 326 |
|
| 429 | 327 |
ProgramReference program = task.getProgram();
|
| 430 |
- String programId = program.getId();
|
|
| 431 |
- String programStr = programDecorator.toString(program);
|
|
| 432 | 328 |
|
| 433 | 329 |
DataDtoReference trip = task.getTrip();
|
| 434 |
- String tripId = trip.getId();
|
|
| 435 |
- String tripStr = decoratorService.getDataReferenceDecorator(trip.getReferenceType()).toString(trip);
|
|
| 436 | 330 |
|
| 437 | 331 |
progressModel.incrementsCurrentStep();
|
| 438 | 332 |
|
| 439 | 333 |
if (task instanceof DeleteFromLeftDataSynchronizeTask) {
|
| 440 |
- |
|
| 441 |
- sendMessage(t("observe.actions.synchro.data.prepare.deleteFromLeftTask", programStr, tripStr));
|
|
| 442 |
- |
|
| 443 |
- DeleteTripRequest deleteTripRequest = new DeleteTripRequest(programId, tripId);
|
|
| 444 |
- DeleteTripResult deleteTripResult = leftTripManagementService.deleteTrip(deleteTripRequest);
|
|
| 445 |
- logDeleteResult(n("observe.actions.synchro.data.result.delete.left.trip"),
|
|
| 446 |
- deleteTripResult,
|
|
| 447 |
- programDecorator,
|
|
| 448 |
- program,
|
|
| 449 |
- trip);
|
|
| 450 |
- if (leftSource.isLocal()) {
|
|
| 451 |
- leftSource.setModified(true);
|
|
| 452 |
- }
|
|
| 334 |
+ executeDeleteTask(programDecorator, program, trip,
|
|
| 335 |
+ leftSource, leftSourceLabel, leftTripManagementService);
|
|
| 453 | 336 |
continue;
|
| 454 |
- |
|
| 455 | 337 |
}
|
| 456 | 338 |
|
| 457 | 339 |
if (task instanceof DeleteFromRightDataSynchronizeTask) {
|
| 458 |
- |
|
| 459 |
- sendMessage(t("observe.actions.synchro.data.prepare.deleteFromRightTask", programStr, tripStr));
|
|
| 460 |
- |
|
| 461 |
- DeleteTripRequest deleteTripRequest = new DeleteTripRequest(programId, tripId);
|
|
| 462 |
- DeleteTripResult deleteTripResult = rightTripManagementService.deleteTrip(deleteTripRequest);
|
|
| 463 |
- logDeleteResult(n("observe.actions.synchro.data.result.delete.right.trip"),
|
|
| 464 |
- deleteTripResult,
|
|
| 465 |
- programDecorator,
|
|
| 466 |
- program,
|
|
| 467 |
- trip);
|
|
| 468 |
- if (rightSource.isLocal()) {
|
|
| 469 |
- rightSource.setModified(true);
|
|
| 470 |
- }
|
|
| 340 |
+ executeDeleteTask(programDecorator, program, trip,
|
|
| 341 |
+ rightSource, rightSourceLabel, rightTripManagementService);
|
|
| 471 | 342 |
continue;
|
| 472 |
- |
|
| 473 | 343 |
}
|
| 474 | 344 |
|
| 475 | 345 |
if (task instanceof CopyToLeftDataSynchronizeTask) {
|
| 476 |
- |
|
| 477 |
- sendMessage(t("observe.actions.synchro.data.prepare.copyToLeftTask", programStr, tripStr));
|
|
| 478 |
- |
|
| 479 |
- ExportTripRequest exportTripRequest = new ExportTripRequest(!leftSource.isLocal(), programId, tripId);
|
|
| 480 |
- ExportTripResult exportTripResult = rightTripManagementService.exportTrip(exportTripRequest);
|
|
| 481 |
- logExportResult(n("observe.actions.synchro.data.result.export.right.trip"),
|
|
| 482 |
- exportTripResult,
|
|
| 483 |
- programDecorator,
|
|
| 484 |
- program,
|
|
| 485 |
- trip);
|
|
| 486 |
- |
|
| 487 |
- progressModel.incrementsCurrentStep();
|
|
| 488 |
- ImportTripRequest importTripRequest = new ImportTripRequest(exportTripResult);
|
|
| 489 |
- ImportTripResult importTripResult = leftTripManagementService.importTrip(importTripRequest);
|
|
| 490 |
- logImportResult(n("observe.actions.synchro.data.result.import.left.trip"),
|
|
| 491 |
- n("observe.actions.synchro.data.result.delete.left.trip"),
|
|
| 492 |
- importTripResult,
|
|
| 493 |
- programDecorator,
|
|
| 494 |
- program,
|
|
| 495 |
- trip);
|
|
| 496 |
- |
|
| 497 |
- if (leftSource.isLocal()) {
|
|
| 498 |
- leftSource.setModified(true);
|
|
| 499 |
- }
|
|
| 346 |
+ executeCopyTask(progressModel, programDecorator, program, trip,
|
|
| 347 |
+ rightSource, rightSourceLabel, rightTripManagementService,
|
|
| 348 |
+ leftSource, leftSourceLabel, leftTripManagementService);
|
|
| 500 | 349 |
continue;
|
| 501 |
- |
|
| 502 | 350 |
}
|
| 503 | 351 |
|
| 504 | 352 |
if (task instanceof CopyToRightDataSynchronizeTask) {
|
| 505 |
- |
|
| 506 |
- sendMessage(t("observe.actions.synchro.data.prepare.copyToRightTask", programStr, tripStr));
|
|
| 507 |
- |
|
| 508 |
- ExportTripRequest exportTripRequest = new ExportTripRequest(!rightSource.isLocal(), programId, tripId);
|
|
| 509 |
- ExportTripResult exportTripResult = leftTripManagementService.exportTrip(exportTripRequest);
|
|
| 510 |
- logExportResult(n("observe.actions.synchro.data.result.export.left.trip"),
|
|
| 511 |
- exportTripResult,
|
|
| 512 |
- programDecorator,
|
|
| 513 |
- program,
|
|
| 514 |
- trip);
|
|
| 515 |
- |
|
| 516 |
- progressModel.incrementsCurrentStep();
|
|
| 517 |
- ImportTripRequest importTripRequest = new ImportTripRequest(exportTripResult);
|
|
| 518 |
- ImportTripResult importTripResult = rightTripManagementService.importTrip(importTripRequest);
|
|
| 519 |
- logImportResult(n("observe.actions.synchro.data.result.import.right.trip"),
|
|
| 520 |
- n("observe.actions.synchro.data.result.delete.right.trip"),
|
|
| 521 |
- importTripResult,
|
|
| 522 |
- programDecorator,
|
|
| 523 |
- program,
|
|
| 524 |
- trip);
|
|
| 525 |
- if (rightSource.isLocal()) {
|
|
| 526 |
- rightSource.setModified(true);
|
|
| 527 |
- }
|
|
| 528 |
- |
|
| 353 |
+ executeCopyTask(progressModel, programDecorator, program, trip,
|
|
| 354 |
+ leftSource, leftSourceLabel, leftTripManagementService,
|
|
| 355 |
+ rightSource, rightSourceLabel, rightTripManagementService);
|
|
| 529 | 356 |
}
|
| 530 | 357 |
|
| 531 | 358 |
}
|
| ... | ... | @@ -534,4 +361,71 @@ public class DataSynchroUIHandler extends AdminTabUIHandler<DataSynchroUI> imple |
| 534 | 361 |
|
| 535 | 362 |
}
|
| 536 | 363 |
|
| 364 |
+ private void executeDeleteTask(ReferentialReferenceDecorator<ProgramReference> programDecorator,
|
|
| 365 |
+ ProgramReference program, DataDtoReference trip,
|
|
| 366 |
+ ObserveSwingDataSource targetSource, String targetSourceLabel, TripManagementService targetTripManagementService) {
|
|
| 367 |
+ |
|
| 368 |
+ String programId = program.getId();
|
|
| 369 |
+ String programStr = programDecorator.toString(program);
|
|
| 370 |
+ |
|
| 371 |
+ String tripId = trip.getId();
|
|
| 372 |
+ @SuppressWarnings("unchecked")
|
|
| 373 |
+ String tripStr = decoratorService.getDataReferenceDecorator(trip.getReferenceType()).toString(trip);
|
|
| 374 |
+ |
|
| 375 |
+ |
|
| 376 |
+ sendMessage(t("observe.actions.synchro.data.prepare.deleteTask", targetSourceLabel, programStr, tripStr));
|
|
| 377 |
+ |
|
| 378 |
+ DeleteTripRequest deleteTripRequest = new DeleteTripRequest(programId, tripId);
|
|
| 379 |
+ DeleteTripResult deleteTripResult = targetTripManagementService.deleteTrip(deleteTripRequest);
|
|
| 380 |
+ logDeleteResult(n("observe.actions.synchro.data.result.delete.trip"),
|
|
| 381 |
+ targetSourceLabel,
|
|
| 382 |
+ deleteTripResult,
|
|
| 383 |
+ programDecorator,
|
|
| 384 |
+ program,
|
|
| 385 |
+ trip);
|
|
| 386 |
+ if (targetSource.isLocal()) {
|
|
| 387 |
+ targetSource.setModified(true);
|
|
| 388 |
+ }
|
|
| 389 |
+ |
|
| 390 |
+ }
|
|
| 391 |
+ |
|
| 392 |
+ private void executeCopyTask(ProgressModel progressModel,
|
|
| 393 |
+ ReferentialReferenceDecorator<ProgramReference> programDecorator,
|
|
| 394 |
+ ProgramReference program, DataDtoReference trip,
|
|
| 395 |
+ ObserveSwingDataSource centralSource, String centralSourceLabel, TripManagementService centralTripManagementService,
|
|
| 396 |
+ ObserveSwingDataSource targetSource, String targetSourceLabel, TripManagementService targetTripManagementService) {
|
|
| 397 |
+ |
|
| 398 |
+ String programId = program.getId();
|
|
| 399 |
+ String programStr = programDecorator.toString(program);
|
|
| 400 |
+ String tripId = trip.getId();
|
|
| 401 |
+ @SuppressWarnings("unchecked")
|
|
| 402 |
+ String tripStr = decoratorService.getDataReferenceDecorator(trip.getReferenceType()).toString(trip);
|
|
| 403 |
+ |
|
| 404 |
+ sendMessage(t("observe.actions.synchro.data.prepare.copyToTask", targetSourceLabel, programStr, tripStr));
|
|
| 405 |
+ |
|
| 406 |
+ ExportTripRequest exportTripRequest = new ExportTripRequest(!targetSource.isLocal(), programId, tripId);
|
|
| 407 |
+ ExportTripResult exportTripResult = centralTripManagementService.exportTrip(exportTripRequest);
|
|
| 408 |
+ logExportResult(n("observe.actions.synchro.data.result.export.trip"),
|
|
| 409 |
+ centralSourceLabel,
|
|
| 410 |
+ exportTripResult,
|
|
| 411 |
+ programDecorator,
|
|
| 412 |
+ program,
|
|
| 413 |
+ trip);
|
|
| 414 |
+ |
|
| 415 |
+ progressModel.incrementsCurrentStep();
|
|
| 416 |
+ ImportTripRequest importTripRequest = new ImportTripRequest(exportTripResult);
|
|
| 417 |
+ ImportTripResult importTripResult = targetTripManagementService.importTrip(importTripRequest);
|
|
| 418 |
+ logImportResult(n("observe.actions.synchro.data.result.import.trip"),
|
|
| 419 |
+ n("observe.actions.synchro.data.result.delete.trip"),
|
|
| 420 |
+ targetSourceLabel,
|
|
| 421 |
+ importTripResult,
|
|
| 422 |
+ programDecorator,
|
|
| 423 |
+ program,
|
|
| 424 |
+ trip);
|
|
| 425 |
+ |
|
| 426 |
+ if (targetSource.isLocal()) {
|
|
| 427 |
+ targetSource.setModified(true);
|
|
| 428 |
+ }
|
|
| 429 |
+ }
|
|
| 430 |
+ |
|
| 537 | 431 |
}
|
| ... | ... | @@ -155,8 +155,7 @@ observe.actions.exportData.error.missingReferentialsId.left=Can't export data, t |
| 155 | 155 |
observe.actions.exportData.error.missingReferentialsId.right=Can't export data, there is some missing referentials in right source and you did not select insert option.
|
| 156 | 156 |
observe.actions.exportData.message.add.missing.referential=\t%s
|
| 157 | 157 |
observe.actions.exportData.message.add.missing.referentials=Insert %s missing referentials of type «%s»
|
| 158 |
-observe.actions.exportData.message.add.missing.referentials.left=Insert %s missing referentials of type «%s» in left source
|
|
| 159 |
-observe.actions.exportData.message.add.missing.referentials.right=Insert %s missing referentials of type «%s» in right source
|
|
| 158 |
+observe.actions.exportData.message.add.missing.referentials2=Database «%s» - Insert %s missing referentials of type «%s»
|
|
| 160 | 159 |
observe.actions.exportData.message.not.possible=Export is not possible (see above messages)
|
| 161 | 160 |
observe.actions.exportData.message.operation.needFix=Select data to export.
|
| 162 | 161 |
observe.actions.exportData.message.prepare.data=Prepare data to export...
|
| ... | ... | @@ -206,17 +205,12 @@ observe.actions.synchro.data.deleteFromLeft.tip=Delete selected trip(s) from lef |
| 206 | 205 |
observe.actions.synchro.data.deleteFromRight.tip=Delete selected trip(s) from right database
|
| 207 | 206 |
observe.actions.synchro.data.description=Advanced data management
|
| 208 | 207 |
observe.actions.synchro.data.launch.operation=Get data fro databases
|
| 209 |
-observe.actions.synchro.data.message.data.loaded=%s - Data loaded
|
|
| 210 |
-observe.actions.synchro.data.prepare.copyToLeftTask=Register operation copy to left database\: %s - %s
|
|
| 211 |
-observe.actions.synchro.data.prepare.copyToRightTask=Register operation copy to right database\: %s - %s
|
|
| 212 |
-observe.actions.synchro.data.prepare.deleteFromLeftTask=Register operation delete from left database\: %s - %s
|
|
| 213 |
-observe.actions.synchro.data.prepare.deleteFromRightTask=Register operation delete from right database\: %s - %s
|
|
| 214 |
-observe.actions.synchro.data.result.delete.left.trip=Trip %s - %s was removed from left database.
|
|
| 215 |
-observe.actions.synchro.data.result.delete.right.trip=Trip %s - %s was removed from right database.
|
|
| 216 |
-observe.actions.synchro.data.result.export.left.trip=Trip %s - %s was exported from left database.
|
|
| 217 |
-observe.actions.synchro.data.result.export.right.trip=Trip %s - %s was exported from right database.
|
|
| 218 |
-observe.actions.synchro.data.result.import.left.trip=Trip %s - %s was imported into left database.
|
|
| 219 |
-observe.actions.synchro.data.result.import.right.trip=Trip %s - %s was imported into right database.
|
|
| 208 |
+observe.actions.synchro.data.message.data.loaded=Database «%s» - Data loaded
|
|
| 209 |
+observe.actions.synchro.data.prepare.copyToTask=Database «%s» - Register operation copy to database\: %s - %s
|
|
| 210 |
+observe.actions.synchro.data.prepare.deleteTask=Database «%s» - Register operation delete from database\: %s - %s
|
|
| 211 |
+observe.actions.synchro.data.result.delete.trip=Database «%s» - Trip %s - %s was removed from database.
|
|
| 212 |
+observe.actions.synchro.data.result.export.trip=Database «%s» - Trip %s - %s was exported from database.
|
|
| 213 |
+observe.actions.synchro.data.result.import.trip=Database «%s» - Trip %s - %s was imported into database.
|
|
| 220 | 214 |
observe.actions.synchro.data.task.copyToLeft=Copy to left database\: <i>%s</i> - «<b>%s</b>»
|
| 221 | 215 |
observe.actions.synchro.data.task.copyToRight=Copy to right database\: <i>%s</i> - «<b>%s</b>»
|
| 222 | 216 |
observe.actions.synchro.data.task.deleteFromLeft=Delete from left database\: <i>%s</i> - «<b>%s</b>»
|
| ... | ... | @@ -1316,8 +1310,7 @@ observe.message.show.usage.for.desactivated=Referential %1$s "%2$s" will be disa |
| 1316 | 1310 |
observe.message.show.usage.for.desactivated2=Some data are using this referential, see following reference
|
| 1317 | 1311 |
observe.message.show.usage.for.desactivated3=Those data need to use another enabled referential to be saved.
|
| 1318 | 1312 |
observe.message.show.usage.for.missingReferentials=There is some referentials present in local source but not in centrale one.
|
| 1319 |
-observe.message.show.usage.for.missingReferentials.left=There is some referentials present in right source but not in left one.
|
|
| 1320 |
-observe.message.show.usage.for.missingReferentials.right=There is some referentials present in left source but not in right one.
|
|
| 1313 |
+observe.message.show.usage.for.missingReferentials2=There is some referentials present in «%s» source but not in the «%s» one.
|
|
| 1321 | 1314 |
observe.message.show.usages=List of usage of referential %1$s\: '%2$s'
|
| 1322 | 1315 |
observe.message.table.editBean.modified=Current entry is modifed and valid.
|
| 1323 | 1316 |
observe.message.table.editBean.modified.but.invalid=Current entry is modified but not valid.
|
| ... | ... | @@ -1473,8 +1466,7 @@ observe.storage.useServerStorage.description=Please configure connexion to remot |
| 1473 | 1466 |
observe.title.about=About
|
| 1474 | 1467 |
observe.title.can.not.delete.referentiel=Impossible to delete a referentiel data...
|
| 1475 | 1468 |
observe.title.can.not.export.data=Could not export data
|
| 1476 |
-observe.title.can.not.export.data.left=Could not export data to left source
|
|
| 1477 |
-observe.title.can.not.export.data.right=Could not export data to right source
|
|
| 1469 |
+observe.title.can.not.export.data2=Could not export data to «%s» source
|
|
| 1478 | 1470 |
observe.title.can.not.export.obstuna=Could not export obstuna data...
|
| 1479 | 1471 |
observe.title.choose.db.dump=Choose a database backup
|
| 1480 | 1472 |
observe.title.choose.db.dump.directory=Chhose directory of backup
|
| ... | ... | @@ -155,14 +155,13 @@ observe.actions.exportData.error.missingReferentialsId.left=Il existe des réfé |
| 155 | 155 |
observe.actions.exportData.error.missingReferentialsId.right=Il existe des référentiels dans la base de droite non présente en base centrale, mais vous n'avez pas activé l'option d'insertion automatique. \#TODO
|
| 156 | 156 |
observe.actions.exportData.message.add.missing.referential=\t%s
|
| 157 | 157 |
observe.actions.exportData.message.add.missing.referentials=Insertion de %s référentiels de type «%s» \#TODO
|
| 158 |
-observe.actions.exportData.message.add.missing.referentials.left=Insertion de %s référentiels de type «%s» dans la base de gauche\#TODO
|
|
| 159 |
-observe.actions.exportData.message.add.missing.referentials.right=Insertion de %s référentiels de type «%s» dans la base de droite\#TODO
|
|
| 158 |
+observe.actions.exportData.message.add.missing.referentials2=Base «%s» - Insertion de %s référentiels de type «%s»\#TODO
|
|
| 160 | 159 |
observe.actions.exportData.message.not.possible=La exportación no es posible (vea el mensaje anterior).
|
| 161 | 160 |
observe.actions.exportData.message.operation.needFix=Seleccione las mareas a exportar.
|
| 162 | 161 |
observe.actions.exportData.message.prepare.data=Preparación de los datos a exportar...
|
| 163 |
-observe.actions.exportData.message.result.delete.trip=La marea %s - %s fue eliminada de la base central
|
|
| 164 |
-observe.actions.exportData.message.result.export.trip=La marea %s - %s fue exportada de la base locale
|
|
| 165 |
-observe.actions.exportData.message.result.import.trip=La marea %s - %s fue importada en la base central
|
|
| 162 |
+observe.actions.exportData.message.result.delete.trip=Base «%s» - La marea %s - %s fue eliminada.
|
|
| 163 |
+observe.actions.exportData.message.result.export.trip=Base «%s» - La marea %s - %s fue exportada.
|
|
| 164 |
+observe.actions.exportData.message.result.import.trip=Base «%s» - La marea %s - %s fue importada.
|
|
| 166 | 165 |
observe.actions.exportData.table.exist.label=E
|
| 167 | 166 |
observe.actions.exportData.table.exist.label.tip=Marea ya está presente en la base de datos remota
|
| 168 | 167 |
observe.actions.exportData.table.program.label=Programa
|
| ... | ... | @@ -206,17 +205,12 @@ observe.actions.synchro.data.deleteFromLeft.tip=Eliminar la ou las mareas selecc |
| 206 | 205 |
observe.actions.synchro.data.deleteFromRight.tip=Eliminar la ou las mareas seleccionada(s) de la base de la derecha
|
| 207 | 206 |
observe.actions.synchro.data.description=Gestión avanzada de los datos de los usuarios
|
| 208 | 207 |
observe.actions.synchro.data.launch.operation=Recuperar los datos de las fuentes de datos
|
| 209 |
-observe.actions.synchro.data.message.data.loaded=%s - Datos recuperadas.
|
|
| 210 |
-observe.actions.synchro.data.prepare.copyToLeftTask=Preparación de la copia en la base de la izquierda \: %s - %s
|
|
| 211 |
-observe.actions.synchro.data.prepare.copyToRightTask=Preparación de la copia en la base de la derecha \: %s - %s
|
|
| 212 |
-observe.actions.synchro.data.prepare.deleteFromLeftTask=Preparación de la eliminación de la base de la izquierda \: %s - %s
|
|
| 213 |
-observe.actions.synchro.data.prepare.deleteFromRightTask=Preparación de la eliminación de la base de la derecha \: %s - %s
|
|
| 214 |
-observe.actions.synchro.data.result.delete.left.trip=Eliminación de la marea %s - %s en la base de la izquierda realizada.
|
|
| 215 |
-observe.actions.synchro.data.result.delete.right.trip=Eliminación de la marea %s - %s en la base de la derecha realizada.
|
|
| 216 |
-observe.actions.synchro.data.result.export.left.trip=Exportación de la marea %s - %s desde la base de la izquierda realizada.
|
|
| 217 |
-observe.actions.synchro.data.result.export.right.trip=Exportación de la marea %s - %s desde la base de la derecha realizada.
|
|
| 218 |
-observe.actions.synchro.data.result.import.left.trip=Inserción de la marea %s - %s en la base de la izquierda realizada.
|
|
| 219 |
-observe.actions.synchro.data.result.import.right.trip=Inserción de la marea %s - %s en la base de la derecha realizada.
|
|
| 208 |
+observe.actions.synchro.data.message.data.loaded=Base «%s» - Datos recuperadas.
|
|
| 209 |
+observe.actions.synchro.data.prepare.copyToTask=Base «%s» - Preparación de la copia \: %s - %s
|
|
| 210 |
+observe.actions.synchro.data.prepare.deleteTask=Base «%s» - Preparación de la eliminación de la base \: %s - %s
|
|
| 211 |
+observe.actions.synchro.data.result.delete.trip=Base «%s» - Eliminación de la marea %s - %s en la base.
|
|
| 212 |
+observe.actions.synchro.data.result.export.trip=Base «%s» - Exportación de la marea %s - %s desde la base.
|
|
| 213 |
+observe.actions.synchro.data.result.import.trip=Base «%s» - Inserción de la marea %s - %s en la base.
|
|
| 220 | 214 |
observe.actions.synchro.data.task.copyToLeft=Copiar en la base de la izquierda \: <i>%s</i> - «<b>%s</b>»
|
| 221 | 215 |
observe.actions.synchro.data.task.copyToRight=Copiar en la base de la derecha \: <i>%s</i> - «<b>%s</b>»
|
| 222 | 216 |
observe.actions.synchro.data.task.deleteFromLeft=Eliminar en la base de la izquierda \: <i>%s</i> - «<b>%s</b>»
|
| ... | ... | @@ -1316,8 +1310,7 @@ observe.message.show.usage.for.desactivated=El referencial %1$s "%2$s" se desact |
| 1316 | 1310 |
observe.message.show.usage.for.desactivated2=Los objetos están usando actualmente las referencias que se enumeran a continuación..
|
| 1317 | 1311 |
observe.message.show.usage.for.desactivated3=Estos objetos deben usar otro referencial (no desactivado) para poder actualizarse.
|
| 1318 | 1312 |
observe.message.show.usage.for.missingReferentials=Il existe des référentiels présents dans la base locale mais non présents dans la base centrale. \#TODO
|
| 1319 |
-observe.message.show.usage.for.missingReferentials.left=Il existe des référentiels présents dans la base de droite mais non présents dans la base de gauche.
|
|
| 1320 |
-observe.message.show.usage.for.missingReferentials.right=Il existe des référentiels présents dans la base de gauche mais non présents dans la base droite.
|
|
| 1313 |
+observe.message.show.usage.for.missingReferentials2=There is some referentials present in «%s» source but not in the «%s» one.
|
|
| 1321 | 1314 |
observe.message.show.usages=Listas de usos de referenciales %1$s \: '%2$s'
|
| 1322 | 1315 |
observe.message.table.editBean.modified=El registro actual se ha modificado y es válido.
|
| 1323 | 1316 |
observe.message.table.editBean.modified.but.invalid=El registro actual se ha modificado pero no es válido.
|
| ... | ... | @@ -1473,8 +1466,7 @@ observe.storage.useServerStorage.description=Configure su conexión al servidor |
| 1473 | 1466 |
observe.title.about=A proposito de ObServe...
|
| 1474 | 1467 |
observe.title.can.not.delete.referentiel=Impossible eliminar un referencial en proceso de utilización...
|
| 1475 | 1468 |
observe.title.can.not.export.data=Impossible d'exporter les données vers la base centrale... \#TODO
|
| 1476 |
-observe.title.can.not.export.data.left=Impossible d'exporter les données vers la base de gauche... \#TODO
|
|
| 1477 |
-observe.title.can.not.export.data.right=Impossible d'exporter les données vers la base de droite... \#TODO
|
|
| 1469 |
+observe.title.can.not.export.data2=Impossible d'exporter les données vers la base «%s»... \#TODO
|
|
| 1478 | 1470 |
observe.title.can.not.export.obstuna=Impossible exportar los datos de obstuna...
|
| 1479 | 1471 |
observe.title.choose.db.dump=Seleccionar una copia de seguridad de base local
|
| 1480 | 1472 |
observe.title.choose.db.dump.directory=Seleccionar e directorio de destinación de la copia de seguridad
|
| ... | ... | @@ -155,14 +155,13 @@ observe.actions.exportData.error.missingReferentialsId.left=Il existe des réfé |
| 155 | 155 |
observe.actions.exportData.error.missingReferentialsId.right=Il existe des référentiels dans la base de droite non présente en base centrale, mais vous n'avez pas activé l'option d'insertion automatique.
|
| 156 | 156 |
observe.actions.exportData.message.add.missing.referential=\t%s
|
| 157 | 157 |
observe.actions.exportData.message.add.missing.referentials=Insertion de %s référentiels de type «%s»
|
| 158 |
-observe.actions.exportData.message.add.missing.referentials.left=Insertion de %s référentiels de type «%s» dans la base de gauche
|
|
| 159 |
-observe.actions.exportData.message.add.missing.referentials.right=Insertion de %s référentiels de type «%s» dans la base de droite
|
|
| 158 |
+observe.actions.exportData.message.add.missing.referentials2=Source «%s» - Insertion de %s référentiels de type «%s»
|
|
| 160 | 159 |
observe.actions.exportData.message.not.possible=L'opération d'export n'est pas possible (voir les messages précédents).
|
| 161 | 160 |
observe.actions.exportData.message.operation.needFix=Veuillez sélectionner les marées à exporter.
|
| 162 | 161 |
observe.actions.exportData.message.prepare.data=Préparation des données à exporter...
|
| 163 |
-observe.actions.exportData.message.result.delete.trip=La marée %s - %s a été supprimée de la base centrale
|
|
| 164 |
-observe.actions.exportData.message.result.export.trip=La marée %s - %s a été exportée depuis la base locale
|
|
| 165 |
-observe.actions.exportData.message.result.import.trip=La marée %s - %s a été importée dans la base centrale
|
|
| 162 |
+observe.actions.exportData.message.result.delete.trip=Source «%s» - La marée %s - %s a été supprimée de la base centrale
|
|
| 163 |
+observe.actions.exportData.message.result.export.trip=Source «%s» - La marée %s - %s a été exportée depuis la base locale
|
|
| 164 |
+observe.actions.exportData.message.result.import.trip=Source «%s» - La marée %s - %s a été importée dans la base centrale
|
|
| 166 | 165 |
observe.actions.exportData.table.exist.label=E
|
| 167 | 166 |
observe.actions.exportData.table.exist.label.tip=Marée déjà présente sur la base distante
|
| 168 | 167 |
observe.actions.exportData.table.program.label=Programme
|
| ... | ... | @@ -206,17 +205,12 @@ observe.actions.synchro.data.deleteFromLeft.tip=Supprimer la ou les marées sél |
| 206 | 205 |
observe.actions.synchro.data.deleteFromRight.tip=Supprimer la ou les marées sélectionnée(s) de la base de droite
|
| 207 | 206 |
observe.actions.synchro.data.description=Gestion avancée des données utilisateurs
|
| 208 | 207 |
observe.actions.synchro.data.launch.operation=Récupérer les données des sources de données
|
| 209 |
-observe.actions.synchro.data.message.data.loaded=%s - Données récupérées.
|
|
| 210 |
-observe.actions.synchro.data.prepare.copyToLeftTask=Préparation de la recopie vers la base de gauche \: %s - %s
|
|
| 211 |
-observe.actions.synchro.data.prepare.copyToRightTask=Préparation de la recopie vers la base de droite \: %s - %s
|
|
| 212 |
-observe.actions.synchro.data.prepare.deleteFromLeftTask=Préparation de la suppression de la base de gauche \: %s - %s
|
|
| 213 |
-observe.actions.synchro.data.prepare.deleteFromRightTask=Préparation de la suppression de la base de droite \: %s - %s
|
|
| 214 |
-observe.actions.synchro.data.result.delete.left.trip=Suppression de la marée %s - %s dans la base de gauche effectuée.
|
|
| 215 |
-observe.actions.synchro.data.result.delete.right.trip=Suppression de la marée %s - %s dans la base de droite effectuée.
|
|
| 216 |
-observe.actions.synchro.data.result.export.left.trip=Export de la marée %s - %s depuis la base de gauche effectuée.
|
|
| 217 |
-observe.actions.synchro.data.result.export.right.trip=Export de la marée %s - %s depuis la base de droite effectuée.
|
|
| 218 |
-observe.actions.synchro.data.result.import.left.trip=Insertion de la marée %s - %s dans la base de gauche effectuée.
|
|
| 219 |
-observe.actions.synchro.data.result.import.right.trip=Insertion de la marée %s - %s dans la base de droite effectuée.
|
|
| 208 |
+observe.actions.synchro.data.message.data.loaded=Source «%s» - Données récupérées.
|
|
| 209 |
+observe.actions.synchro.data.prepare.copyToTask=Source «%s» - Préparation de la recopie \: %s - %s
|
|
| 210 |
+observe.actions.synchro.data.prepare.deleteTask=Source «%s» - Préparation de la suppression \: %s - %s
|
|
| 211 |
+observe.actions.synchro.data.result.delete.trip=Source «%s» - Suppression de la marée %s - %s effectuée.
|
|
| 212 |
+observe.actions.synchro.data.result.export.trip=Source «%s» - Export de la marée %s - %s effectuée.
|
|
| 213 |
+observe.actions.synchro.data.result.import.trip=Source «%s» - Insertion de la marée %s - %s effectuée.
|
|
| 220 | 214 |
observe.actions.synchro.data.task.copyToLeft=Copier vers la base de gauche \: <i>%s</i> - «<b>%s</b>»
|
| 221 | 215 |
observe.actions.synchro.data.task.copyToRight=Copier vers la base de droite \: <i>%s</i> - «<b>%s</b>»
|
| 222 | 216 |
observe.actions.synchro.data.task.deleteFromLeft=Supprimer de la base de gauche \: <i>%s</i> - «<b>%s</b>»
|
| ... | ... | @@ -1316,8 +1310,7 @@ observe.message.show.usage.for.desactivated=Le référentiel %1$s "%2$s" va êtr |
| 1316 | 1310 |
observe.message.show.usage.for.desactivated2=Des objets utilisent actuellement cet entité dont les références sont citées plus bas.
|
| 1317 | 1311 |
observe.message.show.usage.for.desactivated3=Ces objets devront utiliser un autre référentiel (non désactivé) pour pouvoir être mis à jour.
|
| 1318 | 1312 |
observe.message.show.usage.for.missingReferentials=Il existe des référentiels présents dans la base locale mais non présents dans la base centrale.
|
| 1319 |
-observe.message.show.usage.for.missingReferentials.left=Il existe des référentiels présents dans la base de droite mais non présents dans la base de gauche.
|
|
| 1320 |
-observe.message.show.usage.for.missingReferentials.right=Il existe des référentiels présents dans la base de gauche mais non présents dans la base droite.
|
|
| 1313 |
+observe.message.show.usage.for.missingReferentials2=Il existe des référentiels présents dans la base «%s» mais non présents dans la base «%s».
|
|
| 1321 | 1314 |
observe.message.show.usages=Listes des utilisations du référentiel %1$s \: '%2$s'
|
| 1322 | 1315 |
observe.message.table.editBean.modified=L'entrée en cours d'édition a été modifiée et est valide.
|
| 1323 | 1316 |
observe.message.table.editBean.modified.but.invalid=L'entrée en cours d'édition a été modifiée, mais n'est pas valide.
|
| ... | ... | @@ -1473,8 +1466,7 @@ observe.storage.useServerStorage.description=Veuillez configurer votre connexion |
| 1473 | 1466 |
observe.title.about=A propos d'ObServe...
|
| 1474 | 1467 |
observe.title.can.not.delete.referentiel=Impossible de supprimer un référentiel en cours d'utilisation...
|
| 1475 | 1468 |
observe.title.can.not.export.data=Impossible d'exporter les données vers la base centrale...
|
| 1476 |
-observe.title.can.not.export.data.left=Impossible d'exporter les données vers la base de gauche...
|
|
| 1477 |
-observe.title.can.not.export.data.right=Impossible d'exporter les données vers la base de droite...
|
|
| 1469 |
+observe.title.can.not.export.data2=Impossible d'exporter les données vers la base «%s»...
|
|
| 1478 | 1470 |
observe.title.can.not.export.obstuna=Impossible d'exporter des données d'obstuna...
|
| 1479 | 1471 |
observe.title.choose.db.dump=Choisir une sauvegarder de base locale
|
| 1480 | 1472 |
observe.title.choose.db.dump.directory=Choisir le répertoire de destination de la sauvegarde
|
| ... | ... | @@ -57,6 +57,7 @@ import fr.ird.observe.dto.data.longline.SizeMeasureDto; |
| 57 | 57 |
import fr.ird.observe.dto.data.longline.SizeMeasureReference;
|
| 58 | 58 |
import fr.ird.observe.dto.data.longline.TdrDto;
|
| 59 | 59 |
import fr.ird.observe.dto.data.longline.TdrReference;
|
| 60 |
+import fr.ird.observe.dto.data.longline.TripLonglineActivityDto;
|
|
| 60 | 61 |
import fr.ird.observe.dto.data.longline.TripLonglineReference;
|
| 61 | 62 |
import fr.ird.observe.dto.data.longline.WeightMeasureDto;
|
| 62 | 63 |
import fr.ird.observe.dto.data.longline.WeightMeasureReference;
|
| ... | ... | @@ -361,6 +362,8 @@ public class DecoratorService extends DecoratorProvider { |
| 361 | 362 |
"${timeStamp}$td/%1$tm/%1$tY %1$tH:%1$tM##${vesselActivityLongline/label}$s",
|
| 362 | 363 |
"${timeStamp}$td/%1$tm/%1$tY %1$tH:%1$tM##${vesselActivityLonglineLabel}$s",
|
| 363 | 364 |
" - ");
|
| 365 |
+ |
|
| 366 |
+ registerObserveDecorator(TripLonglineActivityDto.class, "${timeStamp}$td/%1$tm/%1$tY %1$tH:%1$t", " - ");
|
|
| 364 | 367 |
}
|
| 365 | 368 |
|
| 366 | 369 |
@Override
|