commit 97ed9ccbfe91e7af593646b0c9a0009e73e5f968
parent 61f9b49ddcc53e7d7662da172a78823cd8ee22a9
Author: Simon Kornblith <simon@simonster.com>
Date: Fri, 10 Feb 2012 16:10:10 -0500
Serialize RDF to string on export
Diffstat:
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
@@ -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 ******/