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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.