Ignore:
Timestamp:
29/06/07 16:17:01 (12 years ago)
Author:
lawrence
Message:

Interim commit of discovery/browse in ows stack.

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server
Files:
15 added
14 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/config/ndgDiscovery.config

    r2655 r2672  
    4848ndgImage:       %(layout)sndg_logo.gif 
    4949ndgAlt:         visit ndg 
     50stfcLink:       http://ceda.stfc.ac.uk/ 
     51stfcImage:      %(layout)sstfc-circle-sm.gif 
    5052key:            %(layout)skeySm.gif 
    5153keyGrey:        %(layout)skeyG.gif 
     
    5355Xicon:          %(layout)sX.gif 
    5456printer:        %(layout)sprinter.gif 
     57helpIcon:       %(layout)shelp_icon.gif 
     58HdrLeftAlt:     %(layout)sNatural Environment Researhc Council 
     59HdrLeftLogo:    %(layout)sNERC_Logo.gif 
    5560 
    56 pageLogo:       %(layout)sbrowse_header4.gif 
     61pageLogo:       %(layout)s20050502_albert-park_silhouetted-trees-and-clouds_02_cropped.jpg 
     62 
    5763ndgJavascript:  %(layout)sndgJavascript.js 
    5864 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/config/ndgMiddleware.py

    r2626 r2672  
    2121        self.globals.ndgImage=cf.get('layout','ndgImage',None) 
    2222        self.globals.ndgAlt=cf.get('layout','ndgAlt','Visit NDG') 
    23         self.globals.PageLogo=cf.get('layout','pageLogo',None) 
     23        self.globals.stfcLink=cf.get('layout','stfcLink') 
     24        self.globals.stfcImage=cf.get('layout','stfcImage') 
     25        self.globals.helpIcon=cf.get('layout','helpIcon') 
     26        self.globals.LeftAlt=cf.get('layout','HdrLeftAlt') 
     27        self.globals.LeftLogo=cf.get('layout','HdrLeftLogo') 
     28        self.globals.pageLogo="bodcHdr" 
     29         
     30        self.globals.discoveryURL=cf.get('SEARCH','discoveryURL') 
    2431         
    2532        self.globals.server=cf.get('DEFAULT','server','') 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/discovery.py

    r2655 r2672  
    166166                        c.xml+='Internal sending of mail failed with error [%s]</p>'%message 
    167167                    return render_response('content') 
    168                 c.xml='<div>%s%s</div>'%(self.oneLineSearch(),renderDiscoverySet(difs,state,self.cf)) 
     168                c.xml=renderDiscoverySet(difs,state,self.cf) 
    169169                print self.oneLineSearch() 
    170170                f=file('debug-dif.xml','w') 
     
    185185            discoveryURL=self.cf.get('SEARCH','discoveryURL') 
    186186            advancedURL=self.cf.get('SEARCH','advancedURL') 
    187             oneLiner=DiscoveryTemplate.oneLiner 
    188187        except: 
    189188            return 'Error, invalid configuration for search interface' 
    190189        bboxN,bboxW,bboxE,bboxS='+90.0','-180.0','+180.0','-90.0' 
    191         startDateDay,startDateMon,startDateYear='','','' 
    192         endDateDay,endDateMon,endDateYear='','','' 
    193         c.xml=DiscoveryTemplate.revisedAdvancedSearch%locals() 
    194         return render_response('content') 
     190        c.startDateDay,c.startDateMon,c.startDateYear='','','' 
     191        c.endDateDay,c.endDateMon,c.endDateYear='','','' 
     192        return render_response('advanced') 
    195193         
    196194    def __checkbox(self,bbox): 
     
    204202            if i not in self.inputs:  
    205203                self.message=message+i 
    206                 self.html='<p>%s</p>'%self.message 
     204        if self.message!='':self.message+='[%s]'%self.inputs 
    207205                 
    208206    def __checkdates(self,dateRange): 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/login.py

    r2639 r2672  
    88        #where are we going back to? 
    99        self.inputs=dict(parse_querystring(request.environ)) 
     10        print self.inputs 
    1011        if 'r' in self.inputs: 
    1112            c.returnTo=self.inputs['r'] 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/retrieve.py

    r2655 r2672  
    7272            elif self.uri.schema=='NDG-A0': 
    7373                r='csml' 
     74                name=self.uri.localID 
     75                if 'format' not in self.inputs: self.inputs['format']='xml' 
    7476            elif self.uri.schema=='DIF': 
    7577                r='dif' 
     
    103105            #we can update the history 
    104106            if 'history' not in session: 
    105                 session['history']=[(self.uri,name),] 
     107                session['history']=[(name,uri),] 
    106108            else: 
    107109                rb=Utilities.RingBuffer(10) 
    108110                for i in session['history']: rb.append(i) 
    109                 rb.append((uri,name)) 
     111                #delete it first, so we get to the top of the queue. 
     112                if (name,uri) in rb: rb.remove((name,uri)) 
     113                rb.append((name,uri)) 
    110114                session['history']=rb.tolist() 
    111115            session.save() 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/examples/badc.nerc.ac.uk__NumSim__HiGEM_6.1_CodeBase.xml

    r2654 r2672  
    44    <!-- Note that this is a handcoded example XML file which should not be regarded as 
    55        authoratative about the Higem control run, Charlotte Pascoe, May 2006 --> 
    6     <NS_CodeBase> 
     6    <NS_CodeBase version="0.9"> 
    77        <dgMetadataID> 
    88            <schemeIdentifier>NumSim</schemeIdentifier> 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/DocumentRetrieve.py

    r2640 r2672  
    2929        # MOLES documents and that we can retrieve from MOLES anything we like 
    3030        # in another format. 
    31         if schema == 'NDG-A0': 
    32             xquery=csmlQuery 
     31        if schema in ['NDG-A0','NumSim']: 
     32            xquery={'NDG-A0':csmlQuery,'NumSim':numsimQuery}[schema] 
     33            if schema=='NumSim': xquery=xquery.replace('RepositoryID',repository) 
    3334            xquery=xquery.replace('TargetCollection',targetCollection) 
    3435            xquery=xquery.replace('LocalID',localID) 
     
    3839                self.sessionRelease(id) 
    3940            else: 
    40                 raise ValueError('Unable to obtain csml document [%s] (hits=%s)'%(localID,summary['hits'])) 
     41                raise ValueError('Unable to obtain %s document [%s] (hits=%s)'%(schema,localID,summary['hits'])) 
    4142            return r 
    4243         
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndg_xqueries.py

    r2639 r2672  
    22# TI07-MOLES/trunk/JavaCode/returnmolesxmldb/ndg/services/returnmoles/Main.java 
    33# Update DIF/DC queries  
     4 
     5numsimQuery=''' declare default element namespace 'http://ndg.nerc.ac.uk/NumSim';  
     6for $DE in collection('TargetCollection')/NS_Simulated[*/dgMetadataID/schemeIdentifier='NumSim' and */dgMetadataID/repositoryIdentifier='RepositoryID' and */dgMetadataID/localIdentifier='LocalID'] return $DE 
     7''' 
    48 
    59csmlQuery='''declare default element namespace 'http://ndg.nerc.ac.uk/csml';  
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndg_xqueries.py~

    r2639 r2672  
    33# Update DIF/DC queries  
    44 
    5 csmlQuery='''declare default namespace 'http://ndg.nerc.ac.uk/csml';  
     5numsimQuery=''' declare default element namespace 'http://ndg.nerc.ac.uk/NumSim';  
     6for $DE in collection('TargetCollection')/NS_Simulated/NS_CodeBase[dgMetadataID/schemeIdentifier='NumSim' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID'] return <NS_Simulated>$DE</NS_Simulated> 
     7''' 
     8 
     9csmlQuery='''declare default element namespace 'http://ndg.nerc.ac.uk/csml';  
    610for $DE in collection('TargetCollection')/Dataset[@id='LocalID'] return $DE''' 
    711 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/xmlHandler2.py

    r2654 r2672  
    108108            lt,'?xml',span('version','xmlAttrTyp'),'1.0',span('encoding','xmlAttrTyp'),'utf-8',gt) 
    109109        ss=self.__fixXML(ss) 
    110         if self.realns=={}: return h+ss 
    111         return h+self.__nsfixpretty(ss,span) 
     110        if self.realns=={}:  
     111            r=h+ss 
     112        else: r= h+self.__nsfixpretty(ss,span) 
     113        return '<div class="xmlDoc">%s</div>'%r 
    112114           
    113115    def __nsfixpretty(self,s,span): 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/layout/ndg2.css

    r2654 r2672  
    11/* Following information on http://css.maxdesign.com.au/floatutorial/tutorial0816.htm */ 
     2/* Entire Page Contents */ 
    23 
    3 /* Entire Page Contents */ 
    4 #entirepage { width: 98%; margin:10px auto; font-size:medium; line-height:110%;} 
     4body, html { 
     5        margin: 0; 
     6        padding: 0; 
     7        border: 0; 
     8        background-color: #fff; 
     9        color:#333333; 
     10        font-family:Verdana, Arial, Helvetica, sans-serif; 
     11        line-height:1.4; 
     12        font-size:small; 
     13} 
     14 
     15body { 
     16min-width: 980px; 
     17} 
     18 
    519 
    620/* Top Banner Div */ 
    721 
    8 #Header {color: black; background-color: white; text-align: center; margin-bottom: 10px; padding-top: 3px; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; border-bottom: 2px solid wheat; font-size: medium; font-weight:bold;} 
     22#header { 
     23 height: 100px; 
     24 background: #fff; 
     25 padding: 0; 
     26 border: solid #333333; 
     27 border-width: 0 0 2px 0; 
     28 background-image:url(/layout/bodc_waves_reversed.png);background-position:right;background-repeat:repeat-x;} 
     29 
     30#logo{ 
     31 position:absolute; 
     32 top:15px; 
     33 left:20px; 
     34 width:200px; 
     35 height:63px; 
     36 z-index:900; 
     37} 
     38 
     39.searchBar { 
     40text-align:right; 
     41margin-top: 2px; margin-bottom: 2px; background-color:  #f0f0f0; 
     42font-weight:bold; 
     43} 
     44.searchBar #loginBar {text-align:right;} 
     45/* .searchOneLine {margin-top: 2px; margin-bottom: 2px; background-color: #f0f0f0; text-align:right; font-size:100%;} */ 
     46 
     47#Header {color: black; background-color: white; text-align: center; margin-bottom: 10px; padding-top: 3px; padding-right: 0px; padding-left: 0px; padding-bottom: 0px; font-size: medium; font-weight:bold; color:white} 
     48#Header table {padding:20px;} 
    949 
    1050/* Left Column if Necessary */ 
     
    2161/* Main Content */ 
    2262 
    23 #contents  {border-left: 1px solid wheat;} 
    24 #contentsRight  {border-left: 1px solid wheat; margin-left:250px;} 
     63#contents  {border-left: 1px solid #3c78b5;} 
     64#contentsRight  {border-left: 1px solid #3c78b5; margin-left:250px;} 
     65 
     66 
    2567 
    2668/* The following is the css associated with pretty printing xml */ 
    27 DIV.xmlElem {PADDING-LEFT: 20px;} 
     69.xmlDoc {font-size:80%} 
     70.xmlElem {PADDING-LEFT: 20px;} 
    2871.xmlAttrVal {COLOR:Red; } 
    2972.xmlAttrTyp {COLOR:Green; } 
     
    77120.Model {margin: 5px 5px 5px 20px; border: 1px solid #3c78b5; clear:both;} 
    78121 
     122/* Advanced Search Page */ 
     123 
     124.clear { clear: both; } 
     125.outer {border-left: 14px solid #FFFFFF; border-right: 500px solid #FFFFFF; } 
     126.inner {width: 100%; } 
     127.inner .hidden {display:none;background-color: #f4f4f4; border:1px solid black;} 
     128.float-wrap {float: left; width: 100%; margin-left: -14px; } 
     129#AdvContent {float: right; background-color: #fff;margin-right: -14px;  width: 100%;} 
     130* html #AdvContent {position: relative; } 
     131.contentWrap{padding: 5px;} 
     132.contentWrap ol, .contentWrap ul {margin: 3px 0 5px 35px;} 
     133.contentWrap li {padding-bottom: 2px;} 
     134#innerLeft {float: left;width: 1px;min-height: 250px;padding: 0;} 
     135* html #innerLeft {position: relative; height: 250px;} 
     136#innerRight {float: right; width: 490px;padding: 5px;min-height: 250px;margin-right: -500px; } 
     137* html #innerRight {height: 250px;position: relative;  } 
     138.searchHdr {font-weight:bold;color: #571F12;background-color: #fff;padding:15px 0px 10px 0px;vertical-align:text-top;} 
     139.SearchBox {padding:0 0 0 60px;} 
     140.SearchTxt {padding:0 20px 0 0;} 
     141.SearchStartDate {padding:0 0 0 60px;} 
     142.SearchEndDate {padding:0 0 0 60px;} 
     143.SearchSource {padding:0 0 0 60px;} 
     144.SearchSubmit {padding:30px 0 20px 60px;} 
     145.map {width:300px;height:250px;border:0;padding:0;margin:0;overflow:hidden;} 
     146.helptxt {font-size:smaller; } 
     147 
    79148/* And now the footer */ 
    80149 
    81 #Footer  { color: #999999; background-color: #f4f4f4; margin-bottom: 25px; padding-top: 3px; padding-right: 10px; padding-left: 10px; clear: both; border-top: 2px solid wheat; margin-top:10px; font-size:80%;} 
     150#Footer  { color: #999999; background-color: #f4f4f4; margin-bottom: 25px; padding-top: 3px; padding-right: 10px; padding-left: 10px; clear: both; border-top: 2px solid #3c78b5; margin-top:10px; font-size:80%;} 
    82151 
    83152/* Footer not yet checked */ 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/content.kid

    r2639 r2672  
    55    <div id="entirepage"> 
    66        <div py:replace="header()"/> 
     7        <div py:replace="searchOneLine()"/> 
    78        <!--! The if on the call to the left panel needs to be here for subtle css reasons --> 
    89        <div py:if="'ndgSec' in session" py:replace="leftpanel()" id="Left"/> 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ndgPage.kid

    r2655 r2672  
    99        function is needed to avoid escaping the < character --> 
    1010        ${XML(h.javascript_include_tag(builtins=True))} 
     11        <script type="text/javascript" src="/layout/toggleDiv.js"></script> 
    1112        <link media="all, screen" href="/layout/ndg2.css" type="text/css" rel="stylesheet"/> 
    1213    </head> 
    1314 
    14     <div py:def="header()" id="Header"> 
    15         <table cellpadding="0" cellspacing="0" width="100%%"><tbody> 
    16             <tr><td width="10%%" align="center" valign="middle"> 
    17               <a href="g.ndgLink"> <img src="$g.ndgImage" alt="$g.ndgAlt"/> </a> </td> 
    18             <td width="80%%" align="center" valign="middle" > 
    19               Natural Environment Research Council<br/> 
    20               Data Discovery Service</td> 
    21             <td width="10%%" align="center" valign="middle"> 
    22               <a href="$g.localLink"> <img src="$g.localImage" alt="$g.localAlt"/> </a> </td> 
    23             </tr> 
    24          </tbody></table> 
     15    <div py:def="header1(searchBox)"> 
     16        <div id="header"/> 
     17        <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
     18    </div> 
     19     
     20    <div py:def="header()"> 
     21        <div id="header"/> 
     22        <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
     23    </div> 
     24     
     25    <!-- One line search box for top of many pages follows --> 
     26     
     27    <div py:def="searchOneLine()" class="searchBar"> 
     28        <table width="100%"><tr><td align="left"> 
     29        <form action="$g.discoveryURL"> 
     30        New Search&nbsp;<input type="text" size="25" name="searchString"/> 
     31            <select name="textTarget"> 
     32            <option value="Authors">Authors</option> 
     33            <option value="All" selected="selected">All</option> 
     34            <option value="Params">Parameters</option>  
     35            </select> 
     36            <input type="submit" value="Search"/> 
     37            </form></td><td/><td align="right"><span py:if="'ndgSec' in session" id="loginBar"> 
     38            <span py:replace="logOut()"/></span> 
     39            <span py:if="'ndgSec' not in session" id="loginBar"> 
     40            <span py:replace="logIn()"/></span> 
     41          </td></tr></table> 
    2542    </div> 
    2643 
     
    86103        <center><table><tbody> 
    87104            <tr> 
    88                 <td align="center" width="50%%"> 
    89                     <p> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a>.  
    90                     Not all functionality is completely implemented, bugs and problems are expected </p> 
     105                <td align="center" width="60%"> 
     106                    <table><tbody> 
     107                    <tr><td><span py:replace="linkimage(g.ndgLink,g.ndgImage,'NDG')"/></td> 
     108                    <td> This portal is a product of the <a href="http://ndg.nerc.ac.uk"> NERC DataGrid</a> 
     109                    Not all functionality is completely implemented, bugs and problems are expected </td> 
     110                    </tr> 
     111                    </tbody></table> 
    91112                </td> 
    92                 <td width="50%%" align="center"> 
     113                <td width="40%" align="center"> 
    93114                    <div id="loginStatus"> 
    94115                        <!--! now we choose one of the next two (logged in or not) --> 
    95116                        <div py:if="'ndgSec' in session"><table><tbody><tr><td> User [${session['ndgSec']['u']}] logged in 
    96117                        at [${session['ndgSec']['h']}] with roles [${session['ndgSec']['r']}]</td><td> 
    97                         &nbsp;<a class="button" href="${g.logout}?r=$g.server${h.url_for()}">logout</a>&nbsp;</td></tr></tbody></table></div> 
     118                        &nbsp;<span py:replace="logOut()"/></td></tr></tbody></table></div> 
    98119                        <div py:if="'ndgSec' not in session">Further services maybe available if you can 
    99                         <a class="button" href="${g.wayfuri}?r=$g.server${h.url_for()}">login</a></div> 
     120                            <span py:replace="logIn()"/></div> 
    100121                    </div> 
    101122                </td> 
     123                <td><span py:replace="linkimage(g.stfcLink,g.stfcImage,'Hosted by the STFC CEDA')"/></td> 
    102124            </tr> 
    103125        </tbody></table></center> 
     
    111133    </span> 
    112134     
    113     
     135    <!-- Help Icons --> 
     136    <span py:def="helpIcon(value)"> 
     137        <span> 
     138            <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','div'); return false;"> 
     139            <img src="$g.helpIcon" alt="Toggle help" class="helpicon"/></a> 
     140       
     141        </span> 
     142    </span> 
     143     
     144    <!-- Login and out buttons --> 
     145     
     146    <span py:def="logOut()" class="logOut"> 
     147        <form action="$g.logout"> 
     148            <input type="hidden" name="r" value="$g.server${h.url_for()}"/> 
     149            <input type="submit" value="Logout"/> 
     150        </form> 
     151    </span> 
     152     
     153    <span py:def="logIn()" class="logIn"> 
     154        <form action="$g.wayfuri"> 
     155            <input type="hidden" name="r" value="$g.server${h.url_for()}"/> 
     156            <input type="submit" value="Login"/> 
     157        </form> 
     158    </span> 
     159     
     160     
    114161     
    115162</html> 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/stubB.kid

    r2655 r2672  
    66        ${XML(c.tbinfo)} 
    77        <div py:replace="header()"/> 
     8         
     9        <div py:replace="searchOneLine()"/> 
     10         
    811        <!--! The if on the call to the left panel needs to be here for subtle css reasons --> 
    912        <div py:if="'ndgSec' in session" py:replace="leftpanel()" id="Left"/> 
Note: See TracChangeset for help on using the changeset viewer.