@Requirement(reqId="DOI_INTER_020", reqName="Interface avec CrossCite Citation") public class ClientCrossCiteCitation extends BaseClient
Modifier and Type | Class and Description |
---|---|
static class |
ClientCrossCiteCitation.Context
Options for each context.
|
Modifier and Type | Field and Description |
---|---|
private ClientCrossCiteCitation.Context |
contextUse
Context use.
|
static String |
CROSS_CITE_MOCK_URL
Service end point "http://localhost:1080".
|
static String |
CROSS_CITE_URL
Service end point "http://citation.crosscite.org".
|
static String |
FORMAT_URI
URI to get format "format".
|
static String |
LOCALE_URI
URI to get locales "locales".
|
static String |
STYLE_URI
URI to get styles "styles".
|
DATACITE_MOCKSERVER_PORT
Constructor and Description |
---|
ClientCrossCiteCitation()
Creates a client to "http://citation.crosscite.org" with a
prod context and without a proxy. |
ClientCrossCiteCitation(ClientCrossCiteCitation.Context context)
Creates a client to an URI related to the context.
|
Modifier and Type | Method and Description |
---|---|
String |
getFormat(String doiName,
String style,
String language)
Returns the citation of a DOI based on the selected style and language.
|
List<String> |
getLanguages()
Returns languages by calling "locales".
|
private List<String> |
getList(String segment)
Returns the response as a list of String of an URI.
|
List<String> |
getStyles()
Returns styles by calling "styles".
|
protected void |
init()
Init the endpoint.
|
getClient, getLog
public static final String CROSS_CITE_URL
public static final String CROSS_CITE_MOCK_URL
public static final String STYLE_URI
public static final String LOCALE_URI
public static final String FORMAT_URI
private final ClientCrossCiteCitation.Context contextUse
public ClientCrossCiteCitation()
prod
context and without a proxy.public ClientCrossCiteCitation(ClientCrossCiteCitation.Context context)
context
- contextprotected void init()
private List<String> getList(String segment) throws ClientCrossCiteException
segment
- resource nameClientCrossCiteException
- - if an error happens when requesting
CrossCitepublic List<String> getStyles() throws ClientCrossCiteException
ClientCrossCiteException
- Will thrown an
Exception when a problem happens during the request to Cross Citepublic List<String> getLanguages() throws ClientCrossCiteException
ClientCrossCiteException
- Will thrown an
Exception when a problem happens during the request to Cross Citepublic String getFormat(String doiName, String style, String language) throws ClientCrossCiteException
doiName
- DOI namestyle
- Selected style to format the citationlanguage
- Selected language to format the citationClientCrossCiteException
- Will thrown an
Exception when a problem happens during the request to Cross CiteCopyright © 2017–2020 CNES. All rights reserved.