-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INSPIRE JRC validation #2444
INSPIRE JRC validation #2444
Conversation
@fxprunayre and @josegar74 please check if it's ok. |
@@ -772,6 +772,8 @@ | |||
"system/inspire/atomDisabled": "Disabled", | |||
"system/inspire/enable-help": "Enable INSPIRE CSW (ie. language support and INSPIRE GetCapabilities document) and INSPIRE indexing. INSPIRE themes thesaurus MUST be installed to properly index themes and annexes. Note: It does not enable the INSPIRE editor view mode (see iso19139/layout/config-editor.xml).", | |||
"system/inspire/enableSearchPanel-help": "Enable search panel (Ext search only).", | |||
"system/inspire/remotevalidation/url": "INSPIRE remote validation URL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add also a placeholder value for the field with the url of actual service, for now is in a sandbox, but can be updated later when the service is "official". In any case the users can setup the service locally also.
This should help the users with the url format. Placeholder: http://inspire-sandbox.jrc.ec.europa.eu/etf-webapp/
try { | ||
Element md = (Element) ApiUtils.getUserSession(session).getProperty(Geonet.Session.METADATA_EDITING + id); | ||
if (md == null) { | ||
throw new ResourceNotFoundException(String.format("Requested metadata with id '%s' is not available in current session. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check to move the message to message bundle files. Not sure if done in other services, but should be good to use them to provide localised error messages.
@@ -0,0 +1,237 @@ | |||
package org.fao.geonet.api.records; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add file header
@@ -0,0 +1,494 @@ | |||
package org.fao.geonet.api.records.editing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add file header.
Also a unit test for this class can be useful.
@@ -0,0 +1,44 @@ | |||
<span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the indentation of the file, afaik we use 2 spaces in html files.
+ "This activates an asyncronous process, this method does not return any report. " | ||
+ "This method returns an id to be used to get the report.", | ||
nickname = "submitValidate") | ||
@RequestMapping(value = "/{metadataUuid}/validate/submit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to have the API like
PUT /srv/api/0.1/records/{metadataUuid}/validate/internal (current one XSD + schematron)
PUT /srv/api/0.1/records/{metadataUuid}/validate/inspire
?
So we can add new validator in the long term.
gnPopup.createModal({ | ||
class: 'disclaimer-popup', | ||
title: $translate.instant('inspirePopupReportTitle'), | ||
content: '<div>' + $translate.instant('inspirePopupReportText') + status + '</br></br>' + '<a href=\''+url+'\' target=\'_blank\'>'+$translate.instant('inspirePopupReportLink')+'</a></div>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should run
cd web-ui
mvn clean install -Pjslint
to clean up JS formatting.
LGTM, maybe one change to apply to the API ? In the long term, we should maybe rework the validation to make them more configurable in the DataManager but we should wait for Maria's refactor first. |
This is related to #2380 |
Thanks @josegar74 @fxprunayre , fixed 👍 |
+ "This activates an asyncronous process, this method does not return any report. " | ||
+ "This method returns an id to be used to get the report.", | ||
nickname = "submitValidate") | ||
@RequestMapping(value = "/{metadataUuid}/validate/inspire/submit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Antonio for the API layout change. I would even remove /submit and /check as PUT will mean start and GET check ? What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a rebase too. It would be good to merge this next week.
@fxprunayre, why it's needed a rebase? |
73eaa57
to
8fe5c64
Compare
I did a rebase (juan told me that there where present conficts on the reviewer interface) and cleaned the commit history |
Testing with http://inspire-sandbox.jrc.ec.europa.eu/etf-webapp, I've quite often 4 times for 5 calls A null test id is returned. Do you have an idea why ? Did you test with local docker install of ETF ? It's also quite slow around 2min for a successfull or not call. |
I'll investigate how is managed this error scenario I suggest you to use the docker image. The official etf-webapp is slower and this time I suspect not working |
943d211
to
6ff94f8
Compare
@fxprunayre , I managed the case where etf returns null but with no HTTP error code. Please let me know if it works now. |
@fxprunayre if you still think this is ok, I will merge. You were the one experiencing weird behaviour. |
@@ -421,6 +421,7 @@ | |||
isXLinkEnabled: 'system.xlinkResolver.enable', | |||
isSelfRegisterEnabled: 'system.userSelfRegistration.enable', | |||
isFeedbackEnabled: 'system.userFeedback.enable', | |||
isInspireEnabled: 'system.inspireValidation.enable', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in a comment section, but the value is not fine, should be the same as in line 440: isInspireEnabled: 'system.inspire.enable',
@PascalLike something to check also would be the naming of the directive/html template as currently seem handling both the internal and INSPIRE validation, but the naming of the files/directive refers only to INSPIRE and it's confusing users. Apologies as I didn't notice in the review about this. |
@josegar74 I fixed this here #2507 |
This pull request introduces an extra validation functionality for ISO19139 metadata, based on ETF web application.
The validation is designed like a remote validation service, by using the API on a configured ETF web application. This ETF endpoint must be configured in settings:
A check on the checkbox and a valid endpoint are both required.
The interaction with this endpoint works in two steps, implemented in two new methods in GeoNetwork API:
The first method is used for the submission of a metadata record to the remote service for the validation.
The validation is not in real time, so the second method is needed to check asynchronously the progress.
When the INSPIRE validation is set in GeoNetwork settings, the validation button change in a dropdown with local validation and INSPIRE one:
When an INSPIRE validation is completed this panel is shown:
With the exit status of the validation and a link to a report with a detailed report (on the ETF web application):
This pull request is made with the intention to improve the integration of INSPIRE directives in GeoNetwork.