Feature Request: Author View/List
Hi,
I migrated to Zotero from Papers 3 (and previously Mendeley) and I've been very happy with the change. One feature I do miss from those other applications is a list of all the authors in my library, and a way to see what publications they are associated with. I don't believe Zotero or any existing plugin does this, but it'd be great to have in a future release.
Thanks.
I migrated to Zotero from Papers 3 (and previously Mendeley) and I've been very happy with the change. One feature I do miss from those other applications is a list of all the authors in my library, and a way to see what publications they are associated with. I don't believe Zotero or any existing plugin does this, but it'd be great to have in a future release.
Thanks.
This would be—oh so useful. There is already a panel with the list of tags and search capability. Is there a specific difficulty to do the same for authors? Maybe journals as well? Can someone provide some guidelines on how that could be implemented? Thanks!
Please, it makes so much sense to have it along with the tags panel.
var names = await Zotero.DB.columnQueryAsync("SELECT DISTINCT TRIM(lastName || ', ' || firstName) AS creator FROM creators WHERE creatorID IN (SELECT creatorID FROM itemCreators JOIN items USING (itemID) WHERE libraryID=1) ORDER BY lastName");
return names.join('\n');
Variations on that are possible, for example limiting the list to the current selected collection and adding a count of the number of items each author is listed for:
var CurrentCollection = Zotero.getActiveZoteroPane().getSelectedCollection();
var sql = "SELECT TRIM(lastName || ', ' || firstName) AS author, COUNT(*) AS num FROM items JOIN itemCreators USING (itemID) JOIN creators USING (creatorID) JOIN collectionItems USING (itemID) JOIN collections USING (collectionID) WHERE collectionName=? GROUP BY author ORDER BY lastName ASC";
var rows = await Zotero.DB.queryAsync(sql,CurrentCollection.name);
var lines = [];
for (let row of rows) {
lines.push(row.author + '\t' + row.num);
}
return lines.join('\n');
Similarly, the following gets a list of all journals in the selected collection, and their item counts:
var CurrentCollection = Zotero.getActiveZoteroPane().getSelectedCollection();
var jnltitleFieldID = Zotero.ItemFields.getID('publicationTitle');
var sql = "SELECT value AS jnltitle, COUNT(*) AS num FROM itemData JOIN itemDataValues USING (valueID) JOIN collectionItems USING (itemID) JOIN collections USING (collectionID) WHERE fieldID=? AND collectionName=? GROUP BY jnltitle ORDER BY UPPER(jnltitle) ASC";
var rows = await Zotero.DB.queryAsync(sql,[jnltitleFieldID,CurrentCollection.name]);
var lines = [];
for (let row of rows) {
lines.push(row.jnltitle + '\t' + row.num);
}
return lines.join('\n');
A list of tags/counts is described here:
https://forums.zotero.org/discussion/97395/is-there-any-way-to-get-a-list-of-current-tags
It would be nice if such code snippets could be saved from within Zotero, so that they could be re-run easily from time to time, without having to cut and paste code from elsewhere.