Commit 4bd72a7da2b4b5ad2db799546291d7fffc640418
1 parent
34c6b428
Exists in
master
and in
7 other branches
--no commit message
Showing
4 changed files
with
42 additions
and
6 deletions
Show diff stats
pacotes/cswclient/csw.html
| @@ -28,6 +28,8 @@ | @@ -28,6 +28,8 @@ | ||
| 28 | </select> | 28 | </select> |
| 29 | <input type="text" name="query" value="" size="24"/> | 29 | <input type="text" name="query" value="" size="24"/> |
| 30 | <p/> | 30 | <p/> |
| 31 | + Região (xmin ymin xmax ymax): <input type="text" name="bbox" value="-180 -90 180 90" size="24"/> | ||
| 32 | + <p/> | ||
| 31 | <span id="csw-hosts"></span> | 33 | <span id="csw-hosts"></span> |
| 32 | <select id="schema" name="schema"> | 34 | <select id="schema" name="schema"> |
| 33 | <option value="http://www.opengis.net/cat/csw/2.0.2">csw:Record</option> | 35 | <option value="http://www.opengis.net/cat/csw/2.0.2">csw:Record</option> |
| @@ -46,7 +48,7 @@ | @@ -46,7 +48,7 @@ | ||
| 46 | <!--input type="hidden" name="schema" value="http://www.isotc211.org/2005/gmd"/--> | 48 | <!--input type="hidden" name="schema" value="http://www.isotc211.org/2005/gmd"/--> |
| 47 | <!--input type="hidden" name="displaymode" value="html"/--> | 49 | <!--input type="hidden" name="displaymode" value="html"/--> |
| 48 | <input type="button" value="limpar" onClick="javascript:void(csw_client.clearPage())"/> | 50 | <input type="button" value="limpar" onClick="javascript:void(csw_client.clearPage())"/> |
| 49 | - <input type="button" value="pesquisar" onClick="javascript:void(csw_client.getRecords())"/> | 51 | + <input type="button" value="pesquisar" onClick="javascript:void(csw_client.clearResposta());void(csw_client.getRecords())"/> |
| 50 | </form> | 52 | </form> |
| 51 | </div> | 53 | </div> |
| 52 | 54 |
pacotes/cswclient/lib/scripts/cswclient.js
| @@ -109,6 +109,16 @@ CSWClient.prototype.getRecords = function(start) | @@ -109,6 +109,16 @@ CSWClient.prototype.getRecords = function(start) | ||
| 109 | 109 | ||
| 110 | var operator = document.theForm.operator.value; | 110 | var operator = document.theForm.operator.value; |
| 111 | var query = trim(document.theForm.query.value); | 111 | var query = trim(document.theForm.query.value); |
| 112 | + var bbox = document.theForm.bbox.value; | ||
| 113 | + if (bbox == ""){ | ||
| 114 | + var lowerCorner = ""; | ||
| 115 | + var upperCorner = "" | ||
| 116 | + } | ||
| 117 | + else{ | ||
| 118 | + bbox = bbox.split(" "); | ||
| 119 | + var lowerCorner = bbox[1]+" "+bbox[0]; | ||
| 120 | + var upperCorner = bbox[3]+" "+bbox[2]; | ||
| 121 | + } | ||
| 112 | if (operator == "contains" & query != "") {query = "%" + query + "%";} | 122 | if (operator == "contains" & query != "") {query = "%" + query + "%";} |
| 113 | 123 | ||
| 114 | var schema = "http://www.opengis.net/cat/csw/2.0.2"; // force outputSchema always to csw:Record for GetRecords requests | 124 | var schema = "http://www.opengis.net/cat/csw/2.0.2"; // force outputSchema always to csw:Record for GetRecords requests |
| @@ -119,13 +129,16 @@ CSWClient.prototype.getRecords = function(start) | @@ -119,13 +129,16 @@ CSWClient.prototype.getRecords = function(start) | ||
| 119 | this.setXpathValue(this.defaults_xml, "/defaults/startposition", start + ''); | 129 | this.setXpathValue(this.defaults_xml, "/defaults/startposition", start + ''); |
| 120 | var sortby = document.theForm.sortby.value; | 130 | var sortby = document.theForm.sortby.value; |
| 121 | this.setXpathValue(this.defaults_xml, "/defaults/sortby", sortby + ''); | 131 | this.setXpathValue(this.defaults_xml, "/defaults/sortby", sortby + ''); |
| 122 | - | 132 | + if (bbox != ""){ |
| 133 | + this.setXpathValue(this.defaults_xml, "/defaults/lowerCorner", lowerCorner + ''); | ||
| 134 | + this.setXpathValue(this.defaults_xml, "/defaults/upperCorner", upperCorner + ''); | ||
| 135 | +} | ||
| 123 | var processor = new XSLTProcessor(); | 136 | var processor = new XSLTProcessor(); |
| 124 | processor.importStylesheet(this.getrecords_xsl); | 137 | processor.importStylesheet(this.getrecords_xsl); |
| 125 | 138 | ||
| 126 | var request_xml = processor.transformToDocument(this.defaults_xml); | 139 | var request_xml = processor.transformToDocument(this.defaults_xml); |
| 127 | var request = new XMLSerializer().serializeToString(request_xml); | 140 | var request = new XMLSerializer().serializeToString(request_xml); |
| 128 | - | 141 | + //alert(request);return; |
| 129 | csw_response = this.sendCSWRequest(request); | 142 | csw_response = this.sendCSWRequest(request); |
| 130 | var results = "<results><request start=\"" + start + "\""; | 143 | var results = "<results><request start=\"" + start + "\""; |
| 131 | results += " maxrecords=\""; | 144 | results += " maxrecords=\""; |
| @@ -227,7 +240,12 @@ CSWClient.prototype.setXpathValue = function(_a,_b,_c) | @@ -227,7 +240,12 @@ CSWClient.prototype.setXpathValue = function(_a,_b,_c) | ||
| 227 | return false; | 240 | return false; |
| 228 | } | 241 | } |
| 229 | }; | 242 | }; |
| 230 | - | 243 | +CSWClient.prototype.clearResposta = function() |
| 244 | +{ | ||
| 245 | + var outputDiv = document.getElementById("csw-output"); | ||
| 246 | + outputDiv.innerHTML = "Aguarde..."; | ||
| 247 | + this.hideDiv(document.getElementById('popup')) | ||
| 248 | +} | ||
| 231 | 249 | ||
| 232 | CSWClient.prototype.clearPage = function() | 250 | CSWClient.prototype.clearPage = function() |
| 233 | { | 251 | { |
pacotes/cswclient/lib/xml/defaults.xml
| @@ -4,11 +4,12 @@ | @@ -4,11 +4,12 @@ | ||
| 4 | <startposition>1</startposition> | 4 | <startposition>1</startposition> |
| 5 | <outputformat>application/xml</outputformat> | 5 | <outputformat>application/xml</outputformat> |
| 6 | <outputschema>http://www.opengis.net/cat/csw/2.0.2</outputschema> | 6 | <outputschema>http://www.opengis.net/cat/csw/2.0.2</outputschema> |
| 7 | -<!--outputschema>http://www.isotc211.org/2005/gmd</outputschema--> | ||
| 8 | <resulttype>results</resulttype> | 7 | <resulttype>results</resulttype> |
| 9 | <propertyname>AnyText</propertyname> | 8 | <propertyname>AnyText</propertyname> |
| 10 | <literal></literal> | 9 | <literal></literal> |
| 11 | <sortby></sortby> | 10 | <sortby></sortby> |
| 12 | <sortorder>ASC</sortorder> | 11 | <sortorder>ASC</sortorder> |
| 13 | <id></id> | 12 | <id></id> |
| 13 | +<lowerCorner></lowerCorner> | ||
| 14 | +<upperCorner></upperCorner> | ||
| 14 | </defaults> | 15 | </defaults> |
pacotes/cswclient/lib/xsl/getrecords.xsl
| @@ -41,7 +41,21 @@ | @@ -41,7 +41,21 @@ | ||
| 41 | <xsl:if test="./literal !=''"> | 41 | <xsl:if test="./literal !=''"> |
| 42 | <csw:Constraint version="1.1.0"> | 42 | <csw:Constraint version="1.1.0"> |
| 43 | <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"> | 43 | <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"> |
| 44 | - <ogc:PropertyIsLike escape="\" singleChar="_" wildCard="%"> | 44 | + <ogc:And> |
| 45 | + <xsl:if test="./lowerCorner !=''"> | ||
| 46 | + <ogc:Intersects> | ||
| 47 | + <ogc:PropertyName>iso:BoundingBox</ogc:PropertyName> | ||
| 48 | + <gml:Envelope xmlns:gml="http://www.opengis.net/gml"> | ||
| 49 | + <gml:lowerCorner> | ||
| 50 | + <xsl:value-of select="./lowerCorner"/> | ||
| 51 | + </gml:lowerCorner> | ||
| 52 | + <gml:upperCorner> | ||
| 53 | + <xsl:value-of select="./upperCorner"/> | ||
| 54 | + </gml:upperCorner> | ||
| 55 | + </gml:Envelope> | ||
| 56 | + </ogc:Intersects> | ||
| 57 | + </xsl:if> | ||
| 58 | + <ogc:PropertyIsLike escape="\" singleChar="_" wildCard="%"> | ||
| 45 | <ogc:PropertyName> | 59 | <ogc:PropertyName> |
| 46 | <xsl:value-of select="./propertyname"/> | 60 | <xsl:value-of select="./propertyname"/> |
| 47 | </ogc:PropertyName> | 61 | </ogc:PropertyName> |
| @@ -49,6 +63,7 @@ | @@ -49,6 +63,7 @@ | ||
| 49 | <xsl:value-of select="./literal"/> | 63 | <xsl:value-of select="./literal"/> |
| 50 | </ogc:Literal> | 64 | </ogc:Literal> |
| 51 | </ogc:PropertyIsLike> | 65 | </ogc:PropertyIsLike> |
| 66 | + </ogc:And> | ||
| 52 | </ogc:Filter> | 67 | </ogc:Filter> |
| 53 | </csw:Constraint> | 68 | </csw:Constraint> |
| 54 | </xsl:if> | 69 | </xsl:if> |