Skip to content

Commit

Permalink
feat: ajout parametres du PLUGIN dgpr dans la liste des arguments dis…
Browse files Browse the repository at this point in the history
…ponible; ajout du schema de validation posgris
  • Loading branch information
cboucheIGN committed Dec 1, 2024
1 parent 9ca0c6d commit f2f215b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@ S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_BUCKET=dev-ign-mut-validtri
S3_REGION=sbg

### validator-worker/validator-cli postgis
DB_URL=jdbc:postgresql:${PGDATABASE}
DB_USER=${POSTGRES_USER}
DB_PASSWORD=${POSTGRES_PASSWORD}
# must stay empty
DB_SCHEMA=
15 changes: 15 additions & 0 deletions docs/specs/schema/validator-arguments.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@
"UTF-8",
"LATIN1"
]
},
"dgpr-tolerance": {
"type": "integer",
"description": "tolerance expresed in meter",
"example": 10
},
"dgpr-simplify": {
"type": "integer",
"description": "geometry simplification before postgis validation expresed in meters",
"example": 2
},
"dgpr-safe-simplify": {
"type": "boolean",
"description": "geometry simplification method",
"example": true
}
},
"additionalProperties": false
Expand Down
29 changes: 29 additions & 0 deletions src/Controller/Api/ValidationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,35 @@ public function getValidation($uid)
return new JsonResponse($this->serializer->toArray($validation), Response::HTTP_OK);
}

/**
* @Route(
* "/{uid}/console",
* name="validator_api_read_console",
* methods={"GET"}
* )
*/
public function readConsole($uid)
{
$validation = $this->repository->findOneByUid($uid);
if (!$validation) {
throw new ApiException("No record found for uid=$uid", Response::HTTP_NOT_FOUND);
}

if ($validation->getStatus() == Validation::STATUS_ARCHIVED) {
throw new ApiException("Validation has been archived", Response::HTTP_FORBIDDEN);
}

$validationDirectory = $this->storage->getDirectory($validation) ;
$filepath = $validationDirectory . '/validator-debug.log';

$content = file_get_contents($filepath, true);

return new Response(
$content,
Response::HTTP_CREATED
);
}


/**
* @Route(
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/ValidatorCLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public function process(Validation $validation)

/* prepare validator-cli.jar command */
$env = $_ENV;
$env['DB_SCHEMA'] = "validation" . $validation->getUid();
$env['GMLAS_CONFIG'] = $this->gmlasConfigPath;


$sourceDataDir = $validationDirectory.'/'.$validation->getDatasetName();
$cmd = ['java'];
Expand Down

0 comments on commit f2f215b

Please sign in to comment.