Skip to content

Commit 1b58322

Browse files
authored
DRYD-2015: Report > Public Art > Full object with place details > place type (placeType) and placement type (placementType) (#501)
* DRYD-2015: added aggregating all placetypes; * DRYD-2015: added aggregating all placetypes; * DRYD-2015: added aggregating all placementtypes;
1 parent 87d5d61 commit 1b58322

2 files changed

Lines changed: 54 additions & 26 deletions

File tree

services/report/3rdparty/jasper-cs-report/src/main/resources/full_obj_place.jrxml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<style name="Column header" fontName="SansSerif" fontSize="12" isBold="true"/>
1111
<style name="Detail" fontName="SansSerif" fontSize="12"/>
1212
<parameter name="deurnfields" class="java.lang.String" isForPrompting="false">
13-
<defaultValueExpression><![CDATA["publicartproductiondatetype,responsibledepartment,publicartproductionpersons,publicartproductionpersonroles,publishto,installationtype,worktypes,materials,collections,owner,computedcurrentlocation,placementtype,placetype,placeowner,addressmunicipality,addressstateorprovince,addresscountry,addresstype,addresstype,broaderplace"]]></defaultValueExpression>
13+
<defaultValueExpression><![CDATA["publicartproductiondatetype,responsibledepartment,publicartproductionpersons,publicartproductionpersonroles,publishto,installationtype,worktypes,materials,collections,owner,computedcurrentlocation,placementtypes,placetypes,placeowner,addressmunicipality,addressstateorprovince,addresscountry,addresstype,addresstype,broaderplace"]]></defaultValueExpression>
1414
</parameter>
1515
<parameter name="tenantid" class="java.lang.String" isForPrompting="false">
1616
<defaultValueExpression><![CDATA["5000"]]></defaultValueExpression>
@@ -42,9 +42,9 @@
4242
obj.computedcurrentlocation,
4343
movement.currentlocationnote,
4444
place.placenote,
45-
placement.item AS placementtype,
45+
coalesce(placementtype_agg.placementtypes, '{}') AS placementtypes,
4646
place_pa.placementenvironment,
47-
placetype.item AS placetype,
47+
coalesce(placetype_agg.placetypes, '{}') AS placetypes,
4848
placeowner.owner AS placeowner,
4949
placeowner.ownershipnote,
5050
placeowner.ownertype,
@@ -140,9 +140,23 @@ LEFT JOIN (
140140
) movement ON movement.objectcsid = hier.name AND movement.currentlocation = obj.computedcurrentlocation
141141
-- place and all place fields
142142
LEFT JOIN places_common place on place.refname = obj.computedcurrentlocation
143-
LEFT JOIN places_publicart_placementtypes placement on placement.id = place.id AND placement.pos = 0
143+
-- AGGREGATE ALL PLACEMENTTYPES
144+
LEFT JOIN (
145+
SELECT
146+
placementtypes.id AS place_id,
147+
array_agg(placementtypes.item) AS placementtypes
148+
FROM places_publicart_placementtypes placementtypes
149+
GROUP BY placementtypes.id
150+
) placementtype_agg ON placementtype_agg.place_id = place.id
144151
LEFT JOIN places_publicart place_pa on place_pa.id = place.id
145-
LEFT JOIN places_publicart_publicartplacetypes placetype on placetype.id = place.id AND placetype.pos = 0
152+
-- AGGREGATE ALL PLACETYPES
153+
LEFT JOIN (
154+
SELECT
155+
placetype.id AS place_id,
156+
array_agg(placetype.item) AS placetypes
157+
FROM places_publicart_publicartplacetypes placetype
158+
GROUP BY placetype.id
159+
) placetype_agg ON placetype_agg.place_id = place.id
146160
LEFT JOIN hierarchy placeowner_hier on placeowner_hier.parentid = place.id and placeowner_hier.primarytype = 'publicartPlaceOwnerGroup' and placeowner_hier.pos = 0
147161
LEFT JOIN hierarchy placeownerdate_hier on placeownerdate_hier.parentid = placeowner_hier.id
148162
LEFT JOIN publicartplaceownergroup placeowner on placeowner.id = placeowner_hier.id
@@ -254,19 +268,19 @@ $P!{whereclause}]]>
254268
<property name="com.jaspersoft.studio.field.label" value="currentlocationnote"/>
255269
<property name="com.jaspersoft.studio.field.tree.path" value="movements_common"/>
256270
</field>
257-
<field name="placementtype" class="java.lang.String">
258-
<property name="com.jaspersoft.studio.field.name" value="placementtype"/>
259-
<property name="com.jaspersoft.studio.field.label" value="placementtype"/>
271+
<field name="placementtypes" class="java.sql.Array">
272+
<property name="com.jaspersoft.studio.field.name" value="placementtypes"/>
273+
<property name="com.jaspersoft.studio.field.label" value="placementtypes"/>
260274
<property name="com.jaspersoft.studio.field.tree.path" value="places_publicart_placementtypes"/>
261275
</field>
262276
<field name="placementenvironment" class="java.lang.String">
263277
<property name="com.jaspersoft.studio.field.name" value="placementenvironment"/>
264278
<property name="com.jaspersoft.studio.field.label" value="placementenvironment"/>
265279
<property name="com.jaspersoft.studio.field.tree.path" value="places_publicart"/>
266280
</field>
267-
<field name="placetype" class="java.lang.String">
268-
<property name="com.jaspersoft.studio.field.name" value="placetype"/>
269-
<property name="com.jaspersoft.studio.field.label" value="placetype"/>
281+
<field name="placetypes" class="java.sql.Array">
282+
<property name="com.jaspersoft.studio.field.name" value="placetypes"/>
283+
<property name="com.jaspersoft.studio.field.label" value="placetypes"/>
270284
<property name="com.jaspersoft.studio.field.tree.path" value="places_publicart_publicartplacetypes"/>
271285
</field>
272286
<field name="placeowner" class="java.lang.String">
@@ -746,7 +760,7 @@ $P!{whereclause}]]>
746760
<reportElement style="Detail" x="2000" y="0" width="100" height="30" uuid="52b33190-796b-42ba-990c-ab86d1d02950">
747761
<property name="com.jaspersoft.studio.unit.y" value="px"/>
748762
</reportElement>
749-
<textFieldExpression><![CDATA[$F{placementtype}]]></textFieldExpression>
763+
<textFieldExpression><![CDATA[$F{placementtypes}.getArray().join('; ')]]></textFieldExpression>
750764
</textField>
751765
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
752766
<reportElement style="Detail" x="2100" y="0" width="100" height="30" uuid="1ae3ea7d-79cd-4254-aa47-67dc138787f6">
@@ -758,7 +772,7 @@ $P!{whereclause}]]>
758772
<reportElement style="Detail" x="2200" y="0" width="100" height="30" uuid="ff9d2e44-827c-43d9-9a79-b138a679019e">
759773
<property name="com.jaspersoft.studio.unit.y" value="px"/>
760774
</reportElement>
761-
<textFieldExpression><![CDATA[$F{placetype}]]></textFieldExpression>
775+
<textFieldExpression><![CDATA[$F{placetypes}.getArray().join('; ')]]></textFieldExpression>
762776
</textField>
763777
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
764778
<reportElement style="Detail" x="2300" y="0" width="100" height="30" uuid="f29bc0cb-c282-49fe-bc66-86b32da69ceb">

services/report/3rdparty/jasper-cs-report/src/main/resources/full_obj_place_creator_role_combined.jrxml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<style name="Column header" fontName="SansSerif" fontSize="12" isBold="true"/>
1111
<style name="Detail" fontName="SansSerif" fontSize="12"/>
1212
<parameter name="deurnfields" class="java.lang.String" isForPrompting="false">
13-
<defaultValueExpression><![CDATA["publicartproductiondatetype,responsibledepartment,publicartproductionpersons,publicartproductionpersonroles,publishto,installationtype,worktypes,materials,collections,owner,computedcurrentlocation,placementtype,placetype,placeowner,addressmunicipality,addressstateorprovince,addresscountry,addresstype,addresstype,broaderplace"]]></defaultValueExpression>
13+
<defaultValueExpression><![CDATA["publicartproductiondatetype,responsibledepartment,publicartproductionpersons,publicartproductionpersonroles,publishto,installationtype,worktypes,materials,collections,owner,computedcurrentlocation,placementtypes,placetypes,placeowner,addressmunicipality,addressstateorprovince,addresscountry,addresstype,addresstype,broaderplace"]]></defaultValueExpression>
1414
</parameter>
1515
<parameter name="tenantid" class="java.lang.String" isForPrompting="false">
1616
<defaultValueExpression><![CDATA["5000"]]></defaultValueExpression>
@@ -42,9 +42,9 @@
4242
obj.computedcurrentlocation,
4343
movement.currentlocationnote,
4444
place.placenote,
45-
placement.item AS placementtype,
45+
coalesce(placementtype_agg.placementtypes, '{}') AS placementtypes,
4646
place_pa.placementenvironment,
47-
placetype.item AS placetype,
47+
coalesce(placetype_agg.placetypes, '{}') AS placetypes,
4848
placeowner.owner AS placeowner,
4949
placeowner.ownershipnote,
5050
placeowner.ownertype,
@@ -140,9 +140,23 @@ LEFT JOIN (
140140
) movement ON movement.objectcsid = hier.name AND movement.currentlocation = obj.computedcurrentlocation
141141
-- place and all place fields
142142
LEFT JOIN places_common place on place.refname = obj.computedcurrentlocation
143-
LEFT JOIN places_publicart_placementtypes placement on placement.id = place.id AND placement.pos = 0
143+
-- AGGREGATE ALL PLACEMENTTYPES
144+
LEFT JOIN (
145+
SELECT
146+
placementtypes.id AS place_id,
147+
array_agg(placementtypes.item) AS placementtypes
148+
FROM places_publicart_placementtypes placementtypes
149+
GROUP BY placementtypes.id
150+
) placementtype_agg ON placementtype_agg.place_id = place.id
144151
LEFT JOIN places_publicart place_pa on place_pa.id = place.id
145-
LEFT JOIN places_publicart_publicartplacetypes placetype on placetype.id = place.id AND placetype.pos = 0
152+
-- AGGREGATE ALL PLACETYPES
153+
LEFT JOIN (
154+
SELECT
155+
placetype.id AS place_id,
156+
array_agg(placetype.item) AS placetypes
157+
FROM places_publicart_publicartplacetypes placetype
158+
GROUP BY placetype.id
159+
) placetype_agg ON placetype_agg.place_id = place.id
146160
LEFT JOIN hierarchy placeowner_hier on placeowner_hier.parentid = place.id and placeowner_hier.primarytype = 'publicartPlaceOwnerGroup' and placeowner_hier.pos = 0
147161
LEFT JOIN hierarchy placeownerdate_hier on placeownerdate_hier.parentid = placeowner_hier.id
148162
LEFT JOIN publicartplaceownergroup placeowner on placeowner.id = placeowner_hier.id
@@ -254,19 +268,19 @@ $P!{whereclause}]]>
254268
<property name="com.jaspersoft.studio.field.label" value="currentlocationnote"/>
255269
<property name="com.jaspersoft.studio.field.tree.path" value="movements_common"/>
256270
</field>
257-
<field name="placementtype" class="java.lang.String">
258-
<property name="com.jaspersoft.studio.field.name" value="placementtype"/>
259-
<property name="com.jaspersoft.studio.field.label" value="placementtype"/>
271+
<field name="placementtypes" class="java.sql.Array">
272+
<property name="com.jaspersoft.studio.field.name" value="placementtypes"/>
273+
<property name="com.jaspersoft.studio.field.label" value="placementtypes"/>
260274
<property name="com.jaspersoft.studio.field.tree.path" value="places_publicart_placementtypes"/>
261275
</field>
262276
<field name="placementenvironment" class="java.lang.String">
263277
<property name="com.jaspersoft.studio.field.name" value="placementenvironment"/>
264278
<property name="com.jaspersoft.studio.field.label" value="placementenvironment"/>
265279
<property name="com.jaspersoft.studio.field.tree.path" value="places_publicart"/>
266280
</field>
267-
<field name="placetype" class="java.lang.String">
268-
<property name="com.jaspersoft.studio.field.name" value="placetype"/>
269-
<property name="com.jaspersoft.studio.field.label" value="placetype"/>
281+
<field name="placetypes" class="java.sql.Array">
282+
<property name="com.jaspersoft.studio.field.name" value="placetypes"/>
283+
<property name="com.jaspersoft.studio.field.label" value="placetypes"/>
270284
<property name="com.jaspersoft.studio.field.tree.path" value="places_publicart_publicartplacetypes"/>
271285
</field>
272286
<field name="placeowner" class="java.lang.String">
@@ -746,7 +760,7 @@ $P!{whereclause}]]>
746760
<reportElement style="Detail" x="2000" y="0" width="100" height="30" uuid="e703c8f3-255d-4e9b-86c2-6c3ff4a5d57c">
747761
<property name="com.jaspersoft.studio.unit.y" value="px"/>
748762
</reportElement>
749-
<textFieldExpression><![CDATA[$F{placementtype}]]></textFieldExpression>
763+
<textFieldExpression><![CDATA[$F{placementtypes}.getArray().join('; ')]]></textFieldExpression>
750764
</textField>
751765
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
752766
<reportElement style="Detail" x="2100" y="0" width="100" height="30" uuid="bf82c6ce-f8fa-4d71-975d-5aac2739aa36">
@@ -758,7 +772,7 @@ $P!{whereclause}]]>
758772
<reportElement style="Detail" x="2200" y="0" width="100" height="30" uuid="d8b3cb62-ef05-4108-a4d1-91eb6b40daf4">
759773
<property name="com.jaspersoft.studio.unit.y" value="px"/>
760774
</reportElement>
761-
<textFieldExpression><![CDATA[$F{placetype}]]></textFieldExpression>
775+
<textFieldExpression><![CDATA[$F{placetypes}.getArray().join('; ')]]></textFieldExpression>
762776
</textField>
763777
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
764778
<reportElement style="Detail" x="2300" y="0" width="100" height="30" uuid="0d2aedb2-b30d-46e2-8127-a28616a502c2">

0 commit comments

Comments
 (0)