org.fcrepo.server.rest
Class FedoraObjectsResource

java.lang.Object
  extended by org.fcrepo.server.rest.BaseRestResource
      extended by org.fcrepo.server.rest.FedoraObjectsResource

@Component
public class FedoraObjectsResource
extends BaseRestResource

Implement /objects/pid/* REST API

Version:
$Id$
Author:
cuong.tran@yourmediashelf.com

Field Summary
 
Fields inherited from class org.fcrepo.server.rest.BaseRestResource
APP_ZIP, FORM, HTML, m_access, m_datastreamFilenameHelper, m_headers, m_hostname, m_management, m_mapper, m_server, m_servletRequest, m_uriInfo, TEXT_HTML, TEXT_XML, VALID_PID_PART, XML, ZIP
 
Constructor Summary
FedoraObjectsResource(Server server)
           
 
Method Summary
 javax.ws.rs.core.Response createObject(javax.ws.rs.core.HttpHeaders headers, String pid, String label, String logMessage, String format, String encoding, String namespace, String ownerID, String state, boolean ignoreMime, boolean flash)
          Create/Update a new digital object.
 javax.ws.rs.core.Response deleteObject(String pid, String logMessage, boolean flash)
          Permanently removes an object from the repository.
 javax.ws.rs.core.Response doObjectValidation(String pid, String dateTime, boolean flash)
           
 javax.ws.rs.core.Response getNextPID(int numPIDS, String namespace, String format, boolean flash)
          Implements the "getNextPID" functionality of the Fedora Management LITE (API-M-LITE) interface using a java servlet front end.
 javax.ws.rs.core.Response getObjectExport(String pid, String format, String exportContext, String encoding, boolean flash)
          Exports the entire digital object in the specified XML format ("info:fedora/fedora-system:FOXML-1.1" or "info:fedora/fedora-system:METSFedoraExt-1.1"), and encoded appropriately for the specified export context ("public", "migrate", or "archive").
 javax.ws.rs.core.Response getObjectHistory(String pid, String format, boolean flash)
          Gets a list of timestamps indicating when components changed in an object.
 javax.ws.rs.core.Response getObjectProfile(String pid, String dateTime, String format, boolean flash)
          Gets a profile of the object which includes key metadata fields and URLs for the object Dissemination Index and the object Item Index.
 javax.ws.rs.core.Response getObjectXML(String pid, boolean flash)
          Gets a profile of the object which includes key metadata fields and URLs for the object Dissemination Index and the object Item Index.
 javax.ws.rs.core.Response newObject(javax.ws.rs.core.HttpHeaders headers, String label, String logMessage, String format, String encoding, String namespace, String ownerID, String state, boolean ignoreMime, boolean flash)
           
 javax.ws.rs.core.Response searchObjects(String terms, String query, int maxResults, String sessionToken, String format, boolean flash)
           
 javax.ws.rs.core.Response updateObject(String pid, String label, String logMessage, String ownerID, String state, DateTimeParam lastModifiedDate, boolean flash)
          Update (modify) digital object.
 
Methods inherited from class org.fcrepo.server.rest.BaseRestResource
buildResponse, getContext, getSerializer, handleException, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FedoraObjectsResource

public FedoraObjectsResource(Server server)
Method Detail

searchObjects

public javax.ws.rs.core.Response searchObjects(String terms,
                                               String query,
                                               int maxResults,
                                               String sessionToken,
                                               String format,
                                               boolean flash)

getNextPID

public javax.ws.rs.core.Response getNextPID(int numPIDS,
                                            String namespace,
                                            String format,
                                            boolean flash)
                                     throws Exception
Implements the "getNextPID" functionality of the Fedora Management LITE (API-M-LITE) interface using a java servlet front end. The syntax defined by API-M-LITE for getting a list of the next available PIDs has the following binding:
  1. getNextPID URL syntax: protocol://hostname:port/fedora/objects/nextPID[?numPIDs=NUMPIDS&namespace=NAMESPACE&format=html,xml] This syntax requests a list of next available PIDS. The parameter numPIDs determines the number of requested PIDS to generate. If omitted, numPIDs defaults to 1. The namespace parameter determines the namespace to be used in generating the PIDs. If omitted, namespace defaults to the namespace defined in the fedora.fcfg configuration file for the parameter pidNamespace. The xml parameter determines the type of output returned. If the parameter is omitted or has a value of "false", a MIME-typed stream consisting of an html table is returned providing a browser-savvy means of viewing the object profile. If the value specified is "true", then a MIME-typed stream consisting of XML is returned.
  2. Throws:
    Exception

doObjectValidation

public javax.ws.rs.core.Response doObjectValidation(String pid,
                                                    String dateTime,
                                                    boolean flash)

getObjectExport

public javax.ws.rs.core.Response getObjectExport(String pid,
                                                 String format,
                                                 String exportContext,
                                                 String encoding,
                                                 boolean flash)
Exports the entire digital object in the specified XML format ("info:fedora/fedora-system:FOXML-1.1" or "info:fedora/fedora-system:METSFedoraExt-1.1"), and encoded appropriately for the specified export context ("public", "migrate", or "archive").

GET /objects/{pid}/export ? format context encoding


getObjectHistory

public javax.ws.rs.core.Response getObjectHistory(String pid,
                                                  String format,
                                                  boolean flash)
Gets a list of timestamps indicating when components changed in an object. This is a set of timestamps indicating when a datastream or disseminator 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.

GET /objects/{pid}/versions ? format


getObjectXML

public javax.ws.rs.core.Response getObjectXML(String pid,
                                              boolean flash)
Gets a profile of the object which includes key metadata fields and URLs for the object Dissemination Index and the object Item Index. Can be thought of as a default view of the object.

GET /objects/{pid}/objectXML


getObjectProfile

public javax.ws.rs.core.Response getObjectProfile(String pid,
                                                  String dateTime,
                                                  String format,
                                                  boolean flash)
Gets a profile of the object which includes key metadata fields and URLs for the object Dissemination Index and the object Item Index. Can be thought of as a default view of the object.

GET /objects/{pid} ? format asOfDateTime


deleteObject

public javax.ws.rs.core.Response deleteObject(String pid,
                                              String logMessage,
                                              boolean flash)
Permanently removes an object from the repository.

DELETE /objects/{pid} ? logMessage


newObject

public javax.ws.rs.core.Response newObject(@Context
                                           javax.ws.rs.core.HttpHeaders headers,
                                           String label,
                                           String logMessage,
                                           String format,
                                           String encoding,
                                           String namespace,
                                           String ownerID,
                                           String state,
                                           boolean ignoreMime,
                                           boolean flash)

createObject

public javax.ws.rs.core.Response createObject(@Context
                                              javax.ws.rs.core.HttpHeaders headers,
                                              String pid,
                                              String label,
                                              String logMessage,
                                              String format,
                                              String encoding,
                                              String namespace,
                                              String ownerID,
                                              String state,
                                              boolean ignoreMime,
                                              boolean flash)
Create/Update a new digital object. If no xml given in the body, will create an empty object.

POST /objects/{pid} ? label logMessage format encoding namespace ownerId state


updateObject

public javax.ws.rs.core.Response updateObject(String pid,
                                              String label,
                                              String logMessage,
                                              String ownerID,
                                              String state,
                                              DateTimeParam lastModifiedDate,
                                              boolean flash)
Update (modify) digital object.

PUT /objects/{pid} ? label logMessage ownerId state lastModifiedDate

Parameters:
pid - the persistent identifier
label -
logMessage -
ownerID -
state -
lastModifiedDate - Optional XSD dateTime to guard against concurrent modification. If provided (i.e. not null), the request will fail with an HTTP 409 Conflict if lastModifiedDate is earlier than the object's lastModifiedDate.
Returns:
The timestamp for this modification (as an XSD dateTime string)
See Also:
org.fcrepo.server.management.Management#modifyObject(org.fcrepo.server.Context, String, String, String, String, String)


Copyright © 2012 DuraSpace. All Rights Reserved.