Serialize RDF to string on export

This commit is contained in:
Simon Kornblith 2012-02-10 16:10:10 -05:00
parent 61f9b49ddc
commit 97ed9ccbfe

View File

@ -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 ******/