package program;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import models.ReportA;
import models.ReportB;
import models.ReportC;
public class Start {
/**
* This program is written to parse input from exported xml files generated by SAP,
* then to generate various reports based on the information within.
* @throws ParseException
*/
public static void main(String[] args) throws ParseException {
//declare variables to be used as file references
String file_zmarket, file_zmb52, file_zme2n, file_zva05, file_zvc2;
//Static references to file names for parsing purposes
//TODO: this will be a dynamic lookup at some point, the references below are for development purposes
file_zmarket = "src/files/fileSetA/zmarket.xml";
file_zmb52 = "src/files/fileSetA/zmb52.xml";
file_zme2n = "src/files/fileSetA/zme2n.xml";
file_zva05 = "src/files/fileSetA/zva05.xml";
file_zvc2 = "src/files/fileSetA/zvc2.xml";
// file_zmarket = "/src/files/fileSetB/zmarket.xml";
// file_zmb52 = "/src/files/fileSetB/zmb52";
// file_zme2n = "/src/files/fileSetB/zme2n.xml";
// file_zva05 = "/src/files/fileSetB/zva05.xml";
// file_zvc2 = "/src/files/fileSetB/zvc2.xml";
//populate the repository with the specified files
Repository repository = new Repository(file_zmarket, file_zmb52, file_zme2n, file_zva05, file_zvc2);
System.out.println();
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
String startDateString = "03/01/10";
String endDateString = "03/30/10";
Date startDate = df.parse(startDateString);
Date endDate = df.parse(endDateString);
ReportA testA = new ReportA(startDate, endDate, repository);
System.out.println(testA.getTitle() + " (" + startDateString.substring(0, 5) + " through " + endDateString.substring(0, 5) + ")");
testA.printToOutput();
System.out.println();
System.out.println();
ReportB testB = new ReportB(startDate, endDate, repository);
System.out.println(testB.getTitle() + " (" + startDateString.substring(0, 5) + " through " + endDateString.substring(0, 5) + ")");
testB.printToOutput();
System.out.println();
System.out.println();
ReportC testC = new ReportC(startDate, endDate, repository);
System.out.println(testC.getTitle() + " (" + startDateString.substring(0, 5) + " through " + endDateString.substring(0, 5) + ")");
testC.printToOutput();
}
}