Ignore:
Timestamp:
31/01/12 17:10:32 (8 years ago)
Author:
mnagni
Message:

Refactored partially the migration code
Refactored substantially the Model2Form code
Now is visible the "cov" page is visible the relatedParty name (implementation as list possibly in the next commit)

File:
1 edited

Legend:

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

    r8014 r8082  
    44@author: mnagni 
    55''' 
    6 class NoAssociatedDeployments(Exception): 
    7     def __init__(self, value): 
    8         self.value = value 
    9     def __str__(self): 
    10         return "The DataEntity with ID %s has no associated deployments" % (self.value) 
     6 
     7def _migrationObjectDescription(migrationObject): 
     8    return "%s %s %s" % (migrationObject.doc_status, migrationObject.doc_owner, migrationObject.doc_name) 
    119     
    1210class NoCreationDate(Exception): 
     
    1513    def __str__(self): 
    1614        return "The resource with ID %s has no creation date" % (self.value)   
     15 
     16class MigrationObjectException(Exception): 
     17    def __init__(self, value): 
     18        self._migrationObject = value 
     19    def __str__(self): 
     20        return "Error on migration object %s " % (_migrationObjectDescription(self._migrationObject)) 
     21 
     22class NoAssociatedDeployments(Exception): 
     23    def __init__(self, data_entityMigration, deploymentName): 
     24        self._migrationObject = data_entityMigration 
     25        self._deploymentName = deploymentName         
     26        super(NoAssociatedDeployments, self).__init__() 
     27    def __str__(self): 
     28        return "The DataEntity %s has no associated deployment named %s" % (_migrationObjectDescription(self._migrationObject), self._deploymentName) 
    1729     
    18 class NoDataLineage(Exception): 
     30class NoDataLineage(MigrationObjectException): 
    1931    def __init__(self, value): 
    20         ''' 
    21         @param value: the full eXist path of the associated resource  
    22         '''        
    23         self.value = value 
     32        self._migrationObject = value         
     33        super(NoDataLineage, self).__init__(self._migrationObject) 
    2434    def __str__(self): 
    25         return "The resource with path %s has no moles:lineage value" % (self.value)         
     35        return "The DataEntity %s has no moles:lineage value" % (_migrationObjectDescription(self._migrationObject)) 
Note: See TracChangeset for help on using the changeset viewer.