You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by ij...@apache.org on 2014/07/01 17:29:04 UTC

svn commit: r1607114 - in /jena/Experimental/jena-fuseki2/src/main/webapp/js/app: models/dataset-stats.js models/dataset.js views/dataset-info.js

Author: ijd
Date: Tue Jul  1 15:29:04 2014
New Revision: 1607114

URL: http://svn.apache.org/r1607114
Log:
Update to reflect minor change in JSON structure being returned from the server

Modified:
    jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset-stats.js
    jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset.js
    jena/Experimental/jena-fuseki2/src/main/webapp/js/app/views/dataset-info.js

Modified: jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset-stats.js
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset-stats.js?rev=1607114&r1=1607113&r2=1607114&view=diff
==============================================================================
--- jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset-stats.js (original)
+++ jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset-stats.js Tue Jul  1 15:29:04 2014
@@ -31,16 +31,16 @@ define(
       /** Return a table of the statistics we have, one row per dataset */
       asTable: function() {
         var ds = this.datasets();
-        var services = this.collectServices( ds );
+        var endpoints = this.collectEndpoints( ds );
         var rows = [];
 
         _.each( ds, function( d, dsName ) {
           var row = [dsName, d.Requests, d.RequestsGood, d.RequestsBad];
-          var s = d.services;
+          var es = d.endpoints;
 
-          _.each( services, function( service ) {
-            if (s[service]) {
-              var servStats = s[service];
+          _.each( endpoints, function( e ) {
+            if (es[e.key]) {
+              var servStats = es[e.key];
 
               if (servStats.Requests === 0) {
                 row.push( "0" );
@@ -57,7 +57,7 @@ define(
           rows.push( row );
         } );
 
-        return {headings: this.columnHeadings( services ), rows: rows};
+        return {headings: this.columnHeadings( endpoints ), rows: rows};
       },
 
       stats: function() {
@@ -70,21 +70,19 @@ define(
 
       // internal methods
 
-      collectServices: function( ds ) {
-        var services = [];
+      collectEndpoints: function( ds ) {
+        var endpoints = [];
         _.each( ds, function( d ) {
-          services = services.concat( _.keys( d.services ) );
+          var ep = _.each( d.endpoints, function( v, k ) {
+            endpoints.push( {key: k, label: v.description} );
+          } );
         } );
-        return _.uniq( services ).sort();
+
+        return _.uniq( endpoints ).sort();
       },
 
       columnHeadings: function( services ) {
-        // we replace the name of the empty service - where the user can post quads
-        // with something more understandable
-        var svcs = _.map( services, function( s ) {
-          return s === "" ? "quads" : s;
-        } );
-        return ["Service name", "overall", "overall good", "overall bad"].concat( svcs );
+        return ["Name", "Overall", "Overall good", "Overall bad"].concat( _.pluck( services, 'label' ) );
       }
     } );
 

Modified: jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset.js
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset.js?rev=1607114&r1=1607113&r2=1607114&view=diff
==============================================================================
--- jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset.js (original)
+++ jena/Experimental/jena-fuseki2/src/main/webapp/js/app/models/dataset.js Tue Jul  1 15:29:04 2014
@@ -57,7 +57,7 @@ define(
 
         _.each( this.services(), function( s ) {
           _.each( s["srv.endpoints"], function( e ) {
-            description.push( {label: s["srv.type"],
+            description.push( {label: s["srv.description"],
                                url: self.datasetEndpointURL( e )
                               } );
           } );
@@ -96,17 +96,17 @@ define(
 
       /** Return the sparql query URL for this dataset, if it has one, or null */
       queryURL: function() {
-        return this.endpointURL( "query" ) ;
+        return this.endpointURL( "Query" ) ;
       },
 
       /** Return the sparql update URL for this dataset, if it has one, or null */
       updateURL: function() {
-        return this.endpointURL( "update" ) ;
+        return this.endpointURL( "Update" ) ;
       },
 
       /** Return the GSP write URL for this dataset, if it has one, or null */
       graphStoreProtocolURL: function() {
-        return this.endpointURL( "graph store protocol" ) ;
+        return this.endpointURL( "GSP" ) ;
       },
 
       /** Return the sparql upload URL for this dataset, if it has one, or null */

Modified: jena/Experimental/jena-fuseki2/src/main/webapp/js/app/views/dataset-info.js
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-fuseki2/src/main/webapp/js/app/views/dataset-info.js?rev=1607114&r1=1607113&r2=1607114&view=diff
==============================================================================
--- jena/Experimental/jena-fuseki2/src/main/webapp/js/app/views/dataset-info.js (original)
+++ jena/Experimental/jena-fuseki2/src/main/webapp/js/app/views/dataset-info.js Tue Jul  1 15:29:04 2014
@@ -12,6 +12,8 @@ define(
     var DatasetInfo = Backbone.Marionette.ItemView.extend( {
 
       initialize: function() {
+        _.bindAll( this, "onShowTab" );
+
         var dataset = this.dataset();
 
         this.model
@@ -31,6 +33,7 @@ define(
       el: "#info .with-dataset",
 
       events: {
+        "shown.bs.tab": "onShowTab"
       },
 
       templateHelpers: {
@@ -43,11 +46,13 @@ define(
       /** Alias for the model */
       dataset: function() {
         return this.model;
-      }
+      },
 
       // event handlers
 
-
+      onShowTab: function( e ) {
+        var tab = $(e.target);
+      }
     });