/** * ============================================================================= * * 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.t2; 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.*; /** * An interface representing read-only access to the Orcid * Service. This requires the use of an access token even to read data. * * @author James Bowen */ public interface OAuthOrcidApiService<T> { /** * @return Plain text message indicating health of service */ @GET @Produces(value = { MediaType.TEXT_PLAIN }) @Path(STATUS_PATH) public T viewStatusText(String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); T viewFullDetailsXml(String orcid, String accessToken, 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); /** * 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, String accessToken); }