r-geoflow / geoflow

Tools to Orchestrate Geospatial (Meta)Data Management Workflows and Manage FAIR Services
https://github.com/r-geoflow/geoflow/wiki
Other
41 stars 14 forks source link

Breaklines removed during upload #278

Closed kikislater closed 2 years ago

kikislater commented 2 years ago

Discussed here : https://github.com/eblondel/geoflow/discussions/277

But finally tested with cURL and GeoNetwork API and breaklines are kept !

Clean session

rm -f /tmp/cookie;

Authentification

curl -s -c /tmp/cookie -o /dev/null -X GET -H "Accept: application/json" "$CATALOG/srv/api/me"; TOKEN=grep XSRF-TOKEN /tmp/cookie | cut -f 7;

Test

curl -X GET -H "Accept: application/json" -H "X-XSRF-TOKEN: $TOKEN" --user $CATALOGUSER:$CATALOGPASS -b /tmp/cookie "$CATALOG/srv/api/me"

Send XML

curl -X POST -F "file=@metadata_test.xml" -H "Content-Type: multipart/form-data" -H "Accept: application/json" -H "X-XSRF-TOKEN: $TOKEN" -b /tmp/cookie --user $CATALOGUSER:$CATALOGPASS $CATALOG/srv/api/records -v



5. Go to GeoNetwork and watch breaklines kept
eblondel commented 2 years ago

What is the version of GN that you used?

eblondel commented 2 years ago

Ok i've run a test workflow, and indeed breaklines are removed. ISO 19115/19139 is properly generated with geometa action, but when passed to payload with geonapi, we lose the breaklines. I will create a ticket there

kikislater commented 2 years ago

Tested in GeoNetwork 3.12.3.0 and 4.2.0

eblondel commented 2 years ago

Well after investigation, there seems to be no issue in geonapi, but instead readISO19139 from geometa that removes breaklines from texts....

eblondel commented 2 years ago

@kikislater i've fixed https://github.com/eblondel/geometa/issues/193 which was responsible of this issue. In geoflow, each ISO 19139 metadata produced and stored in the metadata directory is then read back in actions to publish metadata (with geonapi or ows4R) with the geometa readISO19139 function. The readISO1139 function was removing the line breaks. Please re-install geometa from Github and next the issue should have disappeared. let me know

kikislater commented 2 years ago

Thanks it works ! @juldebar