Skip to content

Commit ebee085

Browse files
committed
Remove all references to WFS datasets
refs #1223 * wip, can't remember, will revist
1 parent b78fc2c commit ebee085

File tree

2 files changed

+20
-43
lines changed

2 files changed

+20
-43
lines changed

js/hoot/control/utilities/ExportDataset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Hoot.control.utilities.exportdataset = function(context) {
229229
if(selTrans.NAME.substring(0,3)!=='TDS'){
230230
hideFGDB=true;
231231
}
232-
if(selTrans.NAME.substring(0,3)!=='OSM'){
232+
if(selTrans.NAME.substring(0,3)!=='OSM'){
233233
hideExport=true;
234234
}
235235
} else {

js/hoot/model/Export.js

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Hoot.model.export = function (context)
1212
var model_export = {};
1313
var statusTimer;
1414
var outputname;
15-
var selectedInput;
15+
var selectedInputUUID;
1616
var selExportTypeDesc;
1717
//var removeConflationRes;
1818
var selectedOutType;
@@ -27,7 +27,8 @@ Hoot.model.export = function (context)
2727
outputname = container.select('#fileExportOutputName').value() ||
2828
container.select('#fileExportOutputName').attr('placeholder');
2929
}
30-
selectedInput = data.name || outputname;
30+
31+
selectedInputUUID = data.id;
3132

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

3839
var _expType = {
39-
'File Geodatabase': 'gdb',
40-
'Shapefile': 'shp',
41-
/*'Web Feature Service (WFS)':'wfs',*/
42-
'OpenStreetMap (OSM)':'osm',
43-
'OpenStreetMap (PBF)':'osm.pbf',
44-
'OSM API Database':'osm_api_db'
40+
'File Geodatabase' : 'gdb',
41+
'Shapefile' : 'shp',
42+
'OpenStreetMap (OSM)' : 'osm',
43+
'OpenStreetMap (PBF)' : 'osm.pbf',
44+
'OSM API Database' : 'osm_api_db'
4545
};
4646
selectedOutType = _expType[selExportTypeDesc] || selExportTypeDesc;
4747

@@ -85,7 +85,7 @@ Hoot.model.export = function (context)
8585
selectedTranslation = transName + '.js';
8686
}
8787

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

145145
param.inputtype = 'db';
146-
param.input = selectedInput;
146+
param.inputId = selectedInputUUID;
147147
param.outputtype = selectedOutType;
148148
param.outputname = outputname;
149149
param.append = appendTemplate.toString();
@@ -168,8 +168,7 @@ Hoot.model.export = function (context)
168168
});
169169
};
170170

171-
var _exportResultHandler = function(error, result)
172-
{
171+
var _exportResultHandler = function(error, result) {
173172

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

185-
if(result.status !== 'failed'){
186-
//Huh?
187-
// if(removeConflationRes === 'true'){
188-
// d3.json('/hoot-services/osm/api/0.6/map/delete/' + mapId)
189-
// .header('Content-Type', 'text/plain')
190-
// .post('', function (error, data) {
191-
192-
// });
193-
// }
194-
195-
/* if(selectedOutType === 'wfs'){
196-
// var capaUrl = location.origin + '/hoot-services/ogc/' + result.jobId +
197-
// '?service=WFS&version=1.1.0&request=GetCapabilities';
198-
//alert('WFS Resource URL:\n' + capaUrl);
199-
var param = {};
200-
param.id = result.jobId;
201-
context.hoot().control.utilities.wfsdataset.wfsDetailPopup(param);
202-
}
203-
else */
204-
if (selectedOutType === 'osm_api_db')
205-
{
184+
if(result.status !== 'failed') {
185+
if (selectedOutType === 'osm_api_db') {
206186
//OSM API db export writes directly to an osm api database and involves no file
207187
//download for export.
208188
var summaryStartIndex = result.statusDetail.indexOf('Changeset(s)');
@@ -212,8 +192,7 @@ Hoot.model.export = function (context)
212192
//having difficulty accessing the iD alerts in cucumber tests, so using a regular
213193
//alert instead
214194
alert('Successful export to an OSM API database:\n\n' + summary);
215-
}
216-
else {
195+
} else {
217196
var sUrl = '/hoot-services/job/export/' + result.jobId + '?' + outNameParam + '&removecache=true';
218197
if (selectedOutType === 'osm.pbf') {
219198
// specify the file ext since the default is zip and there is no need to zip a pbf file
@@ -256,14 +235,12 @@ Hoot.model.export = function (context)
256235

257236
var _initVariables = function()
258237
{
259-
statusTimer = null;
260-
outputname = null;
261-
selectedInput = null;
238+
statusTimer = null;
239+
outputname = null;
240+
selectedInputUUID = null;
262241
selExportTypeDesc = null;
263-
//removeConflationRes = null;
264-
selectedOutType = null;
265-
exportCallback = null;
266-
//mapId = null;
242+
selectedOutType = null;
243+
exportCallback = null;
267244
};
268245

269246
return model_export;

0 commit comments

Comments
 (0)