Andrea Aime wrote: > Justin Deoliveira ha scritto: >> Hi all, >> >> The BasicFidMapper return a new fid using a UID. In gml / filter, a fid >> is defined to be an NCName. My problem is the string representation of a >> UID does not form a valid NCName. >> >> So I would like to modify the returned UID slighly so that: >> >> 1. It does not contain any non alpha numeric characters ( nameley ":" ) >> 2. It always starts with a letter >> >> Replacing the line: >> >> return new UID().toString() >> >> with: >> >> return "fid-" + new UID().toString().replaceAll("\\W","_") >> >> does the trick nicley. Does anyone have any objections? > > I don't have any, but what if the datastore uses a varchar property > that's user provided for ids, and the users do provide invalid > characters or have anyways invalid chars already there in the > column? Good point, > > Is it possible to find something like urlencoding, that provides > a two way conversion, and use it in the GML encoder? > What I mean, datastores are not affected by strange chars afaik, > so the problem is better handled on the GML side of the equation? I guess the problem here is to ensure the fid is valid gml involves changing it on the way out, which is definitley possible. However it gives the client a different fid. How do we know how to handle fids on the way in? Like on a subsequent request? Do we always "decode" them? How do we ensure the encoding is lossless?
Tough problem :). Its like a darned if you do, darned if you dont sort of thing. -Justin > > Cheers > Andrea > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Geotools-devel mailing list > Geotools-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-devel > > !DSPAM:1004,457fc944129011194215290! > -- Justin Deoliveira [EMAIL PROTECTED] The Open Planning Project http://topp.openplans.org ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel