From c9008583b41e681697bb7edcc8cec111b00ef837 Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Fri, 22 Aug 2008 14:18:39 +0000 Subject: [PATCH] git-svn-id: https://svn.coded.pt/svn/SIPRP@744 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/SIPRPSoft/src/siprp/Main.java | 2 +- .../companydataloaders/SIPRPDataLoader.java | 8 +- .../src/siprp/ficha/FichaWindow.java | 128 +++++++++--------- .../siprp/impressaofichas/FichasPrinter.java | 4 +- 4 files changed, 71 insertions(+), 71 deletions(-) diff --git a/trunk/SIPRPSoft/src/siprp/Main.java b/trunk/SIPRPSoft/src/siprp/Main.java index 9b5fa35a..00b34c2a 100644 --- a/trunk/SIPRPSoft/src/siprp/Main.java +++ b/trunk/SIPRPSoft/src/siprp/Main.java @@ -53,7 +53,7 @@ import com.evolute.utils.ui.window.LoginWindow; public class Main implements com.evolute.utils.ui.window.Connector { - public final static String SHST_VERSION = "8.3"; + public final static String SHST_VERSION = "8.4"; private final static ClassLoader classLoader = new EVUtilsImageLib().getClass().getClassLoader(); diff --git a/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java b/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java index e895afe5..90bcd313 100644 --- a/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java +++ b/trunk/SIPRPSoft/src/siprp/companydataloaders/SIPRPDataLoader.java @@ -91,8 +91,8 @@ public class SIPRPDataLoader implements CompanyDataLoader Singleton.setInstance( SingletonConstants.WEB_DB_NAME, "siprp" ); Singleton.setInstance( SingletonConstants.WEB_DRIVER_NAME, "org.postgresql.Driver" ); -// Singleton.setInstance( SingletonConstants.LOCAL_USER, "slony" ); -// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "-rg2hevoevo" ); +// Singleton.setInstance( SingletonConstants.LOCAL_USER, "siprp" ); +// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "rg2h-opksiprp" ); // Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" ); // Singleton.setInstance( SingletonConstants.LOCAL_URL, "www.evolute.pt:5436" ); // Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" ); @@ -104,7 +104,7 @@ public class SIPRPDataLoader implements CompanyDataLoader Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" ); Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" ); Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" ); -// + // Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" ); // Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" ); // Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" ); @@ -117,7 +117,7 @@ public class SIPRPDataLoader implements CompanyDataLoader // Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" ); // Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" ); // Singleton.setInstance( SingletonConstants.LOCAL_URL, "localhost:5432" ); -// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" ); +// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" ); // Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" ); // Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" ); diff --git a/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java b/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java index 6a8eaf82..fffc4e94 100644 --- a/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java +++ b/trunk/SIPRPSoft/src/siprp/ficha/FichaWindow.java @@ -197,21 +197,21 @@ public class FichaWindow extends TabbedWindow "Imprimir Fichas Anteriores", null, 0, false ); - registerAction( new ActionHandler(){ - public void execute() - { - printOldFO(); - } - - public boolean activate( boolean newAction, boolean editAction, - boolean cancelAction, boolean saveAction, - boolean deleteAction, boolean selectAction ) - { - return saveAction || editAction; - } - }, "Imprimir Fichas Anteriores (novo)", - "Imprimir Fichas Anteriores (novo)", null, - 0, false ); +// registerAction( new ActionHandler(){ +// public void execute() +// { +// printOldFO(); +// } +// +// public boolean activate( boolean newAction, boolean editAction, +// boolean cancelAction, boolean saveAction, +// boolean deleteAction, boolean selectAction ) +// { +// return saveAction || editAction; +// } +// }, "Imprimir Fichas Anteriores (novo)", +// "Imprimir Fichas Anteriores (novo)", null, +// 0, false ); registerAction( new ActionHandler(){ public void execute() @@ -644,31 +644,31 @@ public class FichaWindow extends TabbedWindow fileName = absolutePath + fileName + ".pdf"; } - if( fo != null ) - { - Printer.printFoToFile( fo, fileName, true ); - } - else - { +// if( fo != null ) +// { +// Printer.printFoToFile( fo, fileName, true ); +// } +// else +// { Printer.printPDFToFile( pdf, fileName, true ); - } +// } JOptionPane.showMessageDialog( this, "Ficha exportada para: " + fileName ); } } } else { - if( fo != null ) - { - FichaAptidaoCreator.getCreator().print( fo ); - } - else - { +// if( fo != null ) +// { +// FichaAptidaoCreator.getCreator().print( fo ); +// } +// else +// { TrabalhadorData trabalhadorExame = ( TrabalhadorData ) exame.get( ExameData.TRABALHADOR ); String nomeFicheiro = StringPlainer.convertString( ( String ) trabalhadorExame.get( TrabalhadorData.NOME ) ); nomeFicheiro = nomeFicheiro.replaceAll( " ", "_" ); ePDF.print( pdf, nomeFicheiro ); - } +// } } } @@ -1182,28 +1182,28 @@ public class FichaWindow extends TabbedWindow } } - private void printOldFO() - { - if( trabalhadorID != null ) - { - Vector linhas; - try - { - IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID ); - linhas = new Vector( Arrays.asList( fichas ) ); - } - catch( Exception ex ) - { - DialogException.showExceptionMessage( ex, "Erro a criar lista de Fichas anteriores", true ); - return; - } - ListActionDialog dialog = new ListActionDialog( this, "Imprimir Fichas Anteriores", new String[]{ "Data" }, - linhas, this ); - dialog.setSize( 250, 200 ); - useFO = true; - dialog.setVisible( true ); - } - } +// private void printOldFO() +// { +// if( trabalhadorID != null ) +// { +// Vector linhas; +// try +// { +// IDObject fichas[] = fdpProvider.getAllFichasForTrabalhador( trabalhadorID ); +// linhas = new Vector( Arrays.asList( fichas ) ); +// } +// catch( Exception ex ) +// { +// DialogException.showExceptionMessage( ex, "Erro a criar lista de Fichas anteriores", true ); +// return; +// } +// ListActionDialog dialog = new ListActionDialog( this, "Imprimir Fichas Anteriores", new String[]{ "Data" }, +// linhas, this ); +// dialog.setSize( 250, 200 ); +// useFO = true; +// dialog.setVisible( true ); +// } +// } public boolean executeListAction( int line, Object value ) { @@ -1211,20 +1211,20 @@ public class FichaWindow extends TabbedWindow { try { - if( useFO ) - { - ExameData exame = (ExameData) JDO.load( ExameData.class, ( ( IDObject )value ).getID() ); - if( exame == null ) - { - throw new Exception( "N\u00e3o existe exame" ); - } - byte fo[] = (byte[]) exame.get( ExameData.FO ); - Printer.printFO( fo ); - } - else - { +// if( useFO ) +// { +// ExameData exame = (ExameData) JDO.load( ExameData.class, ( ( IDObject )value ).getID() ); +// if( exame == null ) +// { +// throw new Exception( "N\u00e3o existe exame" ); +// } +// byte fo[] = (byte[]) exame.get( ExameData.FO ); +// Printer.printFO( fo ); +// } +// else +// { print( ( ( IDObject )value ).getID(), false ); - } +// } } catch( Exception ex ) { diff --git a/trunk/SIPRPSoft/src/siprp/impressaofichas/FichasPrinter.java b/trunk/SIPRPSoft/src/siprp/impressaofichas/FichasPrinter.java index ea11de63..40c69b13 100644 --- a/trunk/SIPRPSoft/src/siprp/impressaofichas/FichasPrinter.java +++ b/trunk/SIPRPSoft/src/siprp/impressaofichas/FichasPrinter.java @@ -104,7 +104,7 @@ public class FichasPrinter extends Thread ByteArrayInputStream in = new ByteArrayInputStream( toPrint ); Hashtable printOptions = new Hashtable(); //System.out.println( "OUT: " + out.toString() ); - printOptions.put( FOPPrinterConstants.FOP_MANDATORY_PRINTER_NAME, printerName ); +// printOptions.put( FOPPrinterConstants.FOP_MANDATORY_PRINTER_NAME, printerName ); FOPPrinter.getFOPPrinter().printFO( in, false, true, printOptions ); byte []pdfData = PDFCreator.getPDFCreator().createPdfFromFo( toPrint ); File dir = new File( new File( listPath ), StringPlainer.convertString( nomeEmpresa ).replace( ' ', '_' ) ); @@ -136,7 +136,7 @@ public class FichasPrinter extends Thread // ExameData exame = (ExameData) JDO.load( ExameData.class, exameID ); // byte pdf[] = (byte []) exame.get( ExameData.PDF ); - if( !printFO( exameID ) && !printPDF( exameID ) ) + if( /* !printFO( exameID ) && */!printPDF( exameID ) ) { throw new Exception( "N\u00e3o existe exame" ); }