Changeset 4398 for cows/trunk


Ignore:
Timestamp:
30/10/08 15:35:08 (11 years ago)
Author:
domlowe
Message:

Adding stub code for WFS 2.0 stored query implementation

Location:
cows/trunk/cows
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/pylons/templates/wfs_capabilities_2_0_0.xml

    r4394 r4398  
    106106    <py:if test="om is not None"> 
    107107      <?python 
    108         ops = ['GetCapabilities', 'DescribeFeature', 'GetFeature'] 
     108        ops = ['GetCapabilities', 'DescribeFeature', 'GetFeature', 'DescribeStoredQueries'] 
    109109        eops = [x for x in om.operationDict.keys() if x not in ops] 
    110110      ?> 
  • cows/trunk/cows/pylons/wfs_controller.py

    r4394 r4398  
    4040 
    4141    service = 'WFS' 
    42     owsOperations = (ows_controller.OWSController.owsOperations + ['DescribeFeatureType', 'GetFeature']) 
     42    owsOperations = (ows_controller.OWSController.owsOperations + ['DescribeFeatureType', 'GetFeature', 'DescribeStoredQueries']) 
    4343    validVersions = ['1.1.0', '2.0.0'] 
    4444     
     
    8787        ows_controller.addOperation('GetFeature') 
    8888        ows_controller.addOperation('DescribeFeature') 
     89        ows_controller.addOperation('DescribeStoredQueries') 
    8990         
    9091         
     
    114115            c.capabilities.contents.datasetSummaries.append(ds) 
    115116 
     117    def _buildStoredQueries(self): 
     118        return self.layerMapper.queryDescriptions.queries 
     119 
    116120    def _getSchema(self, typename): 
    117121        namespace = typename.split(':')[0] 
     
    131135        return xmlschema 
    132136 
    133                  
    134137    def DescribeFeatureType(self): 
    135138        """ DescribeFeatureType """ 
     
    172175 
    173176 
    174 #        featureid=self.getOwsParam('featureid') 
    175 #        #TODO populate self.featureinstances! 
    176 #        feature=self.featureset.featureinstances[featureid]     
    177 #        response.headers['content-type'] = 'text/xml' 
    178 #        return feature.toGML() 
    179 #         
    180177     
    181     
     178    def DescribeStoredQueries(self): 
     179        """ DescribeStoredQueries method. Takes zero or more stored query ids as args""" 
     180        c.storedqueries = self._buildStoredQueries() 
     181        t = ows_controller.templateLoader.load('wfs_describestoredqueries.xml') 
     182        return t.generate(c=c).render()   
     183          
  • cows/trunk/cows/service/imps/csmlbackend/wfs_csmllayer.py

    r4394 r4398  
    66from cows.service.imps.csmlbackend.csmlcommon import CSMLLayerMapper, CSMLConnector 
    77from cows.service.wfs_iface import * 
     8from cows.model.storedquery import * 
    89import csml 
    910from xml.etree import ElementTree as etree 
     
    2930        super(CSMLwfsLayerMapper, self).__init__() 
    3031        self.featureinstancecache={} 
     32        self.queryDescriptions=CSMLStoredQueries() 
    3133     
    3234 
     
    8082        else: 
    8183            raise ValueError 
     84 
     85class CSMLStoredQueries(object): 
     86    """ Holds definitions of supported WFS stored queries and mappings to functional implementations""" 
     87    def __init__(self): 
     88        #self.queries is a dictionary of form: {id:(StoredQuery, func)} 
     89        #where fun is the name of the implementation of the stored query (typically) in wfs_csmlstoredqueries 
     90        self.queries={} 
     91        qid='queryOne' 
     92        query=StoredQuery(qid) 
     93        self.queries[qid]=(query, 'query_one_func') 
     94        qid='queryTwo' 
     95        query=StoredQuery(qid) 
     96        self.queries[qid]=(query, 'query_two_func')       
     97         
    8298 
    8399class CSMLFeatureSet(IFeatureSet): 
Note: See TracChangeset for help on using the changeset viewer.