Skip to content
Snippets Groups Projects
Commit cae56c1b authored by Stefan E. Funk's avatar Stefan E. Funk
Browse files

added POST calls to OAIPMH request handling.

parent 9230c223
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
<parent>
<artifactId>oaipmh</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>2.15.0-SNAPSHOT</version>
<version>2.16.0-SNAPSHOT</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>oaipmh-core</artifactId>
......
package info.textgrid.middleware;
import info.textgrid.middleware.oaipmh.OAIPMHType;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.FormParam;
import javax.ws.rs.core.MediaType;
import javax.xml.bind.JAXBElement;
/**
* <p>
* Interface to the get Request function
* </p>
*
* @author Maximilian Brodhun, SUB
* @version 1.0
......@@ -20,53 +23,76 @@ import javax.xml.bind.JAXBElement;
public interface OAIPMHProducer {
/**
*
* @param verb
* The parameter verb is a required parameter to all requests.
* Depending on it the request will be proceed. Possible values
* are: GetRecord, Identify, ListIdentifiers,
* ListMetadataFormats, ListRecords and ListSets In case of other
* verbs an error response will be send back
*
* @param identifier
* This value indicates if the request will be proceed just for a
* single identifier of the repository
* @param metadataPrefix
* To limit the response just for a special metadata format this
* value can be used. The prefix "oai_dc" has to be supported by
* all repositories
* @param set
* To represent the architecture of the repository it is possible
* to make sets which work like categories. At the moment
* textgrid does not support sets
* @param from
* Start value to filter the response for a specific interval
* @param until
* End value to filter the response for a specific interval
* @param resumptionToken
* Indicates how many value will be send back in the response
*
*/
/**
* <p>
* Getting the request values as QueryParam from a REST GET request and proceeds appropriate to
* them.
* </p>
*
* @param verb - The parameter verb is a required parameter to all requests. Depending on it the
* request will be proceed. Possible values are: GetRecord, Identify, ListIdentifiers,
* ListMetadataFormats, ListRecords and ListSets In case of other verbs an error response
* will be send back
* @param identifier - This value indicates if the request will be proceed just for a single
* identifier of the repository
* @param metadataPrefix - To limit the response just for a special metadata format this value can
* be used. The prefix "oai_dc" has to be supported by all repositories
* @param set - To represent the architecture of the repository it is possible to make sets which
* work like categories. At the moment textgrid does not support sets
* @param from - Start value to filter the response for a specific interval
* @param until - End value to filter the response for a specific interval
* @param resumptionToken - Indicates how many value will be send back in the response
* @return OAIPMHType object containing the whole response
*/
@GET
@Path("/")
@Produces(MediaType.TEXT_XML)
JAXBElement<OAIPMHType> getRequest(@QueryParam("verb") String verb,
@QueryParam("identifier") @DefaultValue("") String identifier,
@QueryParam("metadataPrefix") @DefaultValue("") String metadataPrefix,
@QueryParam("set") @DefaultValue("") String set,
@QueryParam("from") @DefaultValue("") String from,
@QueryParam("until") @DefaultValue("") String until,
@QueryParam("resumptionToken") @DefaultValue("") String resumptionToken);
@GET
@Path("/")
@Produces(MediaType.TEXT_XML)
JAXBElement<OAIPMHType> getRequest(
@QueryParam("verb") String verb,
@QueryParam("identifier") @DefaultValue("") String identifier,
@QueryParam("metadataPrefix") @DefaultValue("") String metadataPrefix,
@QueryParam("set") @DefaultValue("") String set,
@QueryParam("from") @DefaultValue("") String from,
@QueryParam("until") @DefaultValue("") String until,
@QueryParam("resumptionToken") @DefaultValue("") String resumptionToken);
/**
* <p>
* Getting the request values as FormParams from a REST POST request and proceeds appropriate to
* them.
* </p>
*
* @param verb - The parameter verb is a required parameter to all requests. Depending on it the
* request will be proceed. Possible values are: GetRecord, Identify, ListIdentifiers,
* ListMetadataFormats, ListRecords and ListSets In case of other verbs an error response
* will be send back
* @param identifier - This value indicates if the request will be proceed just for a single
* identifier of the repository
* @param metadataPrefix - To limit the response just for a special metadata format this value can
* be used. The prefix "oai_dc" has to be supported by all repositories
* @param set - To represent the architecture of the repository it is possible to make sets which
* work like categories. At the moment textgrid does not support sets
* @param from - Start value to filter the response for a specific interval
* @param until - End value to filter the response for a specific interval
* @param resumptionToken - Indicates how many value will be send back in the response
* @return OAIPMHType object containing the whole response
*/
@POST
@Path("/")
@Produces(MediaType.TEXT_XML)
JAXBElement<OAIPMHType> postRequest(@FormParam("verb") String verb,
@FormParam("identifier") @DefaultValue("") String identifier,
@FormParam("metadataPrefix") @DefaultValue("") String metadataPrefix,
@FormParam("set") @DefaultValue("") String set,
@FormParam("from") @DefaultValue("") String from,
@FormParam("until") @DefaultValue("") String until,
@FormParam("resumptionToken") @DefaultValue("") String resumptionToken);
/**
* @return
*/
@GET
@Path("/version")
@Produces(MediaType.TEXT_PLAIN)
String getVersion();
/**
* @return
*/
@GET
@Path("/version")
@Produces(MediaType.TEXT_PLAIN)
String getVersion();
}
......@@ -4,7 +4,7 @@
<parent>
<artifactId>oaipmh</artifactId>
<groupId>info.textgrid.middleware</groupId>
<version>2.15.0-SNAPSHOT</version>
<version>2.16.0-SNAPSHOT</version>
</parent>
<groupId>info.textgrid.middleware</groupId>
<artifactId>oaipmh-webapp</artifactId>
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>info.textgrid.middleware</groupId>
<artifactId>oaipmh</artifactId>
<version>2.15.0-SNAPSHOT</version>
<version>2.16.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>DARIAHDE :: OAI-PMH DataProvider</name>
<properties>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment