Changeset 2524


Ignore:
Timestamp:
29/05/07 18:04:52 (12 years ago)
Author:
spascoe
Message:

Still messing around with get_capabilities. More works now. Some
debugging required.

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

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/csml_wms.py

    r2507 r2524  
    4444                                              'SERVICE') 
    4545         
    46         ows_c_file = request.environ['paste.config']['app_conf']['ows_common_config'] 
    47         c.ows_c = ET.parse(ows_c_file).getroot() 
    48         c.dataset = get_csml_doc(file) 
    49         c.ows_capabilities = self._load_capabilities( 
     46        #c.dataset = get_csml_doc(file) 
     47        c.service_metadata = self._load_capabilities( 
    5048            h.url_for(controller='csml_wms', file=file) 
    5149            ) 
     50        c.version = '1.1.0' 
    5251         
    53         return render_response('wms_service_metadata', format='xml') 
     52        return render_response('ows/get_capabilities', format='xml') 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/base.py

    r2507 r2524  
    1111from ows_common.operations_metadata import OperationsMetadata, Operation, RequestMethod 
    1212from ows_common.get_capabilities import ServiceMetadata 
     13import ows_common.xml 
     14from elementtree import ElementTree as ET 
    1315 
    1416class BaseController(WSGIController): 
     
    7779 
    7880        """ 
    79         if hasattr(self, '_ows_service_metadata'): 
    80             return 
    8181 
     82        # Get the server-level configuration data from an XML file 
     83        config = request.environ['paste.config'] 
     84        sm_tree = ET.parse(config['ows_common_config']) 
     85        sm = ows_common.xml.service_metadata(sm_tree.getroot()) 
     86 
     87        # Extract service-level parameters and constraint 
    8288        parameters = getattr(self, '_ows_parameters', {}) 
    8389        constraints = getattr(self, '_ows_constraints', {}) 
    8490 
     91        # Extract operation-level parameters and constraints 
    8592        od = {} 
    8693        for attr in dir(self): 
     
    94101                                             constraints=c) 
    95102         
    96         om = OperationsMetadata(od, constraints, parameters) 
    97         return ServiceMetadata(operationsMetadata=om) 
     103        sm.operationsMetadata = OperationsMetadata(od, constraints, parameters) 
     104         
     105        return sm 
    98106 
    99107# Include the '_' function in the public names 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ows/get_capabilities.kid

    r2521 r2524  
    6868  <DomainMetadata py:def="domain_metadata(dm)" py:attrs="dm_attrs(dm)">${dm}</DomainMetadata> 
    6969 
    70   <py:block py:def="domain(d)" strip="1"> 
     70  <py:block py:def="domain(d)" py:strip="1"> 
    7171    <DefaultValue py:if="d.defaultValue is not None">${d.defaultValue}</DefaultValue> 
    7272    <Meaning py:if="d.meaning is not None" 
     
    118118      ${a} 
    119119    </Abstract> 
    120     <ServiceVersionType py:for="v in si.serviceVersionTypes">${v}</ServiceVersionType> 
     120    <ServiceTypeVersion py:for="v in si.serviceTypeVersions">${v}</ServiceTypeVersion> 
    121121    <Profile py:for="p in si.profiles">${p}</Profile> 
    122122    <Fees>${si.fees}</Fees> 
     
    126126  <?python sp = c.service_metadata.serviceProvider ?> 
    127127  <ServiceProvider py:if="sp is not None"> 
    128     <ProviderSite py:if="sp.providerSite is not None" xlink:href="sp.providerSite.href"/> 
     128    <ProviderSite py:if="sp.providerSite is not None" xlink:href="${sp.providerSite.href}"/> 
    129129    <?python rp = sp.serviceContact ?> 
    130130    <ResponsibleParty py:if="rp is not None"> 
     
    138138        <?python a = ci.address ?> 
    139139        <Address> 
    140           <DeliveryPoint py:if="a.deliveryPoint is not None">${a.deliveryPoint}</DeliveryPoint> 
     140          <DeliveryPoint py:for="dp in a.deliveryPoints" 
     141                         py:content="dp"/> 
    141142          <City py:if="a.city is not None">${a.city}</City> 
    142143          <AdministrativeArea py:if="a.administrativeArea is not None">${a.administrativeArea}</AdministrativeArea> 
     
    160161    <Constraint py:for="c in om.constraints" name="${c}" 
    161162                py:content="domain(om.constraints[c])"/> 
    162     <Operation py:for="(opName, op) in im.operationDict.items()" 
     163    <Operation py:for="(opName, op) in om.operationDict.items()" 
    163164               name="${opName}"> 
    164165      <Parameter py:for="p in op.parameters" name="${p}" 
Note: See TracChangeset for help on using the changeset viewer.