dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #05346
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1751: Merge from 2.0.4 branch. Removed unnessecary transitive dependencies. Added javadocs
Merge authors:
Lars <larshelg@larshelg-laptop>
------------------------------------------------------------
revno: 1751 [merge]
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Thu 2010-04-08 16:13:44 +0200
message:
Merge from 2.0.4 branch. Removed unnessecary transitive dependencies. Added javadocs
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/FollowupAnalysisService.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/pom.xml
dhis-2/dhis-web/dhis-web-mapping/pom.xml
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-mapping/src/main/java/org/hisp/dhis/mapping/export/SVGUtils.java
dhis-2/pom.xml
--
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/dataanalysis/DataAnalysisStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisStore.java 2009-12-24 14:47:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisStore.java 2010-04-08 12:12:55 +0000
@@ -40,15 +40,59 @@
*/
public interface DataAnalysisStore
{
+ /**
+ * Calculates the standard deviation of the DataValues registered for the given
+ * data element, category option combo and organisation unit.
+ *
+ * @param dataElement the DataElement.
+ * @param categoryOptionCombo the DataElementCategoryOptionCombo.
+ * @param organisationUnit the OrganisationUnit.
+ * @return the standard deviation.
+ */
Double getStandardDeviation( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, OrganisationUnit organisationUnit );
+ /**
+ * Calculates the average of the DataValues registered for the given
+ * data element, category option combo and organisation unit.
+ *
+ * @param dataElement the DataElement.
+ * @param categoryOptionCombo the DataElementCategoryOptionCombo.
+ * @param organisationUnit the OrganisationUnit.
+ * @return the average.
+ */
Double getAverage( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, OrganisationUnit organisationUnit );
+ /**
+ * Returns a collection of DeflatedDataValues for the given input.
+ *
+ * @param dataElement the DataElement.
+ * @param categoryOptionCombo the DataElementCategoryOptionCombo.
+ * @param periods the collection of Periods.
+ * @param organisationUnit the OrganisationUnit.
+ * @param lowerBound the lower bound for the registered MinMaxDataElement.
+ * @param upperBound the upper bound for the registered MinMaxDataElement.
+ * @return
+ */
Collection<DeflatedDataValue> getDeflatedDataValues( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo,
Collection<Period> periods, OrganisationUnit organisationUnit, int lowerBound, int upperBound );
+ /**
+ * Returns a collection of gap DeflatedDataValues for the given input. A gap
+ * is a period for which there is no registered data values among the input periods.
+ *
+ * @param dataElement the DataElement.
+ * @param categoryOptionCombo the DataElementCategoryOptionCombo.
+ * @param periods the collection of Periods.
+ * @param organisationUnit the OrganisationUnit.
+ * @return
+ */
Collection<DeflatedDataValue> getDeflatedDataValueGaps( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo,
Collection<Period> periods, OrganisationUnit organisationUnit );
+ /**
+ * Returns a collection of DeflatedDataValues which are marked for followup.
+ *
+ * @return a collection of DeflatedDataValues.
+ */
Collection<DeflatedDataValue> getDataValuesMarkedForFollowup();
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/FollowupAnalysisService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/FollowupAnalysisService.java 2009-12-24 14:47:25 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/FollowupAnalysisService.java 2010-04-08 11:10:09 +0000
@@ -1,5 +1,32 @@
package org.hisp.dhis.dataanalysis;
+/*
+ * Copyright (c) 2004-${year}, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
import java.util.Collection;
import org.hisp.dhis.dataelement.DataElement;
@@ -7,6 +34,9 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.period.Period;
+/**
+ * @author Lars Helge Overland
+ */
public class FollowupAnalysisService
implements DataAnalysisService
{
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm 2010-04-07 15:43:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm 2010-04-08 11:10:09 +0000
@@ -42,7 +42,7 @@
<th>$i18n.getString( "available_dataelementgroup" )</th><td></td><th>$i18n.getString( "group_members" )</th>
</tr>
<tr>
- <td><input type="text" id="availableDataElementGroupsFilter" onkeyup="filterList( this.value, 'availableDataElements' )" style="width:25em"></td>
+ <td><input type="text" id="availableDataElementGroupsFilter" onkeyup="filterList( this.value, 'availableDataElementGroups' )" style="width:25em"></td>
<td style="text-align:center">< $i18n.getString( "filters" ) ></td>
<td><input type="text" id="groupMembersFilter" onkeyup="filterList( this.value, 'groupMembers' )" style="width:25em"></td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/pom.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/pom.xml 2010-03-12 11:05:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/pom.xml 2010-04-08 14:02:15 +0000
@@ -41,12 +41,12 @@
<!-- Other -->
- <dependency>
- <groupId>net.sf.json-lib</groupId>
- <artifactId>json-lib</artifactId>
- <version>2.3</version>
- <classifier>jdk15</classifier>
- </dependency>
+ <dependency>
+ <groupId>net.sf.json-lib</groupId>
+ <artifactId>json-lib</artifactId>
+ <version>2.3</version>
+ <classifier>jdk15</classifier>
+ </dependency>
</dependencies>
<properties>
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/pom.xml'
--- dhis-2/dhis-web/dhis-web-mapping/pom.xml 2010-03-25 17:42:43 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/pom.xml 2010-04-08 14:02:15 +0000
@@ -80,95 +80,23 @@
<!-- JSON -->
<dependency>
- <groupId>net.sf.json-lib</groupId>
- <artifactId>json-lib</artifactId>
- <version>2.2.3</version>
- <classifier>jdk15</classifier>
+ <groupId>net.sf.json-lib</groupId>
+ <artifactId>json-lib</artifactId>
+ <version>2.3</version>
+ <classifier>jdk15</classifier>
</dependency>
<!-- Batik -->
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-dom</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-script</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-svg-dom</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-svggen</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-transcoder</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-util</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-awt-util</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-anim</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-css</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-bridge</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-gvt</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis-ext</artifactId>
- <version>1.3.04</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-ext</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-codec</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-parser</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-xml</artifactId>
- <version>1.7</version>
- </dependency>
-
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>batik-transcoder</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>batik-codec</artifactId>
+ </dependency>
+
</dependencies>
<repositories>
=== 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 2010-04-06 17:41:30 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportExcelAction.java 2010-04-08 11:37:23 +0000
@@ -47,6 +47,8 @@
import net.sf.json.JSONSerializer;
import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.indicator.Indicator;
@@ -67,6 +69,8 @@
public class ExportExcelAction
extends StreamActionSupport
{
+ private static final Log log = LogFactory.getLog( ExportExcelAction.class );
+
// -------------------------------------------------------------------------
// Map position in excel
// -------------------------------------------------------------------------
@@ -208,6 +212,8 @@
protected String execute( HttpServletResponse response, OutputStream out )
throws Exception
{
+ log.info( "Exporting workbook, width: " + width + ", height: " + height );
+
Period p = periodService.getPeriod( period );
p.setName( format.formatPeriod( p ) );
=== 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 2010-04-06 17:41:30 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/ExportImageAction.java 2010-04-08 11:37:23 +0000
@@ -30,6 +30,8 @@
import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.indicator.IndicatorService;
@@ -46,6 +48,8 @@
public class ExportImageAction
extends StreamActionSupport
{
+ private static final Log log = LogFactory.getLog( ExportImageAction.class );
+
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -130,11 +134,13 @@
{
this.height = height;
}
-
+
@Override
protected String execute( HttpServletResponse response, OutputStream out )
throws Exception
- {
+ {
+ log.info( "Exporting image, width: " + width + ", height: " + height );
+
SVGUtils.convertToPNG( getSvg(), out, width, height );
return SUCCESS;
@@ -153,7 +159,7 @@
}
private StringBuffer getSvg()
- {
+ {
Period p = periodService.getPeriod( period );
p.setName( format.formatPeriod( p ) );
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/export/SVGUtils.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/export/SVGUtils.java 2010-04-06 16:55:11 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/export/SVGUtils.java 2010-04-08 11:10:09 +0000
@@ -27,9 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
@@ -43,48 +40,16 @@
* @author Tran Thanh Tri
*/
public class SVGUtils
-{
- public static void convertSVG2PNG( File svgFile, File outputImage, Integer w, Integer h )
- throws TranscoderException, IOException
- {
- if ( w == null )
- {
- w = 500;
- }
-
- if ( h == null )
- {
- h = 500;
- }
-
- PNGTranscoder t = new PNGTranscoder();
-
- // Set the transcoding hints
- t.addTranscodingHint( PNGTranscoder.KEY_HEIGHT, new Float( h ) );
- t.addTranscodingHint( PNGTranscoder.KEY_WIDTH, new Float( w ) );
-
- TranscoderInput input = new TranscoderInput( new FileInputStream( svgFile ) );
- // Create the transcoder output
- OutputStream ostream = new FileOutputStream( outputImage );
- TranscoderOutput output = new TranscoderOutput( ostream );
-
- // Save the image
- t.transcode( input, output );
-
- // Flush and close the stream
- ostream.flush();
- ostream.close();
- }
-
+{
public static void convertToPNG( StringBuffer buffer, OutputStream out, Integer width, Integer height )
throws TranscoderException, IOException
{
- if ( width == null )
+ if ( width == null || width < 10 )
{
width = 500;
}
- if ( height == null )
+ if ( height == null || height < 10 )
{
height = 500;
}
=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml 2010-03-25 08:25:46 +0000
+++ dhis-2/pom.xml 2010-04-08 14:02:15 +0000
@@ -262,6 +262,20 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.1.6</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>velocity</groupId>
@@ -404,6 +418,12 @@
<groupId>org.amplecode</groupId>
<artifactId>cave-process</artifactId>
<version>1.0.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>joda-time</groupId>
@@ -505,7 +525,7 @@
<groupId>jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>3.7.0</version>
- <exclusions>
+ <exclusions>
<exclusion>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
@@ -566,6 +586,23 @@
<scope>test</scope>
<type>jar</type>
</dependency>
+ <!-- GIS -->
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>batik-transcoder</artifactId>
+ <version>1.7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xmlgraphics</groupId>
+ <artifactId>batik-codec</artifactId>
+ <version>1.7</version>
+ </dependency>
<!-- Relaxng schema validation. -->
<dependency>