Changeset 2549 for TI05-delivery


Ignore:
Timestamp:
06/06/07 15:11:50 (12 years ago)
Author:
spascoe
Message:

Fleshed out WMS 1.3 capabilities. Still more to do.

Location:
TI05-delivery/ows_framework/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_common/ows_common/contents.py

    r2529 r2549  
    2929    @ivar identifier 
    3030    @type identifier: None, str or Code 
     31    @ivar datasetSummaries 
     32    @type datasetSummaries: Iterable of DatasetSummary objects 
    3133    @ivar metadata 
    3234    @type metadata: iterable of Metadata objects 
     
    3840 
    3941    def __init__(self, titles=[], abstracts=[], keywords=Keywords(), 
    40                  identifier=None, metadata=[], boundingBoxes=[], 
     42                 identifier=None, datasetSummaries=[], metadata=[], boundingBoxes=[], 
    4143                 wgs84BoundingBoxes=[]): 
    4244        super(DatasetSummary, self).__init__(titles, abstracts, keywords) 
    4345 
    4446        self.identifier = identifier 
     47        self.datasetSummaries = datasetSummaries 
    4548        self.metadata = metadata 
    4649        self.boundingBoxes = boundingBoxes 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wms.py

    r2529 r2549  
    4343        sm = super(CsmlWmsController, self)._load_capabilities() 
    4444 
    45         # Add a DatasetSummary for each feature 
    46         contents = Contents() 
     45        # For WMS 1.3.0 compatibility we need a single root DatasetSummary 
     46        ds = DatasetSummary(titles=['Root Dataset'], datasetSummaries=[]) 
     47        # Add a DatasetSummary for each feature         
    4748        for f_n in c.dataset.getFeatureList(): 
    4849            f = c.dataset.getFeature(f_n) 
    49             contents.datasetSummaries.append(DatasetSummary(identifier=f.id, 
    50                                                             titles=[f.description.CONTENT])) 
     50            ds.datasetSummaries.append(DatasetSummary(identifier=f.id, 
     51                                                      titles=[f.description.CONTENT])) 
    5152 
    52         sm.contents = contents 
     53        sm.contents = Contents(datasetSummaries=[ds]) 
    5354        return sm 
    5455 
     
    8283        c.service_metadata = self._load_capabilities() 
    8384 
    84         r = render_response('ows/get_capabilities', format='xml') 
     85        r = render_response('ows/wms_capabilities', format='xml') 
    8586        r.headers['content-type'] = 'text/xml' 
    8687        return r 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ows/get_capabilities.kid

    r2529 r2549  
    44from ows_common.domain import PossibleValues, Range 
    55 
     6# Define useful namespaces 
     7ows_ns = 'http://www.opengis.net/ows/1.1' 
     8xlink_ns = 'http://www.w3.org/1999/xlink' 
     9 
     10 
    611def langstr_attrs(k): 
    712    """ 
     
    1015 
    1116    """ 
    12     try: 
    13         d = {'lang': k.lang} 
    14     except AttributeError: 
    15         d = {} 
    16     return d 
     17    return dict(lang=getattr(k, 'lang', None)) 
    1718 
    1819def code_attrs(c): 
    19     try: 
    20         d = {'codeSpace': c.codeSpace} 
    21     except AttributeError: 
    22         d = {} 
    23     return d 
     20    return dict(codeSpace=getattr(c, 'codeSpace', None)) 
    2421 
    2522def kw_type(kw): 
     
    4340 
    4441    """ 
    45     try: 
    46         d = {'reference': dm.reference} 
    47     except AttributeError: 
    48         d = {} 
    49  
    50     return d 
     42    return dict(reference=getattr(dm, 'reference', None)) 
    5143 
    5244 
     
    5648              xmlns:xlink="http://www.w3.org/1999/xlink"  
    5749              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
    58               xsi:schemaLocation="http://www.opengis.net/ows/1.1 exampleCapabilities.xsd" 
     50              xsi:schemaLocation="http://www.opengis.net/ows/1.1 
     51                                  http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd" 
    5952              version="${c.version}"> 
    6053   
     
    130123    <?python rp = sp.serviceContact ?> 
    131124    <ResponsibleParty py:if="rp is not None"> 
    132       <IndividualName py:if="rp.individualName is not None">${rp.individualName}</IndividualName> 
    133       <PositionName py:if="rp.positionName is not None">${rp.positionName}</PositionName> 
    134       <Role py:if="rp.role is not None">${rp.role}</Role> 
     125      <IndividualName py:if="rp.individualName is not None" py:content="rp.individualName"/> 
     126      <PositionName py:if="rp.positionName is not None" py:content="rp.positionName"/> 
     127      <Role py:if="rp.role is not None" py:content="rp.role"/> 
    135128      <?python ci = rp.contactInfo ?> 
    136129      <ContactInfo py:if="ci is not None"> 
    137         <HoursOfService py:if="ci.hoursOfService is not None">${ci.hoursOfService}</HoursOfService> 
    138         <ContactInstructions py:if="ci.contactInstructions is not None">${ci.contactInstructions}</ContactInstructions> 
     130        <HoursOfService py:if="ci.hoursOfService is not None" py:content="ci.hoursOfService"/> 
     131        <ContactInstructions py:if="ci.contactInstructions is not None" 
     132                             py:content="ci.contactInstructions"/> 
    139133        <?python a = ci.address ?> 
    140134        <Address> 
    141135          <DeliveryPoint py:for="dp in a.deliveryPoints" 
    142136                         py:content="dp"/> 
    143           <City py:if="a.city is not None">${a.city}</City> 
    144           <AdministrativeArea py:if="a.administrativeArea is not None">${a.administrativeArea}</AdministrativeArea> 
    145           <PostalCode py:if="a.postalCode is not None">${a.postalCode}</PostalCode> 
    146           <Country py:if="a.country is not None">${a.country}</Country> 
    147           <ElectronicMailAddress py:if="a.electronicMailAddress is not None">${a.electronicMailAddress}</ElectronicMailAddress> 
     137          <City py:if="a.city is not None" py:content="a.city"/> 
     138          <AdministrativeArea py:if="a.administrativeArea is not None" 
     139                              py:content="a.administrativeArea"/> 
     140          <PostalCode py:if="a.postalCode is not None" 
     141                      py:content="a.postalCode"/> 
     142          <Country py:if="a.country is not None" py:content="a.country"/> 
     143          <ElectronicMailAddress py:if="a.electronicMailAddress is not None" 
     144                                 py:content="a.electronicMailAddress"/> 
    148145        </Address> 
    149146        <Phone py:if="ci.phone is not None"> 
    150           <Voice py:if="ci.phone.voice is not None">${ci.phone.voice}</Voice> 
    151           <Facsimile py:if="ci.phone.facsimile is not None">${ci.phone.facsimile}</Facsimile> 
     147          <Voice py:if="ci.phone.voice is not None" 
     148                 py:content="ci.phone.voice"/> 
     149          <Facsimile py:if="ci.phone.facsimile is not None" 
     150                     py:content="ci.phone.facsimile"/> 
    152151        </Phone> 
    153         <OnlineResource py:if="ci.onlineResource is not None">${ci.onlineResource}</OnlineResource> 
     152        <OnlineResource py:if="ci.onlineResource is not None" 
     153                        py:content="ci.onlineResource"/> 
    154154      </ContactInfo> 
    155155    </ResponsibleParty> 
Note: See TracChangeset for help on using the changeset viewer.