Skip to content
Permalink
Browse files

ETF Remote validation results persistency (#4308)

* ETF Remote validation results persistency

* Added a pineapple icon for INSPIRE validation

* ETF Remote validation results persistency - use gnConfigService to retrieve the INSPIRE settings to display the Batch validation option

* ETF Remote validation results persistency - confirm validation

* ETF Remote validation results persistency - fix indexing

* ETF Remote validation results persistency - updates for progress bar widget updates in the UI

* Better support to INSPIRE validation - integrated changes from PR #4312

* ETF Remote validation results persistency - Use try-with-resources syntax for http connections and IOUtils.closeQuietly in InspireValidatorUtils class

* Increase the maximum height of the dropdown menu

*  ETF Remote validation results persistency:
- Add new metadata validation status: DOES_NOT_APPLY.
- Handle adidtional INSPIRE validator result codes.
- Index metadata when validating with the INSPIRE validator in the metadata editor.
- Update batch INSPIRE validation end-point name.
- Define test validation rules conditions per schema.

* ETF Remote validation results persistency - don't show progress panel when loading the editor board page for old finished task

* ETF Remote validation results persistency - configuration of the max number of checks to verify a validation task is complete and the interval between checks

* ETF Remote validation results persistency - add test conditions for iso19115-3.2018 and convert metadata to iso19139 for other schemas

* ETF Remote validation results persistency - Improve icon and increase timeout between progress status checker - ETF is slow, 10s interval is probably good enough.

* ETF Remote validation results persistency - do not add an inspireValid field is validation info is not set. Do not display icon if no inspireValid info.

Co-authored-by: josegar74 <josegar74@gmail.com>
Co-authored-by: Michel Gabriël <michel.gabriel@geocat.net>
Co-authored-by: Fabio Vinci <fabio.vinci@ext.ec.europa.eu>
  • Loading branch information
4 people committed Jan 10, 2020
1 parent 541e844 commit 72133937add1d8f4e1beb3678ec715923c64ddc3
Showing with 1,293 additions and 92 deletions.
  1. +2 −0 core/src/main/java/org/fao/geonet/constants/Geonet.java
  2. +15 −2 core/src/main/java/org/fao/geonet/kernel/datamanager/base/BaseMetadataIndexer.java
  3. +28 −0 domain/src/main/java/org/fao/geonet/domain/MetadataValidation.java
  4. +1 −1 domain/src/main/java/org/fao/geonet/domain/MetadataValidationStatus.java
  5. +26 −0 services/src/main/java/org/fao/geonet/api/processing/EmptySlotBatch.java
  6. +291 −0 services/src/main/java/org/fao/geonet/api/processing/MInspireEtfValidateProcess.java
  7. +111 −1 services/src/main/java/org/fao/geonet/api/processing/ValidateApi.java
  8. +14 −1 services/src/main/java/org/fao/geonet/api/records/InspireValidationApi.java
  9. +79 −0 services/src/main/java/org/fao/geonet/api/records/InspireValidationRunnable.java
  10. +211 −49 services/src/main/java/org/fao/geonet/api/records/editing/InspireValidatorUtils.java
  11. +1 −0 services/src/main/java/org/fao/geonet/api/records/formatters/FormatterParams.java
  12. +7 −7 services/src/main/java/org/fao/geonet/api/records/formatters/XsltFormatter.java
  13. +32 −5 services/src/main/resources/config-spring-geonetwork.xml
  14. +34 −0 services/src/test/java/org/fao/geonet/api/records/editing/InspireValidatorUtilsTest.java
  15. +204 −0 web-ui/src/main/resources/catalog/components/admin/batch/BatchTaskDirective.js
  16. +30 −0 web-ui/src/main/resources/catalog/components/admin/batch/BatchTaskModule.js
  17. +17 −0 web-ui/src/main/resources/catalog/components/admin/batch/partials/batchstatus.html
  18. +4 −0 web-ui/src/main/resources/catalog/components/admin/batch/partials/batchstatuscontainer.html
  19. +4 −2 ...rc/main/resources/catalog/components/edit/directoryassociatedmd/DirectoryAssociatedMdDirective.js
  20. +26 −6 web-ui/src/main/resources/catalog/components/metadataactions/MetadataActionService.js
  21. +1 −0 web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js
  22. +8 −2 web-ui/src/main/resources/catalog/components/search/resultsview/SelectionDirective.js
  23. +9 −0 web-ui/src/main/resources/catalog/components/search/resultsview/partials/selection-widget.html
  24. +3 −2 web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/editor.html
  25. +42 −0 web-ui/src/main/resources/catalog/components/utility/MetadataTypeInspireValidationWidget.js
  26. +20 −0 web-ui/src/main/resources/catalog/components/utility/partials/typeinspirevalidationwidget.html
  27. +3 −1 web-ui/src/main/resources/catalog/js/GnModule.js
  28. +5 −1 web-ui/src/main/resources/catalog/js/edit/DirectoryController.js
  29. +11 −0 web-ui/src/main/resources/catalog/js/edit/EditorBoardController.js
  30. +10 −0 web-ui/src/main/resources/catalog/locales/en-core.json
  31. +1 −0 web-ui/src/main/resources/catalog/locales/en-search.json
  32. +4 −4 web-ui/src/main/resources/catalog/style/gn.less
  33. +12 −7 web-ui/src/main/resources/catalog/style/gn_editor.less
  34. +7 −0 web-ui/src/main/resources/catalog/templates/editor/editorboard.html
  35. BIN web-ui/src/main/resources/catalog/views/default/images/inspire.png
  36. +16 −1 web-ui/src/main/resources/catalog/views/default/less/gn_editor_default.less
  37. +2 −0 web/src/main/webapp/WEB-INF/config-lucene.xml
  38. +2 −0 web/src/main/webapp/WEB-INF/config-summary.xml
@@ -675,11 +675,13 @@
public static final String STATUS = "_status";
public static final String STATUS_CHANGE_DATE = "_statusChangeDate";
public static final String VALID = "_valid";
public static final String VALID_INSPIRE = "_valid_inspire";
public static final String ID = "_id";
public static final String ANY = "any";
public static final String LOCALE = "locale";
public static final String IS_PUBLISHED_TO_ALL = "_isPublishedToAll";
public static final String FEEDBACKCOUNT = "feedbackCount";
public static final String DRAFT = "_draft";
public static final String INSPIRE_REPORT_URL = "_inspireReportUrl";
}
}
@@ -550,16 +550,29 @@ public void indexMetadata(final String metadataId, boolean forceRefreshReaders,
moreFields.add(SearchManager.makeField(Geonet.IndexFieldNames.VALID, "-1", true, true));
} else {
String isValid = "1";
boolean hasInspireValidation = false;
for (MetadataValidation vi : validationInfo) {
String type = vi.getId().getValidationType();
MetadataValidationStatus status = vi.getStatus();
if (status == MetadataValidationStatus.INVALID && vi.isRequired()) {
isValid = "0";

// TODO: Check if ignore INSPIRE validation?
if (!type.equalsIgnoreCase("inspire")) {
if (status == MetadataValidationStatus.INVALID && vi.isRequired()) {
isValid = "0";
}
} else {
hasInspireValidation = true;
moreFields.add(SearchManager.makeField(Geonet.IndexFieldNames.INSPIRE_REPORT_URL, vi.getReportUrl(), true, true));
}

moreFields.add(SearchManager.makeField(Geonet.IndexFieldNames.VALID + "_" + type, status.getCode(),
true, true));
}
moreFields.add(SearchManager.makeField(Geonet.IndexFieldNames.VALID, isValid, true, true));

if (!hasInspireValidation) {
moreFields.add(SearchManager.makeField(Geonet.IndexFieldNames.VALID_INSPIRE, "-1", true, true));
}
}

//To inject extra fields from BaseMetadataIndexer inherited beans
@@ -24,6 +24,7 @@
package org.fao.geonet.domain;

import org.fao.geonet.entitylistener.MetadataValidationEntityListenerManager;
import org.hibernate.annotations.Type;

import javax.annotation.Nonnull;
import javax.persistence.*;
@@ -45,6 +46,8 @@
private int numFailures = 0;
private ISODate validationDate = new ISODate();
private Boolean required = Boolean.TRUE;
private String reportUrl;
private String reportContent;

/**
* Return the id object of this entity.
@@ -181,6 +184,29 @@ public MetadataValidation setNumFailures(int numFailures) {
return this;
}

@Column
public String getReportUrl() {
return reportUrl;
}

public MetadataValidation setReportUrl(String reportUrl) {
this.reportUrl = reportUrl;
return this;
}

@Column
@Lob
@Basic(fetch = FetchType.LAZY)
@Type(type = "org.hibernate.type.StringClobType")
public String getReportContent() {
return reportContent;
}

public MetadataValidation setReportContent(String reportContent) {
this.reportContent = reportContent;
return this;
}

@Override
public String toString() {
return "MetadataValidation{" + id +
@@ -189,6 +215,8 @@ public String toString() {
", numFailures=" + numFailures +
", validationDate=" + validationDate +
", required=" + required +
", reportUrl=" + reportUrl +
", reportContent=" + reportContent +
'}';
}
}
@@ -29,7 +29,7 @@
* @author Jesse
*/
public enum MetadataValidationStatus {
INVALID, VALID, NEVER_CALCULATED;
INVALID, VALID, NEVER_CALCULATED, DOES_NOT_APPLY;

public String getCode() {
return String.valueOf(ordinal());
@@ -0,0 +1,26 @@
package org.fao.geonet.api.processing;

import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.jmx.export.naming.SelfNaming;

import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;

@ManagedResource
public class EmptySlotBatch implements SelfNaming {

private ObjectName objectName;

public EmptySlotBatch(String name, int i) {
try {
objectName = new ObjectName(String.format("geonetwork:name=' + name + ',idx=empty-slot-%d", i));
} catch (MalformedObjectNameException e) {
e.printStackTrace();
}
}

@Override
public ObjectName getObjectName() throws MalformedObjectNameException {
return objectName;
}
}

0 comments on commit 7213393

Please sign in to comment.
You can’t perform that action at this time.