Ignore:
Timestamp:
03/04/09 15:03:12 (10 years ago)
Author:
sdonegan
Message:

updates to allow oai_document_ingester to work

Location:
TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch
Files:
2 edited

Legend:

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

    r4854 r5167  
    66from xml.etree import cElementTree 
    77import os, sys, logging, re 
    8 #import csml.csml2Moles.molesReadWrite as MRW 
     8import csml.csml2Moles.molesReadWrite as MRW 
    99from ndg.common.src.models.ndgObject import ndgObject 
     10from ndg.common.src.lib.ndgresources import ndgResources 
    1011import ndg.common.src.lib.fileutilities as FileUtilities 
    1112from SpatioTemporalData import SpatioTemporalData 
     
    138139         
    139140        # load in the moles file and put this into an object for direct access to the xml elements 
     141        
    140142        self.dgMeta=MRW.dgMetadata() 
    141143        try: 
     
    163165             
    164166        # get the query and set this up to use properly 
    165         xquery = self._xq.actual(xQueryType, dir, self._repository_local_id, self._local_id) 
    166  
     167         
     168        #xquery = self._xq.actual(xQueryType, dir, self._repository_local_id, self._local_id) 
     169        #SJD - added this bit in (missed?) to upgrade to ndgCommon. 
     170        self.xqueryLib = ndgResources()         
     171        xquery = self.xqueryLib.createXQuery(xQueryType,dir, self._repository_local_id, self._local_id) 
     172       
    167173        # sort out the input ID stuff 
    168174        xquery=xquery.replace('Input_Entry_ID', self.discovery_id) 
     
    176182        # write the query to file, to make it easier to input 
    177183        # NB, running directly at the command line leads to problems with the interpretation of $ characters 
    178         xqFile = "currentQuery.xq" 
     184        xqFile = "currentQuery" + xQueryType + ".xq"  
    179185        FileUtilities.createFile(xqFile, xquery) 
    180186 
     
    191197 
    192198        # now remove the temp xquery file 
    193         status = os.unlink(xqFile) 
     199        '''status = os.unlink(xqFile) 
    194200        if status is not None: 
    195             raise OSError, 'Failed to remove the temporary xquery file, ' + xqFile 
     201            raise OSError, 'Failed to remove the temporary xquery file, ' + xqFile''' 
    196202         
    197203        logging.info("Transform completed successfully") 
  • TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/abstractdocumentingester.py

    r4962 r5167  
    109109                try: 
    110110                        discoveryID = self.getID(filename) 
     111                         
    111112                        record = PostgresRecord(filename, self._NDG_dataProvider, \ 
    112113                                                            self._datacentre_groups, self._datacentre_namespace, \ 
    113114                                                            discoveryID, self._xq, self._datacentre_format) 
    114          
     115                         
     116                        print self._xq 
    115117                        # Now create the data access object to interface to the DB 
    116118                        dao = PostgresDAO(record, pgClient = self.pgc) 
     
    276278                  strftime("%y%m%d_%H%M") + "_originals/" 
    277279                 
    278                 FileUtilities.makeBackUp(self.originals_dir, this_backupdir) 
     280                #FileUtilities.makeBackUp(self.originals_dir, this_backupdir) 
    279281                logging.info("Data backed up - now clearing ingest directories") 
    280282                #Clear out the original harvest records area and discovery dir 
Note: See TracChangeset for help on using the changeset viewer.