Changing collection naming behavior on import

I understand that, if this is possible, it would require some mucking around in the Zotero source code -- and I'm perfectly willing to do that, if someone can point me in the direction of the critical file(s).

I'm introducing a class of 350 students at university to the joys of Zotero. I've been having them turn in a zipped, exported Zotero RDF (+notes -files) via Blackboard Learning System.

The issues is this: I have to manually import each student's records into Zotero and, once imported, I can't reliably tell one student's work from anothers. Asking them to add a note with their ID is a non-starter -- their compliance would be too unreliable.

Default behavior in Zotero is to name the imported collection as "Imported <datetime stamp>". I would like to change that behavior to name the collection based on the name of the Zotero RDF file. For example, my exported Zotero RDF might be named wdoane.rdf. I'd like Zotero to name the imported collection (at a minimum) "wdoane", or preferably, "Imported wdoane <datetime stamp>".

I'm completely comfortable in JavaScript, if not conversant with the Zotero code tree.

Any help/suggestions for source code to target would be appreciated.
  • Take a look at _importTranslatorsAvailable() in chrome/content/zotero/fileInterface.js. You can get the filename out of translation.path.

    See Modifying Zotero Files for info on editing.
  • PERFECT!


    I modified chrome/content/zotero/fileInterface.js, lines 226-231, by including the messy but for the moment functional


    var wejdFilename = translation.path.slice(translation.path.lastIndexOf("/") + 1);

    _importCollection = Zotero.Collections.add(Zotero.getString("fileInterface.imported")+" "+wejdFilename+" "+date.toLocaleString());
    which decidedly solves the logistical problem for me. Thank you very much!!
Sign In or Register to comment.