- Timestamp:
- 06/07/12 15:57:19 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/MolesManager/trunk/src/libs/migration/processor/dataEntity.py
r8433 r8445 40 40 calculateHash, findDOIInMigrationDocument,\ 41 41 hasMOBeenProcessed, getAtomDocumentHashByMO, extractTitle, extractSummary,\ 42 createEX_GeographicBoundingBox 42 createEX_GeographicBoundingBox, fromDateStringToPhenomenonTime,\ 43 comparePhenomenonTimes, compareGeographicBoundingBoxes 43 44 from libs.migration.processor.deployment import DeploymentProcessor 44 45 from logging import StreamHandler … … 49 50 getCLValue 50 51 from ea_model.ceda_metadatamodel.ceda_observationcollection.ceda_observationcollection import CEDA_ObservationCollection 52 from MolesManager.moles3epb import getUnifyObservationCollectionPhenomenonTime 51 53 CEDA_TITLE = 'ceda_title' 52 54 … … 80 82 geographicExtent = createEX_GeographicBoundingBox(float(east), float(north), \ 81 83 float(west), float(south)) 82 if self._dataEntityHasBeenProcessed: 83 DataEntityProcessor.log.warn('The _assignGeographicExtent update is skipped because not implemented') 84 return 85 86 self.epbRepo.moles3EPB.updateCedaObject(ceda_observationCollection, {'geographicExtent': geographicExtent}) 84 85 if len(ceda_observationCollection.geographicExtent) == 0 or \ 86 (len(ceda_observationCollection.geographicExtent) > 0 and \ 87 not compareGeographicBoundingBoxes(geographicExtent, \ 88 ceda_observationCollection.geographicExtent[0])): 89 self.epbRepo.moles3EPB.updateCedaObject(ceda_observationCollection, \ 90 {'geographicExtent': geographicExtent}) 87 91 else: 88 92 self._report.append(NoGeographicalExtensionException(self._dataEntityMigration)) 89 93 94 def _assignPhenomenonTime(self, ceda_observationCollection): 95 start, end = getUnifyObservationCollectionPhenomenonTime(ceda_observationCollection) 96 dateString = start 97 if end is not None: 98 dateString = '%s/%s' % (start, end) 99 pt = fromDateStringToPhenomenonTime(dateString) 100 101 if ceda_observationCollection.phenomenonTime is not None \ 102 and (len(ceda_observationCollection.phenomenonTime) == 0 \ 103 or (len(ceda_observationCollection.phenomenonTime) == 1 and \ 104 not comparePhenomenonTimes(ceda_observationCollection.phenomenonTime[0], pt))): 105 self.epbRepo.moles3EPB.updateCedaObject(ceda_observationCollection, {'phenomenonTime': pt}) 90 106 91 107 def _assignDescription(self, ceda_observationCollection): … … 243 259 except Exception as ex: 244 260 self._report.append(ex) 261 245 262 self._assignGeographicExtent(obsColl) 263 self._assignPhenomenonTime(obsColl) 246 264 247 265 return self._report
Note: See TracChangeset
for help on using the changeset viewer.