View Javadoc
1   package org.kuali.ole.deliver.util;
2   
3   import com.itextpdf.text.Chunk;
4   import com.itextpdf.text.Document;
5   import com.itextpdf.text.Element;
6   import com.itextpdf.text.Paragraph;
7   import com.itextpdf.text.pdf.PdfPTable;
8   import com.itextpdf.text.pdf.PdfWriter;
9   import org.apache.log4j.Logger;
10  import org.kuali.ole.OLEConstants;
11  import org.kuali.ole.deliver.bo.OleCirculationDesk;
12  import org.kuali.ole.deliver.bo.OleItemSearch;
13  import org.kuali.ole.deliver.util.printSlip.OlePrintSlipUtil;
14  import org.kuali.ole.util.DocstoreUtil;
15  
16  import javax.servlet.http.HttpServletResponse;
17  import java.io.OutputStream;
18  import java.text.SimpleDateFormat;
19  
20  /**
21   * Created by sheiksalahudeenm on 7/29/15.
22   */
23  public class OleRegularPrintSlipUtil extends OlePrintSlipUtil {
24      private static final Logger LOG = Logger.getLogger(OleRegularPrintSlipUtil.class);
25  
26  
27      @Override
28      public RegularPdfFormatUtil getPdfFormatUtil() {
29          return null;
30      }
31  
32      @Override
33      protected void populateHeader(Paragraph paraGraph) {
34  
35      }
36  
37      @Override
38      protected void populateBody(PdfPTable pdfTable) {
39  
40      }
41  
42      @Override
43      protected void populateContentForSlip(PdfPTable pdfTable) {
44          OleCirculationDesk oleCirculationDesk = null != getOleItemRecordForCirc() ? getOleItemRecordForCirc().getCheckinLocation() : null;
45          try {
46  
47              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Route From"));
48              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
49              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(oleCirculationDesk != null ? oleCirculationDesk.getCirculationDeskPublicName() : ""));
50  
51              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Item Barcode"));
52              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
53              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(getOleItemRecordForCirc().getItemRecord().getBarCode()));
54  
55              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Title"));
56              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
57              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(getOleItemSearch().getTitle()));
58  
59              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Call Number"));
60              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
61              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(getOleItemSearch().getCallNumber()));
62  
63              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified("Copy Number"));
64              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInLeft(":"));
65              pdfTable.addCell(getPdfFormatUtil().getPdfPCellInJustified(getOleItemSearch().getCopyNumber()));
66  
67  
68          } catch (Exception e) {
69              LOG.error("Exception while creating pdf for printing slip", e);
70          }
71  
72      }
73  
74      @Override
75      protected PdfPTable getPdfPTable() {
76          return new PdfPTable(3);
77      }
78  }
79