本文整理了Java中de.undercouch.citeproc.zotero.ZoteroConnector
类的一些代码示例,展示了ZoteroConnector
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoteroConnector
类的具体详情如下:
包路径:de.undercouch.citeproc.zotero.ZoteroConnector
类名称:ZoteroConnector
[英]Connects to the Zotero API v2. Needs an OAuth API key and secret in order to authenticate. Users of this class should register their app to receive such a key and secret.
[中]连接到Zotero API v2。需要OAuth API密钥和密码才能进行身份验证。这个类的用户应该register their app才能收到这样的密钥和秘密。
代码示例来源:origin: de.undercouch/citeproc-java
@Override
public CSLItemData getItem(String itemId) throws IOException {
Map<String, CSLItemData> r = getItems(Arrays.asList(itemId));
return r.get(itemId);
}
代码示例来源:origin: michel-kraemer/citeproc-java
@Override
protected ZoteroConnector createRemoteConnector(String consumerKey,
String consumerSecret) {
return new ZoteroConnector(consumerKey, consumerSecret);
}
代码示例来源:origin: michel-kraemer/citeproc-java
int s = 0;
while (s < itemIds.size()) {
int n = Math.min(getMaxBulkItems(), itemIds.size() - s);
List<String> itemsToRequest = itemIds.subList(s, s + n);
String istr = StringUtils.join(itemsToRequest, ',');
Map<String, Object> res = performRequestObject(ENDPOINT_USERS +
userId + "/items?key=" + key +
"&content=" + CSLJSON +
代码示例来源:origin: michel-kraemer/citeproc-java
@Override
public List<String> getItemIDs() throws IOException {
if (accessToken == null) {
throw new UnauthorizedException("Access token has not yet been requested");
}
//since Zotero uses a single API key we store the user ID in the token
//see ZoteroOAuth#responseToToken(Map<String, String>)
String userId = accessToken.getToken();
String key = accessToken.getSecret();
Map<String, Object> res = performRequestObject(ENDPOINT_USERS +
userId + "/items?key=" + key + "&newer=0&format=versions"
+ "&itemType=-attachment", REQUEST_HEADERS);
return new ArrayList<>(res.keySet());
}
代码示例来源:origin: de.undercouch/citeproc-java
int s = 0;
while (s < itemIds.size()) {
int n = Math.min(getMaxBulkItems(), itemIds.size() - s);
List<String> itemsToRequest = itemIds.subList(s, s + n);
String istr = StringUtils.join(itemsToRequest, ',');
Map<String, Object> res = performRequestObject(ENDPOINT_USERS +
userId + "/items?key=" + key +
"&content=" + CSLJSON +
代码示例来源:origin: de.undercouch/citeproc-java
@Override
public List<String> getItemIDs() throws IOException {
if (accessToken == null) {
throw new UnauthorizedException("Access token has not yet been requested");
}
//since Zotero uses a single API key we store the user ID in the token
//see ZoteroOAuth#responseToToken(Map<String, String>)
String userId = accessToken.getToken();
String key = accessToken.getSecret();
Map<String, Object> res = performRequestObject(ENDPOINT_USERS +
userId + "/items?key=" + key + "&newer=0&format=versions"
+ "&itemType=-attachment", REQUEST_HEADERS);
return new ArrayList<>(res.keySet());
}
代码示例来源:origin: michel-kraemer/citeproc-java
@Override
public CSLItemData getItem(String itemId) throws IOException {
Map<String, CSLItemData> r = getItems(Arrays.asList(itemId));
return r.get(itemId);
}
内容来源于网络,如有侵权,请联系作者删除!