Opened 12 years ago

Closed 11 years ago

#320 closed defect (fixed)

Adding parameterized definitions doesn't work

Reported by: Dimitar Misev Owned by: mrusu
Priority: major Milestone: 8.5
Component: secore Version: 8.3
Keywords: Cc: Piero Campalani
Complexity: Easy

Description

Adding parameterized definitions via the browse.jsp interface doesn't work properly, as the variables in the parameter values which should be in the form ${variableName} are replaced with $ when inserted in the database.

To reproduce, go to http://localhost:8080/def/crs/AUTO/1.3/browse.jsp and add the following definition:

<ParameterizedCRS xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:epsg="urn:x-ogp:spec:schema-xsd:EPSG:0.1:dataset" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns="http://www.opengis.net/gml" gml:id="parameterized">
  <parameters>
    <parameter name="lon">
      <value>0.0</value>
    </parameter>
    <parameter name="lat">
      <value>0.0</value>
    </parameter>
    <parameter name="zone">
      <value>Math.min( Math.floor( (${lon} + 180.0) / 6.0 ) + 1, 60 )</value>
    </parameter>
    <parameter name="central_meridian">
      <value>-183.0 + ${zone} * 6.0</value>
      <target>//gml:greenwichLongitude</target>
    </parameter>
    <parameter name="false_northing">
      <value>(${lat} >= 0.0) ? 0.0 : 10000000.0</value>
    </parameter>
  </parameters>
  <identifier>urn:ogc:def:crs:AUTO:1.3:42002</identifier>
  <targetCRS xlink:href="http://www.opengis.net/def/crs/EPSG/0/4326"/>
</ParameterizedCRS>

if you click on the created definition it will be like:

<ParameterizedCRS xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:epsg="urn:x-ogp:spec:schema-xsd:EPSG:0.1:dataset" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns="http://www.opengis.net/gml" gml:id="parameterized">
  <parameters>
    <parameter name="lon">
      <value>0.0</value>
    </parameter>
    <parameter name="lat">
      <value>0.0</value>
    </parameter>
    <parameter name="zone">
      <value>Math.min( Math.floor( ($ + 180.0) / 6.0 ) + 1, 60 )</value>
    </parameter>
    <parameter name="central_meridian">
      <value>-183.0 + $ * 6.0</value>
      <target>//gml:greenwichLongitude</target>
    </parameter>
    <parameter name="false_northing">
      <value>($ >= 0.0) ? 0.0 : 10000000.0</value>
    </parameter>
  </parameters>
  <identifier>urn:ogc:def:crs:AUTO:1.3:42002</identifier>
  <targetCRS xlink:href="http://www.opengis.net/def/crs/EPSG/0/4326"/>
</ParameterizedCRS>

Change History (4)

comment:1 by Dimitar Misev, 12 years ago

Mihaela, can you please take care of this since you wrote the browse interface.

comment:2 by mrusu, 12 years ago

Status: newaccepted

The problem doesn't seem to be with browse.jsp, the query sent to the servlet still contains the curly brackets. Most probably it happens when adding it to the db. Working on it.

comment:3 by Dimitar Misev, 12 years ago

Ok forget it, I submitted a patch that fixes it. Curly braces need to be escaped by double curly braces in XQuery.

comment:4 by Dimitar Misev, 11 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.