Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

 

Request URI: /path/to/some/resource/fcr:versions

Methods: GET, POST, PATCH

 


Status
titleGET
 
Get a list of the available versions of an object

Request Headers:

ACCEPT  application/ld+json, application/n-triples, application/rdf+xml, application/x-turtle, application/xhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtle

Example:

Code Block
curl -H "Accept: text/turtle" http://localhost:8080/rest/path/to/resource/fcr:versions

Response:

Code Block
Status: 200 OK

Headers:
Content-Type: text/turtle

Body:
<http://localhost:8080/rest/path/to/resource> <http://fedora.info/definitions/v4/repository#hasVersion>fedora:hasVersion <http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion/jcr:frozenNode> .
path/to/resource/fcr:versions/87a0a8c317f1e749515d33-cb73-4fd7-9d1d-c715eb6947e0> .
<http://localhost:8080/rest/jcr:system/jcr:versionStorage/25/7c/4f/257c4fc463d7db126cf4c9dfe34a6a7b344c572b/jcr:rootVersion/jcr:frozenNode> <http://fedora.info/definitions/v4/repository#primaryType> "nt:frozenNodepath/to/resource/fcr:versions/87a0a8c317f1e749515d33-cb73-4fd7-9d1d-c715eb6947e0> fedora:hasVersionLabel "v0"^^<http://www.w3.org/2001/XMLSchema#string> ;
        <http://fedora.info/definitions/v4/repository#frozenPrimaryType> "nt:folderfedora:created "2014-12-03T23:55:38.47Z"^^<http://www.w3.org/2001/XMLSchema#string>XMLSchema#dateTime> ;
    .

<http://fedora.info/definitions/v4/repository#frozenMixinTypes> "fedora:resource"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:object"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenUuid> "19cd1832-a5d7-4965-9564-579b1684a003localhost:8080/rest/path/to/resource> fedora:hasVersion <http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e7dae533ec-b1b6-4da1-8bb9-f1964e253572> .
<http://localhost:8080/rest/path/to/resource/fcr:versions/87a0a8c317f1e7dae533ec-b1b6-4da1-8bb9-f1964e253572> fedora:hasVersionLabel "v1"^^<http://www.w3.org/2001/XMLSchema#string> ;
      <http://fedora.info/definitions/v4/repository#uuid> "87a0a8c317f1e702f0967e-c1bd-49cf-a78f-7b132fbabbb3  fedora:created "2014-12-03T23:56:12.863Z"^^<http://www.w3.org/2001/XMLSchema#string>XMLSchema#dateTime> .

Status:

Status
subtletrue
colourGreen
title200
OK

Status
subtletrue
colourRed
title404
Not Found: This resource is not versioned or this resource is not exist.

Response: The requested resource is not available.

 



Status
titleGET
Get a previous version of an object

Request Headers:

ACCEPT  application/ld+json, application/n-triples, application/rdf+xml, application/x-turtle, application/xhtml+xml, application/xml, text/html, text/n3, text/plain, text/rdf+n3, text/turtle

Example:

Code Block
curl http://localhost:8080/rest/resource/fcr:versions/87a0a8c317f1e72c658170-624d-40f9-96cb-21ede3392155<version-label>

Response:

Code Block
Status: 200 OK

Response Headers:
ETag: "39f0d8a01a066771e56f70be892a39a7b505843c"
Last-Modified: Tue, 20 May 2014 19:29:10 GMT
Content-Type: text/turtle

Body:

<http://localhost:8080/rest/resource/fcr:versions/87a0a8c317f1e72c658170-624d-40f9-96cb-21ede3392155> <http://fedora.info/definitions/v4/repository#primaryType> "nt:frozenNode"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenPrimaryType> "nt:folder"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#created> "2014-05-20T19:29:00.192Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenMixinTypes> "fedora:resource"^^<http://www.w3.org/2001/XMLSchema#string> , "mix:versionable"^^<http://www.w3.org/2001/XMLSchema#string> , "fedora:object"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#lastModified> "2014-05-20T19:29:10.555Z"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#frozenUuid> "fed529c6-2121-4b1d-83fc-cc4274563612"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#lastModifiedBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#uuid> "87a0a8c317f1e72c658170-624d-40f9-96cb-21ede3392155"^^<http://www.w3.org/2001/XMLSchema#string> ;
    <http://fedora.info/definitions/v4/repository#createdBy> "bypassAdmin"^^<http://www.w3.org/2001/XMLSchema#string> ;
    a <http://www.jcp.org/jcr/nt/1.0frozenNode> , <http://www.jcp.org/jcr/nt/1.0base> , <http://www.jcp.org/jcr/mix/1.0referenceable> .

Status:

Status
subtletrue
colourGreen
title200
OK

Status
subtletrue
colourRed
title404
Not Found: if the version or the resource does not exist

Response: The requested resource is not available.

 



Status
colourBlue
titlePOST
Create a new version of an object

Request Headers

SLUG (Required) A suggested name for the new child resource, which the repository may ignore.

Example:

Code Block
curl -X POST -H "Slug: newVersionName" http://localhost:8080/rest/path/to/resource/fcr:versions

Response:

Code Block
Status: 204 No Content

 

Status:

Status
subtletrue
colourGreen
title204
No Content: if a new version is created successfully

Status
subtletrue
colourRed
title404
Not Found: if the resource does not exist

Status
subtletrue
colourRed
title409
Conflict: if the version label is already in use for another version of this rexource

Response: The requested resource is not available.




Anchor
revert
revert
Status
colourBlue
titlePATCH
Revert to a previous version of an object

Example:

Code Block
curl -X PATCH http://localhost:8080/rest/path/to/resource/fcr:versions/existingVersionName
Tip
For previous versions for which explicit names were not provided, you may use the UUID property which you can find by parsing the response from the listing of available versions.

 

Response:

Code Block
Status: 204 No Content

Status:

Status
subtletrue
colourGreen
title204
No Content: if the version is reverted successfully

Status
subtletrue
colourRed
title404
Not Found: if the version does not exist

Response: The requested resource is not available.


 

Anchor
delete
delete
Request URI: /path/to/some/resource/fcr:versions/versionName

Methods: DELETE

Status
colourRed
titleDELETE
Remove a previous version of an object

Example:

Code Block
curl -X DELETE http://localhost:8080/rest/path/to/resource/fcr:versions/versionName


Response:

Code Block
Status: 204 No Content
Note

Trying to delete the current version of a resource will result in an error.  To revert to an old version of a resource, first revert to the old version using the PATCH method, and then delete the newer version.

Status:

Status
subtletrue
colourGreen
title204
No Content: if the version is reverted successfully

Status
subtletrue
colourRed
title400
Bad Request: if trying to delete the most recent version

Response: Cannot remove current version

Status
subtletrue
colourRed
title404
Not Found: if the version does not exist

Response: The requested resource is not available.