Changeset 8247 for mauRepo


Ignore:
Timestamp:
18/04/12 08:42:03 (8 years ago)
Author:
mnagni
Message:

Incomplete - # 22428: CEDA Project - observationCollection
 http://team.ceda.ac.uk/trac/ceda/ticket/22428
Complete - # 22410: CEDA Observation - resultAccumulation
 http://team.ceda.ac.uk/trac/ceda/ticket/22410
Incomplete - # 22386: CEDA Observation - title
 http://team.ceda.ac.uk/trac/ceda/ticket/22386

Location:
mauRepo/MolesManager/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/ascore/asenumeration.py

    r8088 r8247  
    114114        return ASEnumType(cls) 
    115115     
    116 ''' 
     116 
    117117class EmployeeType(ASEnumeration): 
    118118    part_time = "part_time", "Part Time" 
     
    120120    contractor = "contractor", "Contractor" 
    121121 
     122''' 
    122123emp = EmployeeType() 
    123 print (emp)     
    124 '''     
     124print (emp) 
     125print EmployeeType.values() 
     126print EmployeeType.contractor 
     127print EmployeeType.from_string('mau') 
     128print EmployeeType.from_string('contractor') 
     129''' 
     130     
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/commons.py

    r8245 r8247  
    4444from ea_model.ceda_metadatamodel.ceda_utilities.ceda_review import CEDA_Review 
    4545from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_responsibleparty import CI_ResponsibleParty 
     46from ea_model.iso_19115_2006_metadata_corrigendum.maintenance_information.md_maintenancefrequencycode import MD_MaintenanceFrequencyCode 
    4647 
    4748base = '/exist/rest/atoms' 
     
    232233    quality = resourceXML.find('%sentity/%smolesISO/%squality' % (molesNS, molesNS, molesNS)) 
    233234    return _returnNotNoneText(quality) 
     235 
     236def extractUpdateFrequency(dataEntityMigration): 
     237    resourceXML = getAtomDocumentByMO(dataEntityMigration) 
     238    update_frequency = resourceXML.find('%sentity/%smolesISO/%supdateFrequency' % (molesNS, molesNS, molesNS)) 
     239    return _returnNotNoneText(update_frequency) 
    234240 
    235241def extractContent(dataEntityMigration): 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/dataEntity.py

    r8245 r8247  
    1515    hasAtomDocumentSameHash, createCI_Citation, createCI_Date, findPublishedDate,\ 
    1616    isoDateTimeStringToTimeDate, findUpdatedDate, createDate,\ 
    17     calculateHash 
     17    calculateHash, extractUpdateFrequency 
    1818from libs.migration.processor.deployment import DeploymentProcessor 
    1919from ea_model.moles3_4.utilities.mo_publicationstatevalue import MO_PublicationStateValue 
     
    2222from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_datetypecode import CI_DateTypeCode 
    2323from MolesManager.ceda_guid import CedaGUID 
     24from ea_model.iso_19115_2006_metadata_corrigendum.maintenance_information.md_maintenancefrequencycode import MD_MaintenanceFrequencyCode 
    2425 
    2526class DataEntityProcessor(object): 
     
    116117        try: 
    117118            ceda_observation = deProcessor.process() 
     119            if ceda_observation.resultAccumulation is None: 
     120                    updateFrequency = extractUpdateFrequency(self._dataEntityMigration) 
     121                    if updateFrequency: 
     122                        ceda_observation.resultAccumulation = MD_MaintenanceFrequencyCode.from_string(updateFrequency) 
    118123            Moles3EPB.addObservationToObservationCollection(cedaObservationCollection, ceda_observation, self.migrationSessions.molesSession, True)             
    119124            MigrationEPB.associateObservationCollectionToDataEntity(deploymentMigration, \ 
     
    157162        for deploymentMigration in deploymentMigrations: 
    158163            try: 
    159                 ceda_observation = self._processDeploymentMigration(deploymentMigration, cedaObservationCollection) 
     164                ceda_observation = self._processDeploymentMigration(deploymentMigration, cedaObservationCollection)                 
    160165                if howManydm == 1: 
    161166                    collection_identifier = Moles3EPB.extractCollectionIdentifierByTitle(MD_CODE_MOLES2_CITATION, self.migrationSessions.molesSession) 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py

    r8245 r8247  
    2121    createDQ_Element, createDQ_ConformanceResult, findUpdatedDate,\ 
    2222    createMD_Metadata, createMO_OnlineResource, createCEDA_Review, calculateHash,\ 
    23     createCI_ResponsibleParty 
     23    createCI_ResponsibleParty, extractUpdateFrequency 
    2424from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue 
    2525from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 
     
    4646from MolesManager.ceda_guid import CedaGUID 
    4747from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_rolecode import CI_RoleCode 
     48from ea_model.iso_19115_2006_metadata_corrigendum.maintenance_information.md_maintenancefrequencycode import MD_MaintenanceFrequencyCode 
    4849 
    4950class DeploymentProcessor(object): 
     
    200201            doc_title = extractTitle(self._dataEntityMigration)             
    201202        auth = createCI_Citation(title = 'ceda_title')                   
    202         Moles3EPB.addIdentifierToObservation(createMD_Identifier(code = doc_title, authority = auth), \ 
    203                                              observation, self._migrationSessions.molesSession) 
     203        identifier = createMD_Identifier(code = doc_title, authority = auth) 
     204        observation.identifier.append(identifier) 
    204205 
    205206    def _assignDescription(self, observation): 
     
    418419                              reviewStatus=CEDA_ReviewStatusValue.cl_required))    
    419420     
     421    def _assignUpdateFrequency(self, ceda_observation): 
     422        updateFrequency = extractUpdateFrequency(self._deploymentMigration) 
     423        if updateFrequency: 
     424            ceda_observation.resultAccumulation = MD_MaintenanceFrequencyCode.from_string(updateFrequency) 
     425     
    420426    def _create(self): 
    421427        ceda_observation = CEDA_Observation() 
     
    436442        self._assignQuality(ceda_observation)                 
    437443        self._assignInternalReview(ceda_observation)         
    438         self._assignLanguage(ceda_observation)                 
     444        self._assignLanguage(ceda_observation) 
     445        self._assignUpdateFrequency(ceda_observation)                         
    439446        Moles3EPB.addCedaObject(ceda_observation, self._migrationSessions.molesSession, True) 
    440447         
Note: See TracChangeset for help on using the changeset viewer.