Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:translator_overview [2008/12/11 12:18] ahowarddev:translator_overview [2017/11/12 19:53] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +<html><p id="zotero-5-update-warning" style="color: red; font-weight: bold">We’re
 +in the process of updating the documentation for
 +<a href="https://www.zotero.org/blog/zotero-5-0">Zotero 5.0</a>. Some documentation
 +may be outdated in the meantime. Thanks for your understanding.</p></html>
 +
 +
 Site translators are discrete pieces of code that extract web-based metadata and then insert it into a Zotero item.  Writing them sometimes requires a little ingenuity, but this overview should help to simplify the process.  This document will not cover the nitty gritty of GUIDs, sqlite insertion, etc.  It intended instead to get developers thinking about how translators work.   Site translators are discrete pieces of code that extract web-based metadata and then insert it into a Zotero item.  Writing them sometimes requires a little ingenuity, but this overview should help to simplify the process.  This document will not cover the nitty gritty of GUIDs, sqlite insertion, etc.  It intended instead to get developers thinking about how translators work.  
  
Line 32: Line 38:
 ===== Step 4: Put Everything in Its Place ===== ===== Step 4: Put Everything in Its Place =====
 Once we have our metadata, we need only to create a new Zotero item and then populate its fields.  Usually translators perform this task inline with parsing the metadata, so that as each piece of metadata is retrieved, it goes into the appropriate [[Zotero metadata format|Zotero item field]].  Sometimes we might want to add some additional information that does not appear in the metadata or that does not have an appropriate item field in the Zotero case type.  Perhaps we are looking at a journal article and have pulled a clean set of metadata about the article, but we also want to include the article's associated PDF file.  We can tailor the translator to download that file and add it as an attachment to the Zotero item.  Alternatively, we may find a good piece of miscellaneous metadata that we want to keep.  Amazon, for example, provides two release dates for DVD films: the DVD release date and the original theatrical release date.  If we want to include the latter, we can simply add it to the "extra" field so that it is saved along with the rest of the item's metadata. Once we have our metadata, we need only to create a new Zotero item and then populate its fields.  Usually translators perform this task inline with parsing the metadata, so that as each piece of metadata is retrieved, it goes into the appropriate [[Zotero metadata format|Zotero item field]].  Sometimes we might want to add some additional information that does not appear in the metadata or that does not have an appropriate item field in the Zotero case type.  Perhaps we are looking at a journal article and have pulled a clean set of metadata about the article, but we also want to include the article's associated PDF file.  We can tailor the translator to download that file and add it as an attachment to the Zotero item.  Alternatively, we may find a good piece of miscellaneous metadata that we want to keep.  Amazon, for example, provides two release dates for DVD films: the DVD release date and the original theatrical release date.  If we want to include the latter, we can simply add it to the "extra" field so that it is saved along with the rest of the item's metadata.
 +
 +===== Step 5: Contribute Your Translator =====
 +If your new or modified translator would be useful to others, 
 +  - upload your JavaScript to [[http://groups.google.com/group/zotero-dev/files|section=Files of the Zotero developers googlegroup]].
 +  - notify the [[http://groups.google.com/group/zotero-dev|Zotero developers mailing list]].
 +
dev/translator_overview.1229015936.txt.gz · Last modified: 2008/12/11 12:18 by ahoward