|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package siprp;
|
|
|
|
|
|
|
|
|
|
import siprp.companydataloaders.*;
|
|
|
|
|
import siprp.data.*;
|
|
|
|
|
import siprp.ficha.*;
|
|
|
|
|
import siprp.clientes.*;
|
|
|
|
|
@ -29,7 +30,7 @@ public class Main implements Connector
|
|
|
|
|
{
|
|
|
|
|
private final static ClassLoader classLoader = new EVUtilsImageLib().getClass().getClassLoader();
|
|
|
|
|
|
|
|
|
|
private static String dbase = "siprp";
|
|
|
|
|
private static String dbase;
|
|
|
|
|
private SIPRPTracker siprpTracker;
|
|
|
|
|
|
|
|
|
|
private static AvisosPanel avisos = null;
|
|
|
|
|
@ -42,12 +43,13 @@ public class Main implements Connector
|
|
|
|
|
// Singleton.setInstance( SingletonConstants.WEB_AWARE, Boolean.FALSE );
|
|
|
|
|
// Singleton.setInstance( SingletonConstants.DB_NAME, "shst" );
|
|
|
|
|
|
|
|
|
|
Singleton.setInstance( SingletonConstants.COMPANY_NAME, "SIPRP - Sociedade Ib\u00e9rica de Preven\u00e7\u00e3o de Riscos Profissionais" );
|
|
|
|
|
Singleton.setInstance( SingletonConstants.COMPANY_LOGO, "logo_combo.jpg" );
|
|
|
|
|
Singleton.setInstance( SingletonConstants.WEB_AWARE, Boolean.TRUE );
|
|
|
|
|
Singleton.setInstance( SingletonConstants.DB_NAME, "siprp" );
|
|
|
|
|
// Singleton.setInstance( SingletonConstants.COMPANY_NAME, "SIPRP - Sociedade Ib\u00e9rica de Preven\u00e7\u00e3o de Riscos Profissionais" );
|
|
|
|
|
// Singleton.setInstance( SingletonConstants.COMPANY_LOGO, "logo_combo.jpg" );
|
|
|
|
|
// Singleton.setInstance( SingletonConstants.WEB_AWARE, Boolean.TRUE );
|
|
|
|
|
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp" );
|
|
|
|
|
new SIPRPDataLoader().load();
|
|
|
|
|
|
|
|
|
|
dbase = (String)Singleton.getInstance( SingletonConstants.DB_NAME );
|
|
|
|
|
dbase = (String)Singleton.getInstance( SingletonConstants.LOCAL_DB_NAME );
|
|
|
|
|
/* Calendar cal = Calendar.getInstance();
|
|
|
|
|
cal.set( 2004, 06, 14 );
|
|
|
|
|
if( cal.before( Calendar.getInstance() ) )
|
|
|
|
|
@ -85,7 +87,8 @@ public class Main implements Connector
|
|
|
|
|
LoginWindow loginWindow = new LoginWindow( new Main(), /*"logo"+File.separator +*/ logoFileName,//"logo"+File.separator + "logo_w400.jpg",
|
|
|
|
|
new String[] { "SIPRPSoft" },
|
|
|
|
|
new String[] { "Vers\u00E3o 2.0", "(EVOLUTE 2004)" }, "",
|
|
|
|
|
"root", "UNIXLuvsU", avisos, false );
|
|
|
|
|
(String)Singleton.getInstance( SingletonConstants.LOCAL_USER ),
|
|
|
|
|
(String)Singleton.getInstance( SingletonConstants.LOCAL_PASSWORD ), avisos, false );
|
|
|
|
|
loginWindow.setTitle( "SIPRPSoft" );
|
|
|
|
|
JPanel left = loginWindow.getLeftPanel();
|
|
|
|
|
left.setBackground( Color.white );
|
|
|
|
|
@ -102,10 +105,11 @@ public class Main implements Connector
|
|
|
|
|
if( server == null )
|
|
|
|
|
{
|
|
|
|
|
//server = "192.168.1.191";
|
|
|
|
|
server = "192.168.0.110";
|
|
|
|
|
server = (String)Singleton.getInstance( SingletonConstants.LOCAL_URL );
|
|
|
|
|
// server = "ws_fpalma";
|
|
|
|
|
}
|
|
|
|
|
String url = "jdbc:mysql://" + server + "/" + dbase;
|
|
|
|
|
String prefix = (String)Singleton.getInstance( SingletonConstants.LOCAL_URL_PREFIX );
|
|
|
|
|
String url = prefix + server + "/" + dbase;
|
|
|
|
|
// System.out.println( "url: " + url + " user: " + user + " ps: " + passwd );
|
|
|
|
|
DBManager dbm = new JDBCManager( url, user, passwd , 10, 8, 8, null );
|
|
|
|
|
// UnicodeChecker.setUseDoubleSlash( true );
|
|
|
|
|
@ -203,7 +207,7 @@ System.out.println( "INIT: " + d );
|
|
|
|
|
jpoxProps.setProperty( "javax.jdo.PersistenceManagerFactoryClass",
|
|
|
|
|
"org.jpox.PersistenceManagerFactoryImpl" );
|
|
|
|
|
// Set the JDBC driver name.
|
|
|
|
|
jpoxProps.setProperty( "javax.jdo.option.ConnectionDriverName", "com.mysql.jdbc.Driver" );
|
|
|
|
|
jpoxProps.setProperty( "javax.jdo.option.ConnectionDriverName", (String) Singleton.getInstance( SingletonConstants.LOCAL_DRIVER_NAME ) );
|
|
|
|
|
jpoxProps.setProperty( "org.jpox.identifier.fullyQualifiedNames", "false" );
|
|
|
|
|
// props.setProperty("com.triactive.jdo.transactionIsolation",
|
|
|
|
|
// "read-uncommitted" );
|
|
|
|
|
@ -232,7 +236,7 @@ System.out.println( "INIT: " + d );
|
|
|
|
|
// jpoxProps.setProperty( "org.jpox.identifier.defaultSchemaName", "informix" );
|
|
|
|
|
jpoxProps.setProperty( "org.jpox.rdbms.CheckExistTablesOrViews", "false" );
|
|
|
|
|
|
|
|
|
|
System.setProperty( "org.jpox.catalogName", (String)Singleton.getInstance( SingletonConstants.DB_NAME ) );
|
|
|
|
|
System.setProperty( "org.jpox.catalogName", (String)Singleton.getInstance( SingletonConstants.LOCAL_DB_NAME ) );
|
|
|
|
|
System.setProperty( "org.jpox.schemaName", "" );
|
|
|
|
|
|
|
|
|
|
PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory( jpoxProps );
|
|
|
|
|
|