Index: lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java =================================================================== diff -u -rd5b05f6e239a87908856f9f4251a487158ed9ca8 -rfb1f64c71c4639656caf445c16c8409035bc74b8 --- lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java (.../ImportService.java) (revision d5b05f6e239a87908856f9f4251a487158ed9ca8) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java (.../ImportService.java) (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -37,6 +37,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.logevent.LogEvent; import org.lamsfoundation.lams.logevent.service.ILogEventService; @@ -604,7 +605,7 @@ if (cell != null) { String value; try { - cell.setCellType(Cell.CELL_TYPE_STRING); + cell.setCellType(CellType.STRING); if (cell.getStringCellValue() != null) { if (cell.getStringCellValue().trim().length() != 0) { emptyRow = false; @@ -614,7 +615,7 @@ } value = cell.getStringCellValue().trim(); } catch (Exception e) { - cell.setCellType(Cell.CELL_TYPE_NUMERIC); + cell.setCellType(CellType.NUMERIC); double d = cell.getNumericCellValue(); emptyRow = false; value = new Long(new Double(d).longValue()).toString(); @@ -629,7 +630,7 @@ private String parseStringCell(HSSFCell cell) { if (cell != null) { try { - cell.setCellType(Cell.CELL_TYPE_STRING); + cell.setCellType(CellType.STRING); if (cell.getStringCellValue() != null) { if (cell.getStringCellValue().trim().length() != 0) { emptyRow = false; @@ -640,7 +641,7 @@ // log.debug("string cell value: '"+cell.getStringCellValue().trim()+"'"); return cell.getStringCellValue().trim(); } catch (Exception e) { - cell.setCellType(Cell.CELL_TYPE_NUMERIC); + cell.setCellType(CellType.NUMERIC); double d = cell.getNumericCellValue(); emptyRow = false; // log.debug("numeric cell value: '"+d+"'"); @@ -669,7 +670,7 @@ String roleDescription = ""; if (cell != null) { try { - cell.setCellType(Cell.CELL_TYPE_STRING); + cell.setCellType(CellType.STRING); if ((cell.getStringCellValue() != null) || (cell.getStringCellValue().trim().length() != 0)) { emptyRow = false; } else { Index: lams_build/3rdParty.userlibraries =================================================================== diff -u -r266434d5ec15cc4026c93a740c3110c046b1d88a -rfb1f64c71c4639656caf445c16c8409035bc74b8 --- lams_build/3rdParty.userlibraries (.../3rdParty.userlibraries) (revision 266434d5ec15cc4026c93a740c3110c046b1d88a) +++ lams_build/3rdParty.userlibraries (.../3rdParty.userlibraries) (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -24,9 +24,9 @@ - - - + + + Index: lams_build/lib/apache-poi/poi-3.16.jar =================================================================== diff -u -re08e9d27daa3991d64dd1c424c9fe9494588e7c7 -rfb1f64c71c4639656caf445c16c8409035bc74b8 Binary files differ Index: lams_build/lib/apache-poi/poi-3.17.jar =================================================================== diff -u Binary files differ Index: lams_build/lib/apache-poi/poi-ooxml-3.16.jar =================================================================== diff -u -re08e9d27daa3991d64dd1c424c9fe9494588e7c7 -rfb1f64c71c4639656caf445c16c8409035bc74b8 Binary files differ Index: lams_build/lib/apache-poi/poi-ooxml-3.17.jar =================================================================== diff -u Binary files differ Index: lams_build/lib/apache-poi/poi-ooxml-schemas-3.16.jar =================================================================== diff -u -re08e9d27daa3991d64dd1c424c9fe9494588e7c7 -rfb1f64c71c4639656caf445c16c8409035bc74b8 Binary files differ Index: lams_build/lib/apache-poi/poi-ooxml-schemas-3.17.jar =================================================================== diff -u Binary files differ Index: lams_build/lib/apache-poi/poi.module.xml =================================================================== diff -u -re08e9d27daa3991d64dd1c424c9fe9494588e7c7 -rfb1f64c71c4639656caf445c16c8409035bc74b8 --- lams_build/lib/apache-poi/poi.module.xml (.../poi.module.xml) (revision e08e9d27daa3991d64dd1c424c9fe9494588e7c7) +++ lams_build/lib/apache-poi/poi.module.xml (.../poi.module.xml) (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -24,13 +24,14 @@ - - - + + + + \ No newline at end of file Index: lams_build/liblist.txt =================================================================== diff -u -r266434d5ec15cc4026c93a740c3110c046b1d88a -rfb1f64c71c4639656caf445c16c8409035bc74b8 --- lams_build/liblist.txt (.../liblist.txt) (revision 266434d5ec15cc4026c93a740c3110c046b1d88a) +++ lams_build/liblist.txt (.../liblist.txt) (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -2,9 +2,9 @@ Folder Library Version License Vendor Description -apache-poi poi-3.16.jar 3.16 Apache License 2.0 Apache the Java API for Microsoft Documents - poi-ooxml-3.16.jar - poi-ooxml-schemas-3.16.jar +apache-poi poi-3.17.jar 3.17 Apache License 2.0 Apache the Java API for Microsoft Documents + poi-ooxml-3.17.jar + poi-ooxml-schemas-3.17.jar xmlbeans-2.6.0.jar 2.6.0 autopatch autopatch-1.4.2-lams.jar 1.4.2-lams Apache License Tacit Knowledge automated Java patching system Index: lams_common/src/java/org/lamsfoundation/lams/util/ExcelUtil.java =================================================================== diff -u -r1aff6aeac19473c0089c0f3ff578a183beb92555 -rfb1f64c71c4639656caf445c16c8409035bc74b8 --- lams_common/src/java/org/lamsfoundation/lams/util/ExcelUtil.java (.../ExcelUtil.java) (revision 1aff6aeac19473c0089c0f3ff578a183beb92555) +++ lams_common/src/java/org/lamsfoundation/lams/util/ExcelUtil.java (.../ExcelUtil.java) (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -30,15 +30,19 @@ import org.apache.commons.lang.StringUtils; import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.util.CellUtil; import org.apache.poi.ss.util.WorkbookUtil; +import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; /** @@ -130,29 +134,29 @@ //create bold style boldStyle = workbook.createCellStyle(); Font boldFont = workbook.createFont(); - boldFont.setBoldweight(Font.BOLDWEIGHT_BOLD); + boldFont.setBold(true); boldFont.setFontName(DEFAULT_FONT_NAME); boldStyle.setFont(boldFont); //create color style blueColor = workbook.createCellStyle(); blueColor.setFillForegroundColor(IndexedColors.LIGHT_CORNFLOWER_BLUE.getIndex()); - blueColor.setFillPattern(CellStyle.SOLID_FOREGROUND); + blueColor.setFillPattern(FillPatternType.SOLID_FOREGROUND); blueColor.setFont(defaultFont); redColor = workbook.createCellStyle(); redColor.setFillForegroundColor(IndexedColors.RED.getIndex()); - redColor.setFillPattern(CellStyle.SOLID_FOREGROUND); + redColor.setFillPattern(FillPatternType.SOLID_FOREGROUND); redColor.setFont(defaultFont); greenColor = workbook.createCellStyle(); greenColor.setFillForegroundColor(IndexedColors.LIME.getIndex()); - greenColor.setFillPattern(CellStyle.SOLID_FOREGROUND); + greenColor.setFillPattern(FillPatternType.SOLID_FOREGROUND); Font whiteFont = workbook.createFont(); whiteFont.setColor(IndexedColors.WHITE.getIndex()); whiteFont.setFontName(DEFAULT_FONT_NAME); greenColor.setFont(whiteFont); yellowColor = workbook.createCellStyle(); yellowColor.setFillForegroundColor(IndexedColors.GOLD.getIndex()); - yellowColor.setFillPattern(CellStyle.SOLID_FOREGROUND); + yellowColor.setFillPattern(FillPatternType.SOLID_FOREGROUND); yellowColor.setFont(defaultFont); // create percentage style @@ -162,44 +166,44 @@ //create border style borderStyleLeftThin = workbook.createCellStyle(); - borderStyleLeftThin.setBorderLeft(CellStyle.BORDER_THIN); + borderStyleLeftThin.setBorderLeft(BorderStyle.THIN); borderStyleLeftThin.setFont(defaultFont); borderStyleLeftThick = workbook.createCellStyle(); - borderStyleLeftThick.setBorderLeft(CellStyle.BORDER_THICK); + borderStyleLeftThick.setBorderLeft(BorderStyle.THICK); borderStyleLeftThick.setFont(defaultFont); borderStyleRightThick = workbook.createCellStyle(); - borderStyleRightThick.setBorderRight(CellStyle.BORDER_THICK); + borderStyleRightThick.setBorderRight(BorderStyle.THICK); borderStyleRightThick.setFont(defaultFont); borderStyleLeftThinBoldFont = workbook.createCellStyle(); - borderStyleLeftThinBoldFont.setBorderLeft(CellStyle.BORDER_THIN); + borderStyleLeftThinBoldFont.setBorderLeft(BorderStyle.THIN); borderStyleLeftThinBoldFont.setFont(boldFont); borderStyleLeftThickBoldFont = workbook.createCellStyle(); - borderStyleLeftThickBoldFont.setBorderLeft(CellStyle.BORDER_THICK); + borderStyleLeftThickBoldFont.setBorderLeft(BorderStyle.THICK); borderStyleLeftThickBoldFont.setFont(boldFont); borderStyleRightThickBoldFont = workbook.createCellStyle(); - borderStyleRightThickBoldFont.setBorderRight(CellStyle.BORDER_THICK); + borderStyleRightThickBoldFont.setBorderRight(BorderStyle.THICK); borderStyleRightThickBoldFont.setFont(boldFont); borderStyleBottomThin = workbook.createCellStyle(); - borderStyleBottomThin.setBorderBottom(CellStyle.BORDER_THIN); + borderStyleBottomThin.setBorderBottom(BorderStyle.THIN); borderStyleBottomThin.setFont(defaultFont); borderStyleBottomThinBoldFont = workbook.createCellStyle(); - borderStyleBottomThinBoldFont.setBorderBottom(CellStyle.BORDER_THIN); + borderStyleBottomThinBoldFont.setBorderBottom(BorderStyle.THIN); borderStyleBottomThinBoldFont.setFont(boldFont); borderStyleLeftThinPercentage = workbook.createCellStyle(); - borderStyleLeftThinPercentage.setBorderLeft(CellStyle.BORDER_THIN); + borderStyleLeftThinPercentage.setBorderLeft(BorderStyle.THIN); borderStyleLeftThinPercentage.setFont(defaultFont); borderStyleLeftThinPercentage.setDataFormat(percentageDataFormatId); borderStyleLeftThinBoldFontPercentage = workbook.createCellStyle(); - borderStyleLeftThinBoldFontPercentage.setBorderLeft(CellStyle.BORDER_THIN); + borderStyleLeftThinBoldFontPercentage.setBorderLeft(BorderStyle.THIN); borderStyleLeftThinBoldFontPercentage.setFont(boldFont); borderStyleLeftThinBoldFontPercentage.setDataFormat(percentageDataFormatId); borderStyleRightThickPercentage = workbook.createCellStyle(); - borderStyleRightThickPercentage.setBorderRight(CellStyle.BORDER_THICK); + borderStyleRightThickPercentage.setBorderRight(BorderStyle.THICK); borderStyleRightThickPercentage.setDataFormat(percentageDataFormatId); borderStyleRightThickBoldFontPercentage = workbook.createCellStyle(); - borderStyleRightThickBoldFontPercentage.setBorderRight(CellStyle.BORDER_THICK); + borderStyleRightThickBoldFontPercentage.setBorderRight(BorderStyle.THICK); borderStyleRightThickBoldFontPercentage.setFont(boldFont); borderStyleRightThickBoldFontPercentage.setDataFormat(percentageDataFormatId); @@ -227,6 +231,10 @@ } Sheet sheet = workbook.createSheet(sheetName); + //make sure columns are tracked prior to auto-sizing them + if (workbook instanceof SXSSFWorkbook) { + ((SXSSFSheet)sheet).trackAllColumnsForAutoSizing(); + } // Print title in bold, if needed if (!StringUtils.isBlank(sheetTitle)) { @@ -368,16 +376,16 @@ if (excelCell.getAlignment() != 0) { switch (excelCell.getAlignment()) { case ExcelCell.ALIGN_GENERAL: - CellUtil.setCellStyleProperty(cell, workbook, CellUtil.ALIGNMENT, CellStyle.ALIGN_GENERAL); + CellUtil.setCellStyleProperty(cell, CellUtil.ALIGNMENT, HorizontalAlignment.GENERAL); break; case ExcelCell.ALIGN_LEFT: - CellUtil.setCellStyleProperty(cell, workbook, CellUtil.ALIGNMENT, CellStyle.ALIGN_LEFT); + CellUtil.setCellStyleProperty(cell, CellUtil.ALIGNMENT, HorizontalAlignment.LEFT); break; case ExcelCell.ALIGN_CENTER: - CellUtil.setCellStyleProperty(cell, workbook, CellUtil.ALIGNMENT, CellStyle.ALIGN_CENTER); + CellUtil.setCellStyleProperty(cell, CellUtil.ALIGNMENT, HorizontalAlignment.CENTER); break; case ExcelCell.ALIGN_RIGHT: - CellUtil.setCellStyleProperty(cell, workbook, CellUtil.ALIGNMENT, CellStyle.ALIGN_RIGHT); + CellUtil.setCellStyleProperty(cell, CellUtil.ALIGNMENT, HorizontalAlignment.RIGHT); break; default: break; Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXAction.java =================================================================== diff -u -r920d578377db9f50585f754c68a25e72da1d2c2f -rfb1f64c71c4639656caf445c16c8409035bc74b8 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXAction.java (.../GroupingUploadAJAXAction.java) (revision 920d578377db9f50585f754c68a25e72da1d2c2f) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXAction.java (.../GroupingUploadAJAXAction.java) (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -51,7 +51,7 @@ import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -472,7 +472,7 @@ /* XLS Version Parse */ private String parseStringCell(HSSFCell cell) { if (cell != null) { - cell.setCellType(Cell.CELL_TYPE_STRING); + cell.setCellType(CellType.STRING); if (cell.getStringCellValue() != null) { return cell.getStringCellValue().trim(); } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java =================================================================== diff -u -r52a4d603e80751438f18864c4a3797c6126de8e4 -rfb1f64c71c4639656caf445c16c8409035bc74b8 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision 52a4d603e80751438f18864c4a3797c6126de8e4) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McService.java (.../McService.java) (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -48,7 +48,7 @@ import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.IndexedColors; import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; @@ -944,7 +944,7 @@ HSSFWorkbook wb = new HSSFWorkbook(); HSSFCellStyle greenColor = wb.createCellStyle(); greenColor.setFillForegroundColor(IndexedColors.LIME.getIndex()); - greenColor.setFillPattern(CellStyle.SOLID_FOREGROUND); + greenColor.setFillPattern(FillPatternType.SOLID_FOREGROUND); Font whiteFont = wb.createFont(); whiteFont.setColor(IndexedColors.WHITE.getIndex()); whiteFont.setFontName(ExcelUtil.DEFAULT_FONT_NAME); Index: moodle/.tern-project =================================================================== diff -u --- moodle/.tern-project (revision 0) +++ moodle/.tern-project (revision fb1f64c71c4639656caf445c16c8409035bc74b8) @@ -0,0 +1,17 @@ +{ + "plugins": { + "guess-types": { + + }, + "outline": { + + }, + "angular": { + + } + }, + "libs": [ + "ecma5", + "browser" + ] +} \ No newline at end of file