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.bo.OleDeliverRequestBo;
7   import org.kuali.ole.deliver.util.OleRegularPrintSlipUtil;
8   import org.kuali.ole.deliver.util.RegularPdfFormatUtil;
9   
10  /**
11   * Created by sheiksalahudeenm on 7/30/15.
12   */
13  public class InTransitForStaffRegularPrintSlipUtil extends OleRegularPrintSlipUtil {
14  
15      @Override
16      public RegularPdfFormatUtil getPdfFormatUtil() {
17          return new RegularPdfFormatUtil();
18      }
19  
20      @Override
21      protected void populateHeader(Paragraph paraGraph) {
22          paraGraph.add(new Chunk("Routing Slip In-Transit Per Staff Request", getPdfFormatUtil().getBoldFont()));
23      }
24  
25      @Override
26      protected void populateBody(PdfPTable pdfTable) {
27          String routeTo = getOleItemRecordForCirc().getRouteToLocation();
28          OleDeliverRequestBo oleDeliverRequestBo = getOleItemRecordForCirc().getOleDeliverRequestBo();
29          String requestedBy = oleDeliverRequestBo != null ? (oleDeliverRequestBo.getOlePatron().getPatronName()) : null;
30          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Route To"));
31          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
32          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(routeTo));
33  
34          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Requested By"));
35          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
36          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(requestedBy));
37  
38  
39          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Date/Time "));
40          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
41          pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(getSimpleDateFormat().format(getOleItemRecordForCirc().getItemRecord().getEffectiveDate()).toString()));
42      }
43  }