From 97ed9ccbfe91e7af593646b0c9a0009e73e5f968 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 10 Feb 2012 16:10:10 -0500 Subject: [PATCH] Serialize RDF to string on export --- chrome/content/zotero/xpcom/translation/translate.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 4db52ca9d..6eb682547 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1552,7 +1552,7 @@ Zotero.Translate.Import.prototype.setString = function(string) { Zotero.Translate.Import.prototype.complete = function(returnValue, error) { if(this._io) { this._progress = null; - this._io.close(); + this._io.close(false); } // call super @@ -1732,7 +1732,7 @@ Zotero.Translate.Export.prototype.setDisplayOptions = function(displayOptions) { Zotero.Translate.Export.prototype.complete = function(returnValue, error) { if(this._io) { this._progress = null; - this._io.close(); + this._io.close(true); if(this._io instanceof Zotero.Translate.IO.String) { this.string = this._io.string; } @@ -2068,7 +2068,13 @@ Zotero.Translate.IO.String.prototype = { } }, - "close":function() {} + "close":function(serialize) { + // if we are writing in RDF data mode and no string is set, serialize current RDF to the + // string + if(serialize && Zotero.Translate.IO.rdfDataModes.indexOf(this._mode) !== -1 && this.string === "") { + this.string = this.RDF.serialize(); + } + } } /****** RDF DATA MODE ******/