Ignore:
Timestamp:
03/11/08 16:36:55 (11 years ago)
Author:
domlowe
Message:

More prototype support for stored queries.

File:
1 edited

Legend:

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

    r4400 r4408  
    4040 
    4141    service = 'WFS' 
    42     owsOperations = (ows_controller.OWSController.owsOperations + ['DescribeFeatureType', 'GetFeature', 'DescribeStoredQueries']) 
     42    owsOperations = (ows_controller.OWSController.owsOperations + ['DescribeFeatureType', 'GetFeature', 'DescribeStoredQueries','ListStoredQueries']) 
    4343    validVersions = ['1.1.0', '2.0.0'] 
    4444     
     
    114114 
    115115            c.capabilities.contents.datasetSummaries.append(ds) 
    116  
    117     def _buildStoredQueries(self): 
    118         return self.layerMapper.queryDescriptions.queries 
    119116 
    120117    def _getSchema(self, typename): 
     
    169166        queryxml=self.getOwsParam('query',default=None) 
    170167        storedqueryid=self.getOwsParam('storedquery_id', default=None) 
     168         
     169        #TODO get any other parameters from self._owsParams and pass them to the stored query        
    171170        if queryxml: 
    172171            qp=FEQueryProcessor() 
     
    175174        elif storedqueryid: 
    176175            storedquery, func=self.layerMapper.queryDescriptions.queries[storedqueryid] 
    177             c.resultset=func(arg1='cat', arg2='dog') 
     176            c.resultset=func(self.featureset, arg1='cat', arg2='dog') 
    178177            log.debug('Final resultset from stored query %s'%c.resultset) 
    179178        else: 
     
    185184        return t.generate(c=c).render()             
    186185 
    187  
    188      
     186    
    189187    def DescribeStoredQueries(self): 
    190188        """ DescribeStoredQueries method. Takes zero or more stored query ids as args""" 
    191         c.storedqueries = self._buildStoredQueries() 
     189        allqueries=self.layerMapper.queryDescriptions.queries         
     190        storedqueryid=self.getOwsParam('storedqueryid', default=None) 
     191        if storedqueryid is None: 
     192            c.storedqueries = self.layerMapper.queryDescriptions.queries 
     193        else: 
     194            c.storedqueries={} 
     195            for queryid in storedqueryid.split(','): 
     196                c.storedqueries[queryid]=self.layerMapper.queryDescriptions.queries[queryid]        
    192197        t = ows_controller.templateLoader.load('wfs_describestoredqueries.xml') 
    193198        return t.generate(c=c).render()   
    194199          
     200    def ListStoredQueries(self): 
     201        """ DescribeStoredQueries method. Takes zero or more stored query ids as args""" 
     202        c.storedqueries = self.layerMapper.queryDescriptions.queries 
     203        t = ows_controller.templateLoader.load('wfs_liststoredqueries.xml') 
     204        return t.generate(c=c).render()  
Note: See TracChangeset for help on using the changeset viewer.