We’re in the process of updating the documentation for Zotero 5.0. Some documentation may be outdated in the meantime. Thanks for your understanding.

Functions and objects in the translator sandbox

This is a list of the functions and objects exposed to translators running in the sandbox. As it was generated from the existing translators, this list is probably not complete, and some of the functions may be deprecated or unavailable in certain types of translators. Most of the below are described in the general Translator Coding documentation, or the Translator overview. Others are rarely used– search in the code of existing translators for usage guidance.

Objects

  • Zotero.Collection
  • Zotero.Item

Functions

  • Zotero.debug
  • Zotero.getOption
  • Zotero.getXML
  • Zotero.loadTranslator
  • Zotero.monitorDOMChanges NEW since 4.0
  • Zotero.nextCollection
  • Zotero.nextItem
  • Zotero.read
  • Zotero.selectItems
  • Zotero.setCharacterSet
  • Zotero.setProgress
  • Zotero.write

Utility functions

  • Zotero.Utilities.capitalizeTitle
  • Zotero.Utilities.cleanAuthor
  • Zotero.Utilities.cleanTags
  • Zotero.Utilities.createContextObject
  • Zotero.Utilities.doGet
  • Zotero.Utilities.doPost
  • Zotero.Utilities.formatDate
  • Zotero.Utilities.gatherElementsOnXPath
  • Zotero.Utilities.getCreatorsForType
  • Zotero.Utilities.getItemArray
  • Zotero.Utilities.getLocalizedCreatorType
  • Zotero.Utilities.getPageRange
  • Zotero.Utilities.getVersion
  • Zotero.Utilities.htmlSpecialChars
  • Zotero.Utilities.HTTP.doGet
  • Zotero.Utilities.HTTP.doPost
  • Zotero.Utilities.itemTypeExists
  • Zotero.Utilities.loadDocument
  • Zotero.Utilities.lpad
  • Zotero.Utilities.parseContextObject
  • Zotero.Utilities.processAsync
  • Zotero.Utilities.processDocuments
  • Zotero.Utilities.removeDiacritics NEW since 3.0
  • Zotero.Utilities.retrieveDocument unavailable since 3.0
  • Zotero.Utilities.retrieveSource unavailable since 3.0
  • Zotero.Utilities.strToDate
  • Zotero.Utilities.strToISO
  • Zotero.Utilities.superCleanString
  • Zotero.Utilities.text2html
  • Zotero.Utilities.trim DEPRECATED use “.trim()” instead
  • Zotero.Utilities.trimInternal
  • Zotero.Utilities.unescapeHTML
  • Zotero.Utilities.xpath NEW since 2.1
  • Zotero.Utilities.xpathText NEW since 2.1

The utility functions are defined in utilities.js.

RDF functions

  • Zotero.RDF.addContainerElement
  • Zotero.RDF.addNamespace
  • Zotero.RDF.addStatement
  • Zotero.RDF.getAllResources
  • Zotero.RDF.getArcsIn DEPRECATED since 2.1, use Z.RDF.getStatementsMatching(undefined, undefined, .)
  • Zotero.RDF.getArcsOut DEPRECATED since 2.1, use Z.RDF.getStatementsMatching(., undefined, undefined)
  • Zotero.RDF.getContainerElements
  • Zotero.RDF.getResourceURI
  • Zotero.RDF.getSources DEPRECATED since 2.1, use Z.RDF.getStatementsMatching(undefined, ., .)
  • Zotero.RDF.getStatementsMatching
  • Zotero.RDF.getTargets DEPRECATED since 2.1, use Z.RDF.getStatementsMatching(., ., undefined)
  • Zotero.RDF.newContainer
  • Zotero.RDF.newResource

The RDF functions are defined in translator.js.

XML objects

  • DOMParser
  • XML
dev/translators/functions.txt · Last modified: 2017/11/12 19:53 by 127.0.0.1