@@ -0,0 +1,1892 @@
+package com.equalize.xpi.af.modules.excel;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.InputStream;%0Aimport com.sap.aii.af.lib.mp.module.ModuleContext;%0Aimport com.sap.engine.interfaces.messaging.api.MessageKey;%0Aimport com.sap.engine.interfaces.messaging.api.auditlog.AuditAccess;%0Aimport com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;%0A%0Apublic abstract class ExcelTransformer %7B%0A%09protected AuditAccess audit;%0A%09protected ModuleContext moduleParam;%0A%09protected MessageKey key;%0A%0A%09public ExcelTransformer (ModuleContext mc, MessageKey key, AuditAccess audit) %7B%0A%09%09this.moduleParam = mc;%0A%09%09this.key = key;%0A%09%09this.audit = audit;%09%09%09%09%09%09%0A%09%7D%0A%0A%09public abstract void retrieveModuleParameters() throws Exception;%0A%0A%09public abstract void parseInput(InputStream inStream) throws Exception;%0A%0A%09public abstract ByteArrayOutputStream generateOutput() throws Exception;%0A%0A%09protected void addLog (AuditLogStatus status, String message) %7B%0A%09%09if (this.audit != null) %7B%0A%09%09%09this.audit.addAuditLogEntry(this.key, status, message);%09%0A%09%09%7D else %7B%0A%09%09%09System.out.println( %22Audit Log: %22 + message);%0A%09%09%7D%0A%09%7D%0A%0A%09protected String getParaWithDefault(String key, String deflt) %7B%0A%09%09String value = this.moduleParam.getContextData(key);%0A%09%09if (value == null) %7B%0A%09%09%09value = deflt;%0A%09%09%7D%0A%09%09return value;%0A%09%7D%0A%0A%09protected String getParaWithErrorDescription(String key) throws Exception %7B%0A%09%09String value = this.moduleParam.getContextData(key);%0A%09%09if (value == null) %7B%0A%09%09%09throw new Exception(%22Mandatory parameter %22 + key + %22 is missing%22);%0A%09%09%7D%0A%09%09return value;%0A%09%7D%0A%09%0A%09protected int checkIntegerInput(String input, String fieldName) throws Exception %7B%0A%09%09try %7B%0A%09%09%09int result = Integer.parseInt(input);%0A%09%09%09if (result %3C 0 ) %7B%0A%09%09%09%09throw new Exception(%22Negative integers not allowed for %22+ fieldName);%0A%09%09%09%7D%0A%09%09%09return result;%0A%09%09%7D catch (NumberFormatException e) %7B%0A%09%09%09throw new Exception(%22Only integers allowed for %22+ fieldName);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create ExcelTransformer.java