diff --git a/trunk/AnaliseAcidentesTrabalho/lib/postgresql-9.0-801.jdbc4.jar b/trunk/AnaliseAcidentesTrabalho/lib/postgresql-9.0-801.jdbc4.jar deleted file mode 100644 index 63e54165..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/lib/postgresql-9.0-801.jdbc4.jar and /dev/null differ diff --git a/trunk/AnaliseAcidentesTrabalho/src/pdf/Pdf.java b/trunk/AnaliseAcidentesTrabalho/src/pdf/Pdf.java deleted file mode 100644 index 231f8b4e..00000000 --- a/trunk/AnaliseAcidentesTrabalho/src/pdf/Pdf.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Pdf.java - * - * Created on November 13, 2007, 11:33 AM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package pdf; - -import beans.Acidentado; -import beans.AnaliseAcidente; -import com.evolute.utils.error.ErrorLogger; -import com.lowagie.text.Document; -import com.lowagie.text.Font; -import com.lowagie.text.FontFactory; -import com.lowagie.text.Paragraph; -import com.lowagie.text.Rectangle; -import com.lowagie.text.pdf.BaseFont; -import com.lowagie.text.pdf.PdfPCell; -import com.lowagie.text.pdf.PdfPTable; -import com.lowagie.text.pdf.PdfWriter; -import db.providers.AnalisesDataProvider; -import java.awt.Color; -import java.io.FileOutputStream; -import javax.faces.context.FacesContext; - -/** - * - * @author lluis - */ -public class Pdf { - - PdfPCell cell = null; - Paragraph p = null; - private final static int FONT_SIZE = 5; - /** Creates a new instance of Pdf */ - public Pdf() { - } - - public void generatePdf(String folder, AnaliseAcidente a) - { - PdfPTable table = null; - FacesContext ctx = FacesContext.getCurrentInstance(); - ////HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse(); - Document document = new Document(); - ////response.setContentType("application/pdf"); - - try - { - ////PdfWriter writer = PdfWriter.getInstance(document, response.getOutputStream()); - PdfWriter.getInstance(document, new FileOutputStream(folder + "/" + a.getId().toString() + ".pdf")); - document.open(); - //document.add(new Paragraph("Hello World")); - //document.add(new Paragraph(new Date().toString())); - - table = createTableEmpresa(a); - document.add(table); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - document.close(); - } - - private PdfPTable createTableHeader(AnaliseAcidente a) - { - PdfPTable table = new PdfPTable(3); - return table; - } - - private PdfPTable createTableEmpresa(AnaliseAcidente a) - { - String empresa_str = ""; - String estabelecimento_str = ""; - String trabalhador_str = ""; -// AnalisesDataProvider adp = new AnalisesDataProvider(); - - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); - empresa_str = utils.Utils.unicodeToHTML(nome_empresa); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - estabelecimento_str = adp.getEstabelecimentoNome(a.getEstabelecimento_id()); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - Acidentado ac = null; - try - { - AnalisesDataProvider adp = AnalisesDataProvider.getInstance(); - ac = adp.getAcidentado(a.getAcidentado_id()); - trabalhador_str = ac.getNome(); - } - catch(Exception ex) - { - ErrorLogger.logException( ex ); - } - - //TableEvents event = new TableEvents(); - - float[] widths = { 1f, 4f }; - PdfPTable table = new PdfPTable(widths); - table.getDefaultCell().setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP | Rectangle.BOTTOM); - //PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3")); - //cell.setColspan(3); - //table.addCell(cell); - - - - - cell = new PdfPCell(new Paragraph("Empresa:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); - cell.setBorder(Rectangle.NO_BORDER); - cell.setBackgroundColor(new Color(102, 133, 151)); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph(empresa_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)) )); - cell.setBorder(Rectangle.NO_BORDER); - cell.setBackgroundColor(new Color(102, 133, 151)); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph("Estabelecimento:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); - cell.setBorder(Rectangle.NO_BORDER); - cell.setBackgroundColor(new Color(102, 133, 151)); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph(estabelecimento_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); - cell.setBorder(Rectangle.NO_BORDER); - cell.setBackgroundColor(new Color(102, 133, 151)); - table.addCell(cell); - - cell = new PdfPCell(new Paragraph("Trabalhador:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); - cell.setBorder(Rectangle.NO_BORDER); - cell.setBackgroundColor(new Color(102, 133, 151)); - - table.addCell(cell); - - cell = new PdfPCell(new Paragraph(trabalhador_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); - cell.setBorder(Rectangle.NO_BORDER); - cell.setBackgroundColor(new Color(102, 133, 151)); - table.addCell(cell); - table.getDefaultCell().setBackgroundColor(new Color(102, 133, 151)); - table.getDefaultCell().setPadding(0f); - table.setSpacingAfter(0f); - table.setSpacingBefore(0f); - return table; - } - - private PdfPTable createTableEmpresaHs(AnaliseAcidente a) - { - PdfPTable table = new PdfPTable(3); - return table; - } - - - - -} diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils.jar deleted file mode 100644 index 98bfbb7d..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-beanutils.jar and /dev/null differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections-3.1.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections-3.1.jar deleted file mode 100644 index 41e230fe..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections-3.1.jar and /dev/null differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections.jar deleted file mode 100644 index bf8bcd02..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-collections.jar and /dev/null differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester.jar deleted file mode 100644 index 3656eb93..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-digester.jar and /dev/null differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-fileupload-1.0.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-fileupload-1.0.jar deleted file mode 100644 index cf0f5547..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-fileupload-1.0.jar and /dev/null differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging.jar deleted file mode 100644 index ef43682b..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/commons-logging.jar and /dev/null differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar deleted file mode 100644 index 63e54165..00000000 Binary files a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/lib/postgresql-9.0-801.jdbc4.jar and /dev/null differ