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
12
13 public class OnHoldRegularPrintSlipUtil 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("Hold Slip", getPdfFormatUtil().getBoldFont()));
23 }
24
25 @Override
26 protected void populateBody(PdfPTable pdfTable) {
27 OleDeliverRequestBo oleDeliverRequestBo = getOleItemRecordForCirc().getOleDeliverRequestBo();
28 String patronName = oleDeliverRequestBo != null ? oleDeliverRequestBo.getOlePatron().getPatronName() : null;
29 Object expirationDate = oleDeliverRequestBo != null ? oleDeliverRequestBo.getHoldExpirationDate() : null;
30 pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Patron Name"));
31 pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
32 pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(patronName));
33
34 pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Expiration Date"));
35 pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
36 pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(expirationDate != null ? getDateFormat().format(expirationDate).toString() : null));
37 }
38
39 }