source: mauRepo/MolesManager/trunk/src/ea_model/iso_19115_2_2009_metadata___imagery/data_quality_information___imagery/qe_coverageresult.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19115_2_2009_metadata___imagery/data_quality_information___imagery/qe_coverageresult.py@8091
Revision 8091, 4.0 KB checked in by mnagni, 8 years ago (diff)

The migration process now includes
1) deployment_data files
2) XML document hash
3) full Dojo support


Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_result import  DQ_Result
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:01
26
27@author: mnagni
28'''
29
30class QE_CoverageResult(DQ_Result):
31    '''
32        Represents a data entity defined in a UML diagram and supposed to
33        be persisted in a relational database.
34 
35        This class has been genererated automatically using the Apache Velocity project.
36    '''
37    '''
38        Please note that any access to the inner attributes should be done using
39        the given get/set methods and NOT accessing them directly.
40    '''
41    def __init__(self):
42        self._dq_result = DQ_Result()   
43
44        self.spatialRepresentationType = None
45        self._resultContentDescription_mi_coveragedescription = None
46        self._resultContentDescription_md_imagedescription = None
47        self.resultFormat = None
48        self._resultSpatialRepresentation_md_gridspatialrepresentation = None
49        self._resultSpatialRepresentation_md_vectorspatialrepresentation = None
50        self.resultFile = None
51        super(QE_CoverageResult, self).__init__()
52
53    @property
54    def resultContentDescription(self): 
55        if(has_value(self._resultContentDescription_mi_coveragedescription)):
56            return self._resultContentDescription_mi_coveragedescription
57        if(has_value(self._resultContentDescription_md_imagedescription)):
58            return self._resultContentDescription_md_imagedescription
59        return  None
60
61    @resultContentDescription.setter
62    def resultContentDescription(self, value): 
63        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
64        if valueClass == "ea_model.iso_19115_2_2009_metadata___imagery.content_information___imagery.mi_coveragedescription.MI_CoverageDescription":
65            self._resultContentDescription_mi_coveragedescription = value
66            self._resultContentDescription_md_imagedescription = None
67        if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.content_information.md_imagedescription.MD_ImageDescription":
68            self._resultContentDescription_md_imagedescription = value
69            self._resultContentDescription_mi_coveragedescription = None
70
71    @property
72    def resultSpatialRepresentation(self):     
73        if(has_value(self._resultSpatialRepresentation_md_gridspatialrepresentation)):
74            return self._resultSpatialRepresentation_md_gridspatialrepresentation
75        if(has_value(self._resultSpatialRepresentation_md_vectorspatialrepresentation)):
76            return self._resultSpatialRepresentation_md_vectorspatialrepresentation
77        return  None
78
79    @resultSpatialRepresentation.setter
80    def resultSpatialRepresentation(self, value):       
81        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
82        if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.spatial_representation_information.md_gridspatialrepresentation.MD_GridSpatialRepresentation":
83            self._resultSpatialRepresentation_md_gridspatialrepresentation = value
84            self._resultSpatialRepresentation_md_vectorspatialrepresentation = None
85        if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.spatial_representation_information.md_vectorspatialrepresentation.MD_VectorSpatialRepresentation":
86            self._resultSpatialRepresentation_md_vectorspatialrepresentation = value
87            self._resultSpatialRepresentation_md_gridspatialrepresentation = None
88
89    def __key(self):
90        return (self.spatialRepresentationType, self.resultContentDescription, self.resultFormat, self.resultSpatialRepresentation, self.resultFile)
91
92    def __eq__(self, y):
93        '''
94        Cannot compare classes which do not define a "__key" attribute
95        '''
96        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
97            return self.__key() == y.__key()
98        return id(self) == id(y)
99
100    def __hash__(self):
101        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.