package com.github.neunkasulle.chronocommand.model;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;

/**
 * Created by Janze on 16.01.2016.
 */
public class TimeSheetHandler {
    String warningEmailTemplate;

    /*public boolean setTimeSheetState(TimeSheet timeSheet, TimeSheetState state) {
        return false;
    }*/

    public void createPdfFromTimeSheet(TimeSheet timeSheet){ //TODO fill timesheet with content
        //new document
        PDDocument newTimesheet = new PDDocument();
        //new page
        try{
            PDPage newPage = new PDPage();
            newTimesheet.addPage(newPage);

            //content: userData, timeData
        }
        finally {
            newTimesheet.close(); //most important part!
        }
    }

    public void   createPdfFromAllTimeSheet(TimeSheet timeSheet){

        //TODO Iteration
        createPdfFromTimeSheet(null);
    }



}

@@ -133,16 +133,45 @@
 DPage;%0A%0A
+import java.io.IOException;%0A%0A
 /**%0A * C
@@ -445,16 +445,17 @@
 meSheet)
+ 
 %7B //TODO
@@ -588,16 +588,17 @@
      try
+ 
 %7B%0A      
@@ -729,24 +729,16 @@
        %7D
-%0A       
  finally
@@ -736,24 +736,46 @@
 %7D finally %7B%0A
+            try %7B%0A    
             
@@ -819,16 +819,109 @@
 t part!%0A
+            %7D catch (IOException e) %7B%0A                // TODO handle exception%0A            %7D%0A
         

Fix compiler error