Follow-up: Google docs plugin: How to the urls relate to Zotero items?

19 views
Skip to first unread message

Bjoern Hassler

unread,
Feb 22, 2020, 11:05:09 AM2/22/20
to zotero-dev
Hello @adomasven,

Follow-up to the post here:
https://forums.zotero.org/discussion/81432/google-docs-plugin-how-to-the-urls-relate-to-zotero-items#latest

I've written up our process here:

At the end, there are some questions. We would love to use the Zotero GDocs plugin to insert references, as it’s easier to use than our process (effectively scannable cites).

- For this to work, the plugin would have to insert the library/group ID and the item ID.

- We work on GDocs collaboratively, and we would therefore want to restrict the search to the group library (rather than searching everything one user has access too.

There are some more considerations in the Google Doc, but those two are the main ones.

Many thanks!
Björn

Adomas Venčkauskas

unread,
Feb 24, 2020, 3:34:13 AM2/24/20
to zotero-dev
On Saturday, 22 February 2020 18:05:09 UTC+2, Bjoern Hassler wrote:
At the end, there are some questions. We would love to use the Zotero GDocs plugin to insert references, as it’s easier to use than our process (effectively scannable cites).

- For this to work, the plugin would have to insert the library/group ID and the item ID.

- We work on GDocs collaboratively, and we would therefore want to restrict the search to the group library (rather than searching everything one user has access too.

There are some more considerations in the Google Doc, but those two are the main ones.

So the main thing I want to note here that the Zotero Google Docs integration works essentially the same as Word and LibreOffice integrations. I.e. the cited text has field codes attached to them, which contains all the information required to identify the item in the user's library as well as item metadata. In Word and LibreOffice this is very transparent since you can toggle field code display and view the underlying codes directly. In Google Docs we use a bit of a heavy hack to achieve effectively the same thing. I will spare you the details on how this is implemented, but since you already use GD Script in your workflow, it would seem to me that integrating with the Zotero Google Docs plugin should be fairly straightforward, since the plugin also uses GD Script, including for things like retrieving field codes. As noted in the forum post this code (along with accompanying functions called in it) is responsible for retrieving all field codes (i.e. Zotero inserted citation metadata) in the document in the order of appearance. You will have to modify it somewhat for your purposes, but hopefully the code is readable and understandable enough for it to be fairly trivial, although I can help you if you get stuck with anything.

As for your other requests outlined in your process doc: (2) is not possible since the plugin uses the Zotero integration pipeline present in Word and LibreOffice and that would require modifications of the Zotero client itself. (3) is hard, but I would imagine possible with a lot of work, either if you write some gdscript to encode your scannable cites to Zotero field codes and encode them into the document using the functions form Zotero google docs plugin GD script.

Encoding item and group data into the links Zotero creates for the citations is not planned since it would be excessive and unnecessary added complexity to the plugin, which already is extremely complex when taken in its entirety.

Bjoern Hassler

unread,
Feb 25, 2020, 5:01:24 AM2/25/20
to zotero-dev
Thanks - that's very useful. I'll need a bit of time to tinker, but this is really helpful, many thanks!
Björn
Reply all
Reply to author
Forward
0 new messages