Changeset 4434 for exist


Ignore:
Timestamp:
17/11/08 17:34:48 (11 years ago)
Author:
cbyrom
Message:

Add new method to vocabtermdata - to retrieve the vocab term item when
specifying its ID and (unversioned) uri.

File:
1 edited

Legend:

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

    r4347 r4434  
    514514        logging.debug("Determining term ID for uri, '%s'" %uri) 
    515515        termID = uri.split('/')[-1] 
     516 
     517        return self.getTermItemfromURIAndTerm(uri, termID) 
     518     
     519     
     520    def getTermItemfromURIAndTerm(self, uri, termID): 
     521        ''' 
     522        Given a term id and its uri 
     523        determine the correct vocab data term item 
     524        @param uri: base uri for vocab term - i.e. without versioning info 
     525        @param termID: term ID to look up 
     526        @return vocab term item corresponding to the input uri/term 
     527        @raise VocabTermDataError if term ID not found 
     528        ''' 
     529        logging.debug("Determining term item for uri, '%s', term name, '%s'" %(uri, termID)) 
    516530        vti = None 
    517531        if self.TERM_DATA.get(termID) and uri.startswith(self.TERM_DATA[termID].vocabURL): 
Note: See TracChangeset for help on using the changeset viewer.