source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/ceda_metadatamodel/ceda_acquisition/ceda_operation.py @ 8437

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/ceda_metadatamodel/ceda_acquisition/ceda_operation.py@8437
Revision 8437, 2.9 KB checked in by mnagni, 7 years ago (diff)

Added a new function to ascore.utils in order to synchronize classes before committing to database

The following constraints has been added to the official model:

MO_ObservationCollection:member:CEDA_Observation
MO_ObservationCollection:phenomenonTime:TM_GeometricPrimitive
MO_Project:observationCollection:CEDA_ObservationCollection
MO_Observation:result:CEDA_Result
MO_Observation:inSupportOf:CEDA_Project
MO_Project:subProject:CEDA_Project
OM_Observation:procedure:CEDA_Process
OM_Observation:phenomenonTime:TM_GeometricPrimitive
MO_ResponsiblePartyFunctionValue:CEDA_RoleValue

  • Property svn:mime-type set to text/plain
Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.moles3_4.acquisition.mo_operation import  MO_Operation
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 06-Jul-2012 07:43:09
26
27@author: mnagni
28'''
29
30class CEDA_Operation(MO_Operation):
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._mo_operation = MO_Operation()     
43
44                self.metadataManagement = []
45                self.status = None
46                self.operationTime = None
47                self.location = None
48                self.description = None
49                super(CEDA_Operation, self).__init__()
50        @property
51        def identifier(self):   
52                return self._mo_operation.identifier
53
54        @identifier.setter
55        def identifier(self, value):   
56                        self._mo_operation.identifier = value
57        @property
58        def childOperation(self):       
59                return self._mo_operation.childOperation
60
61        @childOperation.setter
62        def childOperation(self, value):       
63                        self._mo_operation.childOperation = value
64        @property
65        def status(self):       
66                return self._mo_operation.status
67
68        @status.setter
69        def status(self, value):       
70                        self._mo_operation.status = value
71        @property
72        def relatedParty(self):
73                return self._mo_operation.relatedParty
74
75        @relatedParty.setter
76        def relatedParty(self, value): 
77                        self._mo_operation.relatedParty = value
78        @property
79        def operationTime(self):       
80                return self._mo_operation.operationTime
81
82        @operationTime.setter
83        def operationTime(self, value):
84                        self._mo_operation.operationTime = value
85        @property
86        def documentation(self):       
87                return self._mo_operation.documentation
88
89        @documentation.setter
90        def documentation(self, value):
91                        self._mo_operation.documentation = value
92        @property
93        def location(self):     
94                return self._mo_operation.location
95
96        @location.setter
97        def location(self, value):     
98                        self._mo_operation.location = value
99        @property
100        def platform(self):     
101                return self._mo_operation.platform
102
103        @platform.setter
104        def platform(self, value):     
105                        self._mo_operation.platform = value
106        @property
107        def description(self): 
108                return self._mo_operation.description
109
110        @description.setter
111        def description(self, value):   
112                        self._mo_operation.description = value
113
114        def synchronize(self):
115                pass
116
117        def __key(self):
118                return (self.identifier, self.childOperation, self.metadataManagement, self.status, self.relatedParty, self.operationTime, self.documentation, self.location, self.platform, self.description)
119
120        def __eq__(self, y):
121                if type(self) != type(y):
122                        return False
123                '''
124                Cannot compare classes which do not define a "__key" attribute
125                '''
126                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
127                        return self.__key() == y.__key()
128                return id(self) == id(y)
129
130        def __hash__(self):
131                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.