<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<br>(FYI I inadvertently replied offlist, sorry)<br><br>Hi Adrià: This was happening in the absence of an ISO <-> DC mapping for this use case (i.e. querying csw:Record, asking for ISO back). I've committed the ISO to DC serializer in the code (and at the same time ended up refactoring the csw:Record serializer, which was occurring in two places -- thanks!). Can you test this and let us know if this works for you?<br><br>Thanks much for testing and feedback!<br><br>..Tom<br><br><br>> Date: Fri, 3 Jun 2011 15:42:58 +0100<br>> From: amercader.dev@gmail.com<br>> To: pycsw-devel@lists.sourceforge.net<br>> Subject: [pycsw-devel] Constraint parameter<br>> <br>> Hi Tom,<br>> Yes, that worked nicely thank you. But I'm getting another error :)<br>> I loaded the example records provided in the data/cite directory (I'm<br>> using Postgres 8.4 as db backend) and when doing this query:<br>> <br>> http://localhost/csw/csw.py?REQUEST=GetRecords&SERVICE=CSW&VERSION=2.0.2&CONSTRAINTLANGUAGE=CQL_TEXT&TYPENAMES=csw:Record&RESULTTYPE=results&OUTPUTSCHEMA=http://www.isotc211.org/2005/gmd&CONSTRAINT_LANGUAGE_VERSION=1.1.0&elementSetName=summary<br>> <br>> I get this:<br>> <br>> Traceback (most recent call last):<br>> File "/var/www/apps/pycsw/trunk/csw.py", line 40, in <module><br>> CSW.dispatch()<br>> File "/var/www/apps/pycsw/trunk/server/server.py", line 243, in dispatch<br>> self.response = self.getrecords()<br>> File "/var/www/apps/pycsw/trunk/server/server.py", line 926, in getrecords<br>> self.repository.queryables['_all']))<br>> File "/var/www/apps/pycsw/trunk/server/profiles/apiso/apiso.py",<br>> line 375, in write_record<br>> codeSpace = CODESPACE).text = val<br>> File "lxml.etree.pyx", line 2437, in lxml.etree.SubElement<br>> (src/lxml/lxml.etree.c:47709)<br>> File "apihelpers.pxi", line 210, in lxml.etree._makeSubElement<br>> (src/lxml/lxml.etree.c:11413)<br>> File "apihelpers.pxi", line 205, in lxml.etree._makeSubElement<br>> (src/lxml/lxml.etree.c:11349)<br>> File "apihelpers.pxi", line 283, in lxml.etree._initNodeAttributes<br>> (src/lxml/lxml.etree.c:12184)<br>> File "apihelpers.pxi", line 1293, in lxml.etree._utf8<br>> (src/lxml/lxml.etree.c:20190)<br>> TypeError: Argument must be string or unicode.<br>> <br>> val is None in apiso.py. If I check for val in line 371, the records<br>> are returned nicely. (Of course I don't know the implications of this<br>> fix)<br>> <br>> Thanks,<br>> <br>> Adrià<br>> <br>> <br>> On 3 June 2011 15:13, Tom Kralidis <tomkralidis@hotmail.com> wrote:<br>> ><br>> ><br>> >> Date: Fri, 3 Jun 2011 14:43:54 +0100<br>> >> From: amercader.dev@gmail.com<br>> >> To: pycsw-devel@lists.sourceforge.net<br>> >> Subject: [pycsw-devel] Constraint parameter<br>> >><br>> >> Hi all,<br>> >> I'm using the latest svn trunk, and when doing a GetRecords query like<br>> >> the following I get a 500 error with the following traceback:<br>> >><br>> >><br>> >> http://localhost/csw/csw.py?REQUEST=GetRecords&SERVICE=CSW&VERSION=2.0.2&CONSTRAINTLANGUAGE=CQL_TEXT&TYPENAMES=csw:Record&RESULTTYPE=results&OUTPUTSCHEMA=http://www.isotc211.org/2005/gmd&CONSTRAINT_LANGUAGE_VERSION=1.1.0&ELEMENTSETNAME=brief<br>> >><br>> >> Traceback (most recent call last):<br>> >> File "/var/www/apps/pycsw/trunk/csw.py", line 40, in <module><br>> >> CSW.dispatch()<br>> >> File "/var/www/apps/pycsw/trunk/server/server.py", line 243, in dispatch<br>> >> self.response = self.getrecords()<br>> >> File "/var/www/apps/pycsw/trunk/server/server.py", line 834, in getrecords<br>> >> (self.kvp['constraint'], self.kvp['sortby'], self.kvp['typenames']))<br>> >> KeyError: 'constraint'<br>> >><br>> >> If I add something like "&CONSTRAINT=1" to the query I get the<br>> >> records. AFAIK, constraint is an optional parameter of the getrecords<br>> >> request, so maybe this is a bug?<br>> >><br>> >> Cheers,<br>> >><br>> >> Adrià<br>> >><br>> ><br>> > Hi Adrià: thanks for the info. I've applied a fix in trunk. Can you test<br>> > and let me know if this works for you?<br>> ><br>> > ..Tom<br>> ><br>> ><br>> <br>> <br>> <br>> --<br>> <br>> <br>> Adrià Mercader<br>> -----------------------------<br>> http://amercader.net<br>> <br>> <br>> <br>> -- <br>> <br>> <br>> Adrià Mercader<br>> -----------------------------<br>> http://amercader.net<br>> <br>> ------------------------------------------------------------------------------<br>> Simplify data backup and recovery for your virtual environment with vRanger.<br>> Installation's a snap, and flexible recovery options mean your data is safe,<br>> secure and there when you need it. Discover what all the cheering's about.<br>> Get your free trial download today. <br>> http://p.sf.net/sfu/quest-dev2dev2 <br>> _______________________________________________<br>> pycsw-devel mailing list<br>> pycsw-devel@lists.sourceforge.net<br>> https://lists.sourceforge.net/lists/listinfo/pycsw-devel<br>                                            </body>
</html>