Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
642401fc
by Tony CHEMIT at 2018-09-23T21:14:58Z
-
f3379ac9
by Tony CHEMIT at 2018-09-23T21:15:11Z
-
649d3f81
by Tony CHEMIT at 2018-09-23T21:35:02Z
-
f3bbfcf7
by Tony CHEMIT at 2018-09-23T21:35:23Z
-
e6863e0f
by Tony CHEMIT at 2018-09-23T21:39:27Z
25 changed files:
- client/src/main/java/fr/ird/observe/client/ui/admin/config/SelectDataModel.java
- client/src/main/java/fr/ird/observe/client/ui/admin/report/ReportUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/admin/validate/ValidateConfigUI.jcss
- client/src/main/java/fr/ird/observe/client/ui/admin/validate/ValidateUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/dcprefs/FloatingObjectPresetsUIHandler.java
- client/src/main/java/fr/ird/observe/client/ui/storage/presets/RemotePresetsUIHandler.java
- services-client/src/test/java/fr/ird/observe/services/client/service/actions/report/AbstractReportServiceClientTest.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/report/ReportServiceLocal.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/synchro/referential/sql/DisableSqlStatementGenerator.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/validate/ValidateServiceLocal.java
- services-local/src/main/java/fr/ird/observe/services/local/service/actions/validate/ValidationMessageDetector.java
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/report/AbstractReportServiceLocalTest.java
- services-local/src/test/java/fr/ird/observe/services/local/service/actions/report/ReportNonTargetDistributionLengthsTest.java
- services/pom.xml
- services/src/main/java/fr/ird/observe/services/gson/ObserveDtoGsonSupplier.java
- services/src/main/java/fr/ird/observe/services/gson/ReportVariableAdapter.java
- + services/src/main/java/fr/ird/observe/services/gson/ValidationResultDtoAdapter.java
- services/src/main/java/fr/ird/observe/services/service/actions/report/ReportBuilder.java
- services/src/main/java/fr/ird/observe/services/service/actions/report/ReportRequest.java
- + services/src/main/java/fr/ird/observe/services/service/actions/validate/DataValidationResult.java
- + services/src/main/java/fr/ird/observe/services/service/actions/validate/ReferentialValidationResult.java
- services/src/main/java/fr/ird/observe/services/service/actions/validate/ValidateService.java
- services/src/main/java/fr/ird/observe/services/service/actions/validate/ValidationResult.java
- services/src/main/java/fr/ird/observe/services/service/actions/validate/ValidationResultDto.java
- services/src/main/resources/observe-reports.properties
Changes:
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.admin.config; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -30,14 +30,14 @@ import fr.ird.observe.client.ui.admin.AdminUIModel; |
| 30 | 30 |
import fr.ird.observe.client.ui.admin.report.ReportModel;
|
| 31 | 31 |
import fr.ird.observe.client.ui.tree.selection.SelectionTreeModel;
|
| 32 | 32 |
import fr.ird.observe.dto.IdDto;
|
| 33 |
+import fr.ird.observe.dto.IdHelper;
|
|
| 33 | 34 |
import fr.ird.observe.dto.ObserveModelType;
|
| 34 | 35 |
import fr.ird.observe.dto.data.longline.TripLonglineReference;
|
| 35 | 36 |
import fr.ird.observe.dto.data.seine.TripSeineReference;
|
| 36 | 37 |
import fr.ird.observe.dto.reference.DataDtoReference;
|
| 37 | 38 |
import fr.ird.observe.dto.reference.DataDtoReferenceSet;
|
| 38 |
-import fr.ird.observe.spi.DtoModelClasses;
|
|
| 39 |
-import org.apache.logging.log4j.Logger;
|
|
| 40 | 39 |
import org.apache.logging.log4j.LogManager;
|
| 40 |
+import org.apache.logging.log4j.Logger;
|
|
| 41 | 41 |
|
| 42 | 42 |
import java.util.ArrayList;
|
| 43 | 43 |
import java.util.List;
|
| ... | ... | @@ -102,10 +102,8 @@ public class SelectDataModel extends AdminActionModel { |
| 102 | 102 |
// on doit aussi calculer les ids des marées distantes
|
| 103 | 103 |
ObserveSwingDataSource safeCentralSource = uiModel.getConfigModel().getSafeCentralSource(true);
|
| 104 | 104 |
|
| 105 |
- List<DataDtoReference<?, ?>> existingTrip = new ArrayList<>();
|
|
| 106 |
- |
|
| 107 | 105 |
DataDtoReferenceSet<TripSeineReference> tripSeineSet = safeCentralSource.getTripSeineService().getAllTripSeine();
|
| 108 |
- existingTrip.addAll(tripSeineSet.toSet());
|
|
| 106 |
+ List<DataDtoReference<?, ?>> existingTrip = new ArrayList<>(tripSeineSet.toSet());
|
|
| 109 | 107 |
|
| 110 | 108 |
DataDtoReferenceSet<TripLonglineReference> tripLonglineSet = safeCentralSource.getTripLonglineService().getAllTripLongline();
|
| 111 | 109 |
existingTrip.addAll(tripLonglineSet.toSet());
|
| ... | ... | @@ -131,7 +129,7 @@ public class SelectDataModel extends AdminActionModel { |
| 131 | 129 |
return null;
|
| 132 | 130 |
}
|
| 133 | 131 |
DataDtoReference dto = data.iterator().next();
|
| 134 |
- if (DtoModelClasses.isTrip(dto)) {
|
|
| 132 |
+ if (IdHelper.isTrip(dto)) {
|
|
| 135 | 133 |
return dto;
|
| 136 | 134 |
}
|
| 137 | 135 |
|
| ... | ... | @@ -143,7 +141,7 @@ public class SelectDataModel extends AdminActionModel { |
| 143 | 141 |
ImmutableSet.Builder<DataDtoReference> result = ImmutableSet.builder();
|
| 144 | 142 |
Set<DataDtoReference<?, ?>> data = getSelectionDataModel().getSelectedData();
|
| 145 | 143 |
for (DataDtoReference<?, ?> datum : data) {
|
| 146 |
- if (DtoModelClasses.isTrip(datum)) {
|
|
| 144 |
+ if (IdHelper.isTrip(datum)) {
|
|
| 147 | 145 |
result.add(datum);
|
| 148 | 146 |
}
|
| 149 | 147 |
}
|
| ... | ... | @@ -208,6 +206,7 @@ public class SelectDataModel extends AdminActionModel { |
| 208 | 206 |
public boolean validate(AdminUIModel uiModel) {
|
| 209 | 207 |
|
| 210 | 208 |
boolean validate = true;
|
| 209 |
+ boolean empty = selectionDataModel.isSelectionEmpty();
|
|
| 211 | 210 |
|
| 212 | 211 |
if (uiModel.containsOperation(AdminStep.VALIDATE)) {
|
| 213 | 212 |
|
| ... | ... | @@ -216,7 +215,6 @@ public class SelectDataModel extends AdminActionModel { |
| 216 | 215 |
if (validate) {
|
| 217 | 216 |
|
| 218 | 217 |
// il faut au moins une donnee de selectionnee
|
| 219 |
- boolean empty = selectionDataModel.isSelectionEmpty();
|
|
| 220 | 218 |
validate = !empty;
|
| 221 | 219 |
}
|
| 222 | 220 |
}
|
| ... | ... | @@ -227,7 +225,6 @@ public class SelectDataModel extends AdminActionModel { |
| 227 | 225 |
if (validate) {
|
| 228 | 226 |
|
| 229 | 227 |
// il faut au moins une donnee de selectionnee
|
| 230 |
- boolean empty = selectionDataModel.isSelectionEmpty();
|
|
| 231 | 228 |
validate = !empty;
|
| 232 | 229 |
}
|
| 233 | 230 |
}
|
| ... | ... | @@ -238,7 +235,6 @@ public class SelectDataModel extends AdminActionModel { |
| 238 | 235 |
if (validate) {
|
| 239 | 236 |
|
| 240 | 237 |
// il faut au moins une donnee de selectionnee
|
| 241 |
- boolean empty = selectionDataModel.isSelectionEmpty();
|
|
| 242 | 238 |
validate = !empty;
|
| 243 | 239 |
}
|
| 244 | 240 |
}
|
| ... | ... | @@ -248,9 +244,8 @@ public class SelectDataModel extends AdminActionModel { |
| 248 | 244 |
validate &= uiModel.validate(AdminStep.CONFIG);
|
| 249 | 245 |
if (validate) {
|
| 250 | 246 |
|
| 251 |
- // il faut exactement une Trip de selectionnee
|
|
| 252 |
- int selectedCount = selectionDataModel.getSelectedCount();
|
|
| 253 |
- validate = selectedCount > 0;
|
|
| 247 |
+ // il faut au moins une donnee de selectionnee
|
|
| 248 |
+ validate = !empty;
|
|
| 254 | 249 |
}
|
| 255 | 250 |
}
|
| 256 | 251 |
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU General Public License as
|
| 9 | 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 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 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>.
|
| ... | ... | @@ -30,8 +30,6 @@ import fr.ird.observe.client.ui.admin.config.ConfigUI; |
| 30 | 30 |
import fr.ird.observe.client.ui.util.UIHelper;
|
| 31 | 31 |
import fr.ird.observe.dto.ObserveModelType;
|
| 32 | 32 |
import fr.ird.observe.dto.data.DataDto;
|
| 33 |
-import fr.ird.observe.dto.decoration.ObserveI18nDecoratorHelper;
|
|
| 34 |
-import fr.ird.observe.dto.decoration.ObserveI18nLabelsBuilder;
|
|
| 35 | 33 |
import fr.ird.observe.dto.reference.DataDtoReference;
|
| 36 | 34 |
import fr.ird.observe.dto.referential.ReferentialDto;
|
| 37 | 35 |
import fr.ird.observe.services.service.actions.report.DataMatrix;
|
| ... | ... | @@ -39,8 +37,8 @@ import fr.ird.observe.services.service.actions.report.Report; |
| 39 | 37 |
import fr.ird.observe.services.service.actions.report.ReportService;
|
| 40 | 38 |
import fr.ird.observe.services.service.actions.report.ReportVariable;
|
| 41 | 39 |
import fr.ird.observe.spi.DtoModelHelper;
|
| 42 |
-import org.apache.logging.log4j.Logger;
|
|
| 43 | 40 |
import org.apache.logging.log4j.LogManager;
|
| 41 |
+import org.apache.logging.log4j.Logger;
|
|
| 44 | 42 |
import org.nuiton.decorator.Decorator;
|
| 45 | 43 |
import org.nuiton.decorator.JXPathDecorator;
|
| 46 | 44 |
import org.nuiton.jaxx.runtime.context.JAXXInitialContext;
|
| ... | ... | @@ -331,27 +329,16 @@ public class ReportUIHandler extends AdminTabUIHandler<ReportUI> implements UIHa |
| 331 | 329 |
|
| 332 | 330 |
combo.setShowReset(true);
|
| 333 | 331 |
variablesPanel.add(combo);
|
| 334 |
- log.info("init variable: " + variable);
|
|
| 335 |
- Class variableType = variable.getType();
|
|
| 336 | 332 |
Decorator decorator;
|
| 337 |
- Class referenceType;
|
|
| 338 |
- if (ReferentialDto.class.isAssignableFrom(variableType) && !universe.isEmpty()) {
|
|
| 339 |
- referenceType = DtoModelHelper.fromReferentialDto(variableType).toReferenceType();
|
|
| 340 |
- decorator = getDecoratorService().getReferentialReferenceDecorator(referenceType);
|
|
| 341 |
- } else if (DataDto.class.isAssignableFrom(variableType) && !universe.isEmpty()) {
|
|
| 342 |
- referenceType = DtoModelHelper.fromDataDto(variableType).toReferenceType();
|
|
| 343 |
- decorator = getDecoratorService().getDataReferenceDecorator(referenceType);
|
|
| 333 |
+ if (ReferentialDto.class.isAssignableFrom(variable.getType()) && !universe.isEmpty()) {
|
|
| 334 |
+ Class type = DtoModelHelper.fromReferentialDto(variable.getType()).toReferenceType();
|
|
| 335 |
+ decorator = getDecoratorService().getReferentialReferenceDecorator(type);
|
|
| 336 |
+ } else if (DataDto.class.isAssignableFrom(variable.getType()) && !universe.isEmpty()) {
|
|
| 337 |
+ Class type = DtoModelHelper.fromDataDto(variable.getType()).toReferenceType();
|
|
| 338 |
+ decorator = getDecoratorService().getDataReferenceDecorator(type);
|
|
| 344 | 339 |
} else {
|
| 345 |
- referenceType = variableType;
|
|
| 346 |
- decorator = getDecoratorService().getDecoratorByType(variableType);
|
|
| 340 |
+ decorator = getDecoratorService().getDecoratorByType(variable.getType());
|
|
| 347 | 341 |
}
|
| 348 |
- log.info("decorator: " + decorator);
|
|
| 349 |
- combo.setI18nPrefix("observe.common.");
|
|
| 350 |
- combo.setBeanType(referenceType);
|
|
| 351 |
- combo.setI18nLabelBuilder(ObserveI18nLabelsBuilder.createFromReferenceType(referenceType));
|
|
| 352 |
- String entityLabel = t(ObserveI18nDecoratorHelper.getTypeI18nKey(variableType));
|
|
| 353 |
- combo.setPopupTitleText(t("observe.common.ReferentialDto.type", entityLabel));
|
|
| 354 |
- |
|
| 355 | 342 |
combo.init((JXPathDecorator<Object>) decorator, universe);
|
| 356 | 343 |
JComboBox jComboBox = combo.getCombobox();
|
| 357 | 344 |
jComboBox.putClientProperty(VARIABLE_NAME, variableName);
|
| ... | ... | @@ -68,19 +68,19 @@ |
| 68 | 68 |
|
| 69 | 69 |
#ERROR {
|
| 70 | 70 |
_value:{NuitonValidatorScope.ERROR};
|
| 71 |
- text:{NuitonValidatorScope.ERROR.getLabel()};
|
|
| 71 |
+ text:{t(NuitonValidatorScope.ERROR.getLabel())};
|
|
| 72 | 72 |
selected:{getHandler().isScopeSelected(validateModel.getScopes(), ERROR)};
|
| 73 | 73 |
}
|
| 74 | 74 |
|
| 75 | 75 |
#WARNING {
|
| 76 | 76 |
_value:{NuitonValidatorScope.WARNING};
|
| 77 |
- text:{NuitonValidatorScope.WARNING.getLabel()};
|
|
| 77 |
+ text:{t(NuitonValidatorScope.WARNING.getLabel())};
|
|
| 78 | 78 |
selected:{getHandler().isScopeSelected(validateModel.getScopes(), WARNING)};
|
| 79 | 79 |
}
|
| 80 | 80 |
|
| 81 | 81 |
#INFO {
|
| 82 | 82 |
_value:{NuitonValidatorScope.INFO};
|
| 83 |
- text:{NuitonValidatorScope.INFO.getLabel()};
|
|
| 83 |
+ text:{t(NuitonValidatorScope.INFO.getLabel())};
|
|
| 84 | 84 |
selected:{getHandler().isScopeSelected(validateModel.getScopes(), INFO)};
|
| 85 | 85 |
}
|
| 86 | 86 |
|
| ... | ... | @@ -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%
|
| ... | ... | @@ -43,6 +43,7 @@ import fr.ird.observe.dto.reference.DataDtoReference; |
| 43 | 43 |
import fr.ird.observe.dto.reference.DtoReference;
|
| 44 | 44 |
import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 45 | 45 |
import fr.ird.observe.services.service.actions.validate.DataValidationRequest;
|
| 46 |
+import fr.ird.observe.services.service.actions.validate.DataValidationResult;
|
|
| 46 | 47 |
import fr.ird.observe.services.service.actions.validate.ReferentialValidationRequest;
|
| 47 | 48 |
import fr.ird.observe.services.service.actions.validate.ValidateService;
|
| 48 | 49 |
import fr.ird.observe.services.service.actions.validate.ValidationResult;
|
| ... | ... | @@ -50,8 +51,8 @@ import fr.ird.observe.services.service.actions.validate.ValidationResultDto; |
| 50 | 51 |
import fr.ird.observe.services.service.actions.validate.ValidationResultDtoMessage;
|
| 51 | 52 |
import fr.ird.observe.services.validation.ValidatorDto;
|
| 52 | 53 |
import org.apache.commons.io.FileUtils;
|
| 53 |
-import org.apache.logging.log4j.Logger;
|
|
| 54 | 54 |
import org.apache.logging.log4j.LogManager;
|
| 55 |
+import org.apache.logging.log4j.Logger;
|
|
| 55 | 56 |
import org.nuiton.jaxx.runtime.context.JAXXInitialContext;
|
| 56 | 57 |
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 57 | 58 |
import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| ... | ... | @@ -410,7 +411,7 @@ public class ValidateUIHandler extends AdminTabUIHandler<ValidateUI> implements |
| 410 | 411 |
mainRequest.setValidationLengthWeightEnable(config.getValidationLengthWeightEnable());
|
| 411 | 412 |
mainRequest.setSeineBycatchObservedSystemConfig(config.getSeineBycatchObservedSystem());
|
| 412 | 413 |
|
| 413 |
- ValidationResult.Builder<DataValidationRequest> resultBuilder = ValidationResult.builder(ReferentialLocale.valueOf(config.getDbLocale()), mainRequest);
|
|
| 414 |
+ ValidationResult.Builder<DataValidationRequest, DataValidationResult> resultBuilder = DataValidationResult.builder(ReferentialLocale.valueOf(config.getDbLocale()), mainRequest);
|
|
| 414 | 415 |
|
| 415 | 416 |
for (DataDtoReference<?, ?> dataReference : dataModel.getSelectedData()) {
|
| 416 | 417 |
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.client.ui.dcprefs; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -33,8 +33,12 @@ import org.nuiton.jaxx.runtime.swing.renderer.DecoratorListCellRenderer; |
| 33 | 33 |
|
| 34 | 34 |
import javax.swing.AbstractButton;
|
| 35 | 35 |
import javax.swing.DefaultListModel;
|
| 36 |
+import javax.swing.JComponent;
|
|
| 37 |
+import javax.swing.JSplitPane;
|
|
| 38 |
+import javax.swing.KeyStroke;
|
|
| 36 | 39 |
import javax.swing.SwingUtilities;
|
| 37 | 40 |
import java.awt.BorderLayout;
|
| 41 |
+import java.awt.event.KeyEvent;
|
|
| 38 | 42 |
import java.util.LinkedList;
|
| 39 | 43 |
import java.util.List;
|
| 40 | 44 |
import java.util.Objects;
|
| ... | ... | @@ -69,6 +73,8 @@ public class FloatingObjectPresetsUIHandler implements UIHandler<FloatingObjectP |
| 69 | 73 |
|
| 70 | 74 |
if (o instanceof AbstractButton) {
|
| 71 | 75 |
init(actionMap, (AbstractButton) o);
|
| 76 |
+ } else if (o instanceof JSplitPane) {
|
|
| 77 |
+ init((JSplitPane) o);
|
|
| 72 | 78 |
}
|
| 73 | 79 |
|
| 74 | 80 |
}
|
| ... | ... | @@ -119,6 +125,12 @@ public class FloatingObjectPresetsUIHandler implements UIHandler<FloatingObjectP |
| 119 | 125 |
UIHelper.askFocus(ui.getQuitAction());
|
| 120 | 126 |
}
|
| 121 | 127 |
|
| 128 |
+ |
|
| 129 |
+ protected void init(JSplitPane editor) {
|
|
| 130 |
+ editor.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
|
|
| 131 |
+ .put(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), "none");
|
|
| 132 |
+ }
|
|
| 133 |
+ |
|
| 122 | 134 |
protected void init(ObserveActionMap actionMap, AbstractButton editor) {
|
| 123 | 135 |
String actionId = (String) editor.getClientProperty(OBSERVE_ACTION);
|
| 124 | 136 |
if (actionId == null) {
|
| ... | ... | @@ -29,8 +29,8 @@ import fr.ird.observe.client.ui.util.UIHelper; |
| 29 | 29 |
import fr.ird.observe.dto.decoration.DecoratorService;
|
| 30 | 30 |
import fr.ird.observe.dto.presets.RemoteDataSourceConfiguration;
|
| 31 | 31 |
import fr.ird.observe.dto.presets.ServerDataSourceConfiguration;
|
| 32 |
-import org.apache.logging.log4j.Logger;
|
|
| 33 | 32 |
import org.apache.logging.log4j.LogManager;
|
| 33 |
+import org.apache.logging.log4j.Logger;
|
|
| 34 | 34 |
import org.nuiton.decorator.Decorator;
|
| 35 | 35 |
import org.nuiton.jaxx.runtime.spi.UIHandler;
|
| 36 | 36 |
import org.nuiton.jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
|
| ... | ... | @@ -40,8 +40,11 @@ import javax.swing.ActionMap; |
| 40 | 40 |
import javax.swing.DefaultListModel;
|
| 41 | 41 |
import javax.swing.InputMap;
|
| 42 | 42 |
import javax.swing.JComponent;
|
| 43 |
+import javax.swing.JSplitPane;
|
|
| 44 |
+import javax.swing.KeyStroke;
|
|
| 43 | 45 |
import javax.swing.SwingUtilities;
|
| 44 | 46 |
import java.awt.BorderLayout;
|
| 47 |
+import java.awt.event.KeyEvent;
|
|
| 45 | 48 |
import java.util.List;
|
| 46 | 49 |
import java.util.Objects;
|
| 47 | 50 |
|
| ... | ... | @@ -79,6 +82,8 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { |
| 79 | 82 |
|
| 80 | 83 |
if (o instanceof AbstractButton) {
|
| 81 | 84 |
init(inputMap, actionMap, (AbstractButton) o);
|
| 85 |
+ } else if (o instanceof JSplitPane) {
|
|
| 86 |
+ init((JSplitPane) o);
|
|
| 82 | 87 |
}
|
| 83 | 88 |
|
| 84 | 89 |
}
|
| ... | ... | @@ -190,6 +195,11 @@ public class RemotePresetsUIHandler implements UIHandler<RemotePresetsUI> { |
| 190 | 195 |
|
| 191 | 196 |
}
|
| 192 | 197 |
|
| 198 |
+ protected void init(JSplitPane editor) {
|
|
| 199 |
+ editor.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
|
|
| 200 |
+ .put(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), "none");
|
|
| 201 |
+ }
|
|
| 202 |
+ |
|
| 193 | 203 |
protected void init(InputMap inputMap, ActionMap actionMap, AbstractButton editor) {
|
| 194 | 204 |
String actionId = (String) editor.getClientProperty(OBSERVE_ACTION);
|
| 195 | 205 |
if (actionId == null) {
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU General Public License as
|
| 9 | 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 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 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>.
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.services.local.service.actions.report; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -43,6 +43,10 @@ import fr.ird.observe.services.service.actions.report.ReportVariable; |
| 43 | 43 |
import fr.ird.observe.spi.DbModelHelper;
|
| 44 | 44 |
import fr.ird.observe.spi.context.DataDtoEntityContext;
|
| 45 | 45 |
import fr.ird.observe.spi.context.ReferentialDtoEntityContext;
|
| 46 |
+import org.apache.commons.lang3.mutable.MutableInt;
|
|
| 47 |
+import org.apache.logging.log4j.LogManager;
|
|
| 48 |
+import org.apache.logging.log4j.Logger;
|
|
| 49 |
+ |
|
| 46 | 50 |
import java.awt.Dimension;
|
| 47 | 51 |
import java.awt.Point;
|
| 48 | 52 |
import java.io.Serializable;
|
| ... | ... | @@ -54,9 +58,6 @@ import java.util.List; |
| 54 | 58 |
import java.util.Map;
|
| 55 | 59 |
import java.util.Set;
|
| 56 | 60 |
import java.util.TreeMap;
|
| 57 |
-import org.apache.commons.lang3.mutable.MutableInt;
|
|
| 58 |
-import org.apache.logging.log4j.Logger;
|
|
| 59 |
-import org.apache.logging.log4j.LogManager;
|
|
| 60 | 61 |
|
| 61 | 62 |
/**
|
| 62 | 63 |
* @author Tony Chemit - dev@tchemit.fr
|
| ... | ... | @@ -651,6 +652,7 @@ public class ReportServiceLocal extends ObserveServiceLocal implements ReportSer |
| 651 | 652 |
|
| 652 | 653 |
AbstractObserveTopiaDao dao = (AbstractObserveTopiaDao) getTopiaPersistenceContext().getDao(TripSeine.class);
|
| 653 | 654 |
|
| 655 |
+ log.info(String.format("Request: %s, params: %s", request, paramsFixes));
|
|
| 654 | 656 |
return dao.findAllFromHql(request, paramsFixes);
|
| 655 | 657 |
}
|
| 656 | 658 |
|
| ... | ... | @@ -43,7 +43,7 @@ public class DisableSqlStatementGenerator { |
| 43 | 43 |
}
|
| 44 | 44 |
|
| 45 | 45 |
public String generateSql(String sourceId) {
|
| 46 |
- return TopiaSqlStatements.generateUpdateStatement(metadataEntity, sourceId, "enabled = false, topiaVersion = topiaVersion + 1");
|
|
| 46 |
+ return TopiaSqlStatements.generateUpdateStatement(metadataEntity, sourceId, "status = 0, topiaVersion = topiaVersion + 1");
|
|
| 47 | 47 |
}
|
| 48 | 48 |
|
| 49 | 49 |
}
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.services.local.service.actions.validate; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -40,16 +40,17 @@ import fr.ird.observe.entities.referentiel.Species; |
| 40 | 40 |
import fr.ird.observe.persistence.Entities;
|
| 41 | 41 |
import fr.ird.observe.services.local.service.ObserveServiceLocal;
|
| 42 | 42 |
import fr.ird.observe.services.service.actions.validate.DataValidationRequest;
|
| 43 |
+import fr.ird.observe.services.service.actions.validate.DataValidationResult;
|
|
| 43 | 44 |
import fr.ird.observe.services.service.actions.validate.ReferentialValidationRequest;
|
| 45 |
+import fr.ird.observe.services.service.actions.validate.ReferentialValidationResult;
|
|
| 44 | 46 |
import fr.ird.observe.services.service.actions.validate.ValidateService;
|
| 45 | 47 |
import fr.ird.observe.services.service.actions.validate.ValidationRequest;
|
| 46 |
-import fr.ird.observe.services.service.actions.validate.ValidationResult;
|
|
| 47 | 48 |
import fr.ird.observe.services.service.referential.ReferentialService;
|
| 48 | 49 |
import fr.ird.observe.services.validation.ServiceValidationContext;
|
| 49 | 50 |
import fr.ird.observe.services.validation.ValidatorsMap;
|
| 50 | 51 |
import fr.ird.observe.spi.DbModelHelper;
|
| 51 |
-import org.apache.logging.log4j.Logger;
|
|
| 52 | 52 |
import org.apache.logging.log4j.LogManager;
|
| 53 |
+import org.apache.logging.log4j.Logger;
|
|
| 53 | 54 |
import org.nuiton.validator.xwork2.XWork2ValidatorUtil;
|
| 54 | 55 |
|
| 55 | 56 |
import java.util.List;
|
| ... | ... | @@ -69,12 +70,12 @@ public class ValidateServiceLocal extends ObserveServiceLocal implements Validat |
| 69 | 70 |
private static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(5);
|
| 70 | 71 |
|
| 71 | 72 |
@Override
|
| 72 |
- public ValidationResult<ReferentialValidationRequest> validateReferential(ReferentialValidationRequest request) {
|
|
| 73 |
+ public ReferentialValidationResult validateReferential(ReferentialValidationRequest request) {
|
|
| 73 | 74 |
|
| 74 |
- Future<ValidationResult<ReferentialValidationRequest>> future = EXECUTOR_SERVICE.submit(() -> {
|
|
| 75 |
+ Future<ReferentialValidationResult> future = EXECUTOR_SERVICE.submit(() -> {
|
|
| 75 | 76 |
|
| 76 | 77 |
ReferentialLocale referentialLocale = getReferentialLocale();
|
| 77 |
- ValidationResult.Builder<ReferentialValidationRequest> resultBuilder = ValidationResult.builder(referentialLocale, request);
|
|
| 78 |
+ ReferentialValidationResult.Builder<ReferentialValidationRequest, ReferentialValidationResult> resultBuilder = ReferentialValidationResult.builder(referentialLocale, request);
|
|
| 78 | 79 |
|
| 79 | 80 |
ServiceValidationContext validationContext = createServiceValidationContext(request);
|
| 80 | 81 |
|
| ... | ... | @@ -99,12 +100,12 @@ public class ValidateServiceLocal extends ObserveServiceLocal implements Validat |
| 99 | 100 |
}
|
| 100 | 101 |
|
| 101 | 102 |
@Override
|
| 102 |
- public ValidationResult<DataValidationRequest> validateData(DataValidationRequest request) {
|
|
| 103 |
+ public DataValidationResult validateData(DataValidationRequest request) {
|
|
| 103 | 104 |
|
| 104 |
- Future<ValidationResult<DataValidationRequest>> future = EXECUTOR_SERVICE.submit(() -> {
|
|
| 105 |
+ Future<DataValidationResult> future = EXECUTOR_SERVICE.submit(() -> {
|
|
| 105 | 106 |
|
| 106 | 107 |
ReferentialLocale referentialLocale = getReferentialLocale();
|
| 107 |
- ValidationResult.Builder<DataValidationRequest> resultBuilder = ValidationResult.builder(referentialLocale, request);
|
|
| 108 |
+ DataValidationResult.Builder<DataValidationRequest, DataValidationResult> resultBuilder = DataValidationResult.builder(referentialLocale, request);
|
|
| 108 | 109 |
|
| 109 | 110 |
ServiceValidationContext validationContext = createServiceValidationContext(request);
|
| 110 | 111 |
|
| ... | ... | @@ -41,6 +41,7 @@ import fr.ird.observe.dto.navigation.select.ObserveSelectModel; |
| 41 | 41 |
import fr.ird.observe.dto.reference.DtoReference;
|
| 42 | 42 |
import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 43 | 43 |
import fr.ird.observe.entities.ObserveEntity;
|
| 44 |
+import fr.ird.observe.services.service.actions.validate.ReferentialValidationResult;
|
|
| 44 | 45 |
import fr.ird.observe.services.service.actions.validate.ValidationResult;
|
| 45 | 46 |
import fr.ird.observe.services.validation.ServiceValidationContext;
|
| 46 | 47 |
import fr.ird.observe.services.validation.ValidatorsMap;
|
| ... | ... | @@ -162,7 +163,7 @@ class ValidationMessageDetector implements SimpleBeanValidatorListener { |
| 162 | 163 |
static ValidationMessageDetector forReferential(ValidatorsMap validators,
|
| 163 | 164 |
ServiceValidationContext validationDataContext,
|
| 164 | 165 |
ReferentialLocale referentialLocale,
|
| 165 |
- ValidationResult.Builder resultBuilder) {
|
|
| 166 |
+ ReferentialValidationResult.Builder resultBuilder) {
|
|
| 166 | 167 |
|
| 167 | 168 |
ImmutableMap.Builder<Class, EntityInterceptor> interceptorsBuilder = ImmutableMap.builder();
|
| 168 | 169 |
|
| ... | ... | @@ -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%
|
| ... | ... | @@ -34,8 +34,8 @@ import fr.ird.observe.services.service.actions.report.ReportVariable; |
| 34 | 34 |
import fr.ird.observe.test.DatabaseName;
|
| 35 | 35 |
import fr.ird.observe.test.ObserveFixtures;
|
| 36 | 36 |
import fr.ird.observe.test.spi.DatabaseNameConfiguration;
|
| 37 |
-import org.apache.logging.log4j.Logger;
|
|
| 38 | 37 |
import org.apache.logging.log4j.LogManager;
|
| 38 |
+import org.apache.logging.log4j.Logger;
|
|
| 39 | 39 |
import org.junit.Assert;
|
| 40 | 40 |
import org.junit.Before;
|
| 41 | 41 |
import org.junit.Test;
|
| ... | ... | @@ -58,15 +58,45 @@ public abstract class AbstractReportServiceLocalTest extends ServiceLocalTestSup |
| 58 | 58 |
|
| 59 | 59 |
/** Logger */
|
| 60 | 60 |
private static final Logger log = LogManager.getLogger(AbstractReportServiceLocalTest.class);
|
| 61 |
- |
|
| 62 |
- protected ReportService service;
|
|
| 63 |
- |
|
| 64 | 61 |
/** La liste de tous les reports connus. */
|
| 65 | 62 |
protected static List<Report> reports;
|
| 66 |
- |
|
| 63 |
+ protected ReportService service;
|
|
| 67 | 64 |
/** Le report à tester. */
|
| 68 | 65 |
private Report report;
|
| 69 | 66 |
|
| 67 |
+ protected static Report getReport(Logger log, String reportId) throws IOException {
|
|
| 68 |
+ if (reports == null) {
|
|
| 69 |
+ |
|
| 70 |
+ URL reportLocation =
|
|
| 71 |
+ AbstractReportServiceLocalTest.class.getResource("/observe-reports.properties");
|
|
| 72 |
+ |
|
| 73 |
+ if (log.isInfoEnabled()) {
|
|
| 74 |
+ log.info("Loading reports from " + reportLocation);
|
|
| 75 |
+ }
|
|
| 76 |
+ |
|
| 77 |
+ ReportBuilder builder = new ReportBuilder();
|
|
| 78 |
+ |
|
| 79 |
+ reports = builder.load(reportLocation);
|
|
| 80 |
+ |
|
| 81 |
+ builder.clear();
|
|
| 82 |
+ |
|
| 83 |
+ Assert.assertNotNull(reports);
|
|
| 84 |
+ Assert.assertFalse(reports.isEmpty());
|
|
| 85 |
+ }
|
|
| 86 |
+ |
|
| 87 |
+ Report result = null;
|
|
| 88 |
+ // recuperation du report à tester
|
|
| 89 |
+ for (Report report : reports) {
|
|
| 90 |
+ if (reportId.equals(report.getId())) {
|
|
| 91 |
+ result = report;
|
|
| 92 |
+ break;
|
|
| 93 |
+ }
|
|
| 94 |
+ }
|
|
| 95 |
+ |
|
| 96 |
+ Assert.assertNotNull("Could not find report with id " + reportId, reports);
|
|
| 97 |
+ return result;
|
|
| 98 |
+ }
|
|
| 99 |
+ |
|
| 70 | 100 |
protected abstract String getReportId();
|
| 71 | 101 |
|
| 72 | 102 |
@Before
|
| ... | ... | @@ -83,7 +113,6 @@ public abstract class AbstractReportServiceLocalTest extends ServiceLocalTestSup |
| 83 | 113 |
|
| 84 | 114 |
}
|
| 85 | 115 |
|
| 86 |
- |
|
| 87 | 116 |
/**
|
| 88 | 117 |
* L'unique test à lancer.
|
| 89 | 118 |
* <p>
|
| ... | ... | @@ -92,7 +121,6 @@ public abstract class AbstractReportServiceLocalTest extends ServiceLocalTestSup |
| 92 | 121 |
* <li>la syntaxe du report via {@link #testReportSyntax(Report)}</li>
|
| 93 | 122 |
* <li>le résultat du report via {@link #testReportResult(DataMatrix)}</li>
|
| 94 | 123 |
* </ul>
|
| 95 |
- *
|
|
| 96 | 124 |
*/
|
| 97 | 125 |
@Test
|
| 98 | 126 |
public final void testReport() {
|
| ... | ... | @@ -149,39 +177,6 @@ public abstract class AbstractReportServiceLocalTest extends ServiceLocalTestSup |
| 149 | 177 |
|
| 150 | 178 |
protected abstract void testReportResult(DataMatrix result);
|
| 151 | 179 |
|
| 152 |
- protected static Report getReport(Logger log, String reportId) throws IOException {
|
|
| 153 |
- if (reports == null) {
|
|
| 154 |
- |
|
| 155 |
- URL reportLocation =
|
|
| 156 |
- AbstractReportServiceLocalTest.class.getResource("/observe-reports.properties");
|
|
| 157 |
- |
|
| 158 |
- if (log.isInfoEnabled()) {
|
|
| 159 |
- log.info("Loading reports from " + reportLocation);
|
|
| 160 |
- }
|
|
| 161 |
- |
|
| 162 |
- ReportBuilder builder = new ReportBuilder();
|
|
| 163 |
- |
|
| 164 |
- reports = builder.load(reportLocation);
|
|
| 165 |
- |
|
| 166 |
- builder.clear();
|
|
| 167 |
- |
|
| 168 |
- Assert.assertNotNull(reports);
|
|
| 169 |
- Assert.assertFalse(reports.isEmpty());
|
|
| 170 |
- }
|
|
| 171 |
- |
|
| 172 |
- Report result = null;
|
|
| 173 |
- // recuperation du report à tester
|
|
| 174 |
- for (Report report : reports) {
|
|
| 175 |
- if (reportId.equals(report.getId())) {
|
|
| 176 |
- result = report;
|
|
| 177 |
- break;
|
|
| 178 |
- }
|
|
| 179 |
- }
|
|
| 180 |
- |
|
| 181 |
- Assert.assertNotNull("Could not find report with id " + reportId, reports);
|
|
| 182 |
- return result;
|
|
| 183 |
- }
|
|
| 184 |
- |
|
| 185 | 180 |
protected void assertReportName(Report report,
|
| 186 | 181 |
String name,
|
| 187 | 182 |
String description) {
|
| ... | ... | @@ -234,12 +229,12 @@ public abstract class AbstractReportServiceLocalTest extends ServiceLocalTestSup |
| 234 | 229 |
|
| 235 | 230 |
protected void assertResultRow(DataMatrix result, int rowId, Object... row) {
|
| 236 | 231 |
Object[] actualRow = result.getData()[rowId];
|
| 237 |
- int index=0;
|
|
| 232 |
+ int index = 0;
|
|
| 238 | 233 |
for (Object o : actualRow) {
|
| 239 |
- if (o==null) {
|
|
| 234 |
+ if (o == null) {
|
|
| 240 | 235 |
Assert.assertEquals(row[index++], o);
|
| 241 |
- }else {
|
|
| 242 |
- Assert.assertArrayEquals(row[index++].toString().split("\\s*\\n\\s*"),o.toString().split("\\s*\\n\\s*"));
|
|
| 236 |
+ } else {
|
|
| 237 |
+ Assert.assertArrayEquals(row[index++].toString().split("\\s*\\n\\s*"), o.toString().split("\\s*\\n\\s*"));
|
|
| 243 | 238 |
}
|
| 244 | 239 |
}
|
| 245 | 240 |
//Assert.assertArrayEquals(row, actualRow);
|
| ... | ... | @@ -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%
|
| ... | ... | @@ -97,10 +97,6 @@ |
| 97 | 97 |
<groupId>io.ultreia.java4all.jaxx</groupId>
|
| 98 | 98 |
<artifactId>jaxx-widgets-gis</artifactId>
|
| 99 | 99 |
</dependency>
|
| 100 |
- <dependency>
|
|
| 101 |
- <groupId>io.ultreia.java4all</groupId>
|
|
| 102 |
- <artifactId>java-lang</artifactId>
|
|
| 103 |
- </dependency>
|
|
| 104 | 100 |
|
| 105 | 101 |
<!-- XWork -->
|
| 106 | 102 |
<dependency>
|
| ... | ... | @@ -25,6 +25,7 @@ package fr.ird.observe.services.gson; |
| 25 | 25 |
import com.google.gson.GsonBuilder;
|
| 26 | 26 |
import fr.ird.observe.services.service.actions.consolidate.dcp.FloatingObjectModification;
|
| 27 | 27 |
import fr.ird.observe.services.service.actions.report.ReportVariable;
|
| 28 |
+import fr.ird.observe.services.service.actions.validate.ValidationResultDto;
|
|
| 28 | 29 |
import io.ultreia.java4all.http.HResponseError;
|
| 29 | 30 |
import io.ultreia.java4all.http.HResponseErrorAdapter;
|
| 30 | 31 |
|
| ... | ... | @@ -51,7 +52,7 @@ public class ObserveDtoGsonSupplier extends ObserveDtoGsonSupplierSupport { |
| 51 | 52 |
gsonBuilder.registerTypeAdapter(ReportVariable.class, new ReportVariableAdapter());
|
| 52 | 53 |
gsonBuilder.registerTypeAdapter(HResponseError.class, new HResponseErrorAdapter());
|
| 53 | 54 |
gsonBuilder.registerTypeAdapter(FloatingObjectModification.class, new FloatingObjectModificationAdapter());
|
| 54 |
- |
|
| 55 |
+ gsonBuilder.registerTypeAdapter(ValidationResultDto.class, new ValidationResultDtoAdapter());
|
|
| 55 | 56 |
}
|
| 56 | 57 |
return gsonBuilder;
|
| 57 | 58 |
|
| ... | ... | @@ -29,10 +29,9 @@ import com.google.gson.JsonElement; |
| 29 | 29 |
import com.google.gson.JsonObject;
|
| 30 | 30 |
import com.google.gson.JsonParseException;
|
| 31 | 31 |
import fr.ird.observe.dto.data.DataDto;
|
| 32 |
-import fr.ird.observe.dto.reference.DataDtoReference;
|
|
| 33 |
-import fr.ird.observe.dto.reference.ReferentialDtoReference;
|
|
| 34 | 32 |
import fr.ird.observe.dto.referential.ReferentialDto;
|
| 35 | 33 |
import fr.ird.observe.services.service.actions.report.ReportVariable;
|
| 34 |
+import fr.ird.observe.spi.DtoModelHelper;
|
|
| 36 | 35 |
|
| 37 | 36 |
import java.lang.reflect.Type;
|
| 38 | 37 |
import java.util.Set;
|
| ... | ... | @@ -55,10 +54,10 @@ public class ReportVariableAdapter implements JsonDeserializer<ReportVariable> { |
| 55 | 54 |
Class valueType = type;
|
| 56 | 55 |
|
| 57 | 56 |
if (DataDto.class.isAssignableFrom(type)) {
|
| 58 |
- valueType = DataDtoReference.class;
|
|
| 57 |
+ valueType = DtoModelHelper.fromDataDto((Class) type).toReferenceType();
|
|
| 59 | 58 |
}
|
| 60 | 59 |
if (ReferentialDto.class.isAssignableFrom(type)) {
|
| 61 |
- valueType = ReferentialDtoReference.class;
|
|
| 60 |
+ valueType = DtoModelHelper.fromReferentialDto((Class) type).toReferenceType();
|
|
| 62 | 61 |
}
|
| 63 | 62 |
|
| 64 | 63 |
JsonElement valuesJson = reportVariableJson.get(ReportVariable.PROPERTY_VALUES);
|
| 1 |
+package fr.ird.observe.services.gson;
|
|
| 2 |
+ |
|
| 3 |
+/*
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Services API
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.common.collect.ImmutableSet;
|
|
| 26 |
+import com.google.common.reflect.TypeToken;
|
|
| 27 |
+import com.google.gson.JsonDeserializationContext;
|
|
| 28 |
+import com.google.gson.JsonDeserializer;
|
|
| 29 |
+import com.google.gson.JsonElement;
|
|
| 30 |
+import com.google.gson.JsonObject;
|
|
| 31 |
+import com.google.gson.JsonParseException;
|
|
| 32 |
+import com.google.gson.JsonSerializationContext;
|
|
| 33 |
+import com.google.gson.JsonSerializer;
|
|
| 34 |
+import fr.ird.observe.dto.reference.DtoReference;
|
|
| 35 |
+import fr.ird.observe.gson.ImmutableSetAdapter;
|
|
| 36 |
+import fr.ird.observe.services.service.actions.validate.ValidationResultDto;
|
|
| 37 |
+import fr.ird.observe.services.service.actions.validate.ValidationResultDtoMessage;
|
|
| 38 |
+ |
|
| 39 |
+import java.lang.reflect.Type;
|
|
| 40 |
+import java.util.Set;
|
|
| 41 |
+ |
|
| 42 |
+/**
|
|
| 43 |
+ * Created by tchemit on 23/09/2018.
|
|
| 44 |
+ *
|
|
| 45 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 46 |
+ */
|
|
| 47 |
+public class ValidationResultDtoAdapter implements JsonDeserializer<ValidationResultDto>, JsonSerializer<ValidationResultDto> {
|
|
| 48 |
+ |
|
| 49 |
+ @Override
|
|
| 50 |
+ public ValidationResultDto deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
|
| 51 |
+ JsonObject reportVariableJson = json.getAsJsonObject();
|
|
| 52 |
+ Class<?> type = context.deserialize(reportVariableJson.get("type"), Class.class);
|
|
| 53 |
+ DtoReference dtoReference = context.deserialize(reportVariableJson.get("dtoReference"), type);
|
|
| 54 |
+ Set<ValidationResultDtoMessage> messages = context.deserialize(reportVariableJson.get("messages"), ImmutableSetAdapter.setOf(TypeToken.of(ValidationResultDtoMessage.class)).getType());
|
|
| 55 |
+ return new ValidationResultDto(dtoReference, ImmutableSet.copyOf(messages));
|
|
| 56 |
+ }
|
|
| 57 |
+ |
|
| 58 |
+ @Override
|
|
| 59 |
+ public JsonElement serialize(ValidationResultDto src, Type typeOfSrc, JsonSerializationContext context) {
|
|
| 60 |
+ JsonObject result = new JsonObject();
|
|
| 61 |
+ result.add("type", context.serialize(src.getReference().getReferenceType()));
|
|
| 62 |
+ result.add("dtoReference", context.serialize(src.getReference()));
|
|
| 63 |
+ result.add("messages", context.serialize(src.getMessages().asList()));
|
|
| 64 |
+ return result;
|
|
| 65 |
+ }
|
|
| 66 |
+}
|
| ... | ... | @@ -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%
|
| ... | ... | @@ -51,27 +51,24 @@ import java.util.regex.Pattern; |
| 51 | 51 |
*/
|
| 52 | 52 |
public class ReportBuilder {
|
| 53 | 53 |
|
| 54 |
- private static final Pattern REPORT_DEFINITION_PATTERN = Pattern.compile("report.(\\w+).name");
|
|
| 54 |
+ public static final Pattern REPORT_DEFINITION_PATTERN = Pattern.compile("report.(\\w+).name");
|
|
| 55 | 55 |
|
| 56 |
- private static final String REQUEST_PREFIX = "request.";
|
|
| 56 |
+ public static final String REQUEST_PREFIX = "request.";
|
|
| 57 | 57 |
|
| 58 |
- private static final String OPERATION_PREFIX = "operations.";
|
|
| 58 |
+ public static final String OPERATION_PREFIX = "operations.";
|
|
| 59 | 59 |
|
| 60 |
- private static final String VARIABLE_PREFIX = "variable.";
|
|
| 60 |
+ public static final String VARIABLE_PREFIX = "variable.";
|
|
| 61 | 61 |
|
| 62 |
- private static final String REPEAT_VARIABLE_PREFIX = "repeatVariable.";
|
|
| 62 |
+ public static final String REPEAT_VARIABLE_PREFIX = "repeatVariable.";
|
|
| 63 | 63 |
|
| 64 | 64 |
/** Logger */
|
| 65 | 65 |
private static final Logger log = LogManager.getLogger(ReportBuilder.class);
|
| 66 |
- |
|
| 67 |
- /** les propriétés chargées par le builder pour construire les reports */
|
|
| 68 |
- private Properties properties;
|
|
| 69 |
- |
|
| 70 |
- /** la liste des lastName sde reports connus par le système */
|
|
| 71 |
- private List<String> reportNames;
|
|
| 72 |
- |
|
| 73 | 66 |
/** les operations connues par le système */
|
| 74 | 67 |
protected static Map<String, Class<?>> operations;
|
| 68 |
+ /** les propriétés chargées par le builder pour construire les reports */
|
|
| 69 |
+ protected Properties properties;
|
|
| 70 |
+ /** la liste des lastName sde reports connus par le système */
|
|
| 71 |
+ protected List<String> reportNames;
|
|
| 75 | 72 |
|
| 76 | 73 |
public List<String> getReportNames() {
|
| 77 | 74 |
return reportNames;
|
| ... | ... | @@ -97,7 +94,7 @@ public class ReportBuilder { |
| 97 | 94 |
}
|
| 98 | 95 |
|
| 99 | 96 |
|
| 100 |
- private List<String> detectReportNames() {
|
|
| 97 |
+ protected List<String> detectReportNames() {
|
|
| 101 | 98 |
List<String> reportNames = new ArrayList<>();
|
| 102 | 99 |
Enumeration<Object> keys = properties.keys();
|
| 103 | 100 |
while (keys.hasMoreElements()) {
|
| ... | ... | @@ -163,7 +160,7 @@ public class ReportBuilder { |
| 163 | 160 |
);
|
| 164 | 161 |
}
|
| 165 | 162 |
|
| 166 |
- private Map<String, String> detectReportProperties(String reportName) {
|
|
| 163 |
+ protected Map<String, String> detectReportProperties(String reportName) {
|
|
| 167 | 164 |
|
| 168 | 165 |
Map<String, String> dico = new TreeMap<>();
|
| 169 | 166 |
|
| ... | ... | @@ -238,8 +235,8 @@ public class ReportBuilder { |
| 238 | 235 |
return result.toArray(new ReportRequest[0]);
|
| 239 | 236 |
}
|
| 240 | 237 |
|
| 241 |
- private ReportRequest getRequest(String requestDef,
|
|
| 242 |
- String requestRepeatDef) {
|
|
| 238 |
+ protected ReportRequest getRequest(String requestDef,
|
|
| 239 |
+ String requestRepeatDef) {
|
|
| 243 | 240 |
|
| 244 | 241 |
String[] parts = requestDef.split("\\|");
|
| 245 | 242 |
if (parts.length != 3) {
|
| ... | ... | @@ -311,7 +308,7 @@ public class ReportBuilder { |
| 311 | 308 |
return result.toArray(new ReportOperation[0]);
|
| 312 | 309 |
}
|
| 313 | 310 |
|
| 314 |
- private ReportVariable[] getVariables(String reportName, Map<String, String> dico) {
|
|
| 311 |
+ protected ReportVariable[] getVariables(String reportName, Map<String, String> dico) {
|
|
| 315 | 312 |
List<ReportVariable> result = new ArrayList<>();
|
| 316 | 313 |
Iterator<Map.Entry<String, String>> itr = dico.entrySet().iterator();
|
| 317 | 314 |
List<String> ids = new ArrayList<>();
|
| ... | ... | @@ -351,7 +348,7 @@ public class ReportBuilder { |
| 351 | 348 |
return result.toArray(new ReportVariable[0]);
|
| 352 | 349 |
}
|
| 353 | 350 |
|
| 354 |
- private ReportVariable[] getRepeatVariables(String reportName, Map<String, String> dico) {
|
|
| 351 |
+ protected ReportVariable[] getRepeatVariables(String reportName, Map<String, String> dico) {
|
|
| 355 | 352 |
List<ReportVariable> result = new ArrayList<>();
|
| 356 | 353 |
Iterator<Map.Entry<String, String>> itr = dico.entrySet().iterator();
|
| 357 | 354 |
List<String> ids = new ArrayList<>();
|
| ... | ... | @@ -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%
|
| ... | ... | @@ -25,8 +25,8 @@ import com.google.common.collect.ImmutableSet; |
| 25 | 25 |
import com.google.common.collect.Maps;
|
| 26 | 26 |
import fr.ird.observe.dto.ObserveDto;
|
| 27 | 27 |
import org.apache.commons.lang3.builder.ToStringBuilder;
|
| 28 |
-import org.apache.logging.log4j.Logger;
|
|
| 29 | 28 |
import org.apache.logging.log4j.LogManager;
|
| 29 |
+import org.apache.logging.log4j.Logger;
|
|
| 30 | 30 |
|
| 31 | 31 |
import java.awt.Point;
|
| 32 | 32 |
import java.io.Serializable;
|
| ... | ... | @@ -42,61 +42,16 @@ import java.util.Map; |
| 42 | 42 |
*/
|
| 43 | 43 |
public class ReportRequest implements Serializable, ObserveDto {
|
| 44 | 44 |
|
| 45 |
+ public static final String TRIP_ID_VARIABLE = "tripId";
|
|
| 45 | 46 |
private static final long serialVersionUID = 1L;
|
| 46 |
- |
|
| 47 | 47 |
/** Logger. */
|
| 48 | 48 |
private static final Logger log = LogManager.getLogger(ReportRequest.class);
|
| 49 |
- |
|
| 50 |
- public static final String TRIP_ID_VARIABLE = "tripId";
|
|
| 51 |
- |
|
| 52 |
- /** le layout de la requete. */
|
|
| 53 |
- public enum RequestLayout {
|
|
| 54 |
- /** lorsque les résultats de la requète sont les lignes du résultat. */
|
|
| 55 |
- row,
|
|
| 56 |
- /** lorsque les résultats de la requète sont les colonnes du résultat. */
|
|
| 57 |
- column
|
|
| 58 |
- }
|
|
| 59 |
- |
|
| 60 |
- /** Un repeater optionnel sur la requête. */
|
|
| 61 |
- public static class RequestRepeat implements Serializable, ObserveDto {
|
|
| 62 |
- |
|
| 63 |
- protected final String variableName;
|
|
| 64 |
- |
|
| 65 |
- protected final RequestLayout layout;
|
|
| 66 |
- |
|
| 67 |
- private static final long serialVersionUID = 1L;
|
|
| 68 |
- |
|
| 69 |
- public RequestRepeat(String variableName, RequestLayout layout) {
|
|
| 70 |
- this.variableName = variableName;
|
|
| 71 |
- this.layout = layout;
|
|
| 72 |
- }
|
|
| 73 |
- |
|
| 74 |
- public String getVariableName() {
|
|
| 75 |
- return variableName;
|
|
| 76 |
- }
|
|
| 77 |
- |
|
| 78 |
- public RequestLayout getLayout() {
|
|
| 79 |
- return layout;
|
|
| 80 |
- }
|
|
| 81 |
- |
|
| 82 |
- @Override
|
|
| 83 |
- public String toString() {
|
|
| 84 |
- ToStringBuilder builder = new ToStringBuilder(this);
|
|
| 85 |
- builder.append("variableName", getVariableName());
|
|
| 86 |
- builder.append("layout", getLayout());
|
|
| 87 |
- return builder.toString();
|
|
| 88 |
- }
|
|
| 89 |
- }
|
|
| 90 |
- |
|
| 91 | 49 |
/** layout de la requète. */
|
| 92 | 50 |
protected final RequestLayout layout;
|
| 93 |
- |
|
| 94 | 51 |
/** la requète à exécuter. */
|
| 95 | 52 |
protected final String request;
|
| 96 |
- |
|
| 97 | 53 |
/** la position de la requète. */
|
| 98 | 54 |
protected final Point location;
|
| 99 |
- |
|
| 100 | 55 |
/** le repeater optionel. */
|
| 101 | 56 |
protected final RequestRepeat repeat;
|
| 102 | 57 |
|
| ... | ... | @@ -111,30 +66,6 @@ public class ReportRequest implements Serializable, ObserveDto { |
| 111 | 66 |
location = new Point(x, y);
|
| 112 | 67 |
}
|
| 113 | 68 |
|
| 114 |
- public RequestLayout getLayout() {
|
|
| 115 |
- return layout;
|
|
| 116 |
- }
|
|
| 117 |
- |
|
| 118 |
- public int getX() {
|
|
| 119 |
- return (int) location.getX();
|
|
| 120 |
- }
|
|
| 121 |
- |
|
| 122 |
- public int getY() {
|
|
| 123 |
- return (int) location.getY();
|
|
| 124 |
- }
|
|
| 125 |
- |
|
| 126 |
- public Point getLocation() {
|
|
| 127 |
- return location;
|
|
| 128 |
- }
|
|
| 129 |
- |
|
| 130 |
- public String getRequest() {
|
|
| 131 |
- return request;
|
|
| 132 |
- }
|
|
| 133 |
- |
|
| 134 |
- public RequestRepeat getRepeat() {
|
|
| 135 |
- return repeat;
|
|
| 136 |
- }
|
|
| 137 |
- |
|
| 138 | 69 |
public static Map<String, Object> extractParams(Report report, ImmutableSet<String> tripId) {
|
| 139 | 70 |
|
| 140 | 71 |
Map<String, Object> params = Maps.newHashMap();
|
| ... | ... | @@ -176,6 +107,30 @@ public class ReportRequest implements Serializable, ObserveDto { |
| 176 | 107 |
return datas;
|
| 177 | 108 |
}
|
| 178 | 109 |
|
| 110 |
+ public RequestLayout getLayout() {
|
|
| 111 |
+ return layout;
|
|
| 112 |
+ }
|
|
| 113 |
+ |
|
| 114 |
+ public int getX() {
|
|
| 115 |
+ return (int) location.getX();
|
|
| 116 |
+ }
|
|
| 117 |
+ |
|
| 118 |
+ public int getY() {
|
|
| 119 |
+ return (int) location.getY();
|
|
| 120 |
+ }
|
|
| 121 |
+ |
|
| 122 |
+ public Point getLocation() {
|
|
| 123 |
+ return location;
|
|
| 124 |
+ }
|
|
| 125 |
+ |
|
| 126 |
+ public String getRequest() {
|
|
| 127 |
+ return request;
|
|
| 128 |
+ }
|
|
| 129 |
+ |
|
| 130 |
+ public RequestRepeat getRepeat() {
|
|
| 131 |
+ return repeat;
|
|
| 132 |
+ }
|
|
| 133 |
+ |
|
| 179 | 134 |
@Override
|
| 180 | 135 |
public String toString() {
|
| 181 | 136 |
ToStringBuilder builder = new ToStringBuilder(this);
|
| ... | ... | @@ -185,4 +140,41 @@ public class ReportRequest implements Serializable, ObserveDto { |
| 185 | 140 |
builder.append("repeatVariable", getRepeat());
|
| 186 | 141 |
return builder.toString();
|
| 187 | 142 |
}
|
| 143 |
+ |
|
| 144 |
+ /** le layout de la requete. */
|
|
| 145 |
+ public enum RequestLayout {
|
|
| 146 |
+ /** lorsque les résultats de la requète sont les lignes du résultat. */
|
|
| 147 |
+ row,
|
|
| 148 |
+ /** lorsque les résultats de la requète sont les colonnes du résultat. */
|
|
| 149 |
+ column
|
|
| 150 |
+ }
|
|
| 151 |
+ |
|
| 152 |
+ /** Un repeater optionnel sur la requête. */
|
|
| 153 |
+ public static class RequestRepeat implements Serializable, ObserveDto {
|
|
| 154 |
+ |
|
| 155 |
+ private static final long serialVersionUID = 1L;
|
|
| 156 |
+ protected final String variableName;
|
|
| 157 |
+ protected final RequestLayout layout;
|
|
| 158 |
+ |
|
| 159 |
+ public RequestRepeat(String variableName, RequestLayout layout) {
|
|
| 160 |
+ this.variableName = variableName;
|
|
| 161 |
+ this.layout = layout;
|
|
| 162 |
+ }
|
|
| 163 |
+ |
|
| 164 |
+ public String getVariableName() {
|
|
| 165 |
+ return variableName;
|
|
| 166 |
+ }
|
|
| 167 |
+ |
|
| 168 |
+ public RequestLayout getLayout() {
|
|
| 169 |
+ return layout;
|
|
| 170 |
+ }
|
|
| 171 |
+ |
|
| 172 |
+ @Override
|
|
| 173 |
+ public String toString() {
|
|
| 174 |
+ ToStringBuilder builder = new ToStringBuilder(this);
|
|
| 175 |
+ builder.append("variableName", getVariableName());
|
|
| 176 |
+ builder.append("layout", getLayout());
|
|
| 177 |
+ return builder.toString();
|
|
| 178 |
+ }
|
|
| 179 |
+ }
|
|
| 188 | 180 |
}
|
| 1 |
+package fr.ird.observe.services.service.actions.validate;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Services API
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.common.collect.ImmutableSet;
|
|
| 26 |
+import fr.ird.observe.dto.referential.ReferentialLocale;
|
|
| 27 |
+ |
|
| 28 |
+/**
|
|
| 29 |
+ * Created by tchemit on 06/08/17.
|
|
| 30 |
+ *
|
|
| 31 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 32 |
+ */
|
|
| 33 |
+public class DataValidationResult extends ValidationResult<DataValidationRequest> {
|
|
| 34 |
+ |
|
| 35 |
+ private final DataValidationRequest request;
|
|
| 36 |
+ |
|
| 37 |
+ private DataValidationResult(DataValidationRequest request, ImmutableSet<ValidationResultDto> data) {
|
|
| 38 |
+ super(data);
|
|
| 39 |
+ this.request = request;
|
|
| 40 |
+ }
|
|
| 41 |
+ |
|
| 42 |
+ @Override
|
|
| 43 |
+ public DataValidationRequest getRequest() {
|
|
| 44 |
+ return request;
|
|
| 45 |
+ }
|
|
| 46 |
+ |
|
| 47 |
+ public static Builder<DataValidationRequest, DataValidationResult> builder(ReferentialLocale referenceLocale, DataValidationRequest request) {
|
|
| 48 |
+ return new Builder<DataValidationRequest, DataValidationResult>(referenceLocale, request) {
|
|
| 49 |
+ |
|
| 50 |
+ @Override
|
|
| 51 |
+ protected DataValidationResult newResult(DataValidationRequest request, ImmutableSet<ValidationResultDto> result) {
|
|
| 52 |
+ return new DataValidationResult(request, result);
|
|
| 53 |
+ }
|
|
| 54 |
+ };
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+}
|
| 1 |
+package fr.ird.observe.services.service.actions.validate;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Services API
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2018 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.common.collect.ImmutableSet;
|
|
| 26 |
+import fr.ird.observe.dto.referential.ReferentialLocale;
|
|
| 27 |
+ |
|
| 28 |
+/**
|
|
| 29 |
+ * Created by tchemit on 06/08/17.
|
|
| 30 |
+ *
|
|
| 31 |
+ * @author Tony Chemit - dev@tchemit.fr
|
|
| 32 |
+ */
|
|
| 33 |
+public class ReferentialValidationResult extends ValidationResult<ReferentialValidationRequest> {
|
|
| 34 |
+ |
|
| 35 |
+ private final ReferentialValidationRequest request;
|
|
| 36 |
+ |
|
| 37 |
+ private ReferentialValidationResult(ReferentialValidationRequest request, ImmutableSet<ValidationResultDto> data) {
|
|
| 38 |
+ super(data);
|
|
| 39 |
+ this.request = request;
|
|
| 40 |
+ }
|
|
| 41 |
+ |
|
| 42 |
+ @Override
|
|
| 43 |
+ public ReferentialValidationRequest getRequest() {
|
|
| 44 |
+ return request;
|
|
| 45 |
+ }
|
|
| 46 |
+ |
|
| 47 |
+ public static Builder<ReferentialValidationRequest, ReferentialValidationResult> builder(ReferentialLocale referenceLocale, ReferentialValidationRequest request) {
|
|
| 48 |
+ return new Builder<ReferentialValidationRequest, ReferentialValidationResult>(referenceLocale, request) {
|
|
| 49 |
+ |
|
| 50 |
+ @Override
|
|
| 51 |
+ protected ReferentialValidationResult newResult(ReferentialValidationRequest request, ImmutableSet<ValidationResultDto> result) {
|
|
| 52 |
+ return new ReferentialValidationResult(request, result);
|
|
| 53 |
+ }
|
|
| 54 |
+ };
|
|
| 55 |
+ }
|
|
| 56 |
+ |
|
| 57 |
+}
|
| ... | ... | @@ -37,11 +37,11 @@ public interface ValidateService extends ObserveService { |
| 37 | 37 |
|
| 38 | 38 |
@ReadReferentialPermission
|
| 39 | 39 |
@Post
|
| 40 |
- ValidationResult<ReferentialValidationRequest> validateReferential(ReferentialValidationRequest request);
|
|
| 40 |
+ ReferentialValidationResult validateReferential(ReferentialValidationRequest request);
|
|
| 41 | 41 |
|
| 42 | 42 |
@ReadDataPermission
|
| 43 | 43 |
@ReadReferentialPermission
|
| 44 | 44 |
@Post
|
| 45 |
- ValidationResult<DataValidationRequest> validateData(DataValidationRequest request);
|
|
| 45 |
+ DataValidationResult validateData(DataValidationRequest request);
|
|
| 46 | 46 |
|
| 47 | 47 |
}
|
| ... | ... | @@ -10,12 +10,12 @@ package fr.ird.observe.services.service.actions.validate; |
| 10 | 10 |
* it under the terms of the GNU General Public License as
|
| 11 | 11 |
* published by the Free Software Foundation, either version 3 of the
|
| 12 | 12 |
* License, or (at your option) any later version.
|
| 13 |
- *
|
|
| 13 |
+ *
|
|
| 14 | 14 |
* This program is distributed in the hope that it will be useful,
|
| 15 | 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 16 | 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 17 | 17 |
* GNU General Public License for more details.
|
| 18 |
- *
|
|
| 18 |
+ *
|
|
| 19 | 19 |
* You should have received a copy of the GNU General Public
|
| 20 | 20 |
* License along with this program. If not, see
|
| 21 | 21 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| ... | ... | @@ -28,8 +28,8 @@ import com.google.common.collect.Multimap; |
| 28 | 28 |
import fr.ird.observe.dto.ObserveDto;
|
| 29 | 29 |
import fr.ird.observe.dto.reference.DtoReference;
|
| 30 | 30 |
import fr.ird.observe.dto.referential.ReferentialLocale;
|
| 31 |
-import org.apache.logging.log4j.Logger;
|
|
| 32 | 31 |
import org.apache.logging.log4j.LogManager;
|
| 32 |
+import org.apache.logging.log4j.Logger;
|
|
| 33 | 33 |
import org.nuiton.validator.bean.simple.SimpleBeanValidatorEvent;
|
| 34 | 34 |
|
| 35 | 35 |
import java.util.ArrayList;
|
| ... | ... | @@ -47,23 +47,15 @@ import static org.nuiton.i18n.I18n.l; |
| 47 | 47 |
*
|
| 48 | 48 |
* @author Tony Chemit - dev@tchemit.fr
|
| 49 | 49 |
*/
|
| 50 |
-public class ValidationResult<R extends ValidationRequest> implements ObserveDto {
|
|
| 50 |
+public abstract class ValidationResult<R extends ValidationRequest> implements ObserveDto {
|
|
| 51 | 51 |
|
| 52 |
- private final R request;
|
|
| 53 | 52 |
private final ImmutableSet<ValidationResultDto> data;
|
| 54 | 53 |
|
| 55 |
- public static <R extends ValidationRequest> Builder<R> builder(ReferentialLocale referenceLocale, R request) {
|
|
| 56 |
- return new Builder<>(referenceLocale, request);
|
|
| 57 |
- }
|
|
| 58 |
- |
|
| 59 |
- private ValidationResult(R request, ImmutableSet<ValidationResultDto> data) {
|
|
| 60 |
- this.request = request;
|
|
| 54 |
+ ValidationResult(ImmutableSet<ValidationResultDto> data) {
|
|
| 61 | 55 |
this.data = data;
|
| 62 | 56 |
}
|
| 63 | 57 |
|
| 64 |
- public R getRequest() {
|
|
| 65 |
- return request;
|
|
| 66 |
- }
|
|
| 58 |
+ public abstract R getRequest();
|
|
| 67 | 59 |
|
| 68 | 60 |
public ImmutableSet<ValidationResultDto> getData() {
|
| 69 | 61 |
return data;
|
| ... | ... | @@ -91,7 +83,7 @@ public class ValidationResult<R extends ValidationRequest> implements ObserveDto |
| 91 | 83 |
*
|
| 92 | 84 |
* @author Tony Chemit - dev@tchemit.fr
|
| 93 | 85 |
*/
|
| 94 |
- public static class Builder<R extends ValidationRequest> {
|
|
| 86 |
+ public static abstract class Builder<R extends ValidationRequest, S extends ValidationResult<R>> {
|
|
| 95 | 87 |
|
| 96 | 88 |
/** Logger. */
|
| 97 | 89 |
private static final Logger log = LogManager.getLogger(Builder.class);
|
| ... | ... | @@ -100,7 +92,7 @@ public class ValidationResult<R extends ValidationRequest> implements ObserveDto |
| 100 | 92 |
private final R request;
|
| 101 | 93 |
private final ReferentialLocale referenceLocale;
|
| 102 | 94 |
|
| 103 |
- private Builder(ReferentialLocale referenceLocale, R request) {
|
|
| 95 |
+ Builder(ReferentialLocale referenceLocale, R request) {
|
|
| 104 | 96 |
this.referenceLocale = referenceLocale;
|
| 105 | 97 |
this.request = request;
|
| 106 | 98 |
data = HashMultimap.create();
|
| ... | ... | @@ -119,12 +111,14 @@ public class ValidationResult<R extends ValidationRequest> implements ObserveDto |
| 119 | 111 |
return this;
|
| 120 | 112 |
}
|
| 121 | 113 |
|
| 122 |
- public ValidationResult<R> build() {
|
|
| 114 |
+ protected abstract S newResult(R request, ImmutableSet<ValidationResultDto> result);
|
|
| 115 |
+ |
|
| 116 |
+ public S build() {
|
|
| 123 | 117 |
ImmutableSet.Builder<ValidationResultDto> result = ImmutableSet.builder();
|
| 124 | 118 |
for (Map.Entry<DtoReference, Collection<ValidationResultDtoMessage>> entry : data.asMap().entrySet()) {
|
| 125 | 119 |
result.add(new ValidationResultDto(entry.getKey(), ImmutableSet.copyOf(entry.getValue())));
|
| 126 | 120 |
}
|
| 127 |
- return new ValidationResult<>(request, result.build());
|
|
| 121 |
+ return newResult(request, result.build());
|
|
| 128 | 122 |
}
|
| 129 | 123 |
|
| 130 | 124 |
private String translateMessage(String message) {
|
| ... | ... | @@ -35,7 +35,7 @@ public class ValidationResultDto { |
| 35 | 35 |
private final DtoReference reference;
|
| 36 | 36 |
private final ImmutableSet<ValidationResultDtoMessage> messages;
|
| 37 | 37 |
|
| 38 |
- ValidationResultDto(DtoReference reference, ImmutableSet<ValidationResultDtoMessage> messages) {
|
|
| 38 |
+ public ValidationResultDto(DtoReference reference, ImmutableSet<ValidationResultDtoMessage> messages) {
|
|
| 39 | 39 |
this.reference = reference;
|
| 40 | 40 |
this.messages = messages;
|
| 41 | 41 |
}
|
| ... | ... | @@ -19,7 +19,6 @@ |
| 19 | 19 |
# <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 |
# #L%
|
| 21 | 21 |
###
|
| 22 |
- |
|
| 23 | 22 |
################################################################################
|
| 24 | 23 |
## Liste des \u00e9quipements (Seine)
|
| 25 | 24 |
################################################################################
|
| ... | ... | @@ -36,7 +35,6 @@ report.tripSeineGearUseFeatures.repeatVariable.gearUseFeaturesId=java.lang.Strin |
| 36 | 35 |
m.id In :tripId \
|
| 37 | 36 |
and g in elements (m.gearUseFeaturesSeine) \
|
| 38 | 37 |
Order By g.gear.label2
|
| 39 |
- |
|
| 40 | 38 |
report.tripSeineGearUseFeatures.request.1=0,0|row|\
|
| 41 | 39 |
Select \
|
| 42 | 40 |
concat(CASE When g.gear.code IS NULL Then 'Aucun code' Else g.gear.code End, ' - ', g.gear.label2), \
|
| ... | ... | @@ -44,9 +42,7 @@ report.tripSeineGearUseFeatures.request.1=0,0|row|\ |
| 44 | 42 |
( CASE g.usedInTrip When true Then 'Oui' Else Case g.usedInTrip When false Then 'Non' Else 'Ind\u00e9termin\u00e9' End End )\
|
| 45 | 43 |
From GearUseFeaturesSeineImpl g \
|
| 46 | 44 |
Where g.id = :gearUseFeaturesId
|
| 47 |
- |
|
| 48 | 45 |
report.tripSeineGearUseFeatures.request.1.repeat=gearUseFeaturesId|column
|
| 49 |
- |
|
| 50 | 46 |
################################################################################
|
| 51 | 47 |
## Liste des \u00e9quipements (Longline)
|
| 52 | 48 |
################################################################################
|
| ... | ... | @@ -63,7 +59,6 @@ report.tripLonglineGearUseFeatures.repeatVariable.gearUseFeaturesId=java.lang.St |
| 63 | 59 |
m.id In :tripId \
|
| 64 | 60 |
and g in elements (m.gearUseFeaturesLongline) \
|
| 65 | 61 |
Order By g.gear.label2
|
| 66 |
- |
|
| 67 | 62 |
report.tripLonglineGearUseFeatures.request.1=0,0|row|\
|
| 68 | 63 |
Select \
|
| 69 | 64 |
concat(CASE When g.gear.code IS NULL Then 'Aucun code' Else g.gear.code End, ' - ', g.gear.label2), \
|
| ... | ... | @@ -71,9 +66,7 @@ report.tripLonglineGearUseFeatures.request.1=0,0|row|\ |
| 71 | 66 |
( CASE g.usedInTrip When true Then 'Oui' Else Case g.usedInTrip When false Then 'Non' Else 'Ind\u00e9termin\u00e9' End End )\
|
| 72 | 67 |
From GearUseFeaturesLonglineImpl g \
|
| 73 | 68 |
Where g.id = :gearUseFeaturesId
|
| 74 |
- |
|
| 75 | 69 |
report.tripLonglineGearUseFeatures.request.1.repeat=gearUseFeaturesId|column
|
| 76 |
- |
|
| 77 | 70 |
################################################################################
|
| 78 | 71 |
## Liste des activit\u00e9s avec des comments
|
| 79 | 72 |
################################################################################
|
| ... | ... | @@ -91,7 +84,6 @@ report.activityWithComment.request.1=0,0|row|\ |
| 91 | 84 |
m.id In :tripId \
|
| 92 | 85 |
and a.comment is not null \
|
| 93 | 86 |
Order By r.date, a.time
|
| 94 |
- |
|
| 95 | 87 |
################################################################################
|
| 96 | 88 |
## Liste de toutes les activit\u00e9s et leurs positions
|
| 97 | 89 |
################################################################################
|
| ... | ... | @@ -108,7 +100,6 @@ report.allActivitys.request.1=0,0|row|\ |
| 108 | 100 |
Where \
|
| 109 | 101 |
m.id In :tripId \
|
| 110 | 102 |
Order By r.date, a.time
|
| 111 |
- |
|
| 112 | 103 |
################################################################################
|
| 113 | 104 |
## Nombre de cal\u00e9es et captures journali\u00e8res d'une mar\u00e9e
|
| 114 | 105 |
################################################################################
|
| ... | ... | @@ -127,7 +118,6 @@ report.dailySetAndCatch.request.1=0,0|row|\ |
| 127 | 118 |
m.id In :tripId \
|
| 128 | 119 |
Group By r.date \
|
| 129 | 120 |
Order By r.date
|
| 130 |
- |
|
| 131 | 121 |
################################################################################
|
| 132 | 122 |
## Utilisation des DCP
|
| 133 | 123 |
################################################################################
|
| ... | ... | @@ -145,14 +135,12 @@ report.dcpUsage.repeatVariable.typeObjetId=java.lang.String|\ |
| 145 | 135 |
Where \
|
| 146 | 136 |
m.id In :tripId \
|
| 147 | 137 |
Order by to.code
|
| 148 |
- |
|
| 149 | 138 |
report.dcpUsage.request.1=0,0|row|\
|
| 150 | 139 |
Select concat(str(to.code) , ' - ', to.label2) \
|
| 151 | 140 |
From ObjectTypeImpl to \
|
| 152 | 141 |
Where \
|
| 153 | 142 |
to.id = :typeObjetId
|
| 154 | 143 |
report.dcpUsage.request.1.repeat=typeObjetId|column
|
| 155 |
- |
|
| 156 | 144 |
report.dcpUsage.request.2=1,0|row|\
|
| 157 | 145 |
Select Count(dcp) \
|
| 158 | 146 |
From TripSeineImpl m \
|
| ... | ... | @@ -164,7 +152,6 @@ report.dcpUsage.request.2=1,0|row|\ |
| 164 | 152 |
and dcp.objectType.id = :typeObjetId \
|
| 165 | 153 |
and dcp.objectOperation.id = 'fr.ird.observe.entities.referentiel.seine.ObjectOperation#1239832686249#0.8268884472438458'
|
| 166 | 154 |
report.dcpUsage.request.2.repeat=typeObjetId|column
|
| 167 |
- |
|
| 168 | 155 |
report.dcpUsage.request.3=2,0|row|\
|
| 169 | 156 |
Select Count(dcp) \
|
| 170 | 157 |
From TripSeineImpl m \
|
| ... | ... | @@ -176,7 +163,6 @@ report.dcpUsage.request.3=2,0|row|\ |
| 176 | 163 |
and dcp.objectType.id = :typeObjetId \
|
| 177 | 164 |
and dcp.objectOperation.id = 'fr.ird.observe.entities.referentiel.seine.ObjectOperation#1239832686249#0.8431519556575698'
|
| 178 | 165 |
report.dcpUsage.request.3.repeat=typeObjetId|column
|
| 179 |
- |
|
| 180 | 166 |
report.dcpUsage.request.4=3,0|row|\
|
| 181 | 167 |
Select Count(dcp) \
|
| 182 | 168 |
From TripSeineImpl m \
|
| ... | ... | @@ -188,7 +174,6 @@ report.dcpUsage.request.4=3,0|row|\ |
| 188 | 174 |
and dcp.objectType.id = :typeObjetId \
|
| 189 | 175 |
and dcp.objectOperation.id = 'fr.ird.observe.entities.referentiel.seine.ObjectOperation#1239832686248#0.8669327599318251'
|
| 190 | 176 |
report.dcpUsage.request.4.repeat=typeObjetId|column
|
| 191 |
- |
|
| 192 | 177 |
report.dcpUsage.request.5=4,0|row|\
|
| 193 | 178 |
Select Count(dcp) \
|
| 194 | 179 |
From TripSeineImpl m \
|
| ... | ... | @@ -201,7 +186,6 @@ report.dcpUsage.request.5=4,0|row|\ |
| 201 | 186 |
and dcp.objectFate.id = 'fr.ird.observe.entities.referentiel.seine.ObjectFate#1396860761530#0.8869464242156488' \
|
| 202 | 187 |
and dcp.objectOperation.id != 'fr.ird.observe.entities.referentiel.seine.ObjectOperation#1239832686248#0.8669327599318251'
|
| 203 | 188 |
report.dcpUsage.request.5.repeat=typeObjetId|column
|
| 204 |
- |
|
| 205 | 189 |
report.dcpUsage.request.6=5,0|row|\
|
| 206 | 190 |
Select Count(dcp) \
|
| 207 | 191 |
From TripSeineImpl m \
|
| ... | ... | @@ -213,7 +197,6 @@ report.dcpUsage.request.6=5,0|row|\ |
| 213 | 197 |
and dcp.objectType.id = :typeObjetId \
|
| 214 | 198 |
and dcp.objectOperation.id = 'fr.ird.observe.entities.referentiel.seine.ObjectOperation#1239832686249#0.7838704130950722'
|
| 215 | 199 |
report.dcpUsage.request.6.repeat=typeObjetId|column
|
| 216 |
- |
|
| 217 | 200 |
report.dcpUsage.request.7=6,0|row| \
|
| 218 | 201 |
Select Sum(efo.count) \
|
| 219 | 202 |
From TripSeineImpl m \
|
| ... | ... | @@ -226,7 +209,6 @@ report.dcpUsage.request.7=6,0|row| \ |
| 226 | 209 |
and dcp.objectType.id = :typeObjetId \
|
| 227 | 210 |
and efo.species.speciesGroup.id = 'fr.ird.observe.entities.referentiel.SpeciesGroup#1239832683690#0.24333033683679461'
|
| 228 | 211 |
report.dcpUsage.request.7.repeat=typeObjetId|column
|
| 229 |
- |
|
| 230 | 212 |
################################################################################
|
| 231 | 213 |
## Nombre des cal\u00e9es selon le type d'association
|
| 232 | 214 |
################################################################################
|
| ... | ... | @@ -249,7 +231,6 @@ report.setByAssociation.request.1=0,0|column|\ |
| 249 | 231 |
and a.setSeine.reasonForNullSet is null \
|
| 250 | 232 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 251 | 233 |
and os not in elements(a.observedSystem)
|
| 252 |
- |
|
| 253 | 234 |
report.setByAssociation.request.2=0,1|column|\
|
| 254 | 235 |
Select Count(a) \
|
| 255 | 236 |
From TripSeineImpl m \
|
| ... | ... | @@ -262,7 +243,6 @@ report.setByAssociation.request.2=0,1|column|\ |
| 262 | 243 |
and a.setSeine.reasonForNullSet is not null \
|
| 263 | 244 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 264 | 245 |
and os not in elements(a.observedSystem)
|
| 265 |
- |
|
| 266 | 246 |
report.setByAssociation.request.3=1,0|column|\
|
| 267 | 247 |
Select Count(a) \
|
| 268 | 248 |
From TripSeineImpl m \
|
| ... | ... | @@ -275,7 +255,6 @@ report.setByAssociation.request.3=1,0|column|\ |
| 275 | 255 |
and a.setSeine.reasonForNullSet is null \
|
| 276 | 256 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 277 | 257 |
and os in elements(a.observedSystem)
|
| 278 |
- |
|
| 279 | 258 |
report.setByAssociation.request.4=1,1|column|\
|
| 280 | 259 |
Select Count(a) \
|
| 281 | 260 |
From TripSeineImpl m \
|
| ... | ... | @@ -288,7 +267,6 @@ report.setByAssociation.request.4=1,1|column|\ |
| 288 | 267 |
and a.setSeine.reasonForNullSet is not null \
|
| 289 | 268 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 290 | 269 |
and os in elements(a.observedSystem)
|
| 291 |
- |
|
| 292 | 270 |
report.setByAssociation.request.5=2,0|column|\
|
| 293 | 271 |
Select Count(a) \
|
| 294 | 272 |
From TripSeineImpl m \
|
| ... | ... | @@ -301,7 +279,6 @@ report.setByAssociation.request.5=2,0|column|\ |
| 301 | 279 |
and a.setSeine.reasonForNullSet is null \
|
| 302 | 280 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 303 | 281 |
and os in elements(a.observedSystem)
|
| 304 |
- |
|
| 305 | 282 |
report.setByAssociation.request.6=2,1|column|\
|
| 306 | 283 |
Select Count(a) \
|
| 307 | 284 |
From TripSeineImpl m \
|
| ... | ... | @@ -314,7 +291,6 @@ report.setByAssociation.request.6=2,1|column|\ |
| 314 | 291 |
and a.setSeine.reasonForNullSet is not null \
|
| 315 | 292 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 316 | 293 |
and os in elements(a.observedSystem)
|
| 317 |
- |
|
| 318 | 294 |
report.setByAssociation.request.7=3,0|column|\
|
| 319 | 295 |
Select Count(a) \
|
| 320 | 296 |
From TripSeineImpl m \
|
| ... | ... | @@ -327,7 +303,6 @@ report.setByAssociation.request.7=3,0|column|\ |
| 327 | 303 |
and a.setSeine.reasonForNullSet is null \
|
| 328 | 304 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 329 | 305 |
and os not in elements(a.observedSystem)
|
| 330 |
- |
|
| 331 | 306 |
report.setByAssociation.request.8=3,1|column|\
|
| 332 | 307 |
Select Count(a) \
|
| 333 | 308 |
From TripSeineImpl m \
|
| ... | ... | @@ -340,7 +315,6 @@ report.setByAssociation.request.8=3,1|column|\ |
| 340 | 315 |
and a.setSeine.reasonForNullSet is not null \
|
| 341 | 316 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 342 | 317 |
and os not in elements(a.observedSystem)
|
| 343 |
- |
|
| 344 | 318 |
################################################################################
|
| 345 | 319 |
## Captures thon par type d'association
|
| 346 | 320 |
################################################################################
|
| ... | ... | @@ -351,7 +325,6 @@ report.targetCatchByAssociation.columns=YFT, SKJ, BET, LTA, FRI, Autres, Total |
| 351 | 325 |
report.targetCatchByAssociation.rows=BL sans baleine, BL avec baleine, BO avec requin-baleine, BO sans requin-baleine, Total
|
| 352 | 326 |
report.targetCatchByAssociation.operations.1=SumRow
|
| 353 | 327 |
report.targetCatchByAssociation.operations.2=SumColumn
|
| 354 |
- |
|
| 355 | 328 |
# ligne 1
|
| 356 | 329 |
report.targetCatchByAssociation.request.1=0,0|row|\
|
| 357 | 330 |
Select \
|
| ... | ... | @@ -383,7 +356,6 @@ report.targetCatchByAssociation.request.1=0,0|row|\ |
| 383 | 356 |
m.id In :tripId \
|
| 384 | 357 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 385 | 358 |
and os not in elements(a.observedSystem)
|
| 386 |
- |
|
| 387 | 359 |
# ligne 2
|
| 388 | 360 |
report.targetCatchByAssociation.request.7=0,1|row|\
|
| 389 | 361 |
Select \
|
| ... | ... | @@ -415,7 +387,6 @@ report.targetCatchByAssociation.request.7=0,1|row|\ |
| 415 | 387 |
m.id In :tripId \
|
| 416 | 388 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 417 | 389 |
and os in elements(a.observedSystem)
|
| 418 |
- |
|
| 419 | 390 |
# ligne 3
|
| 420 | 391 |
report.targetCatchByAssociation.request.13=0,2|row|\
|
| 421 | 392 |
Select \
|
| ... | ... | @@ -447,7 +418,6 @@ report.targetCatchByAssociation.request.13=0,2|row|\ |
| 447 | 418 |
m.id In :tripId \
|
| 448 | 419 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 449 | 420 |
and os in elements(a.observedSystem)
|
| 450 |
- |
|
| 451 | 421 |
# ligne 4
|
| 452 | 422 |
report.targetCatchByAssociation.request.19=0,3|row|\
|
| 453 | 423 |
Select \
|
| ... | ... | @@ -479,7 +449,6 @@ report.targetCatchByAssociation.request.19=0,3|row|\ |
| 479 | 449 |
m.id In :tripId \
|
| 480 | 450 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 481 | 451 |
and os not in elements(a.observedSystem)
|
| 482 |
- |
|
| 483 | 452 |
################################################################################
|
| 484 | 453 |
## Rejets thons selon le type d'association
|
| 485 | 454 |
################################################################################
|
| ... | ... | @@ -490,7 +459,6 @@ report.targetDiscardedByAssociation.columns=YFT, SKJ, BET, LTA, FRI, Autres, Tot |
| 490 | 459 |
report.targetDiscardedByAssociation.rows=BL sans baleine, BL avec baleine, BO avec requin-baleine, BO sans requin-baleine, Total
|
| 491 | 460 |
report.targetDiscardedByAssociation.operations.1=SumRow
|
| 492 | 461 |
report.targetDiscardedByAssociation.operations.2=SumColumn
|
| 493 |
- |
|
| 494 | 462 |
# ligne 1
|
| 495 | 463 |
report.targetDiscardedByAssociation.request.1=0,0|row|\
|
| 496 | 464 |
Select \
|
| ... | ... | @@ -522,7 +490,6 @@ report.targetDiscardedByAssociation.request.1=0,0|row|\ |
| 522 | 490 |
m.id In :tripId \
|
| 523 | 491 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 524 | 492 |
and os not in elements(a.observedSystem)
|
| 525 |
- |
|
| 526 | 493 |
# ligne 2
|
| 527 | 494 |
report.targetDiscardedByAssociation.request.7=0,1|row|\
|
| 528 | 495 |
Select \
|
| ... | ... | @@ -554,7 +521,6 @@ report.targetDiscardedByAssociation.request.7=0,1|row|\ |
| 554 | 521 |
m.id In :tripId \
|
| 555 | 522 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9395222812356602' \
|
| 556 | 523 |
and os in elements(a.observedSystem)
|
| 557 |
- |
|
| 558 | 524 |
# ligne 3
|
| 559 | 525 |
report.targetDiscardedByAssociation.request.13=0,2|row|\
|
| 560 | 526 |
Select \
|
| ... | ... | @@ -586,7 +552,6 @@ report.targetDiscardedByAssociation.request.13=0,2|row|\ |
| 586 | 552 |
m.id In :tripId \
|
| 587 | 553 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 588 | 554 |
and os in elements(a.observedSystem)
|
| 589 |
- |
|
| 590 | 555 |
# ligne 4
|
| 591 | 556 |
report.targetDiscardedByAssociation.request.19=0,3|row|\
|
| 592 | 557 |
Select \
|
| ... | ... | @@ -618,7 +583,6 @@ report.targetDiscardedByAssociation.request.19=0,3|row|\ |
| 618 | 583 |
m.id In :tripId \
|
| 619 | 584 |
and os.topiaId = 'fr.ird.observe.entities.referentiel.seine.ObservedSystem#1239832686428#0.9217864901728908' \
|
| 620 | 585 |
and os not in elements(a.observedSystem)
|
| 621 |
- |
|
| 622 | 586 |
################################################################################
|
| 623 | 587 |
## Captures accessoires observ\u00e9es
|
| 624 | 588 |
################################################################################
|
| ... | ... | @@ -631,7 +595,6 @@ report.accessoryCatch.repeatVariable.speciesId=java.lang.String|\ |
| 631 | 595 |
Select e.id From SpeciesImpl e \
|
| 632 | 596 |
Where e.speciesGroup.id = :speciesGroup \
|
| 633 | 597 |
Order By e.homeId
|
| 634 |
- |
|
| 635 | 598 |
report.accessoryCatch.request.1=0,0|row|\
|
| 636 | 599 |
Select \
|
| 637 | 600 |
concat('[FAO]', (case when e.faoCode is not null then e.faoCode else '-' end), \
|
| ... | ... | @@ -640,7 +603,6 @@ report.accessoryCatch.request.1=0,0|row|\ |
| 640 | 603 |
From SpeciesImpl e \
|
| 641 | 604 |
Where e.id = :speciesId
|
| 642 | 605 |
report.accessoryCatch.request.1.repeat=speciesId|column
|
| 643 |
- |
|
| 644 | 606 |
report.accessoryCatch.request.2=1,0|row|\
|
| 645 | 607 |
Select \
|
| 646 | 608 |
case when Count(ca) > 0 then \
|
| ... | ... | @@ -657,7 +619,6 @@ report.accessoryCatch.request.2=1,0|row|\ |
| 657 | 619 |
with ca.species.id = :speciesId \
|
| 658 | 620 |
Where m.id In :tripId
|
| 659 | 621 |
report.accessoryCatch.request.2.repeat=speciesId|column
|
| 660 |
- |
|
| 661 | 622 |
report.accessoryCatch.request.3=2,0|row|\
|
| 662 | 623 |
Select \
|
| 663 | 624 |
case when Count(ca) > 0 then \
|
| ... | ... | @@ -674,7 +635,6 @@ report.accessoryCatch.request.3=2,0|row|\ |
| 674 | 635 |
with ca.species.id = :speciesId \
|
| 675 | 636 |
Where m.id In :tripId
|
| 676 | 637 |
report.accessoryCatch.request.3.repeat=speciesId|column
|
| 677 |
- |
|
| 678 | 638 |
################################################################################
|
| 679 | 639 |
## Captures accessoires par speciesGroup d'esp\u00e8ces
|
| 680 | 640 |
################################################################################
|
| ... | ... | @@ -683,7 +643,6 @@ report.accessoryCatchByGroup.name=D\u00e9nombrement des captures accessoires et |
| 683 | 643 |
report.accessoryCatchByGroup.description=Afficher les nombres de captures accessoires par groupe d'esp\u00e8ce selon le type de banc et le devenir
|
| 684 | 644 |
report.accessoryCatchByGroup.columns=Esp\u00e8ce, Total BL, Total BO, Sorti vivant/\u00e9chapp\u00e9, Sorti mort, Rejet\u00e9 vivant, Rejet\u00e9 mort, Partiellement conserv\u00e9, Cuve, Cuisine, Autre
|
| 685 | 645 |
report.accessoryCatchByGroup.variable.speciesGroup=fr.ird.observe.dto.referential.SpeciesGroupDto|From SpeciesGroupImpl ge Order By ge.code
|
| 686 |
- |
|
| 687 | 646 |
report.accessoryCatchByGroup.request.1=0,0|row|\
|
| 688 | 647 |
Select \
|
| 689 | 648 |
concat(\
|
| ... | ... | @@ -726,7 +685,6 @@ report.accessoryCatchByGroup.request.1=0,0|row|\ |
| 726 | 685 |
Where m.id In :tripId \
|
| 727 | 686 |
Group by e \
|
| 728 | 687 |
Order By e.homeId
|
| 729 |
- |
|
| 730 | 688 |
###########################################################
|
| 731 | 689 |
## Distribution des tailles par espèces non ciblées
|
| 732 | 690 |
###########################################################
|
| ... | ... | @@ -754,7 +712,6 @@ Where t.id In :tripId \ |
| 754 | 712 |
And ntl.species.id = :speciesId \
|
| 755 | 713 |
Group By ntl.length \
|
| 756 | 714 |
Order By ntl.length
|
| 757 |
- |
|
| 758 | 715 |
####################################################################
|
| 759 | 716 |
## Distribution des tailles des conservés par espèces ciblées (LD1)
|
| 760 | 717 |
####################################################################
|
| ... | ... | @@ -786,7 +743,6 @@ Where t.id In :tripId \ |
| 786 | 743 |
And ts.discarded = false \
|
| 787 | 744 |
Group By tl.length \
|
| 788 | 745 |
Order By tl.length
|
| 789 |
- |
|
| 790 | 746 |
################################################################
|
| 791 | 747 |
## Distribution des tailles des rejets par espèces ciblées (LD1)
|
| 792 | 748 |
################################################################
|
| ... | ... | @@ -818,7 +774,6 @@ Where t.id In :tripId \ |
| 818 | 774 |
And ts.discarded = true \
|
| 819 | 775 |
Group By tl.length \
|
| 820 | 776 |
Order By tl.length
|
| 821 |
- |
|
| 822 | 777 |
###############################################################
|
| 823 | 778 |
## Distribution des tailles des conservés par espèces ciblées (LF)
|
| 824 | 779 |
###############################################################
|
| ... | ... | @@ -850,7 +805,6 @@ Where t.id In :tripId \ |
| 850 | 805 |
And ts.discarded = false \
|
| 851 | 806 |
Group By tl.length \
|
| 852 | 807 |
Order By tl.length
|
| 853 |
- |
|
| 854 | 808 |
###############################################################
|
| 855 | 809 |
## Distribution des tailles des rejets par espèces ciblées (LF)
|
| 856 | 810 |
###############################################################
|
| ... | ... | @@ -882,7 +836,6 @@ Where t.id In :tripId \ |
| 882 | 836 |
And ts.discarded = true \
|
| 883 | 837 |
Group By tl.length \
|
| 884 | 838 |
Order By tl.length
|
| 885 |
- |
|
| 886 | 839 |
############################################
|
| 887 | 840 |
## Répartition des calées par cuves
|
| 888 | 841 |
############################################
|