Changeset 3661 for TI05-delivery


Ignore:
Timestamp:
20/03/08 16:21:35 (11 years ago)
Author:
cbyrom
Message:

Various code tidy ups - including removal of print statements and
addition of extra header + documentation.

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

Legend:

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

    r3544 r3661  
    9696                    c.doc=DIF.DIF(x.tree,et=1,ndgObj=self.uri) 
    9797                    name=c.doc.name 
    98                     print c.doc.ndgObject 
    9998                elif viewFormat=='NumSim': 
    10099                    r='numsim' 
     
    130129            c.xml='%s'%x 
    131130            r='error' 
    132             print c.xml 
    133131             
    134132        response.status_code = code 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/visualise.py

    r3536 r3661  
    2323         
    2424        c.nothing2see=0 
    25         print c.selections 
    2625        if c.selections=={}: 
    2726            c.nothing2see=1 
     
    5150        # We also need to know which dataset (if any) we are looking at     
    5251        c.viewedDataset=session.get('viewedDataset',c.selections.keys()[0]) 
    53         print c.selected.keys() 
    5452        return 0 
    5553         
     
    7573        formValue=request.params.get('dataset',0) 
    7674        if formValue: dataset=formValue 
    77         print 'TabChange ',dataset,formValue 
    7875        #dataset is really a uri ...shame about the variable name we chose ... 
    7976         
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/base.py

    r3544 r3661  
     1# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 
     2# This software may be distributed under the terms of the 
     3# Q Public License, version 1.0 or later. 
     4# http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 
     5# 
     6""" 
     7 Base controller providing generic functionality and extended by most other controllers 
     8""" 
    19import urllib 
    210from urlparse import urlsplit, urlunsplit 
     
    8391        #organise the information needed by pagetabs ...  
    8492        # TODO avoid this for the server controllers ... 
    85          
    8693        c.pageTabs=[('Search',g.discoveryURL)] 
    8794        if 'results' in session:  
     
    93100         
    94101        if 'viewItems' in session: c.pageTabs.append(('View', h.url_for(controller='viewItems',action='index'))) 
    95  
    96 #            c.pageTabs.append(('Visualise',h.url_for(controller='visualise', action='index'))) 
    97 #            c.pageTabs.append(('Download','Blah')) 
    98102         
    99103        return WSGIController.__call__(self, environ, start_response) 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/wmc_util.py

    r3648 r3661  
    55""" 
    66Utils to aid use of wmc docs - including interfacing these with the con terra client 
     7and getting associated legend data 
    78 
    89@author: Calum Byrom 
     
    1819def getConTerraDoc(wmcURLs): 
    1920    """ 
    20     Uses an array of WMC URLs to construct an aggregation to allow the data 
    21     to be plotted in Con Terra 
     21    Construct an aggregated XML file and POST this data to the Con Terra mapClient to visualise 
     22    @param wmcURLS: An array of URLs pointing to WMC docs to visualise 
    2223    """ 
    2324    c.wmcDocs = [] 
    2425    for wmcURL in wmcURLs: 
    2526        c.wmcDocs.append(WMC(wmcURL))  
    26     session.save() 
    2727 
    2828        # need to send the aggregated data as POST data - so change the request method 
    2929    request.method = "POST" 
    30       
     30 
    3131    # now add the required data, using the aggregate template    
    32     request.POST.add('xmlConfig', render('conterra_aggregate', format='xml')) 
    33     print "BBBBaaa", request.POST 
    34     h.redirect_to('http://www.conterra.de/mapclient/businesstier/configuration/postinit')  
    35  
     32    logger.info('Creating XML Config doc for use with Con Terra mapClient') 
     33    request.POST.add('xmlConfig', "<?xml version='1.0' encoding='UTF-8'?><pos:IMCPostConfig SRS='EPSG:4326' xmlns:pos='http://www.conterra.de/mapclient/businesstier/configuration/postinit'><pos:Map ImageFormat='image/png'><pos:WMService url='http://ogc.bgs.ac.uk/cgi-bin/GBR_625k_BGS_Bedrock_and_Superficial_Geology/wms?'></pos:WMService><pos:InitialExtent MinX='-100' MinY='-50' MaxX='100' MaxY='50'></pos:InitialExtent></pos:Map><pos:OverviewMap ImageFormat='image/png'><pos:WMService url='http://www.geographynetwork.com/servlet/com.esri.wms.Esrimap'><pos:AddLayer visible='true'>Continents</pos:AddLayer></pos:WMService></pos:OverviewMap></pos:IMCPostConfig>")#render('conterra_aggregate', format='xml')) 
     34    logger.info('Posting request to mapClient for visualisation') 
     35    h.redirect_to('http://www.gis.bgs.ac.uk:8080/mapClient/postInit.do')#http://www.conterra.de/mapclient/businesstier/configuration/postinit')  
    3636     
    37     response.headers['Content-Type'] = 'text/xml' 
    38     response.headers['Content-Disposition'] = 'attachment;filename=wmcAggregate.xml' 
    39     return render('conterra_aggregate', format='xml') 
     37#    response.headers['Content-Type'] = 'text/xml' 
     38#    response.headers['Content-Disposition'] = 'attachment;filename=wmcAggregate.xml' 
     39#    return render('conterra_aggregate', format='xml') 
    4040 
    4141     
     
    6262    """ 
    6363    Lookup a legend for a WMS map 
     64    NB, all required parameters are already included in the endpoint by this stage 
    6465    """ 
    65     # retrieve context data from the specifiled url 
    6666    endpoint = self.inputs['ENDPOINT'] 
    6767    if not endpoint: 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/DIF.py

    r3501 r3661  
    103103                    name+=helper.getText(parameter,level)+'>' 
    104104            name=name.rstrip('>') 
    105             #print '[%s]\n%s'%(name,ET.tostring(parameter)) 
    106105            if name=='': 
    107106                name=helper.getText(parameter,'.')#.text 
Note: See TracChangeset for help on using the changeset viewer.