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/deployment_data.py

    r8209 r8210  
    44@author: mnagni 
    55''' 
    6 from libs.migration.processor.commons import findLinksInDeployment,\ 
    7     findSubTypeInDPT, hasAtomDocumentSameHash, getAtomDocumentHashByMO,\ 
     6from libs.migration.processor.commons import findSubTypeInDPT,\ 
    87    createCEDA_Processing, createCEDA_Instrument, createCEDA_Project,\ 
    9     findSummary 
     8    findSummary, findDocumentationInMigrationDocument, createCI_Citation,\ 
     9    createMO_OnlineResource 
    1010from libs.migration.MigrationEPB import MigrationEPB 
    1111from MolesManager.moles3epb import Moles3EPB 
     
    2727        if links.has_key('ACTIVITY'): 
    2828            for link in links['ACTIVITY']: 
    29                 activity = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, link + '.atom', self._migrationSessions.migrationSession) 
     29                activity = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, link + '.atom', \ 
     30                                                                         self._migrationSessions.migrationSession) 
    3031                i_abstract = findSummary(activity) 
    31                 project = createCEDA_Project(abstract=i_abstract, publication_state=MO_PublicationStateValue.cl_working) 
     32                doc_link = findDocumentationInMigrationDocument(activity) 
     33                i_documentation = None 
     34                i_resource = None 
     35                if doc_link and len(doc_link) == 1: 
     36                    i_documentation = createCI_Citation("Documentation resource") 
     37                    i_resource = createMO_OnlineResource(doc_link[0]['href']) 
     38                project = createCEDA_Project(abstract=i_abstract, publication_state=MO_PublicationStateValue.cl_working, \ 
     39                                             documentation=i_documentation, project_resource=i_resource) 
    3240                self._commitDeploymentMigration(project, activity, 'ceda_project_id') 
    3341        return project 
     
    3947        hasCedaAcquisition = False 
    4048        for dpt in links['DPT']: 
    41             dataProductionTool = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, dpt + '.atom', self._migrationSessions.migrationSession) 
     49            dataProductionTool = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, dpt + \ 
     50                                                                               '.atom', self._migrationSessions.migrationSession) 
    4251             
    4352            #has the document changed?             
     
    6271        #if not a DPT.subType == 'model' then.... 
    6372        for obs in links['OBS']: 
    64             observationStation = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, obs + '.atom', self._migrationSessions.migrationSession) 
     73            observationStation = MigrationEPB.getDeploymentDataMigrationByName(self._deploymentMigration, obs + \ 
     74                                                                               '.atom', self._migrationSessions.migrationSession) 
    6575  
    6676            #has the document changed?             
Note: See TracChangeset for help on using the changeset viewer.