Skip to content
This repository was archived by the owner on Apr 22, 2022. It is now read-only.

Commit 133eb58

Browse files
committed
fixing bugs
1 parent 370f073 commit 133eb58

File tree

10 files changed

+72
-94
lines changed

10 files changed

+72
-94
lines changed

src/main/resources/system-datasources.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@
6969
:fagi
7070
a onots:Database , onots:DataSource ;
7171
rdfs:label "local postgres Db"^^xsd:string ;
72-
onots:dbHost "192.168.2.22"^^xsd:string ;
72+
onots:dbHost "localhost"^^xsd:string ;
7373
onots:dbName "local postgres"^^xsd:string ;
74-
onots:dbPassword "postgres"^^xsd:string ;
74+
onots:dbPassword "fagi"^^xsd:string ;
7575
onots:dbPort "5432"^^xsd:string ;
7676
onots:dbType onots:PostGIS ;
77-
onots:dbUser "postgres"^^xsd:string .
77+
onots:dbUser "fagi"^^xsd:string .
7878

src/main/webapp/WEB-INF/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/webapp/js/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ app.config(function($routeSegmentProvider, $routeProvider)
6464
.when('/workbench/evolution-and-repair/coevolution-create', 'workbench.coevolution-create')
6565
.when('/workbench/evolution-and-repair/coevolution-apply', 'workbench.coevolution-apply')
6666

67+
68+
.when('/popup-triplegeo','popup-triplegeo')
69+
//.when('/popup-geolift','popup-geolift')
70+
6771
.segment('default', {
6872
templateUrl: 'default.html',
6973

src/main/webapp/js/workbench/extraction-and-loading/triplegeo-controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ var TripleGeoCtrl = function($scope, $http, ConfigurationService, ComponentsServ
1616
function(response){
1717
$scope.component = response;
1818
$scope.service = ComponentsService.getComponentService(serviceId, $scope.component);
19+
console.log($scope.service);
1920
if($scope.service== null)
2021
flash.error="Service not configured: " +serviceId;
22+
2123
},
2224
function(response){
2325
flash.error="Component not configured: " +ServerErrorResponse.getMessage(response);

src/main/webapp/js/workbench/linking-and-fusing/fagi-gis-controller.js

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
***************************************************************************************************/
77

8-
app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, ComponentsService, GraphService, AuthSessionService) {
8+
app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, ComponentsService, GraphService, AuthSessionService, Ns) {
99

1010
var componentId ="FagiGis";
1111
var serviceId = "FagiGisService";
@@ -47,15 +47,15 @@ app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, Compone
4747
var url= $scope.service.serviceUrl +
4848
'?endpoint-a=' + encodeURIComponent($scope.fagi.endpointA == $scope.endpoint? authEndpoint : $scope.fagi.endpointA ) +
4949
'&endpoint-b=' + encodeURIComponent($scope.fagi.endpointB == $scope.endpoint? authEndpoint : $scope.fagi.endpointB ) +
50-
'&dataset-a=' + encodeURIComponent($scope.fagi.datasetA!=""? $scope.fagi.datasetA.replace(':',ConfigurationService.getUriBase()):"") +
51-
'&dataset-b=' + encodeURIComponent($scope.fagi.datasetB!=""? $scope.fagi.datasetB.replace(':',ConfigurationService.getUriBase()):"") +
52-
'&postgis-username='+ encodeURIComponent($scope.fagi.database.dbUser) +
53-
'&postgis-password='+ encodeURIComponent($scope.fagi.database.dbPassword) +
54-
'&postgis-database='+ encodeURIComponent($scope.fagi.database.dbName) +
55-
'&virtuoso-host='+ encodeURIComponent($scope.fagi.database.dbHost) +
56-
'&virtuoso-port='+ encodeURIComponent($scope.fagi.database.dbPort) +
50+
'&dataset-a=' + encodeURIComponent($scope.fagi.datasetA!=""? Ns.lengthen($scope.fagi.datasetA):"") +
51+
'&dataset-b=' + encodeURIComponent($scope.fagi.datasetB!=""? Ns.lengthen($scope.fagi.datasetB):"") +
52+
'&postgis-username='+ encodeURIComponent("fagi") +
53+
'&postgis-password='+ encodeURIComponent("fagi") +
54+
// '&postgis-database='+ encodeURIComponent($scope.fagi.database.dbName) +
55+
// '&virtuoso-host='+ encodeURIComponent($scope.fagi.database.dbHost) +
56+
// '&virtuoso-port='+ encodeURIComponent($scope.fagi.database.dbPort) +
5757
'&target-endpoint='+ encodeURIComponent(authEndpoint) +
58-
'&target-dataset='+ encodeURIComponent($scope.fagi.targetGraph.replace(':',ConfigurationService.getUriBase())) ;
58+
'&target-dataset='+ encodeURIComponent(Ns.lengthen($scope.fagi.targetGraph)) ;
5959
console.log("endpoint" + authEndpoint);
6060
console.log(url);
6161
window.open(url);
@@ -90,27 +90,6 @@ app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, Compone
9090
return ngraph.graph.label + " | " + ngraph.name;
9191
};
9292

93-
$scope.updateServiceParams = function(){
94-
95-
// if(!$scope.fagiForm.$valid)
96-
// return;
97-
98-
// createAuthEndpoint().then(function(authEndpoint){
99-
// $scope.url= $scope.service.serviceUrl +
100-
// '?endpoint-a=' + encodeURIComponent($scope.fagi.endpointA == $scope.endpoint? authEndpoint : $scope.fagi.endpointA ) +
101-
// '&endpoint-b=' + encodeURIComponent($scope.fagi.endpointB == $scope.endpoint? authEndpoint : $scope.fagi.endpointB ) +
102-
// '&dataset-a=' + encodeURIComponent($scope.fagi.datasetA!=""? $scope.fagi.datasetA.replace(':',ConfigurationService.getUriBase()):"") +
103-
// '&dataset-b=' + encodeURIComponent($scope.fagi.datasetB!=""? $scope.fagi.datasetB.replace(':',ConfigurationService.getUriBase()):"") +
104-
// '&postgis-username='+ encodeURIComponent($scope.fagi.database.dbUser) +
105-
// '&postgis-password='+ encodeURIComponent($scope.fagi.database.dbPassword) +
106-
// '&postgis-database='+ encodeURIComponent($scope.fagi.database.dbName) +
107-
// '&virtuoso-host='+ encodeURIComponent($scope.fagi.database.dbHost) +
108-
// '&virtuoso-port='+ encodeURIComponent($scope.fagi.database.dbPort) +
109-
// '&target-endpoint='+ encodeURIComponent(authEndpoint) +
110-
// '&target-dataset='+ encodeURIComponent($scope.fagi.targetGraph.replace(':',ConfigurationService.getUriBase())) ;
111-
// console.log($scope.url);
112-
// });
113-
};
11493

11594
$scope.createTargetGraph = function(){
11695
// create a new graph to save data
@@ -144,9 +123,6 @@ app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, Compone
144123
$scope.updateServiceParams();
145124
};
146125

147-
$scope.$watch( function () { return $scope.fagiForm.$valid; }, function () {
148-
console.log("valid");
149-
$scope.updateServiceParams();
150-
});
126+
151127

152128
});

src/main/webapp/js/workbench/linking-and-fusing/fagi-gis.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h5 class="green bold">Dataset B</h5>
5252
</div>
5353
<br/>
5454

55-
<div class="row">
55+
<!-- <div class="row">
5656
<div class="col-xs-2">
5757
<label for="Database">Database</label>
5858
</div>
@@ -63,7 +63,7 @@ <h5 class="green bold">Dataset B</h5>
6363
</div>
6464
</div>
6565
<br/>
66-
66+
-->
6767
<div class="row">
6868
<div class="col-xs-2">
6969
<label for="Endpoint">Target Endpoint</label>

src/main/webapp/js/workbench/search-querying-and-exploration/esta-ld-controller.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ app.controller('EstaLdCtrl', function($scope, ConfigurationService, ComponentsSe
5656
console.log("endpoint: " + authEndpoint);
5757
console.log("graph: " + $scope.source.graph.replace(':',ConfigurationService.getUriBase()));
5858
console.log(url);
59-
6059
window.open(url);
6160
return false;
6261

@@ -66,10 +65,8 @@ app.controller('EstaLdCtrl', function($scope, ConfigurationService, ComponentsSe
6665
var url = $scope.sevice.serviceUrl +
6766
'?endpoint=' + encodeURIComponent($scope.source.endpoint) +
6867
'&graph=' + encodeURIComponent($scope.source.graph.replace(':',ConfigurationService.getUriBase()));
69-
70-
console.log(url);
71-
72-
window.open(url);
68+
console.log(url);
69+
window.open(url);
7370
}
7471
}
7572

src/main/webapp/js/workbench/search-querying-and-exploration/esta-ld.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
<component-header></component-header>
33

44
<form class="form-horizontal InputForm" role="form" novalidate>
5-
6-
7-
85
<div class="form-group">
96
<label for="endPoint" class="col-xs-2 control-label">SPARQL EndPoint</label>
107
<div class="input-group col-sm-8">

src/main/webapp/js/workbench/search-querying-and-exploration/facete-controller.js

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,62 @@
55
*
66
***************************************************************************************************/
77

8-
app.controller('FaceteFormCtrl', function($scope, ConfigurationService, ComponentsService, GraphService, AccountService) {
8+
app.controller('FaceteFormCtrl', function($scope, ConfigurationService, ComponentsService, GraphService, AccountService, AuthSessionService, Ns) {
99
//Settings for Facete
1010

1111

1212
var componentId ="Facete";
1313
var serviceId = "FaceteService";
14-
14+
var workbenchHP = "";
1515
ComponentsService.getComponent(componentId).then(
1616
//success
1717
function(response){
1818
$scope.component = response;
1919
$scope.sevice = ComponentsService.getComponentService(serviceId, $scope.component);
2020
if($scope.sevice== null)
2121
flash.error="Service not configured: " +serviceId;
22-
$scope.url= $scope.sevice.serviceUrl +
23-
'?service-uri='+ encodeURIComponent($scope.facete.service) +
24-
'&default-graph-uri=';
22+
23+
workbenchHP = ConfigurationService.getFrameworkHomepage();
24+
if (workbenchHP.substr(-1) != '/')
25+
workbenchHP += '/';
26+
$scope.endpoints = ConfigurationService.getAllEndpoints();
2527
},
2628
function(response){
2729
flash.error="Component not configured: " +ServerErrorResponse.getMessage(response);
2830
});
29-
30-
$scope.namedGraphs = [];
31-
32-
$scope.facete = {
33-
service : ConfigurationService.getSPARQLEndpoint(),
34-
dataset : "",
35-
};
3631

37-
$scope.refreshGraphList = function() {
38-
GraphService.getAccessibleGraphs(false, false, true).then(function(graphs) {
39-
$scope.namedGraphs = graphs;
40-
});
41-
};
32+
//scope variable is for the source-graph direcitve
33+
$scope.source = {
34+
endpoint : "",
35+
label : "Source Graph",
36+
graph : "" };
4237

43-
$scope.refreshGraphList();
44-
45-
$scope.updateServiceParams = function(){
46-
$scope.url= $scope.sevice.serviceUrl +
47-
'?service-uri=' + encodeURIComponent($scope.facete.service) +
48-
'&default-graph-uri=' + encodeURIComponent($scope.facete.dataset.replace(':',ConfigurationService.getUriBase()));
49-
console.log($scope.url);
50-
};
38+
$scope.isLocalEndpoint = function(){
39+
return $scope.source.endpoint == ConfigurationService.getSPARQLEndpoint()
40+
}
5141

5242
$scope.openService = function(){
53-
window.open($scope.url);
54-
return false;
43+
if ($scope.isLocalEndpoint()){
44+
45+
return AuthSessionService.createSession().then(function(response){
46+
var authEndpoint = workbenchHP + response.data.endpoint;
47+
var url= $scope.sevice.serviceUrl +
48+
'?service-uri=' + encodeURIComponent(authEndpoint) +
49+
'&default-graph-uri=' + encodeURIComponent(Ns.lengthen($scope.source.graph));
50+
console.log(url);
51+
window.open(url);
52+
return false;
53+
});
54+
}
55+
else{
56+
var url= $scope.sevice.serviceUrl +
57+
'?service-uri=' + encodeURIComponent($scope.source.endpoint) +
58+
'&default-graph-uri=' + encodeURIComponent(Ns.lengthen($scope.source.graph));
59+
console.log(url);
60+
window.open($scope.url);
61+
return false;
62+
}
63+
5564
}
5665

57-
$scope.$watch( function () { return AccountService.getAccount().getUsername(); }, function () {
58-
$scope.refreshGraphList();
59-
});
6066
});
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
<div class="contents" ng-controller="FaceteFormCtrl">
1+
<div ng-controller="FaceteFormCtrl">
22
<component-header></component-header>
33

4-
<p>A tool for exploring (geographical) Linked Data datasets on the Web. To get started select a data set from the drop down menu.</p>
5-
<form class="form-horizontal InputForm" role="form">
4+
<form class="form-horizontal InputForm" role="form" novalidate>
65
<div class="form-group">
7-
<label for="Endpoint">Endpoint</label>
8-
<input type="url" class="form-control" id="Endpoint" disabled="disabled" ng-model="facete.service"></input>
9-
</div>
10-
<div class="form-group">
11-
<label for="DataSet">DataSet</label>
12-
<div class="input-group">
13-
<select id="DataSet" class="form-control" ng-model="facete.dataset" ng-change="updateServiceParams()"
14-
ng-options="namedgraph.name as namedgraph.name for namedgraph in namedGraphs" required></select>
15-
<span class="input-group-btn">
16-
<button type="button" class="btn btn-link reset" ng-click="refreshGraphList()">
17-
<i class="glyphicon glyphicon-refresh" aria-hidden="false"></i>
18-
</button>
19-
</span>
6+
<label for="endPoint" class="col-xs-2 control-label">SPARQL EndPoint</label>
7+
<div class="input-group col-sm-8">
8+
<select id="endPoint" class="form-control" ng-model="source.endpoint" ng-options="c.endpoint as c.label for c in endpoints" required></select>
209
</div>
2110
</div>
11+
12+
13+
<source-graph ng-show="isLocalEndpoint()"></source-graph>
14+
2215
<div class="form-group">
16+
<div class="col-sm-2"></div>
2317
<a class="btn btn-success btn-large" ng-click="openService();">Launch Service</a>
18+
</div>
2419
</div>
20+
2521
</form>
2622

23+
2724
</div>
2825

0 commit comments

Comments
 (0)