diff --git a/main/webapp/modules/core/langs/translation-default.json b/main/webapp/modules/core/langs/translation-default.json index fc97cf6cf..af2c3c76d 100644 --- a/main/webapp/modules/core/langs/translation-default.json +++ b/main/webapp/modules/core/langs/translation-default.json @@ -634,6 +634,7 @@ "pick-record": "Pick Record Elements", "merge-cluster": "Merge Selected & Re-Cluster", "merge-close": "Merge Selected & Close", + "export-cluster": "Export Clusters", "close": "Close", "reset-template": "Reset Template", "export": "Export", diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index e8723ec71..bccc7e54a 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -634,6 +634,7 @@ "pick-record": "Pick Record Elements", "merge-cluster": "Merge Selected & Re-Cluster", "merge-close": "Merge Selected & Close", + "export-cluster": "Export Clusters", "close": "Close", "reset-template": "Reset Template", "export": "Export", diff --git a/main/webapp/modules/core/langs/translation-es.json b/main/webapp/modules/core/langs/translation-es.json index c899bd5e0..98a8d6598 100644 --- a/main/webapp/modules/core/langs/translation-es.json +++ b/main/webapp/modules/core/langs/translation-es.json @@ -634,6 +634,7 @@ "pick-record": "Escojer elementos del registro", "merge-cluster": "Unir seleccionados y reagrupar", "merge-close": "Unir seleccionados y cerrar", + "export-cluster": "Exportar agrupaciones", "close": "Cerrar", "reset-template": "Restablecer la plantilla", "export": "Exportar", diff --git a/main/webapp/modules/core/langs/translation-fr.json b/main/webapp/modules/core/langs/translation-fr.json index 973df0d87..52dab6444 100644 --- a/main/webapp/modules/core/langs/translation-fr.json +++ b/main/webapp/modules/core/langs/translation-fr.json @@ -634,6 +634,7 @@ "pick-record": "Sélectionner les éléments des entrées", "merge-cluster": "Fusionner la sélection & regrouper", "merge-close": "Fusionner la sélection & fermer", + "export-cluster": "Exporter les groupes", "close": "Fermer", "reset-template": "Réinitialiser le modèle", "export": "Exporter", diff --git a/main/webapp/modules/core/langs/translation-it.json b/main/webapp/modules/core/langs/translation-it.json index 1027e8351..022ab88a1 100644 --- a/main/webapp/modules/core/langs/translation-it.json +++ b/main/webapp/modules/core/langs/translation-it.json @@ -634,6 +634,7 @@ "pick-record": "Seleziona gli elementi del record", "merge-cluster": "Unisci i selezionati & Ri-Cluster", "merge-close": "Unisci i selezionati & Chiudi", + "export-cluster": "Esporta cluster", "close": "Chiudi", "reset-template": "Resetta Template", "export": "Esporta", diff --git a/main/webapp/modules/core/langs/translation-jp.json b/main/webapp/modules/core/langs/translation-jp.json index ed39db29d..3d07b607e 100644 --- a/main/webapp/modules/core/langs/translation-jp.json +++ b/main/webapp/modules/core/langs/translation-jp.json @@ -634,6 +634,7 @@ "pick-record": "レコード要素を選択", "merge-cluster": "Merge Selected & Re-Cluster", "merge-close": "Merge Selected & Close", + "export-cluster": "クラスタを出力", "close": "閉じる", "reset-template": "テンプレートをリセット", "export": "出力", diff --git a/main/webapp/modules/core/langs/translation-zh.json b/main/webapp/modules/core/langs/translation-zh.json index 0951e4dfd..1fd4f391d 100644 --- a/main/webapp/modules/core/langs/translation-zh.json +++ b/main/webapp/modules/core/langs/translation-zh.json @@ -635,6 +635,7 @@ "pick-record": "选择记录", "merge-cluster": "合并选中 & 重新簇集", "merge-close": "合并选中 & 关闭", + "export-cluster": "导出簇", "close": "关闭", "reset-template": "重置模板", "export": "导出", diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html index e1bbc83f6..340fb8d6b 100644 --- a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.html @@ -56,6 +56,7 @@ + diff --git a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js index 5f08a4793..0eacd4254 100644 --- a/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/clustering-dialog.js @@ -69,6 +69,7 @@ ClusteringDialog.prototype._createDialog = function() { this._elmts.or_dialog_blockChars.html($.i18n._('core-dialogs')["block-chars"]); this._elmts.selectAllButton.html($.i18n._('core-buttons')["select-all"]); this._elmts.deselectAllButton.html($.i18n._('core-buttons')["unselect-all"]); + this._elmts.exportClusterButton.html($.i18n._('core-buttons')["export-cluster"]); this._elmts.applyReClusterButton.html($.i18n._('core-buttons')["merge-cluster"]); this._elmts.applyCloseButton.html($.i18n._('core-buttons')["merge-close"]); this._elmts.closeButton.html($.i18n._('core-buttons')["close"]); @@ -121,6 +122,7 @@ ClusteringDialog.prototype._createDialog = function() { this._elmts.selectAllButton.click(function() { self._selectAll(); }); this._elmts.deselectAllButton.click(function() { self._deselectAll(); }); + this._elmts.exportClusterButton.click(function() { self._onExportCluster(); }); this._elmts.applyReClusterButton.click(function() { self._onApplyReCluster(); }); this._elmts.applyCloseButton.click(function() { self._onApplyClose(); }); this._elmts.closeButton.click(function() { self._dismiss(); }); @@ -333,6 +335,11 @@ ClusteringDialog.prototype._onApplyReCluster = function() { }); }; +ClusteringDialog.prototype._onExportCluster = function() { + var self = this; + self._export(); +}; + ClusteringDialog.prototype._apply = function(onDone) { var clusters = this._getRestrictedClusters(); var edits = []; @@ -373,6 +380,26 @@ ClusteringDialog.prototype._apply = function(onDone) { } }; +ClusteringDialog.prototype._export = function() { + var clusters = this._getRestrictedClusters(); + var projectName = theProject.metadata.name; + var columnName = this._columnName; + var timeStamp = (new Date()).toISOString(); + var obj = { + 'projectName': projectName, + 'columnName': columnName, + 'timeStamp': timeStamp, + 'clusterMethod': this._method, + 'keyingFunction': this._function, + 'clusters': clusters + }; + var data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(obj)); + var link = document.createElement('a'); + link.href = 'data:' + data; + link.download = "clusters_" + projectName + "_" + columnName + "_" + timeStamp + ".json"; + link.click(); +}; + ClusteringDialog.prototype._dismiss = function() { DialogSystem.dismissUntil(this._level - 1); };