Shirly Radco has uploaded a new change for review.

Change subject: reports: dr2 report - added comments to queries
......................................................................

reports: dr2 report - added comments to queries

Changed the code structure so it will be more readable
and added commets.

Change-Id: I446d98d7da8bb35d681fbb7eb73f95d7fd1ab5fb
Signed-off-by: Shirly Radco <sra...@redhat.com>
---
M 
packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_entities_counts_list_dr2_jrxml.data
1 file changed, 43 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/87/27887/1

diff --git 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_entities_counts_list_dr2_jrxml.data
 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_entities_counts_list_dr2_jrxml.data
index d9b94af..bfb19c8 100644
--- 
a/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_entities_counts_list_dr2_jrxml.data
+++ 
b/packaging/ovirt-reports/resources/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_entities_counts_list_dr2_jrxml.data
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Created with Jaspersoft Studio version 5.5.0-->
 <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports 
http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"; 
name="dc_entities_counts_list_dr2" language="groovy" pageWidth="360" 
pageHeight="160" whenNoDataType="AllSectionsNoDetail" columnWidth="360" 
leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" 
resourceBundle="ovirt_reports_bundle" whenResourceMissingType="Error" 
uuid="0ddd0db5-b36c-44e2-ae0e-183fa3074cfb">
        <property name="ireport.zoom" value="1.0"/>
        <property name="ireport.x" value="0"/>
        <property name="ireport.y" value="0"/>
-       <property name="ireport.jasperserver.reportUnit" 
value="/reports_resources/webadmin_dashboards/ce/datacenter_dashboard"/>
-       <property name="ireport.jasperserver.url" 
value="http://localhost:8080/jasperserver-pro/services/repository"/>
+       <property name="ireport.jasperserver.url" 
value="http://localhost:8080/jasperserver-pro/"/>
+       <property name="ireport.jasperserver.report.resource" 
value="/reports_resources/embedded_reports/webadmin_dashboards/dc_dashboard/jrxmls/dc_entities_counts_list_dr2_jrxml"/>
        <subDataset name="storage_count" 
uuid="6b400e6b-94db-4d9e-af5e-48b1d52f3ad3">
                <parameter name="P_DataCenter_ID" class="java.lang.String">
                        
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
@@ -16,17 +17,37 @@
                </queryString>
                <field name="storage_count" class="java.lang.Long"/>
        </subDataset>
-       <parameter name="P_DataCenter_ID" class="java.lang.String">
-               <defaultValueExpression><![CDATA[]]></defaultValueExpression>
-       </parameter>
-       <queryString>
-               <![CDATA[SELECT count(DISTINCT 
v3_5_latest_configuration_clusters.cluster_id) AS cluster_count,
-       count(DISTINCT v3_5_latest_configuration_hosts.host_id) AS host_count,
-       count(DISTINCT v3_5_latest_configuration_vms.vm_id) AS vm_count
+       <parameter name="P_DataCenter_ID" class="java.lang.String"/>
+       <queryString language="SQL">
+               <![CDATA[-- DR2 - This query returns the
+-- number of cluster, hosts and vms
+-- in the latest datacenter configuration
+
+SELECT
+    COUNT (
+        DISTINCT v3_5_latest_configuration_clusters.cluster_id
+    ) AS cluster_count,
+    COUNT (
+        DISTINCT v3_5_latest_configuration_hosts.host_id
+    ) AS host_count,
+    COUNT (
+        DISTINCT v3_5_latest_configuration_vms.vm_id
+    ) AS vm_count
 FROM v3_5_latest_configuration_clusters
-     LEFT OUTER JOIN v3_5_latest_configuration_hosts ON 
(v3_5_latest_configuration_clusters.cluster_id = 
v3_5_latest_configuration_hosts.cluster_id)
-     LEFT OUTER JOIN v3_5_latest_configuration_vms ON 
(v3_5_latest_configuration_clusters.cluster_id = 
v3_5_latest_configuration_vms.cluster_id)
-WHERE v3_5_latest_configuration_clusters.datacenter_id = 
CAST($P{P_DataCenter_ID} as UUID)]]>
+    LEFT OUTER JOIN v3_5_latest_configuration_hosts
+        ON (
+            v3_5_latest_configuration_clusters.cluster_id =
+            v3_5_latest_configuration_hosts.cluster_id
+        )
+    LEFT OUTER JOIN v3_5_latest_configuration_vms
+        ON (
+            v3_5_latest_configuration_clusters.cluster_id =
+            v3_5_latest_configuration_vms.cluster_id
+        )
+WHERE
+    -- Here we filter by the datacenter chosen by the user
+    v3_5_latest_configuration_clusters.datacenter_id =
+    CAST ( $P{P_DataCenter_ID} as UUID )]]>
        </queryString>
        <field name="cluster_count" class="java.lang.Long"/>
        <field name="host_count" class="java.lang.Long"/>
@@ -37,53 +58,53 @@
        <summary>
                <band height="160" splitType="Stretch">
                        <image>
-                               <reportElement 
uuid="1231a632-b05a-489b-bfb1-40bcb03523a2" x="0" y="0" width="360" 
height="160"/>
+                               <reportElement x="0" y="0" width="360" 
height="160" uuid="1231a632-b05a-489b-bfb1-40bcb03523a2"/>
                                
<imageExpression><![CDATA["repo:statisticBackground.png"]]></imageExpression>
                        </image>
                        <textField>
-                               <reportElement 
uuid="8d6c9321-cc54-4bcb-9c8c-0cbd26f00733" x="48" y="49" width="185" 
height="29" forecolor="#FFFFFF"/>
+                               <reportElement x="48" y="49" width="185" 
height="29" forecolor="#FFFFFF" uuid="8d6c9321-cc54-4bcb-9c8c-0cbd26f00733"/>
                                <textElement verticalAlignment="Middle">
                                        <font fontName="SansSerif" size="16" 
isBold="true"/>
                                </textElement>
                                
<textFieldExpression><![CDATA[$R{dr.count.list.clusters} + 
":"]]></textFieldExpression>
                        </textField>
                        <textField>
-                               <reportElement 
uuid="86975072-5897-4e0b-aebf-1e62e8d5d278" x="48" y="78" width="185" 
height="29" forecolor="#FFFFFF"/>
+                               <reportElement x="48" y="78" width="185" 
height="29" forecolor="#FFFFFF" uuid="86975072-5897-4e0b-aebf-1e62e8d5d278"/>
                                <textElement verticalAlignment="Middle">
                                        <font fontName="SansSerif" size="16" 
isBold="true"/>
                                </textElement>
                                
<textFieldExpression><![CDATA[$R{dr.count.list.hosts} + 
":"]]></textFieldExpression>
                        </textField>
                        <textField>
-                               <reportElement 
uuid="1136c449-cade-4127-a362-56243273bfd7" x="48" y="107" width="185" 
height="29" forecolor="#FFFFFF"/>
+                               <reportElement x="48" y="107" width="185" 
height="29" forecolor="#FFFFFF" uuid="1136c449-cade-4127-a362-56243273bfd7"/>
                                <textElement verticalAlignment="Middle">
                                        <font fontName="SansSerif" size="16" 
isBold="true"/>
                                </textElement>
                                
<textFieldExpression><![CDATA[$R{dr.count.list.vms} + 
":"]]></textFieldExpression>
                        </textField>
                        <textField>
-                               <reportElement 
uuid="83d3568a-345e-4e3f-947e-86105f8fb7e3" x="233" y="49" width="103" 
height="29" forecolor="#FFFFFF"/>
+                               <reportElement x="233" y="49" width="103" 
height="29" forecolor="#FFFFFF" uuid="83d3568a-345e-4e3f-947e-86105f8fb7e3"/>
                                <textElement verticalAlignment="Middle">
                                        <font fontName="SansSerif" size="16" 
isBold="true"/>
                                </textElement>
                                
<textFieldExpression><![CDATA[$F{cluster_count}.toString()]]></textFieldExpression>
                        </textField>
                        <textField>
-                               <reportElement 
uuid="c7d3954a-6faf-46a5-844b-f9bf5489d6f5" x="233" y="78" width="103" 
height="29" forecolor="#FFFFFF"/>
+                               <reportElement x="233" y="78" width="103" 
height="29" forecolor="#FFFFFF" uuid="c7d3954a-6faf-46a5-844b-f9bf5489d6f5"/>
                                <textElement verticalAlignment="Middle">
                                        <font fontName="SansSerif" size="16" 
isBold="true"/>
                                </textElement>
                                
<textFieldExpression><![CDATA[$F{host_count}.toString()]]></textFieldExpression>
                        </textField>
                        <textField>
-                               <reportElement 
uuid="5de18132-8c05-4a51-be5a-35d35d2cfac0" x="233" y="107" width="103" 
height="29" forecolor="#FFFFFF"/>
+                               <reportElement x="233" y="107" width="103" 
height="29" forecolor="#FFFFFF" uuid="5de18132-8c05-4a51-be5a-35d35d2cfac0"/>
                                <textElement verticalAlignment="Middle">
                                        <font fontName="SansSerif" size="16" 
isBold="true"/>
                                </textElement>
                                
<textFieldExpression><![CDATA[$F{vm_count}.toString()]]></textFieldExpression>
                        </textField>
                        <componentElement>
-                               <reportElement 
uuid="932508db-67df-4e7b-a749-a06d8d16a5b8" x="48" y="20" width="288" 
height="29"/>
+                               <reportElement x="48" y="20" width="288" 
height="29" uuid="932508db-67df-4e7b-a749-a06d8d16a5b8"/>
                                <jr:list 
xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components"; 
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components
 http://jasperreports.sourceforge.net/xsd/components.xsd"; printOrder="Vertical">
                                        <datasetRun subDataset="storage_count" 
uuid="c277a795-0665-4798-b54c-e68247c4dd03">
                                                
<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression>
@@ -91,14 +112,14 @@
                                        </datasetRun>
                                        <jr:listContents height="29" 
width="288">
                                                <textField>
-                                                       <reportElement 
uuid="8d6c9321-cc54-4bcb-9c8c-0cbd26f00733" x="0" y="0" width="185" height="29" 
forecolor="#FFFFFF"/>
+                                                       <reportElement x="0" 
y="0" width="185" height="29" forecolor="#FFFFFF" 
uuid="8d6c9321-cc54-4bcb-9c8c-0cbd26f00733"/>
                                                        <textElement 
verticalAlignment="Middle">
                                                                <font 
fontName="SansSerif" size="16" isBold="true"/>
                                                        </textElement>
                                                        
<textFieldExpression><![CDATA[$R{dr.count.list.storage.domains} + 
":"]]></textFieldExpression>
                                                </textField>
                                                <textField>
-                                                       <reportElement 
uuid="83d3568a-345e-4e3f-947e-86105f8fb7e3" x="185" y="0" width="103" 
height="29" forecolor="#FFFFFF"/>
+                                                       <reportElement x="185" 
y="0" width="103" height="29" forecolor="#FFFFFF" 
uuid="83d3568a-345e-4e3f-947e-86105f8fb7e3"/>
                                                        <textElement 
verticalAlignment="Middle">
                                                                <font 
fontName="SansSerif" size="16" isBold="true"/>
                                                        </textElement>


-- 
To view, visit http://gerrit.ovirt.org/27887
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I446d98d7da8bb35d681fbb7eb73f95d7fd1ab5fb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-reports
Gerrit-Branch: master
Gerrit-Owner: Shirly Radco <sra...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to