Changeset 3361


Ignore:
Timestamp:
11/02/08 09:59:51 (12 years ago)
Author:
lawrence
Message:

BrowseServer? removed from xquery. Bug fix in listing query?

Location:
exist/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/DocumentRetrieve.py

    r3127 r3361  
    9999    def get(self,url): 
    100100        request=urllib2.Request(url) 
    101         response='Error obtaining remote file: ' 
     101        response='Cannot obtain remote file: ' 
    102102        try: 
    103103            f = self.opener.open(request) 
     
    158158        self.synonyms=[(i.find('{urn:vocab/types}entryTerm').text or '') for i in s] 
    159159        return [self.broader,self.narrower,self.synonyms] 
     160 
  • exist/trunk/python/ndgUtils/test_xqueries.py

    r3151 r3361  
    6262        moles='{http://ndg.nerc.ac.uk/moles}' 
    6363        xq=xq.replace('TargetCollection',tc) 
     64        print xq 
    6465        #this returns the first one of  
    6566        r=self.xmldb2.executeChunkedQuery(xq,1,1) 
     67        print r 
    6668        #make sure it has got a dgDataEntity record (that's the default) 
    6769        ot=_getType(r) 
     
    9092        #ok, now let's try a moles2dif xquery 
    9193        xquery=self.xq.actual('moles2dif',targetCollection,n.repository,n.localID) 
    92         xquery=xquery.replace('BrowseServer',self.c.get('NDG_B_SERVICE',n.repository)) 
     94        # decided not to do this any more, so xquery should not have this any longer 
     95        #xquery=xquery.replace('BrowseServer',self.c.get('NDG_B_SERVICE',n.repository)) 
    9396        id,s=self.xmldb2.executeQuery(xquery) 
    9497        print '%s hit in %s ms'%(s['hits'],s['queryTime'])  
     
    9699        dif_from_moles=self.xmldb2.retrieve(id,0) 
    97100        self._logToFile('dif_from_moles.xml',dif_from_moles) 
     101        #now test that the b link does something sensible 
     102        etdif=ET.fromstring(dif_from_moles) 
     103        rurl=etdif.findall('Related_URL') 
     104        for url in rurl: 
     105            utext=uurl.find('URL').text or '' 
     106            self.failUnless('BrowseServer' not in utext) 
    98107         
    99108 
  • exist/trunk/xquery/moles2dif.xq

    r3182 r3361  
    22main aim should be to produce DIF documents from MOLES for NDG participants. 
    33Key parameters to be changed when used in anger are 
    4  TargetCollection, Repository ID, LocalID, BrowseServer :) 
     4 TargetCollection, Repository ID, LocalID :) 
    55 
    66import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     
    1515declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    1616declare variable $localIdentifier as xs:string {'LocalID'}; 
    17 declare variable $browseServer as xs:string {'BrowseServer'}; 
    1817(: Keep 
    1918declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
    2019declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
    2120declare variable $localIdentifier as xs:string {'dataent_CIRA'}; 
    22 declare variable $browseServer as xs:string {'ndgbeta.badc.rl.ac.uk'}; 
    2321:) 
    2422for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ 
     
    253251        element Reference {''}, 
    254252        element Summary {string($DE/moles:dgMetadataDescription/moles:abstract/moles:abstractText)}, 
    255         element Related_URL  { 
    256             element URL_Content_Type {'VIEW_EXTENDED_METADATA'}, 
    257             element URL {concat($browseServer,'/view/',data($DE/moles:dgMetadataID/moles:repositoryIdentifier),'__NDG-B1__', 
    258             data($DE/moles:dgMetadataID/moles:localIdentifier))}, 
    259             element Description {'A NERC DataGrid MOLES record is available at this URL.'} 
    260             }, 
    261253        for $DG in $DE/moles:dgDataEntity/moles:dgDataGranule 
    262254            (: BNL need to make sure we have a function for doing related URLs :) 
  • exist/trunk/xquery/molesList.xq

    r3181 r3361  
    55return 
    66<dgMetadataRecord> 
     7(: Yes, there is redundant info, we'll sort that out later, rapid bug fix 
     8mode :) 
     9{$DE/dgMetadataID/repositoryIdentifier}{$DE/dgMetadataID/localIdentifier}  
    710<repositoryID>{string($DE/dgMetadataID/localIdentifier)}</repositoryID> 
    811<fileName>{$f}</fileName> 
Note: See TracChangeset for help on using the changeset viewer.