Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 3d8a24f

Browse files
author
sowerstl
committed
Update metadata Docs with New/Previous and Container info; (DOECODE-555)
1 parent c848a6b commit 3d8a24f

File tree

2 files changed

+67
-11
lines changed

2 files changed

+67
-11
lines changed

src/main/java/gov/osti/services/Metadata.md

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ JSON is the default output format. Authenticated user must be either the owner
7575
Requires authenticated login. Retrieve all metadata projects owned by the current logged-in user account in JSON format. Administrative accounts
7676
will see ALL PROJECTS, while Site Administrator users will see all projects from their SITE.
7777
78-
If pagination is desired, specify the starting row number as the query parameter "start", and the desired number of rows as "rows". If rows is
79-
specified, it is capped at 100.
80-
8178
> Request:
8279
> ```html
8380
> GET /doecodeapi/services/metadata/projects
@@ -93,6 +90,11 @@ specified, it is capped at 100.
9390
> { "records":[{"code_id":234,"software_title":"Test Project", ...}, ... ] }
9491
> ```
9592
93+
<p id='metadata-project-pagination'>
94+
If pagination is desired, specify the starting row number as the query parameter "start", and the desired number of rows as "rows". If rows is
95+
specified, it is capped at 100.
96+
</p>
97+
9698
### projects pending
9799
98100
`GET /doecodeapi/services/metadata/projects/pending`
@@ -172,10 +174,22 @@ Send JSON metadata to be persisted in the back-end. This service persists the d
172174
> ```html
173175
> POST /doecodeapi/services/metadata/save
174176
> Content-Type: application/json
177+
> Authorization: Basic user-api-key
175178
> ```
176179
> ```json
177180
> { "software_title" : "Sample Data", ... }
178181
> ```
182+
> > Request with Upload:
183+
> ```html
184+
> POST /doecodeapi/services/metadata/save
185+
> Content-Type: multipart/form-data
186+
> Authorization: Basic user-api-key
187+
> ```
188+
> ```json
189+
> -F metadata={ "code_id":123, "software_title" : "Sample Data", ... }
190+
191+
192+
> ```
179193
> Response:
180194
> ```html
181195
> HTTP/1.1 200 OK
@@ -193,6 +207,10 @@ Send JSON metadata to be persisted in the back-end. This service persists the d
193207
> { "status" : 500, "errors" : ["Error saving record for \"Sample Data\": database failure." ] }
194208
> ```
195209
210+
<p id='metadata-save-upload-via-api'>
211+
*When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
212+
</p>
213+
196214
### submit
197215
198216
`POST /doecodeapi/services/metadata/submit`
@@ -209,6 +227,17 @@ this operation will be returned.
209227
> ```json
210228
> { "code_id":123, "software_title":"Sample Data", ... }
211229
> ```
230+
> > Request with Upload:
231+
> ```html
232+
> POST /doecodeapi/services/metadata/submit
233+
> Content-Type: multipart/form-data
234+
> Authorization: Basic user-api-key
235+
> ```
236+
> ```json
237+
> -F metadata={ "code_id":123, "software_title" : "Sample Data", ... }
238+
239+
240+
> ```
212241
> Response:
213242
> ```html
214243
> HTTP/1.1 200 OK
@@ -244,7 +273,7 @@ Validation rules are:
244273
* software type is required:
245274
* "S" (Scientific)
246275
* "B" (Business), also requires at least one sponsoring organization
247-
* If project type is Closed Source, OSTI Hosted ("CO"), a file upload is required. *When submitting a file via the API, it must be provided as a "file" multipart form data parameter*
276+
* If project type is Closed Source, OSTI Hosted ("CO"), a file upload is required. *When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
248277
249278
250279
@@ -264,6 +293,17 @@ be announced to DOE. Workflow status remains *Submitted* for this operation. Ad
264293
> ```json
265294
> { "code_id":123, "software_title":"Sample Data", ... }
266295
> ```
296+
> > Request with Upload:
297+
> ```html
298+
> POST /doecodeapi/services/metadata/announce
299+
> Content-Type: multipart/form-data
300+
> Authorization: Basic user-api-key
301+
> ```
302+
> ```json
303+
> -F metadata={ "code_id":123, "software_title" : "Sample Data", ... }
304+
305+
306+
> ```
267307
> Response:
268308
> ```html
269309
> HTTP/1.1 200 OK
@@ -281,9 +321,8 @@ be announced to DOE. Workflow status remains *Submitted* for this operation. Ad
281321
> { "status" : 400, "errors":[ "Title is required", "Developers are required", "Provided email address is invalid" ] }
282322
> ```
283323
284-
<p id='metadata-services-announce'>&nbsp;</p>
324+
<p id='metadata-services-announce'>All above Submitted validations apply, plus:</p>
285325
286-
* All above Submitted validations apply
287326
* A release date is required
288327
* At least one sponsoring organization is required
289328
* each organization must have a name
@@ -294,7 +333,7 @@ be announced to DOE. Workflow status remains *Submitted* for this operation. Ad
294333
* email must be valid
295334
* phone number must be valid
296335
* organization name is required
297-
* If project type is not Open Source ("OS"), a file upload is required. *When submitting a file via the API, it must be provided as a "file" multipart form data parameter*
336+
* If project type is not Open Source ("OS"), a file upload is required. *When uploading a file or container via the API, it must be provided as a "file" or "container" multipart form parameter. File uploads should be a compressed file of type: .zip, .tar, .tar.gz, or .tar.bz2. Container uploads should be Docker or Singularity image files of type: .tar, or .simg*
298337
299338
300339
@@ -328,6 +367,11 @@ code ID value of the Submitted record in order to approve access. Approved reco
328367
> { "status" : 400, "errors":[ "Metadata is not in the Submitted workflow state." ] }
329368
> ```
330369
370+
371+
<p id='metadata-services-approve-newprev'>
372+
Upon approval, any DOI related identifiers of the type "IsNewVersionOf" or "IsPreviousVersionOf" will be matched, by DOI, to existing DOE CODE projects. Those projects will automatically be associated with the Approved project via new Related Identifier information.
373+
</p>
374+
331375
DOE CODE Metadata
332376
===============
333377
A DOE CODE metadata Object is expressed as a JSON entity. Each of the fields making up the entity are defined below, and an example record is provided in JSON format.

src/main/webapp/css/doecodeapi.css

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,29 @@ table{
1717
margin-top:-130px;
1818
}
1919

20+
#metadata-project-pagination{
21+
margin-top:-170px;
22+
}
23+
24+
#metadata-save-upload-via-api{
25+
margin-top:-515px;
26+
}
27+
2028
#metadata-validation-rules-are{
21-
margin-top:-350px;
29+
margin-top:-480px;
2230
}
2331
#metadata-validation-rules-are + ul{
24-
margin-top:-320px;
32+
margin-top:-450px;
2533
}
2634

2735
#metadata-services-announce {
28-
margin-top: -350px;
36+
margin-top: -480px;
2937
}
3038

3139
#metadata-services-announce + ul{
32-
margin-top: -325px;
40+
margin-top: -450px;
41+
}
42+
43+
#metadata-services-approve-newprev{
44+
margin-top:-275px;
3345
}

0 commit comments

Comments
 (0)