Changeset 8258 for mauRepo


Ignore:
Timestamp:
19/04/12 11:56:51 (8 years ago)
Author:
mnagni
Message:
 
Location:
mauRepo/MolesManager/trunk/src/libs/migration
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/libs/migration/exception/exceptions.py

    r8254 r8258  
    55''' 
    66 
    7 def _migrationObjectDescription(migrationObject): 
     7def migrationObjectDescription(migrationObject): 
    88    try: 
    99        return "%s %s %s" % (migrationObject.doc_status, migrationObject.doc_owner, migrationObject.doc_name) 
     
    4848        self.comment = comment 
    4949    def __str__(self): 
    50         return "Error on migration object %s " % (_migrationObjectDescription(self.migrationObject)) 
     50        return "Error on migration object %s " % (migrationObjectDescription(self.migrationObject)) 
    5151 
    5252class NoAssociatedAuthor(MigrationObjectException): 
     
    5858        super(NoAssociatedAuthor, self).__init__(migrationObject, comment = '') 
    5959    def __str__(self): 
    60         return "The MigrationObject %s has no author mapping for %s" % (_migrationObjectDescription(self.migrationObject), self.author)             
     60        return "The MigrationObject %s has no author mapping for %s" % (migrationObjectDescription(self.migrationObject), self.author)             
    6161 
    6262class NoAssociatedDeployments(Exception): 
     
    7171    def __str__(self): 
    7272        if self._deploymentName: 
    73             return "The DataEntity %s has no associated deployment named %s" % (_migrationObjectDescription(self.migrationObject), self._deploymentName) 
     73            return "The DataEntity %s has no associated deployment named %s" % (migrationObjectDescription(self.migrationObject), self._deploymentName) 
    7474        else: 
    75             return "The DataEntity %s has no associated deployment" % (_migrationObjectDescription(self.migrationObject)) 
     75            return "The DataEntity %s has no associated deployment" % (migrationObjectDescription(self.migrationObject)) 
    7676     
    7777class NoDataLineage(MigrationObjectException): 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/commons.py

    r8254 r8258  
    446446                dpt.append(linkName) 
    447447            except Exception as ex: 
    448                 print ex 
     448                print "WARN - Cannot extractLinksByMarker %s" % (link) 
    449449    return dpt 
    450450 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/dataEntity.py

    r8254 r8258  
    1010from libs.migration.MigrationEPB import MigrationEPB 
    1111from libs.migration.exception.exceptions import MigrationObjectException, NoAssociatedAuthor,\ 
    12     _migrationObjectDescription, NoAssociatedDeployments 
     12    migrationObjectDescription, NoAssociatedDeployments 
    1313from libs.migration.processor.commons import findDeploymentsInDE,\ 
    1414    createMD_Identifier, extractContent, MD_CODE_MOLES2_CITATION,\ 
     
    4646        contentDict = extractContent(self._dataEntityMigration) 
    4747        if not contentDict.has_key('citation'): 
    48             DataEntityProcessor.log.info("The migration object "+ _migrationObjectDescription(self._dataEntityMigration) \ 
     48            DataEntityProcessor.log.info("The migration object "+ migrationObjectDescription(self._dataEntityMigration) \ 
    4949                                         + " has not associated cedacat:citation") 
    5050        else: 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/deployment.py

    r8256 r8258  
    4848from ea_model.iso_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_rolecode import CI_RoleCode 
    4949from ea_model.iso_19115_2006_metadata_corrigendum.maintenance_information.md_maintenancefrequencycode import MD_MaintenanceFrequencyCode 
     50from ea_model.ceda_metadatamodel.ceda_result.ceda_curationvalue import CEDA_CurationValue 
    5051 
    5152class DeploymentProcessor(object): 
     
    274275                                              self._deploymentMigration.ceda_observation_id) 
    275276        return ceda_observation 
    276  
    277     def _getcurationcategory(self, curationcategory): 
    278         """ 
    279             Returns a CEDA_CurationValue code if the parameter match any CEDA_CurationValue code 
    280             @param curationcategory: a String  
    281         """ 
    282         if curationcategory is None: 
    283             return None 
    284          
    285         for code in ceda_curationvalue.CEDA_CurationValue.__dict__: 
    286             if code.startswith('cl_'): 
    287                 if code.lower() == curationcategory.lower(): 
    288                     return code 
    289         return None 
    290277         
    291278 
     
    310297                                                   function = CI_OnLineFunctionCode.cl_download, \ 
    311298                                                   description = int_description, applicationProfile = int_applicationProfile) 
    312             dataentity_id = '%s__ATOM__%s' % (self._dataEntityMigration.doc_owner, self._dataEntityMigration.doc_name) 
    313             dataentity_id = dataentity_id.replace('.atom', '')            
    314             infodb_de = InfodbEPB.getCedaInfoApp_dataentityByDE_ID(dataentity_id) 
    315             i_logical_path = '/dummy' 
    316             if infodb_de['logical_path']: 
    317                 i_logical_path = infodb_de['logical_path'] 
    318              
    319             i_category = ceda_curationvalue.CEDA_CurationValue.cl_a                             
    320             if infodb_de['category']: 
    321                 i_category = self._getcurationcategory(infodb_de['category']) 
    322                  
    323             observation.result = createCEDA_Result(i_category, i_logical_path, source = [i_source])                                 
     299             
     300        dataentity_id = '%s__ATOM__%s' % (self._dataEntityMigration.doc_owner, self._dataEntityMigration.doc_name) 
     301        dataentity_id = dataentity_id.replace('.atom', '')            
     302        infodb_de = InfodbEPB.getCedaInfoApp_dataentityByDE_ID(dataentity_id) 
     303        i_logical_path = '/dummy' 
     304        if infodb_de['logical_path']: 
     305            i_logical_path = infodb_de['logical_path'] 
     306         
     307        i_category = ceda_curationvalue.CEDA_CurationValue.cl_a                             
     308        if infodb_de['category']: 
     309            i_category = CEDA_CurationValue.from_string(infodb_de['category'].lower()) #self._getcurationcategory(infodb_de['category'])                 
     310        observation.result = createCEDA_Result(i_category, i_logical_path, source = [i_source])                                 
    324311 
    325312 
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/migrationProcess.py

    r8147 r8258  
    1010import logging 
    1111from logging import StreamHandler 
     12from libs.migration.exception.exceptions import migrationObjectDescription 
    1213 
    1314class MigrationProcess(): 
     
    4546             
    4647        #loops over the data entities 
    47         for dataEntityMigration in [f for f in data_ents if f != None]:              
    48             dep = DataEntityProcessor(dataEntityMigration, self.migrationSessions) 
     48        for dataEntityMigration in [f for f in data_ents if f != None]: 
     49            MigrationProcess.log.info("Start processing dataEntity %s" % (migrationObjectDescription(dataEntityMigration)))              
     50            dep = DataEntityProcessor(dataEntityMigration, self.migrationSessions)             
    4951            exs.extend(dep.process()) 
     52            MigrationProcess.log.info("Done")             
    5053        return exs  
    5154         
Note: See TracChangeset for help on using the changeset viewer.