1 package net.firstpartners.nounit.report; 2 3 26 27 import java.io.File ; 28 import java.io.FileNotFoundException ; 29 import java.io.IOException ; 30 31 import javax.xml.transform.TransformerConfigurationException ; 32 import javax.xml.transform.TransformerException ; 33 34 import org.apache.log4j.Logger; 35 36 import net.firstpartners.nounit.ui.common.CommandPackage; 37 import net.firstpartners.nounit.ui.common.SystemValues; 38 import net.firstpartners.nounit.utility.NoUnitException; 39 40 49 public class SimpleReport 50 extends AbstractReport{ 51 52 55 public static final String XSLT_REPORT="report_name"; 56 57 60 public static final String OUTPUT_FILE="output_file"; 61 62 static Logger log = Logger.getLogger(SimpleReport.class); 64 65 73 public void makeReport(CommandPackage inPackage) 74 throws TransformerException , TransformerConfigurationException , 75 IOException , FileNotFoundException , NoUnitException { 76 77 File xsltFile = new File (inPackage.getString(XSLT_REPORT) ); 79 File outFile = 80 new File ( inPackage.getString(CommandPackage.OUTPUT_DIR), 81 inPackage.getString(OUTPUT_FILE) ); 82 File xmlInFile = 83 new File ( inPackage.getString(CommandPackage.OUTPUT_DIR), 84 SystemValues.XML_OUTPUT_NAME ); 85 86 if ((outFile==null)||outFile.equals("")){ 88 throw new NoUnitException("Please specify a value for "+OUTPUT_FILE); 89 } 90 91 if ((xsltFile==null)||xsltFile.equals("")){ 92 throw new NoUnitException("Please specify a value for "+XSLT_REPORT); 93 } 94 95 log.debug("Generating Report:"); 96 log.debug("XML in:"+xmlInFile); 97 log.debug("XSLT file:"+xsltFile); 98 log.debug("Output file:"+outFile); 99 log.debug(""); 100 101 super.transformFile( xmlInFile, xsltFile, outFile ); 103 } 104 } 105 | Popular Tags |