Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

upgraded plugin to Grails 2.0 and some minor changes.

  • Loading branch information...
commit 14ea4af42e4af35befa3ccd22c43a9b6e332140f 1 parent 111d6c1
Jean Barmash authored
12 application.properties
View
@@ -1,8 +1,8 @@
#Grails Metadata file
-#Mon Sep 05 15:43:28 EDT 2011
-app.grails.version=1.3.6
+#Sun Jan 08 00:55:36 EST 2012
+app.grails.version=2.0.0
app.name=excel-import
-plugins.hibernate=1.3.6
-plugins.joda-time=1.2
-plugins.release=1.0.0.RC3
-plugins.tomcat=1.3.6
+plugins.hibernate=2.0.0
+plugins.joda-time=1.3.1
+plugins.release=1.0.0
+plugins.tomcat=2.0.0
29 src/groovy/org/grails/plugins/excelimport/AbstractExcelImporter.groovy
View
@@ -10,11 +10,7 @@ import org.apache.poi.ss.usermodel.*
*/
public abstract class AbstractExcelImporter extends imexporter.AbstractImexporter {
- static def getExcelImportService() {
- def ctx = org.codehaus.groovy.grails.commons.ApplicationHolder.application.mainContext;
- return ctx.getBean("excelImportService");
- }
-
+
@Deprecated
InputStream inStr = null
@@ -26,8 +22,7 @@ public abstract class AbstractExcelImporter extends imexporter.AbstractImexporte
@Deprecated
public AbstractExcelImporter(String fileName) {
- inStr = new FileInputStream(fileName)
- this.read(inStr)
+ this.read(fileName)
}
@Deprecated
@@ -40,6 +35,14 @@ public abstract class AbstractExcelImporter extends imexporter.AbstractImexporte
}
@Override
+ protected def read(String fileName) {
+ inStr = new FileInputStream(fileName)
+ this.read(inStr)
+ }
+
+
+
+ @Override
protected def read(InputStream inp) {
workbook = WorkbookFactory.create(inp)
evaluator = workbook.creationHelper.createFormulaEvaluator()
@@ -57,17 +60,7 @@ public abstract class AbstractExcelImporter extends imexporter.AbstractImexporte
return this
}
- def copyFromCsv(csvFormat) {
- def currentSheet = workbook.getSheet('Sheet1')
- csvFormat.tokensList.eachWithIndex {tokens, rowIndex ->
- def row = currentSheet.getRow(rowIndex) ?: currentSheet.createRow(rowIndex)
- tokens.eachWithIndex {value, colIndex ->
- excelImportService.setCellValueByColIndex(value, row, colIndex)
- }
- }
- return this
- }
-
+
def evaluateAllFormulaCells() {
for(int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) {
25 web-app/WEB-INF/tld/c.tld
View
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
-
- <description>JSTL 1.1 core library</description>
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ version="2.1">
+
+ <description>JSTL 1.2 core library</description>
<display-name>JSTL core</display-name>
- <tlib-version>1.1</tlib-version>
+ <tlib-version>1.2</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>
@@ -74,7 +74,7 @@ not the body content should be processed.
<description>
Name of the exported scoped variable for the
resulting value of the test condition. The type
-of the scoped variable is Boolean.
+of the scoped variable is Boolean.
</description>
<name>var</name>
<required>false</required>
@@ -174,6 +174,9 @@ Collection of items to iterate over.
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
+ <deferred-value>
+ <type>java.lang.Object</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
@@ -253,6 +256,9 @@ String of tokens to iterate over.
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
+ <deferred-value>
+ <type>java.lang.String</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
@@ -322,7 +328,7 @@ visibility.
<tag>
<description>
Like &lt;%= ... &gt;, but for expressions.
- </description>
+ </description>
<name>out</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
<body-content>JSP</body-content>
@@ -467,6 +473,9 @@ Expression to be evaluated.
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
+ <deferred-value>
+ <type>java.lang.Object</type>
+ </deferred-value>
</attribute>
<attribute>
<description>
16 web-app/WEB-INF/tld/fmt.tld
View
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
- version="2.0">
-
- <description>JSTL 1.1 i18n-capable formatting library</description>
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ version="2.1">
+
+ <description>JSTL 1.2 i18n-capable formatting library</description>
<display-name>JSTL fmt</display-name>
- <tlib-version>1.1</tlib-version>
+ <tlib-version>1.2</tlib-version>
<short-name>fmt</short-name>
<uri>http://java.sun.com/jsp/jstl/fmt</uri>
@@ -55,7 +55,7 @@ and may contain a two-letter (upper-case)
country code (as defined by ISO-3166).
Language and country codes must be
separated by hyphen (-) or underscore
-(_).
+(_).
</description>
<name>value</name>
<required>true</required>
@@ -496,7 +496,7 @@ Date and/or time to be formatted.
<description>
Specifies whether the time, the date, or both
the time and date components of the given
-date are to be formatted.
+date are to be formatted.
</description>
<name>type</name>
<required>false</required>
Please sign in to comment.
Something went wrong with that request. Please try again.