/**
* =============================================================================
*
* 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.integration.blackbox.api.v12;
import static org.orcid.core.api.OrcidApiConstants.AFFILIATIONS_PATH;
import static org.orcid.core.api.OrcidApiConstants.BIO_PATH;
import static org.orcid.core.api.OrcidApiConstants.BIO_SEARCH_PATH;
import static org.orcid.core.api.OrcidApiConstants.EXTERNAL_IDENTIFIER_PATH;
import static org.orcid.core.api.OrcidApiConstants.FUNDING_PATH;
import static org.orcid.core.api.OrcidApiConstants.ORCID_JSON;
import static org.orcid.core.api.OrcidApiConstants.ORCID_XML;
import static org.orcid.core.api.OrcidApiConstants.PROFILE_GET_PATH;
import static org.orcid.core.api.OrcidApiConstants.VND_ORCID_JSON;
import static org.orcid.core.api.OrcidApiConstants.VND_ORCID_XML;
import static org.orcid.core.api.OrcidApiConstants.WORKS_PATH;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import org.orcid.api.common.T2OrcidApiService;
import com.sun.jersey.api.client.ClientResponse;
public interface T1OAuthAPIService<T> {
@POST
@Path(T2OrcidApiService.OAUTH_TOKEN)
@Produces(value = { MediaType.APPLICATION_JSON })
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public ClientResponse obtainOauth2TokenPost(String grantType, MultivaluedMap<String, String> formParams);
@POST
@Path(T2OrcidApiService.OAUTH_TOKEN)
@Produces(value = { MediaType.APPLICATION_JSON })
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public ClientResponse obtainOauth2RefreshTokenPost(String grantType, String token, MultivaluedMap<String, String> formParams);
/**
* 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 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);
T viewFullDetailsXml(String orcid, String messageVersion);
/**
* 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 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);
/**
* 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 XML representation of the ORCID record containing only affiliation
* 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 viewAffiliationDetailsXml(@PathParam("orcid") String orcid);
/**
* 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);
}