Changeset 5323 for ndgCommon


Ignore:
Timestamp:
21/05/09 10:35:57 (10 years ago)
Author:
sdonegan
Message:

Merged updates to allow extraction of more information from DIF for adding to Discovery DB

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/models/DIF.py

    r4793 r5323  
    7373        self.name=helper.getText(self.tree,'Entry_Title') 
    7474        self.abbreviation=self.name[0:min(5,len(self.name))] 
     75 
     76        #add some extra parameters here to extract further columns to aid in ranking & ordering         
     77        if len(helper.getText(self.tree,'DIF_Creation_Date')) < 1:             
     78            #set to null as bad timestamp will screw up the sql commands (will scan for it later) 
     79            self.metadataCreationDate='null' 
     80        else: 
     81            self.metadataCreationDate=helper.getText(self.tree,'DIF_Creation_Date') 
     82             
     83        self.datacentreName=helper.getText(self.tree,'Data_Center/Data_Center_Name/Short_Name') 
     84         
     85        if len(helper.getText(self.tree,'Data_Set_Citation/Dataset_Title')) < 1: 
     86            self.datasetTitle=self.name 
     87        else: 
     88            self.datasetTitle=helper.getText(self.tree,'Data_Set_Citation/Dataset_Title') 
     89         
     90        #logging.info('EXTRA INFORMATION for ORDERING= dataset title:  ' + self.datasetTitle + '  dataset creation date: ' + self.metadataCreationDate + '  datacentre name: ' + self.datacentreName) 
    7591         
    7692        #Note that entity.constraints.html is about access control on the metadata, 
Note: See TracChangeset for help on using the changeset viewer.