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

Commit abe8c99

Browse files
committed
fixing
1 parent 6b9b12f commit abe8c99

File tree

7 files changed

+204
-107
lines changed

7 files changed

+204
-107
lines changed

src/deb/control/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Version: 1.2.0
33
Section: web
44
Priority: extra
55
Architecture: all
6-
Depends: tomcat7,limes-service,deer-service,virtuoso-opensource,spring-batch-admin-geoknow,sparqlify-tomcat7,facete2-tomcat7,triplegeo-service,coevolution,esta-ld,fagi-gis
6+
Depends: virtuoso-opensource,spring-batch-admin-geoknow,coevolution-debian-package,limes-service,deer-service,triplegeo-service,esta-ld
77
Maintainer: Alejandra Garcia-Rojas M <[email protected]>
88
Distribution: ldstack-nightly
99
Homepage: http://stack.linkeddata.org/getting-started/geoknow-generator/
@@ -12,4 +12,4 @@ Description: The GeoKnow Generator provides a workbench that integrates of tools
1212
and are part of the Linked Data Stack (http://stack.linkeddata.org/).
1313
These workbench aim to provide the required methods and tools
1414
to easly integrate and process geospatial data
15-
across a wide range of data sources on the web of data.
15+
across a wide range of data sources on the web of data.

src/main/resources/system-datasources.ttl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868

6969
:fagi
7070
a onots:Database , onots:DataSource ;
71-
rdfs:label "Fagi Data"^^xsd:string ;
72-
onots:dbHost "127.0.0.1"^^xsd:string ;
73-
onots:dbName "fagi"^^xsd:string ;
71+
rdfs:label "local postgres Db"^^xsd:string ;
72+
onots:dbHost "192.168.2.22"^^xsd:string ;
73+
onots:dbName "local postgres"^^xsd:string ;
7474
onots:dbPassword "postgres"^^xsd:string ;
7575
onots:dbPort "5432"^^xsd:string ;
7676
onots:dbType onots:PostGIS ;

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

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, Compone
99

1010
var componentId ="FagiGis";
1111
var serviceId = "FagiGisService";
12+
var workbenchHP;
1213

1314
ComponentsService.getComponent(componentId).then(
1415
//success
@@ -17,6 +18,11 @@ app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, Compone
1718
$scope.service = ComponentsService.getComponentService(serviceId, $scope.component);
1819
if($scope.service== null)
1920
flash.error="Service not configured: " +serviceId;
21+
22+
workbenchHP = ConfigurationService.getFrameworkHomepage();
23+
if (workbenchHP.substr(-1) != '/')
24+
workbenchHP += '/';
25+
2026
},
2127
function(response){
2228
flash.error="Component not configured: " +ServerErrorResponse.getMessage(response);
@@ -36,7 +42,24 @@ app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, Compone
3642
};
3743

3844
$scope.openService = function(){
39-
window.open($scope.service.serviceUrl);
45+
46+
createAuthEndpoint().then(function(authEndpoint){
47+
var url= $scope.service.serviceUrl +
48+
'?endpoint-a=' + encodeURIComponent($scope.fagi.endpointA == $scope.endpoint? authEndpoint : $scope.fagi.endpointA ) +
49+
'&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) +
57+
'&target-endpoint='+ encodeURIComponent(authEndpoint) +
58+
'&target-dataset='+ encodeURIComponent($scope.fagi.targetGraph.replace(':',ConfigurationService.getUriBase())) ;
59+
console.log(url);
60+
window.open(url);
61+
});
62+
4063
return false;
4164
}
4265

@@ -50,38 +73,42 @@ app.controller('FagiGisCtrl', function($q, $scope, ConfigurationService, Compone
5073

5174
var createAuthEndpoint = function(){
5275
var deferred = $q.defer();
76+
console.log ($scope.fagi.targetEndpoint);
5377
if($scope.fagi.targetEndpoint != "")
5478
deferred.resolve($scope.fagi.targetEndpoint);
5579
else{
56-
var workbench = ConfigurationService.getComponent(ConfigurationService.getFrameworkUri());
5780
// get proxied endpoint
5881
AuthSessionService.createSession().then(function(response){
59-
deferred.resolve(workbench.homepage + response.data.endpoint);
82+
deferred.resolve(workbenchHP + response.data.endpoint);
6083
});
6184
}
6285
return deferred.promise;
6386
};
6487

88+
$scope.describeGraph=function (ngraph) {
89+
return ngraph.graph.label + " | " + ngraph.name;
90+
};
91+
6592
$scope.updateServiceParams = function(){
6693

67-
if(!$scope.fagiForm.$valid)
68-
return;
94+
// if(!$scope.fagiForm.$valid)
95+
// return;
6996

70-
createAuthEndpoint().then(function(authEndpoint){
71-
$scope.url= $scope.service.serviceUrl +
72-
'?endpoint-a=' + encodeURIComponent($scope.fagi.endpointA == $scope.endpoint? authEndpoint : $scope.fagi.endpointA ) +
73-
'&endpoint-b=' + encodeURIComponent($scope.fagi.endpointB == $scope.endpoint? authEndpoint : $scope.fagi.endpointB ) +
74-
'&dataset-a=' + encodeURIComponent($scope.fagi.datasetA!=""? $scope.fagi.datasetA.replace(':',ConfigurationService.getUriBase()):"") +
75-
'&dataset-b=' + encodeURIComponent($scope.fagi.datasetB!=""? $scope.fagi.datasetB.replace(':',ConfigurationService.getUriBase()):"") +
76-
'&postgis-username='+ encodeURIComponent($scope.fagi.database.dbUser) +
77-
'&postgis-password='+ encodeURIComponent($scope.fagi.database.dbPassword) +
78-
'&postgis-database='+ encodeURIComponent($scope.fagi.database.dbName) +
79-
'&postgis-host='+ encodeURIComponent($scope.fagi.database.dbHost) +
80-
'&postgis-port='+ encodeURIComponent($scope.fagi.database.dbPort) +
81-
'&target-endpoint='+ encodeURIComponent(authEndpoint) +
82-
'&target-dataset='+ encodeURIComponent($scope.fagi.targetGraph.replace(':',ConfigurationService.getUriBase())) ;
83-
console.log($scope.url);
84-
});
97+
// createAuthEndpoint().then(function(authEndpoint){
98+
// $scope.url= $scope.service.serviceUrl +
99+
// '?endpoint-a=' + encodeURIComponent($scope.fagi.endpointA == $scope.endpoint? authEndpoint : $scope.fagi.endpointA ) +
100+
// '&endpoint-b=' + encodeURIComponent($scope.fagi.endpointB == $scope.endpoint? authEndpoint : $scope.fagi.endpointB ) +
101+
// '&dataset-a=' + encodeURIComponent($scope.fagi.datasetA!=""? $scope.fagi.datasetA.replace(':',ConfigurationService.getUriBase()):"") +
102+
// '&dataset-b=' + encodeURIComponent($scope.fagi.datasetB!=""? $scope.fagi.datasetB.replace(':',ConfigurationService.getUriBase()):"") +
103+
// '&postgis-username='+ encodeURIComponent($scope.fagi.database.dbUser) +
104+
// '&postgis-password='+ encodeURIComponent($scope.fagi.database.dbPassword) +
105+
// '&postgis-database='+ encodeURIComponent($scope.fagi.database.dbName) +
106+
// '&virtuoso-host='+ encodeURIComponent($scope.fagi.database.dbHost) +
107+
// '&virtuoso-port='+ encodeURIComponent($scope.fagi.database.dbPort) +
108+
// '&target-endpoint='+ encodeURIComponent(authEndpoint) +
109+
// '&target-dataset='+ encodeURIComponent($scope.fagi.targetGraph.replace(':',ConfigurationService.getUriBase())) ;
110+
// console.log($scope.url);
111+
// });
85112
};
86113

87114
$scope.createTargetGraph = function(){

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ <h5 class="green bold">Dataset B</h5>
3939
<label for="DatasetA">Graph</label>
4040
</div>
4141
<div class="col-xs-4">
42-
<select id="DatasetA" class="form-control" ng-model="fagi.datasetA" ng-options="namedgraph.name as namedgraph.name for namedgraph in namedGraphsA" ng-change="updateServiceParams();">
42+
<select id="DatasetA" class="form-control" ng-model="fagi.datasetA" ng-options="namedgraph.name as describeGraph(namedgraph) for namedgraph in namedGraphsA" ng-change="updateServiceParams();">
4343
</select>
4444
</div>
4545
<div class="col-xs-2">
4646
<label for="DatasetB">Graph</label>
4747
</div>
4848
<div class="col-xs-4">
49-
<select id="DatasetB" class="form-control" ng-model="fagi.datasetB" ng-options="namedgraph.name as namedgraph.name for namedgraph in namedGraphsB" ng-change="updateServiceParams();">
49+
<select id="DatasetB" class="form-control" ng-model="fagi.datasetB" ng-options="namedgraph.name as describeGraph(namedgraph) for namedgraph in namedGraphsB" ng-change="updateServiceParams();">
5050
</select>
5151
</div>
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>
@@ -62,7 +62,7 @@ <h5 class="green bold">Dataset B</h5>
6262
</select>
6363
</div>
6464
</div>
65-
<br/>
65+
<br/>
6666

6767
<div class="row">
6868
<div class="col-xs-2">
@@ -84,19 +84,14 @@ <h5 class="green bold">Dataset B</h5>
8484
</div>
8585
<div class="col-xs-2">
8686
<a class="btn btn-default btn-large" ng-click="createTargetGraph();" >Create New Dataset</a>
87-
<!-- <span class="input-group-btn">
88-
<button type="button" class="btn btn-link reset" ng-click="refreshGraphList()">
89-
<i class="glyphicon glyphicon-refresh" aria-hidden="false"></i>
90-
</button>
91-
</span> -->
9287
</div>
9388
</div>
9489
<br/>
9590

9691
<div class="row">
9792
<div class="col-xs-2"></div>
9893
<div class="col-xs-2">
99-
<a class="btn btn-success btn-large" ng-click="openService();">Launch Service</a>
94+
<a class="btn btn-success btn-large" ng-disabled="fagiForm.$invalid" ng-click="openService();">Launch Service</a>
10095
</div>
10196
</div>
10297
<br/>

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

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,70 @@
55
*
66
***************************************************************************************************/
77

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

1111

1212
var componentId ="esta-ld";
1313
var serviceId = "esta-ld-service";
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-
'?endpoint='+ encodeURIComponent($scope.estald.service) +
24-
'&graph=';
22+
23+
$scope.endpoints = ConfigurationService.getAllEndpoints();
24+
25+
workbenchHP = ConfigurationService.getFrameworkHomepage();
26+
if (workbenchHP.substr(-1) != '/')
27+
workbenchHP += '/';
2528
},
2629
function(response){
2730
flash.error="Component not configured: " +ServerErrorResponse.getMessage(response);
2831
});
2932

3033
//scope variable is for the source-graph direcitve
3134
$scope.source = {
35+
endpoint : "",
3236
label : "Source Graph",
3337
graph : "" };
3438

35-
//TODO: this may be an authorised session
36-
$scope.estald = {
37-
service : ConfigurationService.getSPARQLEndpoint(),
38-
dataset : "",
39-
};
39+
$scope.isLocalEndpoint = function(){
40+
return $scope.source.endpoint == ConfigurationService.getSPARQLEndpoint()
41+
}
4042

43+
$scope.openService = function(){
44+
// generate the authorised-session
45+
console.log($scope.source.endpoint);
4146

42-
$scope.updateServiceParams = function(){
43-
$scope.url= $scope.sevice.serviceUrl +
44-
'?endpoint=' + encodeURIComponent($scope.estald.service) +
45-
'&graph=' + encodeURIComponent($scope.estald.dataset.replace(':',ConfigurationService.getUriBase()));
46-
console.log($scope.url);
47-
};
47+
if ($scope.isLocalEndpoint()){
4848

49-
$scope.openService = function(){
50-
window.open($scope.url);
51-
return false;
49+
return AuthSessionService.createSession().then(function(response){
50+
51+
var atuhEndpoint = workbenchHP + response.data.endpoint;
52+
var url = $scope.sevice.serviceUrl +
53+
'?endpoint=' + encodeURIComponent(atuhEndpoint) +
54+
'&graph=' + encodeURIComponent($scope.source.graph.replace(':',ConfigurationService.getUriBase()));
55+
56+
console.log(url);
57+
58+
window.open(url);
59+
return false;
60+
61+
});
62+
}
63+
else{
64+
var url = $scope.sevice.serviceUrl +
65+
'?endpoint=' + encodeURIComponent($scope.source.endpoint) +
66+
'&graph=' + encodeURIComponent($scope.source.graph.replace(':',ConfigurationService.getUriBase()));
67+
68+
console.log(url);
69+
70+
window.open(url);
71+
}
5272
}
5373

5474

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33

44
<form class="form-horizontal InputForm" role="form" novalidate>
55

6+
7+
68
<div class="form-group">
7-
<label for="Endpoint" class="col-xs-2 control-label">Endpoint</label>
9+
<label for="endPoint" class="col-xs-2 control-label">SPARQL EndPoint</label>
810
<div class="input-group col-sm-8">
9-
<input type="url" class="form-control" id="Endpoint" disabled="disabled" ng-model="estald.service"></input>
11+
<select id="endPoint" class="form-control" ng-model="source.endpoint" ng-options="c.endpoint as c.label for c in endpoints" required></select>
1012
</div>
1113
</div>
1214

13-
<source-graph source-changed="updateServiceParams()"></source-graph>
15+
16+
<source-graph ng-show="isLocalEndpoint()"></source-graph>
1417

1518
<div class="form-group">
1619
<div class="col-sm-2"></div>

0 commit comments

Comments
 (0)