Changeset 3858 for TI01-discovery


Ignore:
Timestamp:
07/05/08 12:59:32 (11 years ago)
Author:
cbyrom
Message:

Properly update doc when modifications made + remove redundant code +
handle scn's better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/PostgresDAO.py

    r3853 r3858  
    2727         
    2828 
    29     def commavaluesfromsublist(self, list): 
    30         ''' 
    31         Creates an comma-separated string of values from a list of sublists, taking  
    32         the first element of each sublist 
    33         ''' 
    34         csvString = "" 
    35         for item in list: 
    36             if item: 
    37                 if len(csvString) > 0: 
    38                     csvString += ","     
    39                 csvString += "%s" % item[0] 
    40              
    41         return csvString 
    42  
    43              
    4429    def getRecordID(self): 
    4530        ''' 
     
    9984        # firstly, check the document is actually new - i.e. not just a repeat of the same data 
    10085        if self._checkIsUpdatedRecord(): 
    101          
    102             # firstly update the actual documents contained by the record - i.e. the original doc + 
     86 
     87            # firstly, update the original record 
     88            self._updateOriginalRecord() 
     89         
     90            # now update the actual documents contained by the record - i.e. the original doc + 
    10391            # the various transforms required 
    10492            self._updateMetadataRecords() 
     
    130118        if not results: 
    131119            logging.info("Ingested document is different to that in the current DB") 
     120            # get the current SCN 
     121            sql = "SELECT scn FROM ORIGINAL_DOCUMENT where original_document_id = " + \ 
     122                    str(self._record.db_id) + ";" 
     123            results = db_funcs.runSQLCommand(self._connection, sql) 
     124            self._record.scn = results[0][0] 
    132125            return True 
    133126             
     
    255248            self._record.discovery_id + "', '" + self._record.docType + "', '" + \ 
    256249            self._record.originalFormat + "', '" + str(self._record.scn) + "');" 
    257  
    258         id = db_funcs.runSQLCommand(self._connection, sqlCmd) 
    259250        db_funcs.runSQLCommand(self._connection, sqlCmd) 
    260251         
Note: See TracChangeset for help on using the changeset viewer.