Changeset 4582
- Timestamp:
- 09/12/08 16:59:38 (12 years ago)
- Location:
- exist/trunk/python/ndgUtils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
exist/trunk/python/ndgUtils/lib/granulite.py
r4580 r4582 105 105 106 106 # override CSML/CDML data specified in the granulite file with data input directly 107 self.ingestGranuliteFiles = True 107 108 if csmlOrCdmlFile is not None: 108 109 if not isinstance(csmlOrCdmlFile, cgi.FieldStorage): 109 110 raise ValueError("Specified CSML/CDML file is not a cgi.FieldStorage object") 110 111 self.__addCSMLOrCDMLData(csmlOrCdmlFile.filename, csmlOrCdmlFile.value) 112 self.ingestGranuliteFiles = False 111 113 112 114 if granuleAtom: … … 253 255 if self.PARAMETERS_SECTION in granulite_data: 254 256 self._atom.addParameters(granulite_data[self.PARAMETERS_SECTION]) 255 256 # check for CSML/CDML file input - these data are changed before adding to the granule 257 # - since the file will be stored and referenced in eXist by then 258 if not self._csmlFileName: 259 if self.CSML_SECTION in granulite_data: 260 self.__addCSMLOrCDMLData(granulite_data[self.CSML_SECTION][0], None) 261 262 if not self._cdmlFileName: 263 if self.CDML_SECTION in granulite_data: 264 if self._csmlFileName: 265 raise ValueError("Cannot specify both CDML and CSML file in granulite config file" + \ 266 "\nNB, CSML file is generated from the specified CDML file") 267 268 data = utilities.getTripleData(granulite_data[self.CDML_SECTION][0]) 269 self.__addCSMLOrCDMLData(data[0], None) 270 self._datasetID = data[1] 271 self._cdmlTimeAxis = data[2] 257 258 # NB, if running from the web, ignore the CSML/CDML files specified in the granulite 259 if self.ingestGranuliteFiles: 260 # check for CSML/CDML file input - these data are changed before adding to the granule 261 # - since the file will be stored and referenced in eXist by then 262 if not self._csmlFileName: 263 if self.CSML_SECTION in granulite_data: 264 self.__addCSMLOrCDMLData(granulite_data[self.CSML_SECTION][0], None) 265 266 if not self._cdmlFileName: 267 if self.CDML_SECTION in granulite_data: 268 if self._csmlFileName: 269 raise ValueError("Cannot specify both CDML and CSML file in granulite config file" + \ 270 "\nNB, CSML file is generated from the specified CDML file") 271 272 data = utilities.getTripleData(granulite_data[self.CDML_SECTION][0]) 273 self.__addCSMLOrCDMLData(data[0], None) 274 self._datasetID = data[1] 275 self._cdmlTimeAxis = data[2] 272 276 273 277 if self.DATA_ENTITY_SECTION in granulite_data: -
exist/trunk/python/ndgUtils/models/Atom.py
r4571 r4582 939 939 else: 940 940 self.ME.responsibleParties.append(attributeValue) 941 elif attributeName == "files": 942 self.addUniqueRelatedLinks(attributeValue) 941 943 else: 942 944 setattr(self, attributeName, attributeValue) … … 962 964 authorType= Person.CONTRIBUTOR_TYPE 963 965 obj = Person(personType = authorType) 966 elif attributeName == 'files': 967 obj = Link() 968 objectVals = '%s|%s|%s' \ 969 %(self.VTD.getTermCurrentVocabURL(VTD.METADATA_SOURCE_TERM), objectVals, VTD.METADATA_SOURCE_TERM) 964 970 965 971 if obj:
Note: See TracChangeset
for help on using the changeset viewer.