Changeset 8204


Ignore:
Timestamp:
01/04/12 16:14:56 (8 years ago)
Author:
mnagni
Message:

Incomplete - # 22420: CEDA Observation - language
 http://team.ceda.ac.uk/trac/ceda/ticket/22420

Location:
mauRepo/MolesManager/trunk/src/libs/migration/processor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/commons.py

    r8203 r8204  
    4242from ea_model.iso_19115_2006_metadata_corrigendum.constraint_information.md_legalconstraints import MD_LegalConstraints 
    4343from ea_model.ceda_metadatamodel.ceda_project.ceda_project import CEDA_Project 
     44from ea_model.iso_19115_2006_metadata_corrigendum.metadata_entity_set_information.md_metadata import MD_Metadata 
    4445 
    4546base = '/exist/rest/atoms' 
     
    710711        md_identifier.authority = authority 
    711712    return md_identifier 
     713 
     714def createMD_Metadata(date_stamp, contact, language = None): 
     715    """ 
     716        Creates a new MD_Metadata 
     717        @param date_stamp: a Date instance 
     718        @param contact: a CI_Citation instance 
     719        @param language: a string 
     720    """     
     721    md_metadata = MD_Metadata() 
     722    md_metadata.dateStamp = date_stamp 
     723    md_metadata.contact = contact 
     724    if language: 
     725        md_metadata.language = language     
     726    return md_metadata 
    712727 
    713728def createMO_OnlineResource(linkage, name = None, function = None, description = None, applicationProfile = None): 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py

    r8203 r8204  
    1919    createTM_Period, createCI_Individual, findAccessLinksInMigrationDocument,\ 
    2020    findLinksInDeployment, createMD_LegalConstraints, extractMolesQuality,\ 
    21     createDQ_Element, createDQ_ConformanceResult, findUpdatedDate 
     21    createDQ_Element, createDQ_ConformanceResult, findUpdatedDate,\ 
     22    createMD_Metadata 
    2223from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue 
    2324from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 
     
    364365        moles3Append(ceda_observation, 'identifier', identifier) 
    365366     
     367    def _assignLanguage(self, ceda_observation): 
     368        i_date_stamp = createDate(isoDateStringToTimeDate(datetime.datetime.now())) 
     369        i_contact = createCI_Citation("", date = i_date_stamp) 
     370        ceda_observation.metadata = createMD_Metadata(date_stamp=i_date_stamp, contact = i_contact, language = "English") 
     371     
    366372    def createNewObservation(self): 
    367373        ceda_observation = CEDA_Observation() 
     
    381387        self._assignMoles2Link(ceda_observation) 
    382388        self._assignQuality(ceda_observation)                 
    383         #self._migrationSessions.molesSession.commit() 
    384         #self._commitMoles3() 
    385         #self._commitMigration() 
     389        #self._assignLanguage(ceda_observation)         
    386390        Moles3EPB.addCedaObject(ceda_observation, self._migrationSessions.molesSession, True) 
    387391        MigrationEPB.associateObservationToDeployment(self._deploymentMigration, ceda_observation.id, self._migrationSessions.molesSession, True) 
Note: See TracChangeset for help on using the changeset viewer.