public class ZoteroConnector extends AbstractRemoteConnector
accessToken, auth, requestToken| Constructor and Description |
|---|
ZoteroConnector(String consumerKey,
String consumerSecret)
Constructs a new connector
|
| Modifier and Type | Method and Description |
|---|---|
protected OAuth |
createOAuth(String consumerKey,
String consumerSecret,
String redirectUri)
Creates an OAuth object
|
CSLItemData |
getItem(String itemId)
Requests an item from the service.
|
List<String> |
getItemIDs()
Requests a list of item IDs from the server.
|
Map<String,CSLItemData> |
getItems(List<String> itemIds)
Requests several items from the service.
|
int |
getMaxBulkItems() |
protected OAuth.Method |
getOAuthAccessTokenMethod() |
protected String |
getOAuthAccessTokenURL() |
protected String |
getOAuthAuthorizationURL() |
protected String |
getOAuthRequestTokenURL() |
protected Map<String,Object> |
parseResponseObject(Response response)
Parses the given response.
|
authorize, getAccessTokenSecret, getAccessTokenValue, getAuthorizationURL, parseResponseArray, performRequest, performRequestArray, performRequestObject, setAccessTokenprotected String getOAuthRequestTokenURL()
getOAuthRequestTokenURL in class AbstractRemoteConnectorprotected String getOAuthAuthorizationURL()
getOAuthAuthorizationURL in class AbstractRemoteConnectorprotected String getOAuthAccessTokenURL()
getOAuthAccessTokenURL in class AbstractRemoteConnectorprotected OAuth.Method getOAuthAccessTokenMethod()
getOAuthAccessTokenMethod in class AbstractRemoteConnectorprotected OAuth createOAuth(String consumerKey, String consumerSecret, String redirectUri)
AbstractRemoteConnectorcreateOAuth in class AbstractRemoteConnectorconsumerKey - the app's consumer keyconsumerSecret - the app's consumer secretredirectUri - the location users are redirected to after
they granted the app accesspublic List<String> getItemIDs() throws IOException
RemoteConnectorUnauthorizedException - if the user is not authenticatedRequestException - if the server returns an error codeIOException - if the items could not be read from the serverpublic CSLItemData getItem(String itemId) throws IOException
RemoteConnectoritemId - the item's IDUnauthorizedException - if the user is not authenticatedRequestException - if the server returns an error codeIOException - if the item could not be read from the serverprotected Map<String,Object> parseResponseObject(Response response) throws IOException
AbstractRemoteConnectorparseResponseObject in class AbstractRemoteConnectorresponse - the HTTP response to parseIOException - if the response could not be readpublic Map<String,CSLItemData> getItems(List<String> itemIds) throws IOException
RemoteConnectorRequests several items from the service. The user has to be authenticated before this method can be called.
Some services support bulk loading. In this case, this method
makes as few requests as possible. The RemoteConnector.getMaxBulkItems()
method returns the maximum number of items that can be queried
within one request.
itemIds - the IDs of the items to requestUnauthorizedException - if the user is not authenticatedRequestException - if the server returns an error codeIOException - if one of the items could not be read from the serverRemoteConnector.getMaxBulkItems()public int getMaxBulkItems()
RemoteConnector.getItems(List)