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

updates to allow oai_document_ingester to work

File:
1 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") 
Note: See TracChangeset for help on using the changeset viewer.