瀏覽代碼

XML Modelization of the relations: transformed the existing model (preserving the current behavior) to define the relations as an ATTRIBUTE whenever possible. Also took the opportunity to enforce a naming convention (neighbour id = target class name in lower case)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3524 a333f486-631f-4898-b8df-5754b55c2be0
romainq 10 年之前
父節點
當前提交
37142d8f96

+ 26 - 26
datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml

@@ -1456,13 +1456,13 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="contact">
-              <query>SELECT Contact AS c JOIN lnkContactToFunctionalCI AS l1 ON l1.contact_id = c.id WHERE l1.functionalci_id = :this-&gt;id</query>
+              <attribute>contacts_list</attribute>
             </neighbour>
-            <neighbour id="solution">
-              <query>SELECT ApplicationSolution AS s JOIN lnkApplicationSolutionToFunctionalCI AS l1 ON l1.applicationsolution_id = s.id WHERE l1.functionalci_id = :this-&gt;id</query>
+            <neighbour id="applicationsolution">
+              <attribute>applicationsolution_list</attribute>
             </neighbour>
-            <neighbour id="SoftwareInstances">
-              <query>SELECT SoftwareInstance AS s  WHERE s.system_id = :this-&gt;id</query>
+            <neighbour id="softwareinstance">
+              <attribute>softwares_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -1857,7 +1857,7 @@
       <relations>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="connected_network">
+            <neighbour id="networkdevice">
               <query>SELECT NetworkDevice AS nw JOIN lnkConnectableCIToNetworkDevice AS l1 ON l1.networkdevice_id = nw.id WHERE l1.connectableci_id = :this-&gt;id AND l1.connection_type='downlink'</query>
             </neighbour>
           </neighbours>
@@ -2386,7 +2386,7 @@
       <relations>
         <relation id="impacts">
           <neighbours>
-            <neighbour id="device">
+            <neighbour id="connectableci">
               <query>SELECT ConnectableCI AS d JOIN lnkConnectableCIToNetworkDevice AS l1 ON l1.connectableci_id = d.id WHERE l1.networkdevice_id = :this-&gt;id AND l1.connection_type='downlink'</query>
             </neighbour>
           </neighbours>
@@ -2825,15 +2825,15 @@
       <relations>
         <relation id="impacts">
           <neighbours>
-            <neighbour id="process">
-              <query>SELECT BusinessProcess AS p JOIN lnkApplicationSolutionToBusinessProcess AS l1 ON l1.businessprocess_id = p.id WHERE l1.applicationsolution_id = :this-&gt;id</query>
+            <neighbour id="businessprocess">
+              <attribute>businessprocess_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="solution">
-              <query>SELECT FunctionalCI AS ci JOIN lnkApplicationSolutionToFunctionalCI AS l1 ON l1.functionalci_id = ci.id WHERE l1.applicationsolution_id = :this-&gt;id</query>
+            <neighbour id="functionalci">
+              <attribute>functionalcis_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -2952,8 +2952,8 @@
       <relations>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="solution">
-              <query>SELECT ApplicationSolution AS app JOIN lnkApplicationSolutionToBusinessProcess AS l1 ON l1.applicationsolution_id = app.id WHERE l1.businessprocess_id = :this-&gt;id</query>
+            <neighbour id="applicationsolution">
+              <attribute>applicationsolutions_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -3126,7 +3126,7 @@
       <relations>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="FunctionalCI">
+            <neighbour id="functionalci">
               <query>SELECT FunctionalCI AS s JOIN SoftwareInstance AS app ON app.system_id = s.id WHERE app.id = :this-&gt;id</query>
             </neighbour>
           </neighbours>
@@ -3262,8 +3262,8 @@
       <relations>
         <relation id="impacts">
           <neighbours>
-            <neighbour id="MiddlewareInstance">
-              <query>SELECT MiddlewareInstance AS mi WHERE middleware_id = :this-&gt;id</query>
+            <neighbour id="middlewareinstance">
+              <attribute>middlewareinstance_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -3398,8 +3398,8 @@
       <relations>
         <relation id="impacts">
           <neighbours>
-            <neighbour id="DatabaseSchema">
-              <query>SELECT DatabaseSchema AS db WHERE dbserver_id = :this-&gt;id</query>
+            <neighbour id="databaseschema">
+              <attribute>dbschema_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -3534,8 +3534,8 @@
       <relations>
         <relation id="impacts">
           <neighbours>
-            <neighbour id="WebApplication">
-              <query>SELECT WebApplication AS db WHERE webserver_id = :this-&gt;id</query>
+            <neighbour id="webapplication">
+              <attribute>webapp_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -3886,8 +3886,8 @@
       <relations>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="Middleware">
-              <query>SELECT Middleware WHERE id = :this-&gt;middleware_id</query>
+            <neighbour id="middleware">
+              <attribute>middleware_id</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -4004,8 +4004,8 @@
       <relations>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="DBServer">
-              <query>SELECT DBServer WHERE id = :this-&gt;dbserver_id</query>
+            <neighbour id="dbserver">
+              <attribute>dbserver_id</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -4131,8 +4131,8 @@
       <relations>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="WebServer">
-              <query>SELECT WebServer WHERE id = :this-&gt;webserver_id</query>
+            <neighbour id="webserver">
+              <attribute>webserver_id</attribute>
             </neighbour>
           </neighbours>
         </relation>

+ 4 - 4
datamodels/2.x/itop-datacenter-mgmt/datamodel.itop-datacenter-mgmt.xml

@@ -369,8 +369,8 @@
       <relations>
         <relation id="impacts">
           <neighbours>
-            <neighbour id="DatacenterDevice">
-              <query>SELECT DatacenterDevice WHERE enclosure_id = :this-&gt;id</query>
+            <neighbour id="datacenterdevice">
+              <attribute>device_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -530,7 +530,7 @@
       <relations>
         <relation id="impacts">
           <neighbours>
-            <neighbour id="DatacenterDevice">
+            <neighbour id="datacenterdevice">
               <query>SELECT DatacenterDevice WHERE powerA_id = :this-&gt;id OR powerB_id = :this-&gt;id</query>
             </neighbour>
             <neighbour id="pdu">
@@ -899,7 +899,7 @@
         <relation id="depends on">
           <neighbours>
             <neighbour id="powerconnection">
-              <query>SELECT PowerConnection WHERE id = :this-&gt;powerstart_id</query>
+              <attribute>powerstart_id</attribute>
             </neighbour>
           </neighbours>
         </relation>

+ 9 - 9
datamodels/2.x/itop-storage-mgmt/datamodel.itop-storage-mgmt.xml

@@ -239,7 +239,7 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="logicalvolume">
-              <query>SELECT LogicalVolume WHERE storagesystem_id = :this-&gt;id</query>
+              <attribute>logicalvolume_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -481,7 +481,7 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="datacenterdevice">
-              <query>SELECT DatacenterDevice AS dc JOIN lnkSanToDatacenterDevice AS l1 ON l1.datacenterdevice_id = dc.id WHERE l1.san_id = :this-&gt;id</query>
+              <attribute>datacenterdevice_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -722,7 +722,7 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="tape">
-              <query>SELECT Tape  WHERE tapelibrary_id= :this-&gt;id</query>
+              <attribute>tapes_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -963,7 +963,7 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="nasfilesystem">
-              <query>SELECT NASFileSystem WHERE nas_id = :this-&gt;id</query>
+              <attribute>nasfilesystem_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -1062,7 +1062,7 @@
         <relation id="depends on">
           <neighbours>
             <neighbour id="tapelibrary">
-              <query>SELECT TapeLibrary  WHERE id = :this-&gt;tapelibrary_id</query>
+              <attribute>tapelibrary_id</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -1175,7 +1175,7 @@
         <relation id="depends on">
           <neighbours>
             <neighbour id="nas">
-              <query>SELECT NAS  WHERE id = :this-&gt;nas_id</query>
+              <attribute>nas_id</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -1433,14 +1433,14 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="server">
-              <query>SELECT Server AS s JOIN lnkServerToVolume AS l1 ON l1.server_id=s.id  WHERE l1.volume_id = :this-&gt;id</query>
+              <attribute>servers_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="sotragesystem">
-              <query>SELECT StorageSystem AS storage WHERE storage.id = :this-&gt;storagesystem_id</query>
+            <neighbour id="storagesystem">
+              <attribute>storagesystem_id</attribute>
             </neighbour>
           </neighbours>
         </relation>

+ 7 - 7
datamodels/2.x/itop-virtualization-mgmt/datamodel.itop-virtualization-mgmt.xml

@@ -236,7 +236,7 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="virtualmachine">
-              <query>SELECT VirtualMachine WHERE virtualhost_id = :this-&gt;id</query>
+              <attribute>virtualmachine_list</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -382,14 +382,14 @@
         <relation id="impacts">
           <neighbours>
             <neighbour id="farm">
-              <query>SELECT Farm WHERE id = :this-&gt;farm_id</query>
+              <attribute>farm_id</attribute>
             </neighbour>
           </neighbours>
         </relation>
         <relation id="depends on">
           <neighbours>
             <neighbour id="server">
-              <query>SELECT Server WHERE id = :this-&gt;server_id</query>
+              <attribute>server_id</attribute>
             </neighbour>
           </neighbours>
         </relation>
@@ -515,9 +515,9 @@
       <relations>
         <relation id="depends on">
           <neighbours>
-            <neighbour id="Hypervisor">
-              <query>SELECT Hypervisor WHERE farm_id = :this-&gt;id</query>
-            </neighbour>
+            <neighbour id="hypervisor">
+              <attribute>hypervisor_list</attribute>
+           </neighbour>
           </neighbours>
         </relation>
       </relations>
@@ -755,7 +755,7 @@
         <relation id="depends on">
           <neighbours>
             <neighbour id="virtualhost">
-              <query>SELECT VirtualHost WHERE id = :this-&gt;virtualhost_id</query>
+              <attribute>virtualhost_id</attribute>
             </neighbour>
           </neighbours>
         </relation>