dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17169
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6751: Made html view of report table data work
------------------------------------------------------------
revno: 6751
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-04-26 09:56:54 +0200
message:
Made html view of report table data work
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GridHeader.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/JacksonRowDataSerializer.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java
dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl
--
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-api/src/main/java/org/hisp/dhis/common/GridHeader.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GridHeader.java 2012-03-27 17:38:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GridHeader.java 2012-04-26 07:56:54 +0000
@@ -97,7 +97,7 @@
@JsonProperty
@JsonView( {DetailedView.class} )
- @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
+ @JacksonXmlProperty( isAttribute = true )
public String getName()
{
return name;
@@ -110,7 +110,7 @@
@JsonProperty
@JsonView( {DetailedView.class} )
- @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
+ @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
public String getColumn()
{
return column;
@@ -123,7 +123,7 @@
@JsonProperty
@JsonView( {DetailedView.class} )
- @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
+ @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
public String getType()
{
return type;
@@ -136,7 +136,7 @@
@JsonProperty
@JsonView( {DetailedView.class} )
- @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
+ @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
public boolean isHidden()
{
return hidden;
@@ -149,7 +149,7 @@
@JsonProperty
@JsonView( {DetailedView.class} )
- @JacksonXmlProperty(namespace = Dxf2Namespace.NAMESPACE)
+ @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
public boolean isMeta()
{
return meta;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/JacksonRowDataSerializer.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/JacksonRowDataSerializer.java 2012-04-25 22:37:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/JacksonRowDataSerializer.java 2012-04-26 07:56:54 +0000
@@ -40,6 +40,9 @@
public class JacksonRowDataSerializer
extends JsonSerializer<List<List<Object>>>
{
+ private static final String ROW_NAME = "row";
+ private static final String FIELD_NAME = "field";
+
@Override
public void serialize( List<List<Object>> values, JsonGenerator jgen, SerializerProvider provider ) throws IOException
{
@@ -49,7 +52,7 @@
{
if ( !b )
{
- jgen.writeFieldName( "row" );
+ jgen.writeFieldName( ROW_NAME );
}
b = false;
@@ -58,7 +61,7 @@
for ( Object object : value )
{
- jgen.writeStringField( "rowData", "" + object );
+ jgen.writeStringField( FIELD_NAME, "" + object );
}
jgen.writeEndObject();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java 2012-04-20 18:31:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java 2012-04-26 07:56:54 +0000
@@ -39,7 +39,6 @@
import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.common.adapter.JacksonPeriodTypeDeserializer;
import org.hisp.dhis.common.adapter.JacksonPeriodTypeSerializer;
-import org.hisp.dhis.common.annotation.Scanned;
import org.hisp.dhis.common.view.DetailedView;
import org.hisp.dhis.common.view.ExportView;
import org.hisp.dhis.expression.Expression;
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java 2012-04-25 22:37:28 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/ListGrid.java 2012-04-26 07:56:54 +0000
@@ -402,7 +402,9 @@
for ( Object value : column )
{
- if ( !MathUtils.isEqual( Double.parseDouble( String.valueOf( value ) ), 0d ) ) // 0 omitted from regression
+ // 0 omitted from regression
+
+ if ( !MathUtils.isEqual( Double.parseDouble( String.valueOf( value ) ), 0d ) )
{
regression.addData( index++, Double.parseDouble( String.valueOf( value ) ) );
}
@@ -414,7 +416,9 @@
{
final double predicted = regression.predict( i );
- if ( !Double.isNaN( predicted ) ) // Enough values must exist for regression
+ // Enough values must exist for regression
+
+ if ( !Double.isNaN( predicted ) )
{
regressionColumn.add( getRounded( predicted, 1 ) );
}
@@ -520,7 +524,8 @@
{
addHeader( new GridHeader( rsmd.getColumnLabel( i ), false, false ) );
}
- } catch ( SQLException ex )
+ }
+ catch ( SQLException ex )
{
throw new RuntimeException( ex );
}
@@ -541,7 +546,8 @@
addValue( rs.getObject( i ) );
}
}
- } catch ( SQLException ex )
+ }
+ catch ( SQLException ex )
{
throw new RuntimeException( ex );
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl 2012-04-08 20:23:29 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/grid.xsl 2012-04-26 07:56:54 +0000
@@ -14,7 +14,7 @@
<xsl:template match="d:row">
<tr>
- <xsl:for-each select="d:rowData">
+ <xsl:for-each select="d:field">
<td> <xsl:value-of select="."/> </td>
</xsl:for-each>
</tr>