<commit_before># dw-media
Dockerized version of the mediaserver, with an nginx <br>
2 keys in have to be added to get the SSL-working ./ , key.pem and combined.pem <br>
put the keys; cert.key and cert.pem in ./nginx-certs/ <br>

## 3 files needs to be added, located inhouse on 'buffalo' right now
There are get-scripts available to fetch those files from 'buffalo' <br>
The three files are the following.

1. the artifact , xxx.ear-file
2. the database-dump, yyyy.sql-file
3. the media-files, zzzz.tgz


# API

## @POST
posting a base64-encoded string ( 2x2 pixels ), mind the URI ( http://localhost:28080/MediaServerResteasy/media ) <br>

### request 
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d  '{"owner":"dina","access":"public","licenseType":"CC BY","legend":"this is chess","fileName":"chess.png","fileDataBase64":"iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAQMAAABIeJ9nAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AQZCR0TdgIZugAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAMSURBVAjXY3BgaAAAAUQAwetZAwkAAAAASUVORK5CYII="}' http://localhost:28080/MediaServerResteasy/media  <br>

### response ( the uuid is random)

{"uuid":"f3959214-fcb2-451a-a0cb-dcd8457d2c83","owner":"dina","visibility":"public","filename":"chess.png","mimetype":"image/png","mediaURL":"127.0.0.1/MediaServerResteasy/media/f3959214-fcb2-451a-a0cb-dcd8457d2c83?format=image/png","taggar":null,"alt":null,"hash":"0782dd0a2fef7bf7e08bd68978e63e27","description":[{"uuid":null,"legend":"this is chess","lang":"sv_SE","comment":""}],"lico":[{"id":1,"abbrev":"CC BY","version":"3.0","issuer":"http://creativecommons.org/licenses/by/","uri":"Attribution","name":"Creative Commons"}],"isExported":false,"exif":"N/A"} <br>

## @GET

## @PUT

## @DELETE

<commit_msg>version 0.1 of API-doc, @post and @get<commit_after># dw-media
Dockerized version of the mediaserver, with an nginx <br>
2 keys in have to be added to get the SSL-working ./ , key.pem and combined.pem <br>
put the keys; cert.key and cert.pem in ./nginx-certs/ <br>

## 3 files needs to be added, located inhouse on 'buffalo' right now
There are get-scripts available to fetch those files from 'buffalo' <br>
The three files are the following.

1. the artifact , xxx.ear-file
2. the database-dump, yyyy.sql-file
3. the media-files, zzzz.tgz


# API

## @POST
posting a base64-encoded string ( 2x2 pixels ), mind the URI ( http://localhost:28080/MediaServerResteasy/media ) <br>

### request 
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d  '{"owner":"dina","access":"public","licenseType":"CC BY","legend":"this is chess","fileName":"chess.png","fileDataBase64":"iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAQMAAABIeJ9nAAAABlBMVEUAAAD///+l2Z/dAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AQZCR0TdgIZugAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAMSURBVAjXY3BgaAAAAUQAwetZAwkAAAAASUVORK5CYII="}' http://localhost:28080/MediaServerResteasy/media  <br>

### response ( the uuid is random)

{"uuid":"f3959214-fcb2-451a-a0cb-dcd8457d2c83","owner":"dina","visibility":"public","filename":"chess.png","mimetype":"image/png","mediaURL":"127.0.0.1/MediaServerResteasy/media/f3959214-fcb2-451a-a0cb-dcd8457d2c83?format=image/png","taggar":null,"alt":null,"hash":"0782dd0a2fef7bf7e08bd68978e63e27","description":[{"uuid":null,"legend":"this is chess","lang":"sv_SE","comment":""}],"lico":[{"id":1,"abbrev":"CC BY","version":"3.0","issuer":"http://creativecommons.org/licenses/by/","uri":"Attribution","name":"Creative Commons"}],"isExported":false,"exif":"N/A"} <br>

## @GET

### fetch the image ( -> ?format=image/png )
http://localhost:28080/MediaServerResteasy/media/f3959214-fcb2-451a-a0cb-dcd8457d2c83?format=image/png <br>

### fetch the metadata ( -> ?content=metadata)
http://localhost:28080/MediaServerResteasy/media/f3959214-fcb2-451a-a0cb-dcd8457d2c83?content=metadata <br>

## @PUT

## @DELETE


{'fraction_non_alphanumeric': 0.1738575440388052, 'fraction_numerical': 0.06382435537401072, 'mean_word_length': 6.867469879518072, 'pattern_counts': {'":': 58, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4766053', 'n_tokens_mistral': 1687, 'n_tokens_neox': 1512, 'n_words': 260}