Changeset 3860 for TI01-discovery
- Timestamp:
- 07/05/08 15:52:04 (13 years ago)
- Location:
- TI01-discovery/branches/ingestAutomation-upgrade
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/PostgresDAO.py
r3858 r3860 229 229 sqlCmd = "SELECT create_document('" + self._record.filename + "', '" + \ 230 230 self._record.discovery_id + "', '" + self._record.docType + "', '" + \ 231 self._record.originalFormat + "');" 231 self._record.originalFormat + "');" 232 232 233 233 id = db_funcs.runSQLCommand(self._connection, sqlCmd) -
TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/PostgresRecord.py
r3853 r3860 14 14 from ndgUtils.elementtree import cElementTree 15 15 16 import os, sys, logging 17 #from ETxmlView import loadET, nsdumb 16 import os, sys, logging, re 18 17 import molesReadWrite as MRW 19 18 from ndgUtils.ndgObject import ndgObject … … 64 63 self.originalFormat = file(filename).read() 65 64 65 # escape any apostrophes 66 self.originalFormat = self.escapeSpecialCharacters(self.originalFormat) 67 66 68 # initialise the various record fields 67 69 self.db_id = None # the DB ID of the record, for easy reference when it is created … … 76 78 self.getSpatioTemporalData() 77 79 80 81 def escapeSpecialCharacters(self, inputString): 82 ''' 83 Adjust the input string to escape any characters that would interfere with string or DB 84 operations 85 @param inputString: string to correct 86 @return: corrected string 87 ''' 88 return re.sub(r'\'', '\\\'', inputString) 89 78 90 79 91 def doRecordTransforms(self): … … 156 168 157 169 logging.info("Transform completed successfully") 158 159 # f=open(xQueryType + "_doc.xml", 'w') 160 # f.write(output) 161 # f.close() 162 170 163 171 return output 164 172 … … 184 192 # now run the appropriate transform and set the attribute 185 193 setattr(self, "_molesFormat", self.doTransform(xqName)) 194 195 # escape any apostrophes 196 self._molesFormat = self.escapeSpecialCharacters(self._molesFormat) 197 186 198 logging.info("moles document created") 187 199 -
TI01-discovery/branches/ingestAutomation-upgrade/database/ingest_procedures.sql
r3859 r3860 26 26 $$ 27 27 DECLARE 28 db_id integer := -1;28 db_id integer; 29 29 BEGIN 30 30 -- This inserts a new document into the DB
Note: See TracChangeset
for help on using the changeset viewer.