Changeset 6041 for qesdi/wms_ddc_vis


Ignore:
Timestamp:
24/11/09 12:47:11 (10 years ago)
Author:
pnorton
Message:

Made some minor alterations to the controllers.

Location:
qesdi/wms_ddc_vis/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • qesdi/wms_ddc_vis/trunk/buildout/buildout.cfg

    r6025 r6041  
    3232  wms_ddc_vis 
    3333  simplejson 
     34  Shapely 
    3435# used for testing 
    3536  libxml2dom 
  • qesdi/wms_ddc_vis/trunk/lib/wms_ddc_vis/controllers/catalogue.py

    r5403 r6041  
    11import logging 
    22 
    3 from wms_ddc_vis.lib.base import * 
     3import wms_ddc_vis.lib.base as base 
    44 
    55log = logging.getLogger(__name__) 
    66 
    7 class CatalogueController(BaseController): 
     7class CatalogueController(base.BaseController): 
    88    """List available endpoints. 
    99    """ 
    1010 
    1111    def index(self): 
    12         c.featureCollections = globalCSMLConnector.list() 
    13  
    14         t = templateLoader.load('catalogue.xml') 
    15         return t.generate(c=c).render() 
     12        base.c.featureCollections = base.globalCSMLConnector.list() 
     13         
     14        t = base.templateLoader.load('catalogue.xml') 
     15         
     16        return t.generate(c=base.c).render() 
  • qesdi/wms_ddc_vis/trunk/lib/wms_ddc_vis/controllers/coastwms.py

    r6020 r6041  
    66import genshi.template  
    77from cows.pylons import ows_controller 
     8from pylons import config 
    89from cows.service.imps.data_reader_geoplot_backend.rendering_option import RenderingOption 
    910from cows.service.imps.data_reader_geoplot_backend.slab_options_parser import SlabOptionsParser 
     
    137138#                dataURLs=[] 
    138139             
    139             onlineRes = OnlineResource(url_for(qualified=True, action='index') +\ 
     140            onlineRes = OnlineResource(self._getIndexActionURL() +\ 
    140141                                    "?request=GetDisplayOptions&layers=%s" % layerName) 
    141142            metadataURL = MetadataURL(metadataType='display_options', format='application/json', onlineResource=onlineRes) 
     
    435436      
    436437        return img 
     438 
     439    def _getIndexActionURL(self): 
     440        """ 
     441        Uses the pylons config to build a url for the index action of this contoller. 
     442        """ 
     443                 
     444        indexURL = url_for(qualified=True, action='index') 
     445        return indexURL     
  • qesdi/wms_ddc_vis/trunk/lib/wms_ddc_vis/lib/base.py

    r5403 r6041  
    1616from cows.pylons.ows_controller import templateLoader 
    1717 
     18from genshi.template import TemplateLoader 
     19from pkg_resources import resource_filename 
     20 
     21ddcVisTemplateLoader = TemplateLoader( 
     22    resource_filename('wms_ddc_vis', 'templates'), 
     23    auto_reload=True, 
     24    ) 
     25 
    1826class BaseController(WSGIController): 
    1927 
Note: See TracChangeset for help on using the changeset viewer.