Versions Compared

Key

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

...

Request URI: /path/to/some/resource

Methods: GET, POST

Status
titleGET
  fcr:export Retrieve serialized form of a resource and its subtree.

Request Headers:

...

Note

Objects are exported and imported relative to the request URI path given. E.g., if you run

...

:

Code Block
curl 
"
http://localhost:8080/rest/path/to
/some
/resource/fcr:export
"

Response:

Code Block
Status: 200
 
Headers:
Content-Type: application/xml
Body:
<jcrxml:jcrxml xmlns:jcrxml="" /> 

Status:

 > export.xml
curl -X POST -d @export.xml http://localhost:8080/rest/somewhere/else

The resource will be imported to http://localhost:8080/rest/somewhere/else/resource.

 

 

Status
titleGET
  fcr:export Retrieve serialized form of a resource and its subtree.

Request Headers:

Status
subtletrue
colourGreen
title200
 

Status
subtletrue
colourRed
title
404

 

 

...

Request Headers:

...

Format
 Export formats; the exact formats available depend on the repository configuration.

Note

The available export formats for an object are available as properties of nodes, e.g. this node exports jcr/xml:

Code Block
<> <http://fedora.info/definitions/v4/rest-api#exportsAs> <./fcr:export?format=jcr/xml> ;

 

Example:

Code Block
curl "http://localhost:8080/rest/path/to/some/resource/fcr:export"

Response:

Code Block
Status: 200
 
Headers:
Content-Type: application/xml
Body:

<?xml version="1.0" encoding="UTF-8"?><sv:node xmlns:dc="http://purl.org/dc/terms/" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ns001="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:test="info:fedora/test/" xmlns:image="http://www.modeshape.org/images/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fedorarelsext="http://fedora.info/definitions/v4/rels-ext#" xmlns:mix="http://www....

Status:

Status
subtletrue
colourGreen
title200
 OK

Status
subtletrue
colourRed
title404
 Not Found

 

...

 

Status
colourBlue
titlePOST
 fcr:import Import a serialized resource 

Request Headers:

Status
subtletrue
titleFormat
 Import formats. The exact formats available depend on the repository configuration.

Example:

Code Block
curl -X POST -d "@export.xml" "http://localhost:8080/rest/path/to/some/resource/fcr:import?format=jcr/xml"
 
Body:
<?xml version="1.0" encoding="UTF-8"?><sv:node xmlns:dc="http://purl.org/dc/terms/" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:ns001="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:test="info:fedora/test/" xmlns:image="http://www.modeshape.org/images/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fedorarelsext="http://fedora.info/definitions/v4/rels-ext#" xmlns:mix="http://www....

Example:

Code Block
curl -X POST -d "@export.xml" "http://localhost:8080/rest/path/to/some/resource/fcr:import?format=jcr/xml"
 
Body:
<jcrxml:jcrxml xmlns:jcrxml="" /> 

Response:

Code Block
Status: 201 Created
 
Headers:
Location: http://localhost:8080/rest/path/to/some/resource/

...