You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/06/01 16:04:23 UTC
[2/4] jena git commit: JENA-869 : Find the graph in the database
based on dataset name.
JENA-869 : Find the graph in the database based on dataset name.
This fix is based on based on PR#66.
This closes #66.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/52ac62d8
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/52ac62d8
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/52ac62d8
Branch: refs/heads/master
Commit: 52ac62d8484c255018f2309bb654bcdbf16b3644
Parents: a977f6a
Author: Andy Seaborne <an...@apache.org>
Authored: Mon Jun 1 15:00:52 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Mon Jun 1 15:00:52 2015 +0100
----------------------------------------------------------------------
.../org/apache/jena/fuseki/mgt/ActionDatasets.java | 10 ++++++----
.../webapp/js/app/templates/dataset-management.tpl | 3 +--
.../main/webapp/js/app/views/dataset-management.js | 16 +++++++++++++---
3 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/52ac62d8/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
index 273d717..e28c2ba 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
+++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
@@ -302,9 +302,11 @@ public class ActionDatasets extends ActionContainerItem {
// Make it invisible to the outside.
DataAccessPointRegistry.get().remove(name) ;
- // Name to graph
- // Statically configured databases aren't in the system database.
- Quad q = getOne(systemDSG, null, null, pServiceName.asNode(), null) ;
+ // Find graph associated with this dataset name.
+ // (Statically configured databases aren't in the system database.)
+
+ Node n = NodeFactory.createLiteral(DataAccessPoint.canonical(name)) ;
+ Quad q = getOne(systemDSG, null, null, pServiceName.asNode(), n) ;
// if ( q == null )
// ServletOps.errorBadRequest("Failed to find dataset for '"+name+"'");
if ( q != null ) {
@@ -350,7 +352,7 @@ public class ActionDatasets extends ActionContainerItem {
}
}
- // ---- Auxilary functions
+ // ---- Auxiliary functions
private static Quad getOne(DatasetGraph dsg, Node g, Node s, Node p, Node o) {
Iterator<Quad> iter = dsg.findNG(g, s, p, o) ;
http://git-wip-us.apache.org/repos/asf/jena/blob/52ac62d8/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/templates/dataset-management.tpl
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/templates/dataset-management.tpl b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/templates/dataset-management.tpl
index 24d40a6..9a01812 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/templates/dataset-management.tpl
+++ b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/templates/dataset-management.tpl
@@ -23,9 +23,8 @@
-->
<td>
<div>
- <!-- JENA-869 Disable download button until it works again
+ <!-- JENA-869 Disable download button until it works again -->
<a class="btn btn-sm action remove btn-primary" data-ds-id='<%= ds.name() %>'><i class='fa fa-times-circle'></i> remove</a>
- -->
<a class="btn btn-sm action backup btn-primary" data-ds-id='<%= ds.name() %>'><i class='fa fa-download'></i> backup</a>
<a class="btn btn-sm action add-data btn-primary" href="dataset.html?tab=upload&ds=<%= ds.name() %>"><i class='fa fa-upload'></i> upload data</a>
</div>
http://git-wip-us.apache.org/repos/asf/jena/blob/52ac62d8/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/views/dataset-management.js
----------------------------------------------------------------------
diff --git a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/views/dataset-management.js b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/views/dataset-management.js
index b4405dd..ca3af74 100644
--- a/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/views/dataset-management.js
+++ b/jena-fuseki2/jena-fuseki-core/src/main/webapp/js/app/views/dataset-management.js
@@ -10,7 +10,7 @@ define(
initialize: function(){
_.bindAll( this, "onRemoveDataset", "onConfirmAction",
"onDatasetRemoveSuccess", "onDatasetRemoveFail",
- "onTaskStatus", "onTaskFailed" );
+ "onTaskStatus", "onTaskFailed", "cleanup" );
this.listenTo( this.model, "change", this.onModelChange, this );
@@ -38,10 +38,17 @@ define(
templateHelpers: {
},
+ cleanup: function() {
+ this.unbind();
+ this.undelegateEvents();
+ this.model.unbind( 'change', this.onModelChange, this );
+ fui.vent.unbind( 'action.delete.confirm', this.onConfirmRemoveDataset, this );
+ },
/** If the model changes, update the summary */
onModelChange: function( event ) {
- this.render();
+ this.cleanup();
+ this.render();
},
/** User has requested a dataset be removed */
@@ -86,7 +93,10 @@ define(
var dsId = elem.data( "ds-id" );
var eventId = elem.data( "event-id" );
- this.ui.actionConfirmModal.modal( 'hide' );
+ //this.ui.actionConfirmModal.modal( 'hide' );
+ $('.modal.in').modal('hide');
+ $('body').removeClass('modal-open');
+ $('.modal-backdrop').remove();
_.delay( function() {
fui.vent.trigger( eventId, dsId );
}, 100 );