Ignore:
Timestamp:
08/08/12 14:52:24 (9 years ago)
Author:
mnagni
Message:

Incomplete - # 22534: Add versiojn number to the gui page
 http://team.ceda.ac.uk/trac/ceda/ticket/22534

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/cedaMoles/libs/migration/processor/deployment.py

    r8490 r8496  
    3131@author: Maurizio Nagni 
    3232''' 
    33 from cedaMoles.libs.migration.processor.commons import findMolesLineage, \ 
    34     createMO_ResponsiblePartyInfo,\ 
    35     DO_BADC, DO_NEODC, findAuthorsInResource, \ 
    36     createMD_Identifier, extractSummary, extractQuality, \ 
    37     hasMOSameHash, getAtomDocumentHashByMO, extractTitle,\ 
    38         createCEDA_Result,\ 
    39     createEX_GeographicBoundingBox, extractGeographicExtentInMigrationDocument, \ 
    40     findDownloadLinksInMigrationDocument,\ 
    41     extractContent, createCI_Citation, createCI_Date, createDate,\ 
    42     createTM_Position, createTM_Instant, extractMolesCreationDate,\ 
    43     createDateTime, isoDateTimeStringToTimeDate, extractMolesProviderID,\ 
    44     DO_UKSSDC, createMO_Organization,\ 
    45     createCI_Contact, createCI_Address, createCI_OnlineResource,\ 
    46     createCI_Telephone, extractMolesTemporalRange,\ 
    47     findAccessLinksInMigrationDocument,\ 
    48     findLinksInDeployment, createMD_LegalConstraints,\ 
    49     createDQ_Element, createDQ_ConformanceResult, findUpdatedDate,\ 
    50     createMD_Metadata, createMO_OnlineResource, createCEDA_Review, calculateHash,\ 
    51     createCI_ResponsibleParty, extractUpdateFrequency,\ 
    52     findLinksInMigrationDocument, findSubTypeInDPT, extractMolesPublishedDate,\ 
    53     createMD_Keywords, hasMOBeenProcessed, createMO_Individual,\ 
    54     fromDateStringToPhenomenonTime, \ 
    55     comparePhenomenonTimes, compareGeographicBoundingBoxes 
     33from cedaMoles.libs.migration.processor.commons import find_moles_lineage, \ 
     34    create_mo_responsible_party_info,\ 
     35    DO_BADC, DO_NEODC, find_authors_in_resource, \ 
     36    create_md_identifier, extract_summary, extract_quality, \ 
     37    has_mo_same_hash, get_atom_document_hash_by_mo, extract_title,\ 
     38        create_ceda_result,\ 
     39    create_ex_geographic_boundingbox, extract_ge_in_migration_doc, \ 
     40    find_download_links_in_migration_document,\ 
     41    extract_content, create_ci_citation, create_ci_date, create_date,\ 
     42    create_tm_position, create_tm_instant, extract_moles_creation_date,\ 
     43    create_datetime, isoDateTimeStringToTimeDate, extract_moles_provider_id,\ 
     44    DO_UKSSDC, create_mo_organization,\ 
     45    create_ci_contact, create_ci_address, create_ci_onlineresource,\ 
     46    create_ci_telephone, extract_moles_temporal_range,\ 
     47    find_access_links_in_migration_document,\ 
     48    find_links_in_deployment, create_md_legal_constraints,\ 
     49    create_dq_element, create_dq_conformance_result, find_updated_date,\ 
     50    create_md_metadata, create_mo_online_resource, create_ceda_review, calculate_hash,\ 
     51    create_ci_responsible_party, extract_update_frequency,\ 
     52    find_links_in_migration_document, find_subtype_in_dpt, extract_moles_published_date,\ 
     53    create_md_keywords, has_mo_been_processed, create_mo_individual,\ 
     54    from_date_string_to_pt, \ 
     55    compare_phenomenon_times, compareGeographicBoundingBoxes 
    5656from cedaMoles.libs.epb import EPB 
    5757from cedaMoles.libs.migration.processor.deployment_data import DeploymentDataProcessor 
     
    112112        self._deployment_migration = deployment_migration 
    113113        self.epbRepo = epbRepo 
    114         self._dataEntityHasSameHash = hasMOSameHash(self._data_entity_migration) 
    115         self._deploymentHasSameHash = hasMOSameHash(self._deployment_migration) 
    116         self._deploymentHasBeenProcessed = hasMOBeenProcessed(self._deployment_migration) 
     114        self._dataEntityHasSameHash = has_mo_same_hash(self._data_entity_migration) 
     115        self._deploymentHasSameHash = has_mo_same_hash(self._deployment_migration) 
     116        self._deploymentHasBeenProcessed = has_mo_been_processed(self._deployment_migration) 
    117117        self._report = [] 
    118118 
     
    139139        try: 
    140140            if tmp_auth['author'] == 'unknown': 
    141                 doc_authors = findAuthorsInResource(self._data_entity_migration) 
     141                doc_authors = find_authors_in_resource(self._data_entity_migration) 
    142142                tmp_auth = authors[doc_authors['authors']] 
    143143             
     
    154154            for item in tmp_auth['co_author_type']:            
    155155                if (tmp_auth['co_author'][tmp_auth['co_author_type'].index(item)] == 'unknown'): 
    156                     doc_authors = findAuthorsInResource(self._data_entity_migration) 
     156                    doc_authors = find_authors_in_resource(self._data_entity_migration) 
    157157                    tmp_auth = authors[doc_authors['contributors']] 
    158158                    break 
     
    189189             
    190190            py_date = None 
    191             cited_responsible = createCI_ResponsibleParty(role=getCLValue(CI_RoleCode.cl_publisher), \ 
     191            cited_responsible = create_ci_responsible_party(role=getCLValue(CI_RoleCode.cl_publisher), \ 
    192192                                                              organizationName='NERC - British Atmospheric Data Centre') 
    193193            if doi.upper() == '10.5285/E8F43A51-0198-4323-A926-FE69225D57DD': 
     
    201201                 
    202202            if py_date:    
    203                 dt = createDate(py_date) 
    204                 ci_date = createCI_Date(getCLValue(CI_DateTypeCode.cl_publication), date = dt) 
    205                 i_authority = createCI_Citation("DOI", date = ci_date) 
    206                 identifier = createMD_Identifier(code = doi, authority=i_authority) 
     203                dt = create_date(py_date) 
     204                ci_date = create_ci_date(getCLValue(CI_DateTypeCode.cl_publication), date = dt) 
     205                i_authority = create_ci_citation("DOI", date = ci_date) 
     206                identifier = create_md_identifier(code = doi, authority=i_authority) 
    207207                self.epbRepo.moles3EPB.updateCedaObject(observation, {'identifier': identifier}) 
    208208                DeploymentProcessor.log.info("DOI: %s" % (doi))                                   
     
    212212            return 
    213213         
    214         provider_id = extractMolesProviderID(self._deployment_migration) 
     214        provider_id = extract_moles_provider_id(self._deployment_migration) 
    215215        i_keywords = [] 
    216216        if provider_id == DO_BADC: 
     
    221221            #Is a first time process? 
    222222            if not self._deploymentHasBeenProcessed:  
    223                 ceda_observation.keywords.append(createMD_Keywords(i_keywords)) 
     223                ceda_observation.keywords.append(create_md_keywords(i_keywords)) 
    224224            else: 
    225225                ceda_observation.keywords.keyword = i_keywords           
     
    229229            return 
    230230         
    231         data_lineage = findMolesLineage(self._data_entity_migration) 
     231        data_lineage = find_moles_lineage(self._data_entity_migration) 
    232232        if data_lineage is None: 
    233233            raise NoDataLineage(self._data_entity_migration) 
     
    241241 
    242242        i_sources = []                 
    243         download = findDownloadLinksInMigrationDocument(self._deployment_migration) 
     243        download = find_download_links_in_migration_document(self._deployment_migration) 
    244244        content = None 
    245245        if len(download) == 0: 
    246             download = findDownloadLinksInMigrationDocument(self._data_entity_migration) 
    247             content = extractContent(self._data_entity_migration) 
     246            download = find_download_links_in_migration_document(self._data_entity_migration) 
     247            content = extract_content(self._data_entity_migration) 
    248248        else: 
    249             content = extractContent(self._deployment_migration) 
     249            content = extract_content(self._deployment_migration) 
    250250        for dwn in download: 
    251251            int_description = None 
     
    256256            if dwn['href'].startswith('http://badc.nerc.ac.uk/browse') or dwn['href'].startswith('http://neodc.nerc.ac.uk/browse'): 
    257257                int_description = "download directly from archive"     
    258             i_sources.append(createMO_OnlineResource(linkage = dwn['href'], name = dwn['title'], \ 
     258            i_sources.append(create_mo_online_resource(linkage = dwn['href'], name = dwn['title'], \ 
    259259                                                   function = getCLValue(CI_OnLineFunctionCode.cl_download), \ 
    260260                                                   description = int_description, applicationProfile = int_applicationProfile)) 
     
    275275 
    276276        if not self._deploymentHasBeenProcessed:                      
    277             observation.result = createCEDA_Result(i_category, i_logical_path, source = i_sources) 
     277            observation.result = create_ceda_result(i_category, i_logical_path, source = i_sources) 
    278278            return  
    279279         
     
    290290            return 
    291291            
    292         provider_id = extractMolesProviderID(self._deployment_migration) 
     292        provider_id = extract_moles_provider_id(self._deployment_migration) 
    293293        party = None 
    294294        if provider_id == DO_BADC: 
    295295            i_linkage = 'http://badc.rl.ac.uk' 
    296             i_onlineResources = createCI_OnlineResource(linkage = i_linkage, name = 'British Atmospheric Data Centre Website') 
    297             i_address = createCI_Address(deliveryPoint = ['British Atmospheric Data Centre, STFC Rutherford Appleton Laboratory'], \ 
     296            i_onlineResources = create_ci_onlineresource(linkage = i_linkage, name = 'British Atmospheric Data Centre Website') 
     297            i_address = create_ci_address(deliveryPoint = ['British Atmospheric Data Centre, STFC Rutherford Appleton Laboratory'], \ 
    298298                                         electronicMailAddress=['badc@rl.ac.uk'], postalCode='OX11 0QX', country='UK', city='Harwell Oxford')                                    
    299             i_phone = createCI_Telephone(voice=['+44(0)1235 446432'])                                   
    300             contact = createCI_Contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                        
    301             party = createMO_Organization(name = "NERC - British Atmospheric Data Centre", contactInfo = [contact]) 
     299            i_phone = create_ci_telephone(voice=['+44(0)1235 446432'])                                   
     300            contact = create_ci_contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                        
     301            party = create_mo_organization(name = "NERC - British Atmospheric Data Centre", contactInfo = [contact]) 
    302302        elif provider_id == DO_NEODC: 
    303303            i_linkage = 'http://www.neodc.rl.ac.uk' 
    304             i_onlineResources = createCI_OnlineResource(linkage = i_linkage, name = 'NERC Earth Observation Data Centre website') 
    305             i_address = createCI_Address(deliveryPoint = ['NERC - Earth Observation Data Centre, STFC Rutherford Appleton Laboratory'], \ 
     304            i_onlineResources = create_ci_onlineresource(linkage = i_linkage, name = 'NERC Earth Observation Data Centre website') 
     305            i_address = create_ci_address(deliveryPoint = ['NERC - Earth Observation Data Centre, STFC Rutherford Appleton Laboratory'], \ 
    306306                                         electronicMailAddress=['neodc@rl.ac.uk'], postalCode='OX11 0QX', country='UK', city='Harwell Oxford')                                    
    307             i_phone = createCI_Telephone(voice=['+44(0)1235 446432'])                                  
    308             contact = createCI_Contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                        
    309             party = createMO_Organization(name = 'NERC - Earth Observation Data Centre', contactInfo = [contact]) 
     307            i_phone = create_ci_telephone(voice=['+44(0)1235 446432'])                                  
     308            contact = create_ci_contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                        
     309            party = create_mo_organization(name = 'NERC - Earth Observation Data Centre', contactInfo = [contact]) 
    310310        elif provider_id == DO_UKSSDC: 
    311311            i_linkage = 'http://www.ukssdc.rl.ac.uk' 
    312             i_onlineResources = createCI_OnlineResource(linkage = i_linkage, name = 'UK Solar System Data Centre website') 
    313             i_address = createCI_Address(deliveryPoint = ['UK Solar System Data Centre, STFC Rutherford Appleton Laboratory'], \ 
     312            i_onlineResources = create_ci_onlineresource(linkage = i_linkage, name = 'UK Solar System Data Centre website') 
     313            i_address = create_ci_address(deliveryPoint = ['UK Solar System Data Centre, STFC Rutherford Appleton Laboratory'], \ 
    314314                                         electronicMailAddress=['support@rl.ac.uk'], postalCode='OX11 0QX', country='UK', city='Harwell Oxford')                                    
    315             i_phone = createCI_Telephone(voice=['+44(0)1235 445173'])                                  
    316             contact = createCI_Contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                        
    317             party = createMO_Organization(name = 'NERC - UK Solar System Data Centre', contactInfo = [contact]) 
     315            i_phone = create_ci_telephone(voice=['+44(0)1235 445173'])                                  
     316            contact = create_ci_contact(phone=i_phone, address=i_address, onlineResource=i_onlineResources)                        
     317            party = create_mo_organization(name = 'NERC - UK Solar System Data Centre', contactInfo = [contact]) 
    318318         
    319319        if party and not self._deploymentHasBeenProcessed: 
    320320            newrp = [] 
    321             newrp.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_publisher), [party])) 
    322             newrp.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_custodian), deepcopy([party]))) 
    323             newrp.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_distributor), deepcopy([party]))) 
    324             newrp.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_pointofcontact), deepcopy([party]))) 
    325             newrp.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_metadataowner), deepcopy([party]))) 
    326             newrp.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_curator), deepcopy([party]))) 
     321            newrp.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_publisher), [party])) 
     322            newrp.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_custodian), deepcopy([party]))) 
     323            newrp.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_distributor), deepcopy([party]))) 
     324            newrp.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_pointofcontact), deepcopy([party]))) 
     325            newrp.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_metadataowner), deepcopy([party]))) 
     326            newrp.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_curator), deepcopy([party]))) 
    327327            self.epbRepo.moles3EPB.updateCedaObject(observation, {'relatedParty': newrp})             
    328328            return         
     
    333333            return 
    334334                 
    335         doc_quality = extractQuality(self._data_entity_migration) 
    336         doc_date = findUpdatedDate(self._data_entity_migration) 
     335        doc_quality = extract_quality(self._data_entity_migration) 
     336        doc_date = find_updated_date(self._data_entity_migration) 
    337337        ci_dates = []             
    338338        if doc_date: 
    339             i_date = createDate(isoDateTimeStringToTimeDate(doc_date))                 
    340             ci_dates.append(createCI_Date(getCLValue(CI_DateTypeCode.cl_revision), date = i_date))             
     339            i_date = create_date(isoDateTimeStringToTimeDate(doc_date))                 
     340            ci_dates.append(create_ci_date(getCLValue(CI_DateTypeCode.cl_revision), date = i_date))             
    341341        else: 
    342             i_date = createDate(isoDateTimeStringToTimeDate(datetime.datetime.now())) 
    343             ci_dates.append(createCI_Date(getCLValue(CI_DateTypeCode.cl_creation), date = i_date)) 
    344  
    345         i_specification = createCI_Citation(title = "CEDA Data Quality Statement", date=ci_dates) 
    346         i_dq_result = createDQ_ConformanceResult(doc_quality, True, i_specification) 
    347         i_quality_element = createDQ_Element(i_dq_result) 
     342            i_date = create_date(isoDateTimeStringToTimeDate(datetime.datetime.now())) 
     343            ci_dates.append(create_ci_date(getCLValue(CI_DateTypeCode.cl_creation), date = i_date)) 
     344 
     345        i_specification = create_ci_citation(title = "CEDA Data Quality Statement", date=ci_dates) 
     346        i_dq_result = create_dq_conformance_result(doc_quality, True, i_specification) 
     347        i_quality_element = create_dq_element(i_dq_result) 
    348348         
    349349        if not self._deploymentHasBeenProcessed:      
     
    356356            return 
    357357         
    358         description = extractSummary(self._deployment_migration) 
     358        description = extract_summary(self._deployment_migration) 
    359359        if description is None: 
    360             description = extractSummary(self._data_entity_migration) 
     360            description = extract_summary(self._data_entity_migration) 
    361361             
    362362        if description: 
     
    367367            return 
    368368                      
    369         doc_title = extractTitle(self._deployment_migration) 
     369        doc_title = extract_title(self._deployment_migration) 
    370370        if doc_title is None: 
    371             doc_title = extractTitle(self._data_entity_migration) 
     371            doc_title = extract_title(self._data_entity_migration) 
    372372         
    373373        if doc_title.startswith('deployment_') or doc_title.startswith('Deployment_'): 
    374             links = findLinksInMigrationDocument(self._deployment_migration) 
     374            links = find_links_in_migration_document(self._deployment_migration) 
    375375            dptList = links['DPT'] 
    376376            if links.has_key('DPT'): 
     
    382382                        doc_title += ' and ' + dptList[-1] 
    383383                                                         
    384             links = findLinksInDeployment(self._deployment_migration) 
     384            links = find_links_in_deployment(self._deployment_migration) 
    385385            if links.has_key('OBS'): 
    386386                obsList = [] 
    387387                for obs in links['OBS']: 
    388388                    observationStation = self.epbRepo.migrationEPB.getDeploymentDataMigrationByName(self._deployment_migration, obs + '.atom') 
    389                     obsList.append((extractTitle(observationStation), findSubTypeInDPT(observationStation))) 
     389                    obsList.append((extract_title(observationStation), find_subtype_in_dpt(observationStation))) 
    390390                 
    391391                if obsList[0][1] in ['stationary platform' ,'moving platform', 'ship','aircraft','satellite','computer']: 
     
    404404                    activity = self.epbRepo.migrationEPB.getDeploymentDataMigrationByName(self._deployment_migration, link + '.atom')                     
    405405      
    406                     projSubType = findSubTypeInDPT(activity) 
    407                     doc_title += ' for the ' + extractTitle(activity) 
     406                    projSubType = find_subtype_in_dpt(activity) 
     407                    doc_title += ' for the ' + extract_title(activity) 
    408408                    if projSubType[0:14] == 'dgActivityData': 
    409409                        doc_title += ' ' + projSubType[14:] 
     
    413413            if doc_title[0:10] != 'Data from' : 
    414414                doc_title = "Data from " + doc_title             
    415         auth = createCI_Citation(title = 'ceda_title')                   
    416         identifier = createMD_Identifier(code = doc_title, authority = auth) 
     415        auth = create_ci_citation(title = 'ceda_title')                   
     416        identifier = create_md_identifier(code = doc_title, authority = auth) 
    417417         
    418418        if not self._deploymentHasBeenProcessed:  
     
    425425            return   
    426426         
    427         ge = extractGeographicExtentInMigrationDocument(self._deployment_migration)         
     427        ge = extract_ge_in_migration_doc(self._deployment_migration)         
    428428        if ge is None: 
    429             ge = extractGeographicExtentInMigrationDocument(self._data_entity_migration) 
     429            ge = extract_ge_in_migration_doc(self._data_entity_migration) 
    430430         
    431431        if ge is None: 
     
    433433            self._report.append(NoGeographicalExtensionException(self._data_entity_migration)) 
    434434         
    435         geographicExtent = createEX_GeographicBoundingBox(ge['east'], ge['north'], ge['west'], ge['south']) 
     435        geographicExtent = create_ex_geographic_boundingbox(ge['east'], ge['north'], ge['west'], ge['south']) 
    436436 
    437437        if len(observation.geographicExtent) == 0 or \ 
     
    445445            return   
    446446         
    447         creation_date = extractMolesPublishedDate(self._deployment_migration) 
     447        creation_date = extract_moles_published_date(self._deployment_migration) 
    448448        if creation_date is None: 
    449             creation_date = extractMolesCreationDate(self._deployment_migration) 
     449            creation_date = extract_moles_creation_date(self._deployment_migration) 
    450450        py_datetime = isoDateTimeStringToTimeDate(creation_date) 
    451         date_time = createDateTime(py_datetime)     
    452         tm_position = createTM_Position(dateTime8601 = date_time) 
     451        date_time = create_datetime(py_datetime)     
     452        tm_position = create_tm_position(dateTime8601 = date_time) 
    453453         
    454454        if not self._deploymentHasBeenProcessed:  
    455             observation.resultTime = createTM_Instant(tm_position) 
     455            observation.resultTime = create_tm_instant(tm_position) 
    456456            return         
    457457        #Still have to update observation.geographicExtent 
     
    461461            return   
    462462               
    463         doc_phenomenon_time = extractMolesTemporalRange(self._deployment_migration)  
    464         pt = fromDateStringToPhenomenonTime(doc_phenomenon_time)     
    465          
    466         if not self._deploymentHasBeenProcessed or not comparePhenomenonTimes(pt,observation.phenomenonTime): 
     463        doc_phenomenon_time = extract_moles_temporal_range(self._deployment_migration)  
     464        pt = from_date_string_to_pt(doc_phenomenon_time)     
     465         
     466        if not self._deploymentHasBeenProcessed or not compare_phenomenon_times(pt,observation.phenomenonTime): 
    467467            self.epbRepo.moles3EPB.updateCedaObject(observation, {'phenomenonTime': pt}) 
    468468        #Now update phenomenonTime but has to remove the previous phenomenonTime                 
     
    472472            return  
    473473         
    474         access_link = findAccessLinksInMigrationDocument(self._deployment_migration) 
    475         dwn_link = findDownloadLinksInMigrationDocument(self._deployment_migration) 
     474        access_link = find_access_links_in_migration_document(self._deployment_migration) 
     475        dwn_link = find_download_links_in_migration_document(self._deployment_migration) 
    476476        if len(access_link) == 0: 
    477             access_link = findAccessLinksInMigrationDocument(self._data_entity_migration)  
     477            access_link = find_access_links_in_migration_document(self._data_entity_migration)  
    478478 
    479479        i_accessConstraints = [] 
     
    483483        if len(access_link) == 0: 
    484484            if len(dwn_link) == 0: 
    485                 dwn_link = findDownloadLinksInMigrationDocument(self._data_entity_migration) 
     485                dwn_link = find_download_links_in_migration_document(self._data_entity_migration) 
    486486                if dwn_link and len(dwn_link) == 1:                 
    487487                    i_use_limitation.append("These data are open access and available through %s." % (dwn_link[0]['href']) ) 
    488488                    #i_accessConstraints.append(MD_RestrictionCode.cl_) 
    489                     observation.permission = createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 
     489                    observation.permission = create_md_legal_constraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 
    490490        else: 
    491491            if access_link and len(access_link) == 1: 
    492492                i_use_limitation.append("Access to these data is restricted. To obtain access please apply for access at: %s" % (access_link[0]['href'])) 
    493493                i_accessConstraints.append(getCLValue(MD_RestrictionCode.cl_restricted)) 
    494                 observation.permission = createMD_LegalConstraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 
     494                observation.permission = create_md_legal_constraints(useLimitation = i_use_limitation, accessConstrains = i_accessConstraints) 
    495495                 
    496496        if not self._deploymentHasBeenProcessed: 
     
    499499                                     
    500500        '''                                 
    501         contentDict = extractContent(self._deployment_migration) 
     501        contentDict = extract_content(self._deployment_migration) 
    502502        if not contentDict.has_key('access-restricted'): 
    503             contentDict = extractContent(self._data_entity_migration) 
     503            contentDict = extract_content(self._data_entity_migration) 
    504504        '''             
    505505 
     
    510510        i_code = 'http://badc.nerc.ac.uk/view/%s__ATOM__%s' % (self._deployment_migration.doc_owner, self._deployment_migration.doc_name) 
    511511        i_code = i_code.replace('.atom', '') 
    512         #i_code = buildExistDocPath(self._deployment_migration.doc_status, DT_DEPLOYMENTS, self._deployment_migration.doc_owner, self._deployment_migration.doc_name) 
    513         i_authority = createCI_Citation('moles2url') 
    514         identifier = createMD_Identifier(code = i_code, authority = i_authority) 
     512        i_authority = create_ci_citation('moles2url') 
     513        identifier = create_md_identifier(code = i_code, authority = i_authority) 
    515514        if not self._deploymentHasBeenProcessed:              
    516515            ceda_observation.identifier.append(identifier) 
     
    521520            return 
    522521                
    523         i_party = createMO_Individual(name = 'Graham Parton') 
    524         i_reviewer = createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_processor), [i_party]) 
     522        i_party = create_mo_individual(name = 'Graham Parton') 
     523        i_reviewer = create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_processor), [i_party]) 
    525524        ceda_observation.metadataManagement.append( \ 
    526             createCEDA_Review(reviewer=i_reviewer, reviewFrequency=getCLValue(CEDA_ReviewFrequencyValue.cl_yearly), \ 
     525            create_ceda_review(reviewer=i_reviewer, reviewFrequency=getCLValue(CEDA_ReviewFrequencyValue.cl_yearly), \ 
    527526                              reviewStatus=getCLValue(CEDA_ReviewStatusValue.cl_required)))   
    528527 
     
    531530            return 
    532531         
    533         i_date_stamp = createDate(datetime.datetime.now()) 
     532        i_date_stamp = create_date(datetime.datetime.now()) 
    534533        #i_contact = createCI_Citation("", date = i_date_stamp) 
    535         i_contact = createCI_ResponsibleParty(getCLValue(CI_RoleCode.cl_user)) 
    536         ceda_observation.metadata = createMD_Metadata(date_stamp=i_date_stamp, contact = [i_contact], language = "English") 
     534        i_contact = create_ci_responsible_party(getCLValue(CI_RoleCode.cl_user)) 
     535        ceda_observation.metadata = create_md_metadata(date_stamp=i_date_stamp, contact = [i_contact], language = "English") 
    537536                         
    538537    def _processResultAccumulation(self, ceda_observation):   
     
    540539            return                       
    541540 
    542             updateFrequency = extractUpdateFrequency(self._data_entity_migration) 
     541            updateFrequency = extract_update_frequency(self._data_entity_migration) 
    543542            if updateFrequency: 
    544543                resultAccumulation = MD_MaintenanceFrequencyCode.from_string(updateFrequency) 
     
    557556         
    558557        whereAreAuthors = self._deployment_migration         
    559         doc_authors = findAuthorsInResource(self._deployment_migration)         
     558        doc_authors = find_authors_in_resource(self._deployment_migration)         
    560559        if doc_authors['authors'] in [DO_BADC, DO_NEODC]: 
    561             doc_authors = findAuthorsInResource(self._data_entity_migration) 
     560            doc_authors = find_authors_in_resource(self._data_entity_migration) 
    562561            whereAreAuthors = self._data_entity_migration  
    563562                 
     
    569568 
    570569            if len(ret['ind']) > 0: 
    571                 i_party = createMO_Individual(name = ret['ind'][0]) 
    572                 observation.relatedParty.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_author), [i_party]))                  
     570                i_party = create_mo_individual(name = ret['ind'][0]) 
     571                observation.relatedParty.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_author), [i_party]))                  
    573572            if len(ret['org']) > 0: 
    574                 i_party = createMO_Organization(name = ret['org'][0]) 
    575                 observation.relatedParty.append(createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_author), [i_party])) 
     573                i_party = create_mo_organization(name = ret['org'][0]) 
     574                observation.relatedParty.append(create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_author), [i_party])) 
    576575             
    577576            if len(ret['ind']) > 1: 
     
    597596        i_party = [] 
    598597        for nm in ind_names: 
    599             i_party.append(createMO_Individual(name = nm)) 
     598            i_party.append(create_mo_individual(name = nm)) 
    600599                 
    601600        for nm in org_names: 
    602             i_party.append(createMO_Organization(name = nm)) 
     601            i_party.append(create_mo_organization(name = nm)) 
    603602             
    604603        if i_party: 
    605604            if not self._deploymentHasBeenProcessed: 
    606                 rp = createMO_ResponsiblePartyInfo(getCLValue(MM_RoleValue.cl_coinvestigator), i_party) 
     605                rp = create_mo_responsible_party_info(getCLValue(MM_RoleValue.cl_coinvestigator), i_party) 
    607606                self.epbRepo.moles3EPB.updateCedaObject(observation, {'relatedParty': rp}) 
    608607                return 
     
    629628         
    630629        #Is a first time process? 
    631         if not hasMOBeenProcessed(self._deployment_migration): 
     630        if not has_mo_been_processed(self._deployment_migration): 
    632631            ceda_observation.publicationState = getCLValue(MM_ObservationPublicationStateValue.cl_working)           
    633             docHash = getAtomDocumentHashByMO(self._data_entity_migration) 
     632            docHash = get_atom_document_hash_by_mo(self._data_entity_migration) 
    634633            self.epbRepo.moles3EPB.persistInstance(ceda_observation)         
    635634            self.epbRepo.migrationEPB.updateMigrationObject(self._deployment_migration, \ 
     
    640639        if self.epbRepo.moles3EPB.retrieveGUIDFromInstance(ceda_observation) is None:        
    641640            ceda_guid = CedaGUID() 
    642             ceda_guid.id = calculateHash(self._deployment_migration.depl_id) 
     641            ceda_guid.id = calculate_hash(self._deployment_migration.depl_id) 
    643642            ceda_guid.ceda_observation = ceda_observation.id 
    644643            self.epbRepo.moles3EPB.persistInstance(ceda_guid) 
Note: See TracChangeset for help on using the changeset viewer.