diff --git a/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/GenericReportExcelServlet.java b/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/GenericReportExcelServlet.java index 5d077f94fe..d5d7708ef9 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/GenericReportExcelServlet.java +++ b/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/GenericReportExcelServlet.java @@ -36,6 +36,7 @@ import org.apache.poi.xssf.usermodel.XSSFColor; import org.apache.poi.xssf.usermodel.XSSFFont; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.apache.poi.xssf.usermodel.DefaultIndexedColorMap; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.resource.Resource; @@ -135,7 +136,7 @@ private Workbook createSpreadsheet(AbstractReport report) { CellStyle createHeaderStyle(Workbook wb){ XSSFCellStyle xstyle = (XSSFCellStyle)wb.createCellStyle(); - XSSFColor header = new XSSFColor(new Color(79, 129, 189)); + XSSFColor header = new XSSFColor(new Color(79, 129, 189), new DefaultIndexedColorMap()); xstyle.setFillForegroundColor(header); xstyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); XSSFFont font = (XSSFFont)wb.createFont(); diff --git a/bundle/src/main/java/com/adobe/acs/commons/redirects/servlets/ImportRedirectMapServlet.java b/bundle/src/main/java/com/adobe/acs/commons/redirects/servlets/ImportRedirectMapServlet.java index b520ea37dc..1044231c4b 100755 --- a/bundle/src/main/java/com/adobe/acs/commons/redirects/servlets/ImportRedirectMapServlet.java +++ b/bundle/src/main/java/com/adobe/acs/commons/redirects/servlets/ImportRedirectMapServlet.java @@ -126,7 +126,7 @@ Map getRules(Resource resource) { /** * @param root root resource, e.g. /conf/global/settings/redirects - * @param xlsRules redirects read from an Excel spreadhseet + * @param xlsRules redirects read from an Excel spreadsheet * @param jcrRedirects existing redirect nodes keyed by the source path. * We assume that the source path is unique. */ @@ -204,7 +204,7 @@ Map mapColumns(Row row) { // columns A, B and C are reserved for source, target and statusCode continue; } - if (cell.getCellTypeEnum() == CellType.STRING) { + if (cell.getCellType() == CellType.STRING) { String title = cell.getStringCellValue(); for (ExportColumn col : ExportColumn.values()) { if (col.getTitle().equalsIgnoreCase(title)) { @@ -225,19 +225,19 @@ private Map readRedirect(Row row, Map col Map props = new HashMap<>(); props.put(PROPERTY_RESOURCE_TYPE, REDIRECT_RULE_RESOURCE_TYPE); Cell c0 = row.getCell(0); - if (c0 == null || c0.getCellTypeEnum() != CellType.STRING) { + if (c0 == null || c0.getCellType() != CellType.STRING) { auditLog.warn(new CellReference(row.getRowNum(), 0).formatAsString(), "Cells A is required and should contain redirect source"); return null; } Cell c1 = row.getCell(1); - if (c1 == null || c1.getCellTypeEnum() != CellType.STRING) { + if (c1 == null || c1.getCellType() != CellType.STRING) { auditLog.warn(new CellReference(row.getRowNum(), 1).formatAsString(), "Cells B is required and should contain redirect source"); return null; } Cell c2 = row.getCell(2); - if (c2 == null || c2.getCellTypeEnum() != CellType.NUMERIC) { + if (c2 == null || c2.getCellType() != CellType.NUMERIC) { auditLog.warn(new CellReference(row.getRowNum(), 2).formatAsString(), "Cells C is required and should contain redirect status code"); return null; @@ -266,15 +266,15 @@ private Map readOptionalProperties(Row row, Map readOptionalProperties(Row row, Map