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

Complete - # 22424: CEDA Project - documentation
 http://team.ceda.ac.uk/trac/ceda/ticket/22424

File:
1 edited

Legend:

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

    r8209 r8210  
    3333from ea_model.iso_19108_2006_temporal_schema.temporal_reference_system.tm_position import TM_Position 
    3434from ea_model.iso_19108_2006_temporal_schema.temporal_objects.tm_instant import TM_Instant 
    35 from ea_model.moles3_4.utilities.mo_organization import MO_Organization 
    3635from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_contact import CI_Contact 
    3736from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_address import CI_Address 
     
    324323    return linksDict 
    325324 
     325 
     326 
    326327def findDownloadLinksInMigrationDocument(migrationObject): 
    327328    """ 
     
    344345    return linksDict['ACCESS'] 
    345346 
     347def findDocumentationInMigrationDocument(migrationObject): 
     348    """ 
     349        Return a list of dictionaries describing a <link rel="...DOCUMENT..."> tag type 
     350        Each dictionary has two keys: 'href' and 'title' 
     351        @param migrationObject: the migration instance to retrieve and parse 
     352        @return: a list of dictionaries 
     353    """ 
     354    linksDict = findLinksInMigrationDocument(migrationObject) 
     355    return linksDict['DOCUMENT'] 
     356 
    346357def findDOIInMigrationDocument(migrationObject): 
    347358    """ 
     
    351362        @return: a dictionary relative to the DOI, None otherwise 
    352363    """ 
    353     linksDict = findLinksInMigrationDocument(migrationObject) 
    354     for link in linksDict['DOCUMENTATION']: 
     364    for link in findDocumentationInMigrationDocument(migrationObject): 
    355365        if link['href'].startswith('doi:'): 
    356366            return link 
     
    828838    return ceda_acquisition 
    829839 
    830 def createCEDA_Project(abstract = None, publication_state = None): 
     840def createCEDA_Project(abstract = None, publication_state = None, documentation = None, project_resource=None): 
    831841    ceda_project = CEDA_Project() 
    832842    if abstract: 
     
    834844    if publication_state: 
    835845        ceda_project.publicationState = publication_state         
     846    if documentation and type(documentation) == list: 
     847        ceda_project.documentation = documentation 
     848    if project_resource and type(project_resource) == list: 
     849        ceda_project.projectResource = project_resource    
    836850    return ceda_project     
Note: See TracChangeset for help on using the changeset viewer.