dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14883
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5176: Minor fixes.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5176 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-11-16 19:54:56 +0000
message:
Minor fixes.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java
dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java
dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/ExportImageAction.java
dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/export/SVGDocument.java
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/exportimage.png
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/index.html
--
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-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java 2011-11-10 20:57:29 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java 2011-11-16 19:37:51 +0000
@@ -332,4 +332,4 @@
{
return "DHIS_2_GIS.xls";
}
-}
+}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java 2011-11-16 16:29:35 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java 2011-11-16 19:37:51 +0000
@@ -33,6 +33,7 @@
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.mapping.export.SVGDocument;
import org.hisp.dhis.mapping.export.SVGUtils;
+import org.hisp.dhis.system.util.CodecUtils;
import org.hisp.dhis.util.ContextUtils;
import org.hisp.dhis.util.SessionUtils;
import org.hisp.dhis.util.StreamActionSupport;
@@ -199,7 +200,7 @@
@Override
protected String getFilename()
{
- return "DHIS2_GIS_" + this.title + ".png";
+ return "dhis2_gis_" + CodecUtils.filenameEncode( this.title ) + ".png";
}
@Override
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/ExportImageAction.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/ExportImageAction.java 2011-11-16 16:29:35 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/ExportImageAction.java 2011-11-16 19:23:27 +0000
@@ -33,6 +33,7 @@
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.visualizer.export.SVGDocument;
import org.hisp.dhis.visualizer.export.SVGUtils;
+import org.hisp.dhis.system.util.CodecUtils;
import org.hisp.dhis.util.ContextUtils;
import org.hisp.dhis.util.SessionUtils;
import org.hisp.dhis.util.StreamActionSupport;
@@ -54,6 +55,13 @@
// -------------------------------------------------------------------------
// Output & input
// -------------------------------------------------------------------------
+
+ private String title;
+
+ public void setTitle( String title )
+ {
+ this.title = title;
+ }
private String svg;
@@ -82,7 +90,7 @@
protected String execute( HttpServletResponse response, OutputStream out )
throws Exception
{
- if ( svg == null || width == null || height == null )
+ if ( title == null || svg == null || width == null || height == null )
{
log.info( "Export map from session" );
@@ -94,6 +102,7 @@
svgDocument = new SVGDocument();
+ svgDocument.setTitle( this.title );
svgDocument.setSvg( this.svg );
svgDocument.setWidth( this.width );
svgDocument.setHeight( this.height );
@@ -115,7 +124,7 @@
@Override
protected String getFilename()
{
- return "DHIS2_Visualizer.png";
+ return "dhis2_dv_" + CodecUtils.filenameEncode( this.title ) + ".png";
}
@Override
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/export/SVGDocument.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/export/SVGDocument.java 2011-11-16 16:29:35 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/export/SVGDocument.java 2011-11-16 19:23:27 +0000
@@ -37,6 +37,8 @@
+ "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" ["
+ "<!ATTLIST svg xmlns:attrib CDATA #IMPLIED> <!ATTLIST path attrib:divname CDATA #IMPLIED>]>";
+ private String title;
+
private String svg;
private int width;
@@ -60,6 +62,17 @@
return svg;
}
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle( String title )
+ {
+ this.title = title;
+
+ }
+
public String getSvg()
{
return svg;
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js 2011-11-16 16:29:35 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js 2011-11-16 19:23:27 +0000
@@ -344,8 +344,8 @@
getEncodedSeriesName: function(text) {
return text.replace(/\./g,'');
},
- getLegend: function() {
- var len = DV.state.series.data.length;
+ getLegend: function(len) {
+ len = len ? len : DV.state.series.data.length;
return {
position: len > 6 ? 'right' : 'top',
boxStroke: '#ffffff',
@@ -942,7 +942,7 @@
store: DV.store.chart,
insetPadding: 60,
items: DV.util.chart.getTitle(),
- legend: DV.util.chart.getLegend(),
+ legend: DV.util.chart.getLegend(DV.state.category.data.length),
series: [{
type: 'pie',
field: DV.store.chart.left[0],
@@ -1843,6 +1843,7 @@
return;
}
+ document.getElementById('titleField').value = DV.state.filter.data[0];
document.getElementById('svgField').value = svg[0].parentNode.innerHTML;
document.getElementById('widthField').value = DV.util.viewport.getSize().x - 100;
document.getElementById('heightField').value = DV.util.viewport.getSize().y - 100;
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/exportimage.png'
Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/exportimage.png 2011-11-16 16:29:35 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/exportimage.png 2011-11-16 19:23:27 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/index.html'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/index.html 2011-11-16 16:29:35 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/index.html 2011-11-16 19:23:27 +0000
@@ -9,6 +9,7 @@
<script type="text/javascript" src="app.js"></script>
<form id="exportPNGForm" method="post">
+ <input type="hidden" id="titleField" name="title"/>
<input type="hidden" id="svgField" name="svg"/>
<input type="hidden" id="widthField" name="width"/>
<input type="hidden" id="heightField" name="height"/>