diff --git a/trunk/SIPRPSoft/lib/cursos.jar b/trunk/SIPRPSoft/lib/cursos.jar index 5ebfa1fd..47958ddc 100644 Binary files a/trunk/SIPRPSoft/lib/cursos.jar and b/trunk/SIPRPSoft/lib/cursos.jar differ diff --git a/trunk/SIPRPSoft/properties/1-development/app.properties b/trunk/SIPRPSoft/properties/1-development/app.properties index df3ae563..57e9f9ca 100644 --- a/trunk/SIPRPSoft/properties/1-development/app.properties +++ b/trunk/SIPRPSoft/properties/1-development/app.properties @@ -4,14 +4,13 @@ app.main-class = siprp.Main app.main = siprp.Main db.url.prefix = jdbc:postgresql:// -db.user = postgres -db.password = Typein -#rg2h-opksiprp -db.name = siprp_local_3_20100713 +db.user = siprp +db.password = rg2h-opksiprp +db.name = siprp_local_3 db.connection.driver = org.postgresql.Driver -jnlp.resources.property.server.address = evoserver -jnlp.resources.property.server.port = 5432 +jnlp.resources.property.server.address = www.evolute.pt +jnlp.resources.property.server.port = 5436 app.resources.j2se.max-heap-size=512m app.resources.j2se.initial-heap-size=256m diff --git a/trunk/SIPRPSoft/src/siprp/FichaDataProvider.java b/trunk/SIPRPSoft/src/siprp/FichaDataProvider.java index 2f117e83..1227313a 100644 --- a/trunk/SIPRPSoft/src/siprp/FichaDataProvider.java +++ b/trunk/SIPRPSoft/src/siprp/FichaDataProvider.java @@ -8,7 +8,6 @@ package siprp; import java.text.DateFormat; import java.util.Date; -import java.util.Hashtable; import siprp.data.AvisoConstants; import siprp.data.Marcacao; @@ -18,7 +17,6 @@ import com.evolute.utils.Singleton; import com.evolute.utils.arrays.Virtual2DArray; import com.evolute.utils.data.IDObject; import com.evolute.utils.data.MappableObject; -import com.evolute.utils.db.DBException; import com.evolute.utils.db.DBManager; import com.evolute.utils.db.Executer; import com.evolute.utils.sql.Assignment; @@ -30,6 +28,8 @@ import com.evolute.utils.sql.Update; import com.evolute.utils.strings.StringPlainer; import com.evolute.utils.ui.search.SearchDialog; import com.evolute.utils.ui.search.SearchExecuter; +import java.util.HashMap; +import java.util.Map; /** * @@ -180,10 +180,10 @@ public class FichaDataProvider private int SEARCH_TRABALHADORES_ID = -1; private int SEARCH_EXAMES_ID = -1; - protected final Hashtable medicosEstabelecimentosHash = new Hashtable(); + protected final Map medicosEstabelecimentosHash = new HashMap(); /** Creates a new instance of FichaDataProvider */ - public FichaDataProvider() + private FichaDataProvider() throws Exception { DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ ); @@ -687,7 +687,7 @@ public class FichaDataProvider public void setMedicoForEstabelecimento( Integer estabelecimentoID, Integer medicoID ) throws Exception { - Integer medicoAntigo = ( Integer ) medicosEstabelecimentosHash.get( estabelecimentoID ); + Integer medicoAntigo = medicosEstabelecimentosHash.get( estabelecimentoID ); if( !medicoID.equals( medicoAntigo ) ) { Update update = @@ -721,11 +721,10 @@ public class FichaDataProvider } public Long countTrabalhadoresActivosForEmpresa( Integer empresaID ) + throws Exception { Long result = 0L; - try - { - Select2 query = new Select2( new String[]{ "trabalhadores", "estabelecimentos", "empresas" }, + Select2 query = new Select2( new String[]{ "trabalhadores", "estabelecimentos", "empresas" }, new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER }, new Expression[]{ new Field("estabelecimentos.id").isEqual(new Field("trabalhadores.estabelecimento_id")), @@ -736,14 +735,10 @@ public class FichaDataProvider and( new Field("trabalhadores.data_demissao").isEqual( null ) ). and( new Field("estabelecimentos.inactivo").isEqual( "n" ) ), null, null, null, null ); - Virtual2DArray returned = executer.executeQuery( query ); - if( returned.columnLength() > 0 ) - { - result = (Long) returned.get( 0, 0 ); - } - } - catch (DBException e) { - e.printStackTrace(); + Virtual2DArray returned = executer.executeQuery( query ); + if( returned.columnLength() > 0 ) + { + result = (Long) returned.get( 0, 0 ); } return result; } diff --git a/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java b/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java index 49ee014d..30413c94 100644 --- a/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java +++ b/trunk/SIPRPSoft/src/siprp/SIPRPTracker.java @@ -6,8 +6,8 @@ package siprp; -import java.util.Hashtable; +import com.evolute.module.cursos.CursosWindow; import javax.swing.tree.DefaultMutableTreeNode; import shst.SHSTTrackerInterface; @@ -32,10 +32,15 @@ import siprp.medicina.prestadores.PrestadoresWindow; import siprp.pesquisas.RelatorioAnualWindow; import com.evolute.utils.Singleton; +import com.evolute.utils.error.ErrorLogger; import com.evolute.utils.tracker.TrackableWindow; import com.evolute.utils.tracker.WindowCreator; import com.evolute.utils.tracker.WindowTracker; import com.evolute.utils.ui.window.LoginWindow; +import java.util.HashMap; +import java.util.Map; +import siprp.cursos.CursosInit; +import siprp.cursos.CursosWindowAdapter; /** * * @author fpalma @@ -69,7 +74,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface Singleton.setInstance( Singleton.TRACKER, this ); this.avisos = avisosP; avisos.setTracker( this ); - Hashtable creators = new Hashtable(); + Map creators = new HashMap(); DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode( Singleton.getInstance( SingletonConstants.COMPANY_ACRONYM ) ); @@ -77,6 +82,8 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface boolean hasGestao = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_CLIENTES ) ).booleanValue(); boolean hasRelatorio = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_RELATORIO ) ).booleanValue(); boolean hasListagens = ( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_LISTAGENS ) ).booleanValue(); + // TODO use property !!!! + boolean hasCursos = false;//true; //( (Boolean)Singleton.getInstance( SingletonConstants.MODULE_CURSOS ) ).booleanValue(); if( hasGestao ) { @@ -94,7 +101,7 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface clientesWindow = null; medicinaWindow = null; higieneWindow = null; - ex.printStackTrace(); + ErrorLogger.logException(ex); } } else @@ -289,6 +296,18 @@ public class SIPRPTracker extends WindowTracker implements SHSTTrackerInterface } } ); } + if( hasCursos ) + { + rootNode.add( new DefaultMutableTreeNode( CursosWindow.TITLE ) ); + creators.put( CursosWindow.TITLE, new WindowCreator() { + public TrackableWindow create() + throws Exception + { + CursosInit.initFactory(); + return new CursosWindowAdapter(); + } + } ); + } setRoot( rootNode ); setCreators( creators ); } diff --git a/trunk/SIPRPSoft/src/siprp/SingletonConstants.java b/trunk/SIPRPSoft/src/siprp/SingletonConstants.java index 6d2170fc..a58da2c9 100644 --- a/trunk/SIPRPSoft/src/siprp/SingletonConstants.java +++ b/trunk/SIPRPSoft/src/siprp/SingletonConstants.java @@ -36,6 +36,7 @@ public class SingletonConstants public static final String WEB_AWARE = "web_aware"; public static final String MODULE_RELATORIO = "module_relatorio"; public static final String MODULE_LISTAGENS = "module_listagens"; + public static final String MODULE_CURSOS = "module_cursos"; public static final String WEB_USER = "web_user"; public static final String WEB_PASSWORD = "web_password"; diff --git a/trunk/SIPRPSoft/src/siprp/clientes/ClientesDataProvider.java b/trunk/SIPRPSoft/src/siprp/clientes/ClientesDataProvider.java index 5ab25639..da178858 100644 --- a/trunk/SIPRPSoft/src/siprp/clientes/ClientesDataProvider.java +++ b/trunk/SIPRPSoft/src/siprp/clientes/ClientesDataProvider.java @@ -9,8 +9,6 @@ package siprp.clientes; -import java.util.Hashtable; -import java.util.Vector; import com.evolute.utils.Singleton; import com.evolute.utils.arrays.Virtual2DArray; @@ -24,6 +22,10 @@ import com.evolute.utils.sql.Delete; import com.evolute.utils.sql.Field; import com.evolute.utils.sql.Insert; import com.evolute.utils.sql.Select; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @@ -38,14 +40,14 @@ public class ClientesDataProvider extends MetaProvider private Integer etiquetaID; /** Creates a new instance of ClientesDataProvider */ - public ClientesDataProvider() + private ClientesDataProvider() throws Exception { DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ ); executer = dbm.getSharedExecuter( this ); } - public static MetaProvider getProvider() + public static ClientesDataProvider getProvider() throws Exception { synchronized( LOCK ) @@ -88,7 +90,7 @@ public class ClientesDataProvider extends MetaProvider return grupos; } - public Hashtable getAllTiposElementosProtocoloByGrupo() + public Map> getAllTiposElementosProtocoloByGrupo() throws Exception { Select select = @@ -98,16 +100,16 @@ public class ClientesDataProvider extends MetaProvider new String[]{ "grupo_protocolo_id", "ordem" }, null ); Virtual2DArray array = executer.executeQuery( select ); - Hashtable tipos = new Hashtable(); + Map> tipos = new HashMap>(); for( int n = 0; n < array.columnLength(); n++ ) { IDObject tipo = new MappableObject( ( Integer ) array.get( n, 0 ), ( String ) array.get( n, 1 ) ); Integer grupoID = ( Integer ) array.get( n, 3 ); if( !tipos.containsKey( grupoID ) ) { - tipos.put( grupoID, new Vector() ); + tipos.put( grupoID, new ArrayList() ); } - Vector tiposGrupo = ( Vector ) tipos.get( grupoID ); + List tiposGrupo = tipos.get( grupoID ); tiposGrupo.add( tipo ); } return tipos; @@ -156,14 +158,14 @@ public class ClientesDataProvider extends MetaProvider new String[]{ "numero_perfil" }, null ); Virtual2DArray array = executer.executeQuery( select ); - Vector data[] = new Vector[ numeroPerfis ]; + List data[] = new List[ numeroPerfis ]; for( int n = 0; n < array.columnLength(); n++ ) { int perfil = ( ( Integer ) array.get( n, 1 ) ).intValue() - 1; Integer tipo = ( Integer ) array.get( n, 0 ); if( data[ perfil ] == null ) { - data[ perfil ] = new Vector(); + data[ perfil ] = new ArrayList(); } data[ perfil ].add( tipo ); } @@ -176,7 +178,7 @@ public class ClientesDataProvider extends MetaProvider } else { - elementos[ n ] = ( Integer [] ) data[ n ].toArray( new Integer[ data[ n ].size() ] ); + elementos[ n ] = data[ n ].toArray( new Integer[ data[ n ].size() ] ); } } return elementos; diff --git a/trunk/SIPRPSoft/src/siprp/clientes/EmpresaPanel.java b/trunk/SIPRPSoft/src/siprp/clientes/EmpresaPanel.java index 75aa853d..e60c1e35 100644 --- a/trunk/SIPRPSoft/src/siprp/clientes/EmpresaPanel.java +++ b/trunk/SIPRPSoft/src/siprp/clientes/EmpresaPanel.java @@ -19,7 +19,6 @@ import java.awt.Insets; import java.util.Arrays; import java.util.Collection; import java.util.Map; -import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.JComboBox; @@ -58,6 +57,8 @@ import com.evolute.utils.ui.DialogException; import com.evolute.utils.ui.calendar.JCalendarPanel; import com.evolute.utils.ui.text.CopyPasteHandler; import com.evolute.utils.ui.text.StateTextField; +import java.util.ArrayList; +import java.util.List; /** * @@ -125,7 +126,7 @@ public class EmpresaPanel extends JPanel private boolean webAware; - private Vector listSelectionListeners; + private final List listSelectionListeners = new ArrayList(); /** Creates a new instance of EmpresaPanel */ public EmpresaPanel() @@ -133,7 +134,6 @@ public class EmpresaPanel extends JPanel { webAware = ( ( Boolean ) Singleton.getInstance( SingletonConstants.WEB_AWARE ) ).booleanValue(); provider = (FichaDataProvider)FichaDataProvider.getProvider(); - listSelectionListeners = new Vector(); objectProvider = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_EVO_DATA_PROVIDER ); setupComponents(); setupComponentsHashtable(); @@ -800,25 +800,32 @@ public class EmpresaPanel extends JPanel estabelecimentos = new IDObject[0]; } reloadMarcacoes(); - Vector v = new Vector( Arrays.asList( estabelecimentos ) ); - estabelecimentosModel.setValues( v ); + estabelecimentosModel.setValues( Arrays.asList( estabelecimentos ) ); - Vector dadosProtocolo[] = new Vector[]{ new Vector(), new Vector() }; + List dadosProtocolo[] = new List[]{ new ArrayList(), new ArrayList() }; boolean analisesExamesA[] = new boolean[2]; - analisesExamesA[ 0 ] = "y".equals( empresa.get( EmpresasData.A_CONSULTAS ) ); - analisesExamesA[ 1 ] = "y".equals( empresa.get( EmpresasData.A_EXAMES ) ); + analisesExamesA[ 0 ] = "y".equals( empresa.getA_consultas() ); + analisesExamesA[ 1 ] = "y".equals( empresa.getA_exames() ); dadosProtocolo[ 0 ].add( analisesExamesA ); dadosProtocolo[ 0 ].add( elementosProtocolo[ 0 ] ); boolean analisesExamesB[] = new boolean[2]; - analisesExamesB[ 0 ] = "y".equals( empresa.get( EmpresasData.B_CONSULTAS ) ); - analisesExamesB[ 1 ] = "y".equals( empresa.get( EmpresasData.B_EXAMES ) ); + analisesExamesB[ 0 ] = "y".equals( empresa.getB_consultas() ); + analisesExamesB[ 1 ] = "y".equals( empresa.getB_exames() ); dadosProtocolo[ 1 ].add( analisesExamesB ); dadosProtocolo[ 1 ].add( elementosProtocolo[ 1 ] ); protocoloPanel.fill( dadosProtocolo ); - Integer empresaID = empresa == null ? null : (Integer) empresa.get( EmpresasData.ID ); + Integer empresaID = empresa == null ? null : empresa.getId(); if( empresaID != null ) { - Long numTrabalhadoresActivos = provider.countTrabalhadoresActivosForEmpresa( empresaID ); + Long numTrabalhadoresActivos = null; + try + { + numTrabalhadoresActivos = provider.countTrabalhadoresActivosForEmpresa(empresaID); + } + catch( Exception ex ) + { + ErrorLogger.logException(ex); + } labelTrabalhadoresActivos.setText( getTextForTrabalhadoresActivos( numTrabalhadoresActivos ) ); ImageData logo = empresa.toEmpresa_logo_id(); logotipo.fill( logo == null ? null : logo.getImage_data() ); @@ -838,20 +845,20 @@ public class EmpresaPanel extends JPanel empresa = new EmpresasData(); } - String names[] = ( String[] ) components.keySet().toArray( new String[ components.size() ] ); + String names[] = components.keySet().toArray( new String[ components.size() ] ); Map hash = empresa.getHashData(); ComponentController.save( names, hash, components ); empresa.setHashData( hash ); - Vector dadosProtocolo[] = ( Vector[] ) protocoloPanel.save(); - boolean analisesExamesA[] = ( boolean [] ) dadosProtocolo[ 0 ].elementAt( 0 ); + List dadosProtocolo[] = protocoloPanel.save(); + boolean analisesExamesA[] = ( boolean [] ) dadosProtocolo[ 0 ].get( 0 ); empresa.set( EmpresasData.A_CONSULTAS, analisesExamesA[ 0 ] ? "y" : "n" ); empresa.set( EmpresasData.A_EXAMES, analisesExamesA[ 1 ] ? "y" : "n" ); - boolean analisesExamesB[] = ( boolean [] ) dadosProtocolo[ 1 ].elementAt( 0 ); + boolean analisesExamesB[] = ( boolean [] ) dadosProtocolo[ 1 ].get( 0 ); empresa.set( EmpresasData.B_CONSULTAS, analisesExamesB[ 0 ] ? "y" : "n" ); empresa.set( EmpresasData.B_EXAMES, analisesExamesB[ 1 ] ? "y" : "n" ); Integer elementosProtocolo[][] = - new Integer[][]{ ( Integer [] ) dadosProtocolo[ 0 ].elementAt( 1 ), - ( Integer [] ) dadosProtocolo[ 1 ].elementAt( 1 ) }; + new Integer[][]{ ( Integer [] ) dadosProtocolo[ 0 ].get( 1 ), + ( Integer [] ) dadosProtocolo[ 1 ].get( 1 ) }; ImageData logo = empresa.toEmpresa_logo_id(); try { @@ -872,6 +879,7 @@ public class EmpresaPanel extends JPanel return new Object[] { empresa, elementosProtocolo }; } + @Override public void setEnabled( boolean enable ) { super.setEnabled( enable ); @@ -898,7 +906,7 @@ public class EmpresaPanel extends JPanel { ListSelectionEvent newEvent = new ListSelectionEvent( this, e.getFirstIndex(), e.getLastIndex(), e.getValueIsAdjusting() ); - ( (ListSelectionListener) listSelectionListeners.elementAt( n ) ).valueChanged( newEvent ); + listSelectionListeners.get( n ).valueChanged( newEvent ); } } @@ -930,7 +938,7 @@ public class EmpresaPanel extends JPanel public void setSelectedEstabelecimento( EstabelecimentosData estab ) { IDObject lista[] = (IDObject [])estabelecimentosModel.getValues().toArray( new IDObject[ 0 ] ); - Integer id = (Integer)estab.get( EstabelecimentosData.ID ); + Integer id = estab.getId(); for( int n = 0; n < lista.length; n++ ) { if( lista[ n ].getID().equals( id ) ) @@ -949,7 +957,7 @@ public class EmpresaPanel extends JPanel Collection marcacoesCollection = objectProvider.listLoad( MarcacoesEmpresaData.class, new Object[]{ empresa.getId() }, new String []{ MarcacoesEmpresaData.EMPRESA_ID }, new String[]{ "data desc" } ); - Vector marcacoes = new Vector(); + List marcacoes = new ArrayList(); marcacoes.add( new ColumnizedObject(){ public Object getValue( int col ) { diff --git a/trunk/SIPRPSoft/src/siprp/clientes/PerfilProtocoloPanel.java b/trunk/SIPRPSoft/src/siprp/clientes/PerfilProtocoloPanel.java index 04ef1c6e..89366c26 100644 --- a/trunk/SIPRPSoft/src/siprp/clientes/PerfilProtocoloPanel.java +++ b/trunk/SIPRPSoft/src/siprp/clientes/PerfilProtocoloPanel.java @@ -15,7 +15,6 @@ import java.awt.Insets; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.Arrays; -import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.JCheckBox; @@ -24,13 +23,15 @@ import javax.swing.JPanel; import com.evolute.utils.data.IDObject; import com.evolute.utils.dataui.ControllableComponent; import com.evolute.utils.ui.panel.CheckBoxPanel; +import java.util.ArrayList; +import java.util.List; /** * * @author fpalma */ public class PerfilProtocoloPanel extends JPanel - implements ControllableComponent, ItemListener + implements ControllableComponent, ItemListener { protected JCheckBox consultasCheck; protected JCheckBox examesCheck; @@ -90,14 +91,13 @@ public class PerfilProtocoloPanel extends JPanel return panel; } - public void fill( Object data ) + public void fill( List list ) { clear(); - if( data != null ) + if( list != null ) { - Vector list = ( Vector ) data; - boolean consultasExames[] = (boolean[]) list.elementAt( 0 ); - Integer tiposEscolhidos[] = ( Integer [] ) list.elementAt( 1 ); + boolean consultasExames[] = ( boolean[] )list.get( 0 ); + Integer tiposEscolhidos[] = ( Integer [] ) list.get( 1 ); consultasCheck.setSelected( consultasExames[ 0 ] ); examesCheck.setSelected( consultasExames[ 1 ] ); for( int n = 0; n < tiposCheck.length; n++ ) @@ -107,12 +107,12 @@ public class PerfilProtocoloPanel extends JPanel } } - public Object save() + public List save() { boolean consultasExames[] = new boolean[ 2 ]; consultasExames[ 0 ] = consultasCheck.isSelected(); consultasExames[ 1 ] = examesCheck.isSelected(); - Vector tiposEscolhidos = new Vector(); + List tiposEscolhidos = new ArrayList(); if( consultasExames[ 1 ] ) { for( int n = 0; n < tiposCheck.length; n++ ) @@ -120,12 +120,13 @@ public class PerfilProtocoloPanel extends JPanel tiposEscolhidos.addAll( Arrays.asList( tiposCheck[ n ].getSelected() ) ); } } - Vector list = new Vector(); + List list = new ArrayList(); list.add( consultasExames ); list.add( tiposEscolhidos.toArray( new Integer[ tiposEscolhidos.size() ] ) ); return list; } + @Override public void setEnabled( boolean enable ) { consultasCheck.setEnabled( enable ); diff --git a/trunk/SIPRPSoft/src/siprp/clientes/ProtocoloPanel.java b/trunk/SIPRPSoft/src/siprp/clientes/ProtocoloPanel.java index 53544e40..8b7284d0 100644 --- a/trunk/SIPRPSoft/src/siprp/clientes/ProtocoloPanel.java +++ b/trunk/SIPRPSoft/src/siprp/clientes/ProtocoloPanel.java @@ -11,7 +11,6 @@ package siprp.clientes; import java.awt.GridLayout; import java.util.Arrays; -import java.util.Hashtable; import java.util.Vector; import javax.swing.BorderFactory; @@ -21,15 +20,18 @@ import javax.swing.JScrollPane; import com.evolute.utils.data.IDObject; import com.evolute.utils.data.MappableObject; import com.evolute.utils.dataui.ControllableComponent; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** * * @author fpalma */ public class ProtocoloPanel extends JPanel - implements ControllableComponent + implements ControllableComponent { - protected ClientesDataProvider provider; + protected final ClientesDataProvider provider; protected IDObject grupos[]; protected IDObject tipos[][]; @@ -40,28 +42,28 @@ public class ProtocoloPanel extends JPanel public ProtocoloPanel() throws Exception { - provider = ( ClientesDataProvider ) ClientesDataProvider.getProvider(); + provider = ClientesDataProvider.getProvider(); IDObject gruposReais[] = provider.getAllGruposProtocoloReais(); - Vector gruposAux = new Vector( Arrays.asList( gruposReais ) ); + List gruposAux = new ArrayList( Arrays.asList( gruposReais ) ); gruposAux.add( new MappableObject( new Integer( 0 ), "Outros" ) ); - grupos = ( IDObject[] ) gruposAux.toArray( new IDObject[ gruposReais.length + 1 ] ); + grupos = gruposAux.toArray( new IDObject[ gruposReais.length + 1 ] ); IDObject gruposFalsos[] = provider.getAllGruposProtocoloFalsos(); - Hashtable tiposHash = provider.getAllTiposElementosProtocoloByGrupo(); + Map> tiposHash = provider.getAllTiposElementosProtocoloByGrupo(); tipos = new IDObject[ grupos.length ][]; for( int n = 0; n < gruposReais.length; n++ ) { - Vector tiposGrupo = ( Vector ) tiposHash.get( gruposReais[ n ].getID() ); - tipos[ n ] = ( IDObject[] ) tiposGrupo.toArray( new IDObject[ tiposGrupo.size() ] ); + List tiposGrupo = tiposHash.get( gruposReais[ n ].getID() ); + tipos[ n ] = tiposGrupo.toArray( new IDObject[ tiposGrupo.size() ] ); } - Vector outros = new Vector(); + List outros = new ArrayList(); for( int n = 0; n < gruposFalsos.length; n++ ) { - Vector tiposGrupo = ( Vector ) tiposHash.get( gruposFalsos[ n ].getID() ); + List tiposGrupo = tiposHash.get( gruposFalsos[ n ].getID() ); outros.addAll( tiposGrupo ); } - tipos[ gruposReais.length ] = ( IDObject[] ) outros.toArray( new IDObject[ outros.size() ] ); + tipos[ gruposReais.length ] = outros.toArray( new IDObject[ outros.size() ] ); setupComponents(); } @@ -88,18 +90,17 @@ public class ProtocoloPanel extends JPanel add( perfilBScp ); } - public void fill( Object data ) + public void fill( List lists[] ) { - Vector lists[] = ( Vector [] ) data; perfisPanels[ 0 ].fill( lists[ 0 ] ); perfisPanels[ 1 ].fill( lists[ 1 ] ); } - public Object save() + public List[] save() { - Vector lists[] = new Vector[ 2 ]; - lists[ 0 ] = ( Vector ) perfisPanels[ 0 ].save(); - lists[ 1 ] = ( Vector ) perfisPanels[ 1 ].save(); + List lists[] = new List[ 2 ]; + lists[ 0 ] = perfisPanels[ 0 ].save(); + lists[ 1 ] = perfisPanels[ 1 ].save(); return lists; } diff --git a/trunk/SIPRPSoft/src/siprp/cursos/CursosInit.java b/trunk/SIPRPSoft/src/siprp/cursos/CursosInit.java new file mode 100644 index 00000000..ef0e4ad2 --- /dev/null +++ b/trunk/SIPRPSoft/src/siprp/cursos/CursosInit.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package siprp.cursos; + +import com.evolute.genericpeople.AutorizacaoLogicFactory; +import com.evolute.genericpeople.AutorizacaoProviderFactory; +import com.evolute.genericpeople.EntidadesProviderFactory; +import com.evolute.genericpeople.PessoasProviderFactory; +import siprp.cursos.logic.AutorizacaoLogic; +import siprp.cursos.provider.AutorizacaoProvider; +import siprp.cursos.provider.EntidadesProvider; +import siprp.cursos.provider.PessoasProvider; + +/** + * + * @author lflores + */ +public class CursosInit +{ + public static void initFactory() + throws Exception + { + AutorizacaoProviderFactory.setProvider( AutorizacaoProvider.getProvider() ); + AutorizacaoLogicFactory.setLogic( AutorizacaoLogic.getLogic() ); + EntidadesProviderFactory.setProvider( EntidadesProvider.getProvider() ); + PessoasProviderFactory.setProvider( PessoasProvider.getProvider() ); + } +} diff --git a/trunk/SIPRPSoft/src/siprp/cursos/CursosWindowAdapter.java b/trunk/SIPRPSoft/src/siprp/cursos/CursosWindowAdapter.java new file mode 100644 index 00000000..63d1daa9 --- /dev/null +++ b/trunk/SIPRPSoft/src/siprp/cursos/CursosWindowAdapter.java @@ -0,0 +1,21 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package siprp.cursos; + +import com.evolute.utils.tracker.TrackableWindow; + +/** + * + * @author lflores + */ +public class CursosWindowAdapter extends com.evolute.module.cursos.CursosWindow + implements TrackableWindow +{ + public CursosWindowAdapter() + throws Exception + { + } +} diff --git a/trunk/SIPRPSoft/src/siprp/cursos/logic/AutorizacaoLogic.java b/trunk/SIPRPSoft/src/siprp/cursos/logic/AutorizacaoLogic.java new file mode 100644 index 00000000..30f3f56a --- /dev/null +++ b/trunk/SIPRPSoft/src/siprp/cursos/logic/AutorizacaoLogic.java @@ -0,0 +1,28 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package siprp.cursos.logic; + +import com.evolute.genericpeople.AutorizacaoLogicInterface; +import com.evolute.swing.frame.EvoFrame; + +/** + * + * @author lflores + */ +public class AutorizacaoLogic implements AutorizacaoLogicInterface +{ + public static AutorizacaoLogic getLogic() + { + return null; + } + + public boolean insertPedido(EvoFrame ef, Integer intgr, String string, String string1, byte[] bytes, Integer intgr1) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + +} diff --git a/trunk/SIPRPSoft/src/siprp/cursos/provider/AutorizacaoProvider.java b/trunk/SIPRPSoft/src/siprp/cursos/provider/AutorizacaoProvider.java new file mode 100644 index 00000000..736f7872 --- /dev/null +++ b/trunk/SIPRPSoft/src/siprp/cursos/provider/AutorizacaoProvider.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package siprp.cursos.provider; + +import com.evolute.genericpeople.AutorizacaoProviderInterface; + +/** + * + * @author lflores + */ +public class AutorizacaoProvider implements AutorizacaoProviderInterface +{ + public static AutorizacaoProvider getProvider() + { + return null; + } + + public Integer getAutorizadorCursos() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Integer getSubTipoIDForDescricao(String string) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff --git a/trunk/SIPRPSoft/src/siprp/cursos/provider/EntidadesProvider.java b/trunk/SIPRPSoft/src/siprp/cursos/provider/EntidadesProvider.java new file mode 100644 index 00000000..4d040a05 --- /dev/null +++ b/trunk/SIPRPSoft/src/siprp/cursos/provider/EntidadesProvider.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package siprp.cursos.provider; + +import com.evolute.genericpeople.EntidadeInterface; +import com.evolute.genericpeople.EntidadesProviderInterface; +import com.evolute.utils.data.IDObject; + +/** + * + * @author lflores + */ +public class EntidadesProvider implements EntidadesProviderInterface +{ + public static EntidadesProvider getProvider() + { + return null; + } + + public EntidadeInterface loadEntidade(Integer intgr) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public IDObject[] getEntidades() throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/trunk/SIPRPSoft/src/siprp/cursos/provider/PessoasProvider.java b/trunk/SIPRPSoft/src/siprp/cursos/provider/PessoasProvider.java new file mode 100644 index 00000000..d0d3ab06 --- /dev/null +++ b/trunk/SIPRPSoft/src/siprp/cursos/provider/PessoasProvider.java @@ -0,0 +1,114 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package siprp.cursos.provider; + +import com.evolute.genericpeople.PessoaDocumentoInterface; +import com.evolute.genericpeople.PessoaInterface; +import com.evolute.genericpeople.PessoasProviderInterface; +import com.evolute.module.cursos.data.CurFormadoresData; +import com.evolute.module.cursos.data.CurFormandosData; +import com.evolute.utils.arrays.Virtual2DArray; +import com.evolute.utils.data.IDObject; +import com.evolute.utils.data.Mappable; +import com.evolute.utils.ui.search.SearchDialog; +import java.util.List; + +/** + * + * @author lflores + */ +public class PessoasProvider implements PessoasProviderInterface +{ + public static PessoasProvider getProvider() + { + return null; + } + + public void setDocumentosForPessoa(Integer intgr, PessoaDocumentoInterface[] pdis) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PessoaInterface getPessoaFromFormador(CurFormadoresData cfd) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PessoaInterface getPessoaFromFormando(CurFormandosData cfd) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean biAlreadyExists(Integer intgr, String string) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PessoaInterface loadPessoa(Integer intgr) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getAllPessoasIDObjects() throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Mappable[] getPaises() throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getNacionalidadeByPaisID(Integer intgr) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getTiposDocumento() throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PessoaDocumentoInterface[] getDocumentosForPessoa(Integer intgr) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PessoaInterface newPessoa() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public PessoaDocumentoInterface newPessoaDocumento() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Virtual2DArray search(String string) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean hasDetails() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void showDetails(SearchDialog sd, Object o) throws Exception + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getSearchTitle() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String[] getColumnNames() + { + throw new UnsupportedOperationException("Not supported yet."); + } +}