/**
* =============================================================================
*
* ORCID (R) Open Source
* http://orcid.org
*
* Copyright (c) 2012-2014 ORCID, Inc.
* Licensed under an MIT-Style License (MIT)
* http://orcid.org/open-source-license
*
* This copyright and license information (including a link to the full license)
* shall be included in its entirety in all copies or substantial portion of
* the software.
*
* =============================================================================
*/
package org.orcid.api.common;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import static org.orcid.core.api.OrcidApiConstants.*;
/**
* @author Declan Newman (declan) Date: 01/03/2012
*/
public interface OrcidApiService<T> {
/**
* @return Plain text message indicating health of service
*/
@GET
@Produces(value = { MediaType.TEXT_PLAIN })
@Path(STATUS_PATH)
public T viewStatusText();
/**
* GETs the HTML representation of the ORCID record
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the HTML representation of the ORCID record
*/
@GET
@Produces(value = { MediaType.TEXT_HTML })
@Path(BIO_PATH)
T viewBioDetailsHtml(@PathParam("orcid") String orcid);
/**
* GETs the XML representation of the ORCID record containing only the
* Biography details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the XML representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
@Path(BIO_PATH)
T viewBioDetailsXml(@PathParam("orcid") String orcid);
/**
* GETs the JSON representation of the ORCID record containing only the
* Biography details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the JSON representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
@Path(BIO_PATH)
T viewBioDetailsJson(@PathParam("orcid") String orcid);
/**
* GETs the RDF/XML representation of the ORCID record containing only the
* Biography details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the RDF/XML representation of the ORCID record
*/
@GET
@Produces(value = { APPLICATION_RDFXML })
@Path(EXPERIMENTAL_RDF_V1 + BIO_PATH)
T viewBioDetailsRdf(@PathParam("orcid") String orcid);
/**
* GETs the RDF Turtle representation of the ORCID record containing only
* the Biography details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the RDF Turtle representation of the ORCID record
*/
@GET
@Produces(value = { TEXT_N3, TEXT_TURTLE })
@Path(EXPERIMENTAL_RDF_V1 + BIO_PATH)
T viewBioDetailsTurtle(@PathParam("orcid") String orcid);
/**
* GETs the HTML representation of the ORCID external identifiers
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the HTML representation of the ORCID record
*/
@GET
@Produces(value = { MediaType.TEXT_HTML })
@Path(EXTERNAL_IDENTIFIER_PATH)
T viewExternalIdentifiersHtml(@PathParam("orcid") String orcid);
/**
* GETs the XML representation of the ORCID record containing only the
* external identifiers
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the XML representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
@Path(EXTERNAL_IDENTIFIER_PATH)
T viewExternalIdentifiersXml(@PathParam("orcid") String orcid);
/**
* GETs the JSON representation of the ORCID record containing only the
* external identifiers
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the JSON representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
@Path(EXTERNAL_IDENTIFIER_PATH)
T viewExternalIdentifiersJson(@PathParam("orcid") String orcid);
/**
* GETs the HTML representation of the ORCID record containing all details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the HTML representation of the ORCID record
*/
@GET
@Produces(value = { MediaType.TEXT_HTML })
@Path(PROFILE_GET_PATH)
T viewFullDetailsHtml(@PathParam("orcid") String orcid);
/**
* GETs the XML representation of the ORCID record containing all details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the XML representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
@Path(PROFILE_GET_PATH)
T viewFullDetailsXml(@PathParam("orcid") String orcid);
/**
* GETs the JSON representation of the ORCID record containing all details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the JSON representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
@Path(PROFILE_GET_PATH)
T viewFullDetailsJson(@PathParam("orcid") String orcid);
/**
* GETs the HTML representation of the ORCID record containing only
* affiliations details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the HTML representation of the ORCID record
*/
@GET
@Produces(value = { MediaType.TEXT_HTML })
@Path(AFFILIATIONS_PATH)
T viewAffiliationsDetailsHtml(@PathParam("orcid") String orcid);
/**
* GETs the XML representation of the ORCID record containing only
* affiliations details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the XML representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
@Path(AFFILIATIONS_PATH)
T viewAffiliationsDetailsXml(@PathParam("orcid") String orcid);
/**
* GETs the JSON representation of the ORCID record containing only
* affiliations details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the JSON representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
@Path(AFFILIATIONS_PATH)
T viewAffiliationsDetailsJson(@PathParam("orcid") String orcid);
/**
* GETs the HTML representation of the ORCID record containing only
* funding details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the HTML representation of the ORCID record
*/
@GET
@Produces(value = { MediaType.TEXT_HTML })
@Path(FUNDING_PATH)
T viewFundingDetailsHtml(@PathParam("orcid") String orcid);
/**
* GETs the XML representation of the ORCID record containing only
* funding details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the XML representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
@Path(FUNDING_PATH)
T viewFundingDetailsXml(@PathParam("orcid") String orcid);
/**
* GETs the JSON representation of the ORCID record containing only
* funding details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the JSON representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
@Path(FUNDING_PATH)
T viewFundingDetailsJson(@PathParam("orcid") String orcid);
/**
* GETs the HTML representation of the ORCID record containing only work
* details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the HTML representation of the ORCID record
*/
@GET
@Produces(value = { MediaType.TEXT_HTML })
@Path(WORKS_PATH)
T viewWorksDetailsHtml(@PathParam("orcid") String orcid);
/**
* GETs the XML representation of the ORCID record containing only work
* details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the XML representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
@Path(WORKS_PATH)
T viewWorksDetailsXml(@PathParam("orcid") String orcid);
/**
* GETs the JSON representation of the ORCID record containing only work
* details
*
* @param orcid
* the ORCID that corresponds to the user's record
* @return the JSON representation of the ORCID record
*/
@GET
@Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
@Path(WORKS_PATH)
T viewWorksDetailsJson(@PathParam("orcid") String orcid);
/**
* Sends a redirect from the client URI to the group URI
*
* @param clientId
* the client ID that corresponds to the client
* @return a redirect to the ORCID record for the client's group
*/
@GET
@Path(CLIENT_PATH)
T viewClient(String clientId);
/**
* Gets the JSON representation any Orcid Profiles (BIO) only relevant to
* the given query
*
* @param query
* @return
*/
@GET
@Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
@Path(BIO_SEARCH_PATH)
public T searchByQueryJSON(String query);
/**
* Gets the JSON representation any Orcid Profiles (BIO) only relevant to
* the given query
*
* @param query
* @return
*/
@GET
@Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
@Path(BIO_SEARCH_PATH)
public T searchByQueryXML(String query);
}