jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • GeoServer
  • GEOS-3026

Spaces in resource name breaks KML and GML output formats.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0-alpha2
  • Fix Version/s: 2.0-beta1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Ubuntu Jaunty

Description

If a space is added into the resource name of a layer, KML and GML output formats in the layer preview break, and they will break in different ways.

Steps to reproduce:
1) Install and run a fresh install of Geoserver.
2) On the Layers page, click on the "states" layer and then change the layer's resource name to "united states". Make sure you include the space, but ignore the quotes. Click Save.
3) Click on the Layer Preview page, and then preview the "topp:united states" layer in the formats below. Note that that each format errors in different ways. I've included the errors with the formats below

Discussion:

Justin said we should probably disallow having spaces in resource names. Sounds like a good plan. Do we know if customers rely on spaces?

Formats:

KML & GML quick links, and KML (plain) from the dropdown: Errors with a javascript error. http://localhost:8081/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage (line 1)

syntax error ../wms/kml_reflect?layers=topp:united states

KML (compressed): Google Earth shows a big X where the layer should be.

GML 2: New tab showing:

XML Parsing Error: not well-formed
Location: http://localhost:8081/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:united%20states&maxFeatures=50&outputFormat=GML2
Line Number 1, Column 642:

(I've suppressed the long string of XML)

GML3:

<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
−
<ServiceException>

java.lang.RuntimeException: Encode failed for _Feature. Cause: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
Encode failed for _Feature. Cause: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
</ServiceException>
</ServiceExceptionReport>

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Andrea Aime added a comment - 15/May/09 8:25 AM

Right... we miss a validator to prevent that kind of invalid names. In fact we have to make sure all resource names are valid typenames wfs wise.

Show
Andrea Aime added a comment - 15/May/09 8:25 AM Right... we miss a validator to prevent that kind of invalid names. In fact we have to make sure all resource names are valid typenames wfs wise.
Hide
Permalink
Andrea Aime added a comment - 15/May/09 9:00 AM

Justin, do you think the regular expression "[\w][\w.-]*" captures all the valid wfs 1.0 names? (afaik we want to keep the ones with _ as valid even if the wfs 1.1 standard does not consider them so, I remember something coming from MASSGis about their typenames).

Show
Andrea Aime added a comment - 15/May/09 9:00 AM Justin, do you think the regular expression "[\w][\w.-]*" captures all the valid wfs 1.0 names? (afaik we want to keep the ones with _ as valid even if the wfs 1.1 standard does not consider them so, I remember something coming from MASSGis about their typenames).
Hide
Permalink
Andrea Aime added a comment - 18/May/09 10:40 AM

Committed with the suggested pattern. If that is not good please reopen

Show
Andrea Aime added a comment - 18/May/09 10:40 AM Committed with the suggested pattern. If that is not good please reopen
Hide
Permalink
Tim Schaub added a comment - 24/Jun/10 3:23 PM

There may be a different issue open about this, but numbers should not be allowed as the first character either (for serializing as XML). ^[a-zA-Z][\w-]*$ perhaps?

Show
Tim Schaub added a comment - 24/Jun/10 3:23 PM There may be a different issue open about this, but numbers should not be allowed as the first character either (for serializing as XML). ^[a-zA-Z][\w-]*$ perhaps?
Hide
Permalink
Andrea Aime added a comment - 24/Jun/10 3:40 PM

There is the issue that someone just interested in publishing via WMS does not have any of these restrictions...

Show
Andrea Aime added a comment - 24/Jun/10 3:40 PM There is the issue that someone just interested in publishing via WMS does not have any of these restrictions...

People

  • Assignee:
    Andrea Aime
    Reporter:
    Tim Coulter
Vote (0)
Watch (1)

Dates

  • Created:
    11/May/09 5:02 PM
    Updated:
    24/Jun/10 3:40 PM
    Resolved:
    18/May/09 10:40 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.