Ignore:
Timestamp:
23/03/09 13:06:29 (12 years ago)
Author:
domlowe
Message:

typename parameter enabled in WFS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/wfs_controller.py

    r4912 r5131  
    141141        return xmlschema 
    142142     
    143     def _runQuery(self, queryxml = None, storedqueryid=None, **kwargs): 
     143    def _runQuery(self, queryxml = None, storedqueryid=None, typename=None, **kwargs): 
    144144        """ this is used by both the GetFeature and GetPropertyValue methods to 
    145145        run a wfs:query over a featurecollection and return a subset of the collection.  
     
    161161            log.debug('Final resultset from stored query %s'%resultset) 
    162162        else:            
    163             #If neither query or storedquery_id are provided then return entire featureset 
     163            #If neither query or storedquery_id are provided then return entire featureset, filtered on 'typename' if supplied. 
    164164            resultset=self.featureset.getFeatureList() 
     165            if typename: 
     166                templist = resultset[:] 
     167                for feature in templist: 
     168                    if feature.featuretype != typename: 
     169                        resultset.remove(feature) 
     170                resultset=resultset 
    165171        return resultset, additionalobjects 
    166172 
     
    224230        queryxml=self.getOwsParam('query',default=None) 
    225231        storedqueryid=self.getOwsParam('storedquery_id', default=None) 
     232        typename=self.getOwsParam('typename', default=None) 
    226233        #get any other parameters from self._owsParams and pass them to the stored query 
    227234        otherparams={} 
    228235        for key in self._owsParams.keys(): 
    229             if key not in ['query', 'request', 'service', 'version', 'storedquery_id', 'valuereference']: 
     236            if key not in ['query', 'request', 'service', 'version', 'storedquery_id', 'typename', 'valuereference']: 
    230237                otherparams[key]=self._owsParams[key]      
    231         featureresultset, additionalobjects =self._runQuery(queryxml, storedqueryid, **otherparams)         
     238        featureresultset, additionalobjects =self._runQuery(queryxml, storedqueryid, typename **otherparams)         
    232239        
    233240        #Now need to take account of valueReferencexpath, and distill the  
Note: See TracChangeset for help on using the changeset viewer.