Ignore:
Timestamp:
21/01/10 16:36:04 (10 years ago)
Author:
sdonegan
Message:

sync dirs

Location:
TI01-discovery/branches/ingestion-MEDIN/ingestAutomation-upgrade/OAIBatch
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/branches/ingestion-MEDIN/ingestAutomation-upgrade/OAIBatch/PostgresRecord.py

    r5846 r6364  
    3333         
    3434    #def __init__(self, filename, ndg_dataprovider, datacentre_groups, datacentre_namespace, discovery_id, xq, docType): 
    35     def __init__(self, filename, ndg_dataprovider, datacentre_groups, datacentre_namespace, discovery_id,datasetName,datacentreName,datasetLastEditUpdateDate,datasetStartDateNom, datasetEndDateNom, xq, docType): 
     35    def __init__(self, filename, ndg_dataprovider, datacentre_groups, datacentre_namespace, isoDataModel, xq, docType): 
     36                  
    3637                  
    3738        logging.info("Setting up Postgres record for file, " + filename) 
     39         
    3840        self.filename = filename 
     41     
     42        self.isoDataModel = isoDataModel 
     43         
     44        #note method of extracting info from isoDataModel - nested lists, so if one value then use [0][0] 
     45        discovery_id = self.isoDataModel.datasetID[0][0] 
    3946     
    4047        # NB, if we're dealing with an NDG data provider, the details are slightly different 
     
    4956        self._datacentre_groups = datacentre_groups 
    5057        self._repository = datacentre_namespace 
    51         self.discovery_id = discovery_id 
     58        self.discovery_id = discovery_id # just a single val.. 
    5259        self._xq = xq 
    5360        # simplify processing by uppercasing format at initialisation 
    5461        self.docType = docType.upper()     
    5562         
     63        
    5664        #make sure we escape any special characters in this field... SJD 20/10/09         
    57         self.dataset_name = self.escapeSpecialCharacters(datasetName) 
    58         self.datacentre_name = self.escapeSpecialCharacters(datacentreName) 
    59          
    60         self.dataset_lastEdit = datasetLastEditUpdateDate     
    61         self.datasetStartNom = datasetStartDateNom 
    62         self.datasetEndNom = datasetEndDateNom 
    63  
     65        #self.dataset_name = self.escapeSpecialCharacters(self.isoDataModel.datasetName[0]) 
     66        self.dataset_name = self.escapeSpecialCharacters(self.isoDataModel.datasetName[0][0]) 
     67         
     68        #self.dataset_lastEdit = datasetLastEditUpdateDate     
     69        self.dataset_lastEdit = self.isoDataModel.revisionDate[0][0] 
     70         
     71        #for nominal start and end dates need to get extreme if multiple values in there 
     72        # - just create list of all values present, sort it by date then select min and max 
     73         
     74         
     75        #self.datasetStartNom = datasetStartDateNom 
     76        self.datasetStartNom = self.isoDataModel.boundingDates['start'] #dictionary method! 
     77         
     78        #self.datasetEndNom = datasetEndDateNom 
     79        self.datasetEndNom = self.isoDataModel.boundingDates['end'] #dictionary method! 
     80                 
    6481        self._molesFormat = None    # initialise this, so we can guarantee a value - to avoid using getattr 
    6582        self._allDocs = []  # array to store all the transformed docs - for easy retrieval by the DAO 
     
    97114        self.parameters = None 
    98115        self.scope = None 
     116         
     117         
    99118 
    100119    def escapeSpecialCharacters(self, inputString): 
Note: See TracChangeset for help on using the changeset viewer.