Changeset 412

Show
Ignore:
Timestamp:
Mon Jun 2 18:21:57 2008
Author:
Brian
Message:

Some changes to the ORM object model

Files:

Legend:

Unmodified
Added
Removed
Modified
  • scripts/trunk/ORM/Install ORM Meta-Model Reports.py

    r410 r412  
    35 35 # this first section descibes the orm model objects. the graphic objects are described later  
    36 36  
    37   #       ORMObject  
    38   #       - ID  
    39   #       - ProjectID (Schema)  
    40   #       - Name  
    41   #       - RefMode = identifier used to refer to instances of object  
    42   #       - Type ['Entity', 'Value']  
    43   #       - Independent [None, '!']  
    44   #       - Derived [None, '*', '+']  
    45   #       - DerivationRule  
    46    
    47 37 ##    rt = { 'Name': 'ORM Diagram', 'TableA': 'ORMObjectType', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    48 38 ##           'SuggestedColumns': ',ID;,Name',  
     
    56 46 ##    Data.AddReportType(rt, ct)  
    57 47  
      48 #       ORMObject  
      49 #       - ID  
      50 #       - ProjectID (Schema)  
      51 #       - Name  
      52 #       - RefMode = identifier used to refer to instances of object  
      53 #       - Type ['Entity', 'Value', 'Objectified']  
      54 #       - ORMFactTypeID            # for objectified fact type  
      55 #       - Independent [None, '!']  # capture objects that play no roles  
      56 #       - Personal [None, 'p']     # refer to object as "who"  
      57 #       - Derived [None, '*', '+']  
      58 #       - DerivationRule  
    58 59  
    59 60     rt = { 'Name': 'ORM ObjectTypes', 'TableA': 'ORMObjectType', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
     
    67 68     { 'Name': 'Type',         'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    68 69     { 'Name': 'Independent',  'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 75  },  
      70     { 'Name': 'Personal',     'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 75  },  
    69 71     { 'Name': 'Derived',      'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    70 72     { 'Name': 'DerivationRule',  'Label': None,          'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 180  },  
     
    78 80 #       - ProjectID (Schema)  
    79 81 #       - Nary (1 ..)  
    80   #       - ORMFactReadingID         # prefered reading  
      82 ##       - ORMFactReadingID         # prefered reading; no, put this in the reading  
      83 #       - ORMObjectTypeID         # if objectified  
    81 84 #       - Derived [None, '*', '+']  
    82 85 #       - DerivationRule  
     
    90 93            'SuggestedColumns': ',ID;,Name;,Nary;,ORMReadingID;,Derived;,DerivationRule;,DateAdded' }  
    91 94     ct = [  
    92       { 'Name': 'ProjectID',    'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    93       { 'Name': 'Project/Name', 'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
    94       { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
      95     { 'Name': 'ProjectID',     'Label': 'Project\nID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
      96     { 'Name': 'Project/Name',  'Label': 'Project\nName',  'DataType': 't', 'AccessType': 'i', 'T': 'A', 'Edit': False, 'Width': 100  },  
      97     { 'Name': 'ID',            'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    95 98     # why do I have name? -- New to ORM2 (see ref doc p.6?) - not displayed in diagram, used for naming tables  
    96       { 'Name': 'Name',         'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
      99     { 'Name': 'Name',          'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    96 99     { 'Name': 'Nary',          'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    97       { 'Name': 'ORMFactReadingID',   'Label': 'ReadingID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
      100 ##    { 'Name': 'ORMFactReadingID',   'Label': 'ReadingID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
      101     { 'Name': 'ORMObjectTypeID',   'Label': 'ReadingID',    'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    98 102     { 'Name': 'Derived',       'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 50  },  
    99 103     { 'Name': 'DerivationRule',  'Label': None,          'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 180  },  
    100       { 'Name': 'Description',  'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
      104     { 'Name': 'Description',   'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    100 104     { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    101 105         ]  
     
    109 113 #       - ORMFactID  
    110 114 #       - Preference  (integer 1 or 2)  
    111   #       - Reading (reading text refers to role ids??)  
      115 #       - Reading (reading text refers to role ids??, if so, be sure to update for server  
    111 115 #       - ORMReadingAltID            # do I need this????  
    112 116  
     
    133 137 #       - ID  
    134 138 #       - ProjectID (Schema)  
    135   #       - ORMFactID - NodeA in the report row  
    136   #       - ORMObjectID - NodeB in the report row  
      139 #       - ORMFactID - NodeA in the connector graphic object  
      140 #       - ORMObjectID - NodeB in the connector graphic object  
    137 141 #       - Seq = sequence number - this identifies the position of the role in the fact  
    138 142 #       - Name  
     
    152 156     { 'Name': 'Mandatory',     'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    153 157     { 'Name': 'Unique',        'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 35  },  
    154       { 'Name': 'ORMRoleLabelID', 'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
      158 #    { 'Name': 'ORMRoleNameID', 'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    154 158     { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    155 159         ]  
    156 160     Data.AddReportType(rt, ct)  
    157 161  
      162 # not needed anymore because graphics are not report rows and don't have the same constraints  
    158 163 # shouldn't really be needed, but it gives the grapic something to point to  
    159       rt = { 'Name': 'ORM Role Label', 'TableA': 'ORMRoleLabel', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    160              'SuggestedColumns': ',ID;,ORMRoleID' }  
    161       ct = [  
    162       { 'Name': 'ID',            'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    163       { 'Name': 'ORMRoleID',     'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    164       { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
    165           ]  
    166       Data.AddReportType(rt, ct)  
      164 ##    rt = { 'Name': 'ORM Role Name', 'TableA': 'ORMRoleName', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
      165 ##           'SuggestedColumns': ',ID;,ORMRoleID' }  
      166 ##    ct = [  
      167 ##    { 'Name': 'ID',            'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
      168 ##    { 'Name': 'ORMRoleID',     'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
      169 ##    { 'Name': 'DateAdded',     'Label': 'Date\nAdded',    'DataType': 'd', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 80  },  
      170 ##        ]  
      171 ##    Data.AddReportType(rt, ct)  
    167 172  
    168 173 #       ORMConstraint  
     
    171 176 #       - ProjectID (Schema)  
    172 177 ##       - Name  
    173   #       - Type ['a', 'd']  
      178 #       =         x             s         =                        xor  
      179 #       - Type ['Disjuntive', 'Subset', 'Equality', 'Exclusion', 'ExclusiveOR', 'Ring', 'Value']  
      180 #       - Modality ['a', 'd']  
    174 181 #       - Unique ['a', 'd']  
      182 #       - Where ['internal', 'extermal']    # all in same fact, cross facts  
    175 183 #       - ORMPathID  
    176   #       - ORMPathAltID  
      184 ###       - ORMPathAltID  
    176 184  
    177 185     rt = { 'Name': 'ORM Constraints', 'TableA': 'ORMConstraint', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
     
    188 196     Data.AddReportType(rt, ct)  
    189 197  
    190       rt = { 'Name': 'ORM Constraint Connectors', 'TableA': 'ORMConstraintConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
      198 # old version  
      199 ##    rt = { 'Name': 'ORM Constraint Connectors', 'TableA': 'ORMConstraintConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
      200 ##           'SuggestedColumns': ',ID;,ORMConstraintID;,TableName;,TableID' }  
      201 ##    ct = [  
      202 ##    { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
      203 ##    { 'Name': 'ORMConstraintID',    'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      204 ###    { 'Name': 'ORMRoleID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      205 ##    { 'Name': 'TableName',    'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
      206 ##    { 'Name': 'TableID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      207 ##        ]  
      208 ##    Data.AddReportType(rt, ct)  
      209 ##  
      210  
      211 #       ORMConstraintConnector  # need better name, different from graphic  
      212 #       - ID  
      213 #       - ProjectID (Schema)  
      214 ##       - Name  
      215 #       - RoleSet    # may have one or more set  
      216 #       - RoleSequence  # sequence within set  
      217 #       - RoleID     #  
      218  
      219 # new version  
      220     rt = { 'Name': 'ORM Constraint Role', 'TableA': 'ORMConstraintRole', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    191 221            'SuggestedColumns': ',ID;,ORMConstraintID;,TableName;,TableID' }  
    192 222     ct = [  
    193 223     { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
    194 224     { 'Name': 'ORMConstraintID',    'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    195   #    { 'Name': 'ORMRoleID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    196       { 'Name': 'TableName',    'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
    197       { 'Name': 'TableID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      225     { 'Name': 'ORMRoleID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      226 #    { 'Name': 'ORMSubTypeConnectorID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      227     { 'Name': 'Set',   'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      228     { 'Name': 'Sequence',   'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      229 ##    { 'Name': 'TableName',    'Label': None,             'DataType': 't', 'AccessType': 'd', 'T': 'A', 'Edit': True,  'Width': 100  },  
      230 ##    { 'Name': 'TableID',      'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
    198 231         ]  
    199 232     Data.AddReportType(rt, ct)  
    200 233  
    201       rt = { 'Name': 'ORM Subtype Connectors', 'TableA': 'ORMSubtypeConnector', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
      234     rt = { 'Name': 'ORM Subtype Connection', 'TableA': 'ORMSubtypeConnection', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
    201 234            'SuggestedColumns': ',ID;,ORMObjectTypeID;,ORMSubtypeID' }  
    202 235     ct = [  
     
    213 246 ##       - Name  
    214 247  
      248     rt = { 'Name': 'ORM Path', 'TableA': 'ORMPath', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
      249            'SuggestedColumns': ',ID;,ORMObjectTypeID;,ORMSubtypeID' }  
      250     ct = [  
      251     { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
      252 ##    { 'Name': 'ORMObjectTypeID','Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      253 ##    { 'Name': 'ORMSubtypeID',   'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      254         ]  
      255     Data.AddReportType(rt, ct)  
      256  
    215 257 #       ORMPathLink  
    216 258 #       - ID  
     
    219 261 #       - Sequence  (1 ..)  
    220 262  
      263     rt = { 'Name': 'ORM Path Link', 'TableA': 'ORMPathLink', 'TableB': None, 'Also': None, 'AllOrEach': 'each',  
      264            'SuggestedColumns': ',ID;,ORMObjectTypeID;,ORMSubtypeID' }  
      265     ct = [  
      266     { 'Name': 'ID',           'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': False, 'Width': 35  },  
      267     { 'Name': 'ORMRoleID',  'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      268     { 'Name': 'Sequence',   'Label': None,             'DataType': 'i', 'AccessType': 'd', 'T': 'A', 'Edit': True, 'Width': 55  },  
      269         ]  
      270     Data.AddReportType(rt, ct)  
      271  
    221 272 #       ORMNote  
    222 273 #       - ID  
     
    257 308 #       - ID  
    258 309 #       - ReportID  
      310 #       - Subtype   # used to create the correct object  
    259 311 #       - PosX      # these refer to the center of the object (the target of arrows pointing to the object)  
    260 312 #       - PosY  
  • scripts/trunk/ORM/Install ORM Diagram.py

    r408 r412  
    37 37     Data.AddReportType(rt, ct)  
    38 38  
      39     # this list must match the meta-model  
    39 40     Data.AddTable('ORMObjectType')  
    40 41     Data.AddTable('ORMFactType')  
    41 42     Data.AddTable('ORMFactReading')  
    42 43     Data.AddTable('ORMRole')  
    43       Data.AddTable('ORMRoleLabel')  
      44     # Data.AddTable('ORMRoleName')  
    43 44     Data.AddTable('ORMConstraint')  
    44       Data.AddTable('ORMConstraintConnector')  
      45     Data.AddTable('ORMConstraintRole')  
      46     Data.AddTable('ORMConstraintConnector')  # temporary - only in diagram  
    45 47     Data.AddTable('ORMSubtypeConnector')  
    46 48     Data.AddTable('ORMNote')