Skip to content
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 / Add support for new validator #2380

Closed
fxprunayre opened this issue Dec 4, 2017 · 0 comments
Closed

INSPIRE / Add support for new validator #2380

fxprunayre opened this issue Dec 4, 2017 · 0 comments
Assignees
Milestone

Comments

@fxprunayre
Copy link
Member

ETF validation

Related to the validation, I have been checking the new API and here are the steps that require to be perform using curl.

  1. Retrieve the test suites to run from http://localhost/etf-webapp/v2/ExecutableTestSuites.json

  2. Upload the file to ETF, using endpoint http://localhost/etf-webapp/v2/TestObjects?action=upload

This endpoint returns a response like:

{
  "testObject": {
    "id": "EID1dc25ba6-c748-4026-a12c-2c1f4bf9b3a8"
  },
  "files": [
    {
      "name": "7374577d-156b-4224-818f-ea91bfef217f.xml",
      "size": "16536",
      "type": "application/xml"
    }
  ]
}
  1. Execute the tests, from ids returned in 1) and 2)  and do a POST to http://localhost/etf-webapp/v2/TestRuns with JSON containing information about the tests and metadata to validate:
{
  "label": "Test run on 10:54 - 02.11.2017 with test suite Conformance class: INSPIRE Profile based on EN ISO 19115 and EN ISO 19119 and one more test suite",
  "executableTestSuiteIds": [
    "EIDec7323d5-d8f0-4cfe-b23a-b826df86d58c",
    "EID9a31ecfc-6673-43c0-9a31-b4595fb53a98"
  ],
  "arguments": {
    "files_to_test": ".*",
    "tests_to_execute": ".*"
  },
  "testObject": {
    "id": "EID1915be77-020e-4da0-bb5f-2887696064c1"
  }
}

This creates a background task returning a json with the task id

  1. Monitor previous task id (in the example EIDc97b7b8c-d306-454a-8729-0dc0ae354332) returned in previous request

http://localhost/etf-webapp/v2/TestRuns/EIDc97b7b8c-d306-454a-8729-0dc0ae354332/progress

  1. Once the monitor check verifies is finished, the results web page can be obtained from: 

http://localhost/etf-webapp/v2/TestRuns/EIDc97b7b8c-d306-454a-8729-0dc0ae354332.html

It's the html page as displayed in the online app

How to implement in GeoNetwork

The easiest way would be to create a backend service that manages all the interaction and returns the url of the result to the client side, the problem with this approach is that the ETF API is asynchronous so the backend service should run the task and monitor it until finished. Usually is quite fast, but I guess depends on how busy is the ETF server.

A better approach would be similar, but having in the backend work asynch also, so the client side checks for finishing task:

EtfValidatorApi
    /validate/metadatauuid  --> Does steps 1, 2 and 3 and returns ETF task id
    /check/taskid --> This enpoint manages about step 4, if not complete returns empty value. If complete returns link to results html

The web client executes /validate/metadatauuid and gets the task id after that check /check/taskid until it's complete and opens the results html.

Would be good to move all validation method in DataManager to a new one. Create a bean configuration to define which validators are available (eg. GeoNetworkValidator, ETFValidator, ...) and the validation API can define which validator to use.

Work to do:

  • Allow to configure the url for ETF in the settings
  • Develop ETF Validation API in GeoNetwork
  • Develop ETF http client
  • Add client-side javascript

Note

The validator should not have dependencies to GeoNetwork in order to be easily reused in the dashboard project if feasible.

@fxprunayre fxprunayre added this to the 3.4.1 milestone Dec 4, 2017
@fxprunayre fxprunayre assigned josegar74 and jonescc and unassigned jonescc Dec 4, 2017
@Delawen Delawen modified the milestones: 3.4.1, 3.4.2 Dec 15, 2017
@josegar74 josegar74 modified the milestones: 3.4.2, 3.4.3 May 4, 2018
@pvgenuchten pvgenuchten added this to To do in INSPIRE support Jun 21, 2018
@fxprunayre fxprunayre moved this from To do to Done in INSPIRE support Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants