Table of Contents |
---|
WORK IN PROGRESS - Kevin Ford has this, it's just taking some time. |
---|
Versioning in Fedora is composed of three specific types of resources - a versionable resource, a versions container, and the actual versioned resources - and a variety of strategies to interact with these resources. Each type of resource and the HTTP methods that can be used on them are discussed below.
Excerpt | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Working with a versionable resourceA versionable resource is a type of (regular) resource - see RESTful HTTP API - Containers - but it is created by invoking a specific Link header and the GET method has an additional interaction model beyond the GET scenarios when interacting with non-versioned resources. All of the headers and methods for regular resources are applicable to a versionable resource. A resource can be declared versionable when it is created originally. This is achieved by including the following link header to your PUT or POST commands when creating the resource. When a versionable resource is created, the versions container will be created at the same time.
Request URI: /path/to/resource Methods: GET, PUT, POST
Request Headers: ACCEPT-datetime An RFC-1123 Date. (E.g. "Wed, 30 May 2018 23:02:44 GMT") Example:
Response:
Status:
Examples:
|
Excerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Working with a versions containerRequest URI: /path/to/resource/fcr:versions Methods: GET, POST, DELETE
Request Headers: ACCEPT application/ld+json, application/link-format, 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:
Response:
Status:
Versions can by created in one of two ways. If the Memento-Datetime header is omitted, the current time will be used by default and the current state of the versionable resource will be preserved. Any specified body will be ignored. If, however, the Memento-Datetime header is included, the versioned resource will be stored at this time marker and the request body will be stored as the versioned resource. Request Headers MEMENTO-DATETIME (Optional) An RFC-1123 Date. (E.g. "Wed, 30 May 2018 23:02:44 GMT") Example 1 (Create a new version resource 'now.' Its state is that of the current versionable resource.):
Response:
Status:
Example 2 (Create a new version resource at the supplied time marker. Its state is supplied as the request body.):
Response:
Status:
Example:
Response:
Status:
|
Excerpt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Working with a versioned resourceRequest URI: /path/to/resource/fcr:versions/<timestamp> Methods: GET, DELETE
Request Headers: ACCEPT application/ld+json, application/link-format, 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:
Response:
Status:
Versions can by created in one of two ways. If the Memento-Datetime header is omitted, the current time will be used by default and the current state of the versionable resource will be preserved. Any specified body will be ignored. If, however, the Memento-Datetime header is included, the versioned resource will be stored at this time marker and the request body will be stored as the versioned resource. Request Headers MEMENTO-DATETIME (Optional) An RFC-1123 Date. (E.g. "Wed, 30 May 2018 23:02:44 GMT") Example 1 (Create a new version resource 'now.' Its state is that of the current versionable resource.):
Response:
Status:
Example 2 (Create a new version resource at the supplied time marker. Its state is supplied as the request body.):
Response:
Status:
Request URI: /path/to/some/resource/fcr:versions/<timestamp> Methods: DELETE
Example:
Response:
Status:
Response: Cannot remove current version
Response: The requested resource is not available. |
...