- Timestamp:
- 11/12/08 09:48:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
exist/trunk/python/ndgUtils/lib/granulite.py
r4585 r4591 91 91 @keyword datasetID: if using a CDML file, specify the ID of the dataset to use 92 92 - otherwise one will be randomly generated 93 @return csmlDoc, cdmlDoc: the CsmlParser.Dataset object with the csml data in and,94 if we're dealing with a CDML doc, return this too95 93 ''' 96 94 logging.info("Creating granulite data model") … … 106 104 # override CSML/CDML data specified in the granulite file with data input directly 107 105 self.ingestGranuliteFiles = True 106 # NB, empty FieldStorage fields end up as empty strings 108 107 if csmlOrCdmlFile is not None: 109 if not isinstance(csmlOrCdmlFile, cgi.FieldStorage):110 raise ValueError("Specified CSML/CDML file is not a cgi.FieldStorage object")111 self.__addCSMLOrCDMLData(csmlOrCdmlFile.filename, csmlOrCdmlFile.value)112 108 self.ingestGranuliteFiles = False 109 if csmlOrCdmlFile != '': 110 if not isinstance(csmlOrCdmlFile, cgi.FieldStorage): 111 raise ValueError("Specified CSML/CDML file is not a cgi.FieldStorage object") 112 self.__addCSMLOrCDMLData(csmlOrCdmlFile.filename, csmlOrCdmlFile.value) 113 113 114 114 115 if granuleAtom: … … 411 412 fileName = fileName.split('\\')[-1] 412 413 413 csmlDoc =self._atom.addCSMLData(self._csmlFileName, \414 414 self._atom.addCSMLData(self._csmlFileName, \ 415 self._csmlContent, useCSMLID = self.useCSMLID) 415 416 logging.info("Adding CSML file to eXist") 416 self._eXist.createOrUpdateEXistFile( csmlDoc.toPrettyXML(), \417 self._eXist.createOrUpdateEXistFile(self._csmlContent, \ 417 418 eXistConnector.NDG_A_COLLECTION_PATH + \ 418 419 self._atom.ME.providerID + '/', \
Note: See TracChangeset
for help on using the changeset viewer.