software-competence-center-hagenberg / NodeDoc

https://nodedoc-demo.scch.at/
MIT License
7 stars 1 forks source link

CI Intergration #3

Open Kantiran91 opened 3 months ago

Kantiran91 commented 3 months ago

It is planed that the html generation can be done with a ci?

bdorninger commented 3 months ago

This should already be possible in the current version. Ther should be an API: @stefanschoeberl-scch will provide you with the details

stefanschoeberl-scch commented 3 months ago

You can integrate it via the same API, which is used by the frontend and it can be used like this (using curl as an example):

Upload a NodeSet from a local file:

curl -X POST <host>/nodeset/ -F nodeset=@<path/to/local/file>

# for example like this
curl -X POST http://localhost:5010/nodeset/ -F nodeset=@nodeset.xml

The <nodeset path>, which is used in the following scripts, is derived from the uploaded NodeSet in the following way:

<uri>/versions/<version>/<publication date>

# for example
www.euromap.org/euromap83/versions/1.01/2019-01-28

Generate the HTML documentation for a NodeSet on the server:

curl -X POST <host>/nodeset/generate-for-existing-nodeset/default-html-template/ -d relativePath=<nodeset path>/nodeset.xml

# for example like this:
curl -X POST http://localhost:5010/nodeset/generate-for-existing-nodeset/default-html-template/ -d relativePath=www.euromap.org/euromap83/versions/1.01/2019-01-28/nodeset.xml

Upload and Generation can also be combined using this endpoint:

curl -X POST <host>/nodeset/generate/default-html-template/ -F nodeset=@<path/to/local/file>

# for example like this
curl -X POST http://localhost:5010/nodeset/generate/default-html-template/ -F nodeset=@nodeset.xml

Download the HTML documentation from the server:

curl <host>/documentation/<nodeset path>/nodeset.html

# for example like this
curl http://localhost:5010/documentation/www.euromap.org/euromap83/versions/1.01/2019-01-28/nodeset.html