Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
e76086e4
by Tony Chemit at 2024-05-13T11:05:50+02:00
-
31a4cd82
by Tony Chemit at 2024-05-13T11:09:38+02:00
7 changed files:
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/save/actions/Start.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/legacy/actions/Apply.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/legacy/actions/Start.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/synchronize/referential/legacy/actions/SynchroUIActionSupport.java
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/common/LinesBuilder.java
- client/datasource/editor/ll/src/main/java/fr/ird/observe/client/datasource/editor/ll/data/common/TripMapContentBuilder.java
- client/datasource/editor/ll/src/main/resources/map/ll-style.xml
Changes:
| ... | ... | @@ -31,7 +31,6 @@ import fr.ird.observe.datasource.request.CreateDatabaseRequest; |
| 31 | 31 | import fr.ird.observe.dto.ProgressionModel;
|
| 32 | 32 | import fr.ird.observe.services.service.DataSourceService;
|
| 33 | 33 | import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeContext;
|
| 34 | -import io.ultreia.java4all.lang.Strings;
|
|
| 35 | 34 | import io.ultreia.java4all.util.TimeLog;
|
| 36 | 35 | import io.ultreia.java4all.util.sql.SqlScript;
|
| 37 | 36 | import org.apache.logging.log4j.LogManager;
|
| ... | ... | @@ -22,26 +22,18 @@ package fr.ird.observe.client.datasource.actions.synchronize.referential.legacy. |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | -import fr.ird.observe.client.datasource.actions.AdminStep;
|
|
| 26 | 25 | import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.ObsoleteReferentialReference;
|
| 27 | 26 | import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeModel;
|
| 28 | 27 | import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeUI;
|
| 29 | 28 | import fr.ird.observe.client.datasource.api.ObserveSwingDataSource;
|
| 30 | -import fr.ird.observe.dto.I18nDecoratorHelper;
|
|
| 31 | 29 | import fr.ird.observe.dto.ToolkitIdLabel;
|
| 32 | 30 | import fr.ird.observe.dto.referential.ReferentialDto;
|
| 33 | -import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeContext;
|
|
| 34 | 31 | import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeEngine;
|
| 35 | 32 | import fr.ird.observe.services.service.referential.synchro.UnidirectionalCallbackResults;
|
| 36 | -import fr.ird.observe.services.service.referential.synchro.UnidirectionalResult;
|
|
| 37 | 33 | import io.ultreia.java4all.jaxx.widgets.combobox.FilterableComboBox;
|
| 38 | -import io.ultreia.java4all.util.LeftOrRightContext;
|
|
| 39 | -import io.ultreia.java4all.util.TimeLog;
|
|
| 40 | 34 | import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState;
|
| 41 | 35 | |
| 42 | 36 | import java.awt.event.ActionEvent;
|
| 43 | -import java.util.Collection;
|
|
| 44 | -import java.util.List;
|
|
| 45 | 37 | |
| 46 | 38 | import static io.ultreia.java4all.i18n.I18n.t;
|
| 47 | 39 | |
| ... | ... | @@ -88,63 +80,4 @@ public class Apply extends SynchroUIActionSupport { |
| 88 | 80 | }
|
| 89 | 81 | }
|
| 90 | 82 | |
| 91 | - |
|
| 92 | - private void beforeSuccess(UnidirectionalSynchronizeEngine engine) {
|
|
| 93 | - SynchronizeModel stepModel = ui.getStepModel();
|
|
| 94 | - |
|
| 95 | - UnidirectionalSynchronizeContext referentialSynchronizeContext = stepModel.getReferentialSynchronizeContext();
|
|
| 96 | - UnidirectionalCallbackResults referentialSynchronizeCallbackResults = stepModel.getReferentialSynchronizeCallbackResults();
|
|
| 97 | - |
|
| 98 | - UnidirectionalResult referentialSynchronizeResult = engine.prepareResult(referentialSynchronizeContext, referentialSynchronizeCallbackResults);
|
|
| 99 | - stepModel.setReferentialSynchronizeResult(referentialSynchronizeResult);
|
|
| 100 | - long t00 = TimeLog.getTime();
|
|
| 101 | - if (referentialSynchronizeResult.isEmpty()) {
|
|
| 102 | - //Update lastUpdateDate anyway (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2231)
|
|
| 103 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.ref.is.updtodate"));
|
|
| 104 | - ui.getModel().getSaveLocalModel().addStepForSave(AdminStep.SYNCHRONIZE);
|
|
| 105 | - } else {
|
|
| 106 | - for (Class<? extends ReferentialDto> referentialName : referentialSynchronizeResult.getReferentialNames()) {
|
|
| 107 | - String referentialStr = t(I18nDecoratorHelper.getType(referentialName));
|
|
| 108 | - Collection<String> referentialAdded = referentialSynchronizeResult.getReferentialAdded(referentialName);
|
|
| 109 | - if (referentialAdded != null && !referentialAdded.isEmpty()) {
|
|
| 110 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.added", referentialStr, referentialAdded.size()));
|
|
| 111 | - for (String id : referentialAdded) {
|
|
| 112 | - sendMessage(" - " + id);
|
|
| 113 | - }
|
|
| 114 | - }
|
|
| 115 | - Collection<String> referentialUpdated = referentialSynchronizeResult.getReferentialUpdated(referentialName);
|
|
| 116 | - if (referentialUpdated != null && !referentialUpdated.isEmpty()) {
|
|
| 117 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.modified", referentialStr, referentialUpdated.size()));
|
|
| 118 | - for (String id : referentialUpdated) {
|
|
| 119 | - sendMessage(" - " + id);
|
|
| 120 | - }
|
|
| 121 | - }
|
|
| 122 | - Collection<String> referentialReverted = referentialSynchronizeResult.getReferentialReverted(referentialName);
|
|
| 123 | - if (referentialReverted != null && !referentialReverted.isEmpty()) {
|
|
| 124 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.reverted", referentialStr, referentialReverted.size()));
|
|
| 125 | - for (String id : referentialReverted) {
|
|
| 126 | - sendMessage(" - " + id);
|
|
| 127 | - }
|
|
| 128 | - }
|
|
| 129 | - Collection<String> referentialRemoved = referentialSynchronizeResult.getReferentialRemoved(referentialName);
|
|
| 130 | - if (referentialRemoved != null && !referentialRemoved.isEmpty()) {
|
|
| 131 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.removed", referentialStr, referentialRemoved.size()));
|
|
| 132 | - for (String id : referentialRemoved) {
|
|
| 133 | - sendMessage(" - " + id);
|
|
| 134 | - }
|
|
| 135 | - }
|
|
| 136 | - List<LeftOrRightContext<String>> referentialReplaced = referentialSynchronizeResult.getReferentialReplaced(referentialName);
|
|
| 137 | - if (referentialReplaced != null && !referentialReplaced.isEmpty()) {
|
|
| 138 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.replaced", referentialStr, referentialReplaced.size()));
|
|
| 139 | - for (LeftOrRightContext<String> ids : referentialReplaced) {
|
|
| 140 | - sendMessage(" - " + ids.left() + " → " + ids.right());
|
|
| 141 | - }
|
|
| 142 | - }
|
|
| 143 | - }
|
|
| 144 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.script.path", referentialSynchronizeContext.getSqlScriptPath()));
|
|
| 145 | - |
|
| 146 | - ui.getModel().getSaveLocalModel().addStepForSave(AdminStep.SYNCHRONIZE);
|
|
| 147 | - }
|
|
| 148 | - onEndAction(t00, -1, null);
|
|
| 149 | - }
|
|
| 150 | 83 | } |
| ... | ... | @@ -22,7 +22,6 @@ package fr.ird.observe.client.datasource.actions.synchronize.referential.legacy. |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | -import fr.ird.observe.client.datasource.actions.AdminStep;
|
|
| 26 | 25 | import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.ObsoleteReferentialReference;
|
| 27 | 26 | import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeModel;
|
| 28 | 27 | import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeUI;
|
| ... | ... | @@ -113,15 +112,14 @@ public class Start extends SynchroUIActionSupport { |
| 113 | 112 | // need user fix on obsolete references
|
| 114 | 113 | return WizardState.NEED_FIX;
|
| 115 | 114 | }
|
| 115 | + |
|
| 116 | + // pas de reference obsolete à traiter
|
|
| 117 | + // on termine le traitement
|
|
| 118 | + //Update lastUpdateDate anyway (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2231)
|
|
| 119 | + beforeSuccess(engine);
|
|
| 120 | + return WizardState.SUCCESSED;
|
|
| 116 | 121 | }
|
| 117 | 122 | }
|
| 118 | - // pas de reference obsolete à traiter
|
|
| 119 | - // on termine le traitement
|
|
| 120 | - //Update lastUpdateDate anyway (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2231)
|
|
| 121 | - sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.ref.is.updtodate"));
|
|
| 122 | - |
|
| 123 | - ui.getModel().getSaveLocalModel().addStepForSave(AdminStep.SYNCHRONIZE);
|
|
| 124 | - return WizardState.SUCCESSED;
|
|
| 125 | 123 | }
|
| 126 | 124 | |
| 127 | 125 | } |
| ... | ... | @@ -22,13 +22,85 @@ package fr.ird.observe.client.datasource.actions.synchronize.referential.legacy. |
| 22 | 22 | * #L%
|
| 23 | 23 | */
|
| 24 | 24 | |
| 25 | +import fr.ird.observe.client.datasource.actions.AdminStep;
|
|
| 25 | 26 | import fr.ird.observe.client.datasource.actions.actions.AdminTabUIActionSupport;
|
| 27 | +import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeModel;
|
|
| 26 | 28 | import fr.ird.observe.client.datasource.actions.synchronize.referential.legacy.SynchronizeUI;
|
| 29 | +import fr.ird.observe.dto.I18nDecoratorHelper;
|
|
| 30 | +import fr.ird.observe.dto.referential.ReferentialDto;
|
|
| 31 | +import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeContext;
|
|
| 32 | +import fr.ird.observe.services.service.referential.UnidirectionalSynchronizeEngine;
|
|
| 33 | +import fr.ird.observe.services.service.referential.synchro.UnidirectionalCallbackResults;
|
|
| 34 | +import fr.ird.observe.services.service.referential.synchro.UnidirectionalResult;
|
|
| 35 | +import io.ultreia.java4all.util.LeftOrRightContext;
|
|
| 36 | +import io.ultreia.java4all.util.TimeLog;
|
|
| 37 | + |
|
| 38 | +import java.util.Collection;
|
|
| 39 | +import java.util.List;
|
|
| 40 | + |
|
| 41 | +import static io.ultreia.java4all.i18n.I18n.t;
|
|
| 27 | 42 | |
| 28 | 43 | public abstract class SynchroUIActionSupport extends AdminTabUIActionSupport<SynchronizeUI> {
|
| 29 | 44 | |
| 30 | 45 | public SynchroUIActionSupport(String label, String shortDescription, String actionIcon, char acceleratorKey) {
|
| 31 | 46 | super(label, shortDescription, actionIcon, acceleratorKey);
|
| 32 | 47 | }
|
| 48 | + protected void beforeSuccess(UnidirectionalSynchronizeEngine engine) {
|
|
| 49 | + SynchronizeModel stepModel = ui.getStepModel();
|
|
| 50 | + |
|
| 51 | + UnidirectionalSynchronizeContext referentialSynchronizeContext = stepModel.getReferentialSynchronizeContext();
|
|
| 52 | + UnidirectionalCallbackResults referentialSynchronizeCallbackResults = stepModel.getReferentialSynchronizeCallbackResults();
|
|
| 33 | 53 | |
| 54 | + UnidirectionalResult referentialSynchronizeResult = engine.prepareResult(referentialSynchronizeContext, referentialSynchronizeCallbackResults);
|
|
| 55 | + stepModel.setReferentialSynchronizeResult(referentialSynchronizeResult);
|
|
| 56 | + long t00 = TimeLog.getTime();
|
|
| 57 | + if (referentialSynchronizeResult.isEmpty()) {
|
|
| 58 | + //Update lastUpdateDate anyway (See https://gitlab.com/ultreiaio/ird-observe/-/issues/2231)
|
|
| 59 | + sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.ref.is.updtodate"));
|
|
| 60 | + ui.getModel().getSaveLocalModel().addStepForSave(AdminStep.SYNCHRONIZE);
|
|
| 61 | + } else {
|
|
| 62 | + for (Class<? extends ReferentialDto> referentialName : referentialSynchronizeResult.getReferentialNames()) {
|
|
| 63 | + String referentialStr = t(I18nDecoratorHelper.getType(referentialName));
|
|
| 64 | + Collection<String> referentialAdded = referentialSynchronizeResult.getReferentialAdded(referentialName);
|
|
| 65 | + if (referentialAdded != null && !referentialAdded.isEmpty()) {
|
|
| 66 | + sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.added", referentialStr, referentialAdded.size()));
|
|
| 67 | + for (String id : referentialAdded) {
|
|
| 68 | + sendMessage(" - " + id);
|
|
| 69 | + }
|
|
| 70 | + }
|
|
| 71 | + Collection<String> referentialUpdated = referentialSynchronizeResult.getReferentialUpdated(referentialName);
|
|
| 72 | + if (referentialUpdated != null && !referentialUpdated.isEmpty()) {
|
|
| 73 | + sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.modified", referentialStr, referentialUpdated.size()));
|
|
| 74 | + for (String id : referentialUpdated) {
|
|
| 75 | + sendMessage(" - " + id);
|
|
| 76 | + }
|
|
| 77 | + }
|
|
| 78 | + Collection<String> referentialReverted = referentialSynchronizeResult.getReferentialReverted(referentialName);
|
|
| 79 | + if (referentialReverted != null && !referentialReverted.isEmpty()) {
|
|
| 80 | + sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.reverted", referentialStr, referentialReverted.size()));
|
|
| 81 | + for (String id : referentialReverted) {
|
|
| 82 | + sendMessage(" - " + id);
|
|
| 83 | + }
|
|
| 84 | + }
|
|
| 85 | + Collection<String> referentialRemoved = referentialSynchronizeResult.getReferentialRemoved(referentialName);
|
|
| 86 | + if (referentialRemoved != null && !referentialRemoved.isEmpty()) {
|
|
| 87 | + sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.removed", referentialStr, referentialRemoved.size()));
|
|
| 88 | + for (String id : referentialRemoved) {
|
|
| 89 | + sendMessage(" - " + id);
|
|
| 90 | + }
|
|
| 91 | + }
|
|
| 92 | + List<LeftOrRightContext<String>> referentialReplaced = referentialSynchronizeResult.getReferentialReplaced(referentialName);
|
|
| 93 | + if (referentialReplaced != null && !referentialReplaced.isEmpty()) {
|
|
| 94 | + sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.referentiel.was.replaced", referentialStr, referentialReplaced.size()));
|
|
| 95 | + for (LeftOrRightContext<String> ids : referentialReplaced) {
|
|
| 96 | + sendMessage(" - " + ids.left() + " → " + ids.right());
|
|
| 97 | + }
|
|
| 98 | + }
|
|
| 99 | + }
|
|
| 100 | + sendMessage(t("observe.ui.datasource.editor.actions.synchro.referential.message.script.path", referentialSynchronizeContext.getSqlScriptPath()));
|
|
| 101 | + |
|
| 102 | + ui.getModel().getSaveLocalModel().addStepForSave(AdminStep.SYNCHRONIZE);
|
|
| 103 | + }
|
|
| 104 | + onEndAction(t00, -1, null);
|
|
| 105 | + }
|
|
| 34 | 106 | } |
| ... | ... | @@ -50,6 +50,20 @@ public abstract class LinesBuilder { |
| 50 | 50 | |
| 51 | 51 | private static final String LOGBOOK_LINES_LAYER_NAME = "Logbook lines";
|
| 52 | 52 | |
| 53 | + @Override
|
|
| 54 | + public String tripLineId() {
|
|
| 55 | + return "logbookTrip";
|
|
| 56 | + }
|
|
| 57 | + |
|
| 58 | + @Override
|
|
| 59 | + public String settingLineId() {
|
|
| 60 | + return "logbookSetting";
|
|
| 61 | + }
|
|
| 62 | + |
|
| 63 | + @Override
|
|
| 64 | + public String haulingLineId() {
|
|
| 65 | + return "logbookHauling";
|
|
| 66 | + }
|
|
| 53 | 67 | |
| 54 | 68 | @Override
|
| 55 | 69 | public boolean addSettingLine(TripMapPointType previousTripMapPointType, TripMapPointType tripMapPointType) {
|
| ... | ... | @@ -91,6 +105,21 @@ public abstract class LinesBuilder { |
| 91 | 105 | |
| 92 | 106 | private static final String OBSERVATION_LINES_LAYER_NAME = "Observation lines";
|
| 93 | 107 | |
| 108 | + @Override
|
|
| 109 | + public String tripLineId() {
|
|
| 110 | + return "observationsTrip";
|
|
| 111 | + }
|
|
| 112 | + |
|
| 113 | + @Override
|
|
| 114 | + public String settingLineId() {
|
|
| 115 | + return "observationsSetting";
|
|
| 116 | + }
|
|
| 117 | + |
|
| 118 | + @Override
|
|
| 119 | + public String haulingLineId() {
|
|
| 120 | + return "observationsHauling";
|
|
| 121 | + }
|
|
| 122 | + |
|
| 94 | 123 | @Override
|
| 95 | 124 | public boolean addSettingLine(TripMapPointType previousTripMapPointType, TripMapPointType tripMapPointType) {
|
| 96 | 125 | return previousTripMapPointType.equals(TripMapPointType.llActivityObsWithSettingStart) && tripMapPointType.equals(TripMapPointType.llActivityObsWithSettingEnd);
|
| ... | ... | @@ -146,10 +175,13 @@ public abstract class LinesBuilder { |
| 146 | 175 | |
| 147 | 176 | public abstract boolean skipLine(TripMapPointType previousTripMapPointType, TripMapPointType tripMapPointType);
|
| 148 | 177 | |
| 178 | + public abstract String tripLineId();
|
|
| 149 | 179 | public abstract String tripLineTitle();
|
| 150 | 180 | |
| 181 | + public abstract String settingLineId();
|
|
| 151 | 182 | public abstract String settingLineTitle();
|
| 152 | 183 | |
| 184 | + public abstract String haulingLineId();
|
|
| 153 | 185 | public abstract String haulingLineTitle();
|
| 154 | 186 | |
| 155 | 187 | public abstract String layerName();
|
| ... | ... | @@ -167,7 +199,7 @@ public abstract class LinesBuilder { |
| 167 | 199 | if (tripMapPoint.isValid()) {
|
| 168 | 200 | offerNextPoint(tripMapPoint);
|
| 169 | 201 | } else {
|
| 170 | - log.info(String.format("Point %d → %s - skip (not valid)", index, tripMapPointType));
|
|
| 202 | + log.debug(String.format("Point %d → %s - skip (not valid)", index, tripMapPointType));
|
|
| 171 | 203 | }
|
| 172 | 204 | previousTripMapPoint = tripMapPoint;
|
| 173 | 205 | }
|
| ... | ... | @@ -187,14 +219,14 @@ public abstract class LinesBuilder { |
| 187 | 219 | |
| 188 | 220 | protected void offerNextPoint(TripMapPoint tripMapPoint) {
|
| 189 | 221 | TripMapPointType tripMapPointType = tripMapPoint.getType();
|
| 190 | - log.info(String.format("Point %d → %s", index, tripMapPointType));
|
|
| 222 | + log.debug(String.format("Point %d → %s", index, tripMapPointType));
|
|
| 191 | 223 | TripMapPointType previousTripMapPointType = previousTripMapPoint.getType();
|
| 192 | 224 | |
| 193 | 225 | boolean previousPointValid = previousTripMapPoint.isValid();
|
| 194 | 226 | if (addSettingLine(previousTripMapPointType, tripMapPointType)) {
|
| 195 | 227 | if (previousPointValid) {
|
| 196 | 228 | settingLines.add(TripMapContentBuilderSupport.create(previousTripMapPoint, tripMapPoint));
|
| 197 | - log.info(String.format("Point %d → %s - add setting line %d (%s → %s)", index, tripMapPoint.getType(), settingLines.size(), previousTripMapPoint.getType(), tripMapPoint.getType()));
|
|
| 229 | + log.debug(String.format("Point %d → %s - add setting line %d (%s → %s)", index, tripMapPoint.getType(), settingLines.size(), previousTripMapPoint.getType(), tripMapPoint.getType()));
|
|
| 198 | 230 | }
|
| 199 | 231 | return;
|
| 200 | 232 | }
|
| ... | ... | @@ -204,17 +236,17 @@ public abstract class LinesBuilder { |
| 204 | 236 | if (addHaulingLine(previousTripMapPointType, tripMapPointType)) {
|
| 205 | 237 | if (previousPointValid) {
|
| 206 | 238 | haulingLines.add(TripMapContentBuilderSupport.create(previousTripMapPoint, tripMapPoint));
|
| 207 | - log.info(String.format("Point %d → %s - add hauling line %d (%s → %s)", index, tripMapPoint.getType(), haulingLines.size(), previousTripMapPoint.getType(), tripMapPoint.getType()));
|
|
| 239 | + log.debug(String.format("Point %d → %s - add hauling line %d (%s → %s)", index, tripMapPoint.getType(), haulingLines.size(), previousTripMapPoint.getType(), tripMapPoint.getType()));
|
|
| 208 | 240 | }
|
| 209 | 241 | return;
|
| 210 | 242 | }
|
| 211 | 243 | if (tripLineStart == null) {
|
| 212 | 244 | tripLineStart = tripMapPoint;
|
| 213 | - log.info(String.format("Point %d → %s - add first start for first line", index, tripMapPoint.getType()));
|
|
| 245 | + log.debug(String.format("Point %d → %s - add first start for first line", index, tripMapPoint.getType()));
|
|
| 214 | 246 | return;
|
| 215 | 247 | }
|
| 216 | 248 | tripLines.add(TripMapContentBuilderSupport.create(tripLineStart, tripMapPoint));
|
| 217 | - log.info(String.format("Point %d → %s - add trip line %d (%s → %s)", index, tripMapPoint.getType(), tripLines.size(), tripLineStart.getType(), tripMapPoint.getType()));
|
|
| 249 | + log.debug(String.format("Point %d → %s - add trip line %d (%s → %s)", index, tripMapPoint.getType(), tripLines.size(), tripLineStart.getType(), tripMapPoint.getType()));
|
|
| 218 | 250 | tripLineStart = tripMapPoint;
|
| 219 | 251 | }
|
| 220 | 252 |
| ... | ... | @@ -56,9 +56,6 @@ import static io.ultreia.java4all.i18n.I18n.n; |
| 56 | 56 | @AutoService(fr.ird.observe.dto.data.TripMapContentBuilder.class)
|
| 57 | 57 | public class TripMapContentBuilder extends TripMapContentBuilderSupport {
|
| 58 | 58 | |
| 59 | - public static final String SETTING_LINE_TYPE = "setting";
|
|
| 60 | - public static final String HAULING_LINE_TYPE = "hauling";
|
|
| 61 | - public static final String TRIP_LINE_TYPE = "trip";
|
|
| 62 | 59 | private static final LinesBuilder.LogbookLinesBuilder LOGBOOK_LINES_BUILDER = new LinesBuilder.LogbookLinesBuilder();
|
| 63 | 60 | private static final ZonesBuilder.LogbookZonesBuilder LOGBOOK_ZONES_BUILDER = new ZonesBuilder.LogbookZonesBuilder();
|
| 64 | 61 | private static final LinesBuilder.ObservationsLinesBuilder OBSERVATIONS_LINES_BUILDER = new LinesBuilder.ObservationsLinesBuilder();
|
| ... | ... | @@ -137,22 +134,22 @@ public class TripMapContentBuilder extends TripMapContentBuilderSupport { |
| 137 | 134 | Set<String> lineTypes = new TreeSet<>();
|
| 138 | 135 | builder.build(tripMapPoints);
|
| 139 | 136 | if (addTripSegment) {
|
| 140 | - addLines(TRIP_LINE_TYPE, linesFeatures, lineTypes, builder.getTripLines(), excludedFeatureNames);
|
|
| 137 | + addLines(builder.tripLineId(), linesFeatures, lineTypes, builder.getTripLines(), excludedFeatureNames);
|
|
| 141 | 138 | }
|
| 142 | - addLines(SETTING_LINE_TYPE, linesFeatures, lineTypes, builder.getSettingLines(), excludedFeatureNames);
|
|
| 143 | - addLines(HAULING_LINE_TYPE, linesFeatures, lineTypes, builder.getHaulingLines(), excludedFeatureNames);
|
|
| 144 | - if (!linesFeatures.isEmpty()) {
|
|
| 139 | + addLines(builder.settingLineId(), linesFeatures, lineTypes, builder.getSettingLines(), excludedFeatureNames);
|
|
| 140 | + addLines(builder.haulingLineId(), linesFeatures, lineTypes, builder.getHaulingLines(), excludedFeatureNames);
|
|
| 141 | + if (!lineTypes.isEmpty()) {
|
|
| 145 | 142 | Style styleLines = findStyle(styledLayerDescriptor, builder.layerName());
|
| 146 | 143 | Layer layerLines = new FeatureLayer(linesFeatures, styleLines, builder.layerName());
|
| 147 | 144 | mapContent.addLayer(layerLines);
|
| 148 | - if (lineTypes.contains(TRIP_LINE_TYPE)) {
|
|
| 149 | - addLineLegend(styleLines, TRIP_LINE_TYPE, builder.tripLineTitle(), excludedFeatureNames);
|
|
| 145 | + if (lineTypes.contains(builder.tripLineId())) {
|
|
| 146 | + addLineLegend(styleLines, builder.tripLineId(), builder.tripLineTitle(), excludedFeatureNames);
|
|
| 150 | 147 | }
|
| 151 | - if (lineTypes.contains(SETTING_LINE_TYPE)) {
|
|
| 152 | - addLineLegend(styleLines, SETTING_LINE_TYPE, builder.settingLineTitle(), excludedFeatureNames);
|
|
| 148 | + if (lineTypes.contains(builder.settingLineId())) {
|
|
| 149 | + addLineLegend(styleLines, builder.settingLineId(), builder.settingLineTitle(), excludedFeatureNames);
|
|
| 153 | 150 | }
|
| 154 | - if (lineTypes.contains(HAULING_LINE_TYPE)) {
|
|
| 155 | - addLineLegend(styleLines, HAULING_LINE_TYPE, builder.haulingLineTitle(), excludedFeatureNames);
|
|
| 151 | + if (lineTypes.contains(builder.haulingLineId())) {
|
|
| 152 | + addLineLegend(styleLines, builder.haulingLineId(), builder.haulingLineTitle(), excludedFeatureNames);
|
|
| 156 | 153 | }
|
| 157 | 154 | }
|
| 158 | 155 | }
|
| ... | ... | @@ -112,7 +112,7 @@ |
| 112 | 112 | <ogc:Filter>
|
| 113 | 113 | <ogc:PropertyIsEqualTo>
|
| 114 | 114 | <ogc:PropertyName>type</ogc:PropertyName>
|
| 115 | - <ogc:Literal>trip</ogc:Literal>
|
|
| 115 | + <ogc:Literal>observationsTrip</ogc:Literal>
|
|
| 116 | 116 | </ogc:PropertyIsEqualTo>
|
| 117 | 117 | </ogc:Filter>
|
| 118 | 118 | <LineSymbolizer>
|
| ... | ... | @@ -130,7 +130,7 @@ |
| 130 | 130 | <ogc:Filter>
|
| 131 | 131 | <ogc:PropertyIsEqualTo>
|
| 132 | 132 | <ogc:PropertyName>type</ogc:PropertyName>
|
| 133 | - <ogc:Literal>setting</ogc:Literal>
|
|
| 133 | + <ogc:Literal>observationsSetting</ogc:Literal>
|
|
| 134 | 134 | </ogc:PropertyIsEqualTo>
|
| 135 | 135 | </ogc:Filter>
|
| 136 | 136 | <LineSymbolizer>
|
| ... | ... | @@ -147,7 +147,7 @@ |
| 147 | 147 | <ogc:Filter>
|
| 148 | 148 | <ogc:PropertyIsEqualTo>
|
| 149 | 149 | <ogc:PropertyName>type</ogc:PropertyName>
|
| 150 | - <ogc:Literal>hauling</ogc:Literal>
|
|
| 150 | + <ogc:Literal>observationsHauling</ogc:Literal>
|
|
| 151 | 151 | </ogc:PropertyIsEqualTo>
|
| 152 | 152 | </ogc:Filter>
|
| 153 | 153 | <LineSymbolizer>
|
| ... | ... | @@ -171,7 +171,7 @@ |
| 171 | 171 | <ogc:Filter>
|
| 172 | 172 | <ogc:PropertyIsEqualTo>
|
| 173 | 173 | <ogc:PropertyName>type</ogc:PropertyName>
|
| 174 | - <ogc:Literal>trip</ogc:Literal>
|
|
| 174 | + <ogc:Literal>logbookTrip</ogc:Literal>
|
|
| 175 | 175 | </ogc:PropertyIsEqualTo>
|
| 176 | 176 | </ogc:Filter>
|
| 177 | 177 | <LineSymbolizer>
|
| ... | ... | @@ -189,7 +189,7 @@ |
| 189 | 189 | <ogc:Filter>
|
| 190 | 190 | <ogc:PropertyIsEqualTo>
|
| 191 | 191 | <ogc:PropertyName>type</ogc:PropertyName>
|
| 192 | - <ogc:Literal>setting</ogc:Literal>
|
|
| 192 | + <ogc:Literal>logbookSetting</ogc:Literal>
|
|
| 193 | 193 | </ogc:PropertyIsEqualTo>
|
| 194 | 194 | </ogc:Filter>
|
| 195 | 195 | <LineSymbolizer>
|
| ... | ... | @@ -206,7 +206,7 @@ |
| 206 | 206 | <ogc:Filter>
|
| 207 | 207 | <ogc:PropertyIsEqualTo>
|
| 208 | 208 | <ogc:PropertyName>type</ogc:PropertyName>
|
| 209 | - <ogc:Literal>hauling</ogc:Literal>
|
|
| 209 | + <ogc:Literal>logbookHauling</ogc:Literal>
|
|
| 210 | 210 | </ogc:PropertyIsEqualTo>
|
| 211 | 211 | </ogc:Filter>
|
| 212 | 212 | <LineSymbolizer>
|