Available fields for OpenSearch lookup engines

Hi!,

I'm playing around with the new nice support for lookup engines. However, where can I find a specification of what zotero-specific fields are available? The documentation here:
http://www.zotero.org/support/dev/creating_locate_engines_using_opensearch
Says the following:
"Zotero also supports any Zotero field in the Zotero namespace (http://www.zotero.org/namespaces/openSearch#). The following special fields are also supported [...]"

But where can I find a definition of that namespace? (The namespace address gives page not found.)

Specifically, one of the things I am trying to find out if there are any fields at all available from attached files and links. E.g., 'filename'.
  • /engines.json in the Zotero source has:
    "_urlTemplate": "http://pubget.com/openurl?rft.title={rft:title}&rft.issue={rft:issue?}&rft.spage={rft:spage?}&rft.epage={rft:epage?}&rft.issn={rft:issn?}&rft.jtitle={rft:stitle?}&doi={z:DOI?}",

    "_urlTemplate": "http://scholar.google.com/scholar?as_q=&as_epq={z:title}&as_occt=title&as_sauthors={rft:aufirst?}+{rft:aulast?}&as_ylo={z:year?}&as_yhi={z:year?}&as_sdt=1.&as_sdtp=on&as_sdtf=&as_sdts=22&",

    Not sure what else is defined, but this should be a start.
  • Looks like any Zotero field (on an item object) can be accessed. That still won't give you filenames, I think, but I don't know the Zotero item object that well (it is different internally from what you see in translator development).

    Further questions should probably be directed to zotero-dev (http://groups.google.com/group/zotero-dev/) or #zotero-dev on freenode.

    See approx. line 294 in chrome/content/zotero/xpcom/locateManager.js:
    } else if(ns === "http://www.zotero.org/namespaces/openSearch#") {
    if(param === "openURL") {
    var ctx = Zotero.OpenURL.createContextObject(item, "1.0");
    return (ctx ? [ctx] : false);
    } else if(param === "year") {
    return (itemOpenURL["rft.date"] ? [itemOpenURL["rft.date"][0].substr(0, 4)] : false);
    } else {
    var result = item.getField(param);
    return (result ? [encodeURIComponent(result)] : false);
    }
    }
  • Thanks for the hints!

    Any idea where I can find a list of the Zotero field names on item objects?

    The code you cite show how z:openURL and z:year are handled specifically, and anything else is given by item.getField(). So the question is what I can get out of getField(), and if I can get anything out of a getField() for an attached file or link object. (Are those objects even 'items'?)

    Sure, I'll move this over to -dev once I feel comfortable enough that I understand what I am asking for :)
  • Many thanks! That is a great link. (Shouldn't the zotero dev-docs really link to that?)

    If someone else finds this thread, for the filename for attached pdfs and links, I did some exploration in the data structures, and it seems they are obtainable simply by {z:title}.
  • They should link to that, and they will. The docs are being worked on right now-- you're welcome to chip in by appending ?do=login to any page and registering to edit the wiki.
  • So great to find this... Wish zotero fly higher
    I am trying to add a lookup for the comment of the journal by which a journal article is published. I tried {z:issn},but the lookup engine won't show up in the UI. I also tried {z:pulisher} or {z:pulication}, and they won't work too.
  • No need for the Way Back Machine, the typeMap (updated for the latest Zotero which has significant updates) is still available at that link: https://aurimasv.github.io/z2csl/typeMap.xml
Sign In or Register to comment.