Add Java dependency for charts module to Gradle
Version 2.5.7 of JXL is closest available version (2.4.3)
⚠️ Modules were not tested after upgrade
This commit is contained in:
parent
2f8160526c
commit
aea04da690
4 changed files with 9 additions and 8 deletions
16
modules/helma/Chart.js
vendored
16
modules/helma/Chart.js
vendored
|
@ -18,12 +18,12 @@
|
|||
/**
|
||||
* @fileoverview Fields and methods of the helma.Chart prototype
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/helma/Chart.js')
|
||||
*/
|
||||
|
||||
// take care of any dependencies
|
||||
app.addRepository('modules/helma/jxl.jar');
|
||||
app.addRepository('modules/helma/jxl-2.5.7.jar');
|
||||
|
||||
/**
|
||||
* Define the global namespace if not existing
|
||||
|
@ -55,12 +55,12 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
|
||||
var workbook, file;
|
||||
try {
|
||||
file = new java.io.File(fpath);
|
||||
file = new java.io.File(fpath);
|
||||
workbook = JXLPKG.getWorkbook(file);
|
||||
} catch (e) {
|
||||
if (e instanceof TypeError == false)
|
||||
throw(e);
|
||||
throw("helma.Chart needs " + JXLPKGNAME +
|
||||
throw("helma.Chart needs " + JXLPKGNAME +
|
||||
" in lib/ext or application directory " +
|
||||
"[" + JXLPKGURL + "]");
|
||||
}
|
||||
|
@ -98,9 +98,9 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
* Renders the Excel spreadsheet as XHTML table.
|
||||
*/
|
||||
this.render = function() {
|
||||
res.write('<table border="0" cellspacing="1" class="' +
|
||||
res.write('<table border="0" cellspacing="1" class="' +
|
||||
prefix + 'table">\n');
|
||||
|
||||
|
||||
var rowBuf = [];
|
||||
var rows = sheet.getRows();
|
||||
var max = 0;
|
||||
|
@ -110,7 +110,7 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
max = row.length;
|
||||
rowBuf.push(row);
|
||||
}
|
||||
|
||||
|
||||
for (var i in rowBuf) {
|
||||
res.write('<tr class="' + prefix + 'row">\n');
|
||||
for (var n=0; n<max; n+=1) {
|
||||
|
@ -145,7 +145,7 @@ helma.Chart = function(fpath, prefix, sheetName) {
|
|||
}
|
||||
res.write('</tr>\n');
|
||||
}
|
||||
|
||||
|
||||
res.write('</table>\n');
|
||||
workbook.close();
|
||||
};
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
dependencies {
|
||||
runtime 'ch.ethz.ganymed:ganymed-ssh2:build208'
|
||||
runtime 'net.sourceforge.jexcelapi:jxl:2.5.7'
|
||||
}
|
||||
|
||||
task deps(type: Copy) {
|
||||
|
|
BIN
modules/helma/jxl-2.5.7.jar
Normal file
BIN
modules/helma/jxl-2.5.7.jar
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue