When the user invokes the Export Tripleloader command, check if the protograph is null or not and alert accordingly.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@321 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-03-18 23:35:54 +00:00
parent b54f7162a8
commit 5db6ee8ae5

View File

@ -31,7 +31,7 @@ MenuBar.prototype._initializeUI = function() {
{},
{
"label": "Tripleloader",
"click": function() { self._doExportRows("tripleloader", "txt"); }
"click": function() { self._doExportTripleloader(); }
}
]
},
@ -145,6 +145,17 @@ MenuBar.prototype._deactivateMenu = function() {
this._mode = "inactive";
};
MenuBar.prototype._doExportTripleloader = function() {
if (theProject.protograph == null) {
alert(
"You haven't done any schema alignment yet,\nso there is no triple to export.\n\n" +
"Use the Schemas > Edit Schema Alignment Skeleton...\ncommand to align your data with Freebase schemas first."
);
} else {
this._doExportRows("tripleloader", "txt");
}
};
MenuBar.prototype._doExportRows = function(format, ext) {
var name = $.trim(theProject.metadata.name.replace(/\W/g, ' ')).replace(/\s+/g, '-');
var form = document.createElement("form");