Skip to content

Commit

Permalink
Remove all references to WFS datasets
Browse files Browse the repository at this point in the history
refs #1223

* wip, can't remember, will revist
  • Loading branch information
sumarlidason committed Jan 13, 2019
1 parent b78fc2c commit ebee085
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 43 deletions.
2 changes: 1 addition & 1 deletion js/hoot/control/utilities/ExportDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Hoot.control.utilities.exportdataset = function(context) {
if(selTrans.NAME.substring(0,3)!=='TDS'){
hideFGDB=true;
}
if(selTrans.NAME.substring(0,3)!=='OSM'){
if(selTrans.NAME.substring(0,3)!=='OSM'){
hideExport=true;
}
} else {
Expand Down
61 changes: 19 additions & 42 deletions js/hoot/model/Export.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Hoot.model.export = function (context)
var model_export = {};
var statusTimer;
var outputname;
var selectedInput;
var selectedInputUUID;
var selExportTypeDesc;
//var removeConflationRes;
var selectedOutType;
Expand All @@ -27,7 +27,8 @@ Hoot.model.export = function (context)
outputname = container.select('#fileExportOutputName').value() ||
container.select('#fileExportOutputName').attr('placeholder');
}
selectedInput = data.name || outputname;

selectedInputUUID = data.id;

if (container.exporttype) { selExportTypeDesc = container.exporttype; }
else {
Expand All @@ -36,12 +37,11 @@ Hoot.model.export = function (context)
}

var _expType = {
'File Geodatabase': 'gdb',
'Shapefile': 'shp',
/*'Web Feature Service (WFS)':'wfs',*/
'OpenStreetMap (OSM)':'osm',
'OpenStreetMap (PBF)':'osm.pbf',
'OSM API Database':'osm_api_db'
'File Geodatabase' : 'gdb',
'Shapefile' : 'shp',
'OpenStreetMap (OSM)' : 'osm',
'OpenStreetMap (PBF)' : 'osm.pbf',
'OSM API Database' : 'osm_api_db'
};
selectedOutType = _expType[selExportTypeDesc] || selExportTypeDesc;

Expand Down Expand Up @@ -85,7 +85,7 @@ Hoot.model.export = function (context)
selectedTranslation = transName + '.js';
}

if (!selectedInput || !selectedOutType) {
if (isNaN(selectedInputUUID) || !selectedOutType) {
iD.ui.Alert('Please enter valid values.','error',new Error().stack);
return;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ Hoot.model.export = function (context)
}

param.inputtype = 'db';
param.input = selectedInput;
param.inputId = selectedInputUUID;
param.outputtype = selectedOutType;
param.outputname = outputname;
param.append = appendTemplate.toString();
Expand All @@ -168,8 +168,7 @@ Hoot.model.export = function (context)
});
};

var _exportResultHandler = function(error, result)
{
var _exportResultHandler = function(error, result) {

if (result.status !== 'running') {
Hoot.model.REST.WarningHandler(result);
Expand All @@ -182,27 +181,8 @@ Hoot.model.export = function (context)
exportCallback(result.status);
}

if(result.status !== 'failed'){
//Huh?
// if(removeConflationRes === 'true'){
// d3.json('/hoot-services/osm/api/0.6/map/delete/' + mapId)
// .header('Content-Type', 'text/plain')
// .post('', function (error, data) {

// });
// }

/* if(selectedOutType === 'wfs'){
// var capaUrl = location.origin + '/hoot-services/ogc/' + result.jobId +
// '?service=WFS&version=1.1.0&request=GetCapabilities';
//alert('WFS Resource URL:\n' + capaUrl);
var param = {};
param.id = result.jobId;
context.hoot().control.utilities.wfsdataset.wfsDetailPopup(param);
}
else */
if (selectedOutType === 'osm_api_db')
{
if(result.status !== 'failed') {
if (selectedOutType === 'osm_api_db') {
//OSM API db export writes directly to an osm api database and involves no file
//download for export.
var summaryStartIndex = result.statusDetail.indexOf('Changeset(s)');
Expand All @@ -212,8 +192,7 @@ Hoot.model.export = function (context)
//having difficulty accessing the iD alerts in cucumber tests, so using a regular
//alert instead
alert('Successful export to an OSM API database:\n\n' + summary);
}
else {
} else {
var sUrl = '/hoot-services/job/export/' + result.jobId + '?' + outNameParam + '&removecache=true';
if (selectedOutType === 'osm.pbf') {
// specify the file ext since the default is zip and there is no need to zip a pbf file
Expand Down Expand Up @@ -256,14 +235,12 @@ Hoot.model.export = function (context)

var _initVariables = function()
{
statusTimer = null;
outputname = null;
selectedInput = null;
statusTimer = null;
outputname = null;
selectedInputUUID = null;
selExportTypeDesc = null;
//removeConflationRes = null;
selectedOutType = null;
exportCallback = null;
//mapId = null;
selectedOutType = null;
exportCallback = null;
};

return model_export;
Expand Down

0 comments on commit ebee085

Please sign in to comment.