dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11621
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3361: Made the get current design in the add/update report screen return te jrxml stream as an attachme...
------------------------------------------------------------
revno: 3361
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-04-12 15:07:35 +0200
message:
Made the get current design in the add/update report screen return te jrxml stream as an attachment instead of text in the browser
modified:
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/StreamActionSupport.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java
--
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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java 2011-04-01 09:57:53 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java 2011-04-12 13:07:35 +0000
@@ -248,13 +248,13 @@
public static void toJrxml( Grid grid, Writer writer )
throws Exception
{
- render(grid, writer);
+ render( grid, writer );
}
/**
- * Render using velocity
+ * Render using Velocity.
*/
- private static void render(Grid grid, Writer writer)
+ private static void render( Grid grid, Writer writer )
throws Exception
{
final VelocityEngine velocity = new VelocityEngine();
@@ -268,7 +268,5 @@
context.put( KEY_GRID, grid );
velocity.getTemplate( TEMPLATE ).merge( context, writer );
-
-
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/StreamActionSupport.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/StreamActionSupport.java 2011-01-18 10:23:08 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/util/StreamActionSupport.java 2011-04-12 13:07:35 +0000
@@ -81,7 +81,7 @@
protected boolean disallowCache()
{
- return false;
+ return true;
}
protected boolean attachment()
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java 2011-03-11 05:40:10 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/reportviewer/action/GetReportDesignAction.java 2011-04-12 13:07:35 +0000
@@ -69,12 +69,6 @@
}
// -------------------------------------------------------------------------
- // Output
- // -------------------------------------------------------------------------
-
- private String filename;
-
- // -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -88,8 +82,6 @@
out.write( report.getDesignContent().getBytes() );
}
- filename = CodecUtils.filenameEncode( report.getName() ) + EXT_JRXML;
-
return SUCCESS;
}
@@ -102,7 +94,9 @@
@Override
protected String getFilename()
{
- return filename;
+ Report report = reportService.getReport( id );
+
+ return CodecUtils.filenameEncode( report.getName() ) + EXT_JRXML;
}
@Override