Ignore:
Timestamp:
22/06/07 17:49:17 (12 years ago)
Author:
lawrence
Message:

Shopping cart, history and login framework for ows/discovery/browse.

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

Legend:

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

    r2629 r2639  
    5252    map.connect('trackback/:uri', controller='trackback') 
    5353    map.connect('discovery',controller='discovery') 
     54    map.connect('updatetab/:value',controller='tabs',action='update') 
    5455   
    5556    return map 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/login.py

    r2626 r2639  
    1919        # fudge for now 
    2020        session['ndgSec']={'h':'badc.nerc.ac.uk','u':'lawrence','r':['all']} 
     21        session['panelView']='History' 
    2122        session.save() 
    2223         
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/retrieve.py

    r2626 r2639  
    6060        c.xml=xml 
    6161        c.title='Viewing [%s]'%self.uri 
    62  
     62        f=file('debug.xml','w') 
     63        f.write(xml) 
     64        f.close() 
    6365        return render_response('content') 
    6466     
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/DocumentRetrieve.py

    r2618 r2639  
    2929        # MOLES documents and that we can retrieve from MOLES anything we like 
    3030        # in another format. 
    31         if schema == 'CSML': 
    32              
    33             # temporary expedient ...  should really use Kev's code ... 
    34             raise TypeError('DocumentRetrieve code does not yet know how to find specific CSML Documents') 
     31        if schema == 'NDG-A0': 
     32            xquery=csmlQuery 
     33            xquery=xquery.replace('TargetCollection',targetCollection) 
     34            xquery=xquery.replace('LocalID',localID) 
     35            id,summary=self.executeQuery(xquery) 
     36            if summary['hits']==1: 
     37                r=self.retrieve(id,0,{}) 
     38                self.sessionRelease(id) 
     39            else: 
     40                raise ValueError('Unable to obtain csml document [%s] (hits=%s)'%(localID,summary['hits'])) 
     41            return r 
    3542         
    3643        elif (schema[0:5] == 'NDG-B' or schema[0:3]=='DIF' or schema[0:4] == 'MDIP'): 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndgRetrieve.py

    r2626 r2639  
    77    ''' Given an ndgObject, uri, retrieve it, with security in place ''' 
    88     
    9     server=config.get('DEFAULT','server') 
    10     if uri.schema=='DIF': 
    11         r=server 
    12         ws=ndgSearch.ndgSearch() 
    13     elif uri.schema[0:5]=='NDG-B': 
     9     
     10    def getws(config,uri): 
     11        ''' Get a ws connection to the local exist database ''' 
    1412        # The logic here is that 
    1513        #    this code is running on server, which supports repositories sr 
     
    2523        pwf=config.get('DEFAULT','passwordFile') 
    2624        ws=DocumentRetrieve.DocumentRetrieve(er,pwfile=pwf) 
    27     elif uri.schema=='CSML': 
    28         return 0,'CSML recovery not yet implemented' 
     25        return 1,ws 
     26     
     27    server=config.get('DEFAULT','server') 
     28    if uri.schema=='DIF': 
     29        r=server 
     30        ws=ndgSearch.ndgSearch() 
     31    elif uri.schema[0:5]=='NDG-B': 
     32        status,ws=getws(config,uri) 
     33        if not status: return status,ws 
     34    elif uri.schema=='NDG-A0': 
     35        status,ws=getws(config,uri) 
     36        if not status: return status,ws 
    2937    try: 
    30         target='/db/ndg_B_metadata' 
     38        if uri.schema=='NDG-A0': 
     39            target='/db/ndg_A_metadata' 
     40        else: 
     41            target='/db/ndg_B_metadata' 
    3142        if format=='': format=uri.schema  
    3243        #do the actual search: 
     
    4556     
    4657    #temporary hack for empty docs from non-existent DIFs ...  
    47     if r=='': return 0,'No matching DIF [%s]'%uri.uri 
     58    #if r=='': return 0,'No matching DIF [%s]'%uri.uri 
    4859    #if we got this far, we should have valid xml 
    4960    x=xmlHandler.xmlHandler(r,string=1) 
     
    5162        pass # no access control 
    5263    elif uri.schema =='NDG-B0': 
     64        #cred=x.find('dgSecurityCondition/simpleCondition') 
     65        #if cred: 
     66        #    return 0,'<p> Access Control: <br/>[<![CDAT[%s]]> </p>' 
    5367        pass 
    5468    elif uri.schema =='NDG-B1': 
     
    6175     
    6276import unittest 
    63  
    6477 
    6578class TestCase(unittest.TestCase): 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndg_xqueries.py

    r2615 r2639  
    22# TI07-MOLES/trunk/JavaCode/returnmolesxmldb/ndg/services/returnmoles/Main.java 
    33# Update DIF/DC queries  
     4 
     5csmlQuery='''declare default element namespace 'http://ndg.nerc.ac.uk/csml';  
     6for $DE in collection('TargetCollection')/Dataset[@id='LocalID'] return $DE''' 
     7 
    48listingQuery=''' 
    59declare default element namespace 'http://ndg.nerc.ac.uk/moles';for $DE 
     
    1216ObjectTypeQuery = '''declare default element namespace 'http://ndg.nerc.ac.uk/moles';declare variable $targetCollection as xs:string {'TargetCollection'};for $Obj in collection($targetCollection)/dgMetadata/dgMetadataRecord[dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID']  return <objectType>{if (exists($Obj/dgDataEntity)) then 4 else (if (exists($Obj/dgObservationStation)) then 3 else (if (exists($Obj/dgDataProductionTool)) then 2 else (if (exists($Obj/dgActivity)) then 1 else (0))))}</objectType>''' 
    1317 
    14 StubBDEQuery = '''declare default element namespace 'http://ndg.nerc.ac.uk/moles/dataentity';  
     18StubBDEQuery = ''' 
     19declare default element namespace 'http://ndg.nerc.ac.uk/moles/dataentity';  
    1520declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; 
    1621declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
     
    2530declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    2631declare variable $localIdentifier as xs:string {'LocalID'}; 
     32(: replacable parameters 
     33declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     34declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     35declare variable $localIdentifier as xs:string {'dataent_chablis'}; 
     36:) 
    2737 
    2838declare function f:return-stub-activity($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element()  
     
    3646element  {$out-element-name} {  
    3747($SRAct/moles:dgMetadataID), 
     48($SRAct/moles:dgMetadataDescription), 
    3849($SRAct/moles:name), 
    3950($SRAct/moles:abbreviation), 
    40 ($SRAct/moles:logos), 
    41 element dgActivity { 
    42 } (: </dgActivity> :)  
     51($SRAct/moles:logos) 
    4352} (: </activity> :)  
    4453} ; 
     
    5261element {$out-element-name} { 
    5362($SRDE/moles:dgMetadataID), 
     63($SRDE/moles:dgMetadataDescription), 
    5464($SRDE/moles:name), 
    55 ($SRDE/moles:abbreviation), 
    56 element dgDataEntity { 
     65($SRDE/moles:abbreviation) 
    5766} (: </dgDataEntity> :)         
    58 } 
    5967} ; 
    6068 
     
    7179element {$out-element-name} { 
    7280$SRDPT/moles:dgMetadataID, 
     81$SRDPT/moles:dgMetadataDescription, 
    7382$SRDPT/moles:name, 
    7483$SRDPT/moles:abbreviation, 
    75 $SRDPT/moles:logos, 
    76 element dgDataProductionTool { 
    77 } (: </dgDataProductionTool> :) 
     84$SRDPT/moles:logos 
    7885} (: </dataproductiontool> :) 
    7986} ; 
     
    9198element {$out-element-name} { 
    9299($SRObsStn/moles:dgMetadataID), 
     100($SRObsStn/moles:dgMetadataDescription), 
    93101($SRObsStn/moles:name), 
    94102($SRObsStn/moles:abbreviation), 
    95 ($SRObsStn/moles:logos), 
    96 element dgObservationStation { 
    97 } (: </dgObservationStation> :) 
     103($SRObsStn/moles:logos) 
    98104} 
    99105} ; 
     
    222228            else () 
    223229        } , (: </dgDataRoles> :) 
    224         for $RelDep in $DE/moles:dgDataEntity/moles:RelatedDeployment 
    225             return 
    226             element RelatedDeployment { 
    227             $RelDep/moles:DateStart, 
    228             $RelDep/moles:DateEnd, 
    229             $RelDep/moles:dgMetadataID, 
    230             f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    231             f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)), 
    232             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    233             $RelDep/moles:Coverage 
    234         } (: </RelatedDeployment> :)  
    235         , 
     230element DeploymentSummary { 
     231element activityList { 
     232for $DepActRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     233for $DepActLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:localIdentifier) 
     234let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     235return $DepAct  
     236}, 
     237element dptList { 
     238for $DepDPTRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     239for $DepDPTLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     240let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     241return $DepDPT  
     242}, 
     243element obsStnList { 
     244for $DepObsStnRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     245for $DepObsStnLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     246let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     247return $DepObsStn  
     248} 
     249} (: </DeploymentSummary> :) , 
    236250        for $RelatedDataEntity in $DE/moles:dgDataEntity/moles:dgRelatedDataEntity 
    237251            return 
     
    265279import module namespace stubblib='http://ndg.nerc.ac.uk/xquery/lib/stubb' at 'xmldb:exist:///db/xqueryLib/StubB/stubb_xquery_lib.xquery'; 
    266280:) 
     281(: replacable parameters 
     282declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     283declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     284declare variable $localIdentifier as xs:string {'activity_11680365144712080'}; 
     285:) 
    267286declare variable $targetCollection as xs:string {'TargetCollection'}; 
    268287declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    282301($SRAct/moles:name), 
    283302($SRAct/moles:abbreviation), 
    284 ($SRAct/moles:logos), 
    285 element dgActivity { 
    286 } (: </dgActivity> :)  
     303($SRAct/moles:logos) 
    287304} (: </activity> :)  
    288305} ; 
     
    298315($SRDE/moles:dgMetadataDescription), 
    299316($SRDE/moles:name), 
    300 ($SRDE/moles:abbreviation), 
    301 element dgDataEntity { 
     317($SRDE/moles:abbreviation) 
    302318} (: </dgDataEntity> :)         
    303 } 
    304319} ; 
    305320 
     
    319334$SRDPT/moles:name, 
    320335$SRDPT/moles:abbreviation, 
    321 $SRDPT/moles:logos, 
    322 element dgDataProductionTool { 
    323 } (: </dgDataProductionTool> :) 
     336$SRDPT/moles:logos 
    324337} (: </dataproductiontool> :) 
    325338} ; 
     
    340353($SRObsStn/moles:name), 
    341354($SRObsStn/moles:abbreviation), 
    342 ($SRObsStn/moles:logos), 
    343 element dgObservationStation { 
    344 } (: </dgObservationStation> :) 
     355($SRObsStn/moles:logos) 
    345356} 
    346357} ; 
     
    515526        else () 
    516527    }, (: </dgActivityRole> :) 
    517     for $RelDep in $Act/moles:dgActivity/moles:ActivityDeployment 
    518         return 
    519         element ActivityDeployment { 
    520             ($RelDep/moles:DateStart), 
    521             if (exists($RelDep/moles:DateEnd)) then  
    522                 ($RelDep/moles:DateEnd) 
    523             else (), 
    524             ($RelDep/moles:dgMetadataID), 
    525             f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)), 
    526             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    527                 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    528 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    529 return 
    530 f:return-stub-dataentity('dataentity', $DE) 
    531         }, (: </ActivityDeployment> :) 
     528element DeploymentSummary { 
     529element dptList { 
     530for $DepDPTRepository in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     531for $DepDPTLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     532let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     533return $DepDPT  
     534}, 
     535element obsStnList { 
     536for $DepObsStnRepository in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     537for $DepObsStnLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     538let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     539return $DepObsStn  
     540}, 
     541element dataEntityList { 
     542for $DE in  
     543collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     544/moles:DataProductionToolID 
     545[moles:localIdentifier=$Act/moles:dgMetadataID/moles:localIdentifier 
     546and moles:repositoryIdentifier=$Act/moles:dgMetadataID/moles:repositoryIdentifier]] 
     547order by $DE/moles:dgMetadataID 
     548return f:return-stub-dataentity('dataentity', $DE) 
     549} 
     550}, (: </DeploymentSummary> :) 
    532551        if (exists($Act/dgActivityCoverage)) then 
    533552            ($Act/dgActivityCoverage) 
     
    555574declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    556575 
     576(: replacable parameters 
     577declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     578declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     579declare variable $localIdentifier as xs:string {'dpt_116291244849226'}; 
     580:) 
    557581declare variable $targetCollection as xs:string {'TargetCollection'}; 
    558582declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    569593element  {$out-element-name} {  
    570594($SRAct/moles:dgMetadataID), 
     595($SRAct/moles:dgMetadataDescription), 
    571596($SRAct/moles:name), 
    572597($SRAct/moles:abbreviation), 
    573 ($SRAct/moles:logos), 
    574 element dgActivity { 
    575 } (: </dgActivity> :)  
     598($SRAct/moles:logos) 
    576599} (: </activity> :)  
    577600} ; 
     
    585608element {$out-element-name} { 
    586609($SRDE/moles:dgMetadataID), 
     610($SRDE/moles:dgMetadataDescription), 
    587611($SRDE/moles:name), 
    588 ($SRDE/moles:abbreviation), 
    589 element dgDataEntity { 
     612($SRDE/moles:abbreviation) 
    590613} (: </dgDataEntity> :)         
    591 } 
    592614} ; 
    593615 
     
    604626element {$out-element-name} { 
    605627$SRDPT/moles:dgMetadataID, 
     628$SRDPT/moles:dgMetadataDescription, 
    606629$SRDPT/moles:name, 
    607630$SRDPT/moles:abbreviation, 
    608 $SRDPT/moles:logos, 
    609 element dgDataProductionTool { 
    610 } (: </dgDataProductionTool> :) 
     631$SRDPT/moles:logos 
    611632} (: </dataproductiontool> :) 
    612633} ; 
     
    624645element {$out-element-name} { 
    625646($SRObsStn/moles:dgMetadataID), 
     647($SRObsStn/moles:dgMetadataDescription), 
    626648($SRObsStn/moles:name), 
    627649($SRObsStn/moles:abbreviation), 
    628 ($SRObsStn/moles:logos), 
    629 element dgObservationStation { 
    630 } (: </dgObservationStation> :) 
     650($SRObsStn/moles:logos) 
    631651} 
    632652} ; 
     
    694714        element dgDPTRoles {'Roles are available, and will be added soon'}  
    695715     else(), 
    696     for $RelDep in $DPT/moles:dgDataProductionTool/moles:DPTDeployment  
    697     return  
    698         element DPTDeployment {  
    699             $RelDep/moles:DateStart, 
    700             $RelDep/moles:DateEnd, 
    701             $RelDep/moles:dgMetadataID, 
    702             f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    703             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    704                 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    705 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    706 return 
    707 f:return-stub-dataentity('dataentity', $DE), 
    708             $RelDep/moles:Coverage 
    709         } (: </DPTDeployment> :)  
    710     } (: </dgDataProductionTool> :),  
     716element DeploymentSummary { 
     717element activityList { 
     718for $DepActRepository in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     719for $DepActLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ActivityID/moles:localIdentifier) 
     720let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     721return $DepAct  
     722}, 
     723element obsStnList { 
     724for $DepObsStnRepository in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     725for $DepObsStnLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     726let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     727return $DepObsStn  
     728}, 
     729element dataEntityList { 
     730for $DE in  
     731collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     732/moles:DataProductionToolID 
     733[moles:localIdentifier=$DPT/moles:dgMetadataID/moles:localIdentifier 
     734and moles:repositoryIdentifier=$DPT/moles:dgMetadataID/moles:repositoryIdentifier]] 
     735order by $DE/moles:dgMetadataID 
     736return f:return-stub-dataentity('dataentity', $DE) 
     737} 
     738} (: </DeploymentSummary> :) 
     739} (: </dgDataProductionTool> :),  
    711740    for $strkwrd in $DPT/moles:dgStructuredKeyword return $strkwrd, 
    712741    if (exists($DPT/moles:dgMetadataProvenance)) then $DPT/moles:dgMetadataProvenance else (), 
     
    727756declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    728757 
     758(: replacable parameters 
     759declare variable $targetCollection as xs:string {'/db/ndg_B_metadata_4'}; 
     760declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     761declare variable $localIdentifier as xs:string {'obs_1162914661529326'}; 
     762:) 
    729763declare variable $targetCollection as xs:string {'TargetCollection'}; 
    730764declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    731765declare variable $localIdentifier as xs:string {'LocalID'}; 
    732  
    733766declare function f:return-stub-activity($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element()  
    734767(: Returns a 'stubB' style activity record to expand an activity record :) 
     
    741774element  {$out-element-name} {  
    742775($SRAct/moles:dgMetadataID), 
     776($SRAct/moles:dgMetadataDescription), 
    743777($SRAct/moles:name), 
    744778($SRAct/moles:abbreviation), 
    745 ($SRAct/moles:logos), 
    746 element dgActivity { 
    747 } (: </dgActivity> :)  
     779($SRAct/moles:logos) 
    748780} (: </activity> :)  
    749781} ; 
     
    757789element {$out-element-name} { 
    758790($SRDE/moles:dgMetadataID), 
     791($SRDE/moles:dgMetadataDescription), 
    759792($SRDE/moles:name), 
    760 ($SRDE/moles:abbreviation), 
    761 element dgDataEntity { 
     793($SRDE/moles:abbreviation) 
    762794} (: </dgDataEntity> :)         
    763 } 
    764795} ; 
    765796 
     
    776807element {$out-element-name} { 
    777808$SRDPT/moles:dgMetadataID, 
     809$SRDPT/moles:dgMetadataDescription, 
    778810$SRDPT/moles:name, 
    779811$SRDPT/moles:abbreviation, 
    780 $SRDPT/moles:logos, 
    781 element dgDataProductionTool { 
    782 } (: </dgDataProductionTool> :) 
     812$SRDPT/moles:logos 
    783813} (: </dataproductiontool> :) 
    784814} ; 
     
    796826element {$out-element-name} { 
    797827($SRObsStn/moles:dgMetadataID), 
     828($SRObsStn/moles:dgMetadataDescription), 
    798829($SRObsStn/moles:name), 
    799830($SRObsStn/moles:abbreviation), 
    800 ($SRObsStn/moles:logos), 
    801 element dgObservationStation { 
    802 } (: </dgObservationStation> :) 
     831($SRObsStn/moles:logos) 
    803832} 
    804833} ; 
     
    844873moles:dgObservationStation!=''  
    845874and moles:dgMetadataID[ 
    846 moles:schemeIdentifier='NDG-B0'  
    847 and moles:repositoryIdentifier=$repositoryIdentifier 
     875moles:repositoryIdentifier=$repositoryIdentifier 
    848876and moles:localIdentifier=$localIdentifier]] 
    849877return 
     
    888916} (: End </dgStationaryPlatform>  :)   
    889917else $ObsStn/moles:dgObservationStation/moles:dgMovingPlatform ,  
    890 for $RelDep in $ObsStn/moles:dgObservationStation/moles:ObsStationDeployment  
    891 return  
    892 element ObsStationDeployment { 
    893 $RelDep/moles:DateStart, 
    894 $RelDep/moles:DateEnd, 
    895 $RelDep/moles:dgMetadataID, 
    896 f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    897 f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)),  
    898 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    899 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    900 return 
    901 f:return-stub-dataentity('dataentity', $DE), 
    902 $RelDep/moles:Coverage 
    903 } (: </RelatedDeployment> :)  
     918element DeploymentSummary { 
     919element activityList { 
     920for $DepActRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     921for $DepActLocal in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:ActivityID/moles:localIdentifier) 
     922let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     923return $DepAct  
     924}, 
     925element dptList { 
     926for $DepDPTRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     927for $DepDPTLocal in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     928let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     929return $DepDPT  
     930}, 
     931element dataEntityList { 
     932for $DE in  
     933collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     934/moles:ObservationStationID 
     935[moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
     936and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
     937order by $DE/moles:dgMetadataID 
     938return f:return-stub-dataentity('dataentity', $DE) 
     939} 
     940} (: </DeploymentSummary> :)  
    904941} (: </dgObservationStation> :),  
    905942for $strkwrd in $ObsStn/moles:dgStructuredKeyword return $strkwrd, 
     
    921958declare namespace xlink='http://www.w3.org/1999/xlink';  
    922959declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
     960declare option exist:timeout '24500';  
    923961 
    924962declare variable $targetCollection as xs:string {'TargetCollection'}; 
     
    11241162    return $Moles ''' 
    11251163             
    1126 DIFQuery = '''import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     1164DIFQuery = ''' 
     1165import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
    11271166import module namespace utillib='http://ndg.nerc.ac.uk/xquery/lib/utilities' at 'xmldb:exist:///db/xqueryLib/Utilities/utility_xquery_lib.xquery'; 
     1167(: Keep 
    11281168declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; 
    11291169declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    11301170declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    1131  
     1171:) 
    11321172declare variable $targetCollection as xs:string {'TargetCollection'}; 
    11331173declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    11341174declare variable $localIdentifier as xs:string {'LocalID'}; 
    1135  
    1136 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ 
     1175declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     1176declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     1177declare variable $localIdentifier as xs:string {'dataent_chablis'}; 
     1178 
     1179let $DE := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ 
    11371180    exists('moles:dgDataEntity')  
    1138     and moles:dgMetadataID/moles:schemeIdentifier='NDG-B0'  
    11391181    and moles:dgMetadataID/moles:repositoryIdentifier=$repositoryIdentifier 
    11401182    and moles:dgMetadataID/moles:localIdentifier=$localIdentifier] 
     
    11471189            for $DataCreatorRole in $DE/moles:dgDataEntity/moles:dgDataRoles/moles:dgDataCreator/moles:dgRoleHolder[not(exists(moles:endDate)) or moles:endDate=''][1] 
    11481190        return  
    1149             for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/*[(moles:dgMetadataID/moles:schemeIdentifier='NDG-B0' 
    1150                    and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/*/moles:repositoryIdentifier 
    1151                    and moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/*/moles:localIdentifier)] 
     1191            for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/(dgOrganisation | dgPerson)[( 
     1192                   moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:repositoryIdentifier 
     1193                   and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:localIdentifier)] 
    11521194            return  
    11531195                    element Dataset_Creator { 
     
    11641206            element Parameters { 
    11651207            element Category {string($StructuredKeyword/*/moles:dgValidTerm)}, 
    1166             if (exists($StructuredKeyword//moles:dgValidSubterm)  
    1167                 and $StructuredKeyword//moles:dgValidSubterm != ''  
    1168                 and $StructuredKeyword//moles:dgValidSubterm != ' ') then  
     1208            if (exists($StructuredKeyword/*/moles:dgValidSubterm)  
     1209                and $StructuredKeyword/*/moles:dgValidSubterm != ''  
     1210                and $StructuredKeyword/*/moles:dgValidSubterm != ' ') then  
    11691211            for $Subterm in $StructuredKeyword//moles:dgValidSubterm[exists(moles:dgValidTerm)] 
    11701212                where exists($Subterm/moles:dgValidSubterm) 
     
    11751217                    else if ($Subterm/moles:ListLevel=3) then element Variable {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)}  
    11761218                    else if ($Subterm/moles:ListLevel=4) then element Detailed_Variable {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)}  
    1177                     else element GCMD_Science_Valid {$Subterm/moles:ListLevel,($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} 
     1219                    else element GCMD_Science_Valid {data($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} 
    11781220            else() 
    11791221                } 
    11801222        else(), 
    1181     for $StructuredKeyword in ($DE//(moles:dgStructuredKeyword | moles:dgDataEntity/moles:dgDataSummary/moles:dgParameterSummary/moles:dgStdParameterMeasured)[voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_correct, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_deprecated, moles:dgValidTermID/moles:ParentListID) and (not(exists(moles:ListLevel)) or moles:ListLevel=0)]) 
     1223    for $StructuredKeyword in ($DE/(moles:dgStructuredKeyword | moles:dgDataEntity/moles:dgDataSummary/moles:dgParameterSummary/moles:dgStdParameterMeasured)[voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_correct, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_deprecated, moles:dgValidTermID/moles:ParentListID) and (not(exists(moles:ListLevel)) or moles:ListLevel=0)]) 
    11821224    return 
    11831225        element Parameters {data($StructuredKeyword/moles:dgValidTerm)}, 
     
    11851227        return  
    11861228            element ISO_Topic_Category {string($ISOTopicCategory/moles:dgValidTerm)}, 
    1187     for $Keyword in distinct-values($DE//moles:dgStructuredKeyword[ 
     1229    for $Keyword in distinct-values($DE/moles:dgStructuredKeyword[ 
    11881230    not (voclib:spot-vocab($voclib:iso_topic_list, moles:dgValidTermID/moles:ParentListID) 
    11891231    or voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID) 
    11901232    or voclib:spot-vocab($voclib:gcmd_science_valids_correct, moles:dgValidTermID/moles:ParentListID) 
     1233    or voclib:spot-vocab($voclib:iso_topic_list, moles:dgValidTermID/moles:ParentListID) 
    11911234    )]/moles:dgValidTerm) 
    11921235    return element Keyword {string($Keyword)},  
    1193     for $DepDPT in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID 
    1194     return  
    1195         element Sensor_Name { 
    1196             for $DepDPTAbbrev in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPT/moles:repositoryIdentifier and moles:localIdentifier=$DepDPT/moles:localIdentifier]]/moles:abbreviation)) 
    1197                 return element Short_Name {data($DepDPTAbbrev)}, 
    1198             for $DepDPTName in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPT/moles:repositoryIdentifier and moles:localIdentifier=$DepDPT/moles:localIdentifier]]/moles:name)) 
    1199                 return element Long_Name {data($DepDPTName)} 
     1236    for $DepDPTRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:repositoryIdentifier 
     1237    for $DepDPTLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID[moles:repositoryIdentifier=$DepDPTRepository]/moles:localIdentifier)  
     1238    let $DepDPTRecord := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPTRepository  and moles:localIdentifier=$DepDPTLocal]] 
     1239                return 
     1240                        element Sensor_Name { 
     1241                element Short_Name {data($DepDPTRecord/moles:abbreviation)}, 
     1242                element Long_Name {data($DepDPTRecord/moles:name)} 
    12001243            }, 
    1201     for $DepObsStn in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID) 
    1202     return  
    1203         element Source_Name { 
    1204             for $DepObsStnAbbrev in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepObsStn/moles:repositoryIdentifier and moles:localIdentifier=$DepObsStn/moles:localIdentifier]]/moles:abbreviation)) 
    1205                 return element Short_Name {data($DepObsStnAbbrev)}, 
    1206             for $DepObsStnName in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepObsStn/moles:repositoryIdentifier and moles:localIdentifier=$DepObsStn/moles:localIdentifier]]/moles:name)) 
    1207                 return element Long_Name {data($DepObsStnName)} 
     1244    for $DepObsStnRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     1245    for $DepObsStnLocal in distinct-values(($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID[moles:repositoryIdentifier=$DepObsStnRepository]/moles:localIdentifier)) 
     1246    let $DepObsStnRecord := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:repositoryIdentifier=$DepObsStnRepository  and moles:localIdentifier=$DepObsStnLocal]] 
     1247                return element Source_Name { 
     1248                element Short_Name {data($DepObsStnRecord/moles:abbreviation)}, 
     1249                element Long_Name {data($DepObsStnRecord/moles:name)} 
    12081250            }, 
    1209     for $TemporalRange in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:DateRange) 
     1251    for $TemporalRange in $DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgTemporalCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgTemporalCoverage)/moles:DateRange 
    12101252        return  
    12111253            element Temporal_Coverage 
     
    12141256                element End_Date {data($TemporalRange/moles:DateRangeEnd)} 
    12151257                }, 
    1216     for $TemporalTerm in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:dgArea[voclib:spot-vocab($voclib:gcmd_chronostratigraphic_valids, moles:dgValidTermID/moles:ParentListID)]/moles:dgValidTerm) 
     1258    for $TemporalTerm in $DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgTemporalCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgTemporalCoverage)/moles:dgChronostratigraphicTerm[voclib:spot-vocab($voclib:gcmd_chronostratigraphic_valids, moles:dgValidTermID/moles:ParentListID)]/moles:dgValidTerm 
    12171259        return element Paleo_Temporal_Coverage {element Chronostratigraphic_Unit {data($TemporalTerm)}},  
    12181260    for $Data_Set_Progress in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataStatus/moles:dgDatasetClosure) 
    12191261        return element Data_Set_Progress {data($Data_Set_Progress)}, 
    1220     for $BoundingBox in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:BoundingBox) 
     1262    for $BoundingBox in $DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgSpatialCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgSpatialCoverage)/moles:BoundingBox 
    12211263    return  
    12221264        element Spatial_Coverage { 
     
    12261268                element Easternmost_Longitude {data($BoundingBox/moles:LimitEast)} 
    12271269            }, 
    1228     for $Location in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:dgArea[voclib:spot-vocab($voclib:gcmd_location_valids, moles:dgValidTermID/moles:ParentListID)]) 
     1270    for $Location in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgSpatialCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgSpatialCoverage)/moles:dgArea[voclib:spot-vocab($voclib:gcmd_location_valids, moles:dgValidTermID/moles:ParentListID)]) 
    12291271        return element Location {data($Location/moles:dgValidTerm)},  
    1230     for $DepAct in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID) 
     1272    for $DepActRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:repositoryIdentifer) 
     1273    for $DepActLocal in  distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID[moles:repositoryIdentifer=$DepActRepository]/moles:localIdentifer)   
     1274    let $DepActRecord := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:repositoryIdentifier=$DepActRepository and moles:localIdentifier=$DepActLocal]] 
    12311275    return  
    12321276        element Project { 
    1233             for $DepActAbbrev in (collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepAct/moles:repositoryIdentifier and moles:localIdentifier=$DepAct/moles:localIdentifier]]/moles:abbreviation) 
    1234                 return  
    1235                     element Short_Name {data($DepActAbbrev)}, 
    1236             for $DepActName in (collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepAct/moles:repositoryIdentifier and moles:localIdentifier=$DepAct/moles:localIdentifier]]/moles:name) 
    1237                 return  
    1238                     element Long_Name {data($DepActName)} 
     1277                    element Short_Name {data($DepActRecord/abbreviation)}, 
     1278                    element Long_Name {data($DepActRecord/name)} 
    12391279            }, 
    12401280    if (exists($DE/moles:dgDataEntity/moles:dgDataGranule/moles:accessControlPolicy)) then  
     
    14301470            element Future_DIF_Review_Date {data($DE/moles:dgMetadataProvenance/moles:RecordReview/moles:ReviewDate)} 
    14311471    else () 
    1432         }''' 
     1472        } 
     1473''' 
    14331474         
    1434 DublinCoreDEQuery='''import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     1475DublinCoreDEQuery=''' 
     1476import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
    14351477import module namespace utillib='http://ndg.nerc.ac.uk/xquery/lib/utilities' at 'xmldb:exist:///db/xqueryLib/Utilities/utility_xquery_lib.xquery'; 
    14361478declare default element namespace 'http://ndg.nerc.ac.uk/moles'; 
    14371479declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    14381480declare namespace dc='http://purl.org/dc/elements/1.1/'; 
    1439 declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc'; 
     1481declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc/'; 
     1482(: 
     1483declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     1484declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     1485declare variable $localIdentifier as xs:string {'dataent_chablis'}; 
     1486:) 
     1487 
    14401488declare variable $targetCollection as xs:string {'TargetCollection'}; 
    14411489declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    14441492for $DE in collection($targetCollection)/dgMetadata/dgMetadataRecord[ 
    14451493exists('dgDataEntity')  
    1446 and dgMetadataID/schemeIdentifier='NDG-B0'  
    14471494and dgMetadataID/repositoryIdentifier=$repositoryIdentifier 
    14481495and dgMetadataID/localIdentifier=$localIdentifier] 
     
    14531500    element dc:type {'Dataset'}, 
    14541501    element dc:identifier {concat($DE/dgMetadataID/repositoryIdentifier, $utillib:moles_id_separator, 'DC', $utillib:moles_id_separator, $DE/dgMetadataID/localIdentifier)}, 
     1502    for $identifiers in $DE/(dgMetadataDescription/descriptionSection/descriptionOnlineReference | abstract/abstractOnlineReference)[ 
     1503        exists(dgReferenceClass/dgValidTermID/ParentListID) 
     1504        and 
     1505        voclib:spot-vocab($voclib:ndg_online_reference_classes_vocab, dgReferenceClass/dgValidTermID/ParentListID)  
     1506        and 
     1507        dgReferenceClass/dgValidTerm='DataPage'] 
     1508    return element dc:identifier {data($identifiers/dgSimpleLink/URI)}, 
    14551509    element dc:description {string($DE/dgMetadataDescription/abstract/abstractText)}, 
    14561510    element dc:date 
     
    14581512        if (exists($DE/(dgMetadataProvenance | DataProvenance)/RecordUpdate/UpdateDate)) then 
    14591513            for $updatedate in ($DE/(dgMetadataProvenance | DataProvenance)/RecordUpdate/UpdateDate) 
    1460                 order by xs:dateTime($updatedate) 
     1514                order by xs:date($updatedate) 
    14611515            return data($updatedate[1]) 
    14621516        else 
     
    15131567                    (string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName)))) 
    15141568                else ('empty content') 
    1515             } 
    1516 }  (: </oai_dc:dc> :)''' 
     1569} 
     1570}  (: </oai_dc:dc> :) 
     1571''' 
    15171572 
    15181573MDIPQuery='''import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     
    16071662    } 
    16081663''' 
    1609  
    1610  
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndg_xqueries.py~

    r2615 r2639  
    22# TI07-MOLES/trunk/JavaCode/returnmolesxmldb/ndg/services/returnmoles/Main.java 
    33# Update DIF/DC queries  
     4 
     5csmlQuery='''declare default namespace 'http://ndg.nerc.ac.uk/csml';  
     6for $DE in collection('TargetCollection')/Dataset[@id='LocalID'] return $DE''' 
     7 
    48listingQuery=''' 
    59declare default element namespace 'http://ndg.nerc.ac.uk/moles';for $DE 
     
    1216ObjectTypeQuery = '''declare default element namespace 'http://ndg.nerc.ac.uk/moles';declare variable $targetCollection as xs:string {'TargetCollection'};for $Obj in collection($targetCollection)/dgMetadata/dgMetadataRecord[dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID']  return <objectType>{if (exists($Obj/dgDataEntity)) then 4 else (if (exists($Obj/dgObservationStation)) then 3 else (if (exists($Obj/dgDataProductionTool)) then 2 else (if (exists($Obj/dgActivity)) then 1 else (0))))}</objectType>''' 
    1317 
    14 StubBDEQuery = '''declare default element namespace 'http://ndg.nerc.ac.uk/moles/dataentity';  
     18StubBDEQuery = ''' 
     19declare default element namespace 'http://ndg.nerc.ac.uk/moles/dataentity';  
    1520declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; 
    1621declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
     
    2530declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    2631declare variable $localIdentifier as xs:string {'LocalID'}; 
     32(: replacable parameters 
     33declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     34declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     35declare variable $localIdentifier as xs:string {'dataent_chablis'}; 
     36:) 
    2737 
    2838declare function f:return-stub-activity($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element()  
     
    3646element  {$out-element-name} {  
    3747($SRAct/moles:dgMetadataID), 
     48($SRAct/moles:dgMetadataDescription), 
    3849($SRAct/moles:name), 
    3950($SRAct/moles:abbreviation), 
    40 ($SRAct/moles:logos), 
    41 element dgActivity { 
    42 } (: </dgActivity> :)  
     51($SRAct/moles:logos) 
    4352} (: </activity> :)  
    4453} ; 
     
    5261element {$out-element-name} { 
    5362($SRDE/moles:dgMetadataID), 
     63($SRDE/moles:dgMetadataDescription), 
    5464($SRDE/moles:name), 
    55 ($SRDE/moles:abbreviation), 
    56 element dgDataEntity { 
     65($SRDE/moles:abbreviation) 
    5766} (: </dgDataEntity> :)         
    58 } 
    5967} ; 
    6068 
     
    7179element {$out-element-name} { 
    7280$SRDPT/moles:dgMetadataID, 
     81$SRDPT/moles:dgMetadataDescription, 
    7382$SRDPT/moles:name, 
    7483$SRDPT/moles:abbreviation, 
    75 $SRDPT/moles:logos, 
    76 element dgDataProductionTool { 
    77 } (: </dgDataProductionTool> :) 
     84$SRDPT/moles:logos 
    7885} (: </dataproductiontool> :) 
    7986} ; 
     
    9198element {$out-element-name} { 
    9299($SRObsStn/moles:dgMetadataID), 
     100($SRObsStn/moles:dgMetadataDescription), 
    93101($SRObsStn/moles:name), 
    94102($SRObsStn/moles:abbreviation), 
    95 ($SRObsStn/moles:logos), 
    96 element dgObservationStation { 
    97 } (: </dgObservationStation> :) 
     103($SRObsStn/moles:logos) 
    98104} 
    99105} ; 
     
    222228            else () 
    223229        } , (: </dgDataRoles> :) 
    224         for $RelDep in $DE/moles:dgDataEntity/moles:RelatedDeployment 
    225             return 
    226             element RelatedDeployment { 
    227             $RelDep/moles:DateStart, 
    228             $RelDep/moles:DateEnd, 
    229             $RelDep/moles:dgMetadataID, 
    230             f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    231             f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)), 
    232             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    233             $RelDep/moles:Coverage 
    234         } (: </RelatedDeployment> :)  
    235         , 
     230element DeploymentSummary { 
     231element activityList { 
     232for $DepActRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     233for $DepActLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:localIdentifier) 
     234let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     235return $DepAct  
     236}, 
     237element dptList { 
     238for $DepDPTRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     239for $DepDPTLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     240let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     241return $DepDPT  
     242}, 
     243element obsStnList { 
     244for $DepObsStnRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     245for $DepObsStnLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     246let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     247return $DepObsStn  
     248} 
     249} (: </DeploymentSummary> :) , 
    236250        for $RelatedDataEntity in $DE/moles:dgDataEntity/moles:dgRelatedDataEntity 
    237251            return 
     
    265279import module namespace stubblib='http://ndg.nerc.ac.uk/xquery/lib/stubb' at 'xmldb:exist:///db/xqueryLib/StubB/stubb_xquery_lib.xquery'; 
    266280:) 
     281(: replacable parameters 
     282declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     283declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     284declare variable $localIdentifier as xs:string {'activity_11680365144712080'}; 
     285:) 
    267286declare variable $targetCollection as xs:string {'TargetCollection'}; 
    268287declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    282301($SRAct/moles:name), 
    283302($SRAct/moles:abbreviation), 
    284 ($SRAct/moles:logos), 
    285 element dgActivity { 
    286 } (: </dgActivity> :)  
     303($SRAct/moles:logos) 
    287304} (: </activity> :)  
    288305} ; 
     
    298315($SRDE/moles:dgMetadataDescription), 
    299316($SRDE/moles:name), 
    300 ($SRDE/moles:abbreviation), 
    301 element dgDataEntity { 
     317($SRDE/moles:abbreviation) 
    302318} (: </dgDataEntity> :)         
    303 } 
    304319} ; 
    305320 
     
    319334$SRDPT/moles:name, 
    320335$SRDPT/moles:abbreviation, 
    321 $SRDPT/moles:logos, 
    322 element dgDataProductionTool { 
    323 } (: </dgDataProductionTool> :) 
     336$SRDPT/moles:logos 
    324337} (: </dataproductiontool> :) 
    325338} ; 
     
    340353($SRObsStn/moles:name), 
    341354($SRObsStn/moles:abbreviation), 
    342 ($SRObsStn/moles:logos), 
    343 element dgObservationStation { 
    344 } (: </dgObservationStation> :) 
     355($SRObsStn/moles:logos) 
    345356} 
    346357} ; 
     
    515526        else () 
    516527    }, (: </dgActivityRole> :) 
    517     for $RelDep in $Act/moles:dgActivity/moles:ActivityDeployment 
    518         return 
    519         element ActivityDeployment { 
    520             ($RelDep/moles:DateStart), 
    521             if (exists($RelDep/moles:DateEnd)) then  
    522                 ($RelDep/moles:DateEnd) 
    523             else (), 
    524             ($RelDep/moles:dgMetadataID), 
    525             f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)), 
    526             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    527                 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    528 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    529 return 
    530 f:return-stub-dataentity('dataentity', $DE) 
    531         }, (: </ActivityDeployment> :) 
     528element DeploymentSummary { 
     529element dptList { 
     530for $DepDPTRepository in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     531for $DepDPTLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     532let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     533return $DepDPT  
     534}, 
     535element obsStnList { 
     536for $DepObsStnRepository in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     537for $DepObsStnLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     538let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     539return $DepObsStn  
     540}, 
     541element dataEntityList { 
     542for $DE in  
     543collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     544/moles:DataProductionToolID 
     545[moles:localIdentifier=$Act/moles:dgMetadataID/moles:localIdentifier 
     546and moles:repositoryIdentifier=$Act/moles:dgMetadataID/moles:repositoryIdentifier]] 
     547order by $DE/moles:dgMetadataID 
     548return f:return-stub-dataentity('dataentity', $DE) 
     549} 
     550}, (: </DeploymentSummary> :) 
    532551        if (exists($Act/dgActivityCoverage)) then 
    533552            ($Act/dgActivityCoverage) 
     
    555574declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    556575 
     576(: replacable parameters 
     577declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     578declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     579declare variable $localIdentifier as xs:string {'dpt_116291244849226'}; 
     580:) 
    557581declare variable $targetCollection as xs:string {'TargetCollection'}; 
    558582declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    569593element  {$out-element-name} {  
    570594($SRAct/moles:dgMetadataID), 
     595($SRAct/moles:dgMetadataDescription), 
    571596($SRAct/moles:name), 
    572597($SRAct/moles:abbreviation), 
    573 ($SRAct/moles:logos), 
    574 element dgActivity { 
    575 } (: </dgActivity> :)  
     598($SRAct/moles:logos) 
    576599} (: </activity> :)  
    577600} ; 
     
    585608element {$out-element-name} { 
    586609($SRDE/moles:dgMetadataID), 
     610($SRDE/moles:dgMetadataDescription), 
    587611($SRDE/moles:name), 
    588 ($SRDE/moles:abbreviation), 
    589 element dgDataEntity { 
     612($SRDE/moles:abbreviation) 
    590613} (: </dgDataEntity> :)         
    591 } 
    592614} ; 
    593615 
     
    604626element {$out-element-name} { 
    605627$SRDPT/moles:dgMetadataID, 
     628$SRDPT/moles:dgMetadataDescription, 
    606629$SRDPT/moles:name, 
    607630$SRDPT/moles:abbreviation, 
    608 $SRDPT/moles:logos, 
    609 element dgDataProductionTool { 
    610 } (: </dgDataProductionTool> :) 
     631$SRDPT/moles:logos 
    611632} (: </dataproductiontool> :) 
    612633} ; 
     
    624645element {$out-element-name} { 
    625646($SRObsStn/moles:dgMetadataID), 
     647($SRObsStn/moles:dgMetadataDescription), 
    626648($SRObsStn/moles:name), 
    627649($SRObsStn/moles:abbreviation), 
    628 ($SRObsStn/moles:logos), 
    629 element dgObservationStation { 
    630 } (: </dgObservationStation> :) 
     650($SRObsStn/moles:logos) 
    631651} 
    632652} ; 
     
    694714        element dgDPTRoles {'Roles are available, and will be added soon'}  
    695715     else(), 
    696     for $RelDep in $DPT/moles:dgDataProductionTool/moles:DPTDeployment  
    697     return  
    698         element DPTDeployment {  
    699             $RelDep/moles:DateStart, 
    700             $RelDep/moles:DateEnd, 
    701             $RelDep/moles:dgMetadataID, 
    702             f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    703             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    704                 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    705 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    706 return 
    707 f:return-stub-dataentity('dataentity', $DE), 
    708             $RelDep/moles:Coverage 
    709         } (: </DPTDeployment> :)  
    710     } (: </dgDataProductionTool> :),  
     716element DeploymentSummary { 
     717element activityList { 
     718for $DepActRepository in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     719for $DepActLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ActivityID/moles:localIdentifier) 
     720let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     721return $DepAct  
     722}, 
     723element obsStnList { 
     724for $DepObsStnRepository in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     725for $DepObsStnLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     726let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     727return $DepObsStn  
     728}, 
     729element dataEntityList { 
     730for $DE in  
     731collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     732/moles:DataProductionToolID 
     733[moles:localIdentifier=$DPT/moles:dgMetadataID/moles:localIdentifier 
     734and moles:repositoryIdentifier=$DPT/moles:dgMetadataID/moles:repositoryIdentifier]] 
     735order by $DE/moles:dgMetadataID 
     736return f:return-stub-dataentity('dataentity', $DE) 
     737} 
     738} (: </DeploymentSummary> :) 
     739} (: </dgDataProductionTool> :),  
    711740    for $strkwrd in $DPT/moles:dgStructuredKeyword return $strkwrd, 
    712741    if (exists($DPT/moles:dgMetadataProvenance)) then $DPT/moles:dgMetadataProvenance else (), 
     
    727756declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    728757 
     758(: replacable parameters 
     759declare variable $targetCollection as xs:string {'/db/ndg_B_metadata_4'}; 
     760declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     761declare variable $localIdentifier as xs:string {'obs_1162914661529326'}; 
     762:) 
    729763declare variable $targetCollection as xs:string {'TargetCollection'}; 
    730764declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    731765declare variable $localIdentifier as xs:string {'LocalID'}; 
    732  
    733766declare function f:return-stub-activity($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element()  
    734767(: Returns a 'stubB' style activity record to expand an activity record :) 
     
    741774element  {$out-element-name} {  
    742775($SRAct/moles:dgMetadataID), 
     776($SRAct/moles:dgMetadataDescription), 
    743777($SRAct/moles:name), 
    744778($SRAct/moles:abbreviation), 
    745 ($SRAct/moles:logos), 
    746 element dgActivity { 
    747 } (: </dgActivity> :)  
     779($SRAct/moles:logos) 
    748780} (: </activity> :)  
    749781} ; 
     
    757789element {$out-element-name} { 
    758790($SRDE/moles:dgMetadataID), 
     791($SRDE/moles:dgMetadataDescription), 
    759792($SRDE/moles:name), 
    760 ($SRDE/moles:abbreviation), 
    761 element dgDataEntity { 
     793($SRDE/moles:abbreviation) 
    762794} (: </dgDataEntity> :)         
    763 } 
    764795} ; 
    765796 
     
    776807element {$out-element-name} { 
    777808$SRDPT/moles:dgMetadataID, 
     809$SRDPT/moles:dgMetadataDescription, 
    778810$SRDPT/moles:name, 
    779811$SRDPT/moles:abbreviation, 
    780 $SRDPT/moles:logos, 
    781 element dgDataProductionTool { 
    782 } (: </dgDataProductionTool> :) 
     812$SRDPT/moles:logos 
    783813} (: </dataproductiontool> :) 
    784814} ; 
     
    796826element {$out-element-name} { 
    797827($SRObsStn/moles:dgMetadataID), 
     828($SRObsStn/moles:dgMetadataDescription), 
    798829($SRObsStn/moles:name), 
    799830($SRObsStn/moles:abbreviation), 
    800 ($SRObsStn/moles:logos), 
    801 element dgObservationStation { 
    802 } (: </dgObservationStation> :) 
     831($SRObsStn/moles:logos) 
    803832} 
    804833} ; 
     
    844873moles:dgObservationStation!=''  
    845874and moles:dgMetadataID[ 
    846 moles:schemeIdentifier='NDG-B0'  
    847 and moles:repositoryIdentifier=$repositoryIdentifier 
     875moles:repositoryIdentifier=$repositoryIdentifier 
    848876and moles:localIdentifier=$localIdentifier]] 
    849877return 
     
    888916} (: End </dgStationaryPlatform>  :)   
    889917else $ObsStn/moles:dgObservationStation/moles:dgMovingPlatform ,  
    890 for $RelDep in $ObsStn/moles:dgObservationStation/moles:ObsStationDeployment  
    891 return  
    892 element ObsStationDeployment { 
    893 $RelDep/moles:DateStart, 
    894 $RelDep/moles:DateEnd, 
    895 $RelDep/moles:dgMetadataID, 
    896 f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    897 f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)),  
    898 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    899 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    900 return 
    901 f:return-stub-dataentity('dataentity', $DE), 
    902 $RelDep/moles:Coverage 
    903 } (: </RelatedDeployment> :)  
     918element DeploymentSummary { 
     919element activityList { 
     920for $DepActRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     921for $DepActLocal in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:ActivityID/moles:localIdentifier) 
     922let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     923return $DepAct  
     924}, 
     925element dptList { 
     926for $DepDPTRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     927for $DepDPTLocal in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     928let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     929return $DepDPT  
     930}, 
     931element dataEntityList { 
     932for $DE in  
     933collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     934/moles:ObservationStationID 
     935[moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
     936and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
     937order by $DE/moles:dgMetadataID 
     938return f:return-stub-dataentity('dataentity', $DE) 
     939} 
     940} (: </DeploymentSummary> :)  
    904941} (: </dgObservationStation> :),  
    905942for $strkwrd in $ObsStn/moles:dgStructuredKeyword return $strkwrd, 
     
    921958declare namespace xlink='http://www.w3.org/1999/xlink';  
    922959declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
     960declare option exist:timeout '24500';  
    923961 
    924962declare variable $targetCollection as xs:string {'TargetCollection'}; 
     
    11241162    return $Moles ''' 
    11251163             
    1126 DIFQuery = '''import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     1164DIFQuery = ''' 
     1165import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
    11271166import module namespace utillib='http://ndg.nerc.ac.uk/xquery/lib/utilities' at 'xmldb:exist:///db/xqueryLib/Utilities/utility_xquery_lib.xquery'; 
     1167(: Keep 
    11281168declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; 
    11291169declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    11301170declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    1131  
     1171:) 
    11321172declare variable $targetCollection as xs:string {'TargetCollection'}; 
    11331173declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    11341174declare variable $localIdentifier as xs:string {'LocalID'}; 
    1135  
    1136 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ 
     1175declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     1176declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     1177declare variable $localIdentifier as xs:string {'dataent_chablis'}; 
     1178 
     1179let $DE := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ 
    11371180    exists('moles:dgDataEntity')  
    1138     and moles:dgMetadataID/moles:schemeIdentifier='NDG-B0'  
    11391181    and moles:dgMetadataID/moles:repositoryIdentifier=$repositoryIdentifier 
    11401182    and moles:dgMetadataID/moles:localIdentifier=$localIdentifier] 
     
    11471189            for $DataCreatorRole in $DE/moles:dgDataEntity/moles:dgDataRoles/moles:dgDataCreator/moles:dgRoleHolder[not(exists(moles:endDate)) or moles:endDate=''][1] 
    11481190        return  
    1149             for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/*[(moles:dgMetadataID/moles:schemeIdentifier='NDG-B0' 
    1150                    and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/*/moles:repositoryIdentifier 
    1151                    and moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/*/moles:localIdentifier)] 
     1191            for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/(dgOrganisation | dgPerson)[( 
     1192                   moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:repositoryIdentifier 
     1193                   and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:localIdentifier)] 
    11521194            return  
    11531195                    element Dataset_Creator { 
     
    11641206            element Parameters { 
    11651207            element Category {string($StructuredKeyword/*/moles:dgValidTerm)}, 
    1166             if (exists($StructuredKeyword//moles:dgValidSubterm)  
    1167                 and $StructuredKeyword//moles:dgValidSubterm != ''  
    1168                 and $StructuredKeyword//moles:dgValidSubterm != ' ') then  
     1208            if (exists($StructuredKeyword/*/moles:dgValidSubterm)  
     1209                and $StructuredKeyword/*/moles:dgValidSubterm != ''  
     1210                and $StructuredKeyword/*/moles:dgValidSubterm != ' ') then  
    11691211            for $Subterm in $StructuredKeyword//moles:dgValidSubterm[exists(moles:dgValidTerm)] 
    11701212                where exists($Subterm/moles:dgValidSubterm) 
     
    11751217                    else if ($Subterm/moles:ListLevel=3) then element Variable {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)}  
    11761218                    else if ($Subterm/moles:ListLevel=4) then element Detailed_Variable {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)}  
    1177                     else element GCMD_Science_Valid {$Subterm/moles:ListLevel,($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} 
     1219                    else element GCMD_Science_Valid {data($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} 
    11781220            else() 
    11791221                } 
    11801222        else(), 
    1181     for $StructuredKeyword in ($DE//(moles:dgStructuredKeyword | moles:dgDataEntity/moles:dgDataSummary/moles:dgParameterSummary/moles:dgStdParameterMeasured)[voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_correct, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_deprecated, moles:dgValidTermID/moles:ParentListID) and (not(exists(moles:ListLevel)) or moles:ListLevel=0)]) 
     1223    for $StructuredKeyword in ($DE/(moles:dgStructuredKeyword | moles:dgDataEntity/moles:dgDataSummary/moles:dgParameterSummary/moles:dgStdParameterMeasured)[voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_correct, moles:dgValidTermID/moles:ParentListID) or voclib:spot-vocab($voclib:gcmd_science_valids_deprecated, moles:dgValidTermID/moles:ParentListID) and (not(exists(moles:ListLevel)) or moles:ListLevel=0)]) 
    11821224    return 
    11831225        element Parameters {data($StructuredKeyword/moles:dgValidTerm)}, 
     
    11851227        return  
    11861228            element ISO_Topic_Category {string($ISOTopicCategory/moles:dgValidTerm)}, 
    1187     for $Keyword in distinct-values($DE//moles:dgStructuredKeyword[ 
     1229    for $Keyword in distinct-values($DE/moles:dgStructuredKeyword[ 
    11881230    not (voclib:spot-vocab($voclib:iso_topic_list, moles:dgValidTermID/moles:ParentListID) 
    11891231    or voclib:spot-vocab($voclib:gcmd_science_valids, moles:dgValidTermID/moles:ParentListID) 
    11901232    or voclib:spot-vocab($voclib:gcmd_science_valids_correct, moles:dgValidTermID/moles:ParentListID) 
     1233    or voclib:spot-vocab($voclib:iso_topic_list, moles:dgValidTermID/moles:ParentListID) 
    11911234    )]/moles:dgValidTerm) 
    11921235    return element Keyword {string($Keyword)},  
    1193     for $DepDPT in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID 
    1194     return  
    1195         element Sensor_Name { 
    1196             for $DepDPTAbbrev in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPT/moles:repositoryIdentifier and moles:localIdentifier=$DepDPT/moles:localIdentifier]]/moles:abbreviation)) 
    1197                 return element Short_Name {data($DepDPTAbbrev)}, 
    1198             for $DepDPTName in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPT/moles:repositoryIdentifier and moles:localIdentifier=$DepDPT/moles:localIdentifier]]/moles:name)) 
    1199                 return element Long_Name {data($DepDPTName)} 
     1236    for $DepDPTRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:repositoryIdentifier 
     1237    for $DepDPTLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID[moles:repositoryIdentifier=$DepDPTRepository]/moles:localIdentifier)  
     1238    let $DepDPTRecord := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPTRepository  and moles:localIdentifier=$DepDPTLocal]] 
     1239                return 
     1240                        element Sensor_Name { 
     1241                element Short_Name {data($DepDPTRecord/moles:abbreviation)}, 
     1242                element Long_Name {data($DepDPTRecord/moles:name)} 
    12001243            }, 
    1201     for $DepObsStn in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID) 
    1202     return  
    1203         element Source_Name { 
    1204             for $DepObsStnAbbrev in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepObsStn/moles:repositoryIdentifier and moles:localIdentifier=$DepObsStn/moles:localIdentifier]]/moles:abbreviation)) 
    1205                 return element Short_Name {data($DepObsStnAbbrev)}, 
    1206             for $DepObsStnName in ((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepObsStn/moles:repositoryIdentifier and moles:localIdentifier=$DepObsStn/moles:localIdentifier]]/moles:name)) 
    1207                 return element Long_Name {data($DepObsStnName)} 
     1244    for $DepObsStnRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     1245    for $DepObsStnLocal in distinct-values(($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID[moles:repositoryIdentifier=$DepObsStnRepository]/moles:localIdentifier)) 
     1246    let $DepObsStnRecord := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:repositoryIdentifier=$DepObsStnRepository  and moles:localIdentifier=$DepObsStnLocal]] 
     1247                return element Source_Name { 
     1248                element Short_Name {data($DepObsStnRecord/moles:abbreviation)}, 
     1249                element Long_Name {data($DepObsStnRecord/moles:name)} 
    12081250            }, 
    1209     for $TemporalRange in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:DateRange) 
     1251    for $TemporalRange in $DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgTemporalCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgTemporalCoverage)/moles:DateRange 
    12101252        return  
    12111253            element Temporal_Coverage 
     
    12141256                element End_Date {data($TemporalRange/moles:DateRangeEnd)} 
    12151257                }, 
    1216     for $TemporalTerm in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:dgArea[voclib:spot-vocab($voclib:gcmd_chronostratigraphic_valids, moles:dgValidTermID/moles:ParentListID)]/moles:dgValidTerm) 
     1258    for $TemporalTerm in $DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgTemporalCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgTemporalCoverage)/moles:dgChronostratigraphicTerm[voclib:spot-vocab($voclib:gcmd_chronostratigraphic_valids, moles:dgValidTermID/moles:ParentListID)]/moles:dgValidTerm 
    12171259        return element Paleo_Temporal_Coverage {element Chronostratigraphic_Unit {data($TemporalTerm)}},  
    12181260    for $Data_Set_Progress in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataStatus/moles:dgDatasetClosure) 
    12191261        return element Data_Set_Progress {data($Data_Set_Progress)}, 
    1220     for $BoundingBox in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:BoundingBox) 
     1262    for $BoundingBox in $DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgSpatialCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgSpatialCoverage)/moles:BoundingBox 
    12211263    return  
    12221264        element Spatial_Coverage { 
     
    12261268                element Easternmost_Longitude {data($BoundingBox/moles:LimitEast)} 
    12271269            }, 
    1228     for $Location in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:dgArea[voclib:spot-vocab($voclib:gcmd_location_valids, moles:dgValidTermID/moles:ParentListID)]) 
     1270    for $Location in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage/(moles:dgSpatialCoverage | moles:dgSpatioTemporalCoverage/moles:dgSpatioTemporalRange/moles:dgSpatialCoverage)/moles:dgArea[voclib:spot-vocab($voclib:gcmd_location_valids, moles:dgValidTermID/moles:ParentListID)]) 
    12291271        return element Location {data($Location/moles:dgValidTerm)},  
    1230     for $DepAct in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID) 
     1272    for $DepActRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:repositoryIdentifer) 
     1273    for $DepActLocal in  distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID[moles:repositoryIdentifer=$DepActRepository]/moles:localIdentifer)   
     1274    let $DepActRecord := collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:repositoryIdentifier=$DepActRepository and moles:localIdentifier=$DepActLocal]] 
    12311275    return  
    12321276        element Project { 
    1233             for $DepActAbbrev in (collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepAct/moles:repositoryIdentifier and moles:localIdentifier=$DepAct/moles:localIdentifier]]/moles:abbreviation) 
    1234                 return  
    1235                     element Short_Name {data($DepActAbbrev)}, 
    1236             for $DepActName in (collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepAct/moles:repositoryIdentifier and moles:localIdentifier=$DepAct/moles:localIdentifier]]/moles:name) 
    1237                 return  
    1238                     element Long_Name {data($DepActName)} 
     1277                    element Short_Name {data($DepActRecord/abbreviation)}, 
     1278                    element Long_Name {data($DepActRecord/name)} 
    12391279            }, 
    12401280    if (exists($DE/moles:dgDataEntity/moles:dgDataGranule/moles:accessControlPolicy)) then  
     
    14301470            element Future_DIF_Review_Date {data($DE/moles:dgMetadataProvenance/moles:RecordReview/moles:ReviewDate)} 
    14311471    else () 
    1432         }''' 
     1472        } 
     1473''' 
    14331474         
    1434 DublinCoreDEQuery='''import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     1475DublinCoreDEQuery=''' 
     1476import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
    14351477import module namespace utillib='http://ndg.nerc.ac.uk/xquery/lib/utilities' at 'xmldb:exist:///db/xqueryLib/Utilities/utility_xquery_lib.xquery'; 
    14361478declare default element namespace 'http://ndg.nerc.ac.uk/moles'; 
    14371479declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    14381480declare namespace dc='http://purl.org/dc/elements/1.1/'; 
    1439 declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc'; 
     1481declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc/'; 
     1482(: 
     1483declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     1484declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     1485declare variable $localIdentifier as xs:string {'dataent_chablis'}; 
     1486:) 
     1487 
    14401488declare variable $targetCollection as xs:string {'TargetCollection'}; 
    14411489declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    14441492for $DE in collection($targetCollection)/dgMetadata/dgMetadataRecord[ 
    14451493exists('dgDataEntity')  
    1446 and dgMetadataID/schemeIdentifier='NDG-B0'  
    14471494and dgMetadataID/repositoryIdentifier=$repositoryIdentifier 
    14481495and dgMetadataID/localIdentifier=$localIdentifier] 
     
    14531500    element dc:type {'Dataset'}, 
    14541501    element dc:identifier {concat($DE/dgMetadataID/repositoryIdentifier, $utillib:moles_id_separator, 'DC', $utillib:moles_id_separator, $DE/dgMetadataID/localIdentifier)}, 
     1502    for $identifiers in $DE/(dgMetadataDescription/descriptionSection/descriptionOnlineReference | abstract/abstractOnlineReference)[ 
     1503        exists(dgReferenceClass/dgValidTermID/ParentListID) 
     1504        and 
     1505        voclib:spot-vocab($voclib:ndg_online_reference_classes_vocab, dgReferenceClass/dgValidTermID/ParentListID)  
     1506        and 
     1507        dgReferenceClass/dgValidTerm='DataPage'] 
     1508    return element dc:identifier {data($identifiers/dgSimpleLink/URI)}, 
    14551509    element dc:description {string($DE/dgMetadataDescription/abstract/abstractText)}, 
    14561510    element dc:date 
     
    14581512        if (exists($DE/(dgMetadataProvenance | DataProvenance)/RecordUpdate/UpdateDate)) then 
    14591513            for $updatedate in ($DE/(dgMetadataProvenance | DataProvenance)/RecordUpdate/UpdateDate) 
    1460                 order by xs:dateTime($updatedate) 
     1514                order by xs:date($updatedate) 
    14611515            return data($updatedate[1]) 
    14621516        else 
     
    15131567                    (string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName)))) 
    15141568                else ('empty content') 
    1515             } 
    1516 }  (: </oai_dc:dc> :)''' 
     1569} 
     1570}  (: </oai_dc:dc> :) 
     1571''' 
    15171572 
    15181573MDIPQuery='''import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     
    16071662    } 
    16081663''' 
    1609  
    1610  
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/layout/ndg.css

    r2616 r2639  
    5353#Main {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px} 
    5454 
    55 #HistoryCart { WIDTH: 220px; FLOAT: left; margin-top: 10px; margin-bottom: 10px;} 
     55/* Left Panel */ 
     56/* Tab styling from http://www.alistapart.com/articles/slidingdoors/ */ 
     57/* remember li.current {} will pick up li with class current 
     58   and #tabhdr li {} will bring up li in div id tabhdr  */  
     59 
     60#Left{ WIDTH: 220px; FLOAT: left; margin-top: 10px; margin-bottom: 10px; margin-right:20px;} 
     61#left div {clear: left;} 
     62.tabhdr { float:left; width:100%;line-height:normal;} 
     63.tabhdr ul {margin:0; padding:0; list-style:none;} 
     64.tabhdr a:link {display:block; text-decoration:none; color:black; float:left; width:5em;} 
     65li.current {float:left; margin:0; padding:2px 10px; background-color:wheat;  
     66            border-left:1px solid black; border-right: 1px solid black; border-top:1px solid black;} 
     67li.hidden {float:left; margin:0; padding:2px 10px;} 
     68.tabcontent {padding:2px 10px;border: 1px solid black;} 
     69 
     70/* Left panel finished */ 
     71 
    5672#Contents { WIDTH: 800px; FLOAT: left; margin-left: 10px; } 
    5773 
     
    8197/* end of result set controls */ 
    8298 
    83 /* Left Pane (History & Cart) CSS Below is the CSS for the tab panel div tags.  
    84      Note that it is dependent on the ndgjavascript.jss 
    85      */ 
    86 .tab {  
    87         font-family: verdana,sans-serif;  
    88         font-size: 14px; 
    89         width: 100px; 
    90         white-space: nowrap; 
    91         text-align: center; 
    92         border-style: solid; 
    93         border-color: wheat; 
    94         border-left-width: 1px; 
    95         border-right-width: 1px; 
    96         border-top-width: 1px; 
    97         border-bottom-width: 0px; 
    98         padding-top: 5px; 
    99         padding-bottom: 5px; 
    100         cursor: pointer; 
    101         } 
    102 .tabhold {  
    103         background-color: white; 
    104         color: black; 
    105         } 
    106 .tabfocus {  
    107         background-color: wheat; 
    108         color: white; 
    109         } 
    110 .tabcontent {  
    111         font-family: sans-serif;  
    112         font-size: 14px; 
    113         width: 200px; 
    114         height: 275px; 
    115         border-style: solid; 
    116         border-color: wheat; 
    117         border-width: 1px; 
    118         padding-top: 15px; 
    119         padding-left: 10px; 
    120         padding-right: 10px; 
    121         } 
    122 </style> 
    12399 
    124100/* end of Left Pane */ 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/content.kid

    r2626 r2639  
    1 <html py:layout="'ndgPage.kid'" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> 
    2     <head> 
    3     <!--!  this comes from the site template --> 
    4     </head> 
     1<html py:extends="'ndgPage.kid'" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> 
     2 
     3    <head py:replace="pagehead()"/> 
    54    <body> 
    6     <div py:match="item.tag == '{http://www.w3.org/1999/xhtml}content'"> 
    7     ${XML(c.xml)} 
     5    <div id="entirepage"> 
     6        <div py:replace="header()"/> 
     7        <!--! The if on the call to the left panel needs to be here for subtle css reasons --> 
     8        <div py:if="'ndgSec' in session" py:replace="leftpanel()" id="Left"/> 
     9        <?python 
     10        id="contents" 
     11        if "ndgSec" in session: id="contentsRight" 
     12        ?>  
     13        <div id="${id}"> 
     14            ${XML(c.xml)} 
     15        </div> 
     16        <div py:replace="footer()"/> 
    817    </div> 
    918    </body> 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/ndgPage.kid

    r2626 r2639  
     1<!-- This is a bunch of named templates for use in pages --> 
    12<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> 
    2     <head> 
    3     <title py:content="c.title">title</title> 
     3     
     4    <!-- HTML Header and Document header follow --> 
     5     
     6    <head py:def="pagehead()"> 
     7        <title py:content="c.title">title</title> 
    48        <!--! The following includes the javascript, note that the XML 
    59        function is needed to avoid escaping the < character --> 
    610        ${XML(h.javascript_include_tag(builtins=True))} 
    7         <link media="all, screen" href="/layout/ndg.css" type="text/css" rel="stylesheet"/> 
     11        <link media="all, screen" href="/layout/ndg2.css" type="text/css" rel="stylesheet"/> 
    812    </head> 
    9     <body> 
    10     <div id="Header"> 
     13 
     14    <div py:def="header()" id="Header"> 
    1115        <table cellpadding="0" cellspacing="0" width="100%%"><tbody> 
    1216            <tr><td width="10%%" align="center" valign="middle"> 
     
    2024         </tbody></table> 
    2125    </div> 
    22     <div id="left"> 
     26 
     27    <!-- History and Shopping Cart follow --> 
     28 
     29    <div py:def="leftpanel()" id="Left"> 
     30            <div py:if="session['panelView']=='History'">  
     31                <div class="tabhdr"> 
     32                    <ul> 
     33                        <li class="current"> History</li> 
     34                        <li class="hidden">${XML(h.link_to_remote("Selected",dict(update="Left", url=h.url_for(controller="tabs", action="update",value="Selection"))))}</li> 
     35                    </ul> 
     36                </div> 
     37                <div class="tabcontent"> 
     38                   <p> Dataset History </p>   
     39                   <ul py:if="'history' in session"> 
     40                        <li py:for="item in session['history']"> 
     41                        ${XML(h.link_to(item[0],item[1]))}</li> 
     42                   </ul> 
     43                </div> 
     44            </div> 
     45            <div py:if="session['panelView']=='Selection'">  
     46                <div class="tabhdr"> 
     47                    <ul> 
     48                    <li class="hidden">${XML(h.link_to_remote("History",dict(update="Left", url=h.url_for(controller="tabs", action="update",value="History"))))}</li> 
     49                    <li class="current">Selection</li> 
     50                    </ul> 
     51                </div> 
     52                <div class="tabcontent"> 
     53                    <p> Selected Datasets </p>   
     54                    <ul py:if="'selection' in session"> 
     55                        <li py:for="item in session['selection']"> 
     56                        ${XML(h.link_to(item[0],item[1]))}</li> 
     57                    </ul> 
     58                </div> 
     59            </div> 
    2360    </div> 
    24     <div id="main"> 
    25     <content>replaced by actual page</content> 
    26     </div> 
    27     <div id="Footer"> 
     61     
     62    <!-- Page Footer follows --> 
     63 
     64    <div py:def="footer()" id="Footer"> 
    2865        <center><table><tbody> 
    2966            <tr> 
     
    4582        </tbody></table></center> 
    4683    </div> 
    47     </body> 
    4884</html> 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/templates/wayf.kid

    r2626 r2639  
    1 <html py:layout="'ndgPage.kid'" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> 
    2     <head> 
    3     <!--!  this comes from the site template --> 
    4     </head> 
     1<html py:extends="'ndgPage.kid'" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"> 
     2    <head py:replace="pagehead()"/> 
    53    <body> 
    6     <div py:match="item.tag == '{http://www.w3.org/1999/xhtml}content'"> 
     4        <div py:replace="header()"/> 
    75        <h4> Where are you from? </h4> 
    86        <p> You can login in at  
    97        <ul py:for="h in c.providers"> 
    108            <li> <a href="${c.providers[h]}?r=${c.returnTo}">${h}</a></li> 
    11         </ul> 
    12     </p> 
    13     </div> 
     9        </ul></p> 
     10        <p>Before clicking on these links, please check that the links redirect to a site 
     11        you trust with your security credentials.</p> 
     12        <p> How can I tell? If you hover over the link, you should see (look at the bottom of  
     13        your browser) that it consists of a <i>normal</i> url,  
     14        followed by ?r=http://anotherURL. You should be sure that 
     15        you trust anotherURL, because it will get access to your credentials!</p> 
     16        <div py:replace="footer()"/> 
    1417    </body> 
    1518</html> 
Note: See TracChangeset for help on using the changeset viewer.