From 9ea0fde42260e13e7e94958a365757dd026c7526 Mon Sep 17 00:00:00 2001 From: OffrayLuna Date: Fri, 9 Dec 2016 19:57:58 +0000 Subject: [PATCH] Exporting subcollections as bibtex. --- src/Zotero/ZoteroLibrary.class.st | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Zotero/ZoteroLibrary.class.st b/src/Zotero/ZoteroLibrary.class.st index c82df28..54142b8 100644 --- a/src/Zotero/ZoteroLibrary.class.st +++ b/src/Zotero/ZoteroLibrary.class.st @@ -62,7 +62,7 @@ ZoteroLibrary >> items [ ] { #category : #querying } -ZoteroLibrary >> subcollectionInfoForKey: keyString [ +ZoteroLibrary >> subcollection: keyString [ "I give the general info for a subcollection, given is alphanumeric key" groupID ifNotNil: @@ -75,7 +75,20 @@ ZoteroLibrary >> subcollectionInfoForKey: keyString [ ] { #category : #querying } -ZoteroLibrary >> subcollectionItemsForKey: keyString [ +ZoteroLibrary >> subcollectionAsBibTeX: keyString [ + "I give all the items for a subcollection, given is alphanumeric key, excluding notes and attachments, exported as bibtex" + + groupID ifNotNil: + [ ^ (ZnEasy get: 'https://api.zotero.org/groups/',groupID,'/collections/',keyString,'/items?itemType=-note%20 || attachment &format=bibtex') contents utf8Decoded]. + userID + ifNotNil: [ + ^ ZnEasy get: 'https://api.zotero.org/users/',userID,'/collections/',keyString,'/items?itemType=-note || attachment%20&format=bibtex' contents utf8Decoded] + ifNil: [ self inform: 'groupID or userID should be not nil. Please fill them to get a proper answer.'. + ^ self ] +] + +{ #category : #querying } +ZoteroLibrary >> subcollectionItems: keyString [ "I give all the items for a subcollection, given is alphanumeric key, including notes, attachments" groupID ifNotNil: @@ -90,7 +103,7 @@ ZoteroLibrary >> subcollectionItemsForKey: keyString [ ] { #category : #querying } -ZoteroLibrary >> subcollectionParentItemsForKey: keyString [ +ZoteroLibrary >> subcollectionParentItems: keyString [ "I give all the items for a subcollection, given is alphanumeric key, excluding notes and attachments" groupID ifNotNil: