Ignore:
Timestamp:
13/06/06 20:45:04 (13 years ago)
Author:
lawrence
Message:

Handling selection and browse history better ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/StubB/XSLT/browse/portal/cgi/browse/ServiceBinding.py

    r1171 r1173  
    1313# This module provides classes to support these activities. 
    1414 
    15 from Utilities import wrapGetText, myConfig 
     15from Utilities import wrapGetText, myConfig, DIFid2NDGid 
    1616from htmlUtilities import hyperlink,image 
    1717 
     
    5757        native service which one expects to be able to operate upon it, for example, 
    5858        an NDG-A type identifier should expect the NDG-A-Service running at the 
    59         specific repository ''' 
    60         def __init__(self,n='',nativeID=None,serviceFile='cgi/serviceMap.config',uri='local'): 
     59        specific repository. Note that we support the NDG id in one of two formats: 
     60            nativeID is an elementTree object from an xml form, and  
     61            entryID is a repository:scheme:localidentifier string  ''' 
     62        def __init__(self,n='',nativeID=None,entryID=None,serviceFile='cgi/serviceMap.config',uri='local'): 
    6163            Service.__init__(self) 
    6264            # regrettably we used different things in our ID's than we did in 
    6365            # our difs : 
    6466            self.mapping={'NDG-A0':'NDG_A_SERVICE','NDG-B0':'NDG_B_SERVICE', 
    65             'NDG-B1':'NDG_B_SERVICE'} 
     67            'NDG-B1':'NDG_B_SERVICE','DIF':'DISCOVERY'} 
    6668            self.serviceMap=ServiceMap(serviceFile=serviceFile) 
    6769            self.name=n 
    68             if nativeID is not None: self.native(nativeID,uri=uri)  
     70            if nativeID is not None:  
     71                self.native(nativeID,uri=uri) 
     72            elif entryID is not None: 
     73                self.entry(entryID) 
     74        def entry(self,id): 
     75            self.native(DIFid2NDGid(id)) 
    6976        def native(self,elem,uri='local',seqno=1): 
    7077            ''' Given an ndg id, get the native service ''' 
     
    115122        def __makeuri(self,s,b,l): 
    116123            ''' Actually create the URI ''' 
    117             if s=='NDG_B_SERVICE': 
     124            if s in ('NDG_B_SERVICE','DISCOVERY'): 
    118125                uri='%s/%s'%(b,l) 
    119126            else: 
Note: See TracChangeset for help on using the changeset viewer.