diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/build.xml b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/build.xml
deleted file mode 100644
index 749e498d..00000000
--- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/build.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class AnaliseAcidenteTrabalho extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase1() { - return gridBase1; - } - - public void setGridBase1(HtmlPanelGrid hpg) { - this.gridBase1 = hpg; - } - - private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout1() { - return gridLayout1; - } - - public void setGridLayout1(HtmlPanelGrid hpg) { - this.gridLayout1 = hpg; - } - - private HtmlPanelGrid gridMsg = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridMsg() { - return gridMsg; - } - - public void setGridMsg(HtmlPanelGrid hpg) { - this.gridMsg = hpg; - } - - private StaticText txtMsg = new StaticText(); - - public StaticText getTxtMsg() { - return txtMsg; - } - - public void setTxtMsg(StaticText st) { - this.txtMsg = st; - } - - private HtmlPanelGrid gridCabecalho = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridCabecalho() { - return gridCabecalho; - } - - public void setGridCabecalho(HtmlPanelGrid hpg) { - this.gridCabecalho = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText lblEmpresa1 = new StaticText(); - - public StaticText getLblEmpresa1() { - return lblEmpresa1; - } - - public void setLblEmpresa1(StaticText st) { - this.lblEmpresa1 = st; - } - - private StaticText txtEmpresa = new StaticText(); - - public StaticText getTxtEmpresa() { - return txtEmpresa; - } - - public void setTxtEmpresa(StaticText st) { - this.txtEmpresa = st; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private StaticText txtEstabelecimento = new StaticText(); - - public StaticText getTxtEstabelecimento() { - return txtEstabelecimento; - } - - public void setTxtEstabelecimento(StaticText st) { - this.txtEstabelecimento = st; - } - - private StaticText txtTrabalhador = new StaticText(); - - public StaticText getTxtTrabalhador() { - return txtTrabalhador; - } - - public void setTxtTrabalhador(StaticText st) { - this.txtTrabalhador = st; - } - - private HtmlPanelGrid gridTrabalhadores = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridTrabalhadores() { - return gridTrabalhadores; - } - - public void setGridTrabalhadores(HtmlPanelGrid hpg) { - this.gridTrabalhadores = hpg; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private StaticText staticText5 = new StaticText(); - - public StaticText getStaticText5() { - return staticText5; - } - - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private Table table1 = new Table(); - - public Table getTable1() { - return table1; - } - - public void setTable1(Table t) { - this.table1 = t; - } - - private TableRowGroup tableRowGroup1 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup1() { - return tableRowGroup1; - } - - public void setTableRowGroup1(TableRowGroup trg) { - this.tableRowGroup1 = trg; - } - - private TableColumn tableColumn1 = new TableColumn(); - - public TableColumn getTableColumn1() { - return tableColumn1; - } - - public void setTableColumn1(TableColumn tc) { - this.tableColumn1 = tc; - } - - private Hyperlink lnkNome1 = new Hyperlink(); - - public Hyperlink getLnkNome1() { - return lnkNome1; - } - - public void setLnkNome1(Hyperlink h) { - this.lnkNome1 = h; - } - - private TableColumn tableColumn2 = new TableColumn(); - - public TableColumn getTableColumn2() { - return tableColumn2; - } - - public void setTableColumn2(TableColumn tc) { - this.tableColumn2 = tc; - } - - private Hyperlink lnkDataNascimento1 = new Hyperlink(); - - public Hyperlink getLnkDataNascimento1() { - return lnkDataNascimento1; - } - - public void setLnkDataNascimento1(Hyperlink h) { - this.lnkDataNascimento1 = h; - } - - private StaticText txtSearchMsg = new StaticText(); - - public StaticText getTxtSearchMsg() { - return txtSearchMsg; - } - - public void setTxtSearchMsg(StaticText st) { - this.txtSearchMsg = st; - } - - private HtmlPanelGrid gridSiprp = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridSiprp() { - return gridSiprp; - } - - public void setGridSiprp(HtmlPanelGrid hpg) { - this.gridSiprp = hpg; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private StaticText staticText6 = new StaticText(); - - public StaticText getStaticText6() { - return staticText6; - } - - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } - - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private StaticText staticText8 = new StaticText(); - - public StaticText getStaticText8() { - return staticText8; - } - - public void setStaticText8(StaticText st) { - this.staticText8 = st; - } - - private StaticText staticText9 = new StaticText(); - - public StaticText getStaticText9() { - return staticText9; - } - - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private DropDown drpTecnicos = new DropDown(); - - public DropDown getDrpTecnicos() { - return drpTecnicos; - } - - public void setDrpTecnicos(DropDown dd) { - this.drpTecnicos = dd; - } - - private StaticText staticText10 = new StaticText(); - - public StaticText getStaticText10() { - return staticText10; - } - - public void setStaticText10(StaticText st) { - this.staticText10 = st; - } - - private StaticText txtCap = new StaticText(); - - public StaticText getTxtCap() { - return txtCap; - } - - public void setTxtCap(StaticText st) { - this.txtCap = st; - } - - private StaticText staticText11 = new StaticText(); - - public StaticText getStaticText11() { - return staticText11; - } - - public void setStaticText11(StaticText st) { - this.staticText11 = st; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private DropDown drpMedicos = new DropDown(); - - public DropDown getDrpMedicos() { - return drpMedicos; - } - - public void setDrpMedicos(DropDown dd) { - this.drpMedicos = dd; - } - - private StaticText staticText12 = new StaticText(); - - public StaticText getStaticText12() { - return staticText12; - } - - public void setStaticText12(StaticText st) { - this.staticText12 = st; - } - - private StaticText txtCedula = new StaticText(); - - public StaticText getTxtCedula() { - return txtCedula; - } - - public void setTxtCedula(StaticText st) { - this.txtCedula = st; - } - - //Construct a new Page bean instance.
- */ - public AnaliseAcidenteTrabalho() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - txtMsg.setText(getSessionBean1().getMsg()); - getSessionBean1().setMsg(""); - - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; - } - - - private void initializePage() - { - butEnviar.setText("Enviar a RH"); - gridSiprpView.setRendered(false); - gridAcidentadoView.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridDadosAcidenteRhView.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridAssinaturas.setRendered(false); - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - String nome_empresa = adp.getEmpresaNome(getSessionBean1().getCurrentUser().getEmpresa_id()); - txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - try - { - txtEstabelecimento.setText(adp.getEstabelecimentoNome(getSessionBean1().getCurrentUser().getEstabelecimento_id())); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - fillTrabalhadoresTable(); - - Calendar c = Calendar.getInstance(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); - stDataAcidente.setText(dateFormat.format(c.getTime())); - - } - - private void fillTrabalhadoresTable() - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - //lblActivos.setRendered(true); - table1.setRendered(true); - - ArrayList trabalhadoresList = adp.getTrabalhadoresListByEstabelecimento(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getTrabalhadoresListDataProvider().setList(trabalhadoresList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table1.setRendered(false); - ex.printStackTrace(); - } - } - - private String fillPage() - { - AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - stHeaderNr.setText(a.getAnalise_nr()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); - stHeaderDate.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); - txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - try - { - txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - Acidentado ac = null; - try - { - //Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); - //txtDataNascimento.setText(t.getData_nascimento()); - ac = adp.getAcidentado(a.getAcidentado_id()); - txtTrabalhador.setText(ac.getNome()); - getSessionBean1().setAcidentado(ac); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - - int estado_documento = a.getEstado().intValue(); - if(estado_documento != ESTADO_IMPRESSAO) - { - butImprimir.setRendered(false); - } - else - { - butGravar.setRendered(false); - } - switch(estado_documento) - { - case ESTADO_SEG: - butEnviar.setText("Enviar a RH"); - gridSiprpView.setRendered(false); - gridAcidentadoView.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridDadosAcidenteRhView.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridAssinaturas.setRendered(false); - fillSiprp(a); - fillAcidentado(ac); - fillDadosAcidenteSeg(a); - break; - case ESTADO_RH1: - butEnviar.setText("Enviar a HS"); - gridSiprpView.setRendered(false); - gridAcidentadoView.setRendered(false); - //gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRhView.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridAssinaturas.setRendered(false); - if(ac != null) - { - fillAcidentado(ac); - } - fillSiprp(a); - fillDadosAcidenteSeg(a); - fillDadosAcidenteRh(a); - break; - case ESTADO_HS: - butEnviar.setText("Enviar a RH"); - //gridSiprpView.setRendered(false); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - //gridAcidentadoView.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridAssinaturas.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesHs(a); - //gridDadosAcidenteRhView.setRendered(false); - //gridRecomendacoesHS.setRendered(false); - break; - case ESTADO_RH2: - butEnviar.setText("Enviar a Médico"); - - //gridSiprpView.setRendered(false); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - //gridAcidentadoView.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - //gridRecomendacoesViewHS.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - gridAssinaturas.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasRh(a); - break; - case ESTADO_MEDICO: - butEnviar.setText("Enviar a Verificação"); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedicoView.setRendered(false); - gridAssinaturas.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - fillMedico(a); - //fillMedicoView(a); - break; - case ESTADO_ASSINATURAS: - butEnviar.setText("Enviar a Impressão"); - if(a.getEstado_assinatura().intValue() < ESTADO_ASSINATURA_3) - { - butEnviar.setDisabled(true); - } - else - { - butEnviar.setDisabled(false); - } - - txtAssSeg.setDisabled(true); - txtAssHS.setDisabled(true); - txtAssMed.setDisabled(true); - txtAssRespRh.setDisabled(true); - txtAssRespSeg.setDisabled(true); - - int tipo_utilizador = getSessionBean1().getCurrentUser().getTipo().intValue(); - - switch(tipo_utilizador) - { - case 1: //seguranca - if(a.getEstado_assinatura().intValue() == 1) - { - txtAssRespSeg.setDisabled(false); - } - else - { - txtAssSeg.setDisabled(false); - } - - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridRecomendacoesViewHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - //fillAssinaturaSeg(a); - break; - - case 2: //rh - txtAssRespRh.setDisabled(false); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - break; - - case 3: //hs - txtAssHS.setDisabled(false); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedidasViewRH.setRendered(false); - gridMedico.setRendered(false); - gridMedicoView.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - break; - - case 5: //med - txtAssMed.setDisabled(false); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedico.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - //fillMedico(a); - fillMedicoView(a); - break; - } - break; - case ESTADO_IMPRESSAO: - butEnviar.setText("Enviar para Fecho"); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedico.setRendered(false); - gridAssinaturas.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - //fillMedico(a); - fillMedicoView(a); - - buildPdf(a); - - break; - case ESTADO_FECHAR: - butEnviar.setText("Fechar"); - gridSiprp.setRendered(false); - gridAcidentado.setRendered(false); - gridDadosAcidenteSeg.setRendered(false); - gridDadosAcidenteRh.setRendered(false); - gridRecomendacoesHS.setRendered(false); - gridMedidasRH.setRendered(false); - gridMedico.setRendered(false); - gridAssinaturas.setRendered(false); - fillSiprpView(a); - if(ac != null) - { - fillAcidentadoView(ac); - } - fillDadosAcidenteRhView(a); - fillRecomendacoesViewHs(a); - fillMedidasViewRh(a); - //fillMedico(a); - fillMedicoView(a); - break; - case ESTADO_CONCLUIDO: - } - - return null; - } - - private void fillSiprp(AnaliseAcidente a) - { - drpTecnicos.setSelected(a.getTecnico_saude_id()); - drpMedicos.setSelected(a.getMedico_id()); - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); - txtCap.setText(u.getCap()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - try - { - Utilizador u = udp.getUtilizador(a.getMedico_id()); - txtCedula.setText(u.getNumero_cedula()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - - private void fillSiprpView(AnaliseAcidente a) - { - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); - stTecnicoNome.setText(Utils.unicodeToHTML(u.getNome())); - txtCap1.setText(u.getCap()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - try - { - Utilizador u = udp.getUtilizador(a.getMedico_id()); - stMedicoNome.setText(Utils.unicodeToHTML(u.getNome())); - txtCedula1.setText(u.getNumero_cedula()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - - private void fillAcidentado(Acidentado a) - { - txtNomeAcidentado.setText(a.getNome()); - txtDataNascimento.setText(a.getData_nascimento()); - txtBI.setText(a.getBilhete_identidade()); - txtMorada.setText(a.getMorada()); - String cod_postal1 = ""; - String cod_postal2 = ""; - try - { - cod_postal1 = a.getCod_postal().substring(0, 4); - } - catch(Exception ex){} - try - { - cod_postal2 = a.getCod_postal().substring(5, 8); - } - catch(Exception ex){} - - - txtCodPostal1.setText(cod_postal1); - txtCodPostal2.setText(cod_postal2); - txtLocalidade.setText(a.getLocalidade()); - txtContactoTelefonico.setText(a.getContacto_telefonico()); - stDataAdmissao.setText(a.getData_admissao()); - - stFuncao.setText(a.getFuncao()); - if(a.getTurno().matches("m")) - { - rbTurnoManha.setSelected(new Boolean(true)); - } - else if(a.getTurno().matches("t")) - { - rbTurnoTarde.setSelected(new Boolean(true)); - } - else if(a.getTurno().matches("n")) - { - rbTurnoNoite.setSelected(new Boolean(true)); - } - } - - private void fillAcidentadoView(Acidentado a) - { - stNomeAcidentado.setText(a.getNome()); - //stDataNascimento.setText(a.getData_nascimento()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime()); - stDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - stBI.setText(a.getBilhete_identidade()); - stMorada.setText(a.getMorada()); - String cod_postal1 = ""; - String cod_postal2 = ""; - try - { - cod_postal1 = a.getCod_postal().substring(0, 4); - } - catch(Exception ex){} - try - { - cod_postal2 = a.getCod_postal().substring(5, 8); - } - catch(Exception ex){} - - //String cod_postal1 = a.getCod_postal().substring(0, 4); - //String cod_postal2 = a.getCod_postal().substring(5, 8); - String cod_postal = cod_postal1 + "-" + cod_postal2 + " " + a.getLocalidade(); - stCodPostal.setText(cod_postal); - stContactoTelefonico.setText(a.getContacto_telefonico()); - //stDataAdmissao1.setText(a.getData_admissao()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_admissao().getTime()); - stDataAdmissao1.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - stFuncao1.setText(a.getFuncao()); - String turno_str = ""; - if(a.getTurno().matches("m")) - { - turno_str = "manhã"; - } - else if(a.getTurno().matches("t")) - { - turno_str += "tarde "; - } - else if(a.getTurno().matches("n")) - { - turno_str += "noite"; - } - stTurno.setText(turno_str); - } - - private void fillDadosAcidenteSeg(AnaliseAcidente a) - { - stDataAcidente.setText(a.getData_acidente()); - Calendar cal = Calendar.getInstance(); - - // set the calendar to have your time - cal.setTimeInMillis(a.getHora_acidente().getTime()); - - int hour = cal.get(Calendar.HOUR); - int minutes = cal.get(Calendar.MINUTE); - drpHours.setSelected(new Integer(hour)); - drpMinutes.setSelected(new Integer(minutes)); - txtHorasTurno.setText(a.getHoras_turno().toString()); - txtSeccao.setText(a.getSeccao()); - txtLocal.setText(a.getLocal_trabalho()); - txtTarefa.setText(a.getTarefa()); - txtSubstancias.setText(a.getSubstancias()); - txtSuperior.setText(a.getSuperior_hierarquico()); - txtCondicoes.setText(a.getCondicoes()); - txtTestemunhas.setText(a.getTestemunhas()); - txtCausas.setText(a.getCausas()); - txtDescricao.setText(a.getDescricao()); - txtConclusoes.setText(a.getConclusoes()); - txtAccoes.setText(a.getAccoes()); - - //fill images - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); - String imageFileFolder = theApplicationsServletContext.getRealPath(IMAGE_URL + "/" + getSessionBean1().getCurrentAnalise().getId()); - try - { - File f = new File(imageFileFolder); - - if(f.exists()) - { - File images[] = f.listFiles(); - - for(int i=0;iProxima fase
"; - html+=""; - msgBodyPart.setContent(html, "text/html"); - multipart.addBodyPart(msgBodyPart); - msg.setContent(multipart); - Transport.send(msg); - System.out.println("Email Enviado !!!! "); -// } -// catch (Exception ex) -// { -// System.out.println("MAIL ERROR : " + ex.getMessage()); -// ex.printStackTrace(); -// } - - } - - public String butImprimir_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. -// AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); -// if(a.getEstado().intValue() == ESTADO_IMPRESSAO) -// { -// Pdf pdf = new Pdf(); -// pdf.generatePdf(a); -// } - return null; - } - - private void buildPdf(AnaliseAcidente a) - { - - // create pdf folder - String pdf_folder = createPdfFolder(a.getId().toString()); - if(pdf_folder != null) - { - hidPdf.setValue(a.getId().toString()); - Pdf pdf = new Pdf(); - pdf.generatePdf(pdf_folder, a); - } - } - - - private String createPdfFolder(String folderName) - { - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); - String pdfFileFolder = theApplicationsServletContext.getRealPath(PDFS_FOLDER_URL + "/" + folderName); - try - { - //String imageFileFolderTmp = theApplicationsServletContext.getRealPath(IMAGE_URL + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); - File folder = new File(pdfFileFolder); - if(! folder.exists()) - { - folder.mkdir(); - } - else - { - //remove all existing files - File files[] = folder.listFiles(); - - for(int i=0;iAn instance of this class will be created for you automatically, - * the first time your application evaluates a value binding expression - * or method binding expression that references a managed bean using - * this class.
- */ -public class ApplicationBean1 extends AbstractApplicationBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - //Construct a new application data bean instance.
- */ - public ApplicationBean1() { - } - - /** - *This method is called when this bean is initially added to - * application scope. Typically, this occurs as a result of evaluating - * a value binding or method binding expression, which utilizes the - * managed bean facility to instantiate this bean and store it into - * application scope.
- * - *You may customize this method to initialize and cache application wide - * data values (such as the lists of valid options for dropdown list - * components), or to allocate resources that are required for the - * lifetime of the application.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //This method is called when this bean is removed from - * application scope. Typically, this occurs as a result of - * the application being shut down by its owning container.
- * - *You may customize this method to clean up resources allocated
- * during the execution of the init() method, or
- * at any later time during the lifetime of the application.
Return an appropriate character encoding based on the
- * Locale defined for the current JavaServer Faces
- * view. If no more suitable encoding can be found, return
- * "UTF-8" as a general purpose default.
The default implementation uses the implementation from
- * our superclass, AbstractApplicationBean.
Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class Dummy extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser1 = new StaticText(); - - public StaticText getLblUser1() { - return lblUser1; - } - - public void setLblUser1(StaticText st) { - this.lblUser1 = st; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Hyperlink lnkEditUser1 = new Hyperlink(); - - public Hyperlink getLnkEditUser1() { - return lnkEditUser1; - } - - public void setLnkEditUser1(Hyperlink h) { - this.lnkEditUser1 = h; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkLogout1 = new Hyperlink(); - - public Hyperlink getLnkLogout1() { - return lnkLogout1; - } - - public void setLnkLogout1(Hyperlink h) { - this.lnkLogout1 = h; - } - - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private HtmlPanelGrid gridHeader = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridHeader() { - return gridHeader; - } - - public void setGridHeader(HtmlPanelGrid hpg) { - this.gridHeader = hpg; - } - - private PanelGroup groupPanel5 = new PanelGroup(); - - public PanelGroup getGroupPanel5() { - return groupPanel5; - } - - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; - } - - private StaticText lblUser2 = new StaticText(); - - public StaticText getLblUser2() { - return lblUser2; - } - - public void setLblUser2(StaticText st) { - this.lblUser2 = st; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private Hyperlink lnkEditUser2 = new Hyperlink(); - - public Hyperlink getLnkEditUser2() { - return lnkEditUser2; - } - - public void setLnkEditUser2(Hyperlink h) { - this.lnkEditUser2 = h; - } - - private StaticText staticText8 = new StaticText(); - - public StaticText getStaticText8() { - return staticText8; - } - - public void setStaticText8(StaticText st) { - this.staticText8 = st; - } - - private Hyperlink lnkLogout2 = new Hyperlink(); - - public Hyperlink getLnkLogout2() { - return lnkLogout2; - } - - public void setLnkLogout2(Hyperlink h) { - this.lnkLogout2 = h; - } - - private StaticText staticText9 = new StaticText(); - - public StaticText getStaticText9() { - return staticText9; - } - - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private ImageComponent image3 = new ImageComponent(); - - public ImageComponent getImage3() { - return image3; - } - - public void setImage3(ImageComponent ic) { - this.image3 = ic; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText staticText5 = new StaticText(); - - public StaticText getStaticText5() { - return staticText5; - } - - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } - - private StaticText stHeaderNr1 = new StaticText(); - - public StaticText getStHeaderNr1() { - return stHeaderNr1; - } - - public void setStHeaderNr1(StaticText st) { - this.stHeaderNr1 = st; - } - - private PanelGroup groupPanel6 = new PanelGroup(); - - public PanelGroup getGroupPanel6() { - return groupPanel6; - } - - public void setGroupPanel6(PanelGroup pg) { - this.groupPanel6 = pg; - } - - private StaticText staticText6 = new StaticText(); - - public StaticText getStaticText6() { - return staticText6; - } - - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } - - private StaticText stHeaderDate1 = new StaticText(); - - public StaticText getStHeaderDate1() { - return stHeaderDate1; - } - - public void setStHeaderDate1(StaticText st) { - this.stHeaderDate1 = st; - } - - private ImageComponent image4 = new ImageComponent(); - - public ImageComponent getImage4() { - return image4; - } - - public void setImage4(ImageComponent ic) { - this.image4 = ic; - } - - private RadioButton radioButton1 = new RadioButton(); - - public RadioButton getRadioButton1() { - return radioButton1; - } - - public void setRadioButton1(RadioButton rb) { - this.radioButton1 = rb; - } - - private PanelGroup groupPanel7 = new PanelGroup(); - - public PanelGroup getGroupPanel7() { - return groupPanel7; - } - - public void setGroupPanel7(PanelGroup pg) { - this.groupPanel7 = pg; - } - - private StaticText staticText10 = new StaticText(); - - public StaticText getStaticText10() { - return staticText10; - } - - public void setStaticText10(StaticText st) { - this.staticText10 = st; - } - - private StaticText staticText11 = new StaticText(); - - public StaticText getStaticText11() { - return staticText11; - } - - public void setStaticText11(StaticText st) { - this.staticText11 = st; - } - - private StaticText staticText12 = new StaticText(); - - public StaticText getStaticText12() { - return staticText12; - } - - public void setStaticText12(StaticText st) { - this.staticText12 = st; - } - - private StaticText staticText13 = new StaticText(); - - public StaticText getStaticText13() { - return staticText13; - } - - public void setStaticText13(StaticText st) { - this.staticText13 = st; - } - - private StaticText staticText14 = new StaticText(); - - public StaticText getStaticText14() { - return staticText14; - } - - public void setStaticText14(StaticText st) { - this.staticText14 = st; - } - - private RadioButton rbTurnoManha = new RadioButton(); - - public RadioButton getRbTurnoManha() { - return rbTurnoManha; - } - - public void setRbTurnoManha(RadioButton rb) { - this.rbTurnoManha = rb; - } - - private RadioButton rbTurnoTarde = new RadioButton(); - - public RadioButton getRbTurnoTarde() { - return rbTurnoTarde; - } - - public void setRbTurnoTarde(RadioButton rb) { - this.rbTurnoTarde = rb; - } - - private RadioButton rbTurnoNoite = new RadioButton(); - - public RadioButton getRbTurnoNoite() { - return rbTurnoNoite; - } - - public void setRbTurnoNoite(RadioButton rb) { - this.rbTurnoNoite = rb; - } - - private Button button1 = new Button(); - - public Button getButton1() { - return button1; - } - - public void setButton1(Button b) { - this.button1 = b; - } - - private HiddenField hiddenField1 = new HiddenField(); - - public HiddenField getHiddenField1() { - return hiddenField1; - } - - public void setHiddenField1(HiddenField hf) { - this.hiddenField1 = hf; - } - - //Construct a new Page bean instance.
- */ - public Dummy() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - //txtIn.setText("OLA"); - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String button1_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - //System.out.println("TEXT : " + txtIn.getText().toString()); - return null; - } - - public String butCancelar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - return null; - } - - public String butGravar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - return null; - } - - public String butEnviar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - return null; - } - - public String butImagem_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - return null; - } - - public String lnkMoreMed1_action() { - // TODO: Replace with your code - - return null; - } - - public String lnkNome_action() { - // TODO: Replace with your code - - return null; - } - - public String lnkDataNascimento_action() { - // TODO: Replace with your code - - return null; - } - - public String lnkEditUser_action() { - // TODO: Replace with your code - - return null; - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - return null; - } -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Erro.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Erro.java deleted file mode 100644 index 66aa2dc1..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Erro.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Error.java - * - * Created on September 19, 2007, 5:21 PM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.StaticText; -import com.sun.rave.web.ui.component.TextField; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class Erro extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText txtCab = new StaticText(); - - public StaticText getTxtCab() { - return txtCab; - } - - public void setTxtCab(StaticText st) { - this.txtCab = st; - } - - private StaticText txtMsg = new StaticText(); - - public StaticText getTxtMsg() { - return txtMsg; - } - - public void setTxtMsg(StaticText st) { - this.txtMsg = st; - } - - //Construct a new Page bean instance.
- */ - public Erro() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - txtMsg.setText( getSessionBean1().getMsg() ); - getSessionBean1().setMsg(""); - System.out.println("ERROR PAGE"); - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java deleted file mode 100644 index 39defa9c..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Empresa.java - * - * Created on October 11, 2007, 5:19 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class Estabelecimento { - private Integer id; - private String nome_plain; - - /** Creates a new instance of Empresa */ - public Estabelecimento() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getNome_plain() { - return nome_plain; - } - - public void setNome_plain(String nome_plain) { - this.nome_plain = nome_plain; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java deleted file mode 100644 index eeefde7c..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java +++ /dev/null @@ -1,1209 +0,0 @@ -/* - * FichaUtilizador.java - * - * Created on October 11, 2007, 9:49 AM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.corba.se.impl.logging.UtilSystemException; -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.DropDown; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.HiddenField; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.Hyperlink; -import com.sun.rave.web.ui.component.ImageComponent; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.PasswordField; -import com.sun.rave.web.ui.component.StaticText; -import com.sun.rave.web.ui.component.TextField; -import com.sun.rave.web.ui.model.SingleSelectOptionsList; -import db.AnalisesDataProvider; -import db.UtilizadoresDataProvider; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; -import javax.faces.event.ValueChangeEvent; -import javax.servlet.http.HttpServletRequest; -import utils.Utils; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class FichaUtilizador extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase1() { - return gridBase1; - } - - public void setGridBase1(HtmlPanelGrid hpg) { - this.gridBase1 = hpg; - } - - private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout1() { - return gridLayout1; - } - - public void setGridLayout1(HtmlPanelGrid hpg) { - this.gridLayout1 = hpg; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Hyperlink lnkEditUser = new Hyperlink(); - - public Hyperlink getLnkEditUser() { - return lnkEditUser; - } - - public void setLnkEditUser(Hyperlink h) { - this.lnkEditUser = h; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkLogout = new Hyperlink(); - - public Hyperlink getLnkLogout() { - return lnkLogout; - } - - public void setLnkLogout(Hyperlink h) { - this.lnkLogout = h; - } - - private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridMsg1() { - return gridMsg1; - } - - public void setGridMsg1(HtmlPanelGrid hpg) { - this.gridMsg1 = hpg; - } - - private StaticText txtMsg = new StaticText(); - - public StaticText getTxtMsg() { - return txtMsg; - } - - public void setTxtMsg(StaticText st) { - this.txtMsg = st; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private StaticText stCriarEditar = new StaticText(); - - public StaticText getStCriarEditar() { - return stCriarEditar; - } - - public void setStCriarEditar(StaticText st) { - this.stCriarEditar = st; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private StaticText staticText5 = new StaticText(); - - public StaticText getStaticText5() { - return staticText5; - } - - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } - - private DropDown drpTipo = new DropDown(); - - public DropDown getDrpTipo() { - return drpTipo; - } - - public void setDrpTipo(DropDown dd) { - this.drpTipo = dd; - } - - private StaticText staticText6 = new StaticText(); - - public StaticText getStaticText6() { - return staticText6; - } - - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private DropDown drpNome = new DropDown(); - - public DropDown getDrpNome() { - return drpNome; - } - - public void setDrpNome(DropDown dd) { - this.drpNome = dd; - } - - private TextField txtNome = new TextField(); - - public TextField getTxtNome() { - return txtNome; - } - - public void setTxtNome(TextField tf) { - this.txtNome = tf; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private TextField txtLogin = new TextField(); - - public TextField getTxtLogin() { - return txtLogin; - } - - public void setTxtLogin(TextField tf) { - this.txtLogin = tf; - } - - private StaticText staticText8 = new StaticText(); - - public StaticText getStaticText8() { - return staticText8; - } - - public void setStaticText8(StaticText st) { - this.staticText8 = st; - } - - private PasswordField txtPassword = new PasswordField(); - - public PasswordField getTxtPassword() { - return txtPassword; - } - - public void setTxtPassword(PasswordField pf) { - this.txtPassword = pf; - } - - private StaticText staticText9 = new StaticText(); - - public StaticText getStaticText9() { - return staticText9; - } - - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } - - private TextField txtEmail = new TextField(); - - public TextField getTxtEmail() { - return txtEmail; - } - - public void setTxtEmail(TextField tf) { - this.txtEmail = tf; - } - - private StaticText lblCap = new StaticText(); - - public StaticText getLblCap() { - return lblCap; - } - - public void setLblCap(StaticText st) { - this.lblCap = st; - } - - private TextField txtCap = new TextField(); - - public TextField getTxtCap() { - return txtCap; - } - - public void setTxtCap(TextField tf) { - this.txtCap = tf; - } - - private StaticText lblCedula = new StaticText(); - - public StaticText getLblCedula() { - return lblCedula; - } - - public void setLblCedula(StaticText st) { - this.lblCedula = st; - } - - private StaticText stCedula = new StaticText(); - - public StaticText getStCedula() { - return stCedula; - } - - public void setStCedula(StaticText st) { - this.stCedula = st; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText staticText13 = new StaticText(); - - public StaticText getStaticText13() { - return staticText13; - } - - public void setStaticText13(StaticText st) { - this.staticText13 = st; - } - - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } - - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } - - private Button butCancelar = new Button(); - - public Button getButCancelar() { - return butCancelar; - } - - public void setButCancelar(Button b) { - this.butCancelar = b; - } - - private PanelGroup groupPanel5 = new PanelGroup(); - - public PanelGroup getGroupPanel5() { - return groupPanel5; - } - - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; - } - - private Button butApagar = new Button(); - - public Button getButApagar() { - return butApagar; - } - - public void setButApagar(Button b) { - this.butApagar = b; - } - - private Button butGravar = new Button(); - - public Button getButGravar() { - return butGravar; - } - - public void setButGravar(Button b) { - this.butGravar = b; - } - - private HiddenField hidConfDelUser = new HiddenField(); - - public HiddenField getHidConfDelUser() { - return hidConfDelUser; - } - - public void setHidConfDelUser(HiddenField hf) { - this.hidConfDelUser = hf; - } - - //Construct a new Page bean instance.
- */ - public FichaUtilizador() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - stCriarEditar.setText("EDITAR"); - butApagar.setRendered(true); - if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) - { - if(!isPostData) - { - txtNome.setStyleClass("hide"); - stCriarEditar.setText("CRIAR"); - } - butApagar.setRendered(false); - } - if(getSessionBean1().getModoEdicaoUtilizador().matches("edit")) - { - //drpNome.setRendered(true); - if(!isPostData) - { - showUser(); - } - } - txtMsg.setText(getSessionBean1().getMsg()); - getSessionBean1().setMsg(""); - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; - } - - - public String butCancelar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - String nav_from = getSessionBean1().getNavFrom(); - if(nav_from.matches("FormSeguranca")) - { - return "form_seguranca"; - } - else if(nav_from.matches("FormRH")) - { - return "form_rh"; - } - else if(nav_from.matches("FormHS")) - { - return "form_hs"; - } - else if(nav_from.matches("FormMedico")) - { - return "form_medico"; - } - else if(nav_from.matches("AnaliseAcidenteTrabalho")) - { - System.out.println("GOTO ANALISE ACIDENTE"); - return "analise_acidente"; - } - else if(nav_from.matches("ViewAnaliseAcidenteTrabalho")) - { - return "view_analise"; - } - return "case1"; - } - - public String butGravar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - if(validationOk()) - { - if(getSessionBean1().getModoEdicaoUtilizador().matches("new")) - { - try - { - Utilizador u = addUser(); - addPermissao(u); - } - catch(Exception ex) - { - getSessionBean1().setMsg("Erro na criação do utilizador"); - ex.printStackTrace(); - } - } - else //edit - { - try - { - updateUser(); - } - catch(Exception ex) - { - getSessionBean1().setMsg("Erro na actualização do utilizador"); - ex.printStackTrace(); - } - } - - } - - return null; - } - - public void drpTipo_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - drpNome.setVisible(true); - Integer tipo = (Integer) drpTipo.getSelected(); - if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == ADMIN_LOJA) - { - drpNome.setRendered(false); - txtNome.setStyleClass("show"); - lblCap.setRendered(false); - txtCap.setRendered(false); - lblCedula.setRendered(false); - stCedula.setRendered(false); - } - else if(tipo.intValue() == HS || tipo.intValue() == MEDICO) - { - drpNome.setRendered(true); - txtNome.setStyleClass("hide"); - AnalisesDataProvider adp = new AnalisesDataProvider(); - if(tipo.intValue() == HS) - { - lblCap.setRendered(true); - txtCap.setRendered(true); - lblCedula.setRendered(false); - stCedula.setRendered(false); - try - { - getSessionBean1().setMedicosOptions(adp.getTecnicosSaudeList()); - drpNome.setSelected(new Integer(0)); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - else // medicos - { - lblCedula.setRendered(true); - stCedula.setRendered(true); - lblCap.setRendered(false); - txtCap.setRendered(false); - try - { - getSessionBean1().setMedicosOptions(adp.getMedicosList()); - drpNome.setSelected(new Integer(0)); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - } - } - - private boolean validationOk() - { - Integer tipo = (Integer) drpTipo.getSelected(); - if(tipo.intValue() == 0) - { - getSessionBean1().setMsg("Tem de escolher um tipo !"); - return false; - } - Integer estabelecimento = (Integer) drpEstabelecimentos.getSelected(); - if(estabelecimento.intValue() == 0) - { - getSessionBean1().setMsg("Tem de escolher um estabelecimento !"); - return false; - } - - if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == HS || tipo.intValue() == MEDICO || tipo.intValue() == ADMIN_LOJA) - { - if(txtNome.getText() == null) - { - getSessionBean1().setMsg("Tem de indicar o nome !"); - return false; - } - else - { - String nome = (String) txtNome.getText(); - if(nome.trim().length() == 0) - { - getSessionBean1().setMsg("Tem de indicar o nome !"); - return false; - } - } - } - else if(tipo.intValue() == HS || tipo.intValue() == MEDICO) - { - Integer nome = (Integer) drpNome.getSelected(); - if(nome.intValue() == 0) - { - getSessionBean1().setMsg("Tem de indicar o nome !"); - return false; - } - } - - if(txtLogin.getText() == null) - { - getSessionBean1().setMsg("Tem de indicar o login !"); - return false; - } - else - { - String login = (String) txtLogin.getText(); - if(login.trim().length() == 0) - { - getSessionBean1().setMsg("Tem de indicar o login !"); - return false; - } - } - - if(txtPassword.getText() == null) - { - getSessionBean1().setMsg("Tem de indicar a password !"); - return false; - } - else - { - String password = (String) txtPassword.getText(); - if(password.trim().length() == 0) - { - getSessionBean1().setMsg("Tem de indicar a password !"); - return false; - } - } - - if(tipo.intValue() == HS) - { - if(txtCap.getText() == null ) - { - getSessionBean1().setMsg("Tem de indicar o c.a.p. !"); - return false; - } - else - { - String cap = (String) txtCap.getText(); - if(cap.trim().length() == 0) - { - getSessionBean1().setMsg("Tem de indicar o c.a.p. !"); - return false; - } - } - } - - return true; - } - - public void drpNome_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Integer tipo = (Integer) drpTipo.getSelected(); - if(tipo.intValue() == MEDICO) - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - Integer medico_id = (Integer) drpNome.getSelected(); - try - { - String numero_cedula = adp.getNumeroCedula(medico_id); - stCedula.setText(numero_cedula); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - } - - private Utilizador addUser() throws Exception - { - Utilizador u = fillUser(); - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - Integer id = udp.createNewUtilizador(u); - u.setId(id); - return u; - } - - private void addPermissao(Utilizador u) throws Exception - { - Permissao p = new Permissao(); - p.setUser_id(u.getId()); - p.setCodigo_permissao(u.getTipo()); - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - udp.createPermissao(p); - } - - private void updateUser() throws Exception - { - Utilizador u = fillUser(); - u.setId(getSessionBean1().getCurrentUser().getId()); - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - udp.updateUtilizador(u); - } - - private void deleteUser() throws Exception - { - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - udp.deleteUser(getSessionBean1().getCurrentUser().getId()); - } - - private void showUser() - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - Utilizador u = getSessionBean1().getCurrentUser(); - drpTipo.setSelected(u.getTipo()); - if(u.getTipo().intValue() == SEG || u.getTipo().intValue() == RH || u.getTipo().intValue() == HS || u.getTipo().intValue() == MEDICO || u.getTipo().intValue() == ADMIN_LOJA) - { - drpNome.setRendered(false); - txtNome.setStyleClass("show"); - lblCap.setRendered(false); - txtCap.setRendered(false); - lblCedula.setRendered(false); - stCedula.setRendered(false); - System.out.println("NOME == " + u.getNome()); - txtNome.setText(utils.Utils.unicodeToHTML(u.getNome())); - } - else if(u.getTipo().intValue() == HS) - { - //txtNome.setRendered(false); - try - { - getSessionBean1().setMedicosOptions(adp.getTecnicosSaudeList()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - drpNome.setSelected(u.getFuncionario_hst_id()); - drpNome.setStyleClass("show"); - lblCap.setRendered(true); - txtCap.setRendered(true); - lblCedula.setRendered(false); - stCedula.setRendered(false); - txtCap.setText(u.getCap()); - } - else if(u.getTipo().intValue() == MEDICO) //medico - { - drpNome.setRendered(true); - try - { - getSessionBean1().setMedicosOptions(adp.getMedicosList()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - drpNome.setSelected(u.getMedico_id()); - txtNome.setStyleClass("hide"); - lblCap.setRendered(false); - txtCap.setRendered(false); - lblCedula.setRendered(true); - stCedula.setRendered(true); - stCedula.setText(u.getNumero_cedula()); - - } - drpEstabelecimentos.setSelected(u.getEstabelecimento_id()); - txtLogin.setText(u.getLogin()); - txtPassword.setText(u.getPassword()); - txtEmail.setText(u.getEmail()); - } - - private Utilizador fillUser() - { - Utilizador u = new Utilizador(); - u.setActivo("y"); - u.setAdministrador("n"); - u.setTipo((Integer) drpTipo.getSelected()); - u.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); - u.setEstabelecimento_id( (Integer) drpEstabelecimentos.getSelected() ); - u.setLogin( (String) txtLogin.getText() ); - u.setPassword( (String) txtPassword.getText() ); - u.setEmail(""); - if(txtEmail.getText() != null) - { - u.setEmail( (String) txtEmail.getText() ); - } - - Integer tipo = (Integer) drpTipo.getSelected(); - - u.setNumero_cedula(""); - u.setCap(""); - if(tipo.intValue() == HS || tipo.intValue() == MEDICO) - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - if(tipo.intValue() == HS) - { - try - { - Integer tecnico_id = (Integer) drpNome.getSelected(); - u.setFuncionario_hst_id(tecnico_id); - u.setNome( adp.getTecnicoSaudeNome(tecnico_id) ); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - u.setCap( (String) txtCap.getText()); - } - else // medico - { - try - { - Integer medico_id = (Integer) drpNome.getSelected(); - u.setMedico_id(medico_id); - u.setNome( adp.getMedicoNome(medico_id) ); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - u.setNumero_cedula( (String) stCedula.getText()); - } - } - else - { - u.setNome( (String) txtNome.getText() ); - } - return u; - } - - public String lnkEditUser_action() { - // TODO: Replace with your code - - getSessionBean1().setModoEdicaoUtilizador("edit"); - return "user"; - } - - public String butApagar_action() { - // TODO: Replace with your code - hidConfDelUser.setValue("apagar"); - return null; - } -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Footer.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Footer.java deleted file mode 100644 index 52f9e49d..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Footer.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Footer.java - * - * Created on September 19, 2007, 10:57 AM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractFragmentBean; -import com.sun.rave.web.ui.component.ImageComponent; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.StaticText; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; - -/** - *Fragment bean that corresponds to a similarly named JSP page - * fragment. This class contains component definitions (and initialization - * code) for all components that you have defined on this fragment, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class Footer extends AbstractFragmentBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - //Callback method that is called whenever a page containing - * this page fragment is navigated to, either directly via a URL, - * or indirectly via page navigation. Override this method to acquire - * resources that will be needed for event handlers and lifecycle methods.
- * - *The default implementation does nothing.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - - //Callback method that is called after rendering is completed for
- * this request, if init() was called. Override this
- * method to release resources acquired in the init()
- * resources that will be needed for event handlers and lifecycle methods.
The default implementation does nothing.
- */ - public void destroy() { - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java deleted file mode 100644 index 1c0ec398..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java +++ /dev/null @@ -1,1327 +0,0 @@ -/* - * FormHS.java - * - * Created on October 1, 2007, 1:43 PM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.data.provider.RowKey; -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.DropDown; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.Hyperlink; -import com.sun.rave.web.ui.component.ImageComponent; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.StaticText; -import com.sun.rave.web.ui.component.Table; -import com.sun.rave.web.ui.component.TableColumn; -import com.sun.rave.web.ui.component.TableRowGroup; -import com.sun.rave.web.ui.component.TextField; -import com.sun.rave.web.ui.model.Option; -import db.AnalisesActualDataProvider; -import db.AnalisesConcluidasDataProvider; -import db.AnalisesDataProvider; -import db.AnalisesSeguimentoDataProvider; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.ListIterator; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; -import javax.faces.event.ValueChangeEvent; -import javax.servlet.http.HttpServletRequest; -import utils.Utils; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class FormHS extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase1() { - return gridBase1; - } - - public void setGridBase1(HtmlPanelGrid hpg) { - this.gridBase1 = hpg; - } - - private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout1() { - return gridLayout1; - } - - public void setGridLayout1(HtmlPanelGrid hpg) { - this.gridLayout1 = hpg; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Hyperlink lnkEditUser = new Hyperlink(); - - public Hyperlink getLnkEditUser() { - return lnkEditUser; - } - - public void setLnkEditUser(Hyperlink h) { - this.lnkEditUser = h; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkLogout = new Hyperlink(); - - public Hyperlink getLnkLogout() { - return lnkLogout; - } - - public void setLnkLogout(Hyperlink h) { - this.lnkLogout = h; - } - - private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayoutTop1() { - return gridLayoutTop1; - } - - public void setGridLayoutTop1(HtmlPanelGrid hpg) { - this.gridLayoutTop1 = hpg; - } - - private HtmlPanelGrid gridActual1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridActual1() { - return gridActual1; - } - - public void setGridActual1(HtmlPanelGrid hpg) { - this.gridActual1 = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private StaticText staticText5 = new StaticText(); - - public StaticText getStaticText5() { - return staticText5; - } - - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private Table table1 = new Table(); - - public Table getTable1() { - return table1; - } - - public void setTable1(Table t) { - this.table1 = t; - } - - private TableRowGroup tableRowGroup1 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup1() { - return tableRowGroup1; - } - - public void setTableRowGroup1(TableRowGroup trg) { - this.tableRowGroup1 = trg; - } - - private TableColumn tableColumn1 = new TableColumn(); - - public TableColumn getTableColumn1() { - return tableColumn1; - } - - public void setTableColumn1(TableColumn tc) { - this.tableColumn1 = tc; - } - - private Hyperlink lnkDataAcidente = new Hyperlink(); - - public Hyperlink getLnkDataAcidente() { - return lnkDataAcidente; - } - - public void setLnkDataAcidente(Hyperlink h) { - this.lnkDataAcidente = h; - } - - private TableColumn tableColumn2 = new TableColumn(); - - public TableColumn getTableColumn2() { - return tableColumn2; - } - - public void setTableColumn2(TableColumn tc) { - this.tableColumn2 = tc; - } - - private Hyperlink lnkNr = new Hyperlink(); - - public Hyperlink getLnkNr() { - return lnkNr; - } - - public void setLnkNr(Hyperlink h) { - this.lnkNr = h; - } - - private TableColumn tableColumn3 = new TableColumn(); - - public TableColumn getTableColumn3() { - return tableColumn3; - } - - public void setTableColumn3(TableColumn tc) { - this.tableColumn3 = tc; - } - - private Hyperlink lnkNomeAcidentado = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentado() { - return lnkNomeAcidentado; - } - - public void setLnkNomeAcidentado(Hyperlink h) { - this.lnkNomeAcidentado = h; - } - - private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridSeguimento1() { - return gridSeguimento1; - } - - public void setGridSeguimento1(HtmlPanelGrid hpg) { - this.gridSeguimento1 = hpg; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private StaticText staticText6 = new StaticText(); - - public StaticText getStaticText6() { - return staticText6; - } - - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private Table table2 = new Table(); - - public Table getTable2() { - return table2; - } - - public void setTable2(Table t) { - this.table2 = t; - } - - private TableRowGroup tableRowGroup2 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup2() { - return tableRowGroup2; - } - - public void setTableRowGroup2(TableRowGroup trg) { - this.tableRowGroup2 = trg; - } - - private TableColumn tableColumn4 = new TableColumn(); - - public TableColumn getTableColumn4() { - return tableColumn4; - } - - public void setTableColumn4(TableColumn tc) { - this.tableColumn4 = tc; - } - - private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); - - public Hyperlink getLnkDataAcidenteSeg() { - return lnkDataAcidenteSeg; - } - - public void setLnkDataAcidenteSeg(Hyperlink h) { - this.lnkDataAcidenteSeg = h; - } - - private TableColumn tableColumn5 = new TableColumn(); - - public TableColumn getTableColumn5() { - return tableColumn5; - } - - public void setTableColumn5(TableColumn tc) { - this.tableColumn5 = tc; - } - - private Hyperlink lnkNrSeg = new Hyperlink(); - - public Hyperlink getLnkNrSeg() { - return lnkNrSeg; - } - - public void setLnkNrSeg(Hyperlink h) { - this.lnkNrSeg = h; - } - - private TableColumn tableColumn6 = new TableColumn(); - - public TableColumn getTableColumn6() { - return tableColumn6; - } - - public void setTableColumn6(TableColumn tc) { - this.tableColumn6 = tc; - } - - private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentadoSeg() { - return lnkNomeAcidentadoSeg; - } - - public void setLnkNomeAcidentadoSeg(Hyperlink h) { - this.lnkNomeAcidentadoSeg = h; - } - - private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridConcluidos1() { - return gridConcluidos1; - } - - public void setGridConcluidos1(HtmlPanelGrid hpg) { - this.gridConcluidos1 = hpg; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } - - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private StaticText staticText8 = new StaticText(); - - public StaticText getStaticText8() { - return staticText8; - } - - public void setStaticText8(StaticText st) { - this.staticText8 = st; - } - - private DropDown drpAno = new DropDown(); - - public DropDown getDrpAno() { - return drpAno; - } - - public void setDrpAno(DropDown dd) { - this.drpAno = dd; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText lblMes = new StaticText(); - - public StaticText getLblMes() { - return lblMes; - } - - public void setLblMes(StaticText st) { - this.lblMes = st; - } - - private DropDown drpMes = new DropDown(); - - public DropDown getDrpMes() { - return drpMes; - } - - public void setDrpMes(DropDown dd) { - this.drpMes = dd; - } - - private PanelGroup groupPanel5 = new PanelGroup(); - - public PanelGroup getGroupPanel5() { - return groupPanel5; - } - - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; - } - - private StaticText lblDia = new StaticText(); - - public StaticText getLblDia() { - return lblDia; - } - - public void setLblDia(StaticText st) { - this.lblDia = st; - } - - private DropDown drpDia = new DropDown(); - - public DropDown getDrpDia() { - return drpDia; - } - - public void setDrpDia(DropDown dd) { - this.drpDia = dd; - } - - private PanelGroup groupPanel6 = new PanelGroup(); - - public PanelGroup getGroupPanel6() { - return groupPanel6; - } - - public void setGroupPanel6(PanelGroup pg) { - this.groupPanel6 = pg; - } - - private StaticText staticText9 = new StaticText(); - - public StaticText getStaticText9() { - return staticText9; - } - - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } - - private TextField txtNome = new TextField(); - - public TextField getTxtNome() { - return txtNome; - } - - public void setTxtNome(TextField tf) { - this.txtNome = tf; - } - - private Button butPesquisar = new Button(); - - public Button getButPesquisar() { - return butPesquisar; - } - - public void setButPesquisar(Button b) { - this.butPesquisar = b; - } - - private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel8() { - return gridPanel8; - } - - public void setGridPanel8(HtmlPanelGrid hpg) { - this.gridPanel8 = hpg; - } - - private Table table3 = new Table(); - - public Table getTable3() { - return table3; - } - - public void setTable3(Table t) { - this.table3 = t; - } - - private TableRowGroup tableRowGroup3 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup3() { - return tableRowGroup3; - } - - public void setTableRowGroup3(TableRowGroup trg) { - this.tableRowGroup3 = trg; - } - - private TableColumn tableColumn7 = new TableColumn(); - - public TableColumn getTableColumn7() { - return tableColumn7; - } - - public void setTableColumn7(TableColumn tc) { - this.tableColumn7 = tc; - } - - private Hyperlink lnkDataConcluida = new Hyperlink(); - - public Hyperlink getLnkDataConcluida() { - return lnkDataConcluida; - } - - public void setLnkDataConcluida(Hyperlink h) { - this.lnkDataConcluida = h; - } - - private TableColumn tableColumn8 = new TableColumn(); - - public TableColumn getTableColumn8() { - return tableColumn8; - } - - public void setTableColumn8(TableColumn tc) { - this.tableColumn8 = tc; - } - - private Hyperlink lnkNrConcluida = new Hyperlink(); - - public Hyperlink getLnkNrConcluida() { - return lnkNrConcluida; - } - - public void setLnkNrConcluida(Hyperlink h) { - this.lnkNrConcluida = h; - } - - private TableColumn tableColumn9 = new TableColumn(); - - public TableColumn getTableColumn9() { - return tableColumn9; - } - - public void setTableColumn9(TableColumn tc) { - this.tableColumn9 = tc; - } - - private Hyperlink lnkNomeConcluida = new Hyperlink(); - - public Hyperlink getLnkNomeConcluida() { - return lnkNomeConcluida; - } - - public void setLnkNomeConcluida(Hyperlink h) { - this.lnkNomeConcluida = h; - } - - private StaticText txtSearchMsg = new StaticText(); - - public StaticText getTxtSearchMsg() { - return txtSearchMsg; - } - - public void setTxtSearchMsg(StaticText st) { - this.txtSearchMsg = st; - } - - private TableColumn tableColumn10 = new TableColumn(); - - public TableColumn getTableColumn10() { - return tableColumn10; - } - - public void setTableColumn10(TableColumn tc) { - this.tableColumn10 = tc; - } - - private Hyperlink lnkFase = new Hyperlink(); - - public Hyperlink getLnkFase() { - return lnkFase; - } - - public void setLnkFase(Hyperlink h) { - this.lnkFase = h; - } - - private TableColumn tableColumn11 = new TableColumn(); - - public TableColumn getTableColumn11() { - return tableColumn11; - } - - public void setTableColumn11(TableColumn tc) { - this.tableColumn11 = tc; - } - - private Hyperlink lnkFaseSeg = new Hyperlink(); - - public Hyperlink getLnkFaseSeg() { - return lnkFaseSeg; - } - - public void setLnkFaseSeg(Hyperlink h) { - this.lnkFaseSeg = h; - } - - //Construct a new Page bean instance.
- */ - public FormHS() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - //lblActivos.setRendered(true); - table1.setRendered(true); - - //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(3)); - ArrayList actuaisList = adp.getAnalisesActuaisHsList( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); - getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table1.setRendered(false); - ex.printStackTrace(); - } - - try - { - //lblActivos.setRendered(true); - table2.setRendered(true); - - ArrayList seguimentoList = adp.getAnalisesSeguimentoHsList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table2.setRendered(false); - ex.printStackTrace(); - } - - HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); - String referer = request.getRequestURI(); - String pageFrom = Utils.getPageFrom(referer); - if(!pageFrom.matches("FormHS.jsp")) - { - - try - { - //lblActivos.setRendered(true); - table3.setRendered(true); - - ArrayList concluidasList = adp.getAnalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table3.setRendered(false); - ex.printStackTrace(); - } - fillAnoDropDown(); - } - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; - } - - public String lnkDataAcidente_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormHS"); - return "analise_acidente"; - } - - public String lnkNr_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormHS"); - return "analise_acidente"; - } - - public String lnkNomeAcidentado_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormHS"); - return "analise_acidente"; - } - - private AnaliseAcidente getTableActivosRowData() - { - RowKey rk = tableRowGroup1.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesActualDataProvider provider = (AnalisesActualDataProvider) tableRowGroup1.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public String lnkDataAcidenteSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - public String lnkNrSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - public String lnkNomeAcidentadoSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - private AnaliseAcidente getTableSeguimentoRowData() - { - RowKey rk = tableRowGroup2.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesSeguimentoDataProvider provider = (AnalisesSeguimentoDataProvider) tableRowGroup2.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - private AnaliseAcidente getTableConcluidasRowData() - { - RowKey rk = tableRowGroup3.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public void drpAno_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object ano = event.getNewValue(); - if(ano == null) - { - lblMes.setVisible(false); - drpMes.setVisible(false); - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblMes.setVisible(true); - drpMes.setVisible(true); - fillMesDropDown(); - } - } - - public void drpMes_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object mes = event.getNewValue(); - if(mes == null) - { - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblDia.setVisible(true); - drpDia.setVisible(true); - fillDiaDropDown(); - } - } - - public void drpDia_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - - } - - public String butPesquisar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - Object obAno = null; - Object obMes = null; - Object obDia = null; - try - { - obAno = drpAno.getSelected(); - obMes = drpMes.getSelected(); - obDia = drpDia.getSelected(); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - Integer ano = null; - Integer mes = null; - Integer dia = null; - - if(obAno != null) - { - ano = (Integer) obAno; - } - - if(obMes != null) - { - mes = (Integer) obMes; - } - - if(obDia != null) - { - dia = (Integer) obDia; - } - - String nome = null; - if(txtNome.getText() != null) - { - nome = (String) txtNome.getText(); - } - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - - //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); - ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, nome); - - table3.setRendered(true); - txtSearchMsg.setRendered(false); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - - - } - catch(Exception ex) - { - table3.setRendered(false); - txtSearchMsg.setRendered(true); - txtSearchMsg.setText("Não foram encontrados registos para a sua pesquisa !"); - ex.printStackTrace(); - } - - return null; - } - -// private String getPageFrom(String referer) -// { -// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); -// return pageFrom; -// } - - private void fillAnoDropDown() - { - ArrayList anosList = new ArrayList(); - for(int ano=2007; ano<2051; ano++) - { - anosList.add(new Integer(ano)); - } - com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[anosList.size()+1]; - anoOptions[0] = new Option("", ""); - ListIterator iter = anosList.listIterator(); - int i = 1; - while(iter.hasNext()) - { - Integer ano = (Integer) iter.next(); - - anoOptions[i] = new Option(ano, ano.toString()); - i++; - } - getSessionBean1().setAnoOptions(anoOptions); - Calendar cal = new GregorianCalendar(); - int year = cal.get(Calendar.YEAR); - //drpAno.setSelected( new Integer(year) ); - } - - private void fillMesDropDown() - { - com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[13]; - mesOptions[0] = new Option("", ""); - mesOptions[1] = new Option(new Integer(1), "Janeiro"); - mesOptions[2] = new Option(new Integer(2), "Fevereiro"); - mesOptions[3] = new Option(new Integer(3), "Março"); - mesOptions[4] = new Option(new Integer(4), "Abril"); - mesOptions[5] = new Option(new Integer(5), "Maio"); - mesOptions[6] = new Option(new Integer(6), "Junho"); - mesOptions[7] = new Option(new Integer(7), "Julho"); - mesOptions[8] = new Option(new Integer(8), "Agosto"); - mesOptions[9] = new Option(new Integer(9), "Setembro"); - mesOptions[10] = new Option(new Integer(10), "Outubro"); - mesOptions[11] = new Option(new Integer(11), "Novembro"); - mesOptions[12] = new Option(new Integer(12), "Dezembro"); - getSessionBean1().setMesOptions(mesOptions); - Calendar cal = new GregorianCalendar(); - int month = cal.get(Calendar.MONTH); // 0=Jan, 1=Feb, ... - //drpMes.setSelected( new Integer(month+1) ); - } - - private void fillDiaDropDown() - { -// int ano = ( (Integer)drpAno.getSelected() ).intValue(); -// int mes = ( (Integer)drpMes.getSelected() ).intValue(); -// int dias = 0; -// switch (mes) { -// case 1: dias=31; break; -// case 2: -// GregorianCalendar cal = new GregorianCalendar(); -// if(cal.isLeapYear(ano)) -// { -// dias = 29; -// } -// else -// { -// dias = 28; -// } -// break; -// case 3: dias=31; break; -// case 4: dias=30; break; -// case 5: dias=31; break; -// case 6: dias=30; break; -// case 7: dias=31; break; -// case 8: dias=31; break; -// case 9: dias=30; break; -// case 10: dias=31; break; -// case 11: dias=30; break; -// case 12: dias=31; break; -// default: System.out.println("Invalid month.");break; -// } -// -// ArrayList diasList = new ArrayList(); -// for(int dia=1; diaAutomatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase1() { - return gridBase1; - } - - public void setGridBase1(HtmlPanelGrid hpg) { - this.gridBase1 = hpg; - } - - private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout1() { - return gridLayout1; - } - - public void setGridLayout1(HtmlPanelGrid hpg) { - this.gridLayout1 = hpg; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Hyperlink lnkEditUser = new Hyperlink(); - - public Hyperlink getLnkEditUser() { - return lnkEditUser; - } - - public void setLnkEditUser(Hyperlink h) { - this.lnkEditUser = h; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkLogout = new Hyperlink(); - - public Hyperlink getLnkLogout() { - return lnkLogout; - } - - public void setLnkLogout(Hyperlink h) { - this.lnkLogout = h; - } - - private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayoutTop1() { - return gridLayoutTop1; - } - - public void setGridLayoutTop1(HtmlPanelGrid hpg) { - this.gridLayoutTop1 = hpg; - } - - private HtmlPanelGrid gridActual = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridActual() { - return gridActual; - } - - public void setGridActual(HtmlPanelGrid hpg) { - this.gridActual = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private StaticText staticText5 = new StaticText(); - - public StaticText getStaticText5() { - return staticText5; - } - - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private Table table1 = new Table(); - - public Table getTable1() { - return table1; - } - - public void setTable1(Table t) { - this.table1 = t; - } - - private TableRowGroup tableRowGroup1 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup1() { - return tableRowGroup1; - } - - public void setTableRowGroup1(TableRowGroup trg) { - this.tableRowGroup1 = trg; - } - - private TableColumn tableColumn1 = new TableColumn(); - - public TableColumn getTableColumn1() { - return tableColumn1; - } - - public void setTableColumn1(TableColumn tc) { - this.tableColumn1 = tc; - } - - private Hyperlink lnkDataAcidente = new Hyperlink(); - - public Hyperlink getLnkDataAcidente() { - return lnkDataAcidente; - } - - public void setLnkDataAcidente(Hyperlink h) { - this.lnkDataAcidente = h; - } - - private TableColumn tableColumn2 = new TableColumn(); - - public TableColumn getTableColumn2() { - return tableColumn2; - } - - public void setTableColumn2(TableColumn tc) { - this.tableColumn2 = tc; - } - - private Hyperlink lnkNr = new Hyperlink(); - - public Hyperlink getLnkNr() { - return lnkNr; - } - - public void setLnkNr(Hyperlink h) { - this.lnkNr = h; - } - - private TableColumn tableColumn3 = new TableColumn(); - - public TableColumn getTableColumn3() { - return tableColumn3; - } - - public void setTableColumn3(TableColumn tc) { - this.tableColumn3 = tc; - } - - private Hyperlink lnkNomeAcidentado = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentado() { - return lnkNomeAcidentado; - } - - public void setLnkNomeAcidentado(Hyperlink h) { - this.lnkNomeAcidentado = h; - } - - private HtmlPanelGrid gridSeguimento = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridSeguimento() { - return gridSeguimento; - } - - public void setGridSeguimento(HtmlPanelGrid hpg) { - this.gridSeguimento = hpg; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private StaticText staticText6 = new StaticText(); - - public StaticText getStaticText6() { - return staticText6; - } - - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private Table table2 = new Table(); - - public Table getTable2() { - return table2; - } - - public void setTable2(Table t) { - this.table2 = t; - } - - private TableRowGroup tableRowGroup2 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup2() { - return tableRowGroup2; - } - - public void setTableRowGroup2(TableRowGroup trg) { - this.tableRowGroup2 = trg; - } - - private TableColumn tableColumn4 = new TableColumn(); - - public TableColumn getTableColumn4() { - return tableColumn4; - } - - public void setTableColumn4(TableColumn tc) { - this.tableColumn4 = tc; - } - - private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); - - public Hyperlink getLnkDataAcidenteSeg() { - return lnkDataAcidenteSeg; - } - - public void setLnkDataAcidenteSeg(Hyperlink h) { - this.lnkDataAcidenteSeg = h; - } - - private TableColumn tableColumn5 = new TableColumn(); - - public TableColumn getTableColumn5() { - return tableColumn5; - } - - public void setTableColumn5(TableColumn tc) { - this.tableColumn5 = tc; - } - - private Hyperlink lnkNrSeg = new Hyperlink(); - - public Hyperlink getLnkNrSeg() { - return lnkNrSeg; - } - - public void setLnkNrSeg(Hyperlink h) { - this.lnkNrSeg = h; - } - - private TableColumn tableColumn6 = new TableColumn(); - - public TableColumn getTableColumn6() { - return tableColumn6; - } - - public void setTableColumn6(TableColumn tc) { - this.tableColumn6 = tc; - } - - private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentadoSeg() { - return lnkNomeAcidentadoSeg; - } - - public void setLnkNomeAcidentadoSeg(Hyperlink h) { - this.lnkNomeAcidentadoSeg = h; - } - - private HtmlPanelGrid gridConcluidos = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridConcluidos() { - return gridConcluidos; - } - - public void setGridConcluidos(HtmlPanelGrid hpg) { - this.gridConcluidos = hpg; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } - - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private StaticText staticText8 = new StaticText(); - - public StaticText getStaticText8() { - return staticText8; - } - - public void setStaticText8(StaticText st) { - this.staticText8 = st; - } - - private DropDown drpAno = new DropDown(); - - public DropDown getDrpAno() { - return drpAno; - } - - public void setDrpAno(DropDown dd) { - this.drpAno = dd; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText lblMes = new StaticText(); - - public StaticText getLblMes() { - return lblMes; - } - - public void setLblMes(StaticText st) { - this.lblMes = st; - } - - private DropDown drpMes = new DropDown(); - - public DropDown getDrpMes() { - return drpMes; - } - - public void setDrpMes(DropDown dd) { - this.drpMes = dd; - } - - private PanelGroup groupPanel5 = new PanelGroup(); - - public PanelGroup getGroupPanel5() { - return groupPanel5; - } - - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; - } - - private StaticText lblDia = new StaticText(); - - public StaticText getLblDia() { - return lblDia; - } - - public void setLblDia(StaticText st) { - this.lblDia = st; - } - - private DropDown drpDia = new DropDown(); - - public DropDown getDrpDia() { - return drpDia; - } - - public void setDrpDia(DropDown dd) { - this.drpDia = dd; - } - - private PanelGroup groupPanel6 = new PanelGroup(); - - public PanelGroup getGroupPanel6() { - return groupPanel6; - } - - public void setGroupPanel6(PanelGroup pg) { - this.groupPanel6 = pg; - } - - private StaticText staticText9 = new StaticText(); - - public StaticText getStaticText9() { - return staticText9; - } - - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } - - private TextField txtNome = new TextField(); - - public TextField getTxtNome() { - return txtNome; - } - - public void setTxtNome(TextField tf) { - this.txtNome = tf; - } - - private Button butPesquisar = new Button(); - - public Button getButPesquisar() { - return butPesquisar; - } - - public void setButPesquisar(Button b) { - this.butPesquisar = b; - } - - private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel8() { - return gridPanel8; - } - - public void setGridPanel8(HtmlPanelGrid hpg) { - this.gridPanel8 = hpg; - } - - private Table table3 = new Table(); - - public Table getTable3() { - return table3; - } - - public void setTable3(Table t) { - this.table3 = t; - } - - private TableRowGroup tableRowGroup3 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup3() { - return tableRowGroup3; - } - - public void setTableRowGroup3(TableRowGroup trg) { - this.tableRowGroup3 = trg; - } - - private TableColumn tableColumn7 = new TableColumn(); - - public TableColumn getTableColumn7() { - return tableColumn7; - } - - public void setTableColumn7(TableColumn tc) { - this.tableColumn7 = tc; - } - - private Hyperlink lnkDataConcluida = new Hyperlink(); - - public Hyperlink getLnkDataConcluida() { - return lnkDataConcluida; - } - - public void setLnkDataConcluida(Hyperlink h) { - this.lnkDataConcluida = h; - } - - private TableColumn tableColumn8 = new TableColumn(); - - public TableColumn getTableColumn8() { - return tableColumn8; - } - - public void setTableColumn8(TableColumn tc) { - this.tableColumn8 = tc; - } - - private Hyperlink lnkNrConcluida = new Hyperlink(); - - public Hyperlink getLnkNrConcluida() { - return lnkNrConcluida; - } - - public void setLnkNrConcluida(Hyperlink h) { - this.lnkNrConcluida = h; - } - - private TableColumn tableColumn9 = new TableColumn(); - - public TableColumn getTableColumn9() { - return tableColumn9; - } - - public void setTableColumn9(TableColumn tc) { - this.tableColumn9 = tc; - } - - private Hyperlink lnkNomeConcluida = new Hyperlink(); - - public Hyperlink getLnkNomeConcluida() { - return lnkNomeConcluida; - } - - public void setLnkNomeConcluida(Hyperlink h) { - this.lnkNomeConcluida = h; - } - - private StaticText txtSearchMsg = new StaticText(); - - public StaticText getTxtSearchMsg() { - return txtSearchMsg; - } - - public void setTxtSearchMsg(StaticText st) { - this.txtSearchMsg = st; - } - - private TableColumn tableColumn10 = new TableColumn(); - - public TableColumn getTableColumn10() { - return tableColumn10; - } - - public void setTableColumn10(TableColumn tc) { - this.tableColumn10 = tc; - } - - private Hyperlink lnkFase = new Hyperlink(); - - public Hyperlink getLnkFase() { - return lnkFase; - } - - public void setLnkFase(Hyperlink h) { - this.lnkFase = h; - } - - private TableColumn tableColumn11 = new TableColumn(); - - public TableColumn getTableColumn11() { - return tableColumn11; - } - - public void setTableColumn11(TableColumn tc) { - this.tableColumn11 = tc; - } - - private Hyperlink lnkFaseSeg = new Hyperlink(); - - public Hyperlink getLnkFaseSeg() { - return lnkFaseSeg; - } - - public void setLnkFaseSeg(Hyperlink h) { - this.lnkFaseSeg = h; - } - - //Construct a new Page bean instance.
- */ - public FormMedico() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - //lblActivos.setRendered(true); - table1.setRendered(true); - - //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(5)); - ArrayList actuaisList = adp.getAnalisesActuaisMedicoList( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); - getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table1.setRendered(false); - ex.printStackTrace(); - } - - table2.setRendered(false); - - try - { - //lblActivos.setRendered(true); - table2.setRendered(true); - - ArrayList seguimentoList = adp.getAnalisesSeguimentoMedList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table2.setRendered(false); - ex.printStackTrace(); - } - - HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); - String referer = request.getRequestURI(); - String pageFrom = Utils.getPageFrom(referer); - if(!pageFrom.matches("FormMedico.jsp")) - { - - try - { - //lblActivos.setRendered(true); - table3.setRendered(true); - - ArrayList concluidasList = adp.getAnalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table3.setRendered(false); - ex.printStackTrace(); - } - fillAnoDropDown(); - } - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String lnkEditUser_action() { - // TODO: Replace with your code - - getSessionBean1().setNavFrom("FormMedico"); - getSessionBean1().setModoEdicaoUtilizador("edit"); - return "user"; - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; - } - - public String lnkDataAcidente_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "analise_acidente"; - } - - public String lnkNr_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "analise_acidente"; - } - - public String lnkNomeAcidentado_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "analise_acidente"; - } - - private AnaliseAcidente getTableActivosRowData() - { - RowKey rk = tableRowGroup1.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesActualDataProvider provider = (AnalisesActualDataProvider) tableRowGroup1.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - private AnaliseAcidente getTableConcluidasRowData() - { - RowKey rk = tableRowGroup3.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public String lnkDataAcidenteSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "view_analise"; - } - - public String lnkNrSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "view_analise"; - } - - public String lnkNomeAcidentadoSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "view_analise"; - } - - private AnaliseAcidente getTableSeguimentoRowData() - { - RowKey rk = tableRowGroup2.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesSeguimentoDataProvider provider = (AnalisesSeguimentoDataProvider) tableRowGroup2.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public void drpAno_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object ano = event.getNewValue(); - if(ano == null) - { - lblMes.setVisible(false); - drpMes.setVisible(false); - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblMes.setVisible(true); - drpMes.setVisible(true); - fillMesDropDown(); - } - } - - public void drpMes_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object mes = event.getNewValue(); - if(mes == null) - { - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblDia.setVisible(true); - drpDia.setVisible(true); - fillDiaDropDown(); - } - } - - public void drpDia_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - - } - - public String butPesquisar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - Object obAno = null; - Object obMes = null; - Object obDia = null; - try - { - obAno = drpAno.getSelected(); - obMes = drpMes.getSelected(); - obDia = drpDia.getSelected(); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - Integer ano = null; - Integer mes = null; - Integer dia = null; - - if(obAno != null) - { - ano = (Integer) obAno; - } - - if(obMes != null) - { - mes = (Integer) obMes; - } - - if(obDia != null) - { - dia = (Integer) obDia; - } - - String nome = null; - if(txtNome.getText() != null) - { - nome = (String) txtNome.getText(); - } - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - - //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); - ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, nome); - - table3.setRendered(true); - txtSearchMsg.setRendered(false); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - - - } - catch(Exception ex) - { - table3.setRendered(false); - txtSearchMsg.setRendered(true); - txtSearchMsg.setText("Não foram encontrados registos para a sua pesquisa !"); - ex.printStackTrace(); - } - return null; - } - - private void fillAnoDropDown() - { - ArrayList anosList = new ArrayList(); - for(int ano=2007; ano<2051; ano++) - { - anosList.add(new Integer(ano)); - } - com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[anosList.size()+1]; - anoOptions[0] = new Option("", ""); - ListIterator iter = anosList.listIterator(); - int i = 1; - while(iter.hasNext()) - { - Integer ano = (Integer) iter.next(); - - anoOptions[i] = new Option(ano, ano.toString()); - i++; - } - getSessionBean1().setAnoOptions(anoOptions); - Calendar cal = new GregorianCalendar(); - int year = cal.get(Calendar.YEAR); - //drpAno.setSelected( new Integer(year) ); - } - - private void fillMesDropDown() - { - com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[13]; - mesOptions[0] = new Option("", ""); - mesOptions[1] = new Option(new Integer(1), "Janeiro"); - mesOptions[2] = new Option(new Integer(2), "Fevereiro"); - mesOptions[3] = new Option(new Integer(3), "Março"); - mesOptions[4] = new Option(new Integer(4), "Abril"); - mesOptions[5] = new Option(new Integer(5), "Maio"); - mesOptions[6] = new Option(new Integer(6), "Junho"); - mesOptions[7] = new Option(new Integer(7), "Julho"); - mesOptions[8] = new Option(new Integer(8), "Agosto"); - mesOptions[9] = new Option(new Integer(9), "Setembro"); - mesOptions[10] = new Option(new Integer(10), "Outubro"); - mesOptions[11] = new Option(new Integer(11), "Novembro"); - mesOptions[12] = new Option(new Integer(12), "Dezembro"); - getSessionBean1().setMesOptions(mesOptions); - Calendar cal = new GregorianCalendar(); - int month = cal.get(Calendar.MONTH); // 0=Jan, 1=Feb, ... - //drpMes.setSelected( new Integer(month+1) ); - } - - private void fillDiaDropDown() - { - - } - - public String lnkDataConcluida_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableConcluidasRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "view_analise"; - } - - public String lnkNrConcluida_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableConcluidasRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "view_analise"; - } - - public String lnkNomeConcluida_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableConcluidasRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "view_analise"; - } - - public String lnkFase_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "analise_acidente"; - } - - public String lnkFaseSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormMedico"); - return "view_analise"; - } - -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java deleted file mode 100644 index 470eabf9..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java +++ /dev/null @@ -1,1335 +0,0 @@ -/* - * FormRH.java - * - * Created on October 1, 2007, 11:43 AM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.data.provider.RowKey; -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.DropDown; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.Hyperlink; -import com.sun.rave.web.ui.component.ImageComponent; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.StaticText; -import com.sun.rave.web.ui.component.Table; -import com.sun.rave.web.ui.component.TableColumn; -import com.sun.rave.web.ui.component.TableRowGroup; -import com.sun.rave.web.ui.component.TextField; -import com.sun.rave.web.ui.model.Option; -import db.AnalisesActualDataProvider; -import db.AnalisesConcluidasDataProvider; -import db.AnalisesDataProvider; -import db.AnalisesSeguimentoDataProvider; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.ListIterator; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; -import javax.faces.event.ValueChangeEvent; -import javax.servlet.http.HttpServletRequest; -import utils.Utils; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class FormRH extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase1() { - return gridBase1; - } - - public void setGridBase1(HtmlPanelGrid hpg) { - this.gridBase1 = hpg; - } - - private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout1() { - return gridLayout1; - } - - public void setGridLayout1(HtmlPanelGrid hpg) { - this.gridLayout1 = hpg; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Hyperlink lnkEditUser = new Hyperlink(); - - public Hyperlink getLnkEditUser() { - return lnkEditUser; - } - - public void setLnkEditUser(Hyperlink h) { - this.lnkEditUser = h; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkLogout = new Hyperlink(); - - public Hyperlink getLnkLogout() { - return lnkLogout; - } - - public void setLnkLogout(Hyperlink h) { - this.lnkLogout = h; - } - - private HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayoutTop1() { - return gridLayoutTop1; - } - - public void setGridLayoutTop1(HtmlPanelGrid hpg) { - this.gridLayoutTop1 = hpg; - } - - private HtmlPanelGrid gridActual1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridActual1() { - return gridActual1; - } - - public void setGridActual1(HtmlPanelGrid hpg) { - this.gridActual1 = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private StaticText staticText5 = new StaticText(); - - public StaticText getStaticText5() { - return staticText5; - } - - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private Table table1 = new Table(); - - public Table getTable1() { - return table1; - } - - public void setTable1(Table t) { - this.table1 = t; - } - - private TableRowGroup tableRowGroup1 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup1() { - return tableRowGroup1; - } - - public void setTableRowGroup1(TableRowGroup trg) { - this.tableRowGroup1 = trg; - } - - private TableColumn tableColumn1 = new TableColumn(); - - public TableColumn getTableColumn1() { - return tableColumn1; - } - - public void setTableColumn1(TableColumn tc) { - this.tableColumn1 = tc; - } - - private Hyperlink lnkDataAcidente = new Hyperlink(); - - public Hyperlink getLnkDataAcidente() { - return lnkDataAcidente; - } - - public void setLnkDataAcidente(Hyperlink h) { - this.lnkDataAcidente = h; - } - - private TableColumn tableColumn2 = new TableColumn(); - - public TableColumn getTableColumn2() { - return tableColumn2; - } - - public void setTableColumn2(TableColumn tc) { - this.tableColumn2 = tc; - } - - private Hyperlink lnkNr = new Hyperlink(); - - public Hyperlink getLnkNr() { - return lnkNr; - } - - public void setLnkNr(Hyperlink h) { - this.lnkNr = h; - } - - private TableColumn tableColumn3 = new TableColumn(); - - public TableColumn getTableColumn3() { - return tableColumn3; - } - - public void setTableColumn3(TableColumn tc) { - this.tableColumn3 = tc; - } - - private Hyperlink lnkNomeAcidentado = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentado() { - return lnkNomeAcidentado; - } - - public void setLnkNomeAcidentado(Hyperlink h) { - this.lnkNomeAcidentado = h; - } - - private HtmlPanelGrid gridSeguimento1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridSeguimento1() { - return gridSeguimento1; - } - - public void setGridSeguimento1(HtmlPanelGrid hpg) { - this.gridSeguimento1 = hpg; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private StaticText staticText6 = new StaticText(); - - public StaticText getStaticText6() { - return staticText6; - } - - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private Table table2 = new Table(); - - public Table getTable2() { - return table2; - } - - public void setTable2(Table t) { - this.table2 = t; - } - - private TableRowGroup tableRowGroup2 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup2() { - return tableRowGroup2; - } - - public void setTableRowGroup2(TableRowGroup trg) { - this.tableRowGroup2 = trg; - } - - private TableColumn tableColumn4 = new TableColumn(); - - public TableColumn getTableColumn4() { - return tableColumn4; - } - - public void setTableColumn4(TableColumn tc) { - this.tableColumn4 = tc; - } - - private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); - - public Hyperlink getLnkDataAcidenteSeg() { - return lnkDataAcidenteSeg; - } - - public void setLnkDataAcidenteSeg(Hyperlink h) { - this.lnkDataAcidenteSeg = h; - } - - private TableColumn tableColumn5 = new TableColumn(); - - public TableColumn getTableColumn5() { - return tableColumn5; - } - - public void setTableColumn5(TableColumn tc) { - this.tableColumn5 = tc; - } - - private Hyperlink lnkNrSeg = new Hyperlink(); - - public Hyperlink getLnkNrSeg() { - return lnkNrSeg; - } - - public void setLnkNrSeg(Hyperlink h) { - this.lnkNrSeg = h; - } - - private TableColumn tableColumn6 = new TableColumn(); - - public TableColumn getTableColumn6() { - return tableColumn6; - } - - public void setTableColumn6(TableColumn tc) { - this.tableColumn6 = tc; - } - - private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentadoSeg() { - return lnkNomeAcidentadoSeg; - } - - public void setLnkNomeAcidentadoSeg(Hyperlink h) { - this.lnkNomeAcidentadoSeg = h; - } - - private HtmlPanelGrid gridConcluidos1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridConcluidos1() { - return gridConcluidos1; - } - - public void setGridConcluidos1(HtmlPanelGrid hpg) { - this.gridConcluidos1 = hpg; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } - - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private StaticText staticText8 = new StaticText(); - - public StaticText getStaticText8() { - return staticText8; - } - - public void setStaticText8(StaticText st) { - this.staticText8 = st; - } - - private DropDown drpAno = new DropDown(); - - public DropDown getDrpAno() { - return drpAno; - } - - public void setDrpAno(DropDown dd) { - this.drpAno = dd; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText lblMes = new StaticText(); - - public StaticText getLblMes() { - return lblMes; - } - - public void setLblMes(StaticText st) { - this.lblMes = st; - } - - private DropDown drpMes = new DropDown(); - - public DropDown getDrpMes() { - return drpMes; - } - - public void setDrpMes(DropDown dd) { - this.drpMes = dd; - } - - private PanelGroup groupPanel5 = new PanelGroup(); - - public PanelGroup getGroupPanel5() { - return groupPanel5; - } - - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; - } - - private StaticText lblDia = new StaticText(); - - public StaticText getLblDia() { - return lblDia; - } - - public void setLblDia(StaticText st) { - this.lblDia = st; - } - - private DropDown drpDia = new DropDown(); - - public DropDown getDrpDia() { - return drpDia; - } - - public void setDrpDia(DropDown dd) { - this.drpDia = dd; - } - - private PanelGroup groupPanel6 = new PanelGroup(); - - public PanelGroup getGroupPanel6() { - return groupPanel6; - } - - public void setGroupPanel6(PanelGroup pg) { - this.groupPanel6 = pg; - } - - private StaticText staticText9 = new StaticText(); - - public StaticText getStaticText9() { - return staticText9; - } - - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } - - private TextField txtNome = new TextField(); - - public TextField getTxtNome() { - return txtNome; - } - - public void setTxtNome(TextField tf) { - this.txtNome = tf; - } - - private Button butPesquisar = new Button(); - - public Button getButPesquisar() { - return butPesquisar; - } - - public void setButPesquisar(Button b) { - this.butPesquisar = b; - } - - private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel8() { - return gridPanel8; - } - - public void setGridPanel8(HtmlPanelGrid hpg) { - this.gridPanel8 = hpg; - } - - private Table table3 = new Table(); - - public Table getTable3() { - return table3; - } - - public void setTable3(Table t) { - this.table3 = t; - } - - private TableRowGroup tableRowGroup3 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup3() { - return tableRowGroup3; - } - - public void setTableRowGroup3(TableRowGroup trg) { - this.tableRowGroup3 = trg; - } - - private TableColumn tableColumn7 = new TableColumn(); - - public TableColumn getTableColumn7() { - return tableColumn7; - } - - public void setTableColumn7(TableColumn tc) { - this.tableColumn7 = tc; - } - - private Hyperlink lnkDataConcluida = new Hyperlink(); - - public Hyperlink getLnkDataConcluida() { - return lnkDataConcluida; - } - - public void setLnkDataConcluida(Hyperlink h) { - this.lnkDataConcluida = h; - } - - private TableColumn tableColumn8 = new TableColumn(); - - public TableColumn getTableColumn8() { - return tableColumn8; - } - - public void setTableColumn8(TableColumn tc) { - this.tableColumn8 = tc; - } - - private Hyperlink lnkNrConcluida = new Hyperlink(); - - public Hyperlink getLnkNrConcluida() { - return lnkNrConcluida; - } - - public void setLnkNrConcluida(Hyperlink h) { - this.lnkNrConcluida = h; - } - - private TableColumn tableColumn9 = new TableColumn(); - - public TableColumn getTableColumn9() { - return tableColumn9; - } - - public void setTableColumn9(TableColumn tc) { - this.tableColumn9 = tc; - } - - private Hyperlink lnkNomeConcluida = new Hyperlink(); - - public Hyperlink getLnkNomeConcluida() { - return lnkNomeConcluida; - } - - public void setLnkNomeConcluida(Hyperlink h) { - this.lnkNomeConcluida = h; - } - - private StaticText txtSearchMsg = new StaticText(); - - public StaticText getTxtSearchMsg() { - return txtSearchMsg; - } - - public void setTxtSearchMsg(StaticText st) { - this.txtSearchMsg = st; - } - - private TableColumn tableColumn10 = new TableColumn(); - - public TableColumn getTableColumn10() { - return tableColumn10; - } - - public void setTableColumn10(TableColumn tc) { - this.tableColumn10 = tc; - } - - private Hyperlink lnkFase = new Hyperlink(); - - public Hyperlink getLnkFase() { - return lnkFase; - } - - public void setLnkFase(Hyperlink h) { - this.lnkFase = h; - } - - private TableColumn tableColumn11 = new TableColumn(); - - public TableColumn getTableColumn11() { - return tableColumn11; - } - - public void setTableColumn11(TableColumn tc) { - this.tableColumn11 = tc; - } - - private Hyperlink lnkFaseSeg = new Hyperlink(); - - public Hyperlink getLnkFaseSeg() { - return lnkFaseSeg; - } - - public void setLnkFaseSeg(Hyperlink h) { - this.lnkFaseSeg = h; - } - - //Construct a new Page bean instance.
- */ - public FormRH() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - //lblActivos.setRendered(true); - table1.setRendered(true); - - //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - ArrayList actuaisList = adp.getAnalisesActuaisRhList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table1.setRendered(false); - ex.printStackTrace(); - } - - try - { - //lblActivos.setRendered(true); - table2.setRendered(true); - - ArrayList seguimentoList = adp.getAnalisesSeguimentoRhList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table2.setRendered(false); - ex.printStackTrace(); - } - - HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); - String referer = request.getRequestURI(); - String pageFrom = Utils.getPageFrom(referer); - if(!pageFrom.matches("FormRH.jsp")) - { - - try - { - //lblActivos.setRendered(true); - table3.setRendered(true); - - ArrayList concluidasList = adp.getAnalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table3.setRendered(false); - ex.printStackTrace(); - } - fillAnoDropDown(); - } - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; - } - - public String butNovaAnalise_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - return null; - } - - public String lnkDataAcidente_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormRH"); - return "analise_acidente"; - } - - public String lnkNr_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormRH"); - return "analise_acidente"; - } - - public String lnkNomeAcidentado_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormRH"); - return "analise_acidente"; - } - - private AnaliseAcidente getTableActivosRowData() - { - RowKey rk = tableRowGroup1.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesActualDataProvider provider = (AnalisesActualDataProvider) tableRowGroup1.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public String lnkDataAcidenteSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - public String lnkNrSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - - public String lnkNomeAcidentadoSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - private AnaliseAcidente getTableSeguimentoRowData() - { - RowKey rk = tableRowGroup2.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesSeguimentoDataProvider provider = (AnalisesSeguimentoDataProvider) tableRowGroup2.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - private AnaliseAcidente getTableConcluidasRowData() - { - RowKey rk = tableRowGroup3.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public void drpAno_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object ano = event.getNewValue(); - if(ano == null) - { - lblMes.setVisible(false); - drpMes.setVisible(false); - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblMes.setVisible(true); - drpMes.setVisible(true); - fillMesDropDown(); - } - } - - public void drpMes_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object mes = event.getNewValue(); - if(mes == null) - { - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblDia.setVisible(true); - drpDia.setVisible(true); - fillDiaDropDown(); - } - } - - public void drpDia_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - - } - - public String butPesquisar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - Object obAno = null; - Object obMes = null; - Object obDia = null; - try - { - obAno = drpAno.getSelected(); - obMes = drpMes.getSelected(); - obDia = drpDia.getSelected(); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - Integer ano = null; - Integer mes = null; - Integer dia = null; - - if(obAno != null) - { - ano = (Integer) obAno; - } - - if(obMes != null) - { - mes = (Integer) obMes; - } - - if(obDia != null) - { - dia = (Integer) obDia; - } - - String nome = null; - if(txtNome.getText() != null) - { - nome = (String) txtNome.getText(); - } - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - - //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); - ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, nome); - - table3.setRendered(true); - txtSearchMsg.setRendered(false); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - - - } - catch(Exception ex) - { - table3.setRendered(false); - txtSearchMsg.setRendered(true); - txtSearchMsg.setText("Não foram encontrados registos para a sua pesquisa !"); - ex.printStackTrace(); - } - - return null; - } - -// private String getPageFrom(String referer) -// { -// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); -// return pageFrom; -// } - - private void fillAnoDropDown() - { - ArrayList anosList = new ArrayList(); - for(int ano=2007; ano<2051; ano++) - { - anosList.add(new Integer(ano)); - } - com.sun.rave.web.ui.model.Option[] anoOptions = new com.sun.rave.web.ui.model.Option[anosList.size()+1]; - anoOptions[0] = new Option("", ""); - ListIterator iter = anosList.listIterator(); - int i = 1; - while(iter.hasNext()) - { - Integer ano = (Integer) iter.next(); - - anoOptions[i] = new Option(ano, ano.toString()); - i++; - } - getSessionBean1().setAnoOptions(anoOptions); - Calendar cal = new GregorianCalendar(); - int year = cal.get(Calendar.YEAR); - //drpAno.setSelected( new Integer(year) ); - } - - private void fillMesDropDown() - { - com.sun.rave.web.ui.model.Option[] mesOptions = new com.sun.rave.web.ui.model.Option[13]; - mesOptions[0] = new Option("", ""); - mesOptions[1] = new Option(new Integer(1), "Janeiro"); - mesOptions[2] = new Option(new Integer(2), "Fevereiro"); - mesOptions[3] = new Option(new Integer(3), "Março"); - mesOptions[4] = new Option(new Integer(4), "Abril"); - mesOptions[5] = new Option(new Integer(5), "Maio"); - mesOptions[6] = new Option(new Integer(6), "Junho"); - mesOptions[7] = new Option(new Integer(7), "Julho"); - mesOptions[8] = new Option(new Integer(8), "Agosto"); - mesOptions[9] = new Option(new Integer(9), "Setembro"); - mesOptions[10] = new Option(new Integer(10), "Outubro"); - mesOptions[11] = new Option(new Integer(11), "Novembro"); - mesOptions[12] = new Option(new Integer(12), "Dezembro"); - getSessionBean1().setMesOptions(mesOptions); - Calendar cal = new GregorianCalendar(); - int month = cal.get(Calendar.MONTH); // 0=Jan, 1=Feb, ... - //drpMes.setSelected( new Integer(month+1) ); - } - - private void fillDiaDropDown() - { -// int ano = ( (Integer)drpAno.getSelected() ).intValue(); -// int mes = ( (Integer)drpMes.getSelected() ).intValue(); -// int dias = 0; -// switch (mes) { -// case 1: dias=31; break; -// case 2: -// GregorianCalendar cal = new GregorianCalendar(); -// if(cal.isLeapYear(ano)) -// { -// dias = 29; -// } -// else -// { -// dias = 28; -// } -// break; -// case 3: dias=31; break; -// case 4: dias=30; break; -// case 5: dias=31; break; -// case 6: dias=30; break; -// case 7: dias=31; break; -// case 8: dias=31; break; -// case 9: dias=30; break; -// case 10: dias=31; break; -// case 11: dias=30; break; -// case 12: dias=31; break; -// default: System.out.println("Invalid month.");break; -// } -// -// ArrayList diasList = new ArrayList(); -// for(int dia=1; diaAutomatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase() { - return gridBase; - } - - public void setGridBase(HtmlPanelGrid hpg) { - this.gridBase = hpg; - } - - private HtmlPanelGrid gridLayout = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout() { - return gridLayout; - } - - public void setGridLayout(HtmlPanelGrid hpg) { - this.gridLayout = hpg; - } - - private HtmlPanelGrid gridLayoutTop = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayoutTop() { - return gridLayoutTop; - } - - public void setGridLayoutTop(HtmlPanelGrid hpg) { - this.gridLayoutTop = hpg; - } - - private HtmlPanelGrid gridActual = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridActual() { - return gridActual; - } - - public void setGridActual(HtmlPanelGrid hpg) { - this.gridActual = hpg; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private HtmlPanelGrid gridSeguimento = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridSeguimento() { - return gridSeguimento; - } - - public void setGridSeguimento(HtmlPanelGrid hpg) { - this.gridSeguimento = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private HtmlPanelGrid gridConcluidos = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridConcluidos() { - return gridConcluidos; - } - - public void setGridConcluidos(HtmlPanelGrid hpg) { - this.gridConcluidos = hpg; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - - private Link link2 = new Link(); - - public Link getLink2() { - return link2; - } - - public void setLink2(Link l) { - this.link2 = l; - } - - private Button butNovaAnalise = new Button(); - - public Button getButNovaAnalise() { - return butNovaAnalise; - } - - public void setButNovaAnalise(Button b) { - this.butNovaAnalise = b; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private Table table1 = new Table(); - - public Table getTable1() { - return table1; - } - - public void setTable1(Table t) { - this.table1 = t; - } - - private TableRowGroup tableRowGroup1 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup1() { - return tableRowGroup1; - } - - public void setTableRowGroup1(TableRowGroup trg) { - this.tableRowGroup1 = trg; - } - - private TableColumn tableColumn1 = new TableColumn(); - - public TableColumn getTableColumn1() { - return tableColumn1; - } - - public void setTableColumn1(TableColumn tc) { - this.tableColumn1 = tc; - } - - private TableColumn tableColumn2 = new TableColumn(); - - public TableColumn getTableColumn2() { - return tableColumn2; - } - - public void setTableColumn2(TableColumn tc) { - this.tableColumn2 = tc; - } - - private TableColumn tableColumn3 = new TableColumn(); - - public TableColumn getTableColumn3() { - return tableColumn3; - } - - public void setTableColumn3(TableColumn tc) { - this.tableColumn3 = tc; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private Table table2 = new Table(); - - public Table getTable2() { - return table2; - } - - public void setTable2(Table t) { - this.table2 = t; - } - - private TableRowGroup tableRowGroup2 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup2() { - return tableRowGroup2; - } - - public void setTableRowGroup2(TableRowGroup trg) { - this.tableRowGroup2 = trg; - } - - private TableColumn tableColumn4 = new TableColumn(); - - public TableColumn getTableColumn4() { - return tableColumn4; - } - - public void setTableColumn4(TableColumn tc) { - this.tableColumn4 = tc; - } - - private TableColumn tableColumn5 = new TableColumn(); - - public TableColumn getTableColumn5() { - return tableColumn5; - } - - public void setTableColumn5(TableColumn tc) { - this.tableColumn5 = tc; - } - - private TableColumn tableColumn6 = new TableColumn(); - - public TableColumn getTableColumn6() { - return tableColumn6; - } - - public void setTableColumn6(TableColumn tc) { - this.tableColumn6 = tc; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private StaticText staticText11 = new StaticText(); - - public StaticText getStaticText11() { - return staticText11; - } - - public void setStaticText11(StaticText st) { - this.staticText11 = st; - } - - private DropDown drpAno = new DropDown(); - - public DropDown getDrpAno() { - return drpAno; - } - - public void setDrpAno(DropDown dd) { - this.drpAno = dd; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblMes = new StaticText(); - - public StaticText getLblMes() { - return lblMes; - } - - public void setLblMes(StaticText st) { - this.lblMes = st; - } - - private DropDown drpMes = new DropDown(); - - public DropDown getDrpMes() { - return drpMes; - } - - public void setDrpMes(DropDown dd) { - this.drpMes = dd; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private StaticText lblDia = new StaticText(); - - public StaticText getLblDia() { - return lblDia; - } - - public void setLblDia(StaticText st) { - this.lblDia = st; - } - - private DropDown drpDia = new DropDown(); - - public DropDown getDrpDia() { - return drpDia; - } - - public void setDrpDia(DropDown dd) { - this.drpDia = dd; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText staticText14 = new StaticText(); - - public StaticText getStaticText14() { - return staticText14; - } - - public void setStaticText14(StaticText st) { - this.staticText14 = st; - } - - private TextField txtNome = new TextField(); - - public TextField getTxtNome() { - return txtNome; - } - - public void setTxtNome(TextField tf) { - this.txtNome = tf; - } - - private Button butPesquisar = new Button(); - - public Button getButPesquisar() { - return butPesquisar; - } - - public void setButPesquisar(Button b) { - this.butPesquisar = b; - } - - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } - - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } - - private Table table3 = new Table(); - - public Table getTable3() { - return table3; - } - - public void setTable3(Table t) { - this.table3 = t; - } - - private TableRowGroup tableRowGroup3 = new TableRowGroup(); - - public TableRowGroup getTableRowGroup3() { - return tableRowGroup3; - } - - public void setTableRowGroup3(TableRowGroup trg) { - this.tableRowGroup3 = trg; - } - - private TableColumn tableColumn7 = new TableColumn(); - - public TableColumn getTableColumn7() { - return tableColumn7; - } - - public void setTableColumn7(TableColumn tc) { - this.tableColumn7 = tc; - } - - private TableColumn tableColumn8 = new TableColumn(); - - public TableColumn getTableColumn8() { - return tableColumn8; - } - - public void setTableColumn8(TableColumn tc) { - this.tableColumn8 = tc; - } - - private TableColumn tableColumn9 = new TableColumn(); - - public TableColumn getTableColumn9() { - return tableColumn9; - } - - public void setTableColumn9(TableColumn tc) { - this.tableColumn9 = tc; - } - - private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel8() { - return gridPanel8; - } - - public void setGridPanel8(HtmlPanelGrid hpg) { - this.gridPanel8 = hpg; - } - - private PanelGroup groupPanel5 = new PanelGroup(); - - public PanelGroup getGroupPanel5() { - return groupPanel5; - } - - public void setGroupPanel5(PanelGroup pg) { - this.groupPanel5 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel6 = new PanelGroup(); - - public PanelGroup getGroupPanel6() { - return groupPanel6; - } - - public void setGroupPanel6(PanelGroup pg) { - this.groupPanel6 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText18 = new StaticText(); - - public StaticText getStaticText18() { - return staticText18; - } - - public void setStaticText18(StaticText st) { - this.staticText18 = st; - } - - private Hyperlink lnkEditUser = new Hyperlink(); - - public Hyperlink getLnkEditUser() { - return lnkEditUser; - } - - public void setLnkEditUser(Hyperlink h) { - this.lnkEditUser = h; - } - - private StaticText staticText19 = new StaticText(); - - public StaticText getStaticText19() { - return staticText19; - } - - public void setStaticText19(StaticText st) { - this.staticText19 = st; - } - - private Hyperlink lnkLogout = new Hyperlink(); - - public Hyperlink getLnkLogout() { - return lnkLogout; - } - - public void setLnkLogout(Hyperlink h) { - this.lnkLogout = h; - } - - private Hyperlink lnkDataAcidente = new Hyperlink(); - - public Hyperlink getLnkDataAcidente() { - return lnkDataAcidente; - } - - public void setLnkDataAcidente(Hyperlink h) { - this.lnkDataAcidente = h; - } - - private Hyperlink lnkNr = new Hyperlink(); - - public Hyperlink getLnkNr() { - return lnkNr; - } - - public void setLnkNr(Hyperlink h) { - this.lnkNr = h; - } - - private Hyperlink lnkNomeAcidentado = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentado() { - return lnkNomeAcidentado; - } - - public void setLnkNomeAcidentado(Hyperlink h) { - this.lnkNomeAcidentado = h; - } - - private Hyperlink lnkDataAcidenteSeg = new Hyperlink(); - - public Hyperlink getLnkDataAcidenteSeg() { - return lnkDataAcidenteSeg; - } - - public void setLnkDataAcidenteSeg(Hyperlink h) { - this.lnkDataAcidenteSeg = h; - } - - private Hyperlink lnkNrSeg = new Hyperlink(); - - public Hyperlink getLnkNrSeg() { - return lnkNrSeg; - } - - public void setLnkNrSeg(Hyperlink h) { - this.lnkNrSeg = h; - } - - private Hyperlink lnkNomeAcidentadoSeg = new Hyperlink(); - - public Hyperlink getLnkNomeAcidentadoSeg() { - return lnkNomeAcidentadoSeg; - } - - public void setLnkNomeAcidentadoSeg(Hyperlink h) { - this.lnkNomeAcidentadoSeg = h; - } - - private Hyperlink lnkDataConcluida = new Hyperlink(); - - public Hyperlink getLnkDataConcluida() { - return lnkDataConcluida; - } - - public void setLnkDataConcluida(Hyperlink h) { - this.lnkDataConcluida = h; - } - - private Hyperlink lnkNrConcluida = new Hyperlink(); - - public Hyperlink getLnkNrConcluida() { - return lnkNrConcluida; - } - - public void setLnkNrConcluida(Hyperlink h) { - this.lnkNrConcluida = h; - } - - private Hyperlink lnkNomeConcluida = new Hyperlink(); - - public Hyperlink getLnkNomeConcluida() { - return lnkNomeConcluida; - } - - public void setLnkNomeConcluida(Hyperlink h) { - this.lnkNomeConcluida = h; - } - - private StaticText txtSearchMsg = new StaticText(); - - public StaticText getTxtSearchMsg() { - return txtSearchMsg; - } - - public void setTxtSearchMsg(StaticText st) { - this.txtSearchMsg = st; - } - - private TableColumn tableColumn10 = new TableColumn(); - - public TableColumn getTableColumn10() { - return tableColumn10; - } - - public void setTableColumn10(TableColumn tc) { - this.tableColumn10 = tc; - } - - private TableColumn tableColumn11 = new TableColumn(); - - public TableColumn getTableColumn11() { - return tableColumn11; - } - - public void setTableColumn11(TableColumn tc) { - this.tableColumn11 = tc; - } - - private Hyperlink lnkFase = new Hyperlink(); - - public Hyperlink getLnkFase() { - return lnkFase; - } - - public void setLnkFase(Hyperlink h) { - this.lnkFase = h; - } - - private Hyperlink lnkFaseSeg = new Hyperlink(); - - public Hyperlink getLnkFaseSeg() { - return lnkFaseSeg; - } - - public void setLnkFaseSeg(Hyperlink h) { - this.lnkFaseSeg = h; - } - - //Construct a new Page bean instance.
- */ - public FormSeguranca() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - //lblActivos.setRendered(true); - table1.setRendered(true); - - //ArrayList actuaisList = adp.getAnalisesActuaisList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), new Integer(1)); - ArrayList actuaisList = adp.getAnalisesActuaisSegList( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); - getSessionBean1().getAnalisesActualDataProvider().setList(actuaisList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table1.setRendered(false); - ex.printStackTrace(); - } - - try - { - //lblActivos.setRendered(true); - table2.setRendered(true); - - ArrayList seguimentoList = adp.getAnalisesSeguimentoSegList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table2.setRendered(false); - ex.printStackTrace(); - } - - HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); - String referer = request.getRequestURI(); - String pageFrom = Utils.getPageFrom(referer); - if(!pageFrom.matches("FormSeguranca.jsp")) - { - - try - { - //lblActivos.setRendered(true); - table3.setRendered(true); - - ArrayList concluidasList = adp.getAnalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id()); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - } - catch(Exception ex) - { - //lblActivos.setRendered(false); - table3.setRendered(false); - ex.printStackTrace(); - } - fillAnoDropDown(); - } - - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String lnkLogout_action() { - // TODO: Replace with your code - // Invalidate the current session - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; - } - - public void drpAno_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object ano = event.getNewValue(); - if(ano == null) - { - lblMes.setVisible(false); - drpMes.setVisible(false); - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblMes.setVisible(true); - drpMes.setVisible(true); - fillMesDropDown(); - } - } - - public void drpMes_processValueChange(ValueChangeEvent event) { - // TODO: Replace with your code - Object mes = event.getNewValue(); - if(mes == null) - { - lblDia.setVisible(false); - drpDia.setVisible(false); - } - else - { - lblDia.setVisible(true); - drpDia.setVisible(true); - fillDiaDropDown(); - } - } - - public String butPesquisar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - Object obAno = null; - Object obMes = null; - Object obDia = null; - try - { - obAno = drpAno.getSelected(); - obMes = drpMes.getSelected(); - obDia = drpDia.getSelected(); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - Integer ano = null; - Integer mes = null; - Integer dia = null; - - if(obAno != null) - { - ano = (Integer) obAno; - } - - if(obMes != null) - { - mes = (Integer) obMes; - } - - if(obDia != null) - { - dia = (Integer) obDia; - } - - String nome = null; - if(txtNome.getText() != null) - { - nome = (String) txtNome.getText(); - } - - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - - //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); - ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, nome); - - table3.setRendered(true); - txtSearchMsg.setRendered(false); - getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList); - - - } - catch(Exception ex) - { - table3.setRendered(false); - txtSearchMsg.setRendered(true); - txtSearchMsg.setText("Não foram encontrados registos para a sua pesquisa !"); - ex.printStackTrace(); - } - - return null; - } - - public void drpDia_processValueChange(ValueChangeEvent vce) { - // TODO: Replace with your code - - } - -// private String getPageFrom(String referer) -// { -// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); -// return pageFrom; -// } - - public String butNovaAnalise_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - getSessionBean1().setNavFrom("FormSeguranca"); - getSessionBean1().setCurrentAnalise(null); - return "analise_acidente"; - } - - public String lnkDataAcidente_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "analise_acidente"; - } - - public String lnkNr_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "analise_acidente"; - } - - public String lnkNomeAcidentado_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "analise_acidente"; - } - - private AnaliseAcidente getTableActivosRowData() - { - RowKey rk = tableRowGroup1.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesActualDataProvider provider = (AnalisesActualDataProvider) tableRowGroup1.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public String lnkDataAcidenteSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - - } - - public String lnkNrSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - public String lnkNomeAcidentadoSeg_action() { - // TODO: Replace with your code - - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - private AnaliseAcidente getTableSeguimentoRowData() - { - RowKey rk = tableRowGroup2.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesSeguimentoDataProvider provider = (AnalisesSeguimentoDataProvider) tableRowGroup2.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - private AnaliseAcidente getTableConcluidasRowData() - { - RowKey rk = tableRowGroup3.getRowKey(); - int k = Integer.parseInt(rk.getRowId()); - AnalisesConcluidasDataProvider provider = (AnalisesConcluidasDataProvider) tableRowGroup3.getSourceData(); - ArrayList list = (ArrayList) provider.getList(); - AnaliseAcidente a = (AnaliseAcidente)list.get(k); - return a; - } - - public String lnkEditUser_action() { - // TODO: Replace with your code - getSessionBean1().setNavFrom("FormSeguranca"); - getSessionBean1().setModoEdicaoUtilizador("edit"); - return "user"; - } - - public String lnkDataConcluida_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableConcluidasRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - public String lnkNrConcluida_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableConcluidasRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - public String lnkNomeConcluida_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableConcluidasRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - - public String lnkFase_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableActivosRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "analise_acidente"; - } - - public String lnkFaseSeg_action() { - // TODO: Replace with your code - AnaliseAcidente a = getTableSeguimentoRowData(); - getSessionBean1().setCurrentAnalise(a); - getSessionBean1().setNavFrom("FormSeguranca"); - return "view_analise"; - } - -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Header.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Header.java deleted file mode 100644 index 7bcdb7dc..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Header.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Header.java - * - * Created on September 19, 2007, 10:14 AM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractFragmentBean; -import com.sun.rave.web.ui.component.StaticText; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; - -/** - *Fragment bean that corresponds to a similarly named JSP page - * fragment. This class contains component definitions (and initialization - * code) for all components that you have defined on this fragment, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class Header extends AbstractFragmentBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - //Callback method that is called whenever a page containing - * this page fragment is navigated to, either directly via a URL, - * or indirectly via page navigation. Override this method to acquire - * resources that will be needed for event handlers and lifecycle methods.
- * - *The default implementation does nothing.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - - //Callback method that is called after rendering is completed for
- * this request, if init() was called. Override this
- * method to release resources acquired in the init()
- * resources that will be needed for event handlers and lifecycle methods.
The default implementation does nothing.
- */ - public void destroy() { - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/LoadImage.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/LoadImage.java deleted file mode 100644 index 8439b42f..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/LoadImage.java +++ /dev/null @@ -1,480 +0,0 @@ -/* - * LoadImage.java - * - * Created on September 26, 2007, 5:36 PM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.ImageComponent; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.StaticText; -import com.sun.rave.web.ui.component.Upload; -import com.sun.rave.web.ui.model.UploadedFile; -import java.io.File; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; -import javax.servlet.ServletContext; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class LoadImage extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase1() { - return gridBase1; - } - - public void setGridBase1(HtmlPanelGrid hpg) { - this.gridBase1 = hpg; - } - - private HtmlPanelGrid gridLayout = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout() { - return gridLayout; - } - - public void setGridLayout(HtmlPanelGrid hpg) { - this.gridLayout = hpg; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Upload fileUpload1 = new Upload(); - - public Upload getFileUpload1() { - return fileUpload1; - } - - public void setFileUpload1(Upload u) { - this.fileUpload1 = u; - } - - private Button butUpload = new Button(); - - public Button getButUpload() { - return butUpload; - } - - public void setButUpload(Button b) { - this.butUpload = b; - } - - //Construct a new Page bean instance.
- */ - - private String realImageFilePath; - //private static final String IMAGE_URL = "/resources/image-file"; - private String IMAGE_URL = "/resources/images"; - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - - private StaticText txtFileName = new StaticText(); - - public StaticText getTxtFileName() { - return txtFileName; - } - - public void setTxtFileName(StaticText st) { - this.txtFileName = st; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText staticText5 = new StaticText(); - - public StaticText getStaticText5() { - return staticText5; - } - - public void setStaticText5(StaticText st) { - this.staticText5 = st; - } - - private StaticText txtFileType = new StaticText(); - - public StaticText getTxtFileType() { - return txtFileType; - } - - public void setTxtFileType(StaticText st) { - this.txtFileType = st; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private StaticText txtFileSize = new StaticText(); - - public StaticText getTxtFileSize() { - return txtFileSize; - } - - public void setTxtFileSize(StaticText st) { - this.txtFileSize = st; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private StaticText txtMsg = new StaticText(); - - public StaticText getTxtMsg() { - return txtMsg; - } - - public void setTxtMsg(StaticText st) { - this.txtMsg = st; - } - public LoadImage() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - String uploadedFileName = (String) - this.txtFileName.getValue(); - if ( uploadedFileName != null ) { - IMAGE_URL += getSessionBean1().getImageName(); - System.out.println("IMAGE URL : " + IMAGE_URL); - image1.setUrl(IMAGE_URL); - } - txtMsg.setText(getSessionBean1().getMsg()); - getSessionBean1().setMsg(""); - - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - return null; - } - - public String lnkNome_action() { - // TODO: Replace with your code - - return null; - } - - public String lnkDataNascimento_action() { - // TODO: Replace with your code - - return null; - } - - public String butUpload_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - UploadedFile uploadedFile = fileUpload1.getUploadedFile(); - String uploadedFileName = uploadedFile.getOriginalName(); - // Some browsers return complete path name, some don't - // Make sure we only have the file name - // First, try forward slash - int index = uploadedFileName.lastIndexOf('/'); - String justFileName; - if ( index >= 0) { - justFileName = uploadedFileName.substring( index + 1 ); - } else { - // Try backslash - index = uploadedFileName.lastIndexOf('\\'); - if (index >= 0) { - justFileName = uploadedFileName.substring( index + 1 ); - } else { - // No forward or back slashes - justFileName = uploadedFileName; - } - } - justFileName = justFileName.substring(0, justFileName.lastIndexOf('.')); - this.txtFileName.setValue(justFileName); - Long uploadedFileSize = new Long(uploadedFile.getSize()); - this.txtFileSize.setValue(uploadedFileSize); - String uploadedFileType = uploadedFile.getContentType(); - this.txtFileType.setValue(uploadedFileType); - if ( uploadedFileType.equals("image/jpeg") - || uploadedFileType.equals("image/pjpeg") - || uploadedFileType.equals("image/gif") - || uploadedFileType.equals("image/png") - || uploadedFileType.equals("image/x-png")) { - try { - realImageFilePath += "/" + justFileName; - File file = new File(this.realImageFilePath); - uploadedFile.write(file); - getSessionBean1().setImageName(justFileName); - //getSessionBean1().setMsg("Ficheiro carregado !"); - } catch (Exception ex) { - ex.printStackTrace(); - getSessionBean1().setMsg("Não foi possivel carregar o ficheiro !"); - return null; - } - } else { - getSessionBean1().setMsg("O ficheiro deve ser do tipo JPEG, PJPEG, GIF, PNG, ou X-PNG !"); - new File(this.realImageFilePath).delete(); - return null; - } - return "analise_acidente"; - } -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java deleted file mode 100644 index a38ebb06..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java +++ /dev/null @@ -1,514 +0,0 @@ -/* - * Page1.java - * - * Created on September 18, 2007, 3:14 PM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.Hyperlink; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.PasswordField; -import com.sun.rave.web.ui.component.StaticText; -import com.sun.rave.web.ui.component.TextField; -import com.sun.rave.web.ui.model.Option; -import db.AnalisesDataProvider; -import db.UtilizadoresDataProvider; -import java.sql.Connection; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class Login extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private TextField txtUtilizador = new TextField(); - - public TextField getTxtUtilizador() { - return txtUtilizador; - } - - public void setTxtUtilizador(TextField tf) { - this.txtUtilizador = tf; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private PasswordField txtPassword = new PasswordField(); - - public PasswordField getTxtPassword() { - return txtPassword; - } - - public void setTxtPassword(PasswordField pf) { - this.txtPassword = pf; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private Hyperlink lnkPassRecovery = new Hyperlink(); - - public Hyperlink getLnkPassRecovery() { - return lnkPassRecovery; - } - - public void setLnkPassRecovery(Hyperlink h) { - this.lnkPassRecovery = h; - } - - private Button butLogin = new Button(); - - public Button getButLogin() { - return butLogin; - } - - public void setButLogin(Button b) { - this.butLogin = b; - } - - private StaticText txtMsg = new StaticText(); - - public StaticText getTxtMsg() { - return txtMsg; - } - - public void setTxtMsg(StaticText st) { - this.txtMsg = st; - } - - //Construct a new Page bean instance.
- */ - public Login() { - connect(); - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - - txtMsg.setText(getSessionBean1().getMsg()); - getSessionBean1().setMsg(""); - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String butLogin_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - String sRet = null; - - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - if(txtUtilizador.getText() != null) - { - String utilizador = (String) txtUtilizador.getText(); - if(utilizador.trim().length() > 0) - { - if(txtPassword.getText() != null) - { - String password = (String) txtPassword.getText(); - if(password.trim().length() > 0) - { - try - { - Utilizador u = udp.getUtilizador(utilizador); - if(u.getActivo().matches("y")) - { - if(!password.equals(u.getPassword())) - { - getSessionBean1().setMsg("Palavra-chave inválida !"); - } - else - { - //if(u.getOwner_id().intValue() == 0 ) - - //Login Ok ! - - try - { - Integer permissao = udp.getPermissionCode(u.getId()); - if(permissao.intValue() == 1) //seguranca - { - sRet = "form_seguranca"; - } - else if(permissao.intValue() == 2) // rh - { - sRet = "form_rh"; - } - else if(permissao.intValue() == 3) // hs - { - System.out.println("PERMISSAO : HS"); - sRet = "form_hs"; - } - else if(permissao.intValue() == 5) // medico - { - sRet = "form_medico"; - } - else if(permissao.intValue() == 6) // administrador de loja - { - //sRet = "loja_admin"; - } - u.setCodigo_permissao(permissao); - getSessionBean1().setCurrentUser( u ); - getSessionBean1().setLoggedIn(true); - initializeClock(); - initializeDropDownOptions(); - - // só para testes. retirar depois : - ///getSessionBean1().setModoEdicaoUtilizador("new"); - ///sRet = "create_user"; - } - catch(Exception e1) - { - e1.printStackTrace(); - getSessionBean1().setMsg("Não tem permissão para entrar na aplicação !"); - } - } - - } - else - { - getSessionBean1().setMsg("Utilizador inválido ! "); - } - } - catch(Exception ex) - { - getSessionBean1().setMsg("Utilizador inválido ! "); - } - } - else - { - getSessionBean1().setMsg("Falta palavra-chave !"); - } - } - else - { - getSessionBean1().setMsg("Falta palavra-chave !"); - } - } - else - { - getSessionBean1().setMsg("Falta utilizador !"); - } - } - else - { - getSessionBean1().setMsg("Falta utilizador !"); - } - return sRet; - } - - public String lnkPassRecovery_action() { - // TODO: Replace with your code - - return "recuperar_password"; - } - - private void connect() - { - db.Db db = new db.Db(); - try - { - Connection connection = db.connect(); - } - catch(Exception ex) - { - getSessionBean1().setMsg("Erro na ligação à Base de Dados"); - //***** terminate session - try { - getExternalContext().redirect("faces/Erro.jsp"); - } catch(Exception e) { - // . . . handle exception . . . - e.printStackTrace(); - } - ex.printStackTrace(); - } - } - - private void initializeClock() - { - com.sun.rave.web.ui.model.Option[] horasOptions = new com.sun.rave.web.ui.model.Option[24]; - for(int i=0; i < 24; i++) - { - - horasOptions[i] = new Option(new Integer(i), new Integer(i).toString()); - } - getSessionBean1().setHorasOptions(horasOptions); - - com.sun.rave.web.ui.model.Option[] minutosOptions = new com.sun.rave.web.ui.model.Option[12]; - int j = 0; - for(int i=0; i < 12; i++) - { - - minutosOptions[i] = new Option(new Integer(j), new Integer(j).toString()); - j += 5; - } - getSessionBean1().setMinutosOptions(minutosOptions); - } - - private void initializeDropDownOptions() - { - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - getSessionBean1().setTecnicosOptions(udp.getTecnicosSaudeList()); - //drpTipo.setSelected(new Integer(0)); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - try - { - getSessionBean1().setMedicosOptions(udp.getMedicosList()); - //drpTipo.setSelected(new Integer(0)); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java deleted file mode 100644 index 257089e6..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Medico.java - * - * Created on October 12, 2007, 11:00 AM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class Medico { - private Integer id; - private String nome; - private String numero_cedula; - - /** Creates a new instance of Medico */ - public Medico() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getNome() { - return nome; - } - - public void setNome(String nome) { - this.nome = nome; - } - - public String getNumero_cedula() { - return numero_cedula; - } - - public void setNumero_cedula(String numero_cedula) { - this.numero_cedula = numero_cedula; - } - - public String toString() { - return utils.Utils.unicodeToHTML(nome); - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java deleted file mode 100644 index 5fe9c763..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Medida.java - * - * Created on October 19, 2007, 4:59 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class Medida { - private Integer id; - private Integer analise_id; - private String medida; - - /** Creates a new instance of Medida */ - public Medida() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getAnalise_id() { - return analise_id; - } - - public void setAnalise_id(Integer analise_id) { - this.analise_id = analise_id; - } - - public String getMedida() { - return medida; - } - - public void setMedida(String medida) { - this.medida = medida; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java deleted file mode 100644 index 31b0be5b..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Permissao.java - * - * Created on October 25, 2007, 4:40 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class Permissao { - private Integer id; - private Integer user_id; - private Integer codigo_permissao; - - /** Creates a new instance of Permissao */ - public Permissao() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getUser_id() { - return user_id; - } - - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - public Integer getCodigo_permissao() { - return codigo_permissao; - } - - public void setCodigo_permissao(Integer codigo_permissao) { - this.codigo_permissao = codigo_permissao; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java deleted file mode 100644 index 85aea13e..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Recomendacao.java - * - * Created on October 16, 2007, 3:13 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class Recomendacao { - private Integer id; - private Integer analise_id; - private String recomendacao; - - /** Creates a new instance of Recomendacao */ - public Recomendacao() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getAnalise_id() { - return analise_id; - } - - public void setAnalise_id(Integer analise_id) { - this.analise_id = analise_id; - } - - public String getRecomendacao() { - return recomendacao; - } - - public void setRecomendacao(String recomendacao) { - this.recomendacao = recomendacao; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java deleted file mode 100644 index deb5b682..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java +++ /dev/null @@ -1,525 +0,0 @@ -/* - * RecuperarPassword.java - * - * Created on September 19, 2007, 9:57 AM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.StaticText; -import com.sun.rave.web.ui.component.TextField; -import db.UtilizadoresDataProvider; -import java.util.Date; -import java.util.Properties; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; -import javax.mail.BodyPart; -import javax.mail.Message; -import javax.mail.Multipart; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeBodyPart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; -import utils.Utils; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class RecuperarPassword extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel3() { - return gridPanel3; - } - - public void setGridPanel3(HtmlPanelGrid hpg) { - this.gridPanel3 = hpg; - } - - private StaticText txtMsg = new StaticText(); - - public StaticText getTxtMsg() { - return txtMsg; - } - - public void setTxtMsg(StaticText st) { - this.txtMsg = st; - } - - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - - private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel4() { - return gridPanel4; - } - - public void setGridPanel4(HtmlPanelGrid hpg) { - this.gridPanel4 = hpg; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private TextField txtUtilizador = new TextField(); - - public TextField getTxtUtilizador() { - return txtUtilizador; - } - - public void setTxtUtilizador(TextField tf) { - this.txtUtilizador = tf; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private TextField txtEmail = new TextField(); - - public TextField getTxtEmail() { - return txtEmail; - } - - public void setTxtEmail(TextField tf) { - this.txtEmail = tf; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private Button butCancelar = new Button(); - - public Button getButCancelar() { - return butCancelar; - } - - public void setButCancelar(Button b) { - this.butCancelar = b; - } - - private Button butOk = new Button(); - - public Button getButOk() { - return butOk; - } - - public void setButOk(Button b) { - this.butOk = b; - } - - //Construct a new Page bean instance.
- */ - public RecuperarPassword() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - txtMsg.setText(getSessionBean1().getMsg()); - getSessionBean1().setMsg(""); - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String butLogin_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - return null; - } - - public String butCancelar_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - return "login"; - } - - public String butOk_action() { - // TODO: Process the button click action. Return value is a navigation - // case name where null will return to the same page. - - - if(fieldsValidationOk()) - { - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - String utilizador = (String) txtUtilizador.getText(); - Utilizador u = udp.getUtilizador(utilizador); - String email = (String) txtEmail.getText(); - if(u.getEmail().equals(email)) - { - //send mail : - try - { - sendEmail(u.getEmail(), u.getLogin(), u.getPassword(), "linojose@mail.com"); - getSessionBean1().setMsg("A sua password foi enviada para o seu email"); - return "login"; - } - catch(Exception ex) - { - getSessionBean1().setMsg("Erro no envio da password !"); - } - - } - else - { - getSessionBean1().setMsg("Os dados não coincidem com os registos !"); - } - } - catch(Exception ex) - { - getSessionBean1().setMsg("Utilizador inválido !"); - } - } - - - return null; - } - - private void sendEmail(String emailTo, String login, String password, String admin_email) throws Exception - { - Properties props = new Properties(); - //props.put("mail.transport.protocol", "smtp"); - props.put("mail.smtp.host", "smtp.netcabo.pt"); - props.put("mail.from", admin_email); - Session session1 = Session.getInstance(props); - Message msg = new MimeMessage(session1); - -// try -// { - //Address Email_TO = new InternetAddress("myemail@bol.com.br"); - msg.setFrom(new InternetAddress(admin_email)); - InternetAddress[] address = {new InternetAddress(emailTo)}; - msg.setRecipients(Message.RecipientType.TO, address); - msg.setSubject("Envio da password"); - msg.setSentDate(new Date()); - Multipart multipart = new MimeMultipart(); - BodyPart msgBodyPart = new MimeBodyPart(); - String html; - html=" "; - html+=""; - html+="Password: " + password + "
"; - html+=""; - msgBodyPart.setContent(html, "text/html"); - multipart.addBodyPart(msgBodyPart); - msg.setContent(multipart); - Transport.send(msg); - System.out.println("Email Enviado !!!! " + emailTo + ", " + login); -// } -// catch (Exception ex) -// { -// System.out.println("MAIL ERROR : " + ex.getMessage()); -// ex.printStackTrace(); -// } - - } - - private boolean fieldsValidationOk() - { - if(txtUtilizador.getText() != null) - { - String utilizador = (String) txtUtilizador.getText(); - if(utilizador.trim().length() == 0) - { - getSessionBean1().setMsg("Falta utilizador !"); - return false; - } - } - else - { - getSessionBean1().setMsg("Falta utilizador !"); - return false; - } - - if(txtEmail.getText() != null) - { - String email = (String) txtEmail.getText(); - if(email.trim().length() == 0) - { - getSessionBean1().setMsg("Falta email !"); - return false; - } - else - { - if(! Utils.isValidEmail(email)) - { - getSessionBean1().setMsg("Email inválido !"); - return false; - } - } - } - else - { - getSessionBean1().setMsg("Falta email !"); - return false; - } - - return true; - } - -// private boolean isValidEmail(String email){ -// boolean res = true; -// -// int indexOfAtChar=email.indexOf("@"); -// -// if(indexOfAtChar > 0) -// { -// int indexOfDotChar = -// email.indexOf(".",indexOfAtChar); -// if(indexOfDotChar > 0) -// { -// res = true; -// } -// else -// { -// res = false; -// } -// } -// else{ -// res = false; -// } -// return res; -// } - - -} - diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RequestBean1.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RequestBean1.java deleted file mode 100644 index 66ece1e4..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RequestBean1.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * RequestBean1.java - * - * Created on September 18, 2007, 3:14 PM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractRequestBean; -import javax.faces.FacesException; - -/** - *Request scope data bean for your application. Create properties - * here to represent data that should be made available across different - * pages in the same HTTP request, so that the page bean classes do not - * have to be directly linked to each other.
- * - *An instance of this class will be created for you automatically, - * the first time your application evaluates a value binding expression - * or method binding expression that references a managed bean using - * this class.
- */ -public class RequestBean1 extends AbstractRequestBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - //Construct a new request data bean instance.
- */ - public RequestBean1() { - } - - /** - *This method is called when this bean is initially added to - * request scope. Typically, this occurs as a result of evaluating - * a value binding or method binding expression, which utilizes the - * managed bean facility to instantiate this bean and store it into - * request scope.
- * - *You may customize this method to allocate resources that are required - * for the lifetime of the current request.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //This method is called when this bean is removed from - * request scope. This occurs automatically when the corresponding - * HTTP response has been completed and sent to the client.
- * - *You may customize this method to clean up resources allocated
- * during the execution of the init() method, or
- * at any later time during the lifetime of the request.
Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java deleted file mode 100644 index d1a90ab0..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java +++ /dev/null @@ -1,459 +0,0 @@ -/* - * SessionBean1.java - * - * Created on September 18, 2007, 3:14 PM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractSessionBean; -import javax.faces.FacesException; -import pagestate.AnaliseAcidenteTrabalhoState; - -/** - *Session scope data bean for your application. Create properties - * here to represent cached data that should be made available across - * multiple HTTP requests for an individual user.
- * - *An instance of this class will be created for you automatically, - * the first time your application evaluates a value binding expression - * or method binding expression that references a managed bean using - * this class.
- */ -public class SessionBean1 extends AbstractSessionBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - //Construct a new session data bean instance.
- */ - public SessionBean1() { - msg = new String(""); - currentUser = new Utilizador(); - analisesActualDataProvider = new db.AnalisesActualDataProvider(); - analisesSeguimentoDataProvider = new db.AnalisesSeguimentoDataProvider(); - analisesConcluidasDataProvider = new db.AnalisesConcluidasDataProvider(); - trabalhadoresListDataProvider = new db.TrabalhadoresListDataProvider(); - - setNavFrom(""); - setAcidentado(null); - setCurrentAnalise(null); - setLoggedIn(false); - - modoEdicaoUtilizador = ""; - setIdSequence(1); - } - - /** - *This method is called when this bean is initially added to - * session scope. Typically, this occurs as a result of evaluating - * a value binding or method binding expression, which utilizes the - * managed bean facility to instantiate this bean and store it into - * session scope.
- * - *You may customize this method to initialize and cache data values - * or resources that are required for the lifetime of a particular - * user session.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //This method is called when the session containing it is about to be
- * passivated. Typically, this occurs in a distributed servlet container
- * when the session is about to be transferred to a different
- * container instance, after which the activate() method
- * will be called to indicate that the transfer is complete.
You may customize this method to release references to session data - * or resources that can not be serialized with the session itself.
- */ - public void passivate() { - } - - /** - *This method is called when the session containing it was - * reactivated.
- * - *You may customize this method to reacquire references to session - * data or resources that could not be serialized with the - * session itself.
- */ - public void activate() { - } - - /** - *This method is called when this bean is removed from - * session scope. Typically, this occurs as a result of - * the session timing out or being terminated by the application.
- * - *You may customize this method to clean up resources allocated
- * during the execution of the init() method, or
- * at any later time during the lifetime of the application.
Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - private String msg; - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } - - private Utilizador currentUser; - - public Utilizador getCurrentUser() { - return currentUser; - } - - public void setCurrentUser(Utilizador currentUser) { - this.currentUser = currentUser; - } - - private db.AnalisesActualDataProvider analisesActualDataProvider; - private db.AnalisesSeguimentoDataProvider analisesSeguimentoDataProvider; - private db.AnalisesConcluidasDataProvider analisesConcluidasDataProvider; - private db.TrabalhadoresListDataProvider trabalhadoresListDataProvider; - - public db.AnalisesActualDataProvider getAnalisesActualDataProvider() { - return analisesActualDataProvider; - } - - public void setAnalisesActualDataProvider(db.AnalisesActualDataProvider analisesActualDataProvider) { - this.analisesActualDataProvider = analisesActualDataProvider; - } - - public db.AnalisesSeguimentoDataProvider getAnalisesSeguimentoDataProvider() { - return analisesSeguimentoDataProvider; - } - - public void setAnalisesSeguimentoDataProvider(db.AnalisesSeguimentoDataProvider analisesSeguimentoDataProvider) { - this.analisesSeguimentoDataProvider = analisesSeguimentoDataProvider; - } - - public db.AnalisesConcluidasDataProvider getAnalisesConcluidasDataProvider() { - return analisesConcluidasDataProvider; - } - - public void setAnalisesConcluidasDataProvider(db.AnalisesConcluidasDataProvider analisesConcluidasDataProvider) { - this.analisesConcluidasDataProvider = analisesConcluidasDataProvider; - } - - public db.TrabalhadoresListDataProvider getTrabalhadoresListDataProvider() { - return trabalhadoresListDataProvider; - } - - public void setTrabalhadoresListDataProvider(db.TrabalhadoresListDataProvider trabalhadoresListDataProvider) { - this.trabalhadoresListDataProvider = trabalhadoresListDataProvider; - } - - private com.sun.rave.web.ui.model.Option[] anoOptions; - - private Integer anoChoice; - - public Integer getAnoChoice() { - return anoChoice; - } - - public void setAnoChoice(Integer anoChoice) { - this.anoChoice = anoChoice; - } - - public com.sun.rave.web.ui.model.Option[] getAnoOptions() { - return anoOptions; - } - - public void setAnoOptions(com.sun.rave.web.ui.model.Option[] anoOptions) { - this.anoOptions = anoOptions; - } - - private com.sun.rave.web.ui.model.Option[] mesOptions; - - private Integer mesChoice; - - public Integer getMesChoice() { - return mesChoice; - } - - public void setMesChoice(Integer mesChoice) { - this.mesChoice = mesChoice; - } - - public com.sun.rave.web.ui.model.Option[] getMesOptions() { - return mesOptions; - } - - public void setMesOptions(com.sun.rave.web.ui.model.Option[] mesOptions) { - this.mesOptions = mesOptions; - } - - private com.sun.rave.web.ui.model.Option[] diaOptions; - - private Integer diaChoice; - - public Integer getDiaChoice() { - return diaChoice; - } - - public void setDiaChoice(Integer diaChoice) { - this.diaChoice = diaChoice; - } - - public com.sun.rave.web.ui.model.Option[] getDiaOptions() { - return diaOptions; - } - - public void setDiaOptions(com.sun.rave.web.ui.model.Option[] diaOptions) { - this.diaOptions = diaOptions; - } - - private String imageName; - - public String getImageName() { - return imageName; - } - - public void setImageName(String imageName) { - this.imageName = imageName; - } - - private String navFrom; - - public String getNavFrom() { - return navFrom; - } - - public void setNavFrom(String navFrom) { - this.navFrom = navFrom; - } - - private Acidentado acidentado; - - public Acidentado getAcidentado() { - return acidentado; - } - - public void setAcidentado(Acidentado acidentado) { - this.acidentado = acidentado; - } - - private AnaliseAcidenteTrabalhoState analise_acidente_trabalho_state; - - public AnaliseAcidenteTrabalhoState getAnalise_acidente_trabalho_state() { - return analise_acidente_trabalho_state; - } - - public void setAnalise_acidente_trabalho_state(AnaliseAcidenteTrabalhoState analise_acidente_trabalho_state) { - this.analise_acidente_trabalho_state = analise_acidente_trabalho_state; - } - - private AnaliseAcidente currentAnalise; - - public AnaliseAcidente getCurrentAnalise() { - return currentAnalise; - } - - public void setCurrentAnalise(AnaliseAcidente currentAnalise) { - this.currentAnalise = currentAnalise; - } - - private boolean loggedIn; - - public boolean isLoggedIn() - { - return loggedIn; - } - - public void setLoggedIn(boolean loggedIn) - { - this.loggedIn = loggedIn; - } - - private String modoEdicaoUtilizador; - - public String getModoEdicaoUtilizador() { - return modoEdicaoUtilizador; - } - - public void setModoEdicaoUtilizador(String modoEdicaoUtilizador) { - this.modoEdicaoUtilizador = modoEdicaoUtilizador; - } - - private Integer tipoChoice; - - public Integer getTipoChoice() { - return tipoChoice; - } - - public void setTipoChoice(Integer tipoChoice) { - this.tipoChoice = tipoChoice; - } - - private com.sun.rave.web.ui.model.Option[] tiposOptions; - - public com.sun.rave.web.ui.model.Option[] getTiposOptions() { - return tiposOptions; - } - - public void setTiposOptions(com.sun.rave.web.ui.model.Option[] tiposOptions) { - this.tiposOptions = tiposOptions; - } - - - private Integer estabelecimentoChoice; - - public Integer getEstabelecimentoChoice() { - return estabelecimentoChoice; - } - - public void setEstabelecimentoChoice(Integer estabelecimentoChoice) { - this.estabelecimentoChoice = estabelecimentoChoice; - } - - private com.sun.rave.web.ui.model.Option[] estabelecimentosOptions; - - public com.sun.rave.web.ui.model.Option[] getEstabelecimentosOptions() { - return estabelecimentosOptions; - } - - public void setEstabelecimentosOptions(com.sun.rave.web.ui.model.Option[] estabelecimentosOptions) { - this.estabelecimentosOptions = estabelecimentosOptions; - } - - - private Integer tecnicoChoice; - - public Integer getTecnicoChoice() { - return tecnicoChoice; - } - - public void setTecnicoChoice(Integer tecnicoChoice) { - this.tecnicoChoice = tecnicoChoice; - } - - private com.sun.rave.web.ui.model.Option[] tecnicosOptions; - - public com.sun.rave.web.ui.model.Option[] getTecnicosOptions() { - return tecnicosOptions; - } - - public void setTecnicosOptions(com.sun.rave.web.ui.model.Option[] tecnicosOptions) { - this.tecnicosOptions = tecnicosOptions; - } - - - private Integer medicoChoice; - - public Integer getMedicoChoice() { - return medicoChoice; - } - - public void setMedicoChoice(Integer medicoChoice) { - this.medicoChoice = medicoChoice; - } - - private com.sun.rave.web.ui.model.Option[] medicosOptions; - - public com.sun.rave.web.ui.model.Option[] getMedicosOptions() { - return medicosOptions; - } - - public void setMedicosOptions(com.sun.rave.web.ui.model.Option[] medicosOptions) { - this.medicosOptions = medicosOptions; - } - - - // Clock : - private Integer horaChoice; - - public Integer getHoraChoice() { - return horaChoice; - } - - public void setHoraChoice(Integer horaChoice) { - this.horaChoice = horaChoice; - } - - private com.sun.rave.web.ui.model.Option[] horasOptions; - - public com.sun.rave.web.ui.model.Option[] getHorasOptions() { - return horasOptions; - } - - public void setHorasOptions(com.sun.rave.web.ui.model.Option[] horasOptions) { - this.horasOptions = horasOptions; - } - - - private Integer minutoChoice; - - public Integer getMinutoChoice() { - return minutoChoice; - } - - public void setMinutoChoice(Integer minutoChoice) { - this.minutoChoice = minutoChoice; - } - - private com.sun.rave.web.ui.model.Option[] minutosOptions; - - public com.sun.rave.web.ui.model.Option[] getMinutosOptions() { - return minutosOptions; - } - - public void setMinutosOptions(com.sun.rave.web.ui.model.Option[] minutosOptions) { - this.minutosOptions = minutosOptions; - } - - - private int idSequence; - - public int getIdSequence() { - return idSequence; - } - - public void setIdSequence(int idSequence) { - this.idSequence = idSequence; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java deleted file mode 100644 index 7980ae83..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * TecnicoSaude.java - * - * Created on October 12, 2007, 11:00 AM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class TecnicoSaude { - private Integer id; - private String nome; - - /** Creates a new instance of TecnicoSaude */ - public TecnicoSaude() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getNome() { - return nome; - } - - public void setNome(String nome) { - this.nome = nome; - } - - public String toString() { - return utils.Utils.unicodeToHTML(nome); - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java deleted file mode 100644 index 749160c9..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * TipoUtilizador.java - * - * Created on October 11, 2007, 4:32 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class TipoUtilizador { - private Integer id; - private Integer tipo; - private String descricao; - private String activo; - private Integer ordem; - - /** Creates a new instance of TipoUtilizador */ - public TipoUtilizador() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getTipo() { - return tipo; - } - - public void setTipo(Integer tipo) { - this.tipo = tipo; - } - - public String getDescricao() { - return descricao; - } - - public void setDescricao(String descricao) { - this.descricao = descricao; - } - - public String getActivo() { - return activo; - } - - public void setActivo(String activo) { - this.activo = activo; - } - - public Integer getOrdem() { - return ordem; - } - - public void setOrdem(Integer ordem) { - this.ordem = ordem; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Top.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Top.java deleted file mode 100644 index d183ddf6..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Top.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Top.java - * - * Created on September 20, 2007, 11:04 AM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractFragmentBean; -import com.sun.rave.web.ui.component.Hyperlink; -import com.sun.rave.web.ui.component.ImageComponent; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.StaticText; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; - -/** - *Fragment bean that corresponds to a similarly named JSP page - * fragment. This class contains component definitions (and initialization - * code) for all components that you have defined on this fragment, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class Top extends AbstractFragmentBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkChangePassword = new Hyperlink(); - - public Hyperlink getLnkChangePassword() { - return lnkChangePassword; - } - - public void setLnkChangePassword(Hyperlink h) { - this.lnkChangePassword = h; - } - - private StaticText staticText3 = new StaticText(); - - public StaticText getStaticText3() { - return staticText3; - } - - public void setStaticText3(StaticText st) { - this.staticText3 = st; - } - - private Hyperlink lnkLogout = new Hyperlink(); - - public Hyperlink getLnkLogout() { - return lnkLogout; - } - - public void setLnkLogout(Hyperlink h) { - this.lnkLogout = h; - } - //Callback method that is called whenever a page containing - * this page fragment is navigated to, either directly via a URL, - * or indirectly via page navigation. Override this method to acquire - * resources that will be needed for event handlers and lifecycle methods.
- * - *The default implementation does nothing.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - - //Callback method that is called after rendering is completed for
- * this request, if init() was called. Override this
- * method to release resources acquired in the init()
- * resources that will be needed for event handlers and lifecycle methods.
The default implementation does nothing.
- */ - public void destroy() { - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java deleted file mode 100644 index 407b593e..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Trabalhador.java - * - * Created on September 26, 2007, 4:23 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class Trabalhador { - private Integer id; - private String nome; - private java.sql.Date data_nascimento; - private String funcao; - private java.sql.Date data_admissao; - private String numero_mecanografico; - - - /** Creates a new instance of Trabalhador */ - public Trabalhador() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getNome() { - return nome; - } - - public void setNome(String nome) { - this.nome = nome; - } - - public java.sql.Date getData_nascimento() { - return data_nascimento; - } - - public void setData_nascimento(java.sql.Date data_nascimento) { - this.data_nascimento = data_nascimento; - } - - public String getFuncao() { - return funcao; - } - - public void setFuncao(String funcao) { - this.funcao = funcao; - } - - public java.sql.Date getData_admissao() { - return data_admissao; - } - - public void setData_admissao(java.sql.Date data_admissao) { - this.data_admissao = data_admissao; - } - - public String getNumero_mecanografico() { - return numero_mecanografico; - } - - public void setNumero_mecanografico(String numero_mecanografico) { - this.numero_mecanografico = numero_mecanografico; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java deleted file mode 100644 index c79482e6..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Utilizador.java - * - * Created on September 20, 2007, 9:58 AM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package analiseacidentestrabalho; - -/** - * - * @author lluis - */ -public class Utilizador { - private Integer id; - private String login; - private String password; - private String email; - private Integer empresa_id; - private Integer estabelecimento_id; - private String administrador; - private Integer tipo; - private String numero_cedula; - private String cap; - - private Integer codigo_permissao; - - private String nome; - - private Integer medico_id; - private Integer funcionario_hst_id; - - private String activo; - - /** Creates a new instance of Utilizador */ - public Utilizador() { - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getLogin() { - return login; - } - - public void setLogin(String login) { - this.login = login; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public Integer getEmpresa_id() { - return empresa_id; - } - - public void setEmpresa_id(Integer empresa_id) { - this.empresa_id = empresa_id; - } - - public Integer getEstabelecimento_id() { - return estabelecimento_id; - } - - public void setEstabelecimento_id(Integer estabelecimento_id) { - this.estabelecimento_id = estabelecimento_id; - } - - public String getAdministrador() { - return administrador; - } - - public void setAdministrador(String administrador) { - this.administrador = administrador; - } - - public Integer getCodigo_permissao() { - return codigo_permissao; - } - - public void setCodigo_permissao(Integer codigo_permissao) { - this.codigo_permissao = codigo_permissao; - } - - public Integer getTipo() { - return tipo; - } - - public void setTipo(Integer tipo) { - this.tipo = tipo; - } - - public String getNumero_cedula() { - return numero_cedula; - } - - public void setNumero_cedula(String numero_cedula) { - this.numero_cedula = numero_cedula; - } - - public String getCap() { - return cap; - } - - public void setCap(String cap) { - this.cap = cap; - } - - public String getNome() { - return nome; - } - - public void setNome(String nome) { - this.nome = nome; - } - - public Integer getMedico_id() { - return medico_id; - } - - public void setMedico_id(Integer medico_id) { - this.medico_id = medico_id; - } - - public Integer getFuncionario_hst_id() { - return funcionario_hst_id; - } - - public void setFuncionario_hst_id(Integer funcionario_hst_id) { - this.funcionario_hst_id = funcionario_hst_id; - } - - public String getActivo() { - return activo; - } - - public void setActivo(String activo) { - this.activo = activo; - } - -} diff --git a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java b/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java deleted file mode 100644 index ba65604d..00000000 --- a/AnaliseAcidentesTrabalho/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java +++ /dev/null @@ -1,2984 +0,0 @@ -/* - * ViewAnaliseAcidenteTrabalho.java - * - * Created on October 1, 2007, 10:48 AM - * Copyright lluis - */ -package analiseacidentestrabalho; - -import com.sun.rave.web.ui.appbase.AbstractPageBean; -import com.sun.rave.web.ui.component.Body; -import com.sun.rave.web.ui.component.Button; -import com.sun.rave.web.ui.component.Form; -import com.sun.rave.web.ui.component.Head; -import com.sun.rave.web.ui.component.Html; -import com.sun.rave.web.ui.component.Hyperlink; -import com.sun.rave.web.ui.component.ImageComponent; -import com.sun.rave.web.ui.component.Link; -import com.sun.rave.web.ui.component.Page; -import com.sun.rave.web.ui.component.PanelGroup; -import com.sun.rave.web.ui.component.StaticText; -import db.AnalisesDataProvider; -import db.UtilizadoresDataProvider; -import java.io.File; -import java.util.ArrayList; -import java.util.ListIterator; -import javax.faces.FacesException; -import javax.faces.component.html.HtmlPanelGrid; -import javax.servlet.ServletContext; -import utils.Utils; - -/** - *Page bean that corresponds to a similarly named JSP page. This - * class contains component definitions (and initialization code) for - * all components that you have defined on this page, as well as - * lifecycle methods and event handlers where you may add behavior - * to respond to incoming events.
- */ -public class ViewAnaliseAcidenteTrabalho extends AbstractPageBean { - //Automatically managed component initialization. WARNING: - * This method is automatically generated, so any user-specified code inserted - * here is subject to being replaced.
- */ - private void _init() throws Exception { - } - - private Page page1 = new Page(); - - public Page getPage1() { - return page1; - } - - public void setPage1(Page p) { - this.page1 = p; - } - - private Html html1 = new Html(); - - public Html getHtml1() { - return html1; - } - - public void setHtml1(Html h) { - this.html1 = h; - } - - private Head head1 = new Head(); - - public Head getHead1() { - return head1; - } - - public void setHead1(Head h) { - this.head1 = h; - } - - private Link link1 = new Link(); - - public Link getLink1() { - return link1; - } - - public void setLink1(Link l) { - this.link1 = l; - } - - private Body body1 = new Body(); - - public Body getBody1() { - return body1; - } - - public void setBody1(Body b) { - this.body1 = b; - } - - private Form form1 = new Form(); - - public Form getForm1() { - return form1; - } - - public void setForm1(Form f) { - this.form1 = f; - } - - private HtmlPanelGrid gridBase1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridBase1() { - return gridBase1; - } - - public void setGridBase1(HtmlPanelGrid hpg) { - this.gridBase1 = hpg; - } - - private HtmlPanelGrid gridLayout1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridLayout1() { - return gridLayout1; - } - - public void setGridLayout1(HtmlPanelGrid hpg) { - this.gridLayout1 = hpg; - } - - private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel1() { - return gridPanel1; - } - - public void setGridPanel1(HtmlPanelGrid hpg) { - this.gridPanel1 = hpg; - } - - private PanelGroup groupPanel1 = new PanelGroup(); - - public PanelGroup getGroupPanel1() { - return groupPanel1; - } - - public void setGroupPanel1(PanelGroup pg) { - this.groupPanel1 = pg; - } - - private ImageComponent image1 = new ImageComponent(); - - public ImageComponent getImage1() { - return image1; - } - - public void setImage1(ImageComponent ic) { - this.image1 = ic; - } - - private ImageComponent image2 = new ImageComponent(); - - public ImageComponent getImage2() { - return image2; - } - - public void setImage2(ImageComponent ic) { - this.image2 = ic; - } - - private PanelGroup groupPanel2 = new PanelGroup(); - - public PanelGroup getGroupPanel2() { - return groupPanel2; - } - - public void setGroupPanel2(PanelGroup pg) { - this.groupPanel2 = pg; - } - - private StaticText lblUser = new StaticText(); - - public StaticText getLblUser() { - return lblUser; - } - - public void setLblUser(StaticText st) { - this.lblUser = st; - } - - private StaticText staticText1 = new StaticText(); - - public StaticText getStaticText1() { - return staticText1; - } - - public void setStaticText1(StaticText st) { - this.staticText1 = st; - } - - private Hyperlink lnkEditUser = new Hyperlink(); - - public Hyperlink getLnkEditUser() { - return lnkEditUser; - } - - public void setLnkEditUser(Hyperlink h) { - this.lnkEditUser = h; - } - - private StaticText staticText2 = new StaticText(); - - public StaticText getStaticText2() { - return staticText2; - } - - public void setStaticText2(StaticText st) { - this.staticText2 = st; - } - - private Hyperlink lnkLogout1 = new Hyperlink(); - - public Hyperlink getLnkLogout1() { - return lnkLogout1; - } - - public void setLnkLogout1(Hyperlink h) { - this.lnkLogout1 = h; - } - - private HtmlPanelGrid gridMsg1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridMsg1() { - return gridMsg1; - } - - public void setGridMsg1(HtmlPanelGrid hpg) { - this.gridMsg1 = hpg; - } - - private StaticText txtMsg1 = new StaticText(); - - public StaticText getTxtMsg1() { - return txtMsg1; - } - - public void setTxtMsg1(StaticText st) { - this.txtMsg1 = st; - } - - private HtmlPanelGrid gridCabecalho1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridCabecalho1() { - return gridCabecalho1; - } - - public void setGridCabecalho1(HtmlPanelGrid hpg) { - this.gridCabecalho1 = hpg; - } - - private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel2() { - return gridPanel2; - } - - public void setGridPanel2(HtmlPanelGrid hpg) { - this.gridPanel2 = hpg; - } - - private StaticText lblEmpresa1 = new StaticText(); - - public StaticText getLblEmpresa1() { - return lblEmpresa1; - } - - public void setLblEmpresa1(StaticText st) { - this.lblEmpresa1 = st; - } - - private StaticText txtEmpresa = new StaticText(); - - public StaticText getTxtEmpresa() { - return txtEmpresa; - } - - public void setTxtEmpresa(StaticText st) { - this.txtEmpresa = st; - } - - private StaticText staticText4 = new StaticText(); - - public StaticText getStaticText4() { - return staticText4; - } - - public void setStaticText4(StaticText st) { - this.staticText4 = st; - } - - private StaticText txtEstabelecimento = new StaticText(); - - public StaticText getTxtEstabelecimento() { - return txtEstabelecimento; - } - - public void setTxtEstabelecimento(StaticText st) { - this.txtEstabelecimento = st; - } - - private StaticText lblTrabalhador1 = new StaticText(); - - public StaticText getLblTrabalhador1() { - return lblTrabalhador1; - } - - public void setLblTrabalhador1(StaticText st) { - this.lblTrabalhador1 = st; - } - - private StaticText txtTrabalhador = new StaticText(); - - public StaticText getTxtTrabalhador() { - return txtTrabalhador; - } - - public void setTxtTrabalhador(StaticText st) { - this.txtTrabalhador = st; - } - - private HtmlPanelGrid gridSiprp1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridSiprp1() { - return gridSiprp1; - } - - public void setGridSiprp1(HtmlPanelGrid hpg) { - this.gridSiprp1 = hpg; - } - - private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel5() { - return gridPanel5; - } - - public void setGridPanel5(HtmlPanelGrid hpg) { - this.gridPanel5 = hpg; - } - - private StaticText staticText6 = new StaticText(); - - public StaticText getStaticText6() { - return staticText6; - } - - public void setStaticText6(StaticText st) { - this.staticText6 = st; - } - - private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel6() { - return gridPanel6; - } - - public void setGridPanel6(HtmlPanelGrid hpg) { - this.gridPanel6 = hpg; - } - - private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel7() { - return gridPanel7; - } - - public void setGridPanel7(HtmlPanelGrid hpg) { - this.gridPanel7 = hpg; - } - - private StaticText staticText7 = new StaticText(); - - public StaticText getStaticText7() { - return staticText7; - } - - public void setStaticText7(StaticText st) { - this.staticText7 = st; - } - - private StaticText staticText8 = new StaticText(); - - public StaticText getStaticText8() { - return staticText8; - } - - public void setStaticText8(StaticText st) { - this.staticText8 = st; - } - - private StaticText staticText9 = new StaticText(); - - public StaticText getStaticText9() { - return staticText9; - } - - public void setStaticText9(StaticText st) { - this.staticText9 = st; - } - - private PanelGroup groupPanel3 = new PanelGroup(); - - public PanelGroup getGroupPanel3() { - return groupPanel3; - } - - public void setGroupPanel3(PanelGroup pg) { - this.groupPanel3 = pg; - } - - private StaticText staticText10 = new StaticText(); - - public StaticText getStaticText10() { - return staticText10; - } - - public void setStaticText10(StaticText st) { - this.staticText10 = st; - } - - private StaticText txtCap1 = new StaticText(); - - public StaticText getTxtCap1() { - return txtCap1; - } - - public void setTxtCap1(StaticText st) { - this.txtCap1 = st; - } - - private StaticText staticText11 = new StaticText(); - - public StaticText getStaticText11() { - return staticText11; - } - - public void setStaticText11(StaticText st) { - this.staticText11 = st; - } - - private PanelGroup groupPanel4 = new PanelGroup(); - - public PanelGroup getGroupPanel4() { - return groupPanel4; - } - - public void setGroupPanel4(PanelGroup pg) { - this.groupPanel4 = pg; - } - - private StaticText staticText12 = new StaticText(); - - public StaticText getStaticText12() { - return staticText12; - } - - public void setStaticText12(StaticText st) { - this.staticText12 = st; - } - - private StaticText txtCedula1 = new StaticText(); - - public StaticText getTxtCedula1() { - return txtCedula1; - } - - public void setTxtCedula1(StaticText st) { - this.txtCedula1 = st; - } - - private HtmlPanelGrid gridAcidentado1 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridAcidentado1() { - return gridAcidentado1; - } - - public void setGridAcidentado1(HtmlPanelGrid hpg) { - this.gridAcidentado1 = hpg; - } - - private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel8() { - return gridPanel8; - } - - public void setGridPanel8(HtmlPanelGrid hpg) { - this.gridPanel8 = hpg; - } - - private StaticText staticText13 = new StaticText(); - - public StaticText getStaticText13() { - return staticText13; - } - - public void setStaticText13(StaticText st) { - this.staticText13 = st; - } - - private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel9() { - return gridPanel9; - } - - public void setGridPanel9(HtmlPanelGrid hpg) { - this.gridPanel9 = hpg; - } - - private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel10() { - return gridPanel10; - } - - public void setGridPanel10(HtmlPanelGrid hpg) { - this.gridPanel10 = hpg; - } - - private StaticText staticText16 = new StaticText(); - - public StaticText getStaticText16() { - return staticText16; - } - - public void setStaticText16(StaticText st) { - this.staticText16 = st; - } - - private StaticText staticText17 = new StaticText(); - - public StaticText getStaticText17() { - return staticText17; - } - - public void setStaticText17(StaticText st) { - this.staticText17 = st; - } - - private StaticText staticText18 = new StaticText(); - - public StaticText getStaticText18() { - return staticText18; - } - - public void setStaticText18(StaticText st) { - this.staticText18 = st; - } - - private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel11() { - return gridPanel11; - } - - public void setGridPanel11(HtmlPanelGrid hpg) { - this.gridPanel11 = hpg; - } - - private StaticText staticText19 = new StaticText(); - - public StaticText getStaticText19() { - return staticText19; - } - - public void setStaticText19(StaticText st) { - this.staticText19 = st; - } - - private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel12() { - return gridPanel12; - } - - public void setGridPanel12(HtmlPanelGrid hpg) { - this.gridPanel12 = hpg; - } - - private StaticText staticText20 = new StaticText(); - - public StaticText getStaticText20() { - return staticText20; - } - - public void setStaticText20(StaticText st) { - this.staticText20 = st; - } - - private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel13() { - return gridPanel13; - } - - public void setGridPanel13(HtmlPanelGrid hpg) { - this.gridPanel13 = hpg; - } - - private StaticText staticText21 = new StaticText(); - - public StaticText getStaticText21() { - return staticText21; - } - - public void setStaticText21(StaticText st) { - this.staticText21 = st; - } - - private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel14() { - return gridPanel14; - } - - public void setGridPanel14(HtmlPanelGrid hpg) { - this.gridPanel14 = hpg; - } - - private StaticText staticText22 = new StaticText(); - - public StaticText getStaticText22() { - return staticText22; - } - - public void setStaticText22(StaticText st) { - this.staticText22 = st; - } - - private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel15() { - return gridPanel15; - } - - public void setGridPanel15(HtmlPanelGrid hpg) { - this.gridPanel15 = hpg; - } - - private StaticText staticText23 = new StaticText(); - - public StaticText getStaticText23() { - return staticText23; - } - - public void setStaticText23(StaticText st) { - this.staticText23 = st; - } - - private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel16() { - return gridPanel16; - } - - public void setGridPanel16(HtmlPanelGrid hpg) { - this.gridPanel16 = hpg; - } - - private StaticText staticText24 = new StaticText(); - - public StaticText getStaticText24() { - return staticText24; - } - - public void setStaticText24(StaticText st) { - this.staticText24 = st; - } - - private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel17() { - return gridPanel17; - } - - public void setGridPanel17(HtmlPanelGrid hpg) { - this.gridPanel17 = hpg; - } - - private StaticText staticText25 = new StaticText(); - - public StaticText getStaticText25() { - return staticText25; - } - - public void setStaticText25(StaticText st) { - this.staticText25 = st; - } - - private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel18() { - return gridPanel18; - } - - public void setGridPanel18(HtmlPanelGrid hpg) { - this.gridPanel18 = hpg; - } - - private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel19() { - return gridPanel19; - } - - public void setGridPanel19(HtmlPanelGrid hpg) { - this.gridPanel19 = hpg; - } - - private StaticText staticText26 = new StaticText(); - - public StaticText getStaticText26() { - return staticText26; - } - - public void setStaticText26(StaticText st) { - this.staticText26 = st; - } - - private HtmlPanelGrid gridImages = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridImages() { - return gridImages; - } - - public void setGridImages(HtmlPanelGrid hpg) { - this.gridImages = hpg; - } - - private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel20() { - return gridPanel20; - } - - public void setGridPanel20(HtmlPanelGrid hpg) { - this.gridPanel20 = hpg; - } - - private StaticText staticText27 = new StaticText(); - - public StaticText getStaticText27() { - return staticText27; - } - - public void setStaticText27(StaticText st) { - this.staticText27 = st; - } - - private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); - - public HtmlPanelGrid getGridPanel21() { - return gridPanel21; - } - - public void setGridPanel21(HtmlPanelGrid hpg) { - this.gridPanel21 = hpg; - } - - private StaticText staticText28 = new StaticText(); - - public StaticText getStaticText28() { - return staticText28; - } - - public void setStaticText28(StaticText st) { - this.staticText28 = st; - } - - private StaticText txtAccoes = new StaticText(); - - public StaticText getTxtAccoes() { - return txtAccoes; - } - - public void setTxtAccoes(StaticText st) { - this.txtAccoes = st; - } - - private StaticText txtConclusoes = new StaticText(); - - public StaticText getTxtConclusoes() { - return txtConclusoes; - } - - public void setTxtConclusoes(StaticText st) { - this.txtConclusoes = st; - } - - private StaticText txtDescricao = new StaticText(); - - public StaticText getTxtDescricao() { - return txtDescricao; - } - - public void setTxtDescricao(StaticText st) { - this.txtDescricao = st; - } - - private StaticText txtCausas = new StaticText(); - - public StaticText getTxtCausas() { - return txtCausas; - } - - public void setTxtCausas(StaticText st) { - this.txtCausas = st; - } - - private StaticText txtTestemunhas = new StaticText(); - - public StaticText getTxtTestemunhas() { - return txtTestemunhas; - } - - public void setTxtTestemunhas(StaticText st) { - this.txtTestemunhas = st; - } - - private StaticText txtCondicoes = new StaticText(); - - public StaticText getTxtCondicoes() { - return txtCondicoes; - } - - public void setTxtCondicoes(StaticText st) { - this.txtCondicoes = st; - } - - private StaticText txtSuperior = new StaticText(); - - public StaticText getTxtSuperior() { - return txtSuperior; - } - - public void setTxtSuperior(StaticText st) { - this.txtSuperior = st; - } - - private StaticText txtSubstancias = new StaticText(); - - public StaticText getTxtSubstancias() { - return txtSubstancias; - } - - public void setTxtSubstancias(StaticText st) { - this.txtSubstancias = st; - } - - private StaticText txtTarefa = new StaticText(); - - public StaticText getTxtTarefa() { - return txtTarefa; - } - - public void setTxtTarefa(StaticText st) { - this.txtTarefa = st; - } - - private StaticText txtHorasTurno = new StaticText(); - - public StaticText getTxtHorasTurno() { - return txtHorasTurno; - } - - public void setTxtHorasTurno(StaticText st) { - this.txtHorasTurno = st; - } - - private StaticText txtSeccao = new StaticText(); - - public StaticText getTxtSeccao() { - return txtSeccao; - } - - public void setTxtSeccao(StaticText st) { - this.txtSeccao = st; - } - - private StaticText txtLocal = new StaticText(); - - public StaticText getTxtLocal() { - return txtLocal; - } - - public void setTxtLocal(StaticText st) { - this.txtLocal = st; - } - - private StaticText txtTecnicoSuperior = new StaticText(); - - public StaticText getTxtTecnicoSuperior() { - return txtTecnicoSuperior; - } - - public void setTxtTecnicoSuperior(StaticText st) { - this.txtTecnicoSuperior = st; - } - - private StaticText txtMedicoTrabalho = new StaticText(); - - public StaticText getTxtMedicoTrabalho() { - return txtMedicoTrabalho; - } - - public void setTxtMedicoTrabalho(StaticText st) { - this.txtMedicoTrabalho = st; - } - - //Construct a new Page bean instance.
- */ - public ViewAnaliseAcidenteTrabalho() { - } - - /** - *Callback method that is called whenever a page is navigated to, - * either directly via a URL, or indirectly via page navigation. - * Customize this method to acquire resources that will be needed - * for event handlers and lifecycle methods, whether or not this - * page is performing post back processing.
- * - *Note that, if the current request is a postback, the property - * values of the components do not represent any - * values submitted with this request. Instead, they represent the - * property values that were saved for this view when it was rendered.
- */ - public void init() { - // Perform initializations inherited from our superclass - super.init(); - // Perform application initialization that must complete - // *before* managed components are initialized - // TODO - add your own initialiation code here - - //Callback method that is called after the component tree has been - * restored, but before any event processing takes place. This method - * will only be called on a postback request that - * is processing a form submit. Customize this method to allocate - * resources that will be required in your event handlers.
- */ - public void preprocess() { - } - - /** - *Callback method that is called just before rendering takes place. - * This method will only be called for the page that - * will actually be rendered (and not, for example, on a page that - * handled a postback and then navigated to a different page). Customize - * this method to allocate resources that will be required for rendering - * this page.
- */ - public void prerender() { - } - - /** - *Callback method that is called after rendering is completed for
- * this request, if init() was called (regardless of whether
- * or not this was the page that was actually rendered). Customize this
- * method to release resources acquired in the init(),
- * preprocess(), or prerender() methods (or
- * acquired during execution of an event handler).
Return a reference to the scoped data bean.
- */ - protected SessionBean1 getSessionBean1() { - return (SessionBean1)getBean("SessionBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected RequestBean1 getRequestBean1() { - return (RequestBean1)getBean("RequestBean1"); - } - - /** - *Return a reference to the scoped data bean.
- */ - protected ApplicationBean1 getApplicationBean1() { - return (ApplicationBean1)getBean("ApplicationBean1"); - } - - public String lnkLogout_action() { - // TODO: Replace with your code - - javax.servlet.http.HttpSession session = - (javax.servlet.http.HttpSession) getExternalContext().getSession(true); - session.invalidate(); - return "login"; - } - - public String lnkNome_action() { - // TODO: Replace with your code - - return null; - } - - public String lnkDataNascimento_action() { - // TODO: Replace with your code - - return null; - } - - private void initializePage() - { - fillPage(); - fillImages(); - } - - private void fillPage() - { - AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); - - fillSIPRP(a); - - AnalisesDataProvider adp = new AnalisesDataProvider(); - Acidentado ac = null; - try - { - ac = adp.getAcidentado(a.getAcidentado_id()); - //txtTrabalhador.setText(ac.getNome()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - - fillAcidentado(ac); - - fillDadosAcidenteSeg(a); - - fillDadosAcidenteRh(a); - - fillRecomendacoesHs(a); - - fillMedidasRh(a); - - fillMedico(a); - } - - private void fillSIPRP(AnaliseAcidente a) - { - UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); - try - { - Utilizador u = udp.getUtilizador(a.getTecnico_saude_id()); - txtTecnicoSuperior.setText(Utils.unicodeToHTML(u.getNome())); - txtCap1.setText(u.getCap()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - try - { - Utilizador u = udp.getUtilizador(a.getMedico_id()); - txtMedicoTrabalho.setText(Utils.unicodeToHTML(u.getNome())); - txtCedula1.setText(u.getNumero_cedula()); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - - private void fillAcidentado(Acidentado a) - { - stNomeAcidentado.setText(a.getNome()); - //stDataNascimento.setText(a.getData_nascimento()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime()); - stDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - stBI.setText(a.getBilhete_identidade()); - stMorada.setText(a.getMorada()); - String cod_postal1 = ""; - String cod_postal2 = ""; - try - { - cod_postal1 = a.getCod_postal().substring(0, 4); - } - catch(Exception ex){} - try - { - cod_postal2 = a.getCod_postal().substring(5, 8); - } - catch(Exception ex){} - - //String cod_postal1 = a.getCod_postal().substring(0, 4); - //String cod_postal2 = a.getCod_postal().substring(5, 8); - String cod_postal = cod_postal1 + "-" + cod_postal2 + " " + a.getLocalidade(); - stCodPostal.setText(cod_postal); - stContactoTelefonico.setText(a.getContacto_telefonico()); - //stDataAdmissao1.setText(a.getData_admissao()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_admissao().getTime()); - stDataAdmissao.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - stFuncao.setText(a.getFuncao()); - String turno_str = ""; - if(a.getTurno().matches("m")) - { - turno_str = "manhã"; - } - else if(a.getTurno().matches("t")) - { - turno_str += "tarde "; - } - if(a.getTurno().matches("n")) - { - turno_str += "noite"; - } - stTurno.setText(turno_str); - } - - private void fillDadosAcidenteSeg(AnaliseAcidente a) - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); - txtEmpresa.setText(utils.Utils.unicodeToHTML(nome_empresa)); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - try - { - txtEstabelecimento.setText(adp.getEstabelecimentoNome(a.getEstabelecimento_id())); - } - catch(Exception ex) - { - ex.printStackTrace(); - } - -// try -// { -// //Trabalhador t = adp.getTrabalhador(a.getTrabalhador_id()); -// Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); -// //txtDataNascimento.setText(ac.getData_nascimento()); -// try -// { -// java.util.Date ddate = new java.util.Date(ac.getData_nascimento().getTime()); -// txtDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); -// } -// catch(Exception ex){}; -// getSessionBean1().setAcidentado(ac); -// } -// catch(Exception ex) -// { -// ex.printStackTrace(); -// } - - txtTrabalhador.setText(a.getNome_acidentado()); -// txtNomeAcidentado.setText(a.getNome_acidentado()); - txtHorasTurno.setText(a.getHoras_turno().toString()); - txtSeccao.setText(a.getSeccao()); - txtLocal.setText(a.getLocal_trabalho()); - txtTarefa.setText(a.getTarefa()); - txtSubstancias.setText(a.getSubstancias()); - txtSuperior.setText(a.getSuperior_hierarquico()); - txtCondicoes.setText(a.getCondicoes()); - txtTestemunhas.setText(a.getTestemunhas()); - txtCausas.setText(a.getCausas()); - txtDescricao.setText(a.getDescricao()); - txtConclusoes.setText(a.getConclusoes()); - txtAccoes.setText(a.getAccoes()); - } - - private void fillDadosAcidenteRh(AnaliseAcidente a) - { - StaticText st = new StaticText(); - st.setId("stSHST"); - st.setEscape(false); - - StaticText st1 = new StaticText(); - st1.setId("stColaborador"); - st1.setEscape(false); - - StaticText st2 = new StaticText(); - st2.setId("stColaboradores"); - st2.setEscape(false); - - if(a.getFormacao_shst().matches("y")) - { - st.setText("O colaborador teve formação em SHST."); - gridSHST.getChildren().add(st); - } - else - { - st.setText("O colaborador não teve formação em SHST."); - gridSHST.getChildren().add(st); - HtmlPanelGrid grd = new HtmlPanelGrid(); - grd.setId("grdMotivo"); - grd.setColumns(2); - grd.setColumnClasses("gridColLeft5, gridColLeft95"); - StaticText s = new StaticText(); - s.setId("stMotivo"); - s.setEscape(false); - s.setText("Motivo: "); - grd.getChildren().add(s); - s = new StaticText(); - s.setId("stMotivo1"); - s.setEscape(false); - s.setText(a.getFormacao_shst_nao_porque()); - grd.getChildren().add(s); - gridSHST.getChildren().add(grd); - } - - - if(a.getOutros_acidentes_com_colaborador().matches("y")) - { - st1.setText("Verificaram-se outras ocurrências/inicidências no mesmo posto de trabalho com o colaborador acidentado."); - gridColaborador.getChildren().add(st1); - boolean booShow = false; - boolean booShow1 = false; - boolean booShow2 = false; - if(a.getNr_acidentes_com_colaborador() != null) - { - booShow = true; - booShow1 = true; - } - if(a.getNr_relatorio_acidente_colaborador1() != null || a.getNr_relatorio_acidente_colaborador2() != null || a.getNr_relatorio_acidente_colaborador3() != null || a.getNr_relatorio_acidente_colaborador4() != null) - { - booShow = true; - booShow2 = true; - } - - if(booShow) - { - HtmlPanelGrid grd = new HtmlPanelGrid(); - grd.setId("grdColaboradorS"); - grd.setColumns(2); - grd.setColumnClasses("gridColLeft15, gridColLeft85"); - if(booShow1) - { - PanelGroup pg = new PanelGroup(); - StaticText s = new StaticText(); - s.setId("s100"); - s.setEscape(false); - s.setText("Total: "); - pg.getChildren().add(s); - s = new StaticText(); - s.setId("s101"); - s.setEscape(false); - s.setText(a.getNr_acidentes_com_colaborador().toString()); - pg.getChildren().add(s); - grd.getChildren().add(pg); - } - if(booShow2) - { - PanelGroup pg = new PanelGroup(); - StaticText s = new StaticText(); - s.setId("s102"); - s.setEscape(false); - s.setText(" Relatórios de acidente nº: "); - pg.getChildren().add(s); - if(a.getNr_relatorio_acidente_colaborador1() != null) - { - if(a.getNr_relatorio_acidente_colaborador1().intValue() > 0) - { - s = new StaticText(); - s.setId("s103"); - s.setEscape(false); - s.setText(a.getNr_relatorio_acidente_colaborador1()); - pg.getChildren().add(s); - } - } - if(a.getNr_relatorio_acidente_colaborador2() != null) - { - if(a.getNr_relatorio_acidente_colaborador2().intValue() > 0) - { - s = new StaticText(); - s.setId("s104"); - s.setEscape(false); - s.setText(" " + a.getNr_relatorio_acidente_colaborador2()); - pg.getChildren().add(s); - } - - } - if(a.getNr_relatorio_acidente_colaborador3() != null) - { - if(a.getNr_relatorio_acidente_colaborador3().intValue() > 0) - { - s = new StaticText(); - s.setId("s105"); - s.setEscape(false); - s.setText(" " + a.getNr_relatorio_acidente_colaborador3()); - pg.getChildren().add(s); - } - } - if(a.getNr_relatorio_acidente_colaborador4() != null) - { - if(a.getNr_relatorio_acidente_colaborador4().intValue() > 0) - { - s = new StaticText(); - s.setId("s106"); - s.setEscape(false); - s.setText(" " + a.getNr_relatorio_acidente_colaborador4()); - pg.getChildren().add(s); - } - } - grd.getChildren().add(pg); - } - gridColaborador.getChildren().add(grd); - } - - } - else - { - st1.setText("Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado."); - gridColaborador.getChildren().add(st1); - } - - if(a.getAcidentes_outros_colaboradores().matches("y")) - { - st2.setText("Verificaram-se ocorrências/incidentes semelhantes com outros colaboradores."); - gridColaboradores.getChildren().add(st2); - boolean booShow = false; - boolean booShow1 = false; - boolean booShow2 = false; - if(a.getNr_acidentes_outros_colaboradores() != null) - { - booShow = true; - booShow1 = true; - } - if(a.getNr_relatorio_acidente_outros_colaboradores1() != null || a.getNr_relatorio_acidente_outros_colaboradores2() != null || a.getNr_relatorio_acidente_outros_colaboradores3() != null || a.getNr_relatorio_acidente_outros_colaboradores4() != null) - { - booShow = true; - booShow2 = true; - } - - if(booShow) - { - HtmlPanelGrid grd = new HtmlPanelGrid(); - grd.setId("grdColaboradoresS"); - grd.setColumns(2); - grd.setColumnClasses("gridColLeft15, gridColLeft85"); - if(booShow1) - { - PanelGroup pg = new PanelGroup(); - StaticText s = new StaticText(); - s.setId("s200"); - s.setEscape(false); - s.setText("Total: "); - pg.getChildren().add(s); - s = new StaticText(); - s.setId("s201"); - s.setEscape(false); - s.setText(a.getNr_acidentes_outros_colaboradores()); - pg.getChildren().add(s); - grd.getChildren().add(pg); - } - if(booShow2) - { - PanelGroup pg = new PanelGroup(); - StaticText s = new StaticText(); - s.setId("s202"); - s.setEscape(false); - s.setText(" Relatórios de acidente nº: "); - pg.getChildren().add(s); - if(a.getNr_relatorio_acidente_outros_colaboradores1() != null) - { - if(a.getNr_relatorio_acidente_outros_colaboradores1().intValue() > 0) - { - s = new StaticText(); - s.setId("s203"); - s.setEscape(false); - s.setText(a.getNr_relatorio_acidente_outros_colaboradores1()); - pg.getChildren().add(s); - } - } - if(a.getNr_relatorio_acidente_outros_colaboradores2() != null) - { - if(a.getNr_relatorio_acidente_outros_colaboradores2().intValue() > 0) - { - s = new StaticText(); - s.setId("s204"); - s.setEscape(false); - s.setText(" " + a.getNr_relatorio_acidente_outros_colaboradores2()); - pg.getChildren().add(s); - } - } - if(a.getNr_relatorio_acidente_outros_colaboradores3() != null) - { - if(a.getNr_relatorio_acidente_outros_colaboradores3().intValue() > 0) - { - s = new StaticText(); - s.setId("s205"); - s.setEscape(false); - s.setText(" " + a.getNr_relatorio_acidente_outros_colaboradores3()); - pg.getChildren().add(s); - } - } - if(a.getNr_relatorio_acidente_outros_colaboradores4() != null) - { - if(a.getNr_relatorio_acidente_outros_colaboradores4().intValue() > 0) - { - s = new StaticText(); - s.setId("s206"); - s.setEscape(false); - s.setText(" " + a.getNr_relatorio_acidente_outros_colaboradores4()); - pg.getChildren().add(s); - } - } - grd.getChildren().add(pg); - } - gridColaboradores.getChildren().add(grd); - } - } - else - { - st2.setText("Não se verificaram ocurrências/inicidentes com outros colaboradores."); - gridColaboradores.getChildren().add(st1); - } - } - - private void fillRecomendacoesHs(AnaliseAcidente a) - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - ArrayList list = adp.getRecomendacoesByAnalise(a.getId()); - ListIterator iter = list.listIterator(); - int seq = 1; - while(iter.hasNext()) - { - Recomendacao r = (Recomendacao) iter.next(); - HtmlPanelGrid grd = new HtmlPanelGrid(); - grd.setId("grdRecomendacaoView" + seq); - grd.setColumns(2); - grd.setColumnClasses("gridColLeft5, gridColLeft95"); - grd.setStyle("width: 100%"); - - StaticText st = new StaticText(); - st.setId("stNrRecomendacaoView" + seq); - st.setText(seq + " ."); - st.setStyle("width: 24px"); - grd.getChildren().add(st); - - st = new StaticText(); - st.setId("stRecomendacaoView" + seq); - st.setText(r.getRecomendacao()); - st.setStyle("width: 24px"); - grd.getChildren().add(st); - - gridRecomendacoesView.getChildren().add(grd); - seq++; - } - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - - private void fillMedidasRh(AnaliseAcidente a) - { - AnalisesDataProvider adp = new AnalisesDataProvider(); - try - { - ArrayList list = adp.getMedidasByAnalise(a.getId()); - ListIterator iter = list.listIterator(); - int seq = 1; - while(iter.hasNext()) - { - Medida m = (Medida) iter.next(); - HtmlPanelGrid grd = new HtmlPanelGrid(); - grd.setId("grdMedidaView" + seq); - grd.setColumns(2); - grd.setColumnClasses("gridColLeft5, gridColLeft95"); - grd.setStyle("width: 100%"); - - StaticText st = new StaticText(); - st.setId("stNrMedidaView" + seq); - st.setText(seq + " ."); - st.setStyle("width: 24px"); - grd.getChildren().add(st); - - st = new StaticText(); - st.setId("stMedidaView" + seq); - st.setText(m.getMedida()); - st.setStyle("width: 24px"); - grd.getChildren().add(st); - - gridMedidasView.getChildren().add(grd); - seq++; - } - } - catch(Exception ex) - { - ex.printStackTrace(); - } - } - - private void fillMedico(AnaliseAcidente a) - { - - PanelGroup pg = null; - StaticText st = null; - HtmlPanelGrid grd = null; - ImageComponent img = null; - //LESAO : - - if(a.getLesao_cabeca().matches("y")) - { - st = new StaticText(); - st.setId("stLesaoCabeca"); - st.setEscape(false); - st.setText("Cabeça"); - gridLesao.getChildren().add(st); - } - - if(a.getLesao_pescoco().matches("y")) - { - st = new StaticText(); - st.setId("stLesaoPescoco"); - st.setEscape(false); - st.setText("Pescoço"); - gridLesao.getChildren().add(st); - } - - if(a.getLesao_tronco().matches("y")) - { - st = new StaticText(); - st.setId("stLesaoTronco"); - st.setEscape(false); - st.setText("Tronco"); - gridLesao.getChildren().add(st); - } - - grd = new HtmlPanelGrid(); - grd.setId("gridLesaoMembros"); - grd.setColumns(2); - grd.setColumnClasses("gridColLeft"); - if(a.getLesao_membro_sup_dir().matches("y")) - { - st = new StaticText(); - st.setId("stLesaoMembroSupDir"); - st.setEscape(false); - st.setText("Membro Superior Direito"); - grd.getChildren().add(st); - st = new StaticText(); - st.setId("stEspecif1"); - st.setEscape(false); - st.setText(a.getEspecif1()); - grd.getChildren().add(st); - } - - if(a.getLesao_membro_sup_esq().matches("y")) - { - st = new StaticText(); - st.setId("stLesaoMembroSupEsq"); - st.setEscape(false); - st.setText("Membro Superior Esquerdo"); - grd.getChildren().add(st); - st = new StaticText(); - st.setId("stEspecif2"); - st.setEscape(false); - st.setText(a.getEspecif2()); - grd.getChildren().add(st); - } - - if(a.getLesao_membro_inf_dir().matches("y")) - { - st = new StaticText(); - st.setId("stLesaoMembroInfDir"); - st.setEscape(false); - st.setText("Membro Inferior Direito"); - grd.getChildren().add(st); - st = new StaticText(); - st.setId("stEspecif3"); - st.setEscape(false); - st.setText(a.getEspecif3()); - grd.getChildren().add(st); - } - - if(a.getLesao_membro_inf_esq().matches("y")) - { - st = new StaticText(); - st.setId("stLesaoMembroInfEsq"); - st.setEscape(false); - st.setText("Membro Inferior Esquerdo"); - grd.getChildren().add(st); - st = new StaticText(); - st.setId("stEspecif4"); - st.setEscape(false); - st.setText(a.getEspecif4()); - grd.getChildren().add(st); - } - if(grd.getChildren().size() > 0) - { - gridLesao.getChildren().add(grd); - } - - if(a.getTipo_lesao().trim().length() > 0 ) - { - pg = new PanelGroup(); - pg.setId("pgTipoLesao"); - st = new StaticText(); - st.setId("stTipoLesaoLbl"); - st.setEscape(false); - st.setText("Tipo de lesão: "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stTipoLesao"); - st.setEscape(false); - st.setText(a.getTipo_lesao()); - pg.getChildren().add(st); - gridLesao.getChildren().add(pg); - } - - //INCAPACIDADE : - pg = new PanelGroup(); - pg.setId("pgTipoIncapacidade"); - st = new StaticText(); - st.setId("stTipoIncapacidadeLbl1"); - st.setEscape(false); - st.setStyle("font-weight: bold"); - st.setText("Tipo de incapacidade: "); - if(a.getTipo_incapacidade().matches("t")) - { - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stTipoIncapacidade"); - st.setEscape(false); - st.setText("Temporária "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stTipoIncapacidadeLbl2"); - st.setStyle("font-weight: bold"); - st.setEscape(false); - st.setText(" Coeficiente de incapacidade: "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stCoefIncapacidade"); - st.setEscape(false); - st.setText(a.getCoef_incapacidade().toString() + "%"); - pg.getChildren().add(st); - } - else if(a.getTipo_incapacidade().matches("p")) - { - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stTipoIncapacidade"); - st.setEscape(false); - st.setText("Permanente "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stTipoIncapacidadeLbl2"); - st.setStyle("font-weight: bold"); - st.setEscape(false); - st.setText(" Coeficiente de incapacidade: "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stCoefIncapacidade"); - st.setEscape(false); - st.setText(a.getCoef_incapacidade().toString() + "%"); - pg.getChildren().add(st); - } - - if(pg.getChildren().size() > 0) - { - gridIncapacidade.getChildren().add(pg); - - } - - pg = new PanelGroup(); - pg.setId("pgAvaliacaoIncapacidade"); - if(a.getData_aval_incapacidade() != null) - { - st = new StaticText(); - st.setId("stDataAvalIncapacidadeLbl1"); - st.setStyle("font-weight: bold"); - st.setEscape(false); - st.setText("Avaliação de incapacidade realizada em "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stDataAvalIncapacidade"); - st.setEscape(false); - //st.setText(a.getData_aval_incapacidade()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_aval_incapacidade().getTime()); - st.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - pg.getChildren().add(st); - } - - - if(a.getData_rev_incapacidade() != null) - { - st = new StaticText(); - st.setId("stDataRevIncapacidadeLbl1"); - st.setStyle("font-weight: bold"); - st.setEscape(false); - st.setText("Revisão de incapacidade em "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stDataRevIncapacidade"); - st.setEscape(false); - //st.setText(a.getData_rev_incapacidade()); - try - { - java.util.Date ddate = new java.util.Date(a.getData_rev_incapacidade().getTime()); - st.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - pg.getChildren().add(st); - } - - if(pg.getChildren().size() > 0) - { - gridIncapacidade.getChildren().add(pg); - } - - if(a.getPeriodo_incapacidade_a() != null || a.getPeriodo_incapacidade_de() != null) - { - pg = new PanelGroup(); - pg.setId("pgPeriodoIncapacidade"); - st = new StaticText(); - st.setId("stPeriodoIncapacidadeLbl1"); - st.setStyle("font-weight: bold"); - st.setEscape(false); - st.setText("Período de incapacidade temporária de "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stPeriodoIncapacidadeDe"); - st.setEscape(false); - //st.setText(a.getPeriodo_incapacidade_de()); - try - { - java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_de().getTime()); - st.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stPeriodoIncapacidadeLbl2"); - st.setStyle("font-weight: bold"); - st.setEscape(false); - st.setText(" a "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stPeriodoIncapacidadeA"); - st.setEscape(false); - //st.setText(a.getPeriodo_incapacidade_a()); - try - { - java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_a().getTime()); - st.setText(utils.Utils.dateToYYYYMMDD(ddate)); - } - catch(Exception ex){}; - pg.getChildren().add(st); - gridIncapacidade.getChildren().add(pg); - } - - - - //RESTRICOES - - if(a.getImg_flexao().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgFlexao"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - pg = new PanelGroup(); - pg.setId("pgImgFlexao"); - img = new ImageComponent(); - img.setId("imgRestricoes1000"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/fle1.gif"); - pg.getChildren().add(img); - img = new ImageComponent(); - img.setId("imgRestricoes1001"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/fle2.gif"); - pg.getChildren().add(img); - img = new ImageComponent(); - img.setId("imgRestricoes1002"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/fle3.gif"); - pg.getChildren().add(img); - img = new ImageComponent(); - img.setId("imgRestricoes1003"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/fle4.gif"); - pg.getChildren().add(img); - grd.getChildren().add(pg); - st = new StaticText(); - st.setId("stImgRestricaoLbl1"); - st.setEscape(false); - st.setText("Flexão"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_rot1().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgRot1"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes1005"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/rot1.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl2"); - st.setEscape(false); - st.setText("Flexão Lateral"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_rot2().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgRot2"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes1006"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/rot2.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl3"); - st.setEscape(false); - st.setText("Rotação"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ext1().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgExt1"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes1007"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ext1.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl4"); - st.setEscape(false); - st.setText("Extensão"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ext2().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgExt2"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - pg = new PanelGroup(); - pg.setId("pgImgExt2"); - img = new ImageComponent(); - img.setId("imgRestricoes1008"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ext2.gif"); - pg.getChildren().add(img); - img = new ImageComponent(); - img.setId("imgRestricoes1009"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ext3.gif"); - pg.getChildren().add(img); - img = new ImageComponent(); - img.setId("imgRestricoes1010"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ext4.gif"); - pg.getChildren().add(img); - grd.getChildren().add(pg); - st = new StaticText(); - st.setId("stImgRestricaoLbl5"); - st.setEscape(false); - st.setText("Flexão/Extensão Lateral + Rotação"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_cab1().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgCab1"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10011"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ca1.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl6"); - st.setEscape(false); - st.setText("Flexão"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_cab2().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgCab2"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10012"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ca2.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl7"); - st.setEscape(false); - st.setText("Extensão"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_cab3().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgCab3"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10013"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ca3.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl8"); - st.setEscape(false); - st.setText("Flexão Lateral"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_cab4().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgCab4"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10014"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ca4.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl9"); - st.setEscape(false); - st.setText("Rotação"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma1().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa1"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10015"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma1.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl10"); - st.setEscape(false); - st.setText("Poronação"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma2().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa2"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10016"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma2.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl11"); - st.setEscape(false); - st.setText("Supinação"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma3().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa3"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10017"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma3.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl12"); - st.setEscape(false); - st.setText("Flexão"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma4().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa4"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10018"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma4.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl13"); - st.setEscape(false); - st.setText("Extensão"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma5().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa5"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10019"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma5.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl14"); - st.setEscape(false); - st.setText("Desvio Ulnar"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma6().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa6"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10020"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma6.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl15"); - st.setEscape(false); - st.setText("Desvio Radial"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma7().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa7"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10021"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma7.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl16"); - st.setEscape(false); - st.setText("Pinça Digital"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma8().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa8"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10022"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma8.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl17"); - st.setEscape(false); - st.setText("Segurar objectos entre os dedos"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma9().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa9"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10023"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma9.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl18"); - st.setEscape(false); - st.setText("Dedos em extensão"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getImg_ma10().matches("y")) - { - grd = new HtmlPanelGrid(); - grd.setId("grdImgMa10"); - grd.setColumns(1); - grd.setColumnClasses("gridColCenter"); - grd.setStyleClass("centerBlock"); - - img = new ImageComponent(); - img.setId("imgRestricoes10024"); - img.setWidth(IMAGE_WIDTH); - img.setHeight(IMAGE_HEIGHT); - img.setUrl("/resources/images/medico/ma10.gif"); - grd.getChildren().add(img); - st = new StaticText(); - st.setId("stImgRestricaoLbl19"); - st.setEscape(false); - st.setText("Pega palmar"); - grd.getChildren().add(st); - gridImagesRestricoes.getChildren().add(grd); - } - - if(a.getRestricao_carga() != null) - { - if(a.getRestricao_carga().intValue() > 0) - { - pg = new PanelGroup(); - st = new StaticText(); - st.setId("stRestricaoCargaLbl"); - st.setEscape(false); - st.setText("Movimentação e manipulação de cargas com mais de "); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stRestricaoCargaKgs"); - st.setEscape(false); - st.setText(a.getRestricao_carga().toString()); - pg.getChildren().add(st); - st = new StaticText(); - st.setId("stRestricaoCargaLbl1"); - st.setEscape(false); - st.setText("Kg"); - pg.getChildren().add(st); - gridOutrasRestricoes.getChildren().add(pg); - } - - if(a.getRestricao_motricidade().matches("y")) - { - st = new StaticText(); - st.setId("stRestricaoMotricidadeLbl"); - st.setEscape(false); - st.setText("Operações que requeiram motricidade fina."); - gridOutrasRestricoes.getChildren().add(st); - } - - if(a.getRestricao_conducao().matches("y")) - { - st = new StaticText(); - st.setId("stRestricaoConducaoLbl"); - st.setEscape(false); - st.setText("Condução/interacção com veículos ou outros equipamentos."); - gridOutrasRestricoes.getChildren().add(st); - } - - if(a.getRestricao_vibracoes().matches("y")) - { - st = new StaticText(); - st.setId("stRestricaoVibracoesLbl"); - st.setEscape(false); - st.setText("Utilizaçõo de equipamentos/ferramentas que impliquem exposição a vibrações ou impactos."); - gridOutrasRestricoes.getChildren().add(st); - } - - if(a.getRestricao_outras().trim().length() > 0) - { - st = new StaticText(); - st.setId("stRestricaoOutras"); - st.setEscape(false); - st.setText(a.getRestricao_outras()); - gridOutrasRestricoes.getChildren().add(st); - } - - if(a.getMed_observ().trim().length() > 0) - { - stObservacoes.setText(a.getMed_observ()); - } - } - - } - - private void fillImages() - { - ServletContext theApplicationsServletContext = - (ServletContext) this.getExternalContext().getContext(); - try - { - String imageFileFolder = theApplicationsServletContext.getRealPath(IMAGE_URL + "/" + getSessionBean1().getCurrentAnalise().getId()); - File f = new File(imageFileFolder); - if( f.exists() ) - { - File files[] = f.listFiles(); - - for(int i=0;i