dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20400
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9292: local vn - Up POI version to 2.9 and missing fixed
------------------------------------------------------------
revno: 9292
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-12-13 15:59:31 +0700
message:
local vn - Up POI version to 2.9 and missing fixed
modified:
local/vn/dhis-web-spreadsheet-reporting/pom.xml
local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportitem/action/ValidationFormulaAction.java
local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/utils/ExcelUtils.java
local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/menu.vm
local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/showAutoGenerateForm.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 'local/vn/dhis-web-spreadsheet-reporting/pom.xml'
--- local/vn/dhis-web-spreadsheet-reporting/pom.xml 2012-11-26 09:12:15 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/pom.xml 2012-12-13 08:59:31 +0000
@@ -69,7 +69,8 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
- <version>3.5-FINAL</version>
+ <!--version>3.5-FINAL</version-->
+ <version>3.9</version>
</dependency>
<!-- Used for Ms Office 2007 and over -->
@@ -77,13 +78,15 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
- <version>3.5-FINAL</version>
+ <!--version>3.5-FINAL</version-->
+ <version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
- <version>3.5-FINAL</version>
+ <!--version>3.5-FINAL</version-->
+ <version>3.9</version>
</dependency>
<!---->
=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportitem/action/ValidationFormulaAction.java'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportitem/action/ValidationFormulaAction.java 2011-07-28 09:50:39 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/exportitem/action/ValidationFormulaAction.java 2012-12-13 08:59:31 +0000
@@ -49,7 +49,6 @@
this.formula = formula;
}
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/utils/ExcelUtils.java'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/utils/ExcelUtils.java 2012-12-12 09:34:51 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/utils/ExcelUtils.java 2012-12-13 08:59:31 +0000
@@ -48,6 +48,7 @@
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.formula.FormulaParser;
import org.apache.poi.ss.formula.FormulaParsingWorkbook;
+import org.apache.poi.ss.formula.FormulaType;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.DateUtil;
@@ -615,15 +616,30 @@
{
try
{
- FormulaParser.parse( formula, evaluationWorkbook );
- }
- catch ( Exception e )
- {
- return false;
- }
-
- return true;
- }
+ FormulaParser.parse( formula, evaluationWorkbook, FormulaType.CELL, -1 );
+ }
+ catch ( Exception e )
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static boolean isValidFormula( String formula, int formulaType, int sheetIndex )
+ {
+ try
+ {
+ FormulaParser.parse( formula, evaluationWorkbook, formulaType, sheetIndex );
+ }
+ catch ( Exception e )
+ {
+ return false;
+ }
+
+ return true;
+ }
+
// -------------------------------------------------------------------------
// Supportive methods
=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/menu.vm'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/menu.vm 2012-12-12 05:14:59 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/menu.vm 2012-12-13 08:59:31 +0000
@@ -20,9 +20,9 @@
<li><a href="getImportingParams.action">$i18n.getString( "import" ) </a></li>
</ul>
-<h2><a href="showAutoGenerateForm.action">$i18n.getString( "auto_generate_form_by_template" ) </a></h2>
+<h2><a href="showAutoGenerateForm.action">$i18n.getString( "automate" ) </a></h2>
<ul>
- <li><a href="showAutoGenerateForm.action">$i18n.getString( "auto_generate_form_by_template" ) </a></li>
+ <li><a href="showAutoGenerateForm.action">$i18n.getString( "generate_form" ) </a></li>
</ul>
<script type="text/javascript">
=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/showAutoGenerateForm.vm'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/showAutoGenerateForm.vm 2012-12-12 05:14:59 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/webapp/dhis-web-spreadsheet-reporting/showAutoGenerateForm.vm 2012-12-13 08:59:31 +0000
@@ -9,7 +9,7 @@
<span id="message" style="top:70px;right:5px;position:fixed;width:200px;z-index:100009" onclick="hideById(this.id);"></span>
<table width="82%">
- <h3>$i18n.getString( 'auto_generate_form_by_template' ) #openHelp( "" )</h3>
+ <h3>$i18n.getString( 'auto_generate_form' ) #openHelp( "" )</h3>
<form name="uploadForm" id="uploadForm" action="autoGenerateFormByTemplate.action" method="POST" enctype="multipart/form-data">
<tr>
<td width="18%" style=" width:25% ">$i18n.getString( 'select_excel_file' )</td>
@@ -23,5 +23,9 @@
</table>
<div id="previewDiv"></div>
-
-</body>
\ No newline at end of file
+</body>
+
+
+<script type="text/javascript">
+ var i18n_auto_generate_form_completed = '$encoder.jsEscape( $i18n.getString("auto_generate_form_completed"), "'" )';
+</script>
\ No newline at end of file