dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09294
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2423: Simplified distribution report
------------------------------------------------------------
revno: 2423
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2010-12-25 15:36:08 +0100
message:
Simplified distribution report
modified:
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/style/dhis-web-reporting.css
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java 2010-12-14 11:36:39 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/orgunitdistribution/impl/DefaultOrgUnitDistributionService.java 2010-12-25 14:36:08 +0000
@@ -62,6 +62,8 @@
private static final Comparator<OrganisationUnit> ORGUNIT_COMPARATOR = new OrganisationUnitNameComparator();
private static final Comparator<OrganisationUnitGroup> ORGUNIT_GROUP_COMPARATOR = new OrganisationUnitGroupNameComparator();
+ private static final String TITLE_SEP = " - ";
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -97,7 +99,7 @@
categoryValues.put( grid.getRow( 0 ).get( i ), Double.valueOf( grid.getRow( 1 ).get( i ) ) );
}
- String title = groupSet.getName() + " - " + organisationUnit.getName();
+ String title = groupSet.getName() + TITLE_SEP + organisationUnit.getName();
JFreeChart chart = chartService.getJFreeChart( title, PlotOrientation.VERTICAL, CategoryLabelPositions.DOWN_45, categoryValues );
@@ -110,7 +112,7 @@
public Grid getOrganisationUnitDistribution( OrganisationUnitGroupSet groupSet, OrganisationUnit organisationUnit, boolean organisationUnitOnly )
{
Grid grid = new ListGrid();
- grid.nextRow();
+ grid.setTitle( groupSet.getName() + TITLE_SEP + organisationUnit.getName() );
List<OrganisationUnit> units = organisationUnitOnly ? Arrays.asList( organisationUnit ) : new ArrayList<OrganisationUnit>( organisationUnit.getChildren() );
List<OrganisationUnitGroup> groups = new ArrayList<OrganisationUnitGroup>( groupSet.getOrganisationUnitGroups() );
@@ -118,14 +120,14 @@
Collections.sort( units, ORGUNIT_COMPARATOR );
Collections.sort( groups, ORGUNIT_GROUP_COMPARATOR );
- grid.addValue( "" ); // First header row column is empty
+ grid.addHeader( null ); // First header row column is empty
- for ( OrganisationUnitGroup group : groups ) // Header row
+ for ( OrganisationUnitGroup group : groups )
{
- grid.addValue( group.getName() );
+ grid.addHeader( group.getName() );
}
- for ( OrganisationUnit unit : units ) // Rows
+ for ( OrganisationUnit unit : units )
{
grid.nextRow();
grid.addValue( unit.getName() );
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionAction.java 2010-12-14 11:36:39 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/orgunitdistribution/action/GetOrgUnitDistributionAction.java 2010-12-25 14:36:08 +0000
@@ -108,11 +108,11 @@
return selectedGroupSet;
}
- private Grid distribution;
+ private Grid grid;
- public Grid getDistribution()
+ public Grid getGrid()
{
- return distribution;
+ return grid;
}
// -------------------------------------------------------------------------
@@ -133,7 +133,7 @@
log.info( "Get distribution for group set: " + selectedGroupSet + " and organisation unit: " + selectedOrganisationUnit );
- distribution = distributionService.getOrganisationUnitDistribution( selectedGroupSet, selectedOrganisationUnit, false );
+ grid = distributionService.getOrganisationUnitDistribution( selectedGroupSet, selectedOrganisationUnit, false );
}
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/style/dhis-web-reporting.css'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/style/dhis-web-reporting.css 2010-12-14 11:36:39 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/style/dhis-web-reporting.css 2010-12-25 14:36:08 +0000
@@ -1,6 +1,11 @@
-.oud
+.gridTable th, .gridTable td
{
text-align: center;
width: 150px;
}
+
+.gridLeft td
+{
+ text-align: left;
+}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm 2010-12-14 11:36:39 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm 2010-12-25 14:36:08 +0000
@@ -42,29 +42,27 @@
<!-- Table -->
-#if( $distribution )
+#if( $grid )
<div id="tableDiv">
-<table class="listTable">
+<table class="listTable gridTable">
<thead>
<tr>
-#foreach( $col in $distribution.getRow( 0 ) )
-<th class="oud">$encoder.htmlEncode( $col )</th>
+#foreach( $header in $grid.getHeaders() )
+<th>$!encoder.htmlEncode( $header )</th>
#end
</tr>
</thead>
<tbody>
-#foreach( $row in $distribution.getRows() )
-#if( $velocityCount > 1 )
+#foreach( $row in $grid.getRows() )
<tr>
#foreach( $col in $row )
-<td #if( $velocityCount > 1 )class="oud"#end>${col}</td>
+<td #if( $velocityCount == 1 )style="text-align:left"#end>$!encoder.htmlEncode( $col )</td>
#end
</tr>
-#end
#end
</tbody>