@@ -108,6 +108,21 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
108108 ] ,
109109 ex : [
110110 ""
111+ ] ,
112+ esriFeature : [
113+ "points" ,
114+ "polyline" ,
115+ "polygon" ,
116+ "multipoint" ,
117+ "pointz" ,
118+ "polylinez" ,
119+ "polygonz" ,
120+ "multipointz" ,
121+ "pointm" ,
122+ "polylinem" ,
123+ "polygonm" ,
124+ "multipointm" ,
125+ "multipatch"
111126 ]
112127 } ;
113128
@@ -148,7 +163,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
148163 } ;
149164
150165 $scope . isFileJob = function ( ) {
151- return ( $scope . datasource != '' && $scope . datasource != 'Database' && $scope . example === '' )
166+ return ( $scope . datasource != '' && $scope . datasource != 'Database' )
152167 } ;
153168
154169 $scope . commonParams = function ( ) {
@@ -174,6 +189,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
174189 $scope . tripleGeoConfig = {
175190 job : "esri-example" ,
176191 inputFile : "points.shp" ,
192+ inputFileName : "points.shp" ,
177193 format : $scope . options . format [ 0 ] ,
178194 targetStore : $scope . options . targetStore [ 0 ] ,
179195
@@ -194,13 +210,15 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
194210 else if ( $scope . example === "Airports example" ) {
195211 $scope . tripleGeoConfig = {
196212 job : "gml-example" ,
197- inputFile : "airports.gml"
213+ inputFile : "airports.gml" ,
214+ inputFileName : "airports.gml"
198215 }
199216 }
200217 else if ( $scope . example === "Kml sample" ) {
201218 $scope . tripleGeoConfig = {
202219 job : "kml-example" ,
203- inputFile : "sample.kml"
220+ inputFile : "sample.kml" ,
221+ inputFileName : "sample.kml"
204222 }
205223 }
206224 else if ( $scope . example === "Wikimapia Extraction" ) {
@@ -209,11 +227,11 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
209227
210228 job : "db-example" ,
211229
212- format : $scope . options . format [ 2 ] ,
213- targetStore : $scope . options . targetStore [ 0 ] ,
230+ format : $scope . options . format [ 2 ] ,
231+ targetStore : $scope . options . targetStore [ 0 ] ,
214232
215233
216- dbtype : $scope . options . dbtype [ 2 ] ,
234+ dbtype : $scope . options . dbtype [ 2 ] ,
217235 dbName : "wikimapia" ,
218236 dbUserName : "gisuser" ,
219237 dbPassword : "admin" ,
@@ -250,7 +268,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
250268 $scope . tripleGeoConfig = {
251269 job : "db" ,
252270 inputDisplay : $scope . databases [ i ] . dbName ,
253-
271+
254272 format : $scope . options . format [ 2 ] ,
255273 targetStore : $scope . options . targetStore [ 0 ] ,
256274
@@ -295,7 +313,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
295313 var promises = [ ] ;
296314
297315 angular . forEach ( files , function ( file ) {
298-
316+
299317 var deferred = $q . defer ( ) ;
300318 file . upload = Upload . upload ( {
301319 url : $scope . service . serviceUrl + '/upload' ,
@@ -304,7 +322,9 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
304322
305323 file . upload . then ( function ( response ) {
306324 $timeout ( function ( ) {
307- deferred . resolve ( response . data [ 0 ] ) ;
325+ var uploaded = new Array ( ) ;
326+ uploaded [ file . name ] = response . data [ 0 ] ;
327+ deferred . resolve ( uploaded ) ;
308328 } ) ;
309329 } , function ( response ) {
310330 if ( response . status > 0 )
@@ -320,7 +340,14 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
320340 $q . all ( promises ) . then (
321341 // results: an array of data objects from each deferred.resolve(data) call
322342 function ( results ) {
323- validateFiles ( files , results ) ;
343+ var normalized = new Array ( ) ;
344+ for ( var i in results ) {
345+ var r = results [ i ] ;
346+ for ( var k in r )
347+ normalized [ k ] = r [ k ] ;
348+
349+ }
350+ validateFiles ( files , normalized ) ;
324351 uploading = false ;
325352 } ,
326353 // error
@@ -333,6 +360,10 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
333360 var validateFiles = function ( files , responseMap ) {
334361 if ( files == null ) return ;
335362 var fileName = "" ;
363+
364+ console . log ( files ) ;
365+ console . log ( responseMap ) ;
366+
336367 $scope . files = files ;
337368 // validate esri
338369 if ( $scope . options . job === "esri" ) {
@@ -371,7 +402,8 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
371402 fileName = file . name ;
372403 }
373404 } ) ;
374- console . log ( responseMap ) ;
405+ console . log ( fileName ) ;
406+
375407
376408 $scope . tripleGeoConfig = {
377409 job :"esri" ,
@@ -382,7 +414,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
382414
383415 featureString : name ,
384416 attribute : "" ,
385- ignore : "" ,
417+ ignore : "UNK " ,
386418 type : "" ,
387419 name : "" ,
388420 uclass : "" ,
@@ -426,7 +458,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
426458 $scope . tripleGeoConfig = {
427459 job : $scope . options . job ,
428460 inputFileName : $scope . files [ 0 ] . name ,
429- inputFile : $scope . files [ 0 ] . result [ 0 ] ,
461+ inputFile : responseMap [ fileName ]
430462 }
431463 }
432464
@@ -445,6 +477,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
445477
446478 $scope . CreateJob = function ( ) {
447479
480+ console . log ( $scope . options . job ) ;
448481 if ( $scope . options . job == "esri" ) {
449482 params = {
450483 job : $scope . tripleGeoConfig . job ,
@@ -472,8 +505,19 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
472505 defaultLang : validate ( $scope . tripleGeoConfig . defaultLang , "en" ) ,
473506 } ;
474507 }
475-
476- if ( $scope . options . job == "db" ) {
508+ if ( $scope . options . job == "gml" ) {
509+ params = {
510+ job : $scope . tripleGeoConfig . job ,
511+ inputFile : $scope . tripleGeoConfig . inputFile ,
512+ }
513+ }
514+ if ( $scope . options . job == "kml" ) {
515+ params = {
516+ job : $scope . tripleGeoConfig . job ,
517+ inputFile : $scope . tripleGeoConfig . inputFile ,
518+ }
519+ }
520+ else if ( $scope . options . job == "db" ) {
477521 params = {
478522 job : $scope . options . job ,
479523
@@ -507,9 +551,7 @@ var TripleGeoCtrl = function($scope, $http, $q, ConfigurationService, Components
507551 defaultLang : $scope . tripleGeoConfig . defaultLang ,
508552 } ;
509553 }
510-
511554
512-
513555 var now = new Date ( ) ;
514556
515557 // ask the user for a job name and description
0 commit comments