[Mapbender-commits] r2463 - branches/2.5/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon May 19 03:17:28 EDT 2008
Author: astrid_emde
Date: 2008-05-19 03:17:26 -0400 (Mon, 19 May 2008)
New Revision: 2463
Modified:
branches/2.5/http/javascripts/mod_wfs_client.html
Log:
added some user messages (please select a WFS), changed the order of the options a bit
Modified: branches/2.5/http/javascripts/mod_wfs_client.html
===================================================================
--- branches/2.5/http/javascripts/mod_wfs_client.html 2008-05-19 07:08:14 UTC (rev 2462)
+++ branches/2.5/http/javascripts/mod_wfs_client.html 2008-05-19 07:17:26 UTC (rev 2463)
@@ -7,7 +7,7 @@
<script type='text/javascript'>
-/*
+/*
* services['action']: instructs the servercomponent
* services['services']: infos about the services (wfs)
* services['services']['id']: a list of ids
@@ -17,7 +17,7 @@
var services = {};
/*
* wfsConf['action']: instructs the servercomponent
- * wfsConf['wfs']: the ID of the selected wfs
+ * wfsConf['wfs']: the ID of the selected wfs
* wfsConf['wfsConf']: infos about the wfs configurations
* wfsConf['wfsConf']['id']: a list of ids
* wfsConf['wfsConf']['abstract']: a corresponding list of descriptions
@@ -33,31 +33,31 @@
/*
* handleAssignment['action']: instructs the servercomponent
- * handleAssignment['selectedConf']: a list of wfs-conf Ids
+ * handleAssignment['selectedConf']: a list of wfs-conf Ids
* handleAssignment['selectedGui']: the selected Gui
*/
-var handleAssignment = {}
-
-/*
- * vupdateWfs['action']: instructs the servercomponent
- * vupdateWfs['wfs']: id of wfs to update
- * vupdateWfs['url']: capabilities url
- */
-var vupdateWfs = {};
-
-/*
- * deleteWfs_['action']: instructs the servercomponent
- * deleteWfs_['wfs']: id of wfs to update
- */
-var deleteWfs_ = {};
-
-/*
- * geturl['action']: instructs the servercomponent
- * geturl['wfs']: id of wfs to get the url for
- * geturl['column']: column of the url to get in table wfs
- */
-var geturl = {}
+var handleAssignment = {}
+/*
+ * vupdateWfs['action']: instructs the servercomponent
+ * vupdateWfs['wfs']: id of wfs to update
+ * vupdateWfs['url']: capabilities url
+ */
+var vupdateWfs = {};
+
+/*
+ * deleteWfs_['action']: instructs the servercomponent
+ * deleteWfs_['wfs']: id of wfs to update
+ */
+var deleteWfs_ = {};
+
+/*
+ * geturl['action']: instructs the servercomponent
+ * geturl['wfs']: id of wfs to get the url for
+ * geturl['column']: column of the url to get in table wfs
+ */
+var geturl = {}
+
var owsproxy = {}
@@ -80,41 +80,41 @@
var w = document.wfsForm.wfsList;
var ind = w.selectedIndex;
if(ind == -1){
- return false;
- }
- if(ind == w.options.length-1)
+ return false;
+ }
+ if(ind == w.options.length-1)
return "gui_confs";
- return w.options[ind].value;
+ return w.options[ind].value;
}
function getGuiConfs(){
guis['action'] = 'getAssignedConfs';
var g = document.wfsForm.guiList;
var ind = g.selectedIndex;
if(ind == -1){
- return false;
+ return false;
}
guis['selectedGui'] = g.options[ind].value;
- guis['selectedWfs'] = wfsConf['wfs'];
+ guis['selectedWfs'] = wfsConf['wfs'];
getData(guis);
-}
-/**
- * Sends an request to get the url to the capabilities doc of selected wfs
- *
- */
-
-function getUpdateUrl(column){
- geturl['action'] = 'getUpdateUrl';
- var w = document.wfsForm.wfsList;
- var ind = w.selectedIndex;
- if(ind == -1){
- alert("please select an WFS");
- return;
- }
- geturl['wfs'] = w.options[ind].value;
- geturl['column'] = column;
- getData(geturl);
-}
+}
+/**
+ * Sends an request to get the url to the capabilities doc of selected wfs
+ *
+ */
+function getUpdateUrl(column){
+ geturl['action'] = 'getUpdateUrl';
+ var w = document.wfsForm.wfsList;
+ var ind = w.selectedIndex;
+ if(ind == -1){
+ alert("please select an WFS");
+ return;
+ }
+ geturl['wfs'] = w.options[ind].value;
+ geturl['column'] = column;
+ getData(geturl);
+}
+
function addConfsToGui(){
handleAssignment['action'] = 'add';
handleAssignment['confs'] = getSelectedConfs();
@@ -126,43 +126,48 @@
handleAssignment['confs'] = getSelectedAssignedConfs();
handleAssignment['gui'] = getSelectedGui();
getData(handleAssignment);
-}
-/**
- * Sends an update request to update the capabilities of selected wfs
- *
- * @return success
- * @type boolean
- */
-
-function updateWfs(){
- vupdateWfs['action'] = 'updateWfs';
- var w = document.wfsForm.wfsList;
- var ind = w.selectedIndex;
- if(ind == -1){
- alert("please select an WFS");
- return false;
- }
- vupdateWfs['wfs'] = w.options[ind].value;
- vupdateWfs['url'] = document.getElementById("updateUrl").value;
- getData(vupdateWfs);
- return true;
-}
-
-function deleteWfs(){
- deleteWfs_['action'] = 'deleteWfs';
- deleteWfs_['wfs'] = getSelectedWfs();
- if(deleteWfs_['wfs']&&deleteWfs_['wfs']!="gui_confs"){
- if(confirm("Do you really want to delete the Wfs with Wfs-id:"+deleteWfs_['wfs']+"?")){
- getData(deleteWfs_);
- }
- return true;
- }
- return false;
-}
+}
+/**
+ * Sends an update request to update the capabilities of selected wfs
+ *
+ * @return success
+ * @type boolean
+ */
+function updateWfs(){
+ vupdateWfs['action'] = 'updateWfs';
+ var w = document.wfsForm.wfsList;
+ var ind = w.selectedIndex;
+ if(ind == -1){
+ alert("please select an WFS");
+ return false;
+ }
+ vupdateWfs['wfs'] = w.options[ind].value;
+ if(document.getElementById("updateUrl").value == ''){
+ alert("Please choose the link to the new WFS Capabilities URL.");
+ return false;
+ }
+
+ vupdateWfs['url'] = document.getElementById("updateUrl").value;
+ getData(vupdateWfs);
+ return true;
+}
+
+function deleteWfs(){
+ deleteWfs_['action'] = 'deleteWfs';
+ deleteWfs_['wfs'] = getSelectedWfs();
+ if(deleteWfs_['wfs']&&deleteWfs_['wfs']!="gui_confs"){
+ if(confirm("Do you really want to delete the Wfs with Wfs-id:"+deleteWfs_['wfs']+"?")){
+ getData(deleteWfs_);
+ }
+ return true;
+ }
+ return false;
+}
+
function setIndicator(){
var str = "<img src='../img/indicator_wheel.gif'>";
- document.getElementById("indicator").innerHTML = str;
+ document.getElementById("indicator").innerHTML = str;
}
function removeIndicator(){
document.getElementById("indicator").innerHTML = "";
@@ -202,38 +207,38 @@
break;
case "getWfsConfData":
getOwsproxy();
- appendWfsConfData(dsJson);
+ appendWfsConfData(dsJson);
break;
case "getGuis":
appendGuis(dsJson);
break;
case "getAssignedConfs":
- appendGuiConfs(dsJson);
- break;
- case "getUpdateUrl":
+ appendGuiConfs(dsJson);
+ break;
+ case "getUpdateUrl":
setUpdateUrl(dsJson)
break;
case "add":
getGuiConfs();
break;
case "remove":
- getGuiConfs();
- break;
- case "updateWfs":
- if(dsJson['success'])
- alert("Update performed.");
- else
+ getGuiConfs();
+ break;
+ case "updateWfs":
+ if(dsJson['success'])
+ alert("Update performed.");
+ else
alert("An error occured, see log for details.");
- break;
- case "deleteWfs":
- if(dsJson['success']){
- clearList(document.forms[0].wfsList);
- clearList(document.forms[0].guiList);
- getWfsList();
- getGuis();
- alert("WFS deleted.");
- }
break;
+ case "deleteWfs":
+ if(dsJson['success']){
+ clearList(document.forms[0].wfsList);
+ clearList(document.forms[0].guiList);
+ getWfsList();
+ getGuis();
+ alert("WFS deleted.");
+ }
+ break;
case "setOwsproxy":
displayOwsproxy(dsJson);
break;
@@ -247,23 +252,23 @@
alert("No action specified.....");
break;
}
- }
+ }
else{
alert("An error occured!");
}
removeIndicator();
});
-}
+}
-/**
- * Sets the update url comming from db in the html form
- *
- */
-
-function setUpdateUrl(dsJson){
- document.getElementById("updateUrl").value = dsJson['url'];
-}
+/**
+ * Sets the update url comming from db in the html form
+ *
+ */
+function setUpdateUrl(dsJson){
+ document.getElementById("updateUrl").value = dsJson['url'];
+}
+
/*
*
*/
@@ -274,23 +279,23 @@
else{
document.wfsForm.owsproxy.checked = true;
}
-}
+}
function appendServices(dsJson){
services['services'] = dsJson.services;
- var o = services['services'];
+ var o = services['services'];
for(var i=0; i<o.id.length; i++){
appendOption(document.forms[0].wfsList, o.title[i], o.id[i], false);
- }
+ }
appendOption(document.forms[0].wfsList, "WFS Configurations", "-1", false);
}
function appendWfsConfData(dsJson){
wfsConf['wfsConf'] = {};
wfsConf['wfsConf'] = dsJson.wfsConf;
- var o = wfsConf['wfsConf'];
- document.forms[0].wfsConfList.innerHTML = '';
- if(typeof(o.id)=="undefined")
+ var o = wfsConf['wfsConf'];
+ document.forms[0].wfsConfList.innerHTML = '';
+ if(typeof(o.id)=="undefined")
return;
for(var i=0; i<o.id.length; i++){
appendOption(document.forms[0].wfsConfList, o.abstract[i], o.id[i], false);
@@ -300,10 +305,10 @@
function appendGuis(dsJson){
guis['id'] = {};
guis['id'] = dsJson.id;
- var o = guis['id'];
+ var o = guis['id'];
for(var i=0; i<o.length; i++){
appendOption(document.forms[0].guiList, o[i], o[i], false);
- }
+ }
}
function appendGuiConfs(dsJson){
var list = document.forms[0].guiConfList;
@@ -311,18 +316,18 @@
for(var i=0; i<dsJson.assignedConfs.length; i++){
var confAbstract = getConfAbstract(dsJson.assignedConfs[i]);
appendOption(list, confAbstract, dsJson.assignedConfs[i], false);
- }
+ }
}
function appendOption(boxObject, optionText, optionValue, selected){
var newOption = new Option(optionText,optionValue,false,selected);
boxObject.options[boxObject.length] = newOption;
-}
-function clearList(boxObject){
- boxObject.length = 0;
-}
+}
+function clearList(boxObject){
+ boxObject.length = 0;
+}
/*
- * returns id and abstract from a wfs configuration
+ * returns id and abstract from a wfs configuration
*/
function getConfAbstract(confId){
var c = wfsConf['wfsConf'];
@@ -370,22 +375,29 @@
<select size='4' name='wfsList' class='wfsList' onchange='getWfsConfData();getGuiConfs();'></select>
</p>
</fieldset>
-
+
<fieldset class="rightContainer">
<legend>Options</legend>
<p>
- <input type='checkbox' name='owsproxy' id='owsproxy' onclick='setOwsproxy(this)' />
- <label for="owsproxy">OWSProxy</label>
+ <input type='checkbox' name='owsproxy' id='owsproxy' onclick='setOwsproxy(this)' />
+ <label for="owsproxy">enable OWSProxy for the selected WFS</label>
+ <br><br>
+ <input type='button' value='Delete WFS' name='delete' id='deleteButton' onclick='deleteWfs()' />
+ <br /><br />
+ </p>
+ </fieldset>
+
+ <fieldset class="rightContainer">
+ <legend>Update WFS</legend>
+ <p>
+ Please choose the Link to the WFS Capabilities URL:
+ <br />
+ <a href='javascript:getUpdateUrl("wfs_getcapabilities")'>wfs_getcapabilities</a> or <a href='javascript:getUpdateUrl("wfs_upload_url")'>wfs_upload_url</a>
+ </label>
+ <input id='updateUrl' type='text' value='' name='updateUrl' class='updateUrl' />
<br />
- <label for="updateUrl">
- Link to new WFS Capabilities URL:
- <br />
- (<a href='javascript:getUpdateUrl("wfs_getcapabilities")'>wfs_getcapabilities</a>, <a href='javascript:getUpdateUrl("wfs_upload_url")'>wfs_upload_url</a>)
- </label>
- <input id='updateUrl' type='text' value='' name='updateUrl' class='updateUrl' />
- <br />
- <input type='button' value='Update WFS' name='update' id='updateButton' onclick='updateWfs()' />
- <input type='button' value='Delete WFS' name='delete' id='deleteButton' onclick='deleteWfs()' />
+ <input type='button' value='Update WFS' name='update' id='updateButton' onclick='updateWfs()' />
+ <br /><br />
</p>
</fieldset>
@@ -420,8 +432,8 @@
<p>
<select size='4' name='guiConfList' class='guiConfList' onchange='' multiple="multiple"></select>
</p>
- </fieldset>
-
+ </fieldset>
+
<hr />
</form>
More information about the Mapbender_commits
mailing list