...
Content | Location |
---|---|
search objects | GET/objects |
nextPid | POST /objects/nextPid |
Object | GET/DELETE/POST/PUT /objects/{pid} |
Object Export | GET /objects/{pid}\export |
Object Versions | GET /objects/{pid}\versions |
Object XML | GET /objects/{pid}\objectXML |
Datastreams | GET/objects/{pid}/datastreams |
Specific datastream | GET/DELETE/PUT/POST /objects/{pid}/datastreams/{dsID} |
content of Datastream | GET/objects/{pid}/datastreams/{dsID}/content |
List Methods on Object | GET/objects/{pid}/methods |
list methods for sdef on Object | GET/objects/{pid}/methods/{sdef} |
get-invoke method | GET/objects/{pid}/methods/{sdef}/{method} |
Repository Resources
GET /objects - search objects
POST /objects/nextPid - generate pid
Object Resources
GET /objects/{pid} - get object profile
...
GET /objects/\{pid}?\[asOfDateTime\]\[format\]
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
asOfDateTime | yyyy-MM-ddTHH:mm:ss.SSSZ | The object, as it looked at the specified time | Now | 2009-01-01T03:00:00:000Z |
format | one of text/xml, text/html, html, xml | The format of the return value | text/html | text/xml |
...
Examples:
Get the object profile of the object as it looked at the specified date in the xml format
GET /objects/{pid}?asOfDateTime=2009-01-01T03:00:00:000Z&format=text/xml
Example of html format
TODO
Example of xml format
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<objectProfile pid="demo:testObject"> <objLabel>label</objLabel> <objOwnerId>fedoraAdmin</objOwnerId> <objModels> <model>info:fedora/demo:ContentModel</model> </objModels> <objCreateDate>2008-09-29T03:49:450Z</objCreateDate> <objLastModDate>2014-09-19T01:18:330Z</objLastModDate> <objDissIndexViewURL>http://localhost:8080/fedora/get/demo:testObject/fedora-system:3/viewMethodIndex</objDissIndexViewURL> <objItemIndexViewURL>http://localhost:8080/fedora/get/demo:testObject/fedora-system:3/viewItemIndex</objItemIndexViewURL> <objState>A</objState> </objectProfile> |
...
DELETE /objects/{pid} - purge object
DELETE /objects/\{pid}?\[logMessage\]\[force\] Wiki Markup
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
logMessage | String | The message to store in the log, about the purge | Empty string | "Deleted this object because it was not used anymore" |
force | one of true, false | Force the purge, even it it breaks a data contract. If set to true, the request will fail, a general exception will be thrown and the return code will be 500. See http://fedora-commons.org/jira/browse/FCREPO-609 | false | false |
Permanently removes an object from the repository.
Return code | Meaning |
---|---|
200 | OK, purging the object, no return body |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
POST /objects/{pid} - ingest or create new object
...
POST /objects/ [{pid}
...
| new] ? [label] [format] [encoding] [namespace] [ownerId][logMessage] [ignoreMime]
Return code | Meaning |
---|---|
201 | OK, purging the object, no return body |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Parameter | Format | Meaning | Default | Example |
---|
logMessage | String |
Wiki Markup |
---|
PUT /objects/\{pid}?\[label]\[logMessage]\[ownerId]\[state] |
Modify an object. Modifies only the object level properties, ie. label, ownerId and state.
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
label | String | The new object label | no change | "My object" |
logMessage | String | The message to store in the log , about the purge | Empty string | "Deleted this object because it was not used anymore" |
ownerID | String | The new owner id | no change | "FedoraAdmin" |
state | String, one of A (active), I (inactive) or D (deleted) | The new object state. Note that if you do not set this parameter, the default value will set the object to Active | A | D |
Return code | Meaning |
---|---|
200 | OK, Modifying the object, no return body |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
GET /objects/{pid}\export
GET /objects/{pid}\versions
Wiki Markup |
---|
GET /objects/\{pid}/versions?\[format] |
Gets a list of timestamps indicating when components changed in an object. This is a set of timestamps indicating when a datastream was created or modified in the object. These timestamps can be used to request a timestamped dissemination request to view the object as it appeared at a specific point in time.
Please note that this timestamp list is generated by requesting the timestamp list of all CURRENTLY Active datastreams, and sorting it. Inactive and Deleted datastreams are disregarded.
Please note that this timestamp list does not include changes to object properties, but only datastream changes.
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
format | one of text/xml, text/html, html, xml | The format of the return value | text/html | text/xml |
Return code | Meaning |
---|---|
200 | OK, Object history in the specified format |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Example of html format
TODO
Example of xml format
...
<fedoraObjectHistory pid="demo:testObject">
<!--1 or more repetitions:-->
<objectChangeDate>2008-09-29T03:49:450Z</objectChangeDate>
<objectChangeDate>2008-10-29T05:47:000Z</objectChangeDate>
</fedoraObjectHistory>
...
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSPY v2004 rel. 2 U (http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="fedoraObjectHistory">
<xs:complexType>
<xs:sequence>
<xs:element name="objectChangeDate" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="pid" use="required">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
Log message about the ingest" |
{pid} | pid format | persistent identifier of the object to be created |
new | indicator that either a new PID should be created for this object or that the PID to be used is encoded in the XML included as the body of the request
| | |
label | String | the label of the new object | Empty string | Â |
format | one of info:fedora/fedora-system:FOXML-1.1, info:fedora/fedora-system:FOXML-1.0, info:fedora/fedora-system:METSFedoraExt-1.1, info:fedora/fedora-system:METSFedoraExt-1.0, info:fedora/fedora-system:ATOM-1.1 or info:fedora/fedora-system:ATOMZip-1.1 | the XML format of the object to be ingested | info:fedora/fedora-system:FOXML-1.1 | Â |
encoding | The encoding names known by the JVM | the encoding of the XML to be ingested | UTF-8 | Â |
namespace | the namespace to be used to create a PID for a new empty object; if object XML is included with the request, the namespace parameter is ignored | the default namespace of the repository | Â |
ownerId | the id of the user to be listed at the object owner | Â | Â |
logMessage | a message describing the activity being performed | Â | Â |
ignoreMime | indicates that the request should not be checked to ensure that the content is XML prior to attempting an ingest. This is provided to allow for client applications which do not indicate the correct Content-Type when submitting a request. | false | true, false |
XML file as request content | file to be ingested as a new object | Â | Â |
Examples
POST: /objects/new
POST: /objects/new?namespace=demo
POST: /objects/test:100?label=Test
PUT /objects/{pid} - modify object
PUT /objects/{pid}?[label][logMessage][ownerId][state]
Modify an object. Modifies only the object level properties, ie. label, ownerId and state.
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
label | String | The new object label | no change | "My object" |
logMessage | String | The message to store in the log, about the purge | Empty string | "Deleted this object because it was not used anymore" |
ownerID | String | The new owner id | no change | "FedoraAdmin" |
state | String, one of A (active), I (inactive) or D (deleted) | The new object state. Note that if you do not set this parameter, the default value will set the object to Active. See https://fedora-commons.org/jira/browse/FCREPO-608 | A | D |
Return code | Meaning |
---|---|
200 | OK, Modifying the object, no return body |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
GET /objects/{pid}\export
GET /objects/{pid}\versions
GET /objects/{pid}/versions?[format]
Gets a list of timestamps indicating when components changed in an object. This is a set of timestamps indicating when a datastream was created or modified in the object. These timestamps can be used to request a timestamped dissemination request to view the object as it appeared at a specific point in time.
Please note that this timestamp list is generated by requesting the timestamp list of all CURRENTLY Active datastreams, and sorting it. Inactive and Deleted datastreams are disregarded. See http://fedora-commons.org/jira/browse/FCREPO-610
Please note that this timestamp list does not include changes to object properties, but only datastream changes.
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
format | one of text/xml, text/html, html, xml | The format of the return value | text/html | text/xml |
Return code | Meaning |
---|---|
200 | OK, Object history in the specified format |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Example of html format
Example of xml format
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<fedoraObjectHistory pid="demo:testObject">
<!--1 or more repetitions:-->
<objectChangeDate>2008-09-29T03:49:450Z</objectChangeDate>
<objectChangeDate>2008-10-29T05:47:000Z</objectChangeDate>
</fedoraObjectHistory>
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSPY v2004 rel. 2 U (http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="fedoraObjectHistory">
<xs:complexType>
<xs:sequence>
<xs:element name="objectChangeDate" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="pid" use="required">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
|
GET /objects/{pid}\objectXML
Datastream Resources
GET /objects/{pid}/datastreams - list datastreams
Inquires upon all object Datastreams to obtain datastreams contained by a digital object. This returns a set of datastream locations that represent all possible datastreams available in the object.
GET /objects/{pid}/datastreams?[asOfDateTime][format]
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
asOfDateTime | yyyy-MM-ddTHH:mm:ss.SSSZ | The datastream list as it looked at the specific time | Now | 2009-01-01T03:00:00:000Z |
format | one of text/xml, text/html, html, xml | The format of the return value | text/html | text/xml |
Return code | Meaning |
---|---|
200 | OK, Return information in the specified format |
404 | Object not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Example of html format
Example of xml format
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<objectDatastreams pid="demo:testObject"
asOfDateTime="2009-01-01T03:00:00:000Z"
baseURL="http://localhost:8080/fedora/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.fedora.info/definitions/1/0/access/
http://localhost:8080/fedora/listDatastreams.xsd">
<!--Zero or more repetitions:-->
<datastream dsid="DC" label="" mimeType="text/xml"/>
</objectDatastreams>
|
The asOfDateTime attribute is not present if the parameter was not specified.
The baseURL is the used to create datastream urls, as in baseURL+pid+/+dsId.
The label and the mimeType will be empty strings if they are not specified for the particular datastream
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="info:fedora/fedora-system:def/listDatastreams#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="info:fedora/fedora-system:def/listDatastreams#" elementFormDefault="qualified">
<!-- root element declaration -->
<xsd:element name="objectDatastreams">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="objectDatastreamsType"/>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<!-- complex type declarations -->
<xsd:complexType name="objectDatastreamsType">
<xsd:sequence>
<xsd:element name="datastream" type="datastreamType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="pid" type="xsd:string" use="required"/>
<xsd:attribute name="asOfDateTime" type="xsd:string" use="optional"/>
<xsd:attribute name="baseURL" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="datastreamType">
<xsd:attribute name="dsid" type="xsd:string" use="required"/>
<xsd:attribute name="label" type="xsd:string" use="required"/>
<xsd:attribute name="mimeType" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:schema>
|
GET /objects/{pid}/datastreams/{dsID} - get datastream profile
GET /objects/{pid}/datastreams/{dsID}?[asOfDateTime][validateChecksum]
Gets the datastream profile, as it looked at the specified time. The datastream profile is a datastructure containing all the datastream properties, but not the content.
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
asOfDateTime | yyyy-MM-ddTHH:mm:ss.SSSZ | The datastream profile as it looked at the specific time | Now | 2009-01-01T03:00:00:000Z |
validateChecksum | one of true, false | Recompute the checksum for the content, and compare this to the stored checksum. Beware, this might take a while, if the content is external or big | false | true |
Return code | Meaning |
---|---|
200 | OK, Return information in the specified format |
404 | Object or datastream not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
Example of html format
Example of xml format
Code Block | ||||
---|---|---|---|---|
| ||||
<datastreamProfile
xsi:schemaLocation="http://www.fedora.info/definitions/1/0/management/
http://localhost:8080/datastreamProfile.xsd"
pid="changeme:1"
dsID="DC"
datetime="2009-11-26T15:31:40.099Z">
<dsLabel>Dublin Core Record for this object</dsLabel>
<dsVersionID>DC1.0</dsVersionID>
<dsCreateDate>2009-11-26T15:31:40.099Z</dsCreateDate>
<dsState>A</dsState>
<dsMIME>text/xml</dsMIME>
<dsFormatURI>http://www.openarchives.org/OAI/2.0/oai_dc/</dsFormatURI>
<dsControlGroup>X</dsControlGroup>
<dsSize>339</dsSize>
<dsVersionable>true</dsVersionable>
<dsInfoType/>
<dsLocation>changeme:1+DC+DC1.0</dsLocation>
<dsLocationType/>
<dsChecksumType>DISABLED</dsChecksumType>
<dsChecksum>none</dsChecksum>
</datastreamProfile>
|
Notes:
- datetime: This attribute is not in the schema. See http://fedora-commons.org/jira/browse/FCREPO-612
- VersionID: Each version of a datastream has a timestamp and an ID. This is the Id of the newest version from before the "asOfDateTime" time.
- CreateDate: Misleadingly named, it is the date where the latest change was performed on the datastream. Corresponds to versionID.
- ControlGroup: One of X (inline Xml), M (Managed content), E (External) or R (Redirect).
- Size: is only trustworthy for inline (X) datastreams, but will be reported for all.
- InfoType: DATA or one of the METS MDType values. Used to maintain backwards compatibility with METS-Fedora
- Location: For internal datastreams, it is the internal id (as shown in the example). For external, it is the url to the content.
- LocationType: URL for external datastreams (E and R controlgroup). INTERNAL_ID for managed datastreams. Not set for inline datastreams
- ChecksumTupe: One of DISABLED, MD5, SHA-1, SHA-256, SHA-384, SHA-512, HAVAL, TIGER, WHIRLPOOL
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="datastreamProfile">
<xs:complexType>
<xs:sequence>
<xs:element name="dsLabel" type="xs:string" />
<xs:element name="dsVersionID" type="xs:string" />
<xs:element name="dsCreateDate" type="xs:dateTime" />
<xs:element name="dsState">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="A"/>
<xs:enumeration value="D"/>
<xs:enumeration value="I"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dsMIME" type="xs:string" />
<xs:element name="dsFormatURI" type="xs:anyURI" />
<xs:element name="dsControlGroup" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="X"/>
<xs:enumeration value="M"/>
<xs:enumeration value="R"/>
<xs:enumeration value="E"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dsSize" type="xs:integer" />
<xs:element name="dsVersionable" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dsInfoType" type="xs:string" />
<xs:element name="dsLocation" type="xs:string" />
<xs:element name="dsLocationType" type="xs:string" />
<xs:element name="dsChecksumType" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="DEFAULT"/>
<xs:enumeration value="DISABLED"/>
<xs:enumeration value="MD5"/>
<xs:enumeration value="SHA-1"/>
<xs:enumeration value="SHA-256"/>
<xs:enumeration value="SHA-385"/>
<xs:enumeration value="SHA-512"/>
<xs:enumeration value="HAVAL"/>
<xs:enumeration value="TIGER"/>
<xs:enumeration value="WHIRLPOOL"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dsChecksum" type="xs:string" />
<xs:element name="dsChecksumValid" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dsAltID" minOccurs="0" maxOccurs="unbounded" type="xs:string" />
</xs:sequence>
<xs:attribute name="pid" use="required">
<xs:simpleType>
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:attribute>
<xs:attribute name="dsID" use="required">
<xs:simpleType>
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
|
DELETE /objects/{pid}/datastreams/{dsID} - purge datastream
DELETE /objects/{pid}/datastreams/{dsID}?[startDT][endDT][logMessage][force]
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
startDT | yyyy-MM-ddTHH:mm:ss.SSSZ | Purge the datastream versions created after this date | From the beginning | 2009-01-01T03:00:00:000Z |
endDT | yyyy-MM-ddTHH:mm:ss.SSSZ | Purge only versions created before this date | Now | 2009-01-01T03:00:00:000Z |
logMessage | String | The message to store in the log, about the purge | Empty string | "Deleted this datastream because it was not used anymore" |
force | one of true, false | Force the purge, even it it breaks a data contract. If set to true, the request will fail, a general exception will be thrown and the return code will be 500. See http://fedora-commons.org/jira/browse/FCREPO-613 | false | false |
If called without startDT and endDT all versions will be purged, along with the datastream itself.
Return code | Meaning |
---|---|
200 | OK, purged datastream. No content. |
404 | Object or datastream not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
PUT /objects/{pid}/datastreams/{dsID} - modify datastream
PUT /objects/{pid}/datastreams/{dsID}?[dsLocation][altIDs][dsLabel][versionable][dsState][formatURI][checksumType][checksum][mimeType][logMessage][force][ignoreContent]
+ multipart file as request content
The behaivour depends on the datastream controlGroup and the content provided and the ignoreContent parameter
- Inline: If the request includes content this is used, otherwhice the dsLocation is dereferenced. If ignoreContent is set, the content is never used, only the dsLocation.
- Managed: If dsLocation is provided, it is dereferenced, otherwise the request content is read.
- External: The dsLocation parameter is used, and must be set. Request content is disregarded
Modify an existing datastream, by creating a new version of the datastream. If the datastream is versionable, the old version is kept, otherwise it is deleted. Each request will generate a new version, but one request (that changes numerous properties) will only generate one object. The default for all the parameters is not to change the existing value.
Not all properties are versionable, so changing these will not generate a new version: These are
- versionable
- dsState
Note the order of the changes
- New datastream version is created and stored
- Datastream state is changed
- Versionable is changed
If the datastream is in the D(eleted) state, it cannot be modified, and return code 500 is given. Except, if the request modify both the datastream and sets the state to A(ctive) or I(nactive). Note, only the old state is checked, it is possible to modify a datastream and set it to deleted in one operation.
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
dsLocation | String | The new content location. If datastream is internal, the content will be uploaded. If datastream is external, the content location will be stored in the datastream | no change | an url |
altIDs | List of Strings | The new alternative IDs for the datastream | no change | |
dsLabel | String | The new datastream label | no change | "My datastream" |
versionable | true or false | should the datastream be versionable. As the default is true, if you modify a datastream without setting this parameter, the datastream will be made versionable. | true | versionable=true |
dsState | one of A(ctive), I(nactive) or D(eleted) | Set the datastream state | no change | dsState=A |
formatURI | String (a valid URI) | The new format URI of the datastream | no change | formatURI=info:pronom/fmt/42 |
checksumType | One of DISABLED, MD5, SHA-1, SHA-256, SHA-384, SHA-512, HAVAL, TIGER, WHIRLPOOL | Set the datastream checksum type | no change | TODO |
checksum | hex String | The value of the checksum. Fedora will read the content of the stream, and compute the checksum for comparison. This might take a while. If no checksumType is provided, use the one in the datastream. If no checksumType is in the datastream, use type DISABLED, and do nothing further. | none | TODO |
mimeType | String | The new mimeType the datastream | no change | text/xml |
logMessage | String | The message to store in the log, about the operation | Empty string | "Deleted this object because it was not used anymore" |
force | one of true, false | Force the purge, even it it breaks a data contract. If set to true, the request will fail, a general | false | false |
ignoreContent | one of true, false | Ignore the message content, and use the content location. | false | false |
Return code | Meaning |
---|---|
200 | OK, modified datastream. Returns the new datastream profile, like GET /objects/{pid}/datastreams/{dsID}?format=xml |
404 | Object or datastream not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain. Please note that this request spans multiple fedora methods, and you could thus modify the datastream, but fail to modify the state, and get a 401. The datastream will still be modified, but the state will not be. Many other combinations are also possible. |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |
POST
GET /objects/{pid}\objectXML
Datastream Resources
2. Method Resources
Create methods
Object resources
Create new object with given pid
PUT /objects/{pid}
Return: Nothing or pid of the new object
Creates a new, empty object
Create new object with autogenerated pid
POST /objects/
Return: pid of the new object (/objects/demo:newObject2)
Creates a new, empty object
Datastream resources
Create a new datastream
Wiki Markup |
---|
PUT /objects/\{pid}/datastreams/\{dsID}\[/withControlGroup/\{cg}\] |
Creates a new datastream in the object with controlgroup X or {cg} if specified. Datastream is empty.
Retrieve methods
Object resources
Present Object
GET /objects/{pid}
Return: XML that presents the object....
Undetailed
Get the object properties
GET /objects/{pid}/properties
Return: list of property names (/object/demo:myPid2/properties/label)
Provides a list of property names that can be queried
Get a specific object property
GET /objects/{pid}/properties/{property}
Return: The value
Give the value of the specific property, or 404 if property not found
Example: /objects/demo:myPid2/properties/label
Get content models for a object
GET /objects/{pid}/contentmodels
Return: Get the content models of the object (/objects/demo:contentmodel)
Get a list of the content models of this object
Get all the relations of an object
GET /objects/{pid}/relations
Return: Return a list of relation names
Get a specific relation from an object
GET /objects/{pid}/relations/{rel-name}
Return: List of pids of objects referred by this relation
List the methods on an object
GET /objects/{pid}/methods
Return: a list of objects
Invoke a method on an object
GET/POST /objects/{pid}/methods/{sdef}/{methodName}?params
Datastream resources
Get Contents of a datastream
...
/objects/{pid}/datastreams/{dsID}
...
- modify or create datastream
GET POST /objects/{pid}/datastreams/{dsID}/properties
Get a specific property of a datastream
?[controlGroup][dsLocation][altIDs][dsLabel][versionable][dsState][formatURI][checksumType][checksum][mimeType][logMessage]
+ multipart file as request content
Modify or create a datastream. Functions almost identical to the above method PUT GET /objects/{pid}/datastreams/{dsID} /properties/{prop}
Return: The value
Get the relations of the datastream
GET /objects/{pid}/datastreams/{dsID}/relations
The RELS-INT block "about" this datastream
Get version timestamps of a datastream
The idea is that the old version of the datastream should support the same getter methods as the current version
GET /objects/{pid}/datastreams/{dsID}/versions
Get the contents of a specific version of a datastream
GET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/contents
Get the versioned properties of a specific version
GET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/properties
Get a specific versioned property of a specific version
GET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/properties/{propertyname}
Get the relations of a specific version
GET /objects/{pid}/datastreams/{dsID}/versions/{timestamp}/relations/
Update methods
Object resources
Write a specific property
PUT /objects/{pid}/properties/{property}
Contents: The new value
Return nothing, or 404 if property not found. New properties cannot be created.
Add a relation to an object
PUT /objects/{pid}/relations/{rel-name}/to/{objpid}
Add a content model to this object
PUT /objects/{pid}/contentmodels/{cmpid}
Contents: Nothing
Add cmpid to the list of content model for this object
Add a literal relation
Wiki Markup |
---|
PUT /objects/\{pid}/relations/\{rel-name}/toLiteral/\{value}\[/withType/\{type}\] |
Datastream resources
Update the contents of an Inline Datastream
POST /objects/{pid}/datastreams/{dsID}/contents
Contents: The new content of the datastream
Update a datastream property
PUT /objects/{pid}/datastreams/{dsID}/properties/{prop}
Contents: The new value
examples: versionable, state and so on.
Update an External, managed or Redirect Datastream
Contentlocation is just a property of these datastreams
PUT /objects/{pid}/datastreams/{dsID}/properties/contentLocation
Contents: The URL to the contents of the datastream
Add a relation to the datastream
PUT /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/to/{objPid}
Add a literal relation to the datastream
Wiki Markup |
---|
PUT /objects/\{pid}/datastreams/\{dsID}/relations/\{rel-name}/toLiteral/\{value}\[/withType/\{type}\] |
Delete methods
Object resources
Purge object
DELETE /objects/{pid}
Remove a content model from this object
DELETE /objects/{pid}/contentmodels/{cmpid}
Contents: Nothing
Remove cmpid from the list of content models for this object
Purge a relation to an object
DELETE /objects/{pid}/relations/{rel-name}/to/{objpid}
Delete a literal relation
DELETE /objects/{pid}/relations/{rel-name}/toLiteral/{value}
Datastream resources
Delete a datastream
DELETE /objects/{pid}/datastreams/{dsID}
Purge the datastream from the object from the repository
Purge a relation from the datastream
DELETE /objects/{pid}/datastreams/{dsID}/relations/{rel-name}/to/{objPid}
Purge a literal relation from a datastream
...
but with a few differences. There is no ignoreContent parameter, so the functioning with dsLocation and message content is more complex.
If the datastream does not exist already, it is created with the specified control group.
- Internal: If the dsLocation parameter not set, the request content is stored as the new content of the datastream
- External: The dsLocation parameter is used, and must be set. Request content is disregarded
If the datastream already exist, the provided control group is disregarded and the one from the existing datastream is used
- Inline: If the request includes content this is used, otherwhice the dsLocation is dereferenced. Note the difference between managed and internal here.
- Managed: If dsLocation is provided, it is dereferenced, otherwise the request content is read.
- External: The dsLocation parameter is used, and must be set. Request content is disregarded
Parameter | Format | Meaning | Default | Example |
---|---|---|---|---|
controlGroup | String. One of X (inline Xml), M (Managed content), E (External) or R (Redirect). | The control group of a new datastream. Ignored if the datastream already exists. | X | an url |
dsLocation | String | The new content location. Required for external datastreams. See above. | no change | an url |
altIDs | List of Strings | The new alternative IDs for the datastream | no change | |
dsLabel | String | The new datastream label | no change | "My datastream" |
versionable | true or false | should the datastream be versionable. As the default is true, if you modify a datastream without setting this parameter, the datastream will be made versionable. | true | versionable=true |
dsState | one of A(ctive), I(nactive) or D(eleted) | Set the datastream state. You can create a datastream in the Deleted state. | no change | dsState=A |
formatURI | String (a valid URI) | The new format URI of the datastream | no change | formatURI=info:pronom/fmt/42 |
checksumType | One of DISABLED, MD5, SHA-1, SHA-256, SHA-384, SHA-512, HAVAL, TIGER, WHIRLPOOL | Set the datastream checksum type | no change | TODO |
checksum | hex String | The value of the checksum. Fedora will read the content of the stream, and compute the checksum for comparison. This might take a while. If no checksumType is provided, use the one in the datastream. If no checksumType is in the datastream, use type DISABLED, and do nothing further. | none | TODO |
mimeType | String | The new mimeType the datastream | no change | text/xml |
logMessage | String | The message to store in the log, about the operation | Empty string | "Deleted this object because it was not used anymore" |
Return values
Return code | Meaning |
---|---|
201 | Created. Locationheader corresponding the new datastream. Updated or created the datastream. Returns the new datastream profile, like GET /objects/{pid}/datastreams/{dsID}?format=xml |
404 | Object or datastream not found in repository. Body is exception as text/plain |
401 | Unauthorized, the security policy forbade this operation with the supplied user credentials. Body as exception as text/plain. Please note that this request spans multiple fedora methods, and you could thus modify the datastream, but fail to modify the state, and get a 401. The datastream will still be modified, but the state will not be. Many other combinations are also possible. |
400 | Wrong syntax in request. Exception as body, text/plain |
500 | Other, unknown error encountered |