Changeset 2950


Ignore:
Timestamp:
15/10/07 09:29:59 (12 years ago)
Author:
domlowe
Message:

Section parameter implemented so can now request a chosen section of capabilites document

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

Legend:

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

    r2936 r2950  
    143143            ds.datasetSummaries.append(feature_ds) 
    144144        sm.contents = Contents(datasetSummaries=[ds]) 
     145        if self.sectionrequested is not None: 
     146            sm.sectionrequested = self.sectionrequested 
    145147        return sm 
    146148 
     
    171173    @parameter('Service', possibleValues=['WCS'], required=True) 
    172174    @parameter('Version', possibleValues=['1.0.0']) 
    173     def GetCapabilities(self, uri, service=None, version=None): 
     175    @parameter('Section', possibleValues=['Service', 'Capability', 'ContentMetadata']) 
     176    def GetCapabilities(self, uri, service=None, version=None, section=None): 
    174177        """ 
    175178        @note: format and updatesequence parameters are not supported 
     
    180183 
    181184        #get doc from cache or disk: 
     185        self.sectionrequested=section 
    182186        try: 
    183187            rstatus,c.dataset=interface.GetParsedCSML(uri)                 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wcs1_0_0_Capabilities.kid

    r2930 r2950  
    4646    newelement.append(dcp)     
    4747    return newelement 
    48  
     48     
    4949?> 
    5050<WCS_Capabilities xmlns:py="http://purl.org/kid/ns#" xmlns="http://www.opengis.net/wcs" 
     
    5252    xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" 
    5353    version="1.0.0"> 
    54  
    55  
    5654 
    5755 
     
    7876  sm = c.service_metadata 
    7977  si = c.service_metadata.serviceIdentification     
     78  #manage flags to specify if only a section of the capabilities doc has been requested: 
     79  servSection, capSection, cmSection=True, True, True 
     80 
     81  if sm.sectionrequested == 'Service': 
     82      capSection=False 
     83      cmSection=False 
     84  elif sm.sectionrequested == 'Capability': 
     85      servSection=False 
     86      cmSection=False 
     87  elif sm.sectionrequested == 'ContentMetadata': 
     88      servSection=False 
     89      capSection=False 
     90 
     91 
    8092  ?> 
    8193  <!--***************************************--> 
    8294  <!--*     Service                         *--> 
    8395  <!--***************************************--> 
    84   <Service> 
     96  <Service py:if="servSection is True"> 
    8597    <description py:if="len(si.abstracts)>0" py:content="si.abstracts[0]"/>     
    8698    <name>tba</name> 
     
    128140<!--***************************************--> 
    129141    <?python om = sm.operationsMetadata ?> 
    130     <Capability> 
     142    <Capability py:if="capSection is True"> 
    131143        <Request> 
    132144            <ops py:for="opName, op in om.operationDict.items()" 
     
    143155  <!--*        ContentMetadata                *--> 
    144156  <!--***************************************-->   
    145   <ContentMetadata> 
     157  <ContentMetadata py:if="cmSection is True"> 
    146158        <CoverageOfferingBrief py:for="ds in sm.contents.datasetSummaries[0].datasetSummaries" py:replace="coverageSummary(ds)"/> 
    147159  </ContentMetadata> 
Note: See TracChangeset for help on using the changeset viewer.