View Javadoc
1   package org.kuali.ole.deliver.util.printSlip;
2   
3   import com.itextpdf.text.Chunk;
4   import com.itextpdf.text.Paragraph;
5   import com.itextpdf.text.pdf.PdfPTable;
6   import org.kuali.ole.deliver.util.OleRegularPrintSlipUtil;
7   import org.kuali.ole.deliver.util.RegularPdfFormatUtil;
8   
9   import java.sql.Timestamp;
10  
11  /**
12   * Created by sheiksalahudeenm on 7/30/15.
13   */
14  public class InTransitRegularPrintSlipUtil extends OleRegularPrintSlipUtil {
15  
16      @Override
17      public RegularPdfFormatUtil getPdfFormatUtil() {
18          return new RegularPdfFormatUtil();
19      }
20  
21      @Override
22      protected void populateHeader(Paragraph paraGraph) {
23          paraGraph.add(new Chunk("Routing Slip In-Transit", getPdfFormatUtil().getBoldFont()));
24      }
25  
26      @Override
27      protected void populateBody(PdfPTable pdfTable) {
28          String routeTo = getOleItemRecordForCirc().getRouteToLocation();
29          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Route To"));
30          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
31          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(routeTo));
32  
33          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Date/Time "));
34          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
35          Timestamp effectiveDate = getOleItemRecordForCirc().getItemRecord().getEffectiveDate();
36          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(effectiveDate != null ?
37                  getSimpleDateFormat().format(effectiveDate).toString() : ""));
38      }
39  }