diff --git a/trunk/AnaliseAcidentesTrabalho/build.xml b/trunk/AnaliseAcidentesTrabalho/build.xml new file mode 100644 index 00000000..749e498d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/build.xml @@ -0,0 +1,66 @@ + + + + + + Builds, tests, and runs the project AnaliseAcidentesTrabalho. + + + diff --git a/trunk/AnaliseAcidentesTrabalho/catalog.xml b/trunk/AnaliseAcidentesTrabalho/catalog.xml new file mode 100644 index 00000000..e69de29b diff --git a/trunk/AnaliseAcidentesTrabalho/jars/activation.jar b/trunk/AnaliseAcidentesTrabalho/jars/activation.jar new file mode 100755 index 00000000..589b6749 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/jars/activation.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/jars/mail.jar b/trunk/AnaliseAcidentesTrabalho/jars/mail.jar new file mode 100755 index 00000000..e6f70832 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/jars/mail.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.0-315.jdbc3.jar b/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.0-315.jdbc3.jar new file mode 100755 index 00000000..777b3040 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.0-315.jdbc3.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.1-407.jdbc3.jar b/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.1-407.jdbc3.jar new file mode 100755 index 00000000..ddf17862 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.1-407.jdbc3.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.2-506.jdbc4.jar b/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.2-506.jdbc4.jar new file mode 100644 index 00000000..260a95eb Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/jars/postgresql-8.2-506.jdbc4.jar differ diff --git a/trunk/AnaliseAcidentesTrabalho/nbproject/ant-deploy.xml b/trunk/AnaliseAcidentesTrabalho/nbproject/ant-deploy.xml new file mode 100644 index 00000000..bcfeee44 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/nbproject/ant-deploy.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/nbproject/build-impl.xml b/trunk/AnaliseAcidentesTrabalho/nbproject/build-impl.xml new file mode 100644 index 00000000..30bc61b4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/nbproject/build-impl.xml @@ -0,0 +1,739 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/nbproject/genfiles.properties b/trunk/AnaliseAcidentesTrabalho/nbproject/genfiles.properties new file mode 100644 index 00000000..dac81cc4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=2ba63215 +build.xml.script.CRC32=ab1471e9 +build.xml.stylesheet.CRC32=95be3570 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=2ba63215 +nbproject/build-impl.xml.script.CRC32=cae04df0 +nbproject/build-impl.xml.stylesheet.CRC32=ac43bae1 diff --git a/trunk/AnaliseAcidentesTrabalho/nbproject/project.properties b/trunk/AnaliseAcidentesTrabalho/nbproject/project.properties new file mode 100644 index 00000000..2ae3bd37 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/nbproject/project.properties @@ -0,0 +1,88 @@ +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.ear.classes.dir=${build.ear.web.dir}/WEB-INF/classes +build.ear.web.dir=${build.dir}/web +build.generated.dir=${build.dir}/generated +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +creator=3.0 +debug.classpath=${javac.classpath}:${build.classes.dir}:${build.ear.classes.dir} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +file.reference.activation.jar=jars/activation.jar +file.reference.itext-2.0.5.jar=../../../Download/iText205/itext-2.0.5.jar +file.reference.mail.jar=jars/mail.jar +file.reference.postgresql-8.2-506.jdbc4.jar=jars/postgresql-8.2-506.jdbc4.jar +j2ee.platform=1.4 +j2ee.server.type=Tomcat55 +jar.compress=false +javac.classpath=\ + ${libs.jsf-designtime.classpath}:\ + ${libs.jsfsupport-designtime.classpath}:\ + ${libs.webui-designtime.classpath}:\ + ${libs.jdbcsupport-designtime.classpath}:\ + ${libs.theme-default.classpath}:\ + ${libs.jstl11.classpath}:\ + ${file.reference.activation.jar}:\ + ${file.reference.mail.jar}:\ + ${file.reference.postgresql-8.2-506.jdbc4.jar}:\ + ${file.reference.itext-2.0.5.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.source=1.4 +javac.target=1.4 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jspcompilation.classpath=${jspc.classpath}:${javac.classpath} +lib.dir=${web.docbase.dir}/WEB-INF/lib +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running class with main method +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional=\ + ${libs.jsf-runtime.classpath}:\ + ${libs.jsfsupport-runtime.classpath}:\ + ${libs.webui-runtime.classpath}:\ + ${libs.jdbcsupport-runtime.classpath}:\ + ${libs.exceptionhandler-runtime.classpath}:\ + ${libs.theme-default.classpath}:\ + ${libs.jstl11.classpath} +war.ear.name=AnaliseAcidentesTrabalho.war +war.name=AnaliseAcidentesTrabalho.war +war.package=true +web.docbase.dir=web +webinf.dir=web/WEB-INF diff --git a/trunk/AnaliseAcidentesTrabalho/nbproject/project.xml b/trunk/AnaliseAcidentesTrabalho/nbproject/project.xml new file mode 100644 index 00000000..11fbc246 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/nbproject/project.xml @@ -0,0 +1,83 @@ + + + org.netbeans.modules.web.project + + + + AnaliseAcidentesTrabalho + 1.6 + + + ${libs.jsf-designtime.classpath} + + + ${libs.jsfsupport-designtime.classpath} + + + ${libs.webui-designtime.classpath} + + + ${libs.jdbcsupport-designtime.classpath} + + + ${libs.theme-default.classpath} + + + ${libs.jstl11.classpath} + + + ${file.reference.activation.jar} + WEB-INF/lib + + + ${file.reference.mail.jar} + WEB-INF/lib + + + ${file.reference.postgresql-8.2-506.jdbc4.jar} + WEB-INF/lib + + + ${file.reference.itext-2.0.5.jar} + WEB-INF/lib + + + + + ${libs.jsf-runtime.classpath} + WEB-INF/lib + + + ${libs.jsfsupport-runtime.classpath} + WEB-INF/lib + + + ${libs.webui-runtime.classpath} + WEB-INF/lib + + + ${libs.jdbcsupport-runtime.classpath} + WEB-INF/lib + + + ${libs.exceptionhandler-runtime.classpath} + WEB-INF/lib + + + ${libs.theme-default.classpath} + WEB-INF/lib + + + ${libs.jstl11.classpath} + WEB-INF/lib + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/src/conf/MANIFEST.MF b/trunk/AnaliseAcidentesTrabalho/src/conf/MANIFEST.MF new file mode 100644 index 00000000..59499bce --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Acidentado.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Acidentado.java new file mode 100644 index 00000000..503385c7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Acidentado.java @@ -0,0 +1,186 @@ +/* + * Acidentado.java + * + * Created on October 16, 2007, 2:36 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +/** + * + * @author lluis + */ +public class Acidentado { + private Integer id; + private String nome; + private java.sql.Date data_nascimento; + private String bilhete_identidade; + private String morada; + private String cod_postal; + private String localidade; + private String contacto_telefonico; + private java.sql.Date data_admissao; + private String funcao; + private String turno; + private Integer trabalhador_id; + private String numero_mecanografico; + private String nome_superior_hierarquico; + private String email_superior_hierarquico; + private String estabelecimento_origem; + private java.sql.Date data_email_superior_hierarquico; + /** Creates a new instance of Acidentado */ + public Acidentado() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + 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 getBilhete_identidade() { + return bilhete_identidade; + } + + public void setBilhete_identidade(String bilhete_identidade) { + this.bilhete_identidade = bilhete_identidade; + } + + public String getMorada() { + return morada; + } + + public void setMorada(String morada) { + this.morada = morada; + } + + public String getCod_postal() { + return cod_postal; + } + + public void setCod_postal(String cod_postal) { + this.cod_postal = cod_postal; + } + + public String getLocalidade() { + return localidade; + } + + public void setLocalidade(String localidade) { + this.localidade = localidade; + } + + public String getContacto_telefonico() { + return contacto_telefonico; + } + + public void setContacto_telefonico(String contacto_telefonico) { + this.contacto_telefonico = contacto_telefonico; + } + + 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 getFuncao() { + return funcao; + } + + public void setFuncao(String funcao) { + this.funcao = funcao; + } + + public Integer getTrabalhador_id() { + return trabalhador_id; + } + + public void setTrabalhador_id(Integer trabalhador_id) { + this.trabalhador_id = trabalhador_id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getTurno() { + return turno; + } + + public void setTurno(String turno) { + this.turno = turno; + } + + public String getNumero_mecanografico() { + return numero_mecanografico; + } + + public void setNumero_mecanografico(String numero_mecanografico) { + this.numero_mecanografico = numero_mecanografico; + } + + public String getNome_superior_hierarquico() { + if(nome_superior_hierarquico == null) + { + return ""; + } + return nome_superior_hierarquico; + } + + public void setNome_superior_hierarquico(String nome_superior_hierarquico) { + this.nome_superior_hierarquico = nome_superior_hierarquico; + } + + public String getEmail_superior_hierarquico() { + if(email_superior_hierarquico == null) + { + return ""; + } + return email_superior_hierarquico; + } + + public void setEmail_superior_hierarquico(String email_superior_hierarquico) { + this.email_superior_hierarquico = email_superior_hierarquico; + } + + public String getEstabelecimento_origem() { + if(estabelecimento_origem == null) + { + return ""; + } + return estabelecimento_origem; + } + + public void setEstabelecimento_origem(String estabelecimento_origem) { + this.estabelecimento_origem = estabelecimento_origem; + } + + public java.sql.Date getData_email_superior_hierarquico() { + return data_email_superior_hierarquico; + } + + public void setData_email_superior_hierarquico(java.sql.Date data_email_superior_hierarquico) { + this.data_email_superior_hierarquico = data_email_superior_hierarquico; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidente.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidente.java new file mode 100644 index 00000000..942075d2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidente.java @@ -0,0 +1,1039 @@ +/* + * AnaliseAcidente.java + * + * Created on September 20, 2007, 1:34 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package analiseacidentestrabalho; + +import java.sql.Date; +import java.sql.Time; + +/** + * + * @author lluis + */ +public class AnaliseAcidente { + private Integer id; + private Integer nr; + private String analise_nr; + private Date data_acidente; + private Integer acidentado_id; + private String nome_acidentado; + private String numero_mecanografico; + private Integer empresa_id; + private Integer estabelecimento_id; + private String nome_estabelecimento; + private Integer estado; + private Integer estado_assinatura; + private String fase; + + private String morada; + private String telefone; + private Integer horas_turno; + private String seccao; + private Integer departamento_id; + private Integer seccao_id; + private String local_trabalho; + private String tarefa; + private String substancias; +// private String superior_hierarquico; + private String condicoes; + private String testemunhas; + private Integer causas; + private String descricao; + private String conclusoes; + private String accoes; + + private Time hora_acidente; + private String formacao_shst; + private String formacao_shst_nao_porque; + private String outros_acidentes_com_colaborador; + private Integer nr_acidentes_com_colaborador; + private Integer nr_relatorio_acidente_colaborador1; + private Integer nr_relatorio_acidente_colaborador2; + private Integer nr_relatorio_acidente_colaborador3; + private Integer nr_relatorio_acidente_colaborador4; + private String acidentes_outros_colaboradores; + private Integer nr_acidentes_outros_colaboradores; + private Integer nr_relatorio_acidente_outros_colaboradores1; + private Integer nr_relatorio_acidente_outros_colaboradores2; + private Integer nr_relatorio_acidente_outros_colaboradores3; + private Integer nr_relatorio_acidente_outros_colaboradores4; + + private String lesao_cabeca; + private String lesao_pescoco; + private String lesao_tronco; + private String lesao_membro_sup_dir; + private String lesao_membro_sup_esq; + private String lesao_membro_inf_dir; + private String lesao_membro_inf_esq; + private String especif1; + private String especif2; + private String especif3; + private String especif4; + private String tipo_lesao; + private String tipo_incapacidade; // 't' ou 'p' + private Integer coef_incapacidade = null; + private Date data_aval_incapacidade; + private Date data_rev_incapacidade; + private Date periodo_incapacidade_de; + private Date periodo_incapacidade_a; + private String img_flexao; + private String img_ext1; + private String img_ext2; + private String img_cab2; + private String img_cab3; + private String img_ma2; + private String img_ma3; + private String img_ma5; + private String img_ma6; + private String img_ma8; + private String img_ma10; + + private String img_rot1; + private String img_rot2; + private String img_cab1; + private String img_cab4; + private String img_ma1; + private String img_ma4; + private String img_ma7; + private String img_ma9; + + private Integer restricao_carga; + private String restricao_motricidade; + private String restricao_conducao; + private String restricao_vibracoes; + private String restricao_outras; + private String med_observ; + + private Integer medico_id; + private Integer tecnico_saude_id; + + private String ass_consolidacao; + private String ass_resp_seg; + private String ass_resp_rh; + + private Date data_consolidacao; + private Date data_assinatura_seg; + private Date data_assinatura_rh; + + private String nome_resp_seg; + private String nome_resp_rh; + + private String correcao; + private Integer estado_antes_correcao; + private String observacoes_correcao; + + private String ass_superior; + private String nome_superior; + private Date data_assinatura_superior; + + private String averiguador; + private String averiguacao_posterior; + private String averiguacao_obs; + + private String nome_resp_consolidacao; + private Date data_inicio_processo; + + + /** Creates a new instance of AnaliseAcidente */ + public AnaliseAcidente() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Date getData_acidente() { + return data_acidente; + } + + public void setData_acidente(Date data_acidente) { + this.data_acidente = data_acidente; + } + + public Integer getAcidentado_id() { + return acidentado_id; + } + + public void setAcidentado_id(Integer acidentado_id) { + this.acidentado_id = acidentado_id; + } + + public Integer getEstado() { + return estado; + } + + public void setEstado(Integer estado) { + this.estado = estado; + } + + public String getNome_acidentado() { + return nome_acidentado; + } + + public void setNome_acidentado(String nome_acidentado) { + this.nome_acidentado = nome_acidentado; + } + + public Integer getEstabelecimento_id() { + return estabelecimento_id; + } + + public void setEstabelecimento_id(Integer estabelecimento_id) { + this.estabelecimento_id = estabelecimento_id; + } + + public Integer getNr() { + return nr; + } + + public void setNr(Integer nr) { + this.nr = nr; + } + + public String getMorada() { + return morada; + } + + public void setMorada(String morada) { + this.morada = morada; + } + + public String getTelefone() { + return telefone; + } + + public void setTelefone(String telefone) { + this.telefone = telefone; + } + + public Integer getHoras_turno() { + return horas_turno; + } + + public void setHoras_turno(Integer horas_turno) { + this.horas_turno = horas_turno; + } + + public String getSeccao() { + return seccao; + } + + public void setSeccao(String seccao) { + this.seccao = seccao; + } + + public String getLocal_trabalho() { + return local_trabalho; + } + + public void setLocal_trabalho(String local_trabalho) { + this.local_trabalho = local_trabalho; + } + + public String getTarefa() { + return tarefa; + } + + public void setTarefa(String tarefa) { + this.tarefa = tarefa; + } + + public String getSubstancias() { + return substancias; + } + + public void setSubstancias(String substancias) { + this.substancias = substancias; + } + +// public String getSuperior_hierarquico() { +// return superior_hierarquico; +// } +// +// public void setSuperior_hierarquico(String superior_hierarquico) { +// this.superior_hierarquico = superior_hierarquico; +// } + + public String getCondicoes() { + return condicoes; + } + + public void setCondicoes(String condicoes) { + this.condicoes = condicoes; + } + + public String getTestemunhas() { + return testemunhas; + } + + public void setTestemunhas(String testemunhas) { + this.testemunhas = testemunhas; + } + + public Integer getCausas() { + return causas; + } + + public void setCausas(Integer causas) { + this.causas = causas; + } + + public String getDescricao() { + return descricao; + } + + public void setDescricao(String descricao) { + this.descricao = descricao; + } + + public String getConclusoes() { + return conclusoes; + } + + public void setConclusoes(String conclusoes) { + this.conclusoes = conclusoes; + } + + public String getAccoes() { + return accoes; + } + + public void setAccoes(String accoes) { + this.accoes = accoes; + } + + public Time getHora_acidente() { + return hora_acidente; + } + + public void setHora_acidente(Time hora_acidente) { + this.hora_acidente = hora_acidente; + } + + public String getFormacao_shst() { + return formacao_shst; + } + + public void setFormacao_shst(String formacao_shst) { + this.formacao_shst = formacao_shst; + } + + public String getFormacao_shst_nao_porque() { + return formacao_shst_nao_porque; + } + + public void setFormacao_shst_nao_porque(String formacao_shst_nao_porque) { + this.formacao_shst_nao_porque = formacao_shst_nao_porque; + } + + public String getOutros_acidentes_com_colaborador() { + return outros_acidentes_com_colaborador; + } + + public void setOutros_acidentes_com_colaborador(String outros_acidentes_com_colaborador) { + this.outros_acidentes_com_colaborador = outros_acidentes_com_colaborador; + } + + public Integer getNr_acidentes_com_colaborador() { + return nr_acidentes_com_colaborador; + } + + public void setNr_acidentes_com_colaborador(Integer nr_acidentes_com_colaborador) { + this.nr_acidentes_com_colaborador = nr_acidentes_com_colaborador; + } + + public Integer getNr_relatorio_acidente_colaborador1() { + return nr_relatorio_acidente_colaborador1; + } + + public void setNr_relatorio_acidente_colaborador1(Integer nr_relatorio_acidente_colaborador1) { + this.nr_relatorio_acidente_colaborador1 = nr_relatorio_acidente_colaborador1; + } + + public Integer getNr_relatorio_acidente_colaborador2() { + return nr_relatorio_acidente_colaborador2; + } + + public void setNr_relatorio_acidente_colaborador2(Integer nr_relatorio_acidente_colaborador2) { + this.nr_relatorio_acidente_colaborador2 = nr_relatorio_acidente_colaborador2; + } + + public Integer getNr_relatorio_acidente_colaborador3() { + return nr_relatorio_acidente_colaborador3; + } + + public void setNr_relatorio_acidente_colaborador3(Integer nr_relatorio_acidente_colaborador3) { + this.nr_relatorio_acidente_colaborador3 = nr_relatorio_acidente_colaborador3; + } + + public Integer getNr_relatorio_acidente_colaborador4() { + return nr_relatorio_acidente_colaborador4; + } + + public void setNr_relatorio_acidente_colaborador4(Integer nr_relatorio_acidente_colaborador4) { + this.nr_relatorio_acidente_colaborador4 = nr_relatorio_acidente_colaborador4; + } + + public String getAcidentes_outros_colaboradores() { + return acidentes_outros_colaboradores; + } + + public void setAcidentes_outros_colaboradores(String acidentes_outros_colaboradores) { + this.acidentes_outros_colaboradores = acidentes_outros_colaboradores; + } + + public Integer getNr_acidentes_outros_colaboradores() { + return nr_acidentes_outros_colaboradores; + } + + public void setNr_acidentes_outros_colaboradores(Integer nr_acidentes_outros_colaboradores) { + this.nr_acidentes_outros_colaboradores = nr_acidentes_outros_colaboradores; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores1() { + return nr_relatorio_acidente_outros_colaboradores1; + } + + public void setNr_relatorio_acidente_outros_colaboradores1(Integer nr_relatorio_acidente_outros_colaboradores1) { + this.nr_relatorio_acidente_outros_colaboradores1 = nr_relatorio_acidente_outros_colaboradores1; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores2() { + return nr_relatorio_acidente_outros_colaboradores2; + } + + public void setNr_relatorio_acidente_outros_colaboradores2(Integer nr_relatorio_acidente_outros_colaboradores2) { + this.nr_relatorio_acidente_outros_colaboradores2 = nr_relatorio_acidente_outros_colaboradores2; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores3() { + return nr_relatorio_acidente_outros_colaboradores3; + } + + public void setNr_relatorio_acidente_outros_colaboradores3(Integer nr_relatorio_acidente_outros_colaboradores3) { + this.nr_relatorio_acidente_outros_colaboradores3 = nr_relatorio_acidente_outros_colaboradores3; + } + + public Integer getNr_relatorio_acidente_outros_colaboradores4() { + return nr_relatorio_acidente_outros_colaboradores4; + } + + public void setNr_relatorio_acidente_outros_colaboradores4(Integer nr_relatorio_acidente_outros_colaboradores4) { + this.nr_relatorio_acidente_outros_colaboradores4 = nr_relatorio_acidente_outros_colaboradores4; + } + + public String getLesao_cabeca() { + return lesao_cabeca; + } + + public void setLesao_cabeca(String lesao_cabeca) { + this.lesao_cabeca = lesao_cabeca; + } + + public String getLesao_pescoco() { + return lesao_pescoco; + } + + public void setLesao_pescoco(String lesao_pescoco) { + this.lesao_pescoco = lesao_pescoco; + } + + public String getLesao_tronco() { + return lesao_tronco; + } + + public void setLesao_tronco(String lesao_tronco) { + this.lesao_tronco = lesao_tronco; + } + + public String getLesao_membro_sup_dir() { + return lesao_membro_sup_dir; + } + + public void setLesao_membro_sup_dir(String lesao_membro_sup_dir) { + this.lesao_membro_sup_dir = lesao_membro_sup_dir; + } + + public String getLesao_membro_sup_esq() { + return lesao_membro_sup_esq; + } + + public void setLesao_membro_sup_esq(String lesao_membro_sup_esq) { + this.lesao_membro_sup_esq = lesao_membro_sup_esq; + } + + public String getLesao_membro_inf_dir() { + return lesao_membro_inf_dir; + } + + public void setLesao_membro_inf_dir(String lesao_membro_inf_dir) { + this.lesao_membro_inf_dir = lesao_membro_inf_dir; + } + + public String getLesao_membro_inf_esq() { + return lesao_membro_inf_esq; + } + + public void setLesao_membro_inf_esq(String lesao_membro_inf_esq) { + this.lesao_membro_inf_esq = lesao_membro_inf_esq; + } + + public String getEspecif1() { + return especif1; + } + + public void setEspecif1(String especif1) { + this.especif1 = especif1; + } + + public String getEspecif2() { + return especif2; + } + + public void setEspecif2(String especif2) { + this.especif2 = especif2; + } + + public String getEspecif3() { + return especif3; + } + + public void setEspecif3(String especif3) { + this.especif3 = especif3; + } + + public String getEspecif4() { + return especif4; + } + + public void setEspecif4(String especif4) { + this.especif4 = especif4; + } + + public String getTipo_incapacidade() { + return tipo_incapacidade; + } + + public void setTipo_incapacidade(String tipo_incapacidade) { + this.tipo_incapacidade = tipo_incapacidade; + } + + public Integer getCoef_incapacidade() { + return coef_incapacidade; + } + + public void setCoef_incapacidade(Integer coef_incapacidade) { + this.coef_incapacidade = coef_incapacidade; + } + + public Date getData_aval_incapacidade() { + return data_aval_incapacidade; + } + + public void setData_aval_incapacidade(Date data_aval_incapacidade) { + this.data_aval_incapacidade = data_aval_incapacidade; + } + + public Date getData_rev_incapacidade() { + return data_rev_incapacidade; + } + + public void setData_rev_incapacidade(Date data_rev_incapacidade) { + this.data_rev_incapacidade = data_rev_incapacidade; + } + + public Date getPeriodo_incapacidade_de() { + return periodo_incapacidade_de; + } + + public void setPeriodo_incapacidade_de(Date periodo_incapacidade_de) { + this.periodo_incapacidade_de = periodo_incapacidade_de; + } + + public Date getPeriodo_incapacidade_a() { + return periodo_incapacidade_a; + } + + public void setPeriodo_incapacidade_a(Date periodo_incapacidade_a) { + this.periodo_incapacidade_a = periodo_incapacidade_a; + } + + public String getImg_flexao() { + return img_flexao; + } + + public void setImg_flexao(String img_flexao) { + this.img_flexao = img_flexao; + } + + public String getImg_ext1() { + return img_ext1; + } + + public void setImg_ext1(String img_ext1) { + this.img_ext1 = img_ext1; + } + + public String getImg_ext2() { + return img_ext2; + } + + public void setImg_ext2(String img_ext2) { + this.img_ext2 = img_ext2; + } + + public String getImg_cab2() { + return img_cab2; + } + + public void setImg_cab2(String img_cab2) { + this.img_cab2 = img_cab2; + } + + public String getImg_cab3() { + return img_cab3; + } + + public void setImg_cab3(String img_cab3) { + this.img_cab3 = img_cab3; + } + + public String getImg_ma2() { + return img_ma2; + } + + public void setImg_ma2(String img_ma2) { + this.img_ma2 = img_ma2; + } + + public String getImg_ma3() { + return img_ma3; + } + + public void setImg_ma3(String img_ma3) { + this.img_ma3 = img_ma3; + } + + public String getImg_ma5() { + return img_ma5; + } + + public void setImg_ma5(String img_ma5) { + this.img_ma5 = img_ma5; + } + + public String getImg_ma6() { + return img_ma6; + } + + public void setImg_ma6(String img_ma6) { + this.img_ma6 = img_ma6; + } + + public String getImg_ma8() { + return img_ma8; + } + + public void setImg_ma8(String img_ma8) { + this.img_ma8 = img_ma8; + } + + public String getImg_ma10() { + return img_ma10; + } + + public void setImg_ma10(String img_ma10) { + this.img_ma10 = img_ma10; + } + + public Integer getRestricao_carga() { + return restricao_carga; + } + + public void setRestricao_carga(Integer restricao_carga) { + this.restricao_carga = restricao_carga; + } + + public String getRestricao_motricidade() { + return restricao_motricidade; + } + + public void setRestricao_motricidade(String restricao_motricidade) { + this.restricao_motricidade = restricao_motricidade; + } + + public String getRestricao_conducao() { + return restricao_conducao; + } + + public void setRestricao_conducao(String restricao_conducao) { + this.restricao_conducao = restricao_conducao; + } + + public String getRestricao_vibracoes() { + return restricao_vibracoes; + } + + public void setRestricao_vibracoes(String restricao_vibracoes) { + this.restricao_vibracoes = restricao_vibracoes; + } + + public String getRestricao_outras() { + return restricao_outras; + } + + public void setRestricao_outras(String restricao_outras) { + this.restricao_outras = restricao_outras; + } + + public String getMed_observ() { + return med_observ; + } + + public void setMed_observ(String med_observ) { + this.med_observ = med_observ; + } + + public String getTipo_lesao() { + return tipo_lesao; + } + + public void setTipo_lesao(String tipo_lesao) { + this.tipo_lesao = tipo_lesao; + } + + public String getImg_rot1() { + return img_rot1; + } + + public void setImg_rot1(String img_rot1) { + this.img_rot1 = img_rot1; + } + + public String getImg_rot2() { + return img_rot2; + } + + public void setImg_rot2(String img_rot2) { + this.img_rot2 = img_rot2; + } + + public String getImg_cab1() { + return img_cab1; + } + + public void setImg_cab1(String img_cab1) { + this.img_cab1 = img_cab1; + } + + public String getImg_cab4() { + return img_cab4; + } + + public void setImg_cab4(String img_cab4) { + this.img_cab4 = img_cab4; + } + + public String getImg_ma1() { + return img_ma1; + } + + public void setImg_ma1(String img_ma1) { + this.img_ma1 = img_ma1; + } + + public String getImg_ma4() { + return img_ma4; + } + + public void setImg_ma4(String img_ma4) { + this.img_ma4 = img_ma4; + } + + public String getImg_ma7() { + return img_ma7; + } + + public void setImg_ma7(String img_ma7) { + this.img_ma7 = img_ma7; + } + + public String getImg_ma9() { + return img_ma9; + } + + public void setImg_ma9(String img_ma9) { + this.img_ma9 = img_ma9; + } + + public Integer getEmpresa_id() { + return empresa_id; + } + + public void setEmpresa_id(Integer empresa_id) { + this.empresa_id = empresa_id; + } + + public Integer getMedico_id() { + return medico_id; + } + + public void setMedico_id(Integer medico_id) { + this.medico_id = medico_id; + } + + public Integer getTecnico_saude_id() { + return tecnico_saude_id; + } + + public void setTecnico_saude_id(Integer tecnico_saude_id) { + this.tecnico_saude_id = tecnico_saude_id; + } + + public String getAnalise_nr() { + return analise_nr; + } + + public void setAnalise_nr(String analise_nr) { + this.analise_nr = analise_nr; + } + + public String getFase() { + return fase; + } + + public void setFase(String fase) { + this.fase = fase; + } + + public Integer getEstado_assinatura() { + return estado_assinatura; + } + + public void setEstado_assinatura(Integer estado_assinatura) { + this.estado_assinatura = estado_assinatura; + } + + public String getAss_resp_seg() { + return ass_resp_seg; + } + + public void setAss_resp_seg(String ass_resp_seg) { + this.ass_resp_seg = ass_resp_seg; + } + + public String getAss_resp_rh() { + return ass_resp_rh; + } + + public void setAss_resp_rh(String ass_resp_rh) { + this.ass_resp_rh = ass_resp_rh; + } + + public String getNumero_mecanografico() { + return numero_mecanografico; + } + + public void setNumero_mecanografico(String numero_mecanografico) { + this.numero_mecanografico = numero_mecanografico; + } + + public String getNome_estabelecimento() { + return nome_estabelecimento; + } + + public void setNome_estabelecimento(String nome_estabelecimento) { + this.nome_estabelecimento = nome_estabelecimento; + } + + public Date getData_consolidacao() { + return data_consolidacao; + } + + public void setData_consolidacao(Date data_consolidacao) { + this.data_consolidacao = data_consolidacao; + } + + public Date getData_assinatura_seg() { + return data_assinatura_seg; + } + + public void setData_assinatura_seg(Date data_assinatura_seg) { + this.data_assinatura_seg = data_assinatura_seg; + } + + public Date getData_assinatura_rh() { + return data_assinatura_rh; + } + + public void setData_assinatura_rh(Date data_assinatura_rh) { + this.data_assinatura_rh = data_assinatura_rh; + } + + public String getNome_resp_seg() { + if(nome_resp_seg == null) + { + return ""; + } + return nome_resp_seg; + } + + public void setNome_resp_seg(String nome_resp_seg) { + this.nome_resp_seg = nome_resp_seg; + } + + public String getNome_resp_rh() { + if(nome_resp_rh == null) + { + return ""; + } + return nome_resp_rh; + } + + public void setNome_resp_rh(String nome_resp_rh) { + this.nome_resp_rh = nome_resp_rh; + } + + public Integer getEstado_antes_correcao() { + return estado_antes_correcao; + } + + public void setEstado_antes_correcao(Integer estado_antes_correcao) { + this.estado_antes_correcao = estado_antes_correcao; + } + + public String getCorrecao() { + return correcao; + } + + public void setCorrecao(String correcao) { + this.correcao = correcao; + } + + public String getObservacoes_correcao() { + if(observacoes_correcao == null) + { + return ""; + } + return observacoes_correcao; + } + + public void setObservacoes_correcao(String observacoes_correcao) { + this.observacoes_correcao = observacoes_correcao; + } + + public String getAss_superior() { + return ass_superior; + } + + public void setAss_superior(String ass_superior) { + this.ass_superior = ass_superior; + } + + public String getNome_superior() { + if(nome_superior == null) + { + return ""; + } + return nome_superior; + } + + public void setNome_superior(String nome_superior) { + this.nome_superior = nome_superior; + } + + public Date getData_assinatura_superior() { + return data_assinatura_superior; + } + + public void setData_assinatura_superior(Date data_assinatura_superior) { + this.data_assinatura_superior = data_assinatura_superior; + } + + public String getAveriguador() { + if(averiguador == null) + { + return ""; + } + return averiguador; + } + + public void setAveriguador(String averiguador) { + this.averiguador = averiguador; + } + + public String getAveriguacao_posterior() { + if(averiguacao_posterior == null) + { + averiguacao_posterior = "n"; + } + return averiguacao_posterior; + } + + public void setAveriguacao_posterior(String averiguacao_posterior) { + this.averiguacao_posterior = averiguacao_posterior; + } + + public String getAveriguacao_obs() { + if(averiguacao_obs == null) + { + averiguacao_obs = ""; + } + return averiguacao_obs; + } + + public void setAveriguacao_obs(String averiguacao_obs) { + this.averiguacao_obs = averiguacao_obs; + } + + public String getNome_resp_consolidacao() { + return nome_resp_consolidacao; + } + + public void setNome_resp_consolidacao(String nome_resp_consolidacao) { + this.nome_resp_consolidacao = nome_resp_consolidacao; + } + + public Date getData_inicio_processo() { + return data_inicio_processo; + } + + public void setData_inicio_processo(Date data_inicio_processo) { + this.data_inicio_processo = data_inicio_processo; + } + + public String getAss_consolidacao() { + return ass_consolidacao; + } + + public void setAss_consolidacao(String ass_consolidacao) { + this.ass_consolidacao = ass_consolidacao; + } + + public Integer getDepartamento_id() { + return departamento_id; + } + + public void setDepartamento_id(Integer departamento_id) { + this.departamento_id = departamento_id; + } + + public Integer getSeccao_id() { + return seccao_id; + } + + public void setSeccao_id(Integer seccao_id) { + this.seccao_id = seccao_id; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java new file mode 100644 index 00000000..91dccddb --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/AnaliseAcidenteTrabalho.java @@ -0,0 +1,14436 @@ +/* + * AnaliseAcidenteTrabalho.java + * + * Created on September 28, 2007, 3:56 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.Checkbox; +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.ImageHyperlink; +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.RadioButton; +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.TextArea; +import com.sun.rave.web.ui.component.TextField; +import com.sun.rave.web.ui.model.DefaultTableDataProvider; +import com.sun.rave.web.ui.model.SingleSelectOptionsList; +import db.AnalisesDataProvider; +import db.TrabalhadoresListDataProvider; +import db.UtilizadoresDataProvider; +import global.Global; +import java.io.File; +import java.sql.Time; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.ListIterator; +import java.util.Properties; +import javax.faces.FacesException; +import javax.faces.FactoryFinder; +import javax.faces.application.ApplicationFactory; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.el.MethodBinding; +import javax.faces.event.ActionEvent; +import javax.faces.event.ValueChangeEvent; +import javax.mail.Authenticator; +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 javax.mail.*; +import javax.mail.internet.*; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import pagestate.AnaliseAcidenteTrabalhoState; +import pdf.Pdf; +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 AnaliseAcidenteTrabalho extends AbstractPageBean { + // + private int __placeholder; + + /** + *

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 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 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 txtCap = new StaticText(); + + public StaticText getTxtCap() { + return txtCap; + } + + public void setTxtCap(StaticText st) { + this.txtCap = st; + } + + //
+ //private String IMAGE_URL = "/resources/images"; + +// private final static int ESTADO_SEG = 1; +// private final static int ESTADO_RH1 = 2; +// private final static int ESTADO_HS = 3; +// private final static int ESTADO_RH2 = 4; +// private final static int ESTADO_MEDICO = 5; +// private final static int ESTADO_ASSINATURAS = 6; +// private final static int ESTADO_IMPRESSAO = 7; +// private final static int ESTADO_FECHAR = 8; +// private final static int ESTADO_CONCLUIDO = 9; + + + private final static int ESTADO_ASSINATURA_1 = 1; + private final static int ESTADO_ASSINATURA_2 = 2; + private final static int ESTADO_ASSINATURA_3 = 3; + +// private final static int ESTADO_ASSINATURA_RESP_SEG = 1; +// private final static int ESTADO_ASSINATURA_SEG = 2; +// private final static int ESTADO_ASSINATURA_HS = 3; +// private final static int ESTADO_ASSINATURA_MED = 4; +// private final static int ESTADO_ASSINATURA_RH = 5; +// private final static int ESTADO_ASSINATURA_RESP_RH = 6; + + private final static int IMAGE_WIDTH = 48; + private final static int IMAGE_HEIGHT = 48; + + private static final String PDFS_FOLDER_URL = "/resources/pdfs"; + + private Hyperlink lnkLblTrabalhador = new Hyperlink(); + + public Hyperlink getLnkLblTrabalhador() { + return lnkLblTrabalhador; + } + + public void setLnkLblTrabalhador(Hyperlink h) { + this.lnkLblTrabalhador = h; + } + + private HtmlPanelGrid gridAcidentado = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAcidentado() { + return gridAcidentado; + } + + public void setGridAcidentado(HtmlPanelGrid hpg) { + this.gridAcidentado = hpg; + } + + private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel23() { + return gridPanel23; + } + + public void setGridPanel23(HtmlPanelGrid hpg) { + this.gridPanel23 = hpg; + } + + private StaticText staticText29 = new StaticText(); + + public StaticText getStaticText29() { + return staticText29; + } + + public void setStaticText29(StaticText st) { + this.staticText29 = st; + } + + private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel24() { + return gridPanel24; + } + + public void setGridPanel24(HtmlPanelGrid hpg) { + this.gridPanel24 = hpg; + } + + private HtmlPanelGrid gridPanel25 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel25() { + return gridPanel25; + } + + public void setGridPanel25(HtmlPanelGrid hpg) { + this.gridPanel25 = hpg; + } + + private StaticText staticText30 = new StaticText(); + + public StaticText getStaticText30() { + return staticText30; + } + + public void setStaticText30(StaticText st) { + this.staticText30 = st; + } + + private StaticText txtNomeAcidentado = new StaticText(); + + public StaticText getTxtNomeAcidentado() { + return txtNomeAcidentado; + } + + public void setTxtNomeAcidentado(StaticText st) { + this.txtNomeAcidentado = st; + } + + private StaticText staticText31 = new StaticText(); + + public StaticText getStaticText31() { + return staticText31; + } + + public void setStaticText31(StaticText st) { + this.staticText31 = st; + } + + private StaticText txtDataNascimento = new StaticText(); + + public StaticText getTxtDataNascimento() { + return txtDataNascimento; + } + + public void setTxtDataNascimento(StaticText st) { + this.txtDataNascimento = st; + } + + private StaticText staticText32 = new StaticText(); + + public StaticText getStaticText32() { + return staticText32; + } + + public void setStaticText32(StaticText st) { + this.staticText32 = st; + } + + private TextField txtBI = new TextField(); + + public TextField getTxtBI() { + return txtBI; + } + + public void setTxtBI(TextField tf) { + this.txtBI = tf; + } + + private StaticText staticText33 = new StaticText(); + + public StaticText getStaticText33() { + return staticText33; + } + + public void setStaticText33(StaticText st) { + this.staticText33 = st; + } + + private TextField txtMorada = new TextField(); + + public TextField getTxtMorada() { + return txtMorada; + } + + public void setTxtMorada(TextField tf) { + this.txtMorada = tf; + } + + private StaticText staticText34 = new StaticText(); + + public StaticText getStaticText34() { + return staticText34; + } + + public void setStaticText34(StaticText st) { + this.staticText34 = st; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private TextField txtCodPostal1 = new TextField(); + + public TextField getTxtCodPostal1() { + return txtCodPostal1; + } + + public void setTxtCodPostal1(TextField tf) { + this.txtCodPostal1 = tf; + } + + private StaticText staticText35 = new StaticText(); + + public StaticText getStaticText35() { + return staticText35; + } + + public void setStaticText35(StaticText st) { + this.staticText35 = st; + } + + private TextField txtCodPostal2 = new TextField(); + + public TextField getTxtCodPostal2() { + return txtCodPostal2; + } + + public void setTxtCodPostal2(TextField tf) { + this.txtCodPostal2 = tf; + } + + private StaticText staticText36 = new StaticText(); + + public StaticText getStaticText36() { + return staticText36; + } + + public void setStaticText36(StaticText st) { + this.staticText36 = st; + } + + private TextField txtLocalidade = new TextField(); + + public TextField getTxtLocalidade() { + return txtLocalidade; + } + + public void setTxtLocalidade(TextField tf) { + this.txtLocalidade = tf; + } + + private StaticText staticText37 = new StaticText(); + + public StaticText getStaticText37() { + return staticText37; + } + + public void setStaticText37(StaticText st) { + this.staticText37 = st; + } + + private TextField txtContactoTelefonico = new TextField(); + + public TextField getTxtContactoTelefonico() { + return txtContactoTelefonico; + } + + public void setTxtContactoTelefonico(TextField tf) { + this.txtContactoTelefonico = tf; + } + + private StaticText staticText38 = new StaticText(); + + public StaticText getStaticText38() { + return staticText38; + } + + public void setStaticText38(StaticText st) { + this.staticText38 = st; + } + + private StaticText stDataAdmissao = new StaticText(); + + public StaticText getStDataAdmissao() { + return stDataAdmissao; + } + + public void setStDataAdmissao(StaticText st) { + this.stDataAdmissao = st; + } + + private StaticText staticText39 = new StaticText(); + + public StaticText getStaticText39() { + return staticText39; + } + + public void setStaticText39(StaticText st) { + this.staticText39 = st; + } + + private StaticText stFuncao = new StaticText(); + + public StaticText getStFuncao() { + return stFuncao; + } + + public void setStFuncao(StaticText st) { + this.stFuncao = st; + } + + private StaticText staticText40 = new StaticText(); + + public StaticText getStaticText40() { + return staticText40; + } + + public void setStaticText40(StaticText st) { + this.staticText40 = st; + } + + private HtmlPanelGrid gridDadosAcidenteSeg = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteSeg() { + return gridDadosAcidenteSeg; + } + + public void setGridDadosAcidenteSeg(HtmlPanelGrid hpg) { + this.gridDadosAcidenteSeg = 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 gridPanel11 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel11() { + return gridPanel11; + } + + public void setGridPanel11(HtmlPanelGrid hpg) { + this.gridPanel11 = hpg; + } + + private PanelGroup groupPanel10 = new PanelGroup(); + + public PanelGroup getGroupPanel10() { + return groupPanel10; + } + + public void setGroupPanel10(PanelGroup pg) { + this.groupPanel10 = pg; + } + + private StaticText staticText17 = new StaticText(); + + public StaticText getStaticText17() { + return staticText17; + } + + public void setStaticText17(StaticText st) { + this.staticText17 = st; + } + + private PanelGroup groupPanel11 = new PanelGroup(); + + public PanelGroup getGroupPanel11() { + return groupPanel11; + } + + public void setGroupPanel11(PanelGroup pg) { + this.groupPanel11 = pg; + } + + private StaticText staticText18 = new StaticText(); + + public StaticText getStaticText18() { + return staticText18; + } + + public void setStaticText18(StaticText st) { + this.staticText18 = st; + } + + private TextField txtLocal = new TextField(); + + public TextField getTxtLocal() { + return txtLocal; + } + + public void setTxtLocal(TextField tf) { + this.txtLocal = tf; + } + + private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel12() { + return gridPanel12; + } + + public void setGridPanel12(HtmlPanelGrid hpg) { + this.gridPanel12 = hpg; + } + + private StaticText staticText19 = new StaticText(); + + public StaticText getStaticText19() { + return staticText19; + } + + public void setStaticText19(StaticText st) { + this.staticText19 = st; + } + + private TextField txtTarefa = new TextField(); + + public TextField getTxtTarefa() { + return txtTarefa; + } + + public void setTxtTarefa(TextField tf) { + this.txtTarefa = tf; + } + + private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel13() { + return gridPanel13; + } + + public void setGridPanel13(HtmlPanelGrid hpg) { + this.gridPanel13 = hpg; + } + + private StaticText staticText20 = new StaticText(); + + public StaticText getStaticText20() { + return staticText20; + } + + public void setStaticText20(StaticText st) { + this.staticText20 = st; + } + + private TextField txtSubstancias = new TextField(); + + public TextField getTxtSubstancias() { + return txtSubstancias; + } + + public void setTxtSubstancias(TextField tf) { + this.txtSubstancias = tf; + } + + private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel15() { + return gridPanel15; + } + + public void setGridPanel15(HtmlPanelGrid hpg) { + this.gridPanel15 = hpg; + } + + private StaticText staticText22 = new StaticText(); + + public StaticText getStaticText22() { + return staticText22; + } + + public void setStaticText22(StaticText st) { + this.staticText22 = st; + } + + private TextField txtCondicoes = new TextField(); + + public TextField getTxtCondicoes() { + return txtCondicoes; + } + + public void setTxtCondicoes(TextField tf) { + this.txtCondicoes = tf; + } + + private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel16() { + return gridPanel16; + } + + public void setGridPanel16(HtmlPanelGrid hpg) { + this.gridPanel16 = hpg; + } + + private StaticText staticText23 = new StaticText(); + + public StaticText getStaticText23() { + return staticText23; + } + + public void setStaticText23(StaticText st) { + this.staticText23 = st; + } + + private TextField txtTestemunhas = new TextField(); + + public TextField getTxtTestemunhas() { + return txtTestemunhas; + } + + public void setTxtTestemunhas(TextField tf) { + this.txtTestemunhas = tf; + } + + private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel17() { + return gridPanel17; + } + + public void setGridPanel17(HtmlPanelGrid hpg) { + this.gridPanel17 = hpg; + } + + private StaticText staticText24 = new StaticText(); + + public StaticText getStaticText24() { + return staticText24; + } + + public void setStaticText24(StaticText st) { + this.staticText24 = st; + } + + private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel18() { + return gridPanel18; + } + + public void setGridPanel18(HtmlPanelGrid hpg) { + this.gridPanel18 = hpg; + } + + private StaticText staticText25 = new StaticText(); + + public StaticText getStaticText25() { + return staticText25; + } + + public void setStaticText25(StaticText st) { + this.staticText25 = st; + } + + private TextField txtDescricao = new TextField(); + + public TextField getTxtDescricao() { + return txtDescricao; + } + + public void setTxtDescricao(TextField tf) { + this.txtDescricao = tf; + } + + private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel19() { + return gridPanel19; + } + + public void setGridPanel19(HtmlPanelGrid hpg) { + this.gridPanel19 = hpg; + } + + private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel20() { + return gridPanel20; + } + + public void setGridPanel20(HtmlPanelGrid hpg) { + this.gridPanel20 = hpg; + } + + private StaticText staticText26 = new StaticText(); + + public StaticText getStaticText26() { + return staticText26; + } + + public void setStaticText26(StaticText st) { + this.staticText26 = st; + } + + private Button butImagem = new Button(); + + public Button getButImagem() { + return butImagem; + } + + public void setButImagem(Button b) { + this.butImagem = b; + } + + private HtmlPanelGrid gridImages = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImages() { + return gridImages; + } + + public void setGridImages(HtmlPanelGrid hpg) { + this.gridImages = hpg; + } + + private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel21() { + return gridPanel21; + } + + public void setGridPanel21(HtmlPanelGrid hpg) { + this.gridPanel21 = hpg; + } + + private StaticText staticText27 = new StaticText(); + + public StaticText getStaticText27() { + return staticText27; + } + + public void setStaticText27(StaticText st) { + this.staticText27 = st; + } + + private TextArea txtConclusoes = new TextArea(); + + public TextArea getTxtConclusoes() { + return txtConclusoes; + } + + public void setTxtConclusoes(TextArea ta) { + this.txtConclusoes = ta; + } + + private HtmlPanelGrid gridPanel26 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel26() { + return gridPanel26; + } + + public void setGridPanel26(HtmlPanelGrid hpg) { + this.gridPanel26 = hpg; + } + + private StaticText staticText28 = new StaticText(); + + public StaticText getStaticText28() { + return staticText28; + } + + public void setStaticText28(StaticText st) { + this.staticText28 = st; + } + + private TextArea txtAccoes = new TextArea(); + + public TextArea getTxtAccoes() { + return txtAccoes; + } + + public void setTxtAccoes(TextArea ta) { + this.txtAccoes = ta; + } + + private HtmlPanelGrid gridDadosAcidenteRh = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRh() { + return gridDadosAcidenteRh; + } + + public void setGridDadosAcidenteRh(HtmlPanelGrid hpg) { + this.gridDadosAcidenteRh = hpg; + } + + private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel27() { + return gridPanel27; + } + + public void setGridPanel27(HtmlPanelGrid hpg) { + this.gridPanel27 = hpg; + } + + private StaticText staticText46 = new StaticText(); + + public StaticText getStaticText46() { + return staticText46; + } + + public void setStaticText46(StaticText st) { + this.staticText46 = st; + } + + private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel28() { + return gridPanel28; + } + + public void setGridPanel28(HtmlPanelGrid hpg) { + this.gridPanel28 = hpg; + } + + private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel29() { + return gridPanel29; + } + + public void setGridPanel29(HtmlPanelGrid hpg) { + this.gridPanel29 = hpg; + } + + private StaticText staticText47 = new StaticText(); + + public StaticText getStaticText47() { + return staticText47; + } + + public void setStaticText47(StaticText st) { + this.staticText47 = st; + } + + private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel30() { + return gridPanel30; + } + + public void setGridPanel30(HtmlPanelGrid hpg) { + this.gridPanel30 = hpg; + } + + private StaticText staticText48 = new StaticText(); + + public StaticText getStaticText48() { + return staticText48; + } + + public void setStaticText48(StaticText st) { + this.staticText48 = st; + } + + private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel31() { + return gridPanel31; + } + + public void setGridPanel31(HtmlPanelGrid hpg) { + this.gridPanel31 = hpg; + } + + private RadioButton rbFormacaoSHSTY = new RadioButton(); + + public RadioButton getRbFormacaoSHSTY() { + return rbFormacaoSHSTY; + } + + public void setRbFormacaoSHSTY(RadioButton rb) { + this.rbFormacaoSHSTY = rb; + } + + private StaticText staticText49 = new StaticText(); + + public StaticText getStaticText49() { + return staticText49; + } + + public void setStaticText49(StaticText st) { + this.staticText49 = st; + } + + private HtmlPanelGrid gridPanel32 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel32() { + return gridPanel32; + } + + public void setGridPanel32(HtmlPanelGrid hpg) { + this.gridPanel32 = hpg; + } + + private StaticText staticText50 = new StaticText(); + + public StaticText getStaticText50() { + return staticText50; + } + + public void setStaticText50(StaticText st) { + this.staticText50 = st; + } + + private HtmlPanelGrid gridPanel33 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel33() { + return gridPanel33; + } + + public void setGridPanel33(HtmlPanelGrid hpg) { + this.gridPanel33 = hpg; + } + + private RadioButton rbFormacaoSHSTN = new RadioButton(); + + public RadioButton getRbFormacaoSHSTN() { + return rbFormacaoSHSTN; + } + + public void setRbFormacaoSHSTN(RadioButton rb) { + this.rbFormacaoSHSTN = rb; + } + + private StaticText stFormacaoDummy = new StaticText(); + + public StaticText getStFormacaoDummy() { + return stFormacaoDummy; + } + + public void setStFormacaoDummy(StaticText st) { + this.stFormacaoDummy = st; + } + + private PanelGroup groupPanel12 = new PanelGroup(); + + public PanelGroup getGroupPanel12() { + return groupPanel12; + } + + public void setGroupPanel12(PanelGroup pg) { + this.groupPanel12 = pg; + } + + private StaticText lblFormacaoSHSTNWhy = new StaticText(); + + public StaticText getLblFormacaoSHSTNWhy() { + return lblFormacaoSHSTNWhy; + } + + public void setLblFormacaoSHSTNWhy(StaticText st) { + this.lblFormacaoSHSTNWhy = st; + } + + private TextField txtFormacaoSHSTNWhy = new TextField(); + + public TextField getTxtFormacaoSHSTNWhy() { + return txtFormacaoSHSTNWhy; + } + + public void setTxtFormacaoSHSTNWhy(TextField tf) { + this.txtFormacaoSHSTNWhy = tf; + } + + private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel34() { + return gridPanel34; + } + + public void setGridPanel34(HtmlPanelGrid hpg) { + this.gridPanel34 = hpg; + } + + private StaticText staticText53 = new StaticText(); + + public StaticText getStaticText53() { + return staticText53; + } + + public void setStaticText53(StaticText st) { + this.staticText53 = st; + } + + private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel35() { + return gridPanel35; + } + + public void setGridPanel35(HtmlPanelGrid hpg) { + this.gridPanel35 = hpg; + } + + private StaticText staticText54 = new StaticText(); + + public StaticText getStaticText54() { + return staticText54; + } + + public void setStaticText54(StaticText st) { + this.staticText54 = st; + } + + private HtmlPanelGrid gridPanel36 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel36() { + return gridPanel36; + } + + public void setGridPanel36(HtmlPanelGrid hpg) { + this.gridPanel36 = hpg; + } + + private RadioButton rbAcidentesColaboradorY = new RadioButton(); + + public RadioButton getRbAcidentesColaboradorY() { + return rbAcidentesColaboradorY; + } + + public void setRbAcidentesColaboradorY(RadioButton rb) { + this.rbAcidentesColaboradorY = rb; + } + + private StaticText staticText55 = new StaticText(); + + public StaticText getStaticText55() { + return staticText55; + } + + public void setStaticText55(StaticText st) { + this.staticText55 = st; + } + + private PanelGroup groupPanel13 = new PanelGroup(); + + public PanelGroup getGroupPanel13() { + return groupPanel13; + } + + public void setGroupPanel13(PanelGroup pg) { + this.groupPanel13 = pg; + } + + private StaticText staticText56 = new StaticText(); + + public StaticText getStaticText56() { + return staticText56; + } + + public void setStaticText56(StaticText st) { + this.staticText56 = st; + } + + private TextField txtNrAcidentesColaborador = new TextField(); + + public TextField getTxtNrAcidentesColaborador() { + return txtNrAcidentesColaborador; + } + + public void setTxtNrAcidentesColaborador(TextField tf) { + this.txtNrAcidentesColaborador = tf; + } + + private HtmlPanelGrid gridPanel37 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel37() { + return gridPanel37; + } + + public void setGridPanel37(HtmlPanelGrid hpg) { + this.gridPanel37 = hpg; + } + + private StaticText staticText57 = new StaticText(); + + public StaticText getStaticText57() { + return staticText57; + } + + public void setStaticText57(StaticText st) { + this.staticText57 = st; + } + + private TextField txtNrRelatorioAcidentesColaborador1 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador1() { + return txtNrRelatorioAcidentesColaborador1; + } + + public void setTxtNrRelatorioAcidentesColaborador1(TextField tf) { + this.txtNrRelatorioAcidentesColaborador1 = tf; + } + + private TextField txtNrRelatorioAcidentesColaborador2 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador2() { + return txtNrRelatorioAcidentesColaborador2; + } + + public void setTxtNrRelatorioAcidentesColaborador2(TextField tf) { + this.txtNrRelatorioAcidentesColaborador2 = tf; + } + + private TextField txtNrRelatorioAcidentesColaborador3 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador3() { + return txtNrRelatorioAcidentesColaborador3; + } + + public void setTxtNrRelatorioAcidentesColaborador3(TextField tf) { + this.txtNrRelatorioAcidentesColaborador3 = tf; + } + + private TextField txtNrRelatorioAcidentesColaborador4 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaborador4() { + return txtNrRelatorioAcidentesColaborador4; + } + + public void setTxtNrRelatorioAcidentesColaborador4(TextField tf) { + this.txtNrRelatorioAcidentesColaborador4 = tf; + } + + private HtmlPanelGrid gridPanel38 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel38() { + return gridPanel38; + } + + public void setGridPanel38(HtmlPanelGrid hpg) { + this.gridPanel38 = hpg; + } + + private StaticText staticText58 = new StaticText(); + + public StaticText getStaticText58() { + return staticText58; + } + + public void setStaticText58(StaticText st) { + this.staticText58 = st; + } + + private HtmlPanelGrid gridPanel39 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel39() { + return gridPanel39; + } + + public void setGridPanel39(HtmlPanelGrid hpg) { + this.gridPanel39 = hpg; + } + + private RadioButton rbAcidentesColaboradorN = new RadioButton(); + + public RadioButton getRbAcidentesColaboradorN() { + return rbAcidentesColaboradorN; + } + + public void setRbAcidentesColaboradorN(RadioButton rb) { + this.rbAcidentesColaboradorN = rb; + } + + private StaticText staticText59 = new StaticText(); + + public StaticText getStaticText59() { + return staticText59; + } + + public void setStaticText59(StaticText st) { + this.staticText59 = st; + } + + private HtmlPanelGrid gridPanel40 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel40() { + return gridPanel40; + } + + public void setGridPanel40(HtmlPanelGrid hpg) { + this.gridPanel40 = hpg; + } + + private StaticText staticText60 = new StaticText(); + + public StaticText getStaticText60() { + return staticText60; + } + + public void setStaticText60(StaticText st) { + this.staticText60 = st; + } + + private HtmlPanelGrid gridPanel41 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel41() { + return gridPanel41; + } + + public void setGridPanel41(HtmlPanelGrid hpg) { + this.gridPanel41 = hpg; + } + + private StaticText staticText61 = new StaticText(); + + public StaticText getStaticText61() { + return staticText61; + } + + public void setStaticText61(StaticText st) { + this.staticText61 = st; + } + + private HtmlPanelGrid gridPanel42 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel42() { + return gridPanel42; + } + + public void setGridPanel42(HtmlPanelGrid hpg) { + this.gridPanel42 = hpg; + } + + private RadioButton rbAcidentesColaboradoresY = new RadioButton(); + + public RadioButton getRbAcidentesColaboradoresY() { + return rbAcidentesColaboradoresY; + } + + public void setRbAcidentesColaboradoresY(RadioButton rb) { + this.rbAcidentesColaboradoresY = rb; + } + + private StaticText staticText62 = new StaticText(); + + public StaticText getStaticText62() { + return staticText62; + } + + public void setStaticText62(StaticText st) { + this.staticText62 = st; + } + + private PanelGroup groupPanel14 = new PanelGroup(); + + public PanelGroup getGroupPanel14() { + return groupPanel14; + } + + public void setGroupPanel14(PanelGroup pg) { + this.groupPanel14 = pg; + } + + private StaticText staticText63 = new StaticText(); + + public StaticText getStaticText63() { + return staticText63; + } + + public void setStaticText63(StaticText st) { + this.staticText63 = st; + } + + private TextField txtNrAcidentesColaboradores = new TextField(); + + public TextField getTxtNrAcidentesColaboradores() { + return txtNrAcidentesColaboradores; + } + + public void setTxtNrAcidentesColaboradores(TextField tf) { + this.txtNrAcidentesColaboradores = tf; + } + + private HtmlPanelGrid gridPanel43 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel43() { + return gridPanel43; + } + + public void setGridPanel43(HtmlPanelGrid hpg) { + this.gridPanel43 = hpg; + } + + private StaticText staticText64 = new StaticText(); + + public StaticText getStaticText64() { + return staticText64; + } + + public void setStaticText64(StaticText st) { + this.staticText64 = st; + } + + private TextField txtNrRelatorioAcidentesColaboradores1 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores1() { + return txtNrRelatorioAcidentesColaboradores1; + } + + public void setTxtNrRelatorioAcidentesColaboradores1(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores1 = tf; + } + + private TextField txtNrRelatorioAcidentesColaboradores2 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores2() { + return txtNrRelatorioAcidentesColaboradores2; + } + + public void setTxtNrRelatorioAcidentesColaboradores2(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores2 = tf; + } + + private TextField txtNrRelatorioAcidentesColaboradores3 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores3() { + return txtNrRelatorioAcidentesColaboradores3; + } + + public void setTxtNrRelatorioAcidentesColaboradores3(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores3 = tf; + } + + private TextField txtNrRelatorioAcidentesColaboradores4 = new TextField(); + + public TextField getTxtNrRelatorioAcidentesColaboradores4() { + return txtNrRelatorioAcidentesColaboradores4; + } + + public void setTxtNrRelatorioAcidentesColaboradores4(TextField tf) { + this.txtNrRelatorioAcidentesColaboradores4 = tf; + } + + private HtmlPanelGrid gridPanel44 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel44() { + return gridPanel44; + } + + public void setGridPanel44(HtmlPanelGrid hpg) { + this.gridPanel44 = hpg; + } + + private StaticText staticText65 = new StaticText(); + + public StaticText getStaticText65() { + return staticText65; + } + + public void setStaticText65(StaticText st) { + this.staticText65 = st; + } + + private HtmlPanelGrid gridPanel45 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel45() { + return gridPanel45; + } + + public void setGridPanel45(HtmlPanelGrid hpg) { + this.gridPanel45 = hpg; + } + + private RadioButton rbAcidentesColaboradoresN = new RadioButton(); + + public RadioButton getRbAcidentesColaboradoresN() { + return rbAcidentesColaboradoresN; + } + + public void setRbAcidentesColaboradoresN(RadioButton rb) { + this.rbAcidentesColaboradoresN = rb; + } + + private StaticText staticText66 = new StaticText(); + + public StaticText getStaticText66() { + return staticText66; + } + + public void setStaticText66(StaticText st) { + this.staticText66 = st; + } + + private HtmlPanelGrid gridRecomendacoesHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesHS() { + return gridRecomendacoesHS; + } + + public void setGridRecomendacoesHS(HtmlPanelGrid hpg) { + this.gridRecomendacoesHS = hpg; + } + + private HtmlPanelGrid gridPanel46 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel46() { + return gridPanel46; + } + + public void setGridPanel46(HtmlPanelGrid hpg) { + this.gridPanel46 = hpg; + } + + private StaticText staticText67 = new StaticText(); + + public StaticText getStaticText67() { + return staticText67; + } + + public void setStaticText67(StaticText st) { + this.staticText67 = st; + } + + private HtmlPanelGrid gridRecomendacoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoes() { + return gridRecomendacoes; + } + + public void setGridRecomendacoes(HtmlPanelGrid hpg) { + this.gridRecomendacoes = hpg; + } + + private HtmlPanelGrid gridPanel48 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel48() { + return gridPanel48; + } + + public void setGridPanel48(HtmlPanelGrid hpg) { + this.gridPanel48 = hpg; + } + + private StaticText stNrRecomendacao1 = new StaticText(); + + public StaticText getStNrRecomendacao1() { + return stNrRecomendacao1; + } + + public void setStNrRecomendacao1(StaticText st) { + this.stNrRecomendacao1 = st; + } + + private ImageHyperlink lnkMoreRec1 = new ImageHyperlink(); + + public ImageHyperlink getLnkMoreRec1() { + return lnkMoreRec1; + } + + public void setLnkMoreRec1(ImageHyperlink ih) { + this.lnkMoreRec1 = ih; + } + + private Hyperlink lnkDelImageTmp = new Hyperlink(); + + public Hyperlink getLnkDelImageTmp() { + return lnkDelImageTmp; + } + + public void setLnkDelImageTmp(Hyperlink lnkDelImageTmp) { + this.lnkDelImageTmp = lnkDelImageTmp; + } + + private HtmlPanelGrid gridSiprpView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSiprpView() { + return gridSiprpView; + } + + public void setGridSiprpView(HtmlPanelGrid hpg) { + this.gridSiprpView = hpg; + } + + private HtmlPanelGrid gridPanel49 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel49() { + return gridPanel49; + } + + public void setGridPanel49(HtmlPanelGrid hpg) { + this.gridPanel49 = hpg; + } + + private StaticText staticText69 = new StaticText(); + + public StaticText getStaticText69() { + return staticText69; + } + + public void setStaticText69(StaticText st) { + this.staticText69 = st; + } + + private HtmlPanelGrid gridPanel50 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel50() { + return gridPanel50; + } + + public void setGridPanel50(HtmlPanelGrid hpg) { + this.gridPanel50 = hpg; + } + + private HtmlPanelGrid gridPanel51 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel51() { + return gridPanel51; + } + + public void setGridPanel51(HtmlPanelGrid hpg) { + this.gridPanel51 = hpg; + } + + private HtmlPanelGrid gridAcidentadoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAcidentadoView() { + return gridAcidentadoView; + } + + public void setGridAcidentadoView(HtmlPanelGrid hpg) { + this.gridAcidentadoView = hpg; + } + + private HtmlPanelGrid gridPanel52 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel52() { + return gridPanel52; + } + + public void setGridPanel52(HtmlPanelGrid hpg) { + this.gridPanel52 = hpg; + } + + private StaticText staticText78 = new StaticText(); + + public StaticText getStaticText78() { + return staticText78; + } + + public void setStaticText78(StaticText st) { + this.staticText78 = st; + } + + private HtmlPanelGrid gridPanel53 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel53() { + return gridPanel53; + } + + public void setGridPanel53(HtmlPanelGrid hpg) { + this.gridPanel53 = hpg; + } + + private HtmlPanelGrid gridPanel54 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel54() { + return gridPanel54; + } + + public void setGridPanel54(HtmlPanelGrid hpg) { + this.gridPanel54 = hpg; + } + + private HtmlPanelGrid gridDadosAcidenteRhView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRhView() { + return gridDadosAcidenteRhView; + } + + public void setGridDadosAcidenteRhView(HtmlPanelGrid hpg) { + this.gridDadosAcidenteRhView = hpg; + } + + private HtmlPanelGrid gridPanel55 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel55() { + return gridPanel55; + } + + public void setGridPanel55(HtmlPanelGrid hpg) { + this.gridPanel55 = hpg; + } + + private StaticText staticText88 = new StaticText(); + + public StaticText getStaticText88() { + return staticText88; + } + + public void setStaticText88(StaticText st) { + this.staticText88 = st; + } + + private HtmlPanelGrid gridPanel56 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel56() { + return gridPanel56; + } + + public void setGridPanel56(HtmlPanelGrid hpg) { + this.gridPanel56 = hpg; + } + + private HtmlPanelGrid gridSHST = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSHST() { + return gridSHST; + } + + public void setGridSHST(HtmlPanelGrid hpg) { + this.gridSHST = hpg; + } + + private HtmlPanelGrid gridColaborador = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaborador() { + return gridColaborador; + } + + public void setGridColaborador(HtmlPanelGrid hpg) { + this.gridColaborador = hpg; + } + + private HtmlPanelGrid gridColaboradores = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaboradores() { + return gridColaboradores; + } + + public void setGridColaboradores(HtmlPanelGrid hpg) { + this.gridColaboradores = hpg; + } + + private SingleSelectOptionsList drpHoursDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpHoursDefaultOptions() { + return drpHoursDefaultOptions; + } + + public void setDrpHoursDefaultOptions(SingleSelectOptionsList ssol) { + this.drpHoursDefaultOptions = ssol; + } + + private SingleSelectOptionsList drpMinutesDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpMinutesDefaultOptions() { + return drpMinutesDefaultOptions; + } + + public void setDrpMinutesDefaultOptions(SingleSelectOptionsList ssol) { + this.drpMinutesDefaultOptions = ssol; + } + + private TextArea txtRecomendacao1 = new TextArea(); + + public TextArea getTxtRecomendacao1() { + return txtRecomendacao1; + } + + public void setTxtRecomendacao1(TextArea ta) { + this.txtRecomendacao1 = ta; + } + + private HtmlPanelGrid gridRecomendacoesViewHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesViewHS() { + return gridRecomendacoesViewHS; + } + + public void setGridRecomendacoesViewHS(HtmlPanelGrid hpg) { + this.gridRecomendacoesViewHS = hpg; + } + + private HtmlPanelGrid gridPanel47 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel47() { + return gridPanel47; + } + + public void setGridPanel47(HtmlPanelGrid hpg) { + this.gridPanel47 = hpg; + } + + private StaticText staticText51 = new StaticText(); + + public StaticText getStaticText51() { + return staticText51; + } + + public void setStaticText51(StaticText st) { + this.staticText51 = st; + } + + private HtmlPanelGrid gridRecomendacoesView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesView() { + return gridRecomendacoesView; + } + + public void setGridRecomendacoesView(HtmlPanelGrid hpg) { + this.gridRecomendacoesView = hpg; + } + + private HtmlPanelGrid gridMedidasRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasRH() { + return gridMedidasRH; + } + + public void setGridMedidasRH(HtmlPanelGrid hpg) { + this.gridMedidasRH = hpg; + } + + private HtmlPanelGrid gridPanel57 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel57() { + return gridPanel57; + } + + public void setGridPanel57(HtmlPanelGrid hpg) { + this.gridPanel57 = hpg; + } + + private StaticText staticText68 = new StaticText(); + + public StaticText getStaticText68() { + return staticText68; + } + + public void setStaticText68(StaticText st) { + this.staticText68 = st; + } + + private HtmlPanelGrid gridMedidas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidas() { + return gridMedidas; + } + + public void setGridMedidas(HtmlPanelGrid hpg) { + this.gridMedidas = hpg; + } + + private HtmlPanelGrid gridPanel58 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel58() { + return gridPanel58; + } + + public void setGridPanel58(HtmlPanelGrid hpg) { + this.gridPanel58 = hpg; + } + + private StaticText stNrMedida1 = new StaticText(); + + public StaticText getStNrMedida1() { + return stNrMedida1; + } + + public void setStNrMedida1(StaticText st) { + this.stNrMedida1 = st; + } + + private TextArea txtMedida1 = new TextArea(); + + public TextArea getTxtMedida1() { + return txtMedida1; + } + + public void setTxtMedida1(TextArea ta) { + this.txtMedida1 = ta; + } + + private ImageHyperlink lnkMoreMed1 = new ImageHyperlink(); + + public ImageHyperlink getLnkMoreMed1() { + return lnkMoreMed1; + } + + public void setLnkMoreMed1(ImageHyperlink ih) { + this.lnkMoreMed1 = ih; + } + + private HtmlPanelGrid gridMedidasViewRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasViewRH() { + return gridMedidasViewRH; + } + + public void setGridMedidasViewRH(HtmlPanelGrid hpg) { + this.gridMedidasViewRH = hpg; + } + + private HtmlPanelGrid gridPanel59 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel59() { + return gridPanel59; + } + + public void setGridPanel59(HtmlPanelGrid hpg) { + this.gridPanel59 = hpg; + } + + private StaticText staticText89 = new StaticText(); + + public StaticText getStaticText89() { + return staticText89; + } + + public void setStaticText89(StaticText st) { + this.staticText89 = st; + } + + private HtmlPanelGrid gridMedidasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasView() { + return gridMedidasView; + } + + public void setGridMedidasView(HtmlPanelGrid hpg) { + this.gridMedidasView = hpg; + } + + private HtmlPanelGrid gridMedico = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedico() { + return gridMedico; + } + + public void setGridMedico(HtmlPanelGrid hpg) { + this.gridMedico = hpg; + } + + private HtmlPanelGrid gridPanel60 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel60() { + return gridPanel60; + } + + public void setGridPanel60(HtmlPanelGrid hpg) { + this.gridPanel60 = hpg; + } + + private StaticText staticText90 = new StaticText(); + + public StaticText getStaticText90() { + return staticText90; + } + + public void setStaticText90(StaticText st) { + this.staticText90 = st; + } + + private HtmlPanelGrid gridLesao1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao1() { + return gridLesao1; + } + + public void setGridLesao1(HtmlPanelGrid hpg) { + this.gridLesao1 = hpg; + } + + private StaticText staticText91 = new StaticText(); + + public StaticText getStaticText91() { + return staticText91; + } + + public void setStaticText91(StaticText st) { + this.staticText91 = st; + } + + private HtmlPanelGrid gridPanel61 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel61() { + return gridPanel61; + } + + public void setGridPanel61(HtmlPanelGrid hpg) { + this.gridPanel61 = hpg; + } + + private PanelGroup groupPanel17 = new PanelGroup(); + + public PanelGroup getGroupPanel17() { + return groupPanel17; + } + + public void setGroupPanel17(PanelGroup pg) { + this.groupPanel17 = pg; + } + + private Checkbox chkCabeca = new Checkbox(); + + public Checkbox getChkCabeca() { + return chkCabeca; + } + + public void setChkCabeca(Checkbox c) { + this.chkCabeca = c; + } + + private StaticText staticText93 = new StaticText(); + + public StaticText getStaticText93() { + return staticText93; + } + + public void setStaticText93(StaticText st) { + this.staticText93 = st; + } + + private PanelGroup groupPanel18 = new PanelGroup(); + + public PanelGroup getGroupPanel18() { + return groupPanel18; + } + + public void setGroupPanel18(PanelGroup pg) { + this.groupPanel18 = pg; + } + + private Checkbox chkMembroSupDir = new Checkbox(); + + public Checkbox getChkMembroSupDir() { + return chkMembroSupDir; + } + + public void setChkMembroSupDir(Checkbox c) { + this.chkMembroSupDir = c; + } + + private StaticText staticText94 = new StaticText(); + + public StaticText getStaticText94() { + return staticText94; + } + + public void setStaticText94(StaticText st) { + this.staticText94 = st; + } + + private HtmlPanelGrid gridPanel62 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel62() { + return gridPanel62; + } + + public void setGridPanel62(HtmlPanelGrid hpg) { + this.gridPanel62 = hpg; + } + + private StaticText lblEspecif1 = new StaticText(); + + public StaticText getLblEspecif1() { + return lblEspecif1; + } + + public void setLblEspecif1(StaticText st) { + this.lblEspecif1 = st; + } + + private TextField txtEspecif1 = new TextField(); + + public TextField getTxtEspecif1() { + return txtEspecif1; + } + + public void setTxtEspecif1(TextField tf) { + this.txtEspecif1 = tf; + } + + private PanelGroup groupPanel19 = new PanelGroup(); + + public PanelGroup getGroupPanel19() { + return groupPanel19; + } + + public void setGroupPanel19(PanelGroup pg) { + this.groupPanel19 = pg; + } + + private Checkbox chkPescoco = new Checkbox(); + + public Checkbox getChkPescoco() { + return chkPescoco; + } + + public void setChkPescoco(Checkbox c) { + this.chkPescoco = c; + } + + private StaticText staticText96 = new StaticText(); + + public StaticText getStaticText96() { + return staticText96; + } + + public void setStaticText96(StaticText st) { + this.staticText96 = st; + } + + private PanelGroup groupPanel20 = new PanelGroup(); + + public PanelGroup getGroupPanel20() { + return groupPanel20; + } + + public void setGroupPanel20(PanelGroup pg) { + this.groupPanel20 = pg; + } + + private Checkbox chkMembroSupEsq = new Checkbox(); + + public Checkbox getChkMembroSupEsq() { + return chkMembroSupEsq; + } + + public void setChkMembroSupEsq(Checkbox c) { + this.chkMembroSupEsq = c; + } + + private StaticText staticText97 = new StaticText(); + + public StaticText getStaticText97() { + return staticText97; + } + + public void setStaticText97(StaticText st) { + this.staticText97 = st; + } + + private HtmlPanelGrid gridPanel63 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel63() { + return gridPanel63; + } + + public void setGridPanel63(HtmlPanelGrid hpg) { + this.gridPanel63 = hpg; + } + + private StaticText lblEspecif2 = new StaticText(); + + public StaticText getLblEspecif2() { + return lblEspecif2; + } + + public void setLblEspecif2(StaticText st) { + this.lblEspecif2 = st; + } + + private TextField txtEspecif2 = new TextField(); + + public TextField getTxtEspecif2() { + return txtEspecif2; + } + + public void setTxtEspecif2(TextField tf) { + this.txtEspecif2 = tf; + } + + private PanelGroup groupPanel21 = new PanelGroup(); + + public PanelGroup getGroupPanel21() { + return groupPanel21; + } + + public void setGroupPanel21(PanelGroup pg) { + this.groupPanel21 = pg; + } + + private Checkbox chkTronco = new Checkbox(); + + public Checkbox getChkTronco() { + return chkTronco; + } + + public void setChkTronco(Checkbox c) { + this.chkTronco = c; + } + + private StaticText staticText99 = new StaticText(); + + public StaticText getStaticText99() { + return staticText99; + } + + public void setStaticText99(StaticText st) { + this.staticText99 = st; + } + + private PanelGroup groupPanel22 = new PanelGroup(); + + public PanelGroup getGroupPanel22() { + return groupPanel22; + } + + public void setGroupPanel22(PanelGroup pg) { + this.groupPanel22 = pg; + } + + private Checkbox chkMembroInfDir = new Checkbox(); + + public Checkbox getChkMembroInfDir() { + return chkMembroInfDir; + } + + public void setChkMembroInfDir(Checkbox c) { + this.chkMembroInfDir = c; + } + + private StaticText staticText100 = new StaticText(); + + public StaticText getStaticText100() { + return staticText100; + } + + public void setStaticText100(StaticText st) { + this.staticText100 = st; + } + + private HtmlPanelGrid gridPanel64 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel64() { + return gridPanel64; + } + + public void setGridPanel64(HtmlPanelGrid hpg) { + this.gridPanel64 = hpg; + } + + private StaticText lblEspecif3 = new StaticText(); + + public StaticText getLblEspecif3() { + return lblEspecif3; + } + + public void setLblEspecif3(StaticText st) { + this.lblEspecif3 = st; + } + + private TextField txtEspecif3 = new TextField(); + + public TextField getTxtEspecif3() { + return txtEspecif3; + } + + public void setTxtEspecif3(TextField tf) { + this.txtEspecif3 = tf; + } + + private StaticText staticText102 = new StaticText(); + + public StaticText getStaticText102() { + return staticText102; + } + + public void setStaticText102(StaticText st) { + this.staticText102 = st; + } + + private PanelGroup groupPanel23 = new PanelGroup(); + + public PanelGroup getGroupPanel23() { + return groupPanel23; + } + + public void setGroupPanel23(PanelGroup pg) { + this.groupPanel23 = pg; + } + + private Checkbox chkMembroInfEsq = new Checkbox(); + + public Checkbox getChkMembroInfEsq() { + return chkMembroInfEsq; + } + + public void setChkMembroInfEsq(Checkbox c) { + this.chkMembroInfEsq = c; + } + + private StaticText staticText103 = new StaticText(); + + public StaticText getStaticText103() { + return staticText103; + } + + public void setStaticText103(StaticText st) { + this.staticText103 = st; + } + + private HtmlPanelGrid gridPanel65 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel65() { + return gridPanel65; + } + + public void setGridPanel65(HtmlPanelGrid hpg) { + this.gridPanel65 = hpg; + } + + private StaticText lblEspecif4 = new StaticText(); + + public StaticText getLblEspecif4() { + return lblEspecif4; + } + + public void setLblEspecif4(StaticText st) { + this.lblEspecif4 = st; + } + + private TextField txtEspecif4 = new TextField(); + + public TextField getTxtEspecif4() { + return txtEspecif4; + } + + public void setTxtEspecif4(TextField tf) { + this.txtEspecif4 = tf; + } + + private HtmlPanelGrid gridPanel66 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel66() { + return gridPanel66; + } + + public void setGridPanel66(HtmlPanelGrid hpg) { + this.gridPanel66 = hpg; + } + + private StaticText staticText105 = new StaticText(); + + public StaticText getStaticText105() { + return staticText105; + } + + public void setStaticText105(StaticText st) { + this.staticText105 = st; + } + + private TextField txtTipoLesao = new TextField(); + + public TextField getTxtTipoLesao() { + return txtTipoLesao; + } + + public void setTxtTipoLesao(TextField tf) { + this.txtTipoLesao = tf; + } + + private HtmlPanelGrid gridPanel67 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel67() { + return gridPanel67; + } + + public void setGridPanel67(HtmlPanelGrid hpg) { + this.gridPanel67 = hpg; + } + + private StaticText staticText106 = new StaticText(); + + public StaticText getStaticText106() { + return staticText106; + } + + public void setStaticText106(StaticText st) { + this.staticText106 = st; + } + + private HtmlPanelGrid gridIncapacidade1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade1() { + return gridIncapacidade1; + } + + public void setGridIncapacidade1(HtmlPanelGrid hpg) { + this.gridIncapacidade1 = hpg; + } + + private HtmlPanelGrid gridPanel68 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel68() { + return gridPanel68; + } + + public void setGridPanel68(HtmlPanelGrid hpg) { + this.gridPanel68 = hpg; + } + + private PanelGroup groupPanel24 = new PanelGroup(); + + public PanelGroup getGroupPanel24() { + return groupPanel24; + } + + public void setGroupPanel24(PanelGroup pg) { + this.groupPanel24 = pg; + } + + private StaticText staticText107 = new StaticText(); + + public StaticText getStaticText107() { + return staticText107; + } + + public void setStaticText107(StaticText st) { + this.staticText107 = st; + } + + private RadioButton rbIncapacidadeNone = new RadioButton(); + + public RadioButton getRbIncapacidadeNone() { + return rbIncapacidadeNone; + } + + public void setRbIncapacidadeNone(RadioButton rb) { + this.rbIncapacidadeNone = rb; + } + + private StaticText staticText108 = new StaticText(); + + public StaticText getStaticText108() { + return staticText108; + } + + public void setStaticText108(StaticText st) { + this.staticText108 = st; + } + + private RadioButton rbIncapacidadeTemp = new RadioButton(); + + public RadioButton getRbIncapacidadeTemp() { + return rbIncapacidadeTemp; + } + + public void setRbIncapacidadeTemp(RadioButton rb) { + this.rbIncapacidadeTemp = rb; + } + + private StaticText staticText109 = new StaticText(); + + public StaticText getStaticText109() { + return staticText109; + } + + public void setStaticText109(StaticText st) { + this.staticText109 = st; + } + + private PanelGroup groupPanel25 = new PanelGroup(); + + public PanelGroup getGroupPanel25() { + return groupPanel25; + } + + public void setGroupPanel25(PanelGroup pg) { + this.groupPanel25 = pg; + } + + private StaticText staticText110 = new StaticText(); + + public StaticText getStaticText110() { + return staticText110; + } + + public void setStaticText110(StaticText st) { + this.staticText110 = st; + } + + private TextField txtCoefIncapacidade = new TextField(); + + public TextField getTxtCoefIncapacidade() { + return txtCoefIncapacidade; + } + + public void setTxtCoefIncapacidade(TextField tf) { + this.txtCoefIncapacidade = tf; + } + + private StaticText staticText111 = new StaticText(); + + public StaticText getStaticText111() { + return staticText111; + } + + public void setStaticText111(StaticText st) { + this.staticText111 = st; + } + + private HtmlPanelGrid gridPanel69 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel69() { + return gridPanel69; + } + + public void setGridPanel69(HtmlPanelGrid hpg) { + this.gridPanel69 = hpg; + } + + private StaticText staticText112 = new StaticText(); + + public StaticText getStaticText112() { + return staticText112; + } + + public void setStaticText112(StaticText st) { + this.staticText112 = st; + } + + private com.sun.rave.web.ui.component.Calendar calAvaliacaoIncap = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalAvaliacaoIncap() { + return calAvaliacaoIncap; + } + + public void setCalAvaliacaoIncap(com.sun.rave.web.ui.component.Calendar c) { + this.calAvaliacaoIncap = c; + } + + private StaticText staticText113 = new StaticText(); + + public StaticText getStaticText113() { + return staticText113; + } + + public void setStaticText113(StaticText st) { + this.staticText113 = st; + } + + private com.sun.rave.web.ui.component.Calendar calRevisaoIncap = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalRevisaoIncap() { + return calRevisaoIncap; + } + + public void setCalRevisaoIncap(com.sun.rave.web.ui.component.Calendar c) { + this.calRevisaoIncap = c; + } + + private HtmlPanelGrid gridPanel70 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel70() { + return gridPanel70; + } + + public void setGridPanel70(HtmlPanelGrid hpg) { + this.gridPanel70 = hpg; + } + + private StaticText staticText114 = new StaticText(); + + public StaticText getStaticText114() { + return staticText114; + } + + public void setStaticText114(StaticText st) { + this.staticText114 = st; + } + + private com.sun.rave.web.ui.component.Calendar calPeridoIncapDe = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalPeridoIncapDe() { + return calPeridoIncapDe; + } + + public void setCalPeridoIncapDe(com.sun.rave.web.ui.component.Calendar c) { + this.calPeridoIncapDe = c; + } + + private StaticText staticText115 = new StaticText(); + + public StaticText getStaticText115() { + return staticText115; + } + + public void setStaticText115(StaticText st) { + this.staticText115 = st; + } + + private com.sun.rave.web.ui.component.Calendar calPeriodoIncapA = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalPeriodoIncapA() { + return calPeriodoIncapA; + } + + public void setCalPeriodoIncapA(com.sun.rave.web.ui.component.Calendar c) { + this.calPeriodoIncapA = c; + } + + private HtmlPanelGrid gridPanel71 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel71() { + return gridPanel71; + } + + public void setGridPanel71(HtmlPanelGrid hpg) { + this.gridPanel71 = hpg; + } + + private StaticText staticText116 = new StaticText(); + + public StaticText getStaticText116() { + return staticText116; + } + + public void setStaticText116(StaticText st) { + this.staticText116 = st; + } + + private HtmlPanelGrid gridRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes() { + return gridRestricoes; + } + + public void setGridRestricoes(HtmlPanelGrid hpg) { + this.gridRestricoes = hpg; + } + + private HtmlPanelGrid gridPanel72 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel72() { + return gridPanel72; + } + + public void setGridPanel72(HtmlPanelGrid hpg) { + this.gridPanel72 = hpg; + } + + private HtmlPanelGrid gridPanel73 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel73() { + return gridPanel73; + } + + public void setGridPanel73(HtmlPanelGrid hpg) { + this.gridPanel73 = hpg; + } + + private HtmlPanelGrid gridPanel74 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel74() { + return gridPanel74; + } + + public void setGridPanel74(HtmlPanelGrid hpg) { + this.gridPanel74 = hpg; + } + + private HtmlPanelGrid gridPanel75 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel75() { + return gridPanel75; + } + + public void setGridPanel75(HtmlPanelGrid hpg) { + this.gridPanel75 = hpg; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private ImageComponent image4 = new ImageComponent(); + + public ImageComponent getImage4() { + return image4; + } + + public void setImage4(ImageComponent ic) { + this.image4 = ic; + } + + private ImageComponent image5 = new ImageComponent(); + + public ImageComponent getImage5() { + return image5; + } + + public void setImage5(ImageComponent ic) { + this.image5 = ic; + } + + private PanelGroup groupPanel26 = new PanelGroup(); + + public PanelGroup getGroupPanel26() { + return groupPanel26; + } + + public void setGroupPanel26(PanelGroup pg) { + this.groupPanel26 = pg; + } + + private StaticText staticText117 = new StaticText(); + + public StaticText getStaticText117() { + return staticText117; + } + + public void setStaticText117(StaticText st) { + this.staticText117 = st; + } + + private Checkbox chkImgFlexao = new Checkbox(); + + public Checkbox getChkImgFlexao() { + return chkImgFlexao; + } + + public void setChkImgFlexao(Checkbox c) { + this.chkImgFlexao = c; + } + + private HtmlPanelGrid gridPanel76 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel76() { + return gridPanel76; + } + + public void setGridPanel76(HtmlPanelGrid hpg) { + this.gridPanel76 = hpg; + } + + private ImageComponent image6 = new ImageComponent(); + + public ImageComponent getImage6() { + return image6; + } + + public void setImage6(ImageComponent ic) { + this.image6 = ic; + } + + private HtmlPanelGrid gridPanel77 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel77() { + return gridPanel77; + } + + public void setGridPanel77(HtmlPanelGrid hpg) { + this.gridPanel77 = hpg; + } + + private ImageComponent image7 = new ImageComponent(); + + public ImageComponent getImage7() { + return image7; + } + + public void setImage7(ImageComponent ic) { + this.image7 = ic; + } + + private ImageComponent image8 = new ImageComponent(); + + public ImageComponent getImage8() { + return image8; + } + + public void setImage8(ImageComponent ic) { + this.image8 = ic; + } + + private PanelGroup groupPanel27 = new PanelGroup(); + + public PanelGroup getGroupPanel27() { + return groupPanel27; + } + + public void setGroupPanel27(PanelGroup pg) { + this.groupPanel27 = pg; + } + + private StaticText staticText118 = new StaticText(); + + public StaticText getStaticText118() { + return staticText118; + } + + public void setStaticText118(StaticText st) { + this.staticText118 = st; + } + + private Checkbox chkImgExt1 = new Checkbox(); + + public Checkbox getChkImgExt1() { + return chkImgExt1; + } + + public void setChkImgExt1(Checkbox c) { + this.chkImgExt1 = c; + } + + private PanelGroup groupPanel28 = new PanelGroup(); + + public PanelGroup getGroupPanel28() { + return groupPanel28; + } + + public void setGroupPanel28(PanelGroup pg) { + this.groupPanel28 = pg; + } + + private StaticText staticText119 = new StaticText(); + + public StaticText getStaticText119() { + return staticText119; + } + + public void setStaticText119(StaticText st) { + this.staticText119 = st; + } + + private Checkbox chkImgExt2 = new Checkbox(); + + public Checkbox getChkImgExt2() { + return chkImgExt2; + } + + public void setChkImgExt2(Checkbox c) { + this.chkImgExt2 = c; + } + + private HtmlPanelGrid gridPanel78 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel78() { + return gridPanel78; + } + + public void setGridPanel78(HtmlPanelGrid hpg) { + this.gridPanel78 = hpg; + } + + private ImageComponent image9 = new ImageComponent(); + + public ImageComponent getImage9() { + return image9; + } + + public void setImage9(ImageComponent ic) { + this.image9 = ic; + } + + private ImageComponent image10 = new ImageComponent(); + + public ImageComponent getImage10() { + return image10; + } + + public void setImage10(ImageComponent ic) { + this.image10 = ic; + } + + private PanelGroup groupPanel29 = new PanelGroup(); + + public PanelGroup getGroupPanel29() { + return groupPanel29; + } + + public void setGroupPanel29(PanelGroup pg) { + this.groupPanel29 = pg; + } + + private StaticText staticText120 = new StaticText(); + + public StaticText getStaticText120() { + return staticText120; + } + + public void setStaticText120(StaticText st) { + this.staticText120 = st; + } + + private Checkbox chkImgCab2 = new Checkbox(); + + public Checkbox getChkImgCab2() { + return chkImgCab2; + } + + public void setChkImgCab2(Checkbox c) { + this.chkImgCab2 = c; + } + + private PanelGroup groupPanel30 = new PanelGroup(); + + public PanelGroup getGroupPanel30() { + return groupPanel30; + } + + public void setGroupPanel30(PanelGroup pg) { + this.groupPanel30 = pg; + } + + private StaticText staticText121 = new StaticText(); + + public StaticText getStaticText121() { + return staticText121; + } + + public void setStaticText121(StaticText st) { + this.staticText121 = st; + } + + private Checkbox chkImgCab3 = new Checkbox(); + + public Checkbox getChkImgCab3() { + return chkImgCab3; + } + + public void setChkImgCab3(Checkbox c) { + this.chkImgCab3 = c; + } + + private HtmlPanelGrid gridPanel79 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel79() { + return gridPanel79; + } + + public void setGridPanel79(HtmlPanelGrid hpg) { + this.gridPanel79 = hpg; + } + + private ImageComponent image12 = new ImageComponent(); + + public ImageComponent getImage12() { + return image12; + } + + public void setImage12(ImageComponent ic) { + this.image12 = ic; + } + + private ImageComponent image13 = new ImageComponent(); + + public ImageComponent getImage13() { + return image13; + } + + public void setImage13(ImageComponent ic) { + this.image13 = ic; + } + + private ImageComponent image14 = new ImageComponent(); + + public ImageComponent getImage14() { + return image14; + } + + public void setImage14(ImageComponent ic) { + this.image14 = ic; + } + + private PanelGroup groupPanel31 = new PanelGroup(); + + public PanelGroup getGroupPanel31() { + return groupPanel31; + } + + public void setGroupPanel31(PanelGroup pg) { + this.groupPanel31 = pg; + } + + private StaticText staticText122 = new StaticText(); + + public StaticText getStaticText122() { + return staticText122; + } + + public void setStaticText122(StaticText st) { + this.staticText122 = st; + } + + private Checkbox chkImgMa2 = new Checkbox(); + + public Checkbox getChkImgMa2() { + return chkImgMa2; + } + + public void setChkImgMa2(Checkbox c) { + this.chkImgMa2 = c; + } + + private PanelGroup groupPanel32 = new PanelGroup(); + + public PanelGroup getGroupPanel32() { + return groupPanel32; + } + + public void setGroupPanel32(PanelGroup pg) { + this.groupPanel32 = pg; + } + + private StaticText staticText123 = new StaticText(); + + public StaticText getStaticText123() { + return staticText123; + } + + public void setStaticText123(StaticText st) { + this.staticText123 = st; + } + + private Checkbox chkImgMa3 = new Checkbox(); + + public Checkbox getChkImgMa3() { + return chkImgMa3; + } + + public void setChkImgMa3(Checkbox c) { + this.chkImgMa3 = c; + } + + private PanelGroup groupPanel33 = new PanelGroup(); + + public PanelGroup getGroupPanel33() { + return groupPanel33; + } + + public void setGroupPanel33(PanelGroup pg) { + this.groupPanel33 = pg; + } + + private StaticText staticText124 = new StaticText(); + + public StaticText getStaticText124() { + return staticText124; + } + + public void setStaticText124(StaticText st) { + this.staticText124 = st; + } + + private Checkbox chkImgMa5 = new Checkbox(); + + public Checkbox getChkImgMa5() { + return chkImgMa5; + } + + public void setChkImgMa5(Checkbox c) { + this.chkImgMa5 = c; + } + + private PanelGroup groupPanel34 = new PanelGroup(); + + public PanelGroup getGroupPanel34() { + return groupPanel34; + } + + public void setGroupPanel34(PanelGroup pg) { + this.groupPanel34 = pg; + } + + private StaticText staticText125 = new StaticText(); + + public StaticText getStaticText125() { + return staticText125; + } + + public void setStaticText125(StaticText st) { + this.staticText125 = st; + } + + private Checkbox chkImgMa6 = new Checkbox(); + + public Checkbox getChkImgMa6() { + return chkImgMa6; + } + + public void setChkImgMa6(Checkbox c) { + this.chkImgMa6 = c; + } + + private HtmlPanelGrid gridPanel80 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel80() { + return gridPanel80; + } + + public void setGridPanel80(HtmlPanelGrid hpg) { + this.gridPanel80 = hpg; + } + + private ImageComponent image15 = new ImageComponent(); + + public ImageComponent getImage15() { + return image15; + } + + public void setImage15(ImageComponent ic) { + this.image15 = ic; + } + + private ImageComponent image16 = new ImageComponent(); + + public ImageComponent getImage16() { + return image16; + } + + public void setImage16(ImageComponent ic) { + this.image16 = ic; + } + + private PanelGroup groupPanel35 = new PanelGroup(); + + public PanelGroup getGroupPanel35() { + return groupPanel35; + } + + public void setGroupPanel35(PanelGroup pg) { + this.groupPanel35 = pg; + } + + private StaticText staticText126 = new StaticText(); + + public StaticText getStaticText126() { + return staticText126; + } + + public void setStaticText126(StaticText st) { + this.staticText126 = st; + } + + private Checkbox chkImgMa8 = new Checkbox(); + + public Checkbox getChkImgMa8() { + return chkImgMa8; + } + + public void setChkImgMa8(Checkbox c) { + this.chkImgMa8 = c; + } + + private PanelGroup groupPanel36 = new PanelGroup(); + + public PanelGroup getGroupPanel36() { + return groupPanel36; + } + + public void setGroupPanel36(PanelGroup pg) { + this.groupPanel36 = pg; + } + + private StaticText staticText127 = new StaticText(); + + public StaticText getStaticText127() { + return staticText127; + } + + public void setStaticText127(StaticText st) { + this.staticText127 = st; + } + + private Checkbox chkImgMa10 = new Checkbox(); + + public Checkbox getChkImgMa10() { + return chkImgMa10; + } + + public void setChkImgMa10(Checkbox c) { + this.chkImgMa10 = c; + } + + private HtmlPanelGrid gridPanel81 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel81() { + return gridPanel81; + } + + public void setGridPanel81(HtmlPanelGrid hpg) { + this.gridPanel81 = hpg; + } + + private StaticText staticText128 = new StaticText(); + + public StaticText getStaticText128() { + return staticText128; + } + + public void setStaticText128(StaticText st) { + this.staticText128 = st; + } + + private PanelGroup groupPanel37 = new PanelGroup(); + + public PanelGroup getGroupPanel37() { + return groupPanel37; + } + + public void setGroupPanel37(PanelGroup pg) { + this.groupPanel37 = pg; + } + + private Checkbox chkRestricaoCargas = new Checkbox(); + + public Checkbox getChkRestricaoCargas() { + return chkRestricaoCargas; + } + + public void setChkRestricaoCargas(Checkbox c) { + this.chkRestricaoCargas = c; + } + + private StaticText staticText129 = new StaticText(); + + public StaticText getStaticText129() { + return staticText129; + } + + public void setStaticText129(StaticText st) { + this.staticText129 = st; + } + + private RadioButton rbKgs2 = new RadioButton(); + + public RadioButton getRbKgs2() { + return rbKgs2; + } + + public void setRbKgs2(RadioButton rb) { + this.rbKgs2 = rb; + } + + private StaticText stKgs2 = new StaticText(); + + public StaticText getStKgs2() { + return stKgs2; + } + + public void setStKgs2(StaticText st) { + this.stKgs2 = st; + } + + private RadioButton rbKgs5 = new RadioButton(); + + public RadioButton getRbKgs5() { + return rbKgs5; + } + + public void setRbKgs5(RadioButton rb) { + this.rbKgs5 = rb; + } + + private StaticText stKgs5 = new StaticText(); + + public StaticText getStKgs5() { + return stKgs5; + } + + public void setStKgs5(StaticText st) { + this.stKgs5 = st; + } + + private RadioButton rbKgs10 = new RadioButton(); + + public RadioButton getRbKgs10() { + return rbKgs10; + } + + public void setRbKgs10(RadioButton rb) { + this.rbKgs10 = rb; + } + + private StaticText stKgs10 = new StaticText(); + + public StaticText getStKgs10() { + return stKgs10; + } + + public void setStKgs10(StaticText st) { + this.stKgs10 = st; + } + + private RadioButton rbKgs15 = new RadioButton(); + + public RadioButton getRbKgs15() { + return rbKgs15; + } + + public void setRbKgs15(RadioButton rb) { + this.rbKgs15 = rb; + } + + private StaticText stKgs15 = new StaticText(); + + public StaticText getStKgs15() { + return stKgs15; + } + + public void setStKgs15(StaticText st) { + this.stKgs15 = st; + } + + private RadioButton rbKgsOutro = new RadioButton(); + + public RadioButton getRbKgsOutro() { + return rbKgsOutro; + } + + public void setRbKgsOutro(RadioButton rb) { + this.rbKgsOutro = rb; + } + + private StaticText stKgsOutro = new StaticText(); + + public StaticText getStKgsOutro() { + return stKgsOutro; + } + + public void setStKgsOutro(StaticText st) { + this.stKgsOutro = st; + } + + private TextField txtKgs = new TextField(); + + public TextField getTxtKgs() { + return txtKgs; + } + + public void setTxtKgs(TextField tf) { + this.txtKgs = tf; + } + + private StaticText stKg = new StaticText(); + + public StaticText getStKg() { + return stKg; + } + + public void setStKg(StaticText st) { + this.stKg = st; + } + + private PanelGroup groupPanel38 = new PanelGroup(); + + public PanelGroup getGroupPanel38() { + return groupPanel38; + } + + public void setGroupPanel38(PanelGroup pg) { + this.groupPanel38 = pg; + } + + private Checkbox chkRestricaoMotricidade = new Checkbox(); + + public Checkbox getChkRestricaoMotricidade() { + return chkRestricaoMotricidade; + } + + public void setChkRestricaoMotricidade(Checkbox c) { + this.chkRestricaoMotricidade = c; + } + + private StaticText staticText136 = new StaticText(); + + public StaticText getStaticText136() { + return staticText136; + } + + public void setStaticText136(StaticText st) { + this.staticText136 = st; + } + + private PanelGroup groupPanel39 = new PanelGroup(); + + public PanelGroup getGroupPanel39() { + return groupPanel39; + } + + public void setGroupPanel39(PanelGroup pg) { + this.groupPanel39 = pg; + } + + private Checkbox chkRestricaoConducao = new Checkbox(); + + public Checkbox getChkRestricaoConducao() { + return chkRestricaoConducao; + } + + public void setChkRestricaoConducao(Checkbox c) { + this.chkRestricaoConducao = c; + } + + private StaticText staticText137 = new StaticText(); + + public StaticText getStaticText137() { + return staticText137; + } + + public void setStaticText137(StaticText st) { + this.staticText137 = st; + } + + private PanelGroup groupPanel40 = new PanelGroup(); + + public PanelGroup getGroupPanel40() { + return groupPanel40; + } + + public void setGroupPanel40(PanelGroup pg) { + this.groupPanel40 = pg; + } + + private Checkbox chkRestricaoVibracoes = new Checkbox(); + + public Checkbox getChkRestricaoVibracoes() { + return chkRestricaoVibracoes; + } + + public void setChkRestricaoVibracoes(Checkbox c) { + this.chkRestricaoVibracoes = c; + } + + private StaticText staticText138 = new StaticText(); + + public StaticText getStaticText138() { + return staticText138; + } + + public void setStaticText138(StaticText st) { + this.staticText138 = st; + } + + private HtmlPanelGrid gridPanel82 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel82() { + return gridPanel82; + } + + public void setGridPanel82(HtmlPanelGrid hpg) { + this.gridPanel82 = hpg; + } + + private PanelGroup groupPanel41 = new PanelGroup(); + + public PanelGroup getGroupPanel41() { + return groupPanel41; + } + + public void setGroupPanel41(PanelGroup pg) { + this.groupPanel41 = pg; + } + + private Checkbox chkRestricaoOutras = new Checkbox(); + + public Checkbox getChkRestricaoOutras() { + return chkRestricaoOutras; + } + + public void setChkRestricaoOutras(Checkbox c) { + this.chkRestricaoOutras = c; + } + + private StaticText staticText139 = new StaticText(); + + public StaticText getStaticText139() { + return staticText139; + } + + public void setStaticText139(StaticText st) { + this.staticText139 = st; + } + + private TextField txtRestricaoOutras = new TextField(); + + public TextField getTxtRestricaoOutras() { + return txtRestricaoOutras; + } + + public void setTxtRestricaoOutras(TextField tf) { + this.txtRestricaoOutras = tf; + } + + private HtmlPanelGrid gridPanel83 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel83() { + return gridPanel83; + } + + public void setGridPanel83(HtmlPanelGrid hpg) { + this.gridPanel83 = hpg; + } + + private StaticText staticText140 = new StaticText(); + + public StaticText getStaticText140() { + return staticText140; + } + + public void setStaticText140(StaticText st) { + this.staticText140 = st; + } + + private TextField txtObservacoes = new TextField(); + + public TextField getTxtObservacoes() { + return txtObservacoes; + } + + public void setTxtObservacoes(TextField tf) { + this.txtObservacoes = tf; + } + + private RadioButton rbIncapacidadePerm = new RadioButton(); + + public RadioButton getRbIncapacidadePerm() { + return rbIncapacidadePerm; + } + + public void setRbIncapacidadePerm(RadioButton rb) { + this.rbIncapacidadePerm = rb; + } + + private StaticText staticText141 = new StaticText(); + + public StaticText getStaticText141() { + return staticText141; + } + + public void setStaticText141(StaticText st) { + this.staticText141 = st; + } + + private ImageComponent image17 = new ImageComponent(); + + public ImageComponent getImage17() { + return image17; + } + + public void setImage17(ImageComponent ic) { + this.image17 = ic; + } + + private ImageComponent image18 = new ImageComponent(); + + public ImageComponent getImage18() { + return image18; + } + + public void setImage18(ImageComponent ic) { + this.image18 = ic; + } + + private HtmlPanelGrid gridPanel84 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel84() { + return gridPanel84; + } + + public void setGridPanel84(HtmlPanelGrid hpg) { + this.gridPanel84 = hpg; + } + + private ImageComponent image19 = new ImageComponent(); + + public ImageComponent getImage19() { + return image19; + } + + public void setImage19(ImageComponent ic) { + this.image19 = ic; + } + + private ImageComponent image20 = new ImageComponent(); + + public ImageComponent getImage20() { + return image20; + } + + public void setImage20(ImageComponent ic) { + this.image20 = ic; + } + + private PanelGroup groupPanel42 = new PanelGroup(); + + public PanelGroup getGroupPanel42() { + return groupPanel42; + } + + public void setGroupPanel42(PanelGroup pg) { + this.groupPanel42 = pg; + } + + private StaticText staticText142 = new StaticText(); + + public StaticText getStaticText142() { + return staticText142; + } + + public void setStaticText142(StaticText st) { + this.staticText142 = st; + } + + private Checkbox chkImgRot1 = new Checkbox(); + + public Checkbox getChkImgRot1() { + return chkImgRot1; + } + + public void setChkImgRot1(Checkbox c) { + this.chkImgRot1 = c; + } + + private PanelGroup groupPanel43 = new PanelGroup(); + + public PanelGroup getGroupPanel43() { + return groupPanel43; + } + + public void setGroupPanel43(PanelGroup pg) { + this.groupPanel43 = pg; + } + + private StaticText staticText143 = new StaticText(); + + public StaticText getStaticText143() { + return staticText143; + } + + public void setStaticText143(StaticText st) { + this.staticText143 = st; + } + + private Checkbox chkImgRot2 = new Checkbox(); + + public Checkbox getChkImgRot2() { + return chkImgRot2; + } + + public void setChkImgRot2(Checkbox c) { + this.chkImgRot2 = c; + } + + private ImageComponent image21 = new ImageComponent(); + + public ImageComponent getImage21() { + return image21; + } + + public void setImage21(ImageComponent ic) { + this.image21 = ic; + } + + private ImageComponent image11 = new ImageComponent(); + + public ImageComponent getImage11() { + return image11; + } + + public void setImage11(ImageComponent ic) { + this.image11 = ic; + } + + private PanelGroup groupPanel44 = new PanelGroup(); + + public PanelGroup getGroupPanel44() { + return groupPanel44; + } + + public void setGroupPanel44(PanelGroup pg) { + this.groupPanel44 = pg; + } + + private StaticText staticText144 = new StaticText(); + + public StaticText getStaticText144() { + return staticText144; + } + + public void setStaticText144(StaticText st) { + this.staticText144 = st; + } + + private Checkbox chkImgCab1 = new Checkbox(); + + public Checkbox getChkImgCab1() { + return chkImgCab1; + } + + public void setChkImgCab1(Checkbox c) { + this.chkImgCab1 = c; + } + + private PanelGroup groupPanel45 = new PanelGroup(); + + public PanelGroup getGroupPanel45() { + return groupPanel45; + } + + public void setGroupPanel45(PanelGroup pg) { + this.groupPanel45 = pg; + } + + private StaticText staticText145 = new StaticText(); + + public StaticText getStaticText145() { + return staticText145; + } + + public void setStaticText145(StaticText st) { + this.staticText145 = st; + } + + private Checkbox chkImgCab4 = new Checkbox(); + + public Checkbox getChkImgCab4() { + return chkImgCab4; + } + + public void setChkImgCab4(Checkbox c) { + this.chkImgCab4 = c; + } + + private ImageComponent image22 = new ImageComponent(); + + public ImageComponent getImage22() { + return image22; + } + + public void setImage22(ImageComponent ic) { + this.image22 = ic; + } + + private ImageComponent image23 = new ImageComponent(); + + public ImageComponent getImage23() { + return image23; + } + + public void setImage23(ImageComponent ic) { + this.image23 = ic; + } + + private ImageComponent image24 = new ImageComponent(); + + public ImageComponent getImage24() { + return image24; + } + + public void setImage24(ImageComponent ic) { + this.image24 = ic; + } + + private PanelGroup groupPanel46 = new PanelGroup(); + + public PanelGroup getGroupPanel46() { + return groupPanel46; + } + + public void setGroupPanel46(PanelGroup pg) { + this.groupPanel46 = pg; + } + + private StaticText staticText146 = new StaticText(); + + public StaticText getStaticText146() { + return staticText146; + } + + public void setStaticText146(StaticText st) { + this.staticText146 = st; + } + + private Checkbox chkImgMa1 = new Checkbox(); + + public Checkbox getChkImgMa1() { + return chkImgMa1; + } + + public void setChkImgMa1(Checkbox c) { + this.chkImgMa1 = c; + } + + private PanelGroup groupPanel47 = new PanelGroup(); + + public PanelGroup getGroupPanel47() { + return groupPanel47; + } + + public void setGroupPanel47(PanelGroup pg) { + this.groupPanel47 = pg; + } + + private StaticText staticText147 = new StaticText(); + + public StaticText getStaticText147() { + return staticText147; + } + + public void setStaticText147(StaticText st) { + this.staticText147 = st; + } + + private Checkbox chkImgMa4 = new Checkbox(); + + public Checkbox getChkImgMa4() { + return chkImgMa4; + } + + public void setChkImgMa4(Checkbox c) { + this.chkImgMa4 = c; + } + + private ImageComponent image25 = new ImageComponent(); + + public ImageComponent getImage25() { + return image25; + } + + public void setImage25(ImageComponent ic) { + this.image25 = ic; + } + + private ImageComponent image26 = new ImageComponent(); + + public ImageComponent getImage26() { + return image26; + } + + public void setImage26(ImageComponent ic) { + this.image26 = ic; + } + + private PanelGroup groupPanel48 = new PanelGroup(); + + public PanelGroup getGroupPanel48() { + return groupPanel48; + } + + public void setGroupPanel48(PanelGroup pg) { + this.groupPanel48 = pg; + } + + private StaticText staticText148 = new StaticText(); + + public StaticText getStaticText148() { + return staticText148; + } + + public void setStaticText148(StaticText st) { + this.staticText148 = st; + } + + private Checkbox chkImgMa7 = new Checkbox(); + + public Checkbox getChkImgMa7() { + return chkImgMa7; + } + + public void setChkImgMa7(Checkbox c) { + this.chkImgMa7 = c; + } + + private PanelGroup groupPanel49 = new PanelGroup(); + + public PanelGroup getGroupPanel49() { + return groupPanel49; + } + + public void setGroupPanel49(PanelGroup pg) { + this.groupPanel49 = pg; + } + + private StaticText staticText149 = new StaticText(); + + public StaticText getStaticText149() { + return staticText149; + } + + public void setStaticText149(StaticText st) { + this.staticText149 = st; + } + + private Checkbox chkImgMa9 = new Checkbox(); + + public Checkbox getChkImgMa9() { + return chkImgMa9; + } + + public void setChkImgMa9(Checkbox c) { + this.chkImgMa9 = c; + } + + private HtmlPanelGrid gridMedicoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedicoView() { + return gridMedicoView; + } + + public void setGridMedicoView(HtmlPanelGrid hpg) { + this.gridMedicoView = hpg; + } + + private HtmlPanelGrid gridPanel85 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel85() { + return gridPanel85; + } + + public void setGridPanel85(HtmlPanelGrid hpg) { + this.gridPanel85 = hpg; + } + + private StaticText staticText150 = new StaticText(); + + public StaticText getStaticText150() { + return staticText150; + } + + public void setStaticText150(StaticText st) { + this.staticText150 = st; + } + + private HtmlPanelGrid gridLesao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao() { + return gridLesao; + } + + public void setGridLesao(HtmlPanelGrid hpg) { + this.gridLesao = hpg; + } + + private StaticText staticText151 = new StaticText(); + + public StaticText getStaticText151() { + return staticText151; + } + + public void setStaticText151(StaticText st) { + this.staticText151 = st; + } + + private HtmlPanelGrid gridPanel86 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel86() { + return gridPanel86; + } + + public void setGridPanel86(HtmlPanelGrid hpg) { + this.gridPanel86 = hpg; + } + + private StaticText staticText152 = new StaticText(); + + public StaticText getStaticText152() { + return staticText152; + } + + public void setStaticText152(StaticText st) { + this.staticText152 = st; + } + + private HtmlPanelGrid gridIncapacidade2 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade2() { + return gridIncapacidade2; + } + + public void setGridIncapacidade2(HtmlPanelGrid hpg) { + this.gridIncapacidade2 = hpg; + } + + private HtmlPanelGrid gridPanel87 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel87() { + return gridPanel87; + } + + public void setGridPanel87(HtmlPanelGrid hpg) { + this.gridPanel87 = hpg; + } + + private StaticText staticText153 = new StaticText(); + + public StaticText getStaticText153() { + return staticText153; + } + + public void setStaticText153(StaticText st) { + this.staticText153 = st; + } + + private HtmlPanelGrid gridRestricoes1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes1() { + return gridRestricoes1; + } + + public void setGridRestricoes1(HtmlPanelGrid hpg) { + this.gridRestricoes1 = hpg; + } + + private HtmlPanelGrid gridPanel88 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel88() { + return gridPanel88; + } + + public void setGridPanel88(HtmlPanelGrid hpg) { + this.gridPanel88 = hpg; + } + + private HtmlPanelGrid gridImagesRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImagesRestricoes() { + return gridImagesRestricoes; + } + + public void setGridImagesRestricoes(HtmlPanelGrid hpg) { + this.gridImagesRestricoes = hpg; + } + + private HtmlPanelGrid gridOutrasRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridOutrasRestricoes() { + return gridOutrasRestricoes; + } + + public void setGridOutrasRestricoes(HtmlPanelGrid hpg) { + this.gridOutrasRestricoes = hpg; + } + + private StaticText staticText154 = new StaticText(); + + public StaticText getStaticText154() { + return staticText154; + } + + public void setStaticText154(StaticText st) { + this.staticText154 = st; + } + + private HtmlPanelGrid gridPanel90 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel90() { + return gridPanel90; + } + + public void setGridPanel90(HtmlPanelGrid hpg) { + this.gridPanel90 = hpg; + } + + private StaticText staticText155 = new StaticText(); + + public StaticText getStaticText155() { + return staticText155; + } + + public void setStaticText155(StaticText st) { + this.staticText155 = st; + } + + private StaticText stObservacoes = new StaticText(); + + public StaticText getStObservacoes() { + return stObservacoes; + } + + public void setStObservacoes(StaticText st) { + this.stObservacoes = st; + } + + private HtmlPanelGrid gridHeader1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridHeader1() { + return gridHeader1; + } + + public void setGridHeader1(HtmlPanelGrid hpg) { + this.gridHeader1 = hpg; + } + + private PanelGroup groupPanel56 = new PanelGroup(); + + public PanelGroup getGroupPanel56() { + return groupPanel56; + } + + public void setGroupPanel56(PanelGroup pg) { + this.groupPanel56 = pg; + } + + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + + private StaticText staticText165 = new StaticText(); + + public StaticText getStaticText165() { + return staticText165; + } + + public void setStaticText165(StaticText st) { + this.staticText165 = st; + } + + private Hyperlink lnkEditUser = new Hyperlink(); + + public Hyperlink getLnkEditUser() { + return lnkEditUser; + } + + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; + } + + private StaticText staticText166 = new StaticText(); + + public StaticText getStaticText166() { + return staticText166; + } + + public void setStaticText166(StaticText st) { + this.staticText166 = st; + } + + private Hyperlink lnkLogout = new Hyperlink(); + + public Hyperlink getLnkLogout() { + return lnkLogout; + } + + public void setLnkLogout(Hyperlink h) { + this.lnkLogout = h; + } + + private HtmlPanelGrid gridPanel114 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel114() { + return gridPanel114; + } + + public void setGridPanel114(HtmlPanelGrid hpg) { + this.gridPanel114 = hpg; + } + + private PanelGroup groupPanel57 = new PanelGroup(); + + public PanelGroup getGroupPanel57() { + return groupPanel57; + } + + public void setGroupPanel57(PanelGroup pg) { + this.groupPanel57 = pg; + } + + private ImageComponent image27 = new ImageComponent(); + + public ImageComponent getImage27() { + return image27; + } + + public void setImage27(ImageComponent ic) { + this.image27 = ic; + } + + private HtmlPanelGrid gridPanel115 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel115() { + return gridPanel115; + } + + public void setGridPanel115(HtmlPanelGrid hpg) { + this.gridPanel115 = hpg; + } + + private StaticText staticText168 = new StaticText(); + + public StaticText getStaticText168() { + return staticText168; + } + + public void setStaticText168(StaticText st) { + this.staticText168 = st; + } + + private HtmlPanelGrid gridPanel116 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel116() { + return gridPanel116; + } + + public void setGridPanel116(HtmlPanelGrid hpg) { + this.gridPanel116 = hpg; + } + + private PanelGroup groupPanel58 = new PanelGroup(); + + public PanelGroup getGroupPanel58() { + return groupPanel58; + } + + public void setGroupPanel58(PanelGroup pg) { + this.groupPanel58 = pg; + } + + private StaticText staticText169 = new StaticText(); + + public StaticText getStaticText169() { + return staticText169; + } + + public void setStaticText169(StaticText st) { + this.staticText169 = st; + } + + private StaticText stHeaderNr = new StaticText(); + + public StaticText getStHeaderNr() { + return stHeaderNr; + } + + public void setStHeaderNr(StaticText st) { + this.stHeaderNr = st; + } + + private PanelGroup groupPanel59 = new PanelGroup(); + + public PanelGroup getGroupPanel59() { + return groupPanel59; + } + + public void setGroupPanel59(PanelGroup pg) { + this.groupPanel59 = pg; + } + + private StaticText staticText170 = new StaticText(); + + public StaticText getStaticText170() { + return staticText170; + } + + public void setStaticText170(StaticText st) { + this.staticText170 = st; + } + + private StaticText stHeaderDate = new StaticText(); + + public StaticText getStHeaderDate() { + return stHeaderDate; + } + + public void setStHeaderDate(StaticText st) { + this.stHeaderDate = st; + } + + private ImageComponent image28 = new ImageComponent(); + + public ImageComponent getImage28() { + return image28; + } + + public void setImage28(ImageComponent ic) { + this.image28 = ic; + } + + private PanelGroup groupPanel1 = new PanelGroup(); + + public PanelGroup getGroupPanel1() { + return groupPanel1; + } + + public void setGroupPanel1(PanelGroup pg) { + this.groupPanel1 = pg; + } + + private RadioButton rbTurnoManha = new RadioButton(); + + public RadioButton getRbTurnoManha() { + return rbTurnoManha; + } + + public void setRbTurnoManha(RadioButton rb) { + this.rbTurnoManha = rb; + } + + 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 RadioButton rbTurnoTarde = new RadioButton(); + + public RadioButton getRbTurnoTarde() { + return rbTurnoTarde; + } + + public void setRbTurnoTarde(RadioButton rb) { + this.rbTurnoTarde = rb; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private StaticText staticText41 = new StaticText(); + + public StaticText getStaticText41() { + return staticText41; + } + + public void setStaticText41(StaticText st) { + this.staticText41 = st; + } + + private RadioButton rbTurnoNoite = new RadioButton(); + + public RadioButton getRbTurnoNoite() { + return rbTurnoNoite; + } + + public void setRbTurnoNoite(RadioButton rb) { + this.rbTurnoNoite = rb; + } + + private StaticText staticText42 = new StaticText(); + + public StaticText getStaticText42() { + return staticText42; + } + + public void setStaticText42(StaticText st) { + this.staticText42 = st; + } + + private HiddenField hidDisableEnviar = new HiddenField(); + + public HiddenField getHidDisableEnviar() { + return hidDisableEnviar; + } + + public void setHidDisableEnviar(HiddenField hf) { + this.hidDisableEnviar = hf; + } + + private PanelGroup groupPanel2 = new PanelGroup(); + + public PanelGroup getGroupPanel2() { + return groupPanel2; + } + + public void setGroupPanel2(PanelGroup pg) { + this.groupPanel2 = pg; + } + + private StaticText staticText43 = new StaticText(); + + public StaticText getStaticText43() { + return staticText43; + } + + public void setStaticText43(StaticText st) { + this.staticText43 = st; + } + + private TextField txtNrMecanografico = new TextField(); + + public TextField getTxtNrMecanografico() { + return txtNrMecanografico; + } + + public void setTxtNrMecanografico(TextField tf) { + this.txtNrMecanografico = tf; + } + + private StaticText staticText44 = new StaticText(); + + public StaticText getStaticText44() { + return staticText44; + } + + public void setStaticText44(StaticText st) { + this.staticText44 = st; + } + + private TextField txtNomeTrabalhador = new TextField(); + + public TextField getTxtNomeTrabalhador() { + return txtNomeTrabalhador; + } + + public void setTxtNomeTrabalhador(TextField tf) { + this.txtNomeTrabalhador = tf; + } + + private StaticText staticText45 = new StaticText(); + + public StaticText getStaticText45() { + return staticText45; + } + + public void setStaticText45(StaticText st) { + this.staticText45 = st; + } + + private Button butProcurarTrab = new Button(); + + public Button getButProcurarTrab() { + return butProcurarTrab; + } + + public void setButProcurarTrab(Button b) { + this.butProcurarTrab = b; + } + + private Table tblTrabalhadores = new Table(); + + public Table getTblTrabalhadores() { + return tblTrabalhadores; + } + + public void setTblTrabalhadores(Table t) { + this.tblTrabalhadores = 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 DefaultTableDataProvider defaultTableDataProvider = new DefaultTableDataProvider(); + + public DefaultTableDataProvider getDefaultTableDataProvider() { + return defaultTableDataProvider; + } + + public void setDefaultTableDataProvider(DefaultTableDataProvider dtdp) { + this.defaultTableDataProvider = dtdp; + } + + private Hyperlink lnkPOR = new Hyperlink(); + + public Hyperlink getLnkPOR() { + return lnkPOR; + } + + public void setLnkPOR(Hyperlink h) { + this.lnkPOR = h; + } + + private Hyperlink lnkNomeTrabalhador = new Hyperlink(); + + public Hyperlink getLnkNomeTrabalhador() { + return lnkNomeTrabalhador; + } + + public void setLnkNomeTrabalhador(Hyperlink h) { + this.lnkNomeTrabalhador = h; + } + + private Hyperlink lnkEstabelecimentoTrabalhador = new Hyperlink(); + + public Hyperlink getLnkEstabelecimentoTrabalhador() { + return lnkEstabelecimentoTrabalhador; + } + + public void setLnkEstabelecimentoTrabalhador(Hyperlink h) { + this.lnkEstabelecimentoTrabalhador = h; + } + + private StaticText stTecnicoNomeEdit = new StaticText(); + + public StaticText getStTecnicoNomeEdit() { + return stTecnicoNomeEdit; + } + + public void setStTecnicoNomeEdit(StaticText st) { + this.stTecnicoNomeEdit = st; + } + + private HtmlPanelGrid gridDadosAcidenteSegView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteSegView() { + return gridDadosAcidenteSegView; + } + + public void setGridDadosAcidenteSegView(HtmlPanelGrid hpg) { + this.gridDadosAcidenteSegView = hpg; + } + + private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel1() { + return gridPanel1; + } + + public void setGridPanel1(HtmlPanelGrid hpg) { + this.gridPanel1 = hpg; + } + + private StaticText staticText95 = new StaticText(); + + public StaticText getStaticText95() { + return staticText95; + } + + public void setStaticText95(StaticText st) { + this.staticText95 = st; + } + + private HtmlPanelGrid gridPanel117 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel117() { + return gridPanel117; + } + + public void setGridPanel117(HtmlPanelGrid hpg) { + this.gridPanel117 = hpg; + } + + private HtmlPanelGrid gridTurnoSeccaoLocal = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTurnoSeccaoLocal() { + return gridTurnoSeccaoLocal; + } + + public void setGridTurnoSeccaoLocal(HtmlPanelGrid hpg) { + this.gridTurnoSeccaoLocal = hpg; + } + + private StaticText lblHorasTurno = new StaticText(); + + public StaticText getLblHorasTurno() { + return lblHorasTurno; + } + + public void setLblHorasTurno(StaticText st) { + this.lblHorasTurno = st; + } + + private StaticText txtHorasTurno2 = new StaticText(); + + public StaticText getTxtHorasTurno2() { + return txtHorasTurno2; + } + + public void setTxtHorasTurno2(StaticText st) { + this.txtHorasTurno2 = st; + } + + private StaticText lblSeccao = new StaticText(); + + public StaticText getLblSeccao() { + return lblSeccao; + } + + public void setLblSeccao(StaticText st) { + this.lblSeccao = st; + } + + private StaticText txtSeccao1 = new StaticText(); + + public StaticText getTxtSeccao1() { + return txtSeccao1; + } + + public void setTxtSeccao1(StaticText st) { + this.txtSeccao1 = st; + } + + private StaticText lblLocal = new StaticText(); + + public StaticText getLblLocal() { + return lblLocal; + } + + public void setLblLocal(StaticText st) { + this.lblLocal = st; + } + + private StaticText txtLocal1 = new StaticText(); + + public StaticText getTxtLocal1() { + return txtLocal1; + } + + public void setTxtLocal1(StaticText st) { + this.txtLocal1 = st; + } + + private HtmlPanelGrid gridTarefa = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTarefa() { + return gridTarefa; + } + + public void setGridTarefa(HtmlPanelGrid hpg) { + this.gridTarefa = hpg; + } + + private StaticText lblTarefa = new StaticText(); + + public StaticText getLblTarefa() { + return lblTarefa; + } + + public void setLblTarefa(StaticText st) { + this.lblTarefa = st; + } + + private StaticText txtTarefa1 = new StaticText(); + + public StaticText getTxtTarefa1() { + return txtTarefa1; + } + + public void setTxtTarefa1(StaticText st) { + this.txtTarefa1 = st; + } + + private HtmlPanelGrid gridSubstancias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSubstancias() { + return gridSubstancias; + } + + public void setGridSubstancias(HtmlPanelGrid hpg) { + this.gridSubstancias = hpg; + } + + private StaticText lblSubstancias = new StaticText(); + + public StaticText getLblSubstancias() { + return lblSubstancias; + } + + public void setLblSubstancias(StaticText st) { + this.lblSubstancias = st; + } + + private StaticText txtSubstancias1 = new StaticText(); + + public StaticText getTxtSubstancias1() { + return txtSubstancias1; + } + + public void setTxtSubstancias1(StaticText st) { + this.txtSubstancias1 = st; + } + + private HtmlPanelGrid gridCondicoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCondicoes() { + return gridCondicoes; + } + + public void setGridCondicoes(HtmlPanelGrid hpg) { + this.gridCondicoes = hpg; + } + + private StaticText lblCondicoes = new StaticText(); + + public StaticText getLblCondicoes() { + return lblCondicoes; + } + + public void setLblCondicoes(StaticText st) { + this.lblCondicoes = st; + } + + private StaticText txtCondicoes1 = new StaticText(); + + public StaticText getTxtCondicoes1() { + return txtCondicoes1; + } + + public void setTxtCondicoes1(StaticText st) { + this.txtCondicoes1 = st; + } + + private HtmlPanelGrid gridTestemunhas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTestemunhas() { + return gridTestemunhas; + } + + public void setGridTestemunhas(HtmlPanelGrid hpg) { + this.gridTestemunhas = hpg; + } + + private StaticText lblTestemunhas = new StaticText(); + + public StaticText getLblTestemunhas() { + return lblTestemunhas; + } + + public void setLblTestemunhas(StaticText st) { + this.lblTestemunhas = st; + } + + private StaticText txtTestemunhas1 = new StaticText(); + + public StaticText getTxtTestemunhas1() { + return txtTestemunhas1; + } + + public void setTxtTestemunhas1(StaticText st) { + this.txtTestemunhas1 = st; + } + + private HtmlPanelGrid gridCausas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCausas() { + return gridCausas; + } + + public void setGridCausas(HtmlPanelGrid hpg) { + this.gridCausas = hpg; + } + + private StaticText lblCausas = new StaticText(); + + public StaticText getLblCausas() { + return lblCausas; + } + + public void setLblCausas(StaticText st) { + this.lblCausas = st; + } + + private StaticText txtCausas1 = new StaticText(); + + public StaticText getTxtCausas1() { + return txtCausas1; + } + + public void setTxtCausas1(StaticText st) { + this.txtCausas1 = st; + } + + private HtmlPanelGrid gridDescricao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDescricao() { + return gridDescricao; + } + + public void setGridDescricao(HtmlPanelGrid hpg) { + this.gridDescricao = hpg; + } + + private StaticText lblDescricao = new StaticText(); + + public StaticText getLblDescricao() { + return lblDescricao; + } + + public void setLblDescricao(StaticText st) { + this.lblDescricao = st; + } + + private StaticText txtDescricao1 = new StaticText(); + + public StaticText getTxtDescricao1() { + return txtDescricao1; + } + + public void setTxtDescricao1(StaticText st) { + this.txtDescricao1 = st; + } + + private HtmlPanelGrid gridFotografias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridFotografias() { + return gridFotografias; + } + + public void setGridFotografias(HtmlPanelGrid hpg) { + this.gridFotografias = hpg; + } + + private HtmlPanelGrid gridPanel127 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel127() { + return gridPanel127; + } + + public void setGridPanel127(HtmlPanelGrid hpg) { + this.gridPanel127 = hpg; + } + + private StaticText lblFotografias = new StaticText(); + + public StaticText getLblFotografias() { + return lblFotografias; + } + + public void setLblFotografias(StaticText st) { + this.lblFotografias = st; + } + + private HtmlPanelGrid gridImages1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImages1() { + return gridImages1; + } + + public void setGridImages1(HtmlPanelGrid hpg) { + this.gridImages1 = hpg; + } + + private HtmlPanelGrid gridConclusoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConclusoes() { + return gridConclusoes; + } + + public void setGridConclusoes(HtmlPanelGrid hpg) { + this.gridConclusoes = hpg; + } + + private StaticText lblConclusoes = new StaticText(); + + public StaticText getLblConclusoes() { + return lblConclusoes; + } + + public void setLblConclusoes(StaticText st) { + this.lblConclusoes = st; + } + + private StaticText txtConclusoes1 = new StaticText(); + + public StaticText getTxtConclusoes1() { + return txtConclusoes1; + } + + public void setTxtConclusoes1(StaticText st) { + this.txtConclusoes1 = st; + } + + private HtmlPanelGrid gridAccoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAccoes() { + return gridAccoes; + } + + public void setGridAccoes(HtmlPanelGrid hpg) { + this.gridAccoes = hpg; + } + + private StaticText lblAccoes = new StaticText(); + + public StaticText getLblAccoes() { + return lblAccoes; + } + + public void setLblAccoes(StaticText st) { + this.lblAccoes = st; + } + + private StaticText txtAccoes1 = new StaticText(); + + public StaticText getTxtAccoes1() { + return txtAccoes1; + } + + public void setTxtAccoes1(StaticText st) { + this.txtAccoes1 = st; + } + + private HtmlPanelGrid gridDataHora = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDataHora() { + return gridDataHora; + } + + public void setGridDataHora(HtmlPanelGrid hpg) { + this.gridDataHora = hpg; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText lblDataAcidente = new StaticText(); + + public StaticText getLblDataAcidente() { + return lblDataAcidente; + } + + public void setLblDataAcidente(StaticText st) { + this.lblDataAcidente = st; + } + + private StaticText stDataAcidente1 = new StaticText(); + + public StaticText getStDataAcidente1() { + return stDataAcidente1; + } + + public void setStDataAcidente1(StaticText st) { + this.stDataAcidente1 = st; + } + + private PanelGroup groupPanel60 = new PanelGroup(); + + public PanelGroup getGroupPanel60() { + return groupPanel60; + } + + public void setGroupPanel60(PanelGroup pg) { + this.groupPanel60 = pg; + } + + private StaticText lblHoraAcidente = new StaticText(); + + public StaticText getLblHoraAcidente() { + return lblHoraAcidente; + } + + public void setLblHoraAcidente(StaticText st) { + this.lblHoraAcidente = st; + } + + private StaticText stHoraAcidente1 = new StaticText(); + + public StaticText getStHoraAcidente1() { + return stHoraAcidente1; + } + + public void setStHoraAcidente1(StaticText st) { + this.stHoraAcidente1 = st; + } + + private HtmlPanelGrid gridVerificacao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridVerificacao() { + return gridVerificacao; + } + + public void setGridVerificacao(HtmlPanelGrid hpg) { + this.gridVerificacao = hpg; + } + + private HtmlPanelGrid gridPanel131 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel131() { + return gridPanel131; + } + + public void setGridPanel131(HtmlPanelGrid hpg) { + this.gridPanel131 = hpg; + } + + private StaticText staticText52 = new StaticText(); + + public StaticText getStaticText52() { + return staticText52; + } + + public void setStaticText52(StaticText st) { + this.staticText52 = st; + } + + private HtmlPanelGrid gridPanel132 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel132() { + return gridPanel132; + } + + public void setGridPanel132(HtmlPanelGrid hpg) { + this.gridPanel132 = hpg; + } + + private HtmlPanelGrid gridPanel133 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel133() { + return gridPanel133; + } + + public void setGridPanel133(HtmlPanelGrid hpg) { + this.gridPanel133 = hpg; + } + + private PanelGroup grpVerHs = new PanelGroup(); + + public PanelGroup getGrpVerHs() { + return grpVerHs; + } + + public void setGrpVerHs(PanelGroup pg) { + this.grpVerHs = pg; + } + + private Checkbox chkVerHs = new Checkbox(); + + public Checkbox getChkVerHs() { + return chkVerHs; + } + + public void setChkVerHs(Checkbox c) { + this.chkVerHs = c; + } + + private StaticText stVerHs = new StaticText(); + + public StaticText getStVerHs() { + return stVerHs; + } + + public void setStVerHs(StaticText st) { + this.stVerHs = st; + } + + private PanelGroup grpVerRespSeg = new PanelGroup(); + + public PanelGroup getGrpVerRespSeg() { + return grpVerRespSeg; + } + + public void setGrpVerRespSeg(PanelGroup pg) { + this.grpVerRespSeg = pg; + } + + private Checkbox chkVerRespSeg = new Checkbox(); + + public Checkbox getChkVerRespSeg() { + return chkVerRespSeg; + } + + public void setChkVerRespSeg(Checkbox c) { + this.chkVerRespSeg = c; + } + + private StaticText stVerRespSeg = new StaticText(); + + public StaticText getStVerRespSeg() { + return stVerRespSeg; + } + + public void setStVerRespSeg(StaticText st) { + this.stVerRespSeg = st; + } + + private PanelGroup grpVerRespRh = new PanelGroup(); + + public PanelGroup getGrpVerRespRh() { + return grpVerRespRh; + } + + public void setGrpVerRespRh(PanelGroup pg) { + this.grpVerRespRh = pg; + } + + private Checkbox chkVerRespRh = new Checkbox(); + + public Checkbox getChkVerRespRh() { + return chkVerRespRh; + } + + public void setChkVerRespRh(Checkbox c) { + this.chkVerRespRh = c; + } + + private StaticText stVerRespRh = new StaticText(); + + public StaticText getStVerRespRh() { + return stVerRespRh; + } + + public void setStVerRespRh(StaticText st) { + this.stVerRespRh = st; + } + + private HtmlPanelGrid gridVerificacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridVerificacaoView() { + return gridVerificacaoView; + } + + public void setGridVerificacaoView(HtmlPanelGrid hpg) { + this.gridVerificacaoView = hpg; + } + + private HtmlPanelGrid gridPanel134 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel134() { + return gridPanel134; + } + + public void setGridPanel134(HtmlPanelGrid hpg) { + this.gridPanel134 = hpg; + } + + private StaticText staticText187 = new StaticText(); + + public StaticText getStaticText187() { + return staticText187; + } + + public void setStaticText187(StaticText st) { + this.staticText187 = st; + } + + private HtmlPanelGrid gridPanel135 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel135() { + return gridPanel135; + } + + public void setGridPanel135(HtmlPanelGrid hpg) { + this.gridPanel135 = hpg; + } + + private HtmlPanelGrid gridAssinaturasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssinaturasView() { + return gridAssinaturasView; + } + + public void setGridAssinaturasView(HtmlPanelGrid hpg) { + this.gridAssinaturasView = hpg; + } + + private DropDown drpCausas = new DropDown(); + + public DropDown getDrpCausas() { + return drpCausas; + } + + public void setDrpCausas(DropDown dd) { + this.drpCausas = dd; + } + + private StaticText stObservacoesCorr = new StaticText(); + + public StaticText getStObservacoesCorr() { + return stObservacoesCorr; + } + + public void setStObservacoesCorr(StaticText st) { + this.stObservacoesCorr = st; + } + + private HtmlPanelGrid gridImpressao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImpressao() { + return gridImpressao; + } + + public void setGridImpressao(HtmlPanelGrid hpg) { + this.gridImpressao = hpg; + } + + private HtmlPanelGrid gridPanel89 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel89() { + return gridPanel89; + } + + public void setGridPanel89(HtmlPanelGrid hpg) { + this.gridPanel89 = hpg; + } + + private StaticText staticText73 = new StaticText(); + + public StaticText getStaticText73() { + return staticText73; + } + + public void setStaticText73(StaticText st) { + this.staticText73 = st; + } + + private HtmlPanelGrid gridPanel91 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel91() { + return gridPanel91; + } + + public void setGridPanel91(HtmlPanelGrid hpg) { + this.gridPanel91 = hpg; + } + + private HtmlPanelGrid gridPanel92 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel92() { + return gridPanel92; + } + + public void setGridPanel92(HtmlPanelGrid hpg) { + this.gridPanel92 = hpg; + } + + private PanelGroup grpAssSup = new PanelGroup(); + + public PanelGroup getGrpAssSup() { + return grpAssSup; + } + + public void setGrpAssSup(PanelGroup pg) { + this.grpAssSup = pg; + } + + private Checkbox chkAssSup = new Checkbox(); + + public Checkbox getChkAssSup() { + return chkAssSup; + } + + public void setChkAssSup(Checkbox c) { + this.chkAssSup = c; + } + + private StaticText stAssSup1 = new StaticText(); + + public StaticText getStAssSup1() { + return stAssSup1; + } + + public void setStAssSup1(StaticText st) { + this.stAssSup1 = st; + } + + private HtmlPanelGrid gridImpressaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImpressaoView() { + return gridImpressaoView; + } + + public void setGridImpressaoView(HtmlPanelGrid hpg) { + this.gridImpressaoView = hpg; + } + + private HtmlPanelGrid gridPanel93 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel93() { + return gridPanel93; + } + + public void setGridPanel93(HtmlPanelGrid hpg) { + this.gridPanel93 = hpg; + } + + private StaticText staticText76 = new StaticText(); + + public StaticText getStaticText76() { + return staticText76; + } + + public void setStaticText76(StaticText st) { + this.staticText76 = st; + } + + private HtmlPanelGrid gridPanel94 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel94() { + return gridPanel94; + } + + public void setGridPanel94(HtmlPanelGrid hpg) { + this.gridPanel94 = hpg; + } + + private HtmlPanelGrid gridAssSupView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssSupView() { + return gridAssSupView; + } + + public void setGridAssSupView(HtmlPanelGrid hpg) { + this.gridAssSupView = hpg; + } + + private HtmlPanelGrid gridPanel22 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel22() { + return gridPanel22; + } + + public void setGridPanel22(HtmlPanelGrid hpg) { + this.gridPanel22 = 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 butImprimir = new Button(); + + public Button getButImprimir() { + return butImprimir; + } + + public void setButImprimir(Button b) { + this.butImprimir = b; + } + + private Button butGravar = new Button(); + + public Button getButGravar() { + return butGravar; + } + + public void setButGravar(Button b) { + this.butGravar = b; + } + + private Button butCorrecao = new Button(); + + public Button getButCorrecao() { + return butCorrecao; + } + + public void setButCorrecao(Button b) { + this.butCorrecao = b; + } + + private Button butEnviar = new Button(); + + public Button getButEnviar() { + return butEnviar; + } + + public void setButEnviar(Button b) { + this.butEnviar = b; + } + + private TextField txtAssSup = new TextField(); + + public TextField getTxtAssSup() { + return txtAssSup; + } + + public void setTxtAssSup(TextField tf) { + this.txtAssSup = tf; + } + + private StaticText stAssSup2 = new StaticText(); + + public StaticText getStAssSup2() { + return stAssSup2; + } + + public void setStAssSup2(StaticText st) { + this.stAssSup2 = st; + } + + private HtmlPanelGrid gridPanel95 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel95() { + return gridPanel95; + } + + public void setGridPanel95(HtmlPanelGrid hpg) { + this.gridPanel95 = hpg; + } + + private PanelGroup groupPanel50 = new PanelGroup(); + + public PanelGroup getGroupPanel50() { + return groupPanel50; + } + + public void setGroupPanel50(PanelGroup pg) { + this.groupPanel50 = pg; + } + + private StaticText staticText98 = new StaticText(); + + public StaticText getStaticText98() { + return staticText98; + } + + public void setStaticText98(StaticText st) { + this.staticText98 = st; + } + + private TextField txtAveriguador = new TextField(); + + public TextField getTxtAveriguador() { + return txtAveriguador; + } + + public void setTxtAveriguador(TextField tf) { + this.txtAveriguador = tf; + } + + private HtmlPanelGrid gridPanel96 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel96() { + return gridPanel96; + } + + public void setGridPanel96(HtmlPanelGrid hpg) { + this.gridPanel96 = hpg; + } + + private PanelGroup groupPanel51 = new PanelGroup(); + + public PanelGroup getGroupPanel51() { + return groupPanel51; + } + + public void setGroupPanel51(PanelGroup pg) { + this.groupPanel51 = pg; + } + + private StaticText staticText101 = new StaticText(); + + public StaticText getStaticText101() { + return staticText101; + } + + public void setStaticText101(StaticText st) { + this.staticText101 = st; + } + + private StaticText stAveriguador = new StaticText(); + + public StaticText getStAveriguador() { + return stAveriguador; + } + + public void setStAveriguador(StaticText st) { + this.stAveriguador = st; + } + + private HtmlPanelGrid gridPanel97 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel97() { + return gridPanel97; + } + + public void setGridPanel97(HtmlPanelGrid hpg) { + this.gridPanel97 = hpg; + } + + private PanelGroup groupPanel52 = new PanelGroup(); + + public PanelGroup getGroupPanel52() { + return groupPanel52; + } + + public void setGroupPanel52(PanelGroup pg) { + this.groupPanel52 = pg; + } + + private Checkbox chkAveriguacaoPosterior = new Checkbox(); + + public Checkbox getChkAveriguacaoPosterior() { + return chkAveriguacaoPosterior; + } + + public void setChkAveriguacaoPosterior(Checkbox c) { + this.chkAveriguacaoPosterior = c; + } + + private StaticText staticText132 = new StaticText(); + + public StaticText getStaticText132() { + return staticText132; + } + + public void setStaticText132(StaticText st) { + this.staticText132 = st; + } + + private HtmlPanelGrid gridPanel98 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel98() { + return gridPanel98; + } + + public void setGridPanel98(HtmlPanelGrid hpg) { + this.gridPanel98 = hpg; + } + + private StaticText staticText104 = new StaticText(); + + public StaticText getStaticText104() { + return staticText104; + } + + public void setStaticText104(StaticText st) { + this.staticText104 = st; + } + + private HtmlPanelGrid gridPanel99 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel99() { + return gridPanel99; + } + + public void setGridPanel99(HtmlPanelGrid hpg) { + this.gridPanel99 = hpg; + } + + private StaticText staticText131 = new StaticText(); + + public StaticText getStaticText131() { + return staticText131; + } + + public void setStaticText131(StaticText st) { + this.staticText131 = st; + } + + private TextArea txtAveriguacaoObs = new TextArea(); + + public TextArea getTxtAveriguacaoObs() { + return txtAveriguacaoObs; + } + + public void setTxtAveriguacaoObs(TextArea ta) { + this.txtAveriguacaoObs = ta; + } + + private HtmlPanelGrid gridAveriguacaoPosterior = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAveriguacaoPosterior() { + return gridAveriguacaoPosterior; + } + + public void setGridAveriguacaoPosterior(HtmlPanelGrid hpg) { + this.gridAveriguacaoPosterior = hpg; + } + + private StaticText lblAveriguacaoPosterior = new StaticText(); + + public StaticText getLblAveriguacaoPosterior() { + return lblAveriguacaoPosterior; + } + + public void setLblAveriguacaoPosterior(StaticText st) { + this.lblAveriguacaoPosterior = st; + } + + private StaticText txtAveriguacaoPosterior = new StaticText(); + + public StaticText getTxtAveriguacaoPosterior() { + return txtAveriguacaoPosterior; + } + + public void setTxtAveriguacaoPosterior(StaticText st) { + this.txtAveriguacaoPosterior = st; + } + + private HtmlPanelGrid gridAveriguacaoPosterior1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAveriguacaoPosterior1() { + return gridAveriguacaoPosterior1; + } + + public void setGridAveriguacaoPosterior1(HtmlPanelGrid hpg) { + this.gridAveriguacaoPosterior1 = hpg; + } + + private HtmlPanelGrid gridPanel101 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel101() { + return gridPanel101; + } + + public void setGridPanel101(HtmlPanelGrid hpg) { + this.gridPanel101 = hpg; + } + + private StaticText staticText134 = new StaticText(); + + public StaticText getStaticText134() { + return staticText134; + } + + public void setStaticText134(StaticText st) { + this.staticText134 = st; + } + + private HtmlPanelGrid gridPanel102 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel102() { + return gridPanel102; + } + + public void setGridPanel102(HtmlPanelGrid hpg) { + this.gridPanel102 = hpg; + } + + private StaticText staticText135 = new StaticText(); + + public StaticText getStaticText135() { + return staticText135; + } + + public void setStaticText135(StaticText st) { + this.staticText135 = st; + } + + private TextArea txtAveriguacaoObs1 = new TextArea(); + + public TextArea getTxtAveriguacaoObs1() { + return txtAveriguacaoObs1; + } + + public void setTxtAveriguacaoObs1(TextArea ta) { + this.txtAveriguacaoObs1 = ta; + } + + private StaticText staticText130 = new StaticText(); + + public StaticText getStaticText130() { + return staticText130; + } + + public void setStaticText130(StaticText st) { + this.staticText130 = st; + } + + private StaticText stEstabelecimentoOrigem = new StaticText(); + + public StaticText getStEstabelecimentoOrigem() { + return stEstabelecimentoOrigem; + } + + public void setStEstabelecimentoOrigem(StaticText st) { + this.stEstabelecimentoOrigem = st; + } + + private HtmlPanelGrid gridPanel100 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel100() { + return gridPanel100; + } + + public void setGridPanel100(HtmlPanelGrid hpg) { + this.gridPanel100 = hpg; + } + + private StaticText staticText156 = new StaticText(); + + public StaticText getStaticText156() { + return staticText156; + } + + public void setStaticText156(StaticText st) { + this.staticText156 = st; + } + + private HtmlPanelGrid gridPanel103 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel103() { + return gridPanel103; + } + + public void setGridPanel103(HtmlPanelGrid hpg) { + this.gridPanel103 = hpg; + } + + private PanelGroup groupPanel53 = new PanelGroup(); + + public PanelGroup getGroupPanel53() { + return groupPanel53; + } + + public void setGroupPanel53(PanelGroup pg) { + this.groupPanel53 = pg; + } + + private StaticText staticText157 = new StaticText(); + + public StaticText getStaticText157() { + return staticText157; + } + + public void setStaticText157(StaticText st) { + this.staticText157 = st; + } + + private TextField txtNomeSuperior = new TextField(); + + public TextField getTxtNomeSuperior() { + return txtNomeSuperior; + } + + public void setTxtNomeSuperior(TextField tf) { + this.txtNomeSuperior = tf; + } + + private PanelGroup groupPanel54 = new PanelGroup(); + + public PanelGroup getGroupPanel54() { + return groupPanel54; + } + + public void setGroupPanel54(PanelGroup pg) { + this.groupPanel54 = pg; + } + + private StaticText staticText158 = new StaticText(); + + public StaticText getStaticText158() { + return staticText158; + } + + public void setStaticText158(StaticText st) { + this.staticText158 = st; + } + + private TextField txtEmailSuperior = new TextField(); + + public TextField getTxtEmailSuperior() { + return txtEmailSuperior; + } + + public void setTxtEmailSuperior(TextField tf) { + this.txtEmailSuperior = tf; + } + + private HtmlPanelGrid gridPanel104 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel104() { + return gridPanel104; + } + + public void setGridPanel104(HtmlPanelGrid hpg) { + this.gridPanel104 = hpg; + } + + private StaticText staticText159 = new StaticText(); + + public StaticText getStaticText159() { + return staticText159; + } + + public void setStaticText159(StaticText st) { + this.staticText159 = st; + } + + private HtmlPanelGrid gridPanel105 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel105() { + return gridPanel105; + } + + public void setGridPanel105(HtmlPanelGrid hpg) { + this.gridPanel105 = hpg; + } + + private PanelGroup groupPanel55 = new PanelGroup(); + + public PanelGroup getGroupPanel55() { + return groupPanel55; + } + + public void setGroupPanel55(PanelGroup pg) { + this.groupPanel55 = pg; + } + + private StaticText staticText160 = new StaticText(); + + public StaticText getStaticText160() { + return staticText160; + } + + public void setStaticText160(StaticText st) { + this.staticText160 = st; + } + + private StaticText stNomeSuperior = new StaticText(); + + public StaticText getStNomeSuperior() { + return stNomeSuperior; + } + + public void setStNomeSuperior(StaticText st) { + this.stNomeSuperior = st; + } + + private PanelGroup groupPanel61 = new PanelGroup(); + + public PanelGroup getGroupPanel61() { + return groupPanel61; + } + + public void setGroupPanel61(PanelGroup pg) { + this.groupPanel61 = pg; + } + + private StaticText staticText162 = new StaticText(); + + public StaticText getStaticText162() { + return staticText162; + } + + public void setStaticText162(StaticText st) { + this.staticText162 = st; + } + + private StaticText stEmailSuperior = new StaticText(); + + public StaticText getStEmailSuperior() { + return stEmailSuperior; + } + + public void setStEmailSuperior(StaticText st) { + this.stEmailSuperior = st; + } + + private Hyperlink lnkNewUser1 = new Hyperlink(); + + public Hyperlink getLnkNewUser1() { + return lnkNewUser1; + } + + public void setLnkNewUser1(Hyperlink h) { + this.lnkNewUser1 = h; + } + + private StaticText staticText21 = new StaticText(); + + public StaticText getStaticText21() { + return staticText21; + } + + public void setStaticText21(StaticText st) { + this.staticText21 = st; + } + + private StaticText staticText161 = new StaticText(); + + public StaticText getStaticText161() { + return staticText161; + } + + public void setStaticText161(StaticText st) { + this.staticText161 = st; + } + + private Hyperlink lnkAnalisesAcidente = new Hyperlink(); + + public Hyperlink getLnkAnalisesAcidente() { + return lnkAnalisesAcidente; + } + + public void setLnkAnalisesAcidente(Hyperlink h) { + this.lnkAnalisesAcidente = h; + } + + private HiddenField hidDisableImprimir = new HiddenField(); + + public HiddenField getHidDisableImprimir() { + return hidDisableImprimir; + } + + public void setHidDisableImprimir(HiddenField hf) { + this.hidDisableImprimir = hf; + } + + private DropDown drpSeccao = new DropDown(); + + public DropDown getDrpSeccao() { + return drpSeccao; + } + + public void setDrpSeccao(DropDown dd) { + this.drpSeccao = dd; + } + + private StaticText staticText163 = new StaticText(); + + public StaticText getStaticText163() { + return staticText163; + } + + public void setStaticText163(StaticText st) { + this.staticText163 = st; + } + + private DropDown drpDepartamento = new DropDown(); + + public DropDown getDrpDepartamento() { + return drpDepartamento; + } + + public void setDrpDepartamento(DropDown dd) { + this.drpDepartamento = dd; + } + + private HiddenField hidAnchor = new HiddenField(); + + public HiddenField getHidAnchor() { + return hidAnchor; + } + + public void setHidAnchor(HiddenField hf) { + this.hidAnchor = hf; + } + + private PanelGroup groupPanel62 = new PanelGroup(); + + public PanelGroup getGroupPanel62() { + return groupPanel62; + } + + public void setGroupPanel62(PanelGroup pg) { + this.groupPanel62 = pg; + } + + private StaticText staticText164 = new StaticText(); + + public StaticText getStaticText164() { + return staticText164; + } + + public void setStaticText164(StaticText st) { + this.staticText164 = st; + } + + private StaticText staticText167 = new StaticText(); + + public StaticText getStaticText167() { + return staticText167; + } + + public void setStaticText167(StaticText st) { + this.staticText167 = st; + } + + private PanelGroup groupPanel63 = new PanelGroup(); + + public PanelGroup getGroupPanel63() { + return groupPanel63; + } + + public void setGroupPanel63(PanelGroup pg) { + this.groupPanel63 = pg; + } + + private StaticText staticText171 = new StaticText(); + + public StaticText getStaticText171() { + return staticText171; + } + + public void setStaticText171(StaticText st) { + this.staticText171 = st; + } + + private StaticText stTecnicoNome = new StaticText(); + + public StaticText getStTecnicoNome() { + return stTecnicoNome; + } + + public void setStTecnicoNome(StaticText st) { + this.stTecnicoNome = st; + } + + private StaticText staticText172 = new StaticText(); + + public StaticText getStaticText172() { + return staticText172; + } + + public void setStaticText172(StaticText st) { + this.staticText172 = st; + } + + private StaticText staticText173 = new StaticText(); + + public StaticText getStaticText173() { + return staticText173; + } + + public void setStaticText173(StaticText st) { + this.staticText173 = st; + } + + private StaticText txtCap1 = new StaticText(); + + public StaticText getTxtCap1() { + return txtCap1; + } + + public void setTxtCap1(StaticText st) { + this.txtCap1 = st; + } + + private PanelGroup groupPanel64 = new PanelGroup(); + + public PanelGroup getGroupPanel64() { + return groupPanel64; + } + + public void setGroupPanel64(PanelGroup pg) { + this.groupPanel64 = pg; + } + + private StaticText staticText174 = new StaticText(); + + public StaticText getStaticText174() { + return staticText174; + } + + public void setStaticText174(StaticText st) { + this.staticText174 = st; + } + + private StaticText stMedicoNome = new StaticText(); + + public StaticText getStMedicoNome() { + return stMedicoNome; + } + + public void setStMedicoNome(StaticText st) { + this.stMedicoNome = st; + } + + private StaticText staticText175 = new StaticText(); + + public StaticText getStaticText175() { + return staticText175; + } + + public void setStaticText175(StaticText st) { + this.staticText175 = st; + } + + private StaticText staticText176 = new StaticText(); + + public StaticText getStaticText176() { + return staticText176; + } + + public void setStaticText176(StaticText st) { + this.staticText176 = st; + } + + private StaticText txtCedula1 = new StaticText(); + + public StaticText getTxtCedula1() { + return txtCedula1; + } + + public void setTxtCedula1(StaticText st) { + this.txtCedula1 = st; + } + + private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel14() { + return gridPanel14; + } + + public void setGridPanel14(HtmlPanelGrid hpg) { + this.gridPanel14 = hpg; + } + + private StaticText staticText15 = new StaticText(); + + public StaticText getStaticText15() { + return staticText15; + } + + public void setStaticText15(StaticText st) { + this.staticText15 = st; + } + + private com.sun.rave.web.ui.component.Calendar calDataOcorrencia = new com.sun.rave.web.ui.component.Calendar(); + + public com.sun.rave.web.ui.component.Calendar getCalDataOcorrencia() { + return calDataOcorrencia; + } + + public void setCalDataOcorrencia(com.sun.rave.web.ui.component.Calendar c) { + this.calDataOcorrencia = c; + } + + private PanelGroup groupPanel9 = new PanelGroup(); + + public PanelGroup getGroupPanel9() { + return groupPanel9; + } + + public void setGroupPanel9(PanelGroup pg) { + this.groupPanel9 = pg; + } + + private StaticText staticText71 = new StaticText(); + + public StaticText getStaticText71() { + return staticText71; + } + + public void setStaticText71(StaticText st) { + this.staticText71 = st; + } + + private DropDown drpHours = new DropDown(); + + public DropDown getDrpHours() { + return drpHours; + } + + public void setDrpHours(DropDown dd) { + this.drpHours = dd; + } + + private StaticText staticText72 = new StaticText(); + + public StaticText getStaticText72() { + return staticText72; + } + + public void setStaticText72(StaticText st) { + this.staticText72 = st; + } + + private DropDown drpMinutes = new DropDown(); + + public DropDown getDrpMinutes() { + return drpMinutes; + } + + public void setDrpMinutes(DropDown dd) { + this.drpMinutes = dd; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() { + return staticText14; + } + + public void setStaticText14(StaticText st) { + this.staticText14 = st; + } + + private StaticText stNomeAcidentado = new StaticText(); + + public StaticText getStNomeAcidentado() { + return stNomeAcidentado; + } + + public void setStNomeAcidentado(StaticText st) { + this.stNomeAcidentado = st; + } + + private PanelGroup groupPanel15 = new PanelGroup(); + + public PanelGroup getGroupPanel15() { + return groupPanel15; + } + + public void setGroupPanel15(PanelGroup pg) { + this.groupPanel15 = pg; + } + + private StaticText staticText70 = new StaticText(); + + public StaticText getStaticText70() { + return staticText70; + } + + public void setStaticText70(StaticText st) { + this.staticText70 = st; + } + + private StaticText stEstabelecimentoOrigem1 = new StaticText(); + + public StaticText getStEstabelecimentoOrigem1() { + return stEstabelecimentoOrigem1; + } + + public void setStEstabelecimentoOrigem1(StaticText st) { + this.stEstabelecimentoOrigem1 = st; + } + + private PanelGroup groupPanel16 = new PanelGroup(); + + public PanelGroup getGroupPanel16() { + return groupPanel16; + } + + public void setGroupPanel16(PanelGroup pg) { + this.groupPanel16 = pg; + } + + private StaticText staticText74 = new StaticText(); + + public StaticText getStaticText74() { + return staticText74; + } + + public void setStaticText74(StaticText st) { + this.staticText74 = st; + } + + private StaticText stDataNascimento = new StaticText(); + + public StaticText getStDataNascimento() { + return stDataNascimento; + } + + public void setStDataNascimento(StaticText st) { + this.stDataNascimento = st; + } + + private PanelGroup groupPanel65 = new PanelGroup(); + + public PanelGroup getGroupPanel65() { + return groupPanel65; + } + + public void setGroupPanel65(PanelGroup pg) { + this.groupPanel65 = pg; + } + + private StaticText staticText75 = new StaticText(); + + public StaticText getStaticText75() { + return staticText75; + } + + public void setStaticText75(StaticText st) { + this.staticText75 = st; + } + + private StaticText stBI = new StaticText(); + + public StaticText getStBI() { + return stBI; + } + + public void setStBI(StaticText st) { + this.stBI = st; + } + + private PanelGroup groupPanel66 = new PanelGroup(); + + public PanelGroup getGroupPanel66() { + return groupPanel66; + } + + public void setGroupPanel66(PanelGroup pg) { + this.groupPanel66 = pg; + } + + private StaticText staticText77 = new StaticText(); + + public StaticText getStaticText77() { + return staticText77; + } + + public void setStaticText77(StaticText st) { + this.staticText77 = st; + } + + private StaticText stMorada = new StaticText(); + + public StaticText getStMorada() { + return stMorada; + } + + public void setStMorada(StaticText st) { + this.stMorada = st; + } + + private StaticText staticText79 = new StaticText(); + + public StaticText getStaticText79() { + return staticText79; + } + + public void setStaticText79(StaticText st) { + this.staticText79 = st; + } + + private StaticText stCodPostal = new StaticText(); + + public StaticText getStCodPostal() { + return stCodPostal; + } + + public void setStCodPostal(StaticText st) { + this.stCodPostal = st; + } + + private PanelGroup groupPanel67 = new PanelGroup(); + + public PanelGroup getGroupPanel67() { + return groupPanel67; + } + + public void setGroupPanel67(PanelGroup pg) { + this.groupPanel67 = pg; + } + + private StaticText staticText80 = new StaticText(); + + public StaticText getStaticText80() { + return staticText80; + } + + public void setStaticText80(StaticText st) { + this.staticText80 = st; + } + + private StaticText stContactoTelefonico = new StaticText(); + + public StaticText getStContactoTelefonico() { + return stContactoTelefonico; + } + + public void setStContactoTelefonico(StaticText st) { + this.stContactoTelefonico = st; + } + + private PanelGroup groupPanel68 = new PanelGroup(); + + public PanelGroup getGroupPanel68() { + return groupPanel68; + } + + public void setGroupPanel68(PanelGroup pg) { + this.groupPanel68 = pg; + } + + private StaticText staticText81 = new StaticText(); + + public StaticText getStaticText81() { + return staticText81; + } + + public void setStaticText81(StaticText st) { + this.staticText81 = st; + } + + private StaticText stDataAdmissao1 = new StaticText(); + + public StaticText getStDataAdmissao1() { + return stDataAdmissao1; + } + + public void setStDataAdmissao1(StaticText st) { + this.stDataAdmissao1 = st; + } + + private PanelGroup groupPanel69 = new PanelGroup(); + + public PanelGroup getGroupPanel69() { + return groupPanel69; + } + + public void setGroupPanel69(PanelGroup pg) { + this.groupPanel69 = pg; + } + + private StaticText staticText82 = new StaticText(); + + public StaticText getStaticText82() { + return staticText82; + } + + public void setStaticText82(StaticText st) { + this.staticText82 = st; + } + + private StaticText stFuncao1 = new StaticText(); + + public StaticText getStFuncao1() { + return stFuncao1; + } + + public void setStFuncao1(StaticText st) { + this.stFuncao1 = st; + } + + private PanelGroup groupPanel70 = new PanelGroup(); + + public PanelGroup getGroupPanel70() { + return groupPanel70; + } + + public void setGroupPanel70(PanelGroup pg) { + this.groupPanel70 = pg; + } + + private StaticText staticText83 = new StaticText(); + + public StaticText getStaticText83() { + return staticText83; + } + + public void setStaticText83(StaticText st) { + this.staticText83 = st; + } + + private StaticText stTurno = new StaticText(); + + public StaticText getStTurno() { + return stTurno; + } + + public void setStTurno(StaticText st) { + this.stTurno = st; + } + + private PanelGroup groupPanel71 = new PanelGroup(); + + public PanelGroup getGroupPanel71() { + return groupPanel71; + } + + public void setGroupPanel71(PanelGroup pg) { + this.groupPanel71 = pg; + } + + private StaticText staticText84 = new StaticText(); + + public StaticText getStaticText84() { + return staticText84; + } + + public void setStaticText84(StaticText st) { + this.staticText84 = st; + } + + private StaticText staticText85 = new StaticText(); + + public StaticText getStaticText85() { + return staticText85; + } + + public void setStaticText85(StaticText st) { + this.staticText85 = st; + } + + private PanelGroup groupPanel72 = new PanelGroup(); + + public PanelGroup getGroupPanel72() { + return groupPanel72; + } + + public void setGroupPanel72(PanelGroup pg) { + this.groupPanel72 = pg; + } + + private StaticText staticText86 = new StaticText(); + + public StaticText getStaticText86() { + return staticText86; + } + + public void setStaticText86(StaticText st) { + this.staticText86 = st; + } + + private StaticText stMedico = new StaticText(); + + public StaticText getStMedico() { + return stMedico; + } + + public void setStMedico(StaticText st) { + this.stMedico = st; + } + + private StaticText staticText87 = new StaticText(); + + public StaticText getStaticText87() { + return staticText87; + } + + public void setStaticText87(StaticText st) { + this.staticText87 = st; + } + + private StaticText staticText92 = new StaticText(); + + public StaticText getStaticText92() { + return staticText92; + } + + public void setStaticText92(StaticText st) { + this.staticText92 = st; + } + + private StaticText txtCedula = new StaticText(); + + public StaticText getTxtCedula() { + return txtCedula; + } + + public void setTxtCedula(StaticText st) { + this.txtCedula = st; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private TextField txtHorasTurno = new TextField(); + + public TextField getTxtHorasTurno() { + return txtHorasTurno; + } + + public void setTxtHorasTurno(TextField tf) { + this.txtHorasTurno = tf; + } + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("AnaliseAcidenteTrabalho Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + else + { + + initCalendars(); + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if(!pageFrom.matches("AnaliseAcidenteTrabalho.jsp")) + { + if(pageFrom.matches("LoadImage.jsp")) + { + restorePageState(); + //if(getSessionBean1().getImageName() != null) + //{ + fillImages(); + //} + } + else + { + String tmpImageFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File tmpFolder = new File(tmpImageFolder); + if(tmpFolder.exists()) + { + Global global = new Global(); + global.deleteFolderFiles(tmpFolder); + tmpFolder.delete(); + } + + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + //drpTecnicos.setSelected(new Integer(0)); + //drpMedicos.setSelected(new Integer(0)); + if(getSessionBean1().getCurrentAnalise() == null) // new analise + { + getSessionBean1().setAcidentado(null); // Here ????? + lnkLblTrabalhador.setDisabled(true); + lnkLblTrabalhador.setStyleClass(""); + initializePage(); + } + else // edit analise + { + lnkLblTrabalhador.setDisabled(false); + lnkLblTrabalhador.setStyleClass("labelTrabalhador"); + gridTrabalhadores.setRendered(false); + + fillPage(); + } + + } + } + + + } + + + } + + /** + *

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).

+ */ + 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"); + } + + public String lnkLogout_action() { + // TODO: Replace with your code + + try + { + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + } + catch(Exception ex){} + + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) {} + //return "login"; + return null; + } + + + private void initializePage() + { + hidAnchor.setValue("none"); + butCorrecao.setRendered(false); + butGravar.setText("Gravar"); + butEnviar.setText("Enviar a RH"); + gridSiprp.setRendered(false); + //gridAcidentadoView.setRendered(false); + 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); + gridVerificacao.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + + tblTrabalhadores.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteSegView.setRendered(false); + + butImprimir.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(); + } + + + drpDepartamento.setSelected(new Integer(0)); + try + { + getSessionBean1().setSeccaoOptions(adp.getSeccoesList(null)); + drpSeccao.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + +// fillTrabalhadoresTable(); + +// Calendar c = Calendar.getInstance(); +// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); +// stDataAcidente.setText(dateFormat.format(c.getTime())); + txtAveriguador.setText( getSessionBean1().getCurrentUser().getNome() ); + java.util.Date today = + new java.util.Date(); + calDataOcorrencia.setValue(today); + + //drpMedicos.setSelected(new Integer(0)); + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + Medico m = udp.getMedico( getSessionBean1().getCurrentUser().getEstabelecimento_id() ); + getSessionBean1().setMedico( m ); + if(m != null) + { + stMedico.setText(m.getNome() + "  "); + txtCedula.setText(m.getNumero_cedula()); + } + drpHours.setSelected(new Integer(-1)); + drpMinutes.setSelected(new Integer(-1)); + drpDepartamento.setSelected(new Integer(0)); + drpSeccao.setSelected(new Integer(0)); + drpCausas.setSelected(new Integer(0)); + } + +// 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(); + + //correcao + if(a.getCorrecao().matches("y")) + { + stObservacoesCorr.setText(a.getObservacoes_correcao()); + } + else + { + stObservacoesCorr.setRendered(false); + } + + + 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 != Global.ESTADO_IMPRESSAO) +//// if(estado_documento != Global.ESTADO_ASSINATURAS || (estado_documento == Global.ESTADO_ASSINATURAS && getSessionBean1().getCurrentUser().getTipo().intValue() != Global.TIPO_UTILIZADOR_RH)) +//// { +//// butImprimir.setRendered(false); +//// } +//// else +//// { +//// butGravar.setRendered(false); +//// } + butImprimir.setRendered(false); + + if(estado_documento > Global.ESTADO_SEG && getSessionBean1().getCurrentUser().getTipo().intValue() == 1 && a.getAveriguacao_posterior().matches("y")) + { + boolean booAveriguacao = false; + if(a.getAveriguacao_obs() == null) + { + booAveriguacao = true; + } + else if(a.getAveriguacao_obs().trim().length() == 0) + { + booAveriguacao = true; + } + if(booAveriguacao) + { + butCorrecao.setRendered(false); + butGravar.setText("Gravar"); + butEnviar.setRendered(false); + gridSiprp.setRendered(false); + //gridSiprpView.setRendered(false); + gridAcidentado.setRendered(false); //19/11/2007 + gridAcidentadoView.setRendered(false); //19/11/2007 + gridDadosAcidenteSeg.setRendered(false); //19/11/2007 + //gridDadosAcidenteSegView.setRendered(false); //19/11/2007 + gridDadosAcidenteRh.setRendered(false); + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacao.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + + // fillSiprp(a); + // fillDadosAcidenteSegView(a); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteSegView(a); + + return null; + } + + } + + + switch(estado_documento) + { + case Global.ESTADO_SEG: + butCorrecao.setRendered(false); + butGravar.setText("Gravar"); + if(a.getCorrecao().matches("y")) + { + butEnviar.setText("Enviar a Recomendações SHST"); + } + else + { + butEnviar.setText("Enviar a Acompanhamento RH"); + } + gridSiprpView.setRendered(false); + gridAcidentado.setRendered(false); //19/11/2007 + //gridAcidentadoView.setRendered(false); //19/11/2007 + gridDadosAcidenteSegView.setRendered(false); //19/11/2007 + gridDadosAcidenteRh.setRendered(false); + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacao.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + + fillSiprp(a); + fillAcidentadoView(ac); + fillDadosAcidenteSeg(a); + break; + case Global.ESTADO_RH1: + butCorrecao.setRendered(false); + butGravar.setText("Gravar"); + butEnviar.setText("Enviar a Recomendações SHST"); + gridSiprpView.setRendered(false); + gridAcidentadoView.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); //19/11/2007 + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedico.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacao.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + + if(ac != null) + { + fillAcidentado(ac); + } + fillSiprp(a); + fillDadosAcidenteSegView(a); + fillDadosAcidenteRh(a); + break; + case Global.ESTADO_HS: + butGravar.setText("Gravar"); + butEnviar.setText("Enviar a Medidas 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); + gridVerificacao.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteSegView(a); + fillDadosAcidenteRhView(a); + fillRecomendacoesHs(a); + //gridDadosAcidenteRhView.setRendered(false); + //gridRecomendacoesHS.setRendered(false); + break; + case Global.ESTADO_RH2: + butCorrecao.setRendered(false); + butGravar.setText("Gravar"); + //butEnviar.setText("Enviar a Médico"); +// if(a.getCorrecao().matches("y")) +// { +// butEnviar.setText("Enviar a Consolidação"); +// } +// else +// { +// butEnviar.setText("Enviar a Medicina"); +// } + butEnviar.setText("Enviar a Consolidação"); + + //butEnviar.setText("Enviar a Medicina"); + //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); + gridVerificacao.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteSegView(a); + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + //fillMedico(a); //19/11/2007 + fillMedidasRh(a); + fillMedico(a); //23/11/2007 + break; +// case Global.ESTADO_MEDICINA: +// butCorrecao.setRendered(false); +// butGravar.setText("Gravar"); +// butEnviar.setText("Enviar a Consolidação"); +// //gridSiprpView.setRendered(false); +// gridSiprp.setRendered(false); +// gridAcidentado.setRendered(false); +// //gridAcidentadoView.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); +// gridVerificacao.setRendered(false); +// gridVerificacaoView.setRendered(false); +// gridImpressao.setRendered(false); +// gridImpressaoView.setRendered(false); +// +// fillSiprpView(a); +// if(ac != null) +// { +// fillAcidentadoView(ac); +// } +// fillDadosAcidenteSegView(a); +// fillDadosAcidenteRhView(a); +// fillRecomendacoesViewHs(a); +// fillMedidasViewRh(a); +// fillMedico(a); //23/11/2007 +// break; + case Global.ESTADO_CONSOLIDACAO: + //butGravar.setText("Gravar"); + butGravar.setRendered(false); + butEnviar.setText("Enviar a Verificação"); + hidDisableEnviar.setValue("n"); + boolean booAveriguacao = false; + if(a.getAveriguacao_posterior().matches("y")) + { + if(a.getAveriguacao_obs() == null) + { + booAveriguacao = true; + } + else if(a.getAveriguacao_obs().trim().length() == 0) + { + booAveriguacao = true; + } + if(booAveriguacao) + { + hidDisableEnviar.setValue("y"); + } + + } + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + //gridAcidentadoView.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); + //gridVerificacao.setRendered(false); + java.util.Date ddate = new java.util.Date(); + stVerHs.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); + grpVerRespSeg.setRendered(false); + grpVerRespRh.setRendered(false); + butGravar.setDisabled(true); + butEnviar.setDisabled(true); + gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteSegView(a); + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + fillMedicoView(a); //23/11/2007 + break; + case Global.ESTADO_ASSINATURA_SEG: + butImprimir.setRendered(false); + butCorrecao.setRendered(false); + butEnviar.setText("Enviar a RH"); + //butGravar.setText("Enviar"); + butGravar.setRendered(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); + //gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + grpVerRespSeg.setRendered(true); + grpVerHs.setRendered(false); + grpVerRespRh.setRendered(false); + //chkVerRespRh.setDisabled(true); + ddate = new java.util.Date(); + stVerRespSeg.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); + + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteSegView(a); + fillDadosAcidenteRhView(a); + fillMedidasViewRh(a); + fillMedicoView(a); + fillVerificacaoView(a); + fillVerificacao(a); + + break; + case Global.ESTADO_ASSINATURA_RH: + //butGravar.setRendered(false); + butGravar.setText("Imprimir"); + butCorrecao.setRendered(false); + butImprimir.setRendered(false); + butEnviar.setText("Enviar a Conclusão"); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedico.setRendered(false); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + grpVerRespRh.setRendered(true); + grpVerHs.setRendered(false); + grpVerRespSeg.setRendered(false); + //chkVerRespSeg.setDisabled(true); + ddate = new java.util.Date(); + stVerRespRh.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); + + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteSegView(a); + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + fillMedicoView(a); + fillVerificacaoView(a); + fillVerificacao(a); + break; +//// case Global.ESTADO_ASSINATURAS: +//// butImprimir.setDisabled(true); +//// butCorrecao.setRendered(false); +//// butGravar.setText("Gravar"); +//// butEnviar.setText("Enviar a Impressão"); +//// if(a.getEstado_assinatura().intValue() == ESTADO_ASSINATURA_1) +//// { +//// butEnviar.setDisabled(true); +//// } +//// else +//// { +//// butEnviar.setDisabled(false); +//// } +//// +//// +//// 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); +//// } +//// butGravar.setText("Enviar"); +//// 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); +//// gridVerificacaoView.setRendered(false); +//// gridImpressao.setRendered(false); +//// gridImpressaoView.setRendered(false); +//// grpVerRespSeg.setRendered(true); +//// grpVerHs.setRendered(false); +//// grpVerRespRh.setRendered(false); +//// //chkVerRespRh.setDisabled(true); +//// ddate = new java.util.Date(); +//// stVerRespSeg.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); +//// +//// fillSiprpView(a); +//// if(ac != null) +//// { +//// fillAcidentadoView(ac); +//// } +//// fillDadosAcidenteSegView(a); +//// fillDadosAcidenteRhView(a); +//// fillMedidasViewRh(a); +//// fillMedicoView(a); +//// //fillAssinaturaSeg(a); +//// break; +//// +//// case 2: //rh +//// //txtAssRespRh.setDisabled(false); +//// butGravar.setRendered(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); +//// gridVerificacaoView.setRendered(false); +//// gridImpressao.setRendered(false); +//// gridImpressaoView.setRendered(false); +//// grpVerRespRh.setRendered(true); +//// grpVerHs.setRendered(false); +//// grpVerRespSeg.setRendered(false); +//// //chkVerRespSeg.setDisabled(true); +//// ddate = new java.util.Date(); +//// stVerRespRh.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); +//// +//// fillSiprpView(a); +//// if(ac != null) +//// { +//// fillAcidentadoView(ac); +//// } +//// fillDadosAcidenteSegView(a); +//// fillDadosAcidenteRhView(a); +//// fillRecomendacoesViewHs(a); +//// fillMedidasViewRh(a); +//// fillMedicoView(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); +// } +// fillDadosAcidenteSegView(a); +// 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); +// } +// fillDadosAcidenteSegView(a); +// fillDadosAcidenteRhView(a); +// fillRecomendacoesViewHs(a); +// fillMedidasViewRh(a); +// //fillMedico(a); +// fillMedicoView(a); +// break; +//// } +//// break; +// case Global.ESTADO_IMPRESSAO: +// butCorrecao.setRendered(false); +// butImprimir.setRendered(false); +// butGravar.setText("Gravar"); +// 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); +// gridVerificacao.setRendered(false); +// gridImpressao.setRendered(false); +// gridImpressaoView.setRendered(false); +// fillSiprpView(a); +// if(ac != null) +// { +// fillAcidentadoView(ac); +// } +// fillDadosAcidenteSegView(a); +// fillDadosAcidenteRhView(a); +// fillRecomendacoesViewHs(a); +// fillMedidasViewRh(a); +// //fillMedico(a); +// fillMedicoView(a); +// fillVerificacaoView(a); +// //fillImpressao(a); +// //buildPdf(a); +// +// break; + case Global.ESTADO_FECHAR: + butCorrecao.setRendered(false); + butGravar.setRendered(false); + butGravar.setText("Gravar"); + butEnviar.setText("Fechar"); + gridSiprp.setRendered(false); + gridAcidentado.setRendered(false); + gridDadosAcidenteSeg.setRendered(false); + gridDadosAcidenteRh.setRendered(false); + gridRecomendacoesHS.setRendered(false); + gridMedidasRH.setRendered(false); + gridMedico.setRendered(false); + gridVerificacao.setRendered(false); + gridImpressao.setRendered(false); + gridImpressaoView.setRendered(false); + fillSiprpView(a); + if(ac != null) + { + fillAcidentadoView(ac); + } + fillDadosAcidenteSegView(a); + fillDadosAcidenteRhView(a); + fillRecomendacoesViewHs(a); + fillMedidasViewRh(a); + //fillMedico(a); + fillMedicoView(a); + fillVerificacaoView(a); + //fillImpressaoView(a); + break; + case Global.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()); + stMedico.setText(u.getNome() + "  "); + txtCedula.setText(u.getNumero_cedula()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillSiprpView(AnaliseAcidente a) + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + + if(a.getEstado().intValue() == Global.ESTADO_HS) + { + if(a.getTecnico_saude_id().equals(new Integer(0))) + { + a.setTecnico_saude_id( getSessionBean1().getCurrentUser().getId()); + } + } + + 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()); + stEstabelecimentoOrigem.setText(a.getEstabelecimento_origem()); + //txtDataNascimento.setText(a.getData_nascimento()); + try + { + java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime()); + txtDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + 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()); + 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()); + rbTurnoManha.setSelected(null); + rbTurnoTarde.setSelected(null); + rbTurnoNoite.setSelected(null); + 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)); + } + + txtNomeSuperior.setText(a.getNome_superior_hierarquico()); + txtEmailSuperior.setText(a.getEmail_superior_hierarquico()); + + } + + private void fillAcidentadoView(Acidentado a) + { + stNomeAcidentado.setText(a.getNome()); + stEstabelecimentoOrigem1.setText(a.getEstabelecimento_origem()); + //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) + { + cod_postal1 = ""; + } + try + { + cod_postal2 = a.getCod_postal().substring(5, 8); + } + catch(Exception ex) + { + cod_postal2 = ""; + } + + //String cod_postal1 = a.getCod_postal().substring(0, 4); + //String cod_postal2 = a.getCod_postal().substring(5, 8); + if(a.getLocalidade() == null) + { + a.setLocalidade(""); + } + 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() != null) + { + 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); + stNomeSuperior.setText(a.getNome_superior_hierarquico()); + stEmailSuperior.setText(a.getEmail_superior_hierarquico()); + } + + private void fillDadosAcidenteSeg(AnaliseAcidente a) + { + //stDataAcidente.setText(a.getData_acidente()); +// try +// { +// java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); +// stDataAcidente.setText(utils.Utils.dateToYYYYMMDD(ddate)); +// } +// catch(Exception ex){}; + if(a.getAveriguador() == null) + { + txtAveriguador.setText(getSessionBean1().getCurrentUser().getNome()); + } + else + { + txtAveriguador.setText(a.getAveriguador()); + } + + if(a.getData_acidente() != null) + { + java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); + calDataOcorrencia.setValue(ddate); + } + + Calendar cal = Calendar.getInstance(); + + // set the calendar to have your time + try + { + cal.setTimeInMillis(a.getHora_acidente().getTime()); + + int hour = cal.get(Calendar.HOUR_OF_DAY); + int minutes = cal.get(Calendar.MINUTE); + drpHours.setSelected(new Integer(hour)); + drpMinutes.setSelected(new Integer(minutes)); + } + catch(Exception ex) + { + //ex.printStackTrace(); + } + + if(a.getHoras_turno() != null) + { + txtHorasTurno.setText(a.getHoras_turno().toString()); + } + + ////txtSeccao.setText(a.getSeccao()); + + AnalisesDataProvider adp = new AnalisesDataProvider(); + drpDepartamento.setSelected(a.getDepartamento_id()); + try + { + if(a.getDepartamento_id().intValue() == 0) + { + getSessionBean1().setSeccaoOptions(adp.getSeccoesList(null)); + drpSeccao.setSelected(new Integer(0)); + } + else + { + getSessionBean1().setSeccaoOptions(adp.getSeccoesList(a.getDepartamento_id())); + drpSeccao.setSelected(a.getSeccao_id()); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + 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()); + + drpCausas.setSelected(a.getCausas()); + txtDescricao.setText(a.getDescricao()); + txtConclusoes.setText(a.getConclusoes()); + txtAccoes.setText(a.getAccoes()); + + if(a.getAveriguacao_posterior().matches("y")) + { + chkAveriguacaoPosterior.setSelected(new Boolean(true)); + } + + txtAveriguacaoObs.setText(a.getAveriguacao_obs()); + + //fill images + if(gridImages.getChildren().size() > 0) + { + gridImages.getChildren().clear(); + } + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(0,2) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(3); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + + File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); + if(apacheAnaliseFolder.exists()) + { + Global global = new Global(); + global.deleteFolderFiles(apacheAnaliseFolder); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File images[] = f.listFiles(); + Arrays.sort(images); + for(int i=0;i 0) + { + gridImages.getChildren().clear(); + } + String folderName = a.getAnalise_nr().substring(0,2) + a.getAnalise_nr().substring(3); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + + File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); + if(apacheAnaliseFolder.exists()) + { + Global global = new Global(); + global.deleteFolderFiles(apacheAnaliseFolder); + System.out.println("FILES DELETED"); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File images[] = f.listFiles(); + Arrays.sort(images); + for(int i=0;i 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 if( a.getOutros_acidentes_com_colaborador().matches("n") ) + { + st1.setText("Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado."); + gridColaborador.getChildren().add(st1); + } + else //t + { + gridColaborador.setRendered(false); + } + + 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 if( a.getAcidentes_outros_colaboradores().matches("n") ) + { + st2.setText("Não se verificaram ocorrências/incidentes com outros colaboradores."); + gridColaboradores.getChildren().add(st2); + } + else //t + { + gridColaboradores.setRendered(false); + } + } + + 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(); + if(seq==1) + { + txtRecomendacao1.setText(r.getRecomendacao()); + } + else + { + + //int seq = gridRecomendacoes.getChildren().size(); + //seq++; + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grd" + seq); + grd.setColumns(3); + grd.setColumnClasses("gridColLeft5, gridColLeft90,gridColLeft5"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("st" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + TextArea ta = new TextArea(); + ta.setId("ta" + seq); + ta.setStyle("height: 24px; width: 98%"); + ta.setText(r.getRecomendacao()); + grd.getChildren().add(ta); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId("ln" + seq); + ln.setWidth(9); + ln.setHeight(9); + ln.setImageURL("/resources/plus_more.gif"); + MethodBinding mbAction = this.getApplication().createMethodBinding("#{AnaliseAcidenteTrabalho.lnkMoreRec1_action}", null); + ln.setAction(mbAction); + + grd.getChildren().add(ln); + + gridRecomendacoes.getChildren().add(grd); + + } + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillRecomendacoesViewHs(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(); + if(seq==1) + { + txtMedida1.setText(m.getMedida()); + } + else + { + HtmlPanelGrid grd = new HtmlPanelGrid(); + grd.setId("grdMedida" + seq); + grd.setColumns(3); + grd.setColumnClasses("gridColLeft5, gridColLeft90,gridColLeft5"); + grd.setStyle("width: 100%"); + + StaticText st = new StaticText(); + st.setId("stNrMedida" + seq); + st.setText(seq + " ."); + st.setStyle("width: 24px"); + grd.getChildren().add(st); + + TextArea ta = new TextArea(); + ta.setId("taMedida" + seq); + ta.setStyle("height: 24px; width: 98%"); + ta.setText(m.getMedida()); + grd.getChildren().add(ta); + + ImageHyperlink ln = new ImageHyperlink(); + ln.setId("lnMedidaMore" + seq); + ln.setWidth(9); + ln.setHeight(9); + ln.setImageURL("/resources/plus_more.gif"); + MethodBinding mbAction = this.getApplication().createMethodBinding("#{AnaliseAcidenteTrabalho.lnkMoreMed_action}", null); + ln.setAction(mbAction); + + grd.getChildren().add(ln); + + gridMedidas.getChildren().add(grd); + } + seq++; + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void fillMedidasViewRh(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) + { + + if(a.getLesao_cabeca().matches("y")) + { + chkCabeca.setSelected( new Boolean(true) ); + } + + if(a.getLesao_pescoco().matches("y")) + { + chkPescoco.setSelected(new Boolean(true)); + } + + if(a.getLesao_tronco().matches("y")) + { + chkTronco.setSelected(new Boolean(true)); + } + + if(a.getLesao_membro_sup_dir().matches("y")) + { + chkMembroSupDir.setSelected(new Boolean(true)); + //lblEspecif1.setRendered(true); + //txtEspecif1.setRendered(true); + lblEspecif1.setVisible(true); + txtEspecif1.setVisible(true); + + txtEspecif1.setText(a.getEspecif1()); + } + else + { + //lblEspecif1.setRendered(false); + //txtEspecif1.setRendered(false); + lblEspecif1.setVisible(false); + txtEspecif1.setVisible(false); + + } + + if(a.getLesao_membro_sup_esq().matches("y")) + { + chkMembroSupEsq.setSelected(new Boolean(true)); +// lblEspecif2.setRendered(true); +// txtEspecif2.setRendered(true); + lblEspecif2.setVisible(true); + txtEspecif2.setVisible(true); + txtEspecif2.setText(a.getEspecif2()); + } + else + { + lblEspecif2.setVisible(false); + txtEspecif2.setVisible(false); + } + + if(a.getLesao_membro_inf_dir().matches("y")) + { + chkMembroInfDir.setSelected(new Boolean(true)); + lblEspecif3.setVisible(true); + txtEspecif3.setVisible(true); + txtEspecif3.setText(a.getEspecif3()); + } + else + { + lblEspecif3.setVisible(false); + txtEspecif3.setVisible(false); + } + + if(a.getLesao_membro_inf_esq().matches("y")) + { + chkMembroInfEsq.setSelected(new Boolean(true)); + lblEspecif4.setVisible(true); + txtEspecif4.setVisible(true); + txtEspecif4.setText(a.getEspecif4()); + } + else + { + lblEspecif4.setVisible(false); + txtEspecif4.setVisible(false); + } + + txtTipoLesao.setText(a.getTipo_lesao()); + if(a.getTipo_incapacidade().matches("n")) + { + rbIncapacidadeNone.setSelected(new Boolean(true)); + } + else if(a.getTipo_incapacidade().matches("t")) + { + rbIncapacidadeTemp.setSelected(new Boolean(true)); + } + else if(a.getTipo_incapacidade().matches("p")) + { + rbIncapacidadePerm.setSelected(new Boolean(true)); + } + else + { + rbIncapacidadeNone.setSelected(null); + rbIncapacidadeTemp.setSelected(null); + rbIncapacidadePerm.setSelected(null); + } + + if(a.getCoef_incapacidade() == null) + { + txtCoefIncapacidade.setText(""); + } + else + { + txtCoefIncapacidade.setText(a.getCoef_incapacidade()); + } + + + if(a.getData_aval_incapacidade() != null) + { + java.util.Date ddate = new java.util.Date(a.getData_aval_incapacidade().getTime()); + calAvaliacaoIncap.setValue(ddate); + } + + if(a.getData_rev_incapacidade() != null) + { + java.util.Date ddate = new java.util.Date(a.getData_rev_incapacidade().getTime()); + calRevisaoIncap.setValue(ddate); + } + + if(a.getPeriodo_incapacidade_de() != null) + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_de().getTime()); + calPeridoIncapDe.setValue(ddate); + } + + if(a.getPeriodo_incapacidade_a() != null) + { + java.util.Date ddate = new java.util.Date(a.getPeriodo_incapacidade_a().getTime()); + calPeriodoIncapA.setValue(ddate); + } + + if(a.getImg_flexao().matches("y")) + { + chkImgFlexao.setSelected(new Boolean(true)); + } + + if(a.getImg_rot1().matches("y")) + { + chkImgRot1.setSelected(new Boolean(true)); + } + + if(a.getImg_rot2().matches("y")) + { + chkImgRot2.setSelected(new Boolean(true)); + } + + if(a.getImg_ext1().matches("y")) + { + chkImgExt1.setSelected(new Boolean(true)); + } + + if(a.getImg_ext2().matches("y")) + { + chkImgExt2.setSelected(new Boolean(true)); + } + + if(a.getImg_cab1().matches("y")) + { + chkImgCab1.setSelected(new Boolean(true)); + } + + if(a.getImg_cab2().matches("y")) + { + chkImgCab2.setSelected(new Boolean(true)); + } + + if(a.getImg_cab3().matches("y")) + { + chkImgCab3.setSelected(new Boolean(true)); + } + + if(a.getImg_cab4().matches("y")) + { + chkImgCab4.setSelected(new Boolean(true)); + } + + if(a.getImg_ma1().matches("y")) + { + chkImgMa1.setSelected(new Boolean(true)); + } + + if(a.getImg_ma2().matches("y")) + { + chkImgMa2.setSelected(new Boolean(true)); + } + + if(a.getImg_ma3().matches("y")) + { + chkImgMa3.setSelected(new Boolean(true)); + } + + if(a.getImg_ma4().matches("y")) + { + chkImgMa4.setSelected(new Boolean(true)); + } + + if(a.getImg_ma5().matches("y")) + { + chkImgMa5.setSelected(new Boolean(true)); + } + + if(a.getImg_ma6().matches("y")) + { + chkImgMa6.setSelected(new Boolean(true)); + } + + if(a.getImg_ma7().matches("y")) + { + chkImgMa7.setSelected(new Boolean(true)); + } + + if(a.getImg_ma8().matches("y")) + { + chkImgMa8.setSelected(new Boolean(true)); + } + + if(a.getImg_ma9().matches("y")) + { + chkImgMa9.setSelected(new Boolean(true)); + } + + if(a.getImg_ma10().matches("y")) + { + chkImgMa10.setSelected(new Boolean(true)); + } + + if(a.getRestricao_carga() != null) + { + if(a.getRestricao_carga().intValue() > 0) + { + chkRestricaoCargas.setSelected(new Boolean(true)); + rbKgs2.setRendered(true); + rbKgs5.setRendered(true); + rbKgs10.setRendered(true); + rbKgs15.setRendered(true); + rbKgsOutro.setRendered(true); + txtKgs.setRendered(true); + stKgs2.setRendered(true); + stKgs5.setRendered(true); + stKgs10.setRendered(true); + stKgs15.setRendered(true); + stKgsOutro.setRendered(true); + stKg.setRendered(true); + int carga = a.getRestricao_carga().intValue(); + switch(carga) + { + case 2: + rbKgs2.setSelected(new Boolean(true)); + break; + case 5: + rbKgs5.setSelected(new Boolean(true)); + break; + case 10: + rbKgs10.setSelected(new Boolean(true)); + break; + case 15: + rbKgs15.setSelected(new Boolean(true)); + break; + default: + rbKgsOutro.setSelected(new Boolean(true)); + txtKgs.setText(a.getRestricao_carga().toString()); + break; + } + } + else + { + chkRestricaoCargas.setSelected(new Boolean(false)); + rbKgs2.setRendered(false); + rbKgs5.setRendered(false); + rbKgs10.setRendered(false); + rbKgs15.setRendered(false); + rbKgsOutro.setRendered(false); + txtKgs.setRendered(false); + stKgs2.setRendered(false); + stKgs5.setRendered(false); + stKgs10.setRendered(false); + stKgs15.setRendered(false); + stKgsOutro.setRendered(false); + stKg.setRendered(false); + } + } + else + { + chkRestricaoCargas.setSelected(new Boolean(false)); + rbKgs2.setRendered(false); + rbKgs5.setRendered(false); + rbKgs10.setRendered(false); + rbKgs15.setRendered(false); + rbKgsOutro.setRendered(false); + txtKgs.setRendered(false); + stKgs2.setRendered(false); + stKgs5.setRendered(false); + stKgs10.setRendered(false); + stKgs15.setRendered(false); + stKgsOutro.setRendered(false); + stKg.setRendered(false); + } + + if(a.getRestricao_motricidade().matches("y")) + { + chkRestricaoMotricidade.setSelected(new Boolean(true)); + } + + if(a.getRestricao_conducao().matches("y")) + { + chkRestricaoConducao.setSelected(new Boolean(true)); + } + + if(a.getRestricao_vibracoes().matches("y")) + { + chkRestricaoVibracoes.setSelected(new Boolean(true)); + } + + if(a.getRestricao_outras() != null) + { + if(a.getRestricao_outras().trim().length() > 0) + { + chkRestricaoOutras.setSelected(new Boolean(true)); + txtRestricaoOutras.setText(a.getRestricao_outras()); + } + } + + txtObservacoes.setText(a.getMed_observ()); + + } + + private void fillMedicoView(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); + if(a.getEspecif1() != null) + { + if(a.getEspecif1().trim().length() > 0) + { + 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); + if(a.getEspecif2() != null) + { + if(a.getEspecif2().trim().length() > 0) + { + 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); + if(a.getEspecif3() != null) + { + if(a.getEspecif3().trim().length() > 0) + { + 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); + if(a.getEspecif4() != null) + { + if(a.getEspecif4().trim().length() > 0) + { + 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.setStyle("font-weight: bold"); + st.setEscape(false); + 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) + { + gridIncapacidade2.getChildren().add(pg); + } + + pg = new PanelGroup(); + if(a.getData_aval_incapacidade() != null) + { + + pg.setId("pgAvaliacaoIncapacidade"); + st = new StaticText(); + st.setId("stDataAvalIncapacidadeLbl1"); + 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.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) + { + gridIncapacidade2.getChildren().add(pg); + } + + + pg = new PanelGroup(); + + if(a.getPeriodo_incapacidade_de() != null || a.getPeriodo_incapacidade_a() != null) + { + + pg.setId("pgPeriodoIncapacidade"); + st = new StaticText(); + st.setId("stPeriodoIncapacidadeLbl1"); + 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.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); + + } + + if(pg.getChildren().size() > 0) + { + gridIncapacidade2.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 String getPageFrom(String referer) +// { +// String pageFrom = referer.substring(referer.lastIndexOf("/")+1); +// return pageFrom; +// } + +// public String lnkNome_action() { +// // TODO: Replace with your code +// RowKey rk = tableRowGroup1.getRowKey(); +// int k = Integer.parseInt(rk.getRowId()); +// TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); +// ArrayList list = (ArrayList) provider.getList(); +// Trabalhador t = (Trabalhador)list.get(k); +// txtTrabalhador.setText(t.getNome()); +// txtNomeAcidentado.setText(t.getNome()); +// txtDataNascimento.setText(t.getData_nascimento()); +// Acidentado a = new Acidentado(); +// a.setTrabalhador_id(t.getId()); +// a.setData_nascimento(t.getData_nascimento()); +// a.setNome(t.getNome()); +// a.setFuncao(utils.Utils.unicodeToHTML(t.getFuncao())); +// a.setData_admissao(t.getData_admissao()); +// getSessionBean1().setAcidentado(a); +// if(getSessionBean1().getCurrentAnalise() != null) // new analise) +// { +// gridTrabalhadores.setRendered(false); +// } +// +// return null; +// } + +// public String lnkDataNascimento_action() { +// // TODO: Replace with your code +// RowKey rk = tableRowGroup1.getRowKey(); +// int k = Integer.parseInt(rk.getRowId()); +// TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); +// ArrayList list = (ArrayList) provider.getList(); +// Trabalhador t = (Trabalhador)list.get(k); +// txtTrabalhador.setText(t.getNome()); +// txtNomeAcidentado.setText(t.getNome()); +// txtDataNascimento.setText(t.getData_nascimento()); +// Acidentado a = new Acidentado(); +// a.setTrabalhador_id(t.getId()); +// a.setData_nascimento(t.getData_nascimento()); +// a.setNome(t.getNome()); +// a.setFuncao(t.getFuncao()); +// a.setData_admissao(t.getData_admissao()); +// getSessionBean1().setAcidentado(a); +// if(getSessionBean1().getCurrentAnalise() != null) // new analise) +// { +// gridTrabalhadores.setRendered(false); +// } +// return null; +// } + + private void fillVerificacao(AnaliseAcidente a) + { + int estado = a.getEstado().intValue(); + switch(estado) + { + case Global.ESTADO_ASSINATURA_SEG: + if(a.getAss_resp_seg().matches("y")) + { + chkVerRespSeg.setSelected(new Boolean(true)); + chkVerRespSeg.setDisabled(true); + java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); + stVerRespSeg.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); + } + break; + + case Global.ESTADO_ASSINATURA_RH: + if(a.getAss_resp_rh().matches("y")) + { + chkVerRespRh.setSelected(new Boolean(true)); + chkVerRespRh.setDisabled(true); + java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); + stVerRespRh.setText("Tomei conhecimento a " + utils.Utils.dateToYYYYMMDD(ddate)); + } + + break; + } + } + + private void fillVerificacaoView(AnaliseAcidente a) + { + StaticText st = null; + String txtVer = null; + if(a.getAveriguador() != null) + { + if(a.getAveriguador().trim().length() > 0) + { + st = new StaticText(); + st.setId("stVerificacao1"); + st.setEscape(false); + txtVer = "Averiguado por " + a.getAveriguador() + " (Departamento de Segurança) a "; + //txtVer += a.getData_assinatura_seg(); + + try + { + java.util.Date ddate = new java.util.Date(a.getData_inicio_processo().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + } + + if(a.getAss_consolidacao().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao2"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_consolidacao() + " (Técnico de HST) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_consolidacao().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + if(a.getAss_resp_seg().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao3"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_seg() + " (Responsável de Segurança) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + if(a.getAss_resp_rh().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao4"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_rh() + " (Responsável de RH) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); + if(ac.getNome_superior_hierarquico() != null) + { + if(ac.getNome_superior_hierarquico().trim().length() > 0) + { + st = new StaticText(); + st.setId("stVerificacao5"); + st.setEscape(false); + txtVer = "Com conhecimento de " + ac.getNome_superior_hierarquico() + " (Responsável hierárquico)"; + + if(ac.getEmail_superior_hierarquico() != null) + { + if(ac.getEmail_superior_hierarquico().trim().length() > 0) + { + try + { + java.util.Date ddate = new java.util.Date(ac.getData_email_superior_hierarquico().getTime()); + txtVer += " a " + utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex){}; + } + } + txtVer += "."; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + HtmlPanelGrid grid = new HtmlPanelGrid(); + grid.setId("rodape1"); + grid.setColumns(1); + grid.setStyle("width: 100%"); + grid.setColumnClasses("gridColCenter"); + st = new StaticText(); + st.setId("stRodape1"); + st.setEscape(false); + st.setText("- processamento informático - acesso autenticado -"); + grid.getChildren().add(st); + gridAssinaturasView.getChildren().add(grid); + } + + + private AnaliseAcidente fillAnaliseFieldsImpressao(AnaliseAcidente a) + { + a.setAss_superior("n"); + if(chkAssSup.getSelected() != null) + { + if(chkAssSup.getSelected().equals(new Boolean(true))) + { + a.setAss_superior("y"); + } + } + + if(a.getAss_superior().matches("y")) + { + a.setNome_superior(""); + if(txtAssSup.getText() != null) + { + a.setNome_superior( (String) txtAssSup.getText()); + } + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date(today.getTime()); + a.setData_assinatura_superior(sqlToday); + } + else + { + a.setNome_superior(""); + a.setData_assinatura_superior(null); + } + return a; + } + + private void fillImpressao(AnaliseAcidente a) + { + if(a.getAss_superior().matches("y")) + { + chkAssSup.setSelected(new Boolean(true)); + txtAssSup.setText(a.getNome_superior()); + String txt = (String) stAssSup2.getText(); + String nome_acidentado = getSessionBean1().getAcidentado().getNome(); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_superior().getTime()); + stData += utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex){}; + stAssSup2.setText(txt + nome_acidentado + ", a " + stData); + } + + } + + private void fillImpressaoView(AnaliseAcidente a) + { + StaticText st = new StaticText(); + st.setId("stImpressaoView1"); + st.setEscape(false); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_superior().getTime()); + stData += utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex){}; + + String txt = "Assinado na Ficha de Análise de Acidente em papel por " + a.getNome_superior() + ", superior hierárquico / superior de "; + txt += getSessionBean1().getAcidentado().getNome() + ", a " + stData; + gridAssSupView.getChildren().add(st); + } + + 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. + + savePageState(); + return "load_image"; + } + + private void fillImages() + { +// String imageName = getSessionBean1().getImageName(); +// if(imageName != null) +// { +// ImageComponent newImg = new ImageComponent(); +// newImg.setUrl("/resources/imagens/" + imageName); +// System.out.println("IMAGE URL : " + "/resources/imagens/" + imageName); +// newImg.setRendered(true); +// gridImages.getChildren().add(newImg); +// System.out.println("HERE"); +// } +// if(gridImages.getChildren().size() > 0) +// { +// gridImages.getChildren().clear(); +// } + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + + + File apacheTmpFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + if(apacheTmpFolder.exists()) + { + Global global = new Global(); + global.deleteFolderFiles(apacheTmpFolder); + } + else + { + apacheTmpFolder.mkdir(); + } + +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolder = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File files[] = f.listFiles(); + //List list = Arrays.asList(files); + Arrays.sort(files); + for(int i=0;i 0) + { + a.setBilhete_identidade(bi); + } + } + + a.setMorada(""); + if(txtMorada.getText() != null) + { + String morada = (String) txtMorada.getText(); + if(morada.trim().length() > 0) + { + a.setMorada( morada ); + } + } + + a.setCod_postal(""); + String cod_postal = ""; + if(txtCodPostal1.getText() != null ) + { + String cod_postal1 = (String) txtCodPostal1.getText(); + String cod_postal2 = ""; + if(txtCodPostal2.getText() != null) + { + cod_postal2 = (String) txtCodPostal2.getText(); + } + if(cod_postal1.trim().length() > 0) + { + cod_postal =(String) txtCodPostal1.getText() + "-" + (String) txtCodPostal2.getText(); + a.setCod_postal( cod_postal); + } + + } + + a.setLocalidade(""); + if(txtLocalidade.getText() != null) + { + String localidade = (String) txtLocalidade.getText(); + if(localidade.trim().length() > 0) + { + a.setLocalidade( localidade); + } + } + + a.setContacto_telefonico(""); + if(txtContactoTelefonico.getText() != null) + { + String contacto_telefonico = (String) txtContactoTelefonico.getText(); + if(contacto_telefonico.trim().length() > 0) + { + a.setContacto_telefonico( contacto_telefonico ); + } + } + + + a.setTurno("v"); // null + if(rbTurnoManha.getValue() != null) + { + if(rbTurnoManha.getValue().equals(new Boolean(true))) + { + a.setTurno("m"); + } + } + if(rbTurnoTarde.getValue() != null) + { + if(rbTurnoTarde.getValue().equals(new Boolean(true))) + { + a.setTurno("t"); + } + } + if(rbTurnoNoite.getValue() != null) + { + if(rbTurnoNoite.getValue().equals(new Boolean(true))) + { + a.setTurno("n"); + } + } + + if(txtNomeSuperior.getText() != null) + { + a.setNome_superior_hierarquico((String) txtNomeSuperior.getText()); + } + + if(txtEmailSuperior.getText() != null) + { + a.setEmail_superior_hierarquico((String) txtEmailSuperior.getText()); + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date(today.getTime()); + a.setData_email_superior_hierarquico(sqlToday); + } + + return a; + } + + private AnaliseAcidente fillAnaliseFields() + { + int estado = 0; + AnaliseAcidente a = null; + //fill analise fields + if(getSessionBean1().getCurrentAnalise() == null) //null + { + a = new AnaliseAcidente(); + a.setEspecif1(""); + a.setEspecif2(""); + a.setEspecif3(""); + a.setEspecif4(""); + a.setRestricao_outras(""); + a.setTipo_lesao(""); + a.setMed_observ(""); + estado = Global.ESTADO_SEG; + a.setEstado(new Integer(estado)); + } + else + { + a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + } + + + //averiguacao posterior +// if(estado < Global.ESTADO_ASSINATURAS) + if(estado < Global.ESTADO_ASSINATURA_SEG) + { + if(getSessionBean1().getCurrentUser().getTipo().intValue() == 1) //seguranca + { + if(a.getAveriguacao_posterior().matches("y")) + { + if(txtAveriguacaoObs1.getText() != null) + { + a.setAveriguacao_obs((String) txtAveriguacaoObs1.getText()); + } + + } + } + } + + switch(estado) + { + case Global.ESTADO_SEG: + a = fillAnaliseFieldsSeg(a); + break; + case Global.ESTADO_RH1: + //a = fillAnaliseFieldsSeg(a); + a = fillAnaliseFieldsRH1(a); + break; + case Global.ESTADO_HS: + //a = fillAnaliseFieldsHS(a); + break; + case Global.ESTADO_RH2: + a = fillAnaliseFieldsMedico(a); + //a = fillAnaliseFieldsRH2(a); + break; +// case Global.ESTADO_MEDICINA: +// a = fillAnaliseFieldsMedico(a); +// break; + case Global.ESTADO_CONSOLIDACAO: + a = fillAnaliseFieldsConsolidacao(a); + break; +// case Global.ESTADO_ASSINATURAS: + case Global.ESTADO_ASSINATURA_SEG: + a = fillAnaliseAssinaturas(a); + break; + case Global.ESTADO_ASSINATURA_RH: + a = fillAnaliseAssinaturas(a); + break; + + } + + return a; + } + + private AnaliseAcidente fillAnaliseFieldsSeg(AnaliseAcidente a) + { + if(txtAveriguador.getText() != null) + { + a.setAveriguador((String) txtAveriguador.getText()); + } + + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date(today.getTime()); + if(a.getData_acidente() == null) + { + a.setData_acidente(sqlToday); + } + else + { + DateFormat formatador = new SimpleDateFormat("yyyy-MM-dd"); + + java.util.Date ddate = (java.util.Date) calDataOcorrencia.getValue(); + try + { + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setData_acidente(ddate_sql); + } + catch(Exception ex) + { + a.setData_acidente(null); + } + } + + if(a.getData_inicio_processo() == null) + { + a.setData_inicio_processo(sqlToday); + } + + Integer hhInt = (Integer) drpHours.getSelected(); + Integer mmInt = (Integer) drpMinutes.getSelected(); + + if(hhInt.intValue() == -1 || mmInt.intValue() == -1) + { + a.setHora_acidente(null); + } + else + { +// String hh = drpHours.getSelected().toString(); +// String mm = drpMinutes.getSelected().toString(); + String hh = hhInt.toString(); + String mm = mmInt.toString(); + SimpleDateFormat formatter = new SimpleDateFormat ( "hh:mm" ); + try + { + Time horaAcidente = new Time(formatter.parse( hh + ":" + mm ).getTime()); + a.setHora_acidente(horaAcidente); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + } + + + + if(getSessionBean1().getCurrentAnalise() == null) // new + { + a.setEmpresa_id(getSessionBean1().getCurrentUser().getEmpresa_id()); + a.setEstabelecimento_id(getSessionBean1().getCurrentUser().getEstabelecimento_id()); + } + +// Integer medico_id = (Integer) drpMedicos.getSelected(); + Medico m = getSessionBean1().getMedico(); + if(m != null) + { + Integer medico_id = m.getId(); + if(medico_id.intValue() > 0) + { + a.setMedico_id(medico_id); + } + + } + + Integer horas_turno = null; + try + { + String horas_turno_str = (String) txtHorasTurno.getText(); + horas_turno = new Integer( Integer.parseInt(horas_turno_str) ); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + a.setHoras_turno(horas_turno); + +// try +// { +// if(txtSeccao.getText() != null) +// { +// a.setSeccao( (String) txtSeccao.getText() ); +// } +// else +// { +// a.setSeccao(""); +// } +// } +// catch(Exception ex) +// { +// ex.printStackTrace(); +// } + + a.setDepartamento_id(( Integer ) drpDepartamento.getSelected()); + a.setSeccao_id((Integer) drpSeccao.getSelected()); + + try + { + if(txtLocal.getText() != null) + { + a.setLocal_trabalho( (String) txtLocal.getText() ); + } + else + { + a.setLocal_trabalho(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtTarefa.getText() != null) + { + a.setTarefa( (String) txtTarefa.getText() ); + } + else + { + a.setTarefa(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtSubstancias.getText() != null) + { + a.setSubstancias( (String) txtSubstancias.getText() ); + } + else + { + a.setSubstancias(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + +// try +// { +// if(txtSuperior.getText() != null) +// { +// a.setSuperior_hierarquico( (String) txtSuperior.getText() ); +// } +// else +// { +// a.setSuperior_hierarquico(""); +// } +// } +// catch(Exception ex) +// { +// ex.printStackTrace(); +// } + + try + { + if(txtCondicoes.getText() != null) + { + a.setCondicoes( (String) txtCondicoes.getText() ); + } + else + { + a.setCondicoes(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtTestemunhas.getText() != null) + { + a.setTestemunhas( (String) txtTestemunhas.getText() ); + } + else + { + a.setTestemunhas(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + +// try +// { +// if(txtCausas.getText() != null) +// { +// a.setCausas( (String) txtCausas.getText() ); +// } +// else +// { +// a.setCausas(""); +// } +// } +// catch(Exception ex) +// { +// ex.printStackTrace(); +// } + + a.setCausas((Integer) drpCausas.getSelected()); + + try + { + if(txtDescricao.getText() != null) + { + a.setDescricao( (String) txtDescricao.getText() ); + } + else + { + a.setDescricao(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtConclusoes.getText() != null) + { + a.setConclusoes( (String) txtConclusoes.getText() ); + } + else + { + a.setConclusoes(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + if(txtAccoes.getText() != null) + { + a.setAccoes( (String) txtAccoes.getText() ); + } + else + { + a.setAccoes(""); + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + a.setAveriguacao_posterior("n"); + if(chkAveriguacaoPosterior.getSelected() != null) + { + if(chkAveriguacaoPosterior.getSelected().equals(new Boolean(true))) + { + a.setAveriguacao_posterior("y"); + } + } + + if(txtAveriguacaoObs.getText() != null) + { + a.setAveriguacao_obs((String) txtAveriguacaoObs.getText()); + } + return a; + } + + private AnaliseAcidente fillAnaliseFieldsRH1(AnaliseAcidente a) + { + boolean booFormacaoSHST = false; + if(rbFormacaoSHSTY.getSelected() != null) + { + Boolean f = (Boolean) rbFormacaoSHSTY.getSelected(); + if(f.equals(new Boolean(true))) + { + a.setFormacao_shst("y"); + booFormacaoSHST = true; + } + } + + if(!booFormacaoSHST) + { + if(rbFormacaoSHSTN.getSelected() != null) + { + Boolean f = (Boolean) rbFormacaoSHSTN.getSelected(); + if(f.equals(new Boolean(true))) + { + a.setFormacao_shst("n"); + a.setFormacao_shst_nao_porque(""); + if(txtFormacaoSHSTNWhy.getText() != null) + { + String s = (String) txtFormacaoSHSTNWhy.getText(); + if(s.trim().length() > 0 ) + { + a.setFormacao_shst_nao_porque( s ); + } + } + } + } + else + { + a.setFormacao_shst("t"); + } + } + + boolean booAcidentesColaborador = false; + a.setOutros_acidentes_com_colaborador("n"); + if(rbAcidentesColaboradorY.getSelected() != null) + { + Boolean f = (Boolean) rbAcidentesColaboradorY.getSelected(); + if(f.equals(new Boolean(true))) + { + a.setOutros_acidentes_com_colaborador("y"); + booAcidentesColaborador = true; + if(txtNrAcidentesColaborador.getText() != null) + { + String nr_str = (String) txtNrAcidentesColaborador.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_acidentes_com_colaborador(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + + if(txtNrRelatorioAcidentesColaborador1.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaborador1.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador1(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaborador2.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaborador2.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador2(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaborador3.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaborador3.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador3(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaborador4.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaborador4.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_colaborador4(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + } + } + + if(!booAcidentesColaborador) + { + if(rbAcidentesColaboradorN.getSelected() != null) + { + Boolean f = (Boolean) rbAcidentesColaboradorN.getSelected(); + if(f.equals(new Boolean(true))) + { + a.setOutros_acidentes_com_colaborador("n"); + } + } + else + { + a.setOutros_acidentes_com_colaborador("t"); + } + } + + boolean booAcidentesColaboradores = false; + if(rbAcidentesColaboradoresY.getSelected() != null) + { + Boolean f = (Boolean) rbAcidentesColaboradoresY.getSelected(); + if(f.equals(new Boolean(true))) + { + a.setAcidentes_outros_colaboradores("y"); + booAcidentesColaboradores = true; + if(txtNrAcidentesColaboradores.getText() != null) + { + String nr_str = (String) txtNrAcidentesColaboradores.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_acidentes_outros_colaboradores(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + + if(txtNrRelatorioAcidentesColaboradores1.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaboradores1.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores1(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaboradores2.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaboradores2.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores2(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaboradores3.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaboradores3.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores3(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + if(txtNrRelatorioAcidentesColaboradores4.getText() != null) + { + String nr_str = (String) txtNrRelatorioAcidentesColaboradores4.getText(); + if(nr_str.trim().length() > 0) + { + try + { + Integer nr = new Integer(Integer.parseInt(nr_str)); + a.setNr_relatorio_acidente_outros_colaboradores4(nr); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + + } + } + + if(!booAcidentesColaboradores) + { + if(rbAcidentesColaboradoresN.getSelected() != null) + { + Boolean f = (Boolean) rbAcidentesColaboradoresN.getSelected(); + if(f.equals(new Boolean(true))) + { + a.setAcidentes_outros_colaboradores("n"); + } + } + else + { + a.setAcidentes_outros_colaboradores("t"); + } + } + + return a; + } + + private ArrayList fillAnaliseRecomendacoesHs(AnaliseAcidente a) + { + ArrayList list = new ArrayList(); + ListIterator iter = gridRecomendacoes.getChildren().listIterator(); + while(iter.hasNext()) + { + HtmlPanelGrid grd = (HtmlPanelGrid)iter.next(); + TextArea ta = (TextArea) grd.getChildren().get(1); + if(ta.getText() != null ) + { + String txt = (String) ta.getText(); + if(txt.trim().length() > 0) + { + Recomendacao r = new Recomendacao(); + r.setAnalise_id(a.getId()); + r.setRecomendacao(txt); + list.add(r); + } + } + } + return list; + } + + private ArrayList fillAnaliseMedidasRh(AnaliseAcidente a) + { + ArrayList list = new ArrayList(); + ListIterator iter = gridMedidas.getChildren().listIterator(); + while(iter.hasNext()) + { + HtmlPanelGrid grd = (HtmlPanelGrid)iter.next(); + TextArea ta = (TextArea) grd.getChildren().get(1); + if(ta.getText() != null ) + { + String txt = (String) ta.getText(); + if(txt.trim().length() > 0) + { + Medida m = new Medida(); + m.setAnalise_id(a.getId()); + m.setMedida(txt); + list.add(m); + } + } + } + return list; + } + + private AnaliseAcidente fillAnaliseFieldsRH2(AnaliseAcidente a) + { + return a; + } + + private AnaliseAcidente fillAnaliseFieldsMedico(AnaliseAcidente a) + { + a.setLesao_cabeca("n"); + if(chkCabeca.getSelected() != null) + { + if(chkCabeca.getSelected().equals(new Boolean(true))) + { + a.setLesao_cabeca("y"); + } + } + + a.setLesao_pescoco("n"); + if(chkPescoco.getSelected() != null) + { + if(chkPescoco.getSelected().equals(new Boolean(true))) + { + a.setLesao_pescoco("y"); + } + } + + a.setLesao_tronco("n"); + if(chkTronco.getSelected() != null) + { + if(chkTronco.getSelected().equals(new Boolean(true))) + { + a.setLesao_tronco("y"); + } + } + + a.setEspecif1(""); + a.setEspecif2(""); + a.setEspecif3(""); + a.setEspecif4(""); + + a.setLesao_membro_sup_dir("n"); + if(chkMembroSupDir.getSelected() != null) + { + if(chkMembroSupDir.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_sup_dir("y"); + if(txtEspecif1.getText() != null) + { + a.setEspecif1((String) txtEspecif1.getText()); + } + } + } + + a.setLesao_membro_sup_esq("n"); + if(chkMembroSupEsq.getSelected() != null) + { + if(chkMembroSupEsq.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_sup_esq("y"); + if(txtEspecif2.getText() != null) + { + a.setEspecif2((String) txtEspecif2.getText()); + } + } + } + + a.setLesao_membro_inf_dir("n"); + if(chkMembroInfDir.getSelected() != null) + { + if(chkMembroInfDir.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_inf_dir("y"); + if(txtEspecif3.getText() != null) + { + a.setEspecif3((String) txtEspecif3.getText()); + } + } + } + + a.setLesao_membro_inf_esq("n"); + if(chkMembroInfEsq.getSelected() != null) + { + if(chkMembroInfEsq.getSelected().equals(new Boolean(true))) + { + a.setLesao_membro_inf_esq("y"); + if(txtEspecif4.getText() != null) + { + a.setEspecif4((String) txtEspecif4.getText()); + } + } + } + + a.setTipo_lesao(""); + if(txtTipoLesao.getText() != null) + { + a.setTipo_lesao((String) txtTipoLesao.getText()); + } + + a.setTipo_incapacidade("v"); + if(rbIncapacidadeNone.getSelected() != null) + { + if(rbIncapacidadeNone.getSelected().equals(new Boolean(true))) + { + a.setTipo_incapacidade("n"); + } + } + if(rbIncapacidadeTemp.getSelected() != null) + { + if(rbIncapacidadeTemp.getSelected().equals(new Boolean(true))) + { + a.setTipo_incapacidade("t"); + } + } + if(rbIncapacidadePerm.getSelected() != null) + { + if(rbIncapacidadePerm.getSelected().equals(new Boolean(true))) + { + a.setTipo_incapacidade("p"); + } + } + + if(txtCoefIncapacidade.getText() != null) + { + String coef_str = txtCoefIncapacidade.getText().toString(); + int coef = Integer.parseInt(coef_str); + a.setCoef_incapacidade(new Integer(coef)); + } + + DateFormat formatador = new SimpleDateFormat("yyyy-MM-dd"); + + java.util.Date ddate = (java.util.Date) calAvaliacaoIncap.getValue(); + try + { + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setData_aval_incapacidade(ddate_sql); + } + catch(Exception ex) + { + a.setData_aval_incapacidade(null); + } + + ddate = (java.util.Date) calRevisaoIncap.getValue(); + + try + { + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setData_rev_incapacidade(ddate_sql); + } + catch(Exception ex) + { + a.setData_rev_incapacidade(null); + } + + ddate = (java.util.Date) calPeridoIncapDe.getValue(); + try + { + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setPeriodo_incapacidade_de(ddate_sql); + } + catch(Exception ex) + { + a.setPeriodo_incapacidade_de(null); + } + + ddate = (java.util.Date) calPeriodoIncapA.getValue(); + try + { + String ddate_str = formatador.format(ddate); + java.sql.Date ddate_sql = new java.sql.Date(formatador.parse(ddate_str).getTime()); + a.setPeriodo_incapacidade_a(ddate_sql); + } + catch(Exception ex) + { + a.setPeriodo_incapacidade_a(null); + } + +// a.setImg_flexao("n"); +// if(chkImgFlexao.getSelected() != null) +// { +// if(chkImgFlexao.getSelected().equals(new Boolean(true))) +// { +// a.setImg_flexao("y"); +// } +// } +// +// a.setImg_rot1("n"); +// if(chkImgRot1.getSelected() != null) +// { +// if(chkImgRot1.getSelected().equals(new Boolean(true))) +// { +// a.setImg_rot1("y"); +// } +// } +// +// a.setImg_rot2("n"); +// if(chkImgRot2.getSelected() != null) +// { +// if(chkImgRot2.getSelected().equals(new Boolean(true))) +// { +// a.setImg_rot2("y"); +// } +// } +// +// a.setImg_ext1("n"); +// if(chkImgExt1.getSelected() != null) +// { +// if(chkImgExt1.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ext1("y"); +// } +// } +// +// a.setImg_ext2("n"); +// if(chkImgExt2.getSelected() != null) +// { +// if(chkImgExt2.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ext2("y"); +// } +// } +// +// a.setImg_cab1("n"); +// if(chkImgCab1.getSelected() != null) +// { +// if(chkImgCab1.getSelected().equals(new Boolean(true))) +// { +// a.setImg_cab1("y"); +// } +// } +// +// a.setImg_cab2("n"); +// if(chkImgCab2.getSelected() != null) +// { +// if(chkImgCab2.getSelected().equals(new Boolean(true))) +// { +// a.setImg_cab2("y"); +// } +// } +// +// a.setImg_cab3("n"); +// if(chkImgCab3.getSelected() != null) +// { +// if(chkImgCab3.getSelected().equals(new Boolean(true))) +// { +// a.setImg_cab3("y"); +// } +// } +// +// a.setImg_cab4("n"); +// if(chkImgCab4.getSelected() != null) +// { +// if(chkImgCab4.getSelected().equals(new Boolean(true))) +// { +// a.setImg_cab4("y"); +// } +// } +// +// a.setImg_ma1("n"); +// if(chkImgMa1.getSelected() != null) +// { +// if(chkImgMa1.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma1("y"); +// } +// } +// +// a.setImg_ma2("n"); +// if(chkImgMa2.getSelected() != null) +// { +// if(chkImgMa2.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma2("y"); +// } +// } +// +// a.setImg_ma3("n"); +// if(chkImgMa3.getSelected() != null) +// { +// if(chkImgMa3.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma3("y"); +// } +// } +// +// a.setImg_ma4("n"); +// if(chkImgMa4.getSelected() != null) +// { +// if(chkImgMa4.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma4("y"); +// } +// } +// +// a.setImg_ma5("n"); +// if(chkImgMa5.getSelected() != null) +// { +// if(chkImgMa5.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma5("y"); +// } +// } +// +// a.setImg_ma6("n"); +// if(chkImgMa6.getSelected() != null) +// { +// if(chkImgMa6.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma6("y"); +// } +// } +// +// a.setImg_ma7("n"); +// if(chkImgMa7.getSelected() != null) +// { +// if(chkImgMa7.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma7("y"); +// } +// } +// +// a.setImg_ma8("n"); +// if(chkImgMa8.getSelected() != null) +// { +// if(chkImgMa8.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma8("y"); +// } +// } +// +// a.setImg_ma9("n"); +// if(chkImgMa9.getSelected() != null) +// { +// if(chkImgMa9.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma9("y"); +// } +// } +// +// a.setImg_ma10("n"); +// if(chkImgMa10.getSelected() != null) +// { +// if(chkImgMa10.getSelected().equals(new Boolean(true))) +// { +// a.setImg_ma10("y"); +// } +// } +// +// a.setRestricao_carga(new Integer(0)); +// if(chkRestricaoCargas.getSelected()!= null) +// { +// if(chkRestricaoCargas.getSelected().equals(new Boolean(true))) +// { +// if(rbKgs2.getSelected() != null) +// { +// if(rbKgs2.getSelected().equals(new Boolean(true))) +// { +// a.setRestricao_carga(new Integer(2)); +// } +// } +// if(rbKgs5.getSelected() != null) +// { +// if(rbKgs5.getSelected().equals(new Boolean(true))) +// { +// a.setRestricao_carga(new Integer(5)); +// } +// } +// if(rbKgs10.getSelected() != null) +// { +// if(rbKgs10.getSelected().equals(new Boolean(true))) +// { +// a.setRestricao_carga(new Integer(10)); +// } +// } +// if(rbKgs15.getSelected() != null) +// { +// if(rbKgs15.getSelected().equals(new Boolean(true))) +// { +// a.setRestricao_carga(new Integer(15)); +// } +// } +// +// if(rbKgsOutro.getSelected() != null) +// { +// if(rbKgsOutro.getSelected().equals(new Boolean(true))) +// { +// if(txtKgs.getText() != null) +// { +// String kgs_str = txtKgs.getText().toString(); +// int kgs = Integer.parseInt(kgs_str); +// a.setRestricao_carga(new Integer(kgs)); +// } +// } +// } +// } +// } +// +// a.setRestricao_motricidade("n"); +// if(chkRestricaoMotricidade.getSelected() != null) +// { +// if(chkRestricaoMotricidade.getSelected().equals(new Boolean(true))) +// { +// a.setRestricao_motricidade("y"); +// } +// } +// +// a.setRestricao_conducao("n"); +// if(chkRestricaoConducao.getSelected() != null) +// { +// if(chkRestricaoConducao.getSelected().equals(new Boolean(true))) +// { +// a.setRestricao_conducao("y"); +// } +// } +// +// a.setRestricao_vibracoes("n"); +// if(chkRestricaoVibracoes.getSelected() != null) +// { +// if(chkRestricaoVibracoes.getSelected().equals(new Boolean(true))) +// { +// a.setRestricao_vibracoes("y"); +// } +// } +// +// a.setRestricao_outras(""); +// if(chkRestricaoOutras.getSelected() != null) +// { +// if(chkRestricaoOutras.getSelected().equals(new Boolean(true))) +// { +// if(txtRestricaoOutras.getText() != null) +// { +// a.setRestricao_outras((String)txtRestricaoOutras.getText()); +// } +// } +// } +// +// a.setMed_observ(""); +// if(txtObservacoes.getText() != null) +// { +// a.setMed_observ( (String) txtObservacoes.getText() ); +// } + + return a; + } + + private AnaliseAcidente fillAnaliseFieldsConsolidacao(AnaliseAcidente a) + { + String nome_resp_consolidacao = getSessionBean1().getCurrentUser().getNome(); + a.setNome_resp_consolidacao(nome_resp_consolidacao); + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date(today.getTime()); + a.setData_consolidacao(sqlToday); + a.setAss_consolidacao("y"); + return a; + } + + private AnaliseAcidente fillAnaliseAssinaturas(AnaliseAcidente a) + { + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + java.util.Date today = new java.util.Date(); + java.sql.Date sqlToday = new java.sql.Date(today.getTime()); + int estado = a.getEstado().intValue(); + switch(estado) + { + case Global.ESTADO_ASSINATURA_SEG: + //notifyNextSignature(new Integer(Global.ESTADO_ASSINATURA_RH)); + a.setData_assinatura_seg(sqlToday); + a.setAss_resp_seg("y"); + a.setNome_resp_seg( getSessionBean1().getCurrentUser().getNome() ); + break; + case Global.ESTADO_ASSINATURA_RH: + a.setData_assinatura_rh(sqlToday); + a.setAss_resp_rh("y"); + a.setNome_resp_rh(getSessionBean1().getCurrentUser().getNome()); + break; + } + + return a; + } + + private boolean validationDepartmentSectionOk() + { + Integer departmentId = (Integer) drpDepartamento.getSelected(); + if(departmentId.intValue() == 0) + { + getSessionBean1().setMsg("Falta departamento!"); + return false; + } + Integer seccaoId = (Integer) drpSeccao.getSelected(); + if(seccaoId.intValue() == 0) + { + getSessionBean1().setMsg("Falta secção!"); + return false; + } + + return true; + } + + + private boolean validationOk() + { + if(getSessionBean1().getAcidentado() == null) + { + getSessionBean1().setMsg("Não seleccionou trabalhador acidentado!"); + return false; + } + + int estado = 0; + int estado_assinatura = 0; + if(getSessionBean1().getCurrentAnalise() == null) //null + { + estado = Global.ESTADO_SEG; + } + else + { + AnaliseAcidente a = getSessionBean1().getCurrentAnalise(); + estado = a.getEstado().intValue(); + estado_assinatura = a.getEstado_assinatura().intValue(); + } + + if(estado == Global.ESTADO_SEG) + { + if(txtAveriguador.getText() == null) + { + getSessionBean1().setMsg("Falta averiguador!"); + return false; + } + else + { + String averiguador = (String) txtAveriguador.getText(); + if(averiguador.trim().length() == 0) + { + getSessionBean1().setMsg("Falta averiguador!"); + return false; + } + } + + if(drpHours.getSelected() == null || drpMinutes.getSelected() == null) + { + getSessionBean1().setMsg("Falta hora acidente!"); + return false; + } + else + { + Integer h = (Integer) drpHours.getSelected(); + Integer m = (Integer) drpMinutes.getSelected(); + if(h.intValue() == -1 || m.intValue() == -1) + { + getSessionBean1().setMsg("Falta hora acidente!"); + return false; + } + + } + + if(txtHorasTurno.getText() != null) + { + String horas_turno = txtHorasTurno.getText().toString(); + if(horas_turno.trim().length() == 0) + { + getSessionBean1().setMsg("Falta nº horas trabalhadas no turno!"); + return false; + } + else + { + try + { + int nr = Integer.parseInt(horas_turno); + if(nr > 9) + { + getSessionBean1().setMsg("As horas turno devem ser entre 0 e 9!"); + return false; + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("As horas turno devem ser um valor numérico!"); + return false; + } + } + } + else + { + getSessionBean1().setMsg("Falta nº horas trabalhadas no turno!"); + return false; + } + + + if(drpDepartamento.getSelected() == null) + { + getSessionBean1().setMsg("Falta departamento!"); + return false; + } + else + { + Integer d = (Integer) drpDepartamento.getSelected(); + if(d.intValue() == 0) + { + getSessionBean1().setMsg("Falta departamento!"); + return false; + } + } + + if(drpSeccao.getSelected() == null) + { + getSessionBean1().setMsg("Falta secção!"); + return false; + } + else + { + Integer s = (Integer) drpSeccao.getSelected(); + if(s.intValue() == 0) + { + getSessionBean1().setMsg("Falta secção!"); + return false; + } + } + + if(txtLocal.getText() == null) + { + getSessionBean1().setMsg("Falta local específico!"); + return false; + } + else + { + String local = (String) txtLocal.getText(); + if(local.trim().length() == 0) + { + getSessionBean1().setMsg("Falta local específico!"); + return false; + } + } + + if(txtTarefa.getText() == null) + { + getSessionBean1().setMsg("Falta tarefa!"); + return false; + } + else + { + String tarefa = (String) txtTarefa.getText(); + if(tarefa.trim().length() == 0) + { + getSessionBean1().setMsg("Falta tarefa!"); + return false; + } + } + + if(txtSubstancias.getText() == null) + { + getSessionBean1().setMsg("Falta substâncias!"); + return false; + } + else + { + String substancias = (String) txtSubstancias.getText(); + if(substancias.trim().length() == 0) + { + getSessionBean1().setMsg("Falta substâncias!"); + return false; + } + } + + if(txtCondicoes.getText() == null) + { + getSessionBean1().setMsg("Falta condições!"); + return false; + } + else + { + String condicoes = (String) txtCondicoes.getText(); + if(condicoes.trim().length() == 0) + { + getSessionBean1().setMsg("Falta condições!"); + return false; + } + } + + if(txtTestemunhas.getText() == null) + { + getSessionBean1().setMsg("Falta testemunhas!"); + return false; + } + else + { + String testemunhas = (String) txtTestemunhas.getText(); + if(testemunhas.trim().length() == 0) + { + getSessionBean1().setMsg("Falta testemunhas!"); + return false; + } + } + + if(drpCausas.getSelected() == null) + { + getSessionBean1().setMsg("Falta causa do acidente!"); + return false; + } + else + { + Integer c = (Integer) drpCausas.getSelected(); + if(c.intValue() == 0) + { + getSessionBean1().setMsg("Falta causa do acidente!"); + return false; + } + } + + if(txtDescricao.getText() == null) + { + getSessionBean1().setMsg("Falta descrição do acidente!"); + return false; + } + else + { + String descricao = (String) txtDescricao.getText(); + if(descricao.trim().length() == 0) + { + getSessionBean1().setMsg("Falta descrição do acidente!"); + return false; + } + } + + if(txtConclusoes.getText() == null) + { + getSessionBean1().setMsg("Falta conclusões!"); + return false; + } + else + { + String conclusoes = (String) txtConclusoes.getText(); + if(conclusoes.trim().length() == 0) + { + getSessionBean1().setMsg("Falta conclusões!"); + return false; + } + } + + if(txtAccoes.getText() == null) + { + getSessionBean1().setMsg("Falta acções!"); + return false; + } + else + { + String accoes = (String) txtAccoes.getText(); + if(accoes.trim().length() == 0) + { + getSessionBean1().setMsg("Falta acções!"); + return false; + } + } + + } + + + if(estado == Global.ESTADO_RH1) + { + + if(txtBI.getText() == null) + { + getSessionBean1().setMsg("Falta Nº Bilhete de Identidade!"); + return false; + } + else + { + String bi = (String) txtBI.getText(); + if(bi.trim().length() == 0) + { + getSessionBean1().setMsg("Falta Nº Bilhete de Identidade!"); + return false; + } + else + { + try + { + int bi_nr = Integer.parseInt(bi); + } + catch(Exception ex) + { + getSessionBean1().setMsg("Nº do Bilhete de Identidade tem de ser numérico!"); + return false; + } + } + } + + if(txtMorada.getText() == null) + { + getSessionBean1().setMsg("Falta morada!"); + return false; + } + else + { + String morada = (String) txtMorada.getText(); + if(morada.trim().length() == 0) + { + getSessionBean1().setMsg("Falta morada!"); + return false; + } + } + + String cod_postal1 = ""; + String cod_postal2 = ""; + if(txtCodPostal1.getText() == null || txtCodPostal2.getText() == null) + { + getSessionBean1().setMsg("Falta código postal!"); + return false; + } + else + { + cod_postal1 = (String) txtCodPostal1.getText(); + cod_postal2 = (String) txtCodPostal2.getText(); + + if(cod_postal1.trim().length() == 0 || cod_postal2.trim().length() == 0) + { + getSessionBean1().setMsg("Falta código postal!"); + return false; + } + } + + if(txtCodPostal1.getText() != null) + { + if(cod_postal1.trim().length() > 0) + { + try + { + int nr = Integer.parseInt(cod_postal1); + if(nr < 1000 || nr > 9999) + { + getSessionBean1().setMsg("O formato do código postal é : '9999-999'"); + return false; + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("O código postal tem de ser um valor numérico!"); + return false; + } + } + } + + if(txtCodPostal2.getText() != null) + { + if(cod_postal2.trim().length() > 0) + { + if(cod_postal1.trim().length() == 0) + { + getSessionBean1().setMsg("O formato do código postal é : '9999-999'"); + return false; + } + try + { + int nr = Integer.parseInt(cod_postal2); + if(cod_postal2.length() > 3 ) + { + getSessionBean1().setMsg("O formato do código postal é : '9999-999'"); + return false; + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("O código postal de ser um valor numérico!"); + return false; + } + } + + if(txtLocalidade.getText() == null) + { + getSessionBean1().setMsg("Falta localidade!"); + return false; + } + else + { + String localidade = (String) txtLocalidade.getText(); + if(localidade.trim().length() == 0) + { + getSessionBean1().setMsg("Falta localidade!"); + return false; + } + } + + if(txtContactoTelefonico.getText() == null) + { + getSessionBean1().setMsg("Falta contacto telefónico!"); + return false; + } + else + { + String contacto_telefonico = (String) txtContactoTelefonico.getText(); + if(contacto_telefonico.trim().length() == 0) + { + getSessionBean1().setMsg("Falta contacto telefónico!"); + return false; + } + } + + if(rbTurnoManha.getSelected() == null && rbTurnoTarde.getSelected() == null && rbTurnoNoite.getSelected() == null ) + { + getSessionBean1().setMsg("Falta turno de trabalho!"); + return false; + } + + if(txtNomeSuperior.getText() == null) + { + getSessionBean1().setMsg("Falta nome do superior hierárquico!"); + return false; + } + else + { + String nome_superior = (String) txtNomeSuperior.getText(); + if(nome_superior.trim().length() == 0) + { + getSessionBean1().setMsg("Falta nome do superior hierárquico!"); + return false; + } + } + + if(txtEmailSuperior.getText() != null) + { + String email_superior = (String) txtEmailSuperior.getText(); + if(email_superior.trim().length() > 0) + { + if(! utils.Utils.isValidEmail(email_superior)) + { + getSessionBean1().setMsg("Email do superior hierárquico inválido!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta email do superior hierárquico!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta email do superior hierárquico!"); + return false; + } + } + + if(estado == Global.ESTADO_RH1) + { + + if(rbFormacaoSHSTY.getSelected() == null && rbFormacaoSHSTN.getSelected() == null) + { + getSessionBean1().setMsg("Falta indicar se o colaborador teve formação em SHST!"); + return false; + } + else + { + if(rbFormacaoSHSTY.getSelected() != null) + { + if(rbFormacaoSHSTY.getSelected().equals(new Boolean(false))) + { + if(rbFormacaoSHSTN.getSelected() != null) + { + if(rbFormacaoSHSTN.getSelected().equals(new Boolean(false))) + { + getSessionBean1().setMsg("Falta indicar se o colaborador teve formação em SHST!"); + return false; + } + } + } + } + } + + if(rbFormacaoSHSTN.getSelected() != null) + { + if(rbFormacaoSHSTN.getSelected().equals(new Boolean(true))) + { + if(txtFormacaoSHSTNWhy.getText() == null) + { + getSessionBean1().setMsg("Falta indicar a razão porque o colaborador não teve formação em SHST!"); + return false; + } + else + { + String why = (String) txtFormacaoSHSTNWhy.getText(); + if(why.trim().length() == 0) + { + getSessionBean1().setMsg("Falta indicar a razão porque o colaborador não teve formação em SHST!"); + return false; + } + } + } + + } + + if(rbAcidentesColaboradorY.getSelected() == null && rbAcidentesColaboradorN.getSelected() == null) + { + getSessionBean1().setMsg("Falta indicar se o colaborador teve outras ocorrências, ou não!"); + return false; + } + else + { + if(rbAcidentesColaboradorY.getSelected() != null) + { + if(rbAcidentesColaboradorY.getSelected().equals(new Boolean(false))) + { + if(rbAcidentesColaboradorN.getSelected() != null) + { + if(rbAcidentesColaboradorN.getSelected().equals(new Boolean(false))) + { + getSessionBean1().setMsg("Falta indicar se o colaborador teve outras ocorrências, ou não!"); + return false; + } + } + } + } + } + + if(rbAcidentesColaboradorY.getSelected() != null) + { + + if(rbAcidentesColaboradorY.getSelected().equals(new Boolean(true))) + { + if(txtNrAcidentesColaborador.getText() != null) + { + String nr_str = txtNrAcidentesColaborador.getText().toString(); + if(nr_str.trim().length() > 0) + { + try + { + int nr = Integer.parseInt(nr_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O º de acidentes do colaborador deve ser um valor numérico!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta indicar o º de ocorrências do colaborador!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta indicar o º de ocorrências do colaborador!"); + return false; + } + + if( + txtNrRelatorioAcidentesColaborador1.getText() == null && + txtNrRelatorioAcidentesColaborador2.getText() == null && + txtNrRelatorioAcidentesColaborador3.getText() == null && + txtNrRelatorioAcidentesColaborador1.getText() == null + ) + { + getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!"); + return false; + } + else + { + String nr_relatorio1 = ""; + String nr_relatorio2 = ""; + String nr_relatorio3 = ""; + String nr_relatorio4 = ""; + if(txtNrRelatorioAcidentesColaborador1.getText() != null) + { + nr_relatorio1 = (String) txtNrRelatorioAcidentesColaborador1.getText(); + } + if(txtNrRelatorioAcidentesColaborador2.getText() != null) + { + nr_relatorio2 = (String) txtNrRelatorioAcidentesColaborador2.getText(); + } + if(txtNrRelatorioAcidentesColaborador3.getText() != null) + { + nr_relatorio3 = (String) txtNrRelatorioAcidentesColaborador3.getText(); + } + if(txtNrRelatorioAcidentesColaborador4.getText() != null) + { + nr_relatorio4 = (String) txtNrRelatorioAcidentesColaborador4.getText(); + } + + if(nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0) + { + getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente do colaborador!"); + return false; + } + } + }// + + } + + + + if(rbAcidentesColaboradoresY.getSelected() == null && rbAcidentesColaboradoresN.getSelected() == null) + { + getSessionBean1().setMsg("Falta indicar se houve outras ocorrências com outros colaboradores!"); + return false; + } + else + { + if(rbAcidentesColaboradoresY.getSelected() != null) + { + if(rbAcidentesColaboradoresY.getSelected().equals(new Boolean(false))) + { + if(rbAcidentesColaboradoresN.getSelected() != null) + { + if(rbAcidentesColaboradoresN.getSelected().equals(new Boolean(false))) + { + getSessionBean1().setMsg("Falta indicar se houve outras ocorrências com outros colaboradores!"); + return false; + } + } + } + } + } + + if(rbAcidentesColaboradoresY.getSelected() != null) + { + + if(rbAcidentesColaboradoresY.getSelected().equals(new Boolean(true))) + { + if(txtNrAcidentesColaboradores.getText() != null) + { + String nr_str = txtNrAcidentesColaboradores.getText().toString(); + if(nr_str.trim().length() > 0) + { + try + { + int nr = Integer.parseInt(nr_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O º de acidentes dos colaboradores deve ser um valor numérico!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta indicar o º de ocorrências com outros colaboradores!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta indicar o º de ocorrências com outros colaboradores!"); + return false; + } + + if( + txtNrRelatorioAcidentesColaboradores1.getText() == null && + txtNrRelatorioAcidentesColaboradores2.getText() == null && + txtNrRelatorioAcidentesColaboradores3.getText() == null && + txtNrRelatorioAcidentesColaboradores1.getText() == null + ) + { + getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!"); + return false; + } + else + { + String nr_relatorio1 = ""; + String nr_relatorio2 = ""; + String nr_relatorio3 = ""; + String nr_relatorio4 = ""; + if(txtNrRelatorioAcidentesColaboradores1.getText() != null) + { + nr_relatorio1 = (String) txtNrRelatorioAcidentesColaboradores1.getText(); + } + if(txtNrRelatorioAcidentesColaboradores2.getText() != null) + { + nr_relatorio2 = (String) txtNrRelatorioAcidentesColaboradores2.getText(); + } + if(txtNrRelatorioAcidentesColaboradores3.getText() != null) + { + nr_relatorio3 = (String) txtNrRelatorioAcidentesColaboradores3.getText(); + } + if(txtNrRelatorioAcidentesColaboradores4.getText() != null) + { + nr_relatorio4 = (String) txtNrRelatorioAcidentesColaboradores4.getText(); + } + + if(nr_relatorio1.trim().length() == 0 && nr_relatorio2.trim().length() == 0 && nr_relatorio3.trim().length() == 0 && nr_relatorio4.trim().length() == 0) + { + getSessionBean1().setMsg("Falta indicar o(s) º(s) do(s) relatório(s) de acidente com outros colaboradores!"); + return false; + } + } + }// + + } + + } + } + else if(estado == Global.ESTADO_HS) //recomendacoes + { + if(isRecomendacoesEmpty()) + { + getSessionBean1().setMsg("Tem de preencher pelo menos uma recomendação!"); + return false; + } + } + else if(estado == Global.ESTADO_RH2) //medidas + { + if(isMedidasEmpty()) + { + getSessionBean1().setMsg("Tem de preencher pelo menos uma medida!"); + return false; + } +// } +// //else if(estado == Global.ESTADO_MEDICINA) +// else if(estado == Global.ESTADO_RH2) +// { + if(rbIncapacidadeNone.getSelected() == null && rbIncapacidadeTemp.getSelected() == null && rbIncapacidadePerm.getSelected() == null) + { + getSessionBean1().setMsg("Falta indicar o tipo de incapacidade!"); + return false; + } + else + { + if(rbIncapacidadeNone.getSelected() != null) + { + if(rbIncapacidadeNone.getSelected().equals(new Boolean(false))) + { + if(rbIncapacidadeTemp.getSelected() != null) + { + if(rbIncapacidadeTemp.getSelected().equals(new Boolean(false))) + { + if(rbIncapacidadePerm.getSelected() != null) + { + if(rbIncapacidadePerm.getSelected().equals(new Boolean(false))) + { + getSessionBean1().setMsg("Falta indicar o tipo de incapacidade!"); + return false; + } + } + } + } + } + } + } + + if(txtCoefIncapacidade.getText() != null) + { + String coef_str = txtCoefIncapacidade.getText().toString(); + if(coef_str.trim().length() > 0) + { + try + { + int nr = Integer.parseInt(coef_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O coeficiente de incapacidade deve ser um valor numérico!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta coeficiente de incapacidade!"); + return false; + } + } + else + { + getSessionBean1().setMsg("Falta coeficiente de incapacidade!"); + return false; + } + + if(chkRestricaoCargas.getSelected() != null) + { + Boolean b = (Boolean) chkRestricaoCargas.getSelected(); + if(b.equals(new Boolean(true))) + { + if(txtKgs.getText() != null) + { + String kgs_str = txtKgs.getText().toString(); + try + { + int nr = Integer.parseInt(kgs_str); + } + catch(Exception ex) + { + getSessionBean1().setMsg("O valor de kgs deve ser um valor numérico!"); + return false; + } + } + } + } + } + else if(estado == Global.ESTADO_CONSOLIDACAO) + { + if(chkVerHs.getSelected() == null) + { + getSessionBean1().setMsg("Falta assinatura!"); + return false; + } + else if(chkVerHs.getSelected().equals(new Boolean(false))) + { + getSessionBean1().setMsg("Falta assinatura!"); + return false; + } + } + else if(estado == Global.ESTADO_ASSINATURA_SEG) + { + if(chkVerRespSeg.getSelected() == null) + { + getSessionBean1().setMsg("Falta assinatura!"); + return false; + } + else if(chkVerRespSeg.getSelected().equals(new Boolean(false))) + { + getSessionBean1().setMsg("Falta assinatura!"); + return false; + } + } + else if(estado == Global.ESTADO_ASSINATURA_RH) + { + if(chkVerRespRh.getSelected() == null) + { + getSessionBean1().setMsg("Falta assinatura!"); + return false; + } + else if(chkVerRespRh.getSelected().equals(new Boolean(false))) + { + getSessionBean1().setMsg("Falta assinatura!"); + return false; + } + } + + + return true; + } + + private void createImagesFolder(AnaliseAcidente a) + //private void createImagesFolder(String folderName) + { + String folderName = a.getAnalise_nr().substring(0,2) + a.getAnalise_nr().substring(3); + + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { +// String imageFileFolderTmp = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin()); + String imageFileFolderTmp = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File f = new File(imageFileFolderTmp); + if( f.exists() ) + { + File folder = new File(imageFileFolder); + folder.mkdir(); + + File files[] = f.listFiles(); + + for(int i=0;i 0) + { + gridImages.getChildren().clear(); + } + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + + + File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); + if(apacheAnaliseFolder.exists()) + { + Global global = new Global(); + global.deleteFolderFiles(apacheAnaliseFolder); + System.out.println("FILES DELETED"); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + + + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File images[] = f.listFiles(); + Arrays.sort(images); + for(int i=0;i"; + + String responsavel_loja = "n"; + switch (estado.intValue()) + { + case Global.ESTADO_RH1: + tipo = new Integer(Global.TIPO_UTILIZADOR_RH); + break; + case Global.ESTADO_HS: + tipo = new Integer(Global.TIPO_UTILIZADOR_HS); + break; + case Global.ESTADO_RH2: + tipo = new Integer(Global.TIPO_UTILIZADOR_RH); + break; + case Global.ESTADO_CONSOLIDACAO: + tipo = new Integer(Global.TIPO_UTILIZADOR_HS); + break; + case Global.ESTADO_ASSINATURA_SEG: + tipo =new Integer(Global.TIPO_UTILIZADOR_SEGURANCA); + responsavel_loja = "y"; + break; + case Global.ESTADO_ASSINATURA_RH: + tipo = new Integer(Global.TIPO_UTILIZADOR_RH); + responsavel_loja = "y"; + break; + case Global.ESTADO_FECHAR: + tipo = new Integer(Global.TIPO_UTILIZADOR_HS); + break; + } + +// if(estado.intValue() == Global.ESTADO_FECHAR) +// { +// tipo = new Integer(Global.TIPO_UTILIZADOR_HS); // hs +// } +// else +// { +// tipo = estado; +// } + + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + try + { + ArrayList list = udp.getUtilizadoresListByTipo(tipo, responsavel_loja); + ListIterator iter = list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + System.out.println("USER MAIL : " + u.getLogin() + " ; " + u.getEmail()); + try + { + sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); + } + catch(Exception ex1) + { + ex1.printStackTrace(); + System.out.println("MAIL ERROR : " + ex1.getMessage()); + } + + } + } + catch(Exception ex) + { + //ex.printStackTrace(); + } + + } + + private void sendEmailResponsavelHierarquico(AnaliseAcidente a) + { + Acidentado ac = getSessionBean1().getAcidentado(); + String assunto = "Comunicação de Análise de Acidentes de Trabalho de " + ac.getNome(); + + String data_acidente = ""; + try + { + java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); + data_acidente = utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex){} + + String texto_email = "

Caro(a) Colega,

"; + texto_email += "

Na sequência do acidente de trabalho do colaborador "; + texto_email += ac.getNome(); + texto_email += " no dia " + data_acidente; + texto_email += ", vimos pelo presente remeter cópia da análise do acidente " + a.getAnalise_nr() + " que se encontra em processo de averiguação pelo departamento de Segurança, Recursos Humanos e pela SIPRP para seu conhecimento. Caso tenha qualquer informação importante sobre o processo ou pretenda esclarecimentos adicionais contacte, por favor, a secção de Recursos Humanos.

"; + texto_email += "

Cumprimentos.

"; + try + { + sendEmail(ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + private void sendEmailFimProcesso(AnaliseAcidente a) + { + Acidentado ac = getSessionBean1().getAcidentado(); + String assunto = "Fecho do Processo de Análise de Acidente de Trabalho de " + ac.getNome(); + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + ArrayList responsavelRh_list = udp.getResponsavelRhList( a.getEstabelecimento_id() ); + if(responsavelRh_list != null) + { + ListIterator iter = responsavelRh_list.listIterator(); + while(iter.hasNext()) + { + Utilizador u = (Utilizador) iter.next(); + String texto_email = "

Exmo. (a) Senhor(a), " + u.getNome() + "

"; + texto_email += "

Informamos que o processo de análise de acidente de trabalho nº " + a.getAnalise_nr() + " se encontra finalizado, "; + texto_email += "pelo que solicitamos a sua impressão e arquivamento em pasta própria, juntamente com a participação de sinistro à seguradora.

"; + texto_email += "

Caso pretenda qualquer esclarecimento, contacte-nos, por favor, através de acidentes.auchan@siprp.pt ou pelo telefone 213 504 540.

"; + texto_email += "

Os melhores cumprimentos.

"; + texto_email += "

SIPRP

"; + try + { + sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + } + } + +// private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_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", emailFrom); +// Session session1 = Session.getInstance(props); +// Message msg = new MimeMessage(session1); +// +//// try +//// { +// //Address Email_TO = new InternetAddress("myemail@bol.com.br"); +// msg.setFrom(new InternetAddress(emailFrom)); +// InternetAddress[] address = {new InternetAddress(emailTo)}; +// msg.setRecipients(Message.RecipientType.TO, address); +// msg.setSubject(assunto); +// msg.setSentDate(new Date()); +// Multipart multipart = new MimeMultipart(); +// BodyPart msgBodyPart = new MimeBodyPart(); +// String html; +// html=" "; +// html+=""; +// html+= texto_email; +// 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 class SMTPAuthenticator extends Authenticator { + public PasswordAuthentication getPasswordAuthentication() { + String username = "lluis"; + String password = "654321"; + return new PasswordAuthentication(username, password); + } + } + private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email) throws Exception + { + Properties props = new Properties(); + //props.put("mail.transport.protocol", "smtp"); + props.put("mail.smtp.host", "mail2.evolute.pt"); + props.put("mail.from", emailFrom); + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.user", "lluis"); + props.put("mail.smtp.password", "654321"); +// Session session1 = Session.getInstance(props); + Authenticator auth = new SMTPAuthenticator(); + Session session = Session.getDefaultInstance(props, auth); + + Message msg = new MimeMessage(session); + msg.setFrom(new InternetAddress(emailFrom)); + InternetAddress[] address = {new InternetAddress(emailTo)}; + msg.setRecipients(Message.RecipientType.TO, address); + msg.setSubject(assunto); + msg.setSentDate(new Date()); + Multipart multipart = new MimeMultipart(); + BodyPart msgBodyPart = new MimeBodyPart(); + String html; + html=" "; + html+=""; + html+= texto_email; + html+=""; + msgBodyPart.setContent(html, "text/html"); + multipart.addBodyPart(msgBodyPart); + msg.setContent(multipart); + ////////Transport.send(msg); + ////////System.out.println("Email Enviado !!!! "); + + } + + 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); +// } + + if(validationOk()) + { + AnaliseAcidente a = fillAnaliseFields(); + Acidentado ac = null; + ArrayList recs = null; + ArrayList meds = null; + int estado = a.getEstado().intValue(); + //if(estado == ESTADO_SEG || estado == ESTADO_RH1) +// if(estado == Global.ESTADO_RH1) +// { +// ac = fillAcidentadoFields(); +// } +// else if(estado == Global.ESTADO_HS) +// { +// a.setTecnico_saude_id(getSessionBean1().getCurrentUser().getId()); +// recs = fillAnaliseRecomendacoesHs(a); +// } +// else if(estado == Global.ESTADO_RH2) +// { +// meds = fillAnaliseMedidasRh(a); +// } +// int novo_estado = a.getEstado().intValue(); +// +// if(a.getCorrecao().matches("y")) +// { +// a.setCorrecao("n"); +// a.setEstado(a.getEstado_antes_correcao()); +// a.setEstado_antes_correcao(null); +// a.setObservacoes_correcao(""); +// } +// else +// { +// if(novo_estado < Global.ESTADO_CONCLUIDO) +// { +// novo_estado++; +// // if(novo_estado == ESTADO_MEDICO) +// // { +// // novo_estado++; //skip medico +// // } +// if(novo_estado == Global.ESTADO_ASSINATURAS) +// { +// a.setEstado_assinatura(new Integer(ESTADO_ASSINATURA_1)); +// notifyNextSignature(new Integer(ESTADO_ASSINATURA_1)); +// } +// } +// a.setEstado(new Integer(novo_estado)); +// } + + try + { + update(a, ac, recs, meds); + chkVerRespRh.setDisabled(true); + //createImagesFolder(analiseId.toString()); +// updateImagesFolder(a.getId().toString()); +// sendMailToNextUser(new Integer(novo_estado)); +// String navFrom = getSessionBean1().getNavFrom(); +// if(navFrom.matches("FormSeguranca")) +// { +// return "form_seguranca"; +// } +// else if(navFrom.matches("FormRH")) +// { +// return "form_rh"; +// } +// else if(navFrom.matches("FormHS")) +// { +// return "form_hs"; +// } +// else if(navFrom.matches("FormMedico")) +// { +// return "form_medico"; +// } + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na actualização da análise !"); + ex.printStackTrace(); + } + } + + return null; + } + + private void buildPdf(AnaliseAcidente a) + { + + // create pdf folder + String pdf_folder = createPdfFolder(a.getId().toString()); + if(pdf_folder != null) + { + hidDisableEnviar.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;i 0) + { + booNrOk = true; + } + else + { + nr_mecano = null; + } + } + + if(txtNomeTrabalhador.getText() != null) + { + nome = (String) txtNomeTrabalhador.getText(); + if(nome.trim().length() > 0) + { + booNomeOk = true; + } + else + { + nome = null; + } + } + + if(! booNrOk && !booNomeOk) + { + getSessionBean1().setMsg("Tem de preencher Numero Mecanográfico ou Nome"); + return null; + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + Trabalhador t = null; + if(nome != null) + { + nome = utils.Utils.textToUnicode( nome.toUpperCase()); + } + try + { + ArrayList list = adp.searchTrabalhador(getSessionBean1().getCurrentUser().getEmpresa_id(), getSessionBean1().getCurrentUser().getEstabelecimento_id(), nr_mecano, nome ); + if(list.size() == 1) + { + t = (Trabalhador) list.get(0); + txtTrabalhador.setText(t.getNome()); + txtNomeAcidentado.setText(t.getNome()); + txtDataNascimento.setText(t.getData_nascimento()); + Acidentado a = new Acidentado(); + a.setTrabalhador_id(t.getId()); + a.setData_nascimento(t.getData_nascimento()); + a.setNome(t.getNome()); + a.setFuncao(utils.Utils.unicodeToHTML(t.getFuncao())); + a.setData_admissao(t.getData_admissao()); + a.setNumero_mecanografico(t.getNumero_mecanografico()); + getSessionBean1().setAcidentado(a); + gridSiprp.setRendered(true); + gridDadosAcidenteSeg.setRendered(true); + } + else + { + tblTrabalhadores.setRendered(true); + getSessionBean1().getTrabalhadoresListDataProvider().setList(list); + } + if(getSessionBean1().getCurrentAnalise() != null) // new analise) + { + gridTrabalhadores.setRendered(false); + } + } + catch(Exception ex) + { + getSessionBean1().setMsg("Trabalhador inexistente !"); + tblTrabalhadores.setRendered(false); + //ex.printStackTrace(); + } + + return null; + } + + public String lnkPOR_action() { + // TODO: Replace with your code + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado(t); + gridSiprp.setRendered(true); + gridAcidentadoView.setRendered(true); + gridDadosAcidenteSeg.setRendered(true); + gridTrabalhadores.setRendered(false); + fillAcidentadoView(ac); + return null; + } + + public String lnkNomeTrabalhador_action() { + // TODO: Replace with your code + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado(t); + gridSiprp.setRendered(true); + gridAcidentadoView.setRendered(true); + gridDadosAcidenteSeg.setRendered(true); + gridTrabalhadores.setRendered(false); + fillAcidentadoView(ac); + return null; + } + + public String lnkEstabelecimentoTrabalhador_action() { + // TODO: Replace with your code + Trabalhador t = getTrabalhadorRowData(); + Acidentado ac = setAcidentado(t); + gridSiprp.setRendered(true); + gridAcidentadoView.setRendered(true); + gridDadosAcidenteSeg.setRendered(true); + gridTrabalhadores.setRendered(false); + fillAcidentadoView(ac); + return null; + } + + private Trabalhador getTrabalhadorRowData() + { + RowKey rk = tableRowGroup1.getRowKey(); + int k = Integer.parseInt(rk.getRowId()); + TrabalhadoresListDataProvider provider = (TrabalhadoresListDataProvider) tableRowGroup1.getSourceData(); + ArrayList list = (ArrayList) provider.getList(); + Trabalhador t = (Trabalhador)list.get(k); + return t; + } + + private Acidentado setAcidentado(Trabalhador t) + { + txtTrabalhador.setText(t.getNome()); + txtNomeAcidentado.setText(t.getNome()); + txtDataNascimento.setText(t.getData_nascimento()); + Acidentado a = new Acidentado(); + a.setTrabalhador_id(t.getId()); + a.setData_nascimento(t.getData_nascimento()); + a.setNome(t.getNome()); + a.setMorada(""); + a.setFuncao(utils.Utils.unicodeToHTML(t.getFuncao())); + a.setData_admissao(t.getData_admissao()); + a.setNumero_mecanografico(t.getNumero_mecanografico()); + a.setEstabelecimento_origem(t.getEstabelecimento()); + getSessionBean1().setAcidentado(a); + return a; + } + + public String butCorrecao_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + + return "correcao"; + } + + public String lnkNewUser_action() { + // TODO: Replace with your code + + return null; + } + + private boolean isRecomendacoesEmpty() + { + boolean res = true; + + for(int i=0; i < gridRecomendacoes.getChildren().size(); i++) + { + HtmlPanelGrid g = (HtmlPanelGrid) gridRecomendacoes.getChildren().get(i); + TextArea t = (TextArea) g.getChildren().get(1); + if(t.getText() != null) + { + String txt = (String) t.getText(); + if(txt.trim().length() > 0) + { + res = false; + break; + } + } + } + + return res; + } + + private boolean isMedidasEmpty() + { + boolean res = true; + + for(int i=0; i < gridMedidas.getChildren().size(); i++) + { + HtmlPanelGrid g = (HtmlPanelGrid) gridMedidas.getChildren().get(i); + TextArea t = (TextArea) g.getChildren().get(1); + if(t.getText() != null) + { + String txt = (String) t.getText(); + if(txt.trim().length() > 0) + { + res = false; + break; + } + } + } + + return res; + } + + public void drpDepartamento_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + AnalisesDataProvider adp = new AnalisesDataProvider(); + Integer departamento_id = (Integer) drpDepartamento.getSelected(); + try + { + if(departamento_id.intValue()== 0) + { + getSessionBean1().setSeccaoOptions(adp.getSeccoesList(null)); + } + else + { + getSessionBean1().setSeccaoOptions(adp.getSeccoesList(departamento_id)); + } + + drpSeccao.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + hidAnchor.setValue("dados"); + } + +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ApplicationBean1.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ApplicationBean1.java new file mode 100644 index 00000000..36df6ef2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ApplicationBean1.java @@ -0,0 +1,100 @@ +/* + * ApplicationBean1.java + * + * Created on September 18, 2007, 3:14 PM + * Copyright lluis + */ +package analiseacidentestrabalho; + +import com.sun.rave.web.ui.appbase.AbstractApplicationBean; +import javax.faces.FacesException; + +/** + *

Application scope data bean for your application. Create properties + * here to represent cached data that should be made available to all users + * and pages in the application.

+ * + *

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 ApplicationBean1 extends AbstractApplicationBean { + // + private int __placeholder; + + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("ApplicationBean1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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.

+ */ + public void destroy() { + } + + /** + *

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.

+ */ + public String getLocaleCharacterEncoding() { + return super.getLocaleCharacterEncoding(); + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Bundle.properties b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Bundle.properties new file mode 100644 index 00000000..13e936fe --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Bundle.properties @@ -0,0 +1 @@ +# Sample ResourceBundle properties file diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Dummy.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Dummy.java new file mode 100644 index 00000000..0dc03da1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Dummy.java @@ -0,0 +1,600 @@ +/* + * Dummy.java + * + * + * Created on September 19, 2007, 10:56 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.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.StaticText; +import global.Global; +import java.io.File; +import java.util.Calendar; +import java.util.GregorianCalendar; +import javax.faces.FacesException; +import javax.faces.component.html.HtmlPanelGrid; +import javax.faces.event.ActionEvent; +import javax.faces.event.ValueChangeEvent; + +/** + *

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 { + // + private int __placeholder; + + /** + *

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 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 HiddenField hiddenField1 = new HiddenField(); + + public HiddenField getHiddenField1() { + return hiddenField1; + } + + public void setHiddenField1(HiddenField hf) { + this.hiddenField1 = hf; + } + + private Button button2 = new Button(); + + public Button getButton2() { + return button2; + } + + public void setButton2(Button b) { + this.button2 = b; + } + + private StaticText stMsg = new StaticText(); + + public StaticText getStMsg() { + return stMsg; + } + + public void setStMsg(StaticText st) { + this.stMsg = st; + } + + private ImageComponent image1 = new ImageComponent(); + + public ImageComponent getImage1() { + return image1; + } + + public void setImage1(ImageComponent ic) { + this.image1 = ic; + } + + //
+ + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Dummy Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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).

+ */ + 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"); + } + + public String button1_action() { + + java.util.Date now = new java.util.Date(); + Calendar cal = new GregorianCalendar(); + cal.setTime(now); + int ano = cal.get(Calendar.YEAR); + int mes = cal.MONTH; + int dia = cal.DAY_OF_MONTH; + + Calendar today = new GregorianCalendar(ano, mes, dia); + Calendar firstJan = new GregorianCalendar(ano, Calendar.JANUARY, 1); + Calendar firstJul = new GregorianCalendar(ano, Calendar.JULY, 1); + + if(today.compareTo(firstJan) == 0) + { + System.out.println("IGUAL !!!!!!!!!"); + } + +// GregorianCalendar backDate = new GregorianCalendar(ano, Calendar.MAY, 1); +// backDate.add(GregorianCalendar.DATE, 180); +// Date d = worldTour.getTime(); + + + 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; + } + + public String butProcurarTrab_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 lnkPOR_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkNomeTrabalhador_action() { + // TODO: Replace with your code + + return null; + } + + public String lnkEstabelecimentoTrabalhador_action() { + // TODO: Replace with your code + + return null; + } + + public void drpTipo_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public void drpNome_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + + } + + public String hyperlink1_action() { + // TODO: Replace with your code + + return null; + } + + public void lnk_actionListener(ActionEvent e) + { + System.out.println("LINK"); + } + + public String button2_action() { + // TODO: Process the button click action. Return value is a navigation + // case name where null will return to the same page. + //File f = new File(Global.IMAGE_FOLDER); + //stMsg.setText(f.getAbsolutePath() + " ; " + f.exists() + " ; " + f.canRead() + " ; " + f.canWrite()); + String foldername = Global.IMAGE_FOLDER + "/AAA"; + File folder = new File(foldername); + boolean res = folder.mkdir(); + stMsg.setText(res + " ; " + folder.getAbsolutePath()); + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Erro.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Erro.java new file mode 100644 index 00000000..66aa2dc1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Erro.java @@ -0,0 +1,239 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Error Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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).

+ */ + 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java new file mode 100644 index 00000000..afdcaecf --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Estabelecimento.java @@ -0,0 +1,49 @@ +/* + * 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; + private String nome; + + /** 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; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java new file mode 100644 index 00000000..72d1cef1 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FichaUtilizador.java @@ -0,0 +1,1568 @@ +/* + * FichaUtilizador.java + * + * Created on October 11, 2007, 9:49 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.Checkbox; +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; +import global.Global; + +/** + *

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 { + // + private int __placeholder; + + /** + *

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; + } + + //
+ private boolean isPostData = false; + + private final static int SEG = 1; + private final static int RH = 2; + private final static int HS = 3; + private final static int MEDICO = 5; + private final static int GESTOR = 6; + private final static int DIRECTOR_RH = 7; + private final static int DIRECTOR_SIPRP = 8; + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private DropDown drpEstabelecimentos = new DropDown(); + + public DropDown getDrpEstabelecimentos() { + return drpEstabelecimentos; + } + + public void setDrpEstabelecimentos(DropDown dd) { + this.drpEstabelecimentos = dd; + } + + private SingleSelectOptionsList drpEstabelecimentosDefaultOptions = new SingleSelectOptionsList(); + + public SingleSelectOptionsList getDrpEstabelecimentosDefaultOptions() { + return drpEstabelecimentosDefaultOptions; + } + + public void setDrpEstabelecimentosDefaultOptions(SingleSelectOptionsList ssol) { + this.drpEstabelecimentosDefaultOptions = ssol; + } + + private StaticText lblResponsavelLoja = new StaticText(); + + public StaticText getLblResponsavelLoja() { + return lblResponsavelLoja; + } + + public void setLblResponsavelLoja(StaticText st) { + this.lblResponsavelLoja = st; + } + + private Checkbox chkResponsavelLoja = new Checkbox(); + + public Checkbox getChkResponsavelLoja() { + return chkResponsavelLoja; + } + + public void setChkResponsavelLoja(Checkbox c) { + this.chkResponsavelLoja = c; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private PasswordField txtConfPassword = new PasswordField(); + + public PasswordField getTxtConfPassword() { + return txtConfPassword; + } + + public void setTxtConfPassword(PasswordField pf) { + this.txtConfPassword = pf; + } + + private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel8() { + return gridPanel8; + } + + public void setGridPanel8(HtmlPanelGrid hpg) { + this.gridPanel8 = hpg; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() { + return staticText14; + } + + public void setStaticText14(StaticText st) { + this.staticText14 = st; + } + + private Hyperlink lnkGerirUtilizadores = new Hyperlink(); + + public Hyperlink getLnkGerirUtilizadores() { + return lnkGerirUtilizadores; + } + + public void setLnkGerirUtilizadores(Hyperlink h) { + this.lnkGerirUtilizadores = h; + } + + private StaticText staticText15 = new StaticText(); + + public StaticText getStaticText15() { + return staticText15; + } + + public void setStaticText15(StaticText st) { + this.staticText15 = st; + } + + private Hyperlink lnkAnalisesAcidente = new Hyperlink(); + + public Hyperlink getLnkAnalisesAcidente() { + return lnkAnalisesAcidente; + } + + public void setLnkAnalisesAcidente(Hyperlink h) { + this.lnkAnalisesAcidente = h; + } + + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FichaUtilizador Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + else + { + + if( + getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH + || getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP ) + { + lnkGerirUtilizadores.setDisabled(false); + } + else + { + lnkGerirUtilizadores.setDisabled(true); + } + + HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest(); + String referer = request.getRequestURI(); + String pageFrom = Utils.getPageFrom(referer); + if(pageFrom.matches("FichaUtilizador.jsp")) + { + isPostData = true; + } + if(!isPostData) + { + + + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + UtilizadoresDataProvider udp = new UtilizadoresDataProvider(); + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + Integer permissao = udp.getPermissionCode( getSessionBean1().getCurrentUser().getId() ); + getSessionBean1().setTiposOptions(adp.getTiposList(permissao)); + drpTipo.setSelected(new Integer(0)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + getSessionBean1().setEstabelecimentosOptions(adp.getEstabelecimentosList( getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean(false) )); + drpEstabelecimentos.setSelected(new Integer(-1)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + } + else //postData + { + String del_user = (String)getExternalContext().getRequestParameterMap().get("del_user"); + if(del_user != null) + { + if(del_user.matches("yes")) + { + hidConfDelUser.setValue(""); + try + { + deleteUser(); + } + catch(Exception ex) + { + ex.printStackTrace(); + getSessionBean1().setMsg("Erro na eliminação do utilizador!"); + } + + //force a page reload + // try + // { + // getExternalContext().redirect("FichaUtilizador.jsp"); + // System.out.println("REDIRECT"); + // } + // catch(Exception ex) + // { + // ex.printStackTrace(); + // } + + } + else if(del_user.matches("no")) + { + hidConfDelUser.setValue(""); + showUser(); + } + } + + } + + } + + + + } + + /** + *

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"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + } + butApagar.setRendered(false); + } + if(getSessionBean1().getModoEdicaoUtilizador().matches("edit")) + { + //drpNome.setRendered(true); + butApagar.setRendered(false); + if(!isPostData) + { + showUser(); + } + } + + txtMsg.setText(getSessionBean1().getMsg()); + getSessionBean1().setMsg(""); + + if(getSessionBean1().isMudarPassword()) + { + //txtMsg.setStyle("color: #000000; font-weight: bold"); + if(!isPostData) + { + txtMsg.setText("Por favor confirme os seus dados e altere a password para uma apenas do seu conhecimento."); + } + //getSessionBean1().setMudarPassword(false); + } + } + + /** + *

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).

+ */ + public void destroy() { + } + + /** + *

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 lnkAnalisesAcidente_action() { + //return navigate(); + int tipo = getSessionBean1().getCurrentUser().getTipo().intValue(); + if(tipo == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + return "form_dir_siprp"; + } + else if(tipo == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + return "form_dir_ger_rh"; + } + else if(tipo == Global.TIPO_UTILIZADOR_SEGURANCA) + { + return "form_seguranca"; + } + else if(tipo == Global.TIPO_UTILIZADOR_RH) + { + return "form_rh"; + } + else if(tipo == Global.TIPO_UTILIZADOR_RH) + { + return "form_rh"; + } + else if(tipo == Global.TIPO_UTILIZADOR_HS) + { + return "form_hs"; + } + else if(tipo == Global.TIPO_UTILIZADOR_GESTOR) + { + return "form_gestor"; + } + + return null; + } + + public String lnkLogout_action() { + // TODO: Replace with your code + try + { + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + } + catch(Exception ex){} + + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) {} + //return "login"; + 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 navigate(); + } + + 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); + getSessionBean1().setMsg("Utilizador criado"); + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na criação do utilizador!"); + ex.printStackTrace(); + } + } + else //edit + { + try + { + updateUser(); + //getSessionBean1().setMsg("Dados actualizados"); + return navigate(); + } + catch(Exception ex) + { + getSessionBean1().setMsg("Erro na actualização do utilizador"); + ex.printStackTrace(); + } + } + + if(getSessionBean1().isMudarPassword()) + { + getSessionBean1().setMudarPassword(false); + } + + } + + return null; + } + + public void drpTipo_processValueChange(ValueChangeEvent event) { + // TODO: Replace with your code + drpNome.setVisible(true); + Integer tipo = (Integer) drpTipo.getSelected(); + boolean booGestor = false; + if(tipo.intValue() == GESTOR) + { + booGestor = true; + } + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + getSessionBean1().setEstabelecimentosOptions(adp.getEstabelecimentosList( getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean(booGestor) )); + drpEstabelecimentos.setSelected(new Integer(-1)); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == GESTOR || tipo.intValue() == DIRECTOR_RH || tipo.intValue() == DIRECTOR_SIPRP) + { + 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"); + 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() == -1) +// { +// getSessionBean1().setMsg("Tem de escolher um estabelecimento!"); +// return false; +// } + +// if(tipo.intValue() == SEG || tipo.intValue() == RH || tipo.intValue() == GESTOR || tipo.intValue() == DIRECTOR_RH || tipo.intValue() == DIRECTOR_SIPRP) +// { +// 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; + } + else + { + if(txtConfPassword.getText() == null) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + String conf_password = (String) txtConfPassword.getText(); + if(conf_password.trim().length() == 0) + { + getSessionBean1().setMsg("Tem de confirmar a password!"); + return false; + } + else + { + if(!password.equals(conf_password)) + { + getSessionBean1().setMsg("A confirmação tem de ser igual à a password!"); + return false; + } + } + } + } // + } + + if(getSessionBean1().isMudarPassword()) + { + String password = (String) txtPassword.getText(); + if(password.matches(getSessionBean1().getCurrentUser().getPassword())) + { + getSessionBean1().setMsg("A nova password tem de ser diferente da password actual!"); + 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() == GESTOR || u.getTipo().intValue() == DIRECTOR_RH || u.getTipo().intValue() == DIRECTOR_SIPRP) + { + drpNome.setRendered(false); + txtNome.setStyleClass("show"); + lblCap.setRendered(false); + txtCap.setRendered(false); + lblCedula.setRendered(false); + stCedula.setRendered(false); + 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()); + + } + if(u.getEstabelecimento_id() != null) + { + drpEstabelecimentos.setSelected(u.getEstabelecimento_id()); + } + + txtLogin.setText(u.getLogin()); + //txtPassword.setText(u.getPassword()); + txtEmail.setText(u.getEmail()); + } + + private Utilizador fillUser() + { + //Utilizador u = new Utilizador(); + Utilizador u = getSessionBean1().getCurrentUser(); +// 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() ); + String password = (String) txtPassword.getText(); + u.setPassword( password ); + java.util.Date today = + new java.util.Date(); + java.sql.Date sqlToday = + new java.sql.Date(today.getTime()); + u.setData_password(sqlToday); + + + 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() ); +// } + +// u.setResponsavel_loja("n"); +// if(chkResponsavelLoja.getSelected() != null) +// { +// if(chkResponsavelLoja.getSelected().equals(new Boolean(true))) +// { +// u.setResponsavel_loja("y"); +// } +// } +// +// if(u.getGestor_geral() == null) +// { +// u.setGestor_geral("n"); +// } + + u.setPrimeiro_login("n"); + 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; + } + + private String navigate() + { + 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")) + { + return "analise_acidente"; + } + else if(nav_from.matches("ViewAnaliseAcidenteTrabalho")) + { + return "view_analise"; + } + else if(nav_from.matches("FormGestor")) + { + return "form_gestor"; + } + else if(nav_from.matches("FormDirGerRh")) + { + return "form_dir_ger_rh"; + } + else if(nav_from.matches("FormDirSiprp")) + { + return "form_dir_siprp"; + } + else if(nav_from.matches("GestaoUtilizadores")) + { + return "gestao_utilizadores"; + } + else if(nav_from.matches("NovoUtilizador")) + { + return "novo_utilizador"; + } + else if(nav_from.matches("Login")) // first login + { + int tipo = getSessionBean1().getCurrentUser().getTipo().intValue(); + switch(tipo) + { + case Global.TIPO_UTILIZADOR_SEGURANCA: + return "form_seguranca"; + case Global.TIPO_UTILIZADOR_RH: + return "form_rh"; + case Global.TIPO_UTILIZADOR_HS: + return "form_hs"; + case Global.TIPO_UTILIZADOR_MEDICO: + return "form_medico"; + case Global.TIPO_UTILIZADOR_GESTOR: + return "form_gestor"; + case Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH: + return "form_dir_ger_rh"; + case Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP: + return "form_dir_siprp"; + } + } + return null; + } + + public String lnkNewUser_action() { + // TODO: Replace with your code + + if(getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_GERAL_RH) + { + getSessionBean1().setNavFrom("FormDirGerRh"); + } + else if(getSessionBean1().getCurrentUser().getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP) + { + getSessionBean1().setNavFrom("FormDirSiprp"); + } + + + return "gestao_utilizadores"; + + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Footer.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Footer.java new file mode 100644 index 00000000..52f9e49d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Footer.java @@ -0,0 +1,152 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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; + } + //
+ + public Footer() { + } + + /** + *

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 + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java new file mode 100644 index 00000000..3b30f435 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormHS.java @@ -0,0 +1,1603 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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; + } + + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() { + return tableColumn12; + } + + public void setTableColumn12(TableColumn tc) { + this.tableColumn12 = tc; + } + + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() { + return tableColumn13; + } + + public void setTableColumn13(TableColumn tc) { + this.tableColumn13 = tc; + } + + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() { + return tableColumn14; + } + + public void setTableColumn14(TableColumn tc) { + this.tableColumn14 = tc; + } + + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() { + return tableColumn15; + } + + public void setTableColumn15(TableColumn tc) { + this.tableColumn15 = tc; + } + + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() { + return lnkPor; + } + + public void setLnkPor(Hyperlink h) { + this.lnkPor = h; + } + + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() { + return lnkPorSeg; + } + + public void setLnkPorSeg(Hyperlink h) { + this.lnkPorSeg = h; + } + + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() { + return lnkPorConcluida; + } + + public void setLnkPorConcluida(Hyperlink h) { + this.lnkPorConcluida = h; + } + + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida(Hyperlink h) { + this.lnkEstabConcluida = h; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private TextField txtPor = new TextField(); + + public TextField getTxtPor() { + return txtPor; + } + + public void setTxtPor(TextField tf) { + this.txtPor = tf; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + private Hyperlink lnkNewUser1 = new Hyperlink(); + + public Hyperlink getLnkNewUser1() { + return lnkNewUser1; + } + + public void setLnkNewUser1(Hyperlink h) { + this.lnkNewUser1 = h; + } + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private Hyperlink lnkAnalisesAcidente = new Hyperlink(); + + public Hyperlink getLnkAnalisesAcidente() { + return lnkAnalisesAcidente; + } + + public void setLnkAnalisesAcidente(Hyperlink h) { + this.lnkAnalisesAcidente = h; + } + + private StaticText staticText13 = new StaticText(); + + public StaticText getStaticText13() { + return staticText13; + } + + public void setStaticText13(StaticText st) { + this.staticText13 = st; + } + + //
+ + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FormHS Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + } + + /** + *

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.getAnalisesConcluidasHsList(); + 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).

+ */ + 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 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 + + try + { + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + } + catch(Exception ex){} + + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) {} + //return "login"; + return null; + } + + 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("FormHS"); + return "view_analise"; + } + + public String lnkNrSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormHS"); + return "view_analise"; + } + + public String lnkNomeAcidentadoSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormHS"); + 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 por = null; + if(txtPor.getText() != null) + { + por = (String) txtPor.getText(); + if(por.trim().length() == 0) + { + por = null; + } + } + + String nome = null; + if(txtNome.getText() != null) + { + nome = (String) txtNome.getText(); + if(nome.trim().length() == 0) + { + nome = null; + } + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, por, 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)); +// } + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList anosList = adp.getAnosListFromAnalises(); + 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) ); + + } + catch(Exception ex) + { + //ex.printStackTrace(); + } + + } + + + 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; diaPage 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 FormMedico extends AbstractPageBean { + // + private int __placeholder; + + /** + *

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 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; + } + + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() { + return tableColumn12; + } + + public void setTableColumn12(TableColumn tc) { + this.tableColumn12 = tc; + } + + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() { + return tableColumn13; + } + + public void setTableColumn13(TableColumn tc) { + this.tableColumn13 = tc; + } + + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() { + return tableColumn14; + } + + public void setTableColumn14(TableColumn tc) { + this.tableColumn14 = tc; + } + + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() { + return tableColumn15; + } + + public void setTableColumn15(TableColumn tc) { + this.tableColumn15 = tc; + } + + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() { + return lnkPor; + } + + public void setLnkPor(Hyperlink h) { + this.lnkPor = h; + } + + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() { + return lnkPorSeg; + } + + public void setLnkPorSeg(Hyperlink h) { + this.lnkPorSeg = h; + } + + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() { + return lnkPorConcluida; + } + + public void setLnkPorConcluida(Hyperlink h) { + this.lnkPorConcluida = h; + } + + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida(Hyperlink h) { + this.lnkEstabConcluida = h; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private TextField txtPor = new TextField(); + + public TextField getTxtPor() { + return txtPor; + } + + public void setTxtPor(TextField tf) { + this.txtPor = tf; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + //
+ + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FormMedico Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + } + + /** + *

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).

+ */ + 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"); + } + + 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 + + try + { + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + } + catch(Exception ex){} + + 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 por = null; + if(txtPor.getText() != null) + { + por = (String) txtPor.getText(); + if(por.trim().length() == 0) + { + por = null; + } + } + + String nome = null; + if(txtNome.getText() != null) + { + nome = (String) txtNome.getText(); + if(nome.trim().length() == 0) + { + nome = null; + } + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, por, 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)); +// } + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList anosList = adp.getAnosListFromAnalises(); + 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) ); + + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + } + + + 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"; + } + + public String lnkPor_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "analise_acidente"; + } + + public String lnkPorSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + public String lnkPorConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + + public String lnkEstabConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormMedico"); + return "view_analise"; + } + +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java new file mode 100644 index 00000000..0d2dfd5d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/FormRH.java @@ -0,0 +1,1628 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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 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; + } + + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() { + return tableColumn12; + } + + public void setTableColumn12(TableColumn tc) { + this.tableColumn12 = tc; + } + + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() { + return tableColumn13; + } + + public void setTableColumn13(TableColumn tc) { + this.tableColumn13 = tc; + } + + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() { + return tableColumn14; + } + + public void setTableColumn14(TableColumn tc) { + this.tableColumn14 = tc; + } + + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() { + return tableColumn15; + } + + public void setTableColumn15(TableColumn tc) { + this.tableColumn15 = tc; + } + + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() { + return lnkPor; + } + + public void setLnkPor(Hyperlink h) { + this.lnkPor = h; + } + + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() { + return lnkPorSeg; + } + + public void setLnkPorSeg(Hyperlink h) { + this.lnkPorSeg = h; + } + + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() { + return lnkPorConcluida; + } + + public void setLnkPorConcluida(Hyperlink h) { + this.lnkPorConcluida = h; + } + + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida(Hyperlink h) { + this.lnkEstabConcluida = h; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private TextField txtPor = new TextField(); + + public TextField getTxtPor() { + return txtPor; + } + + public void setTxtPor(TextField tf) { + this.txtPor = tf; + } + + private StaticText stSep1 = new StaticText(); + + public StaticText getStSep1() { + return stSep1; + } + + public void setStSep1(StaticText st) { + this.stSep1 = st; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText1 = new StaticText(); + + public StaticText getStaticText1() { + return staticText1; + } + + public void setStaticText1(StaticText st) { + this.staticText1 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private Hyperlink lnkNewUser1 = new Hyperlink(); + + public Hyperlink getLnkNewUser1() { + return lnkNewUser1; + } + + public void setLnkNewUser1(Hyperlink h) { + this.lnkNewUser1 = h; + } + + 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 Hyperlink lnkAnalisesAcidente = new Hyperlink(); + + public Hyperlink getLnkAnalisesAcidente() { + return lnkAnalisesAcidente; + } + + public void setLnkAnalisesAcidente(Hyperlink h) { + this.lnkAnalisesAcidente = 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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FormRH Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + + } + + /** + *

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() ); + + String responsavel_loja = getSessionBean1().getCurrentUser().getResponsavel_loja(); +// if(getSessionBean1().getCurrentUser().getTipo().intValue() == 7) // director rh +// { +// //////stSep.setText("|"); +// } +// else //rh +// { +// //////stSep.setText(" "); +// //////lnkNewUser.setRendered(false); +// stSep1.setRendered(false); +// } + + + 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(), responsavel_loja); + 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(), responsavel_loja); + 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).

+ */ + public void destroy() { + } + + /** + *

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 + + try + { + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + } + catch(Exception ex){} + + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) {} + //return "login"; + return null; + } + + 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("FormRh"); + return "view_analise"; + } + + public String lnkNrSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormRh"); + return "view_analise"; + } + + + public String lnkNomeAcidentadoSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormRh"); + 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 por = null; + if(txtPor.getText() != null) + { + por = (String) txtPor.getText(); + if(por.trim().length() == 0) + { + por = null; + } + } + + String nome = null; + if(txtNome.getText() != null) + { + nome = (String) txtNome.getText(); + if(nome.trim().length() == 0) + { + nome = null; + } + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, por, 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)); +// } + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList anosList = adp.getAnosListFromAnalises(); + 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) ); + + } + catch(Exception ex) + { + //ex.printStackTrace(); + } + + } + + + 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; diaPage 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 FormSeguranca extends AbstractPageBean { + // + private int __placeholder; + + /** + *

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 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; + } + + private TableColumn tableColumn12 = new TableColumn(); + + public TableColumn getTableColumn12() { + return tableColumn12; + } + + public void setTableColumn12(TableColumn tc) { + this.tableColumn12 = tc; + } + + private TableColumn tableColumn13 = new TableColumn(); + + public TableColumn getTableColumn13() { + return tableColumn13; + } + + public void setTableColumn13(TableColumn tc) { + this.tableColumn13 = tc; + } + + private TableColumn tableColumn14 = new TableColumn(); + + public TableColumn getTableColumn14() { + return tableColumn14; + } + + public void setTableColumn14(TableColumn tc) { + this.tableColumn14 = tc; + } + + private TableColumn tableColumn15 = new TableColumn(); + + public TableColumn getTableColumn15() { + return tableColumn15; + } + + public void setTableColumn15(TableColumn tc) { + this.tableColumn15 = tc; + } + + private Hyperlink lnkPor = new Hyperlink(); + + public Hyperlink getLnkPor() { + return lnkPor; + } + + public void setLnkPor(Hyperlink h) { + this.lnkPor = h; + } + + private Hyperlink lnkPorSeg = new Hyperlink(); + + public Hyperlink getLnkPorSeg() { + return lnkPorSeg; + } + + public void setLnkPorSeg(Hyperlink h) { + this.lnkPorSeg = h; + } + + private Hyperlink lnkPorConcluida = new Hyperlink(); + + public Hyperlink getLnkPorConcluida() { + return lnkPorConcluida; + } + + public void setLnkPorConcluida(Hyperlink h) { + this.lnkPorConcluida = h; + } + + private Hyperlink lnkEstabConcluida = new Hyperlink(); + + public Hyperlink getLnkEstabConcluida() { + return lnkEstabConcluida; + } + + public void setLnkEstabConcluida(Hyperlink h) { + this.lnkEstabConcluida = h; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText staticText5 = new StaticText(); + + public StaticText getStaticText5() { + return staticText5; + } + + public void setStaticText5(StaticText st) { + this.staticText5 = st; + } + + private TextField txtPor = new TextField(); + + public TextField getTxtPor() { + return txtPor; + } + + public void setTxtPor(TextField tf) { + this.txtPor = tf; + } + + private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel9() { + return gridPanel9; + } + + public void setGridPanel9(HtmlPanelGrid hpg) { + this.gridPanel9 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + 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 Hyperlink lnkNewUser1 = new Hyperlink(); + + public Hyperlink getLnkNewUser1() { + return lnkNewUser1; + } + + public void setLnkNewUser1(Hyperlink h) { + this.lnkNewUser1 = h; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private Hyperlink lnkAnalisesAcidente = new Hyperlink(); + + public Hyperlink getLnkAnalisesAcidente() { + return lnkAnalisesAcidente; + } + + public void setLnkAnalisesAcidente(Hyperlink h) { + this.lnkAnalisesAcidente = 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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("FormSeguranca Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + } + + /** + *

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() ); + String responsavel_loja = getSessionBean1().getCurrentUser().getResponsavel_loja(); + 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(), responsavel_loja ); + 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(), responsavel_loja); + 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).

+ */ + public void destroy() { + } + + +// private void fillDateDropDowns() +// { +// fillAnoDropDown(); +// //fillMesDropDown(); +// //fillDiaDropDown(); +// } + + private void fillAnoDropDown() + { +// ArrayList anosList = new ArrayList(); +// for(int ano=2007; ano<2051; ano++) +// { +// anosList.add(new Integer(ano)); +// } + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + ArrayList anosList = adp.getAnosListFromAnalises(); + 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) ); + + } + catch(Exception ex) + { + //ex.printStackTrace(); + } + + } + + 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; diaReturn 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 + // Invalidate the current session + try + { + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + } + catch(Exception ex){} + + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) {} + //return "login"; + return null; + } + + 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 por = null; + if(txtPor.getText() != null) + { + por = (String) txtPor.getText(); + if(por.trim().length() == 0) + { + por = null; + } + } + + + String nome = null; + if(txtNome.getText() != null) + { + nome = (String) txtNome.getText(); + if(nome.trim().length() == 0) + { + nome = null; + } + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + + //getSessionBean1().getAnalisesConcluidasDataProvider().setList(new ArrayList()); + ArrayList concluidasList = adp.searchAanalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id(), ano, mes, dia, por, 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"; + } + + public String lnkPor_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableActivosRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "analise_acidente"; } + + public String lnkPorSeg_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableSeguimentoRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } + + public String lnkPorConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } + + public String lnkEstabConcluida_action() { + // TODO: Replace with your code + + AnaliseAcidente a = getTableConcluidasRowData(); + getSessionBean1().setCurrentAnalise(a); + getSessionBean1().setNavFrom("FormSeguranca"); + return "view_analise"; + } + + public String lnkNewUser_action() { + // TODO: Replace with your code + + return null; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Header.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Header.java new file mode 100644 index 00000000..7bcdb7dc --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Header.java @@ -0,0 +1,120 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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; + } + //
+ + public Header() { + } + + /** + *

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 + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/LoadImage.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/LoadImage.java new file mode 100644 index 00000000..0c6e4108 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/LoadImage.java @@ -0,0 +1,467 @@ +/* + * 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.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 global.Global; +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 { + // + private int __placeholder; + + /** + *

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; + } + + //
+ /** + *

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 StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private Button butUpload = new Button(); + + public Button getButUpload() { + return butUpload; + } + + public void setButUpload(Button b) { + this.butUpload = b; + } + + private Button butCancelar = new Button(); + + public Button getButCancelar() { + return butCancelar; + } + + public void setButCancelar(Button b) { + this.butCancelar = b; + } + 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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("LoadImage Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + } + } + else + { + + getSessionBean1().setImageName(null); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + //this.realImageFilePath = theApplicationsServletContext.getRealPath(IMAGE_URL); + //this.realImageFilePath = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER); + try + { + realImageFilePath = Global.IMAGE_FOLDER + "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + File f = new File(realImageFilePath); + f.mkdir(); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + } + + + + } + + /** + *

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).

+ */ + 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 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 butCancelar_action() { + getSessionBean1().setImageName(null); + return "analise_acidente"; + } + + 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. + + //realImageFilePath += "/tmp" + getSessionBean1().getCurrentUser().getLogin(); + System.out.println("REAL IMAGE FILE PATH : " + realImageFilePath); + File fdir = new File(realImageFilePath); + System.out.println("FDIR : " + fdir); + + + UploadedFile uploadedFile = fileUpload1.getUploadedFile(); + if(uploadedFile != null) + { + + 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('.')); + int firstImageNr = getFirstImageNr().intValue(); + File files[] = fdir.listFiles(); + // realImageFilePath += "/" + justFileName; + System.out.println("FILES : " + files); + + justFileName = new Integer(firstImageNr + files.length + 1).toString(); + //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("Tem de seleccionar um ficheiro do tipo JPEG, PJPEG, GIF, PNG, ou X-PNG !"); + new File(this.realImageFilePath).delete(); + return null; + } + } + else + { + getSessionBean1().setImageName(null); + } + + return "analise_acidente"; + } + + private Integer getFirstImageNr() + { + if(getSessionBean1().getCurrentAnalise() == null) + { + return new Integer(0); + } + else + { + String folderName = getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(0,2) + getSessionBean1().getCurrentAnalise().getAnalise_nr().substring(3); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + File fdir = new File(imageFileFolder); + int nr = 0; + if(fdir.exists()) + { + File files[] = fdir.listFiles(); + for(int i=0; i < files.length; i++) + { + String nr_str = files[i].getName(); + int i_nr = Integer.parseInt(nr_str); + if(i_nr > nr) + { + nr = i_nr; + } + } + return new Integer(nr); + } + + return new Integer(0); + } + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java new file mode 100644 index 00000000..8964d9bc --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Login.java @@ -0,0 +1,626 @@ +/* + * 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 java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; +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 { + // + private int __placeholder; + + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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).

+ */ + public void destroy() { + } + + /** + *

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 ! +// if(u.getPrimeiro_login().matches("y") || mustChangePassword(u)) + if(u.getPrimeiro_login().matches("y") ) + { + getSessionBean1().setMudarPassword(true); + getSessionBean1().setCurrentUser( u ); + getSessionBean1().setNavFrom("Login"); + getSessionBean1().setModoEdicaoUtilizador("edit"); + getSessionBean1().setLoggedIn(true); + initializeClock(); + initializeDropDownOptions(); + return "user"; + } + 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 + { + sRet = "form_hs"; + } + else if(permissao.intValue() == 5) // medico + { + sRet = "form_medico"; + } + else if(permissao.intValue() == 6) // gestor + { + sRet = "form_gestor"; + } + else if(permissao.intValue() == 7) // director geral rh + { + //sRet = "form_rh"; + sRet = "form_dir_ger_rh"; + } + else if(permissao.intValue() == 8) // director siprp + { + sRet = "form_dir_siprp"; + } + 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[25]; + horasOptions[0] = new Option(new Integer(-1), "-"); + int j = 0; + String str_j = ""; + for(int i=1; i < 25; i++) + { + if(j < 10) + { + str_j = "0" + new Integer(j).toString(); + } + else + { + str_j = new Integer(j).toString(); + } + horasOptions[i] = new Option(new Integer(j), str_j); + j++; + } + getSessionBean1().setHorasOptions(horasOptions); + + com.sun.rave.web.ui.model.Option[] minutosOptions = new com.sun.rave.web.ui.model.Option[13]; + minutosOptions[0] = new Option(new Integer(-1), "-"); + j = 0; + for(int i=1; i < 13; i++) + { + if(j < 10) + { + str_j = "0" + new Integer(j).toString(); + } + else + { + str_j = new Integer(j).toString(); + } + minutosOptions[i] = new Option(new Integer(j), str_j); + 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(); +// } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + getSessionBean1().setCausasOptions(adp.getCausasList()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + try + { + getSessionBean1().setDepartamentoOptions(adp.getDepartamentosList()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + } + + private boolean mustChangePassword(Utilizador u) + { + java.util.Date now = new java.util.Date(); + Calendar cal = new GregorianCalendar(); + cal.setTime(now); + int ano = cal.get(Calendar.YEAR); + int mes = cal.get(Calendar.MONTH); + int dia = cal.get(Calendar.DAY_OF_MONTH); + + Calendar today = new GregorianCalendar(ano, mes, dia); + Calendar firstJan = new GregorianCalendar(ano, Calendar.JANUARY, 1); +// Calendar firstJan = new GregorianCalendar(ano, Calendar.DECEMBER, 27); + Calendar firstJul = new GregorianCalendar(ano, Calendar.JULY, 1); + + if(today.compareTo(firstJan) == 0 || today.compareTo(firstJul) == 0) + { + return true; + } + + if(u.getData_password() == null) + { + return true; + } + else + { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + try + { + java.util.Date dt_password = sdf.parse(u.getData_password().toString()); + Calendar cal_dt_password = new GregorianCalendar(); + cal_dt_password.setTime(dt_password); + cal_dt_password.add(GregorianCalendar.MONTH, 6); + if(cal.compareTo(cal_dt_password) > 0) + { + return true; + } + else + { + return false; + } + + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + } + return false; + } +} + diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java new file mode 100644 index 00000000..257089e6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medico.java @@ -0,0 +1,53 @@ +/* + * 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java new file mode 100644 index 00000000..5fe9c763 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Medida.java @@ -0,0 +1,49 @@ +/* + * 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java new file mode 100644 index 00000000..31b0be5b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Permissao.java @@ -0,0 +1,49 @@ +/* + * 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java new file mode 100644 index 00000000..85aea13e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Recomendacao.java @@ -0,0 +1,49 @@ +/* + * 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java new file mode 100644 index 00000000..deb5b682 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RecuperarPassword.java @@ -0,0 +1,525 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("RecuperarPassword Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here +// if (!getSessionBean1().isLoggedIn()) { +// try { +// getExternalContext().redirect("Login.jsp"); +// } catch(Exception e) { +// // . . . handle exception . . . +// } +// } + } + + /** + *

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).

+ */ + 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"); + } + + 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+="

Envio da password de " + login + " :

"; + 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RequestBean1.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RequestBean1.java new file mode 100644 index 00000000..66ece1e4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/RequestBean1.java @@ -0,0 +1,100 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("RequestBean1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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.

+ */ + public void destroy() { + } + + /** + *

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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java new file mode 100644 index 00000000..64bdcbec --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/SessionBean1.java @@ -0,0 +1,645 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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(); + setEstadosCorrecaoDataProvider(new db.EstadosCorrecaoDataProvider()); + utilizadoresActivosListDataProvider = new db.UtilizadoresActivosListDataProvider(); + utilizadoresInactivosListDataProvider = new db.UtilizadoresInactivosListDataProvider(); + + setNavFrom(""); + setAcidentado(null); + setCurrentAnalise(null); + setLoggedIn(false); + + modoEdicaoUtilizador = ""; + setIdSequence(1); + setNewUser(null); + setEditUser(null); + setUserDeleted(false); + setMudarPassword(false); + } + + /** + *

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 + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("SessionBean1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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.

+ */ + public void destroy() { + } + + /** + *

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; + private db.EstadosCorrecaoDataProvider estadosCorrecaoDataProvider; + private db.UtilizadoresActivosListDataProvider utilizadoresActivosListDataProvider; + private db.UtilizadoresInactivosListDataProvider utilizadoresInactivosListDataProvider; + + 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; + } + + public db.EstadosCorrecaoDataProvider getEstadosCorrecaoDataProvider() { + return estadosCorrecaoDataProvider; + } + + public void setEstadosCorrecaoDataProvider(db.EstadosCorrecaoDataProvider estadosCorrecaoDataProvider) { + this.estadosCorrecaoDataProvider = estadosCorrecaoDataProvider; + } + + public db.UtilizadoresActivosListDataProvider getUtilizadoresActivosListDataProvider() { + return utilizadoresActivosListDataProvider; + } + + public void setUtilizadoresActivosListDataProvider(db.UtilizadoresActivosListDataProvider utilizadoresActivosListDataProvider) { + this.utilizadoresActivosListDataProvider = utilizadoresActivosListDataProvider; + } + + public db.UtilizadoresInactivosListDataProvider getUtilizadoresInactivosListDataProvider() { + return utilizadoresInactivosListDataProvider; + } + + public void setUtilizadoresInactivosListDataProvider(db.UtilizadoresInactivosListDataProvider utilizadoresInactivosListDataProvider) { + this.utilizadoresInactivosListDataProvider = utilizadoresInactivosListDataProvider; + } + + 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 com.sun.rave.web.ui.model.Option[] departamentoOptions; + + private Integer departamentoChoice; + + public Integer getDepartamentoChoice() { + return departamentoChoice; + } + + public void setDepartamentoChoice(Integer departamentoChoice) { + this.departamentoChoice = departamentoChoice; + } + + public com.sun.rave.web.ui.model.Option[] getDepartamentoOptions() { + return departamentoOptions; + } + + public void setDepartamentoOptions(com.sun.rave.web.ui.model.Option[] departamentoOptions) { + this.departamentoOptions = departamentoOptions; + } + + private com.sun.rave.web.ui.model.Option[] seccaoOptions; + + private Integer seccaoChoice; + + public Integer getSeccaoChoice() { + return seccaoChoice; + } + + public void setSeccaoChoice(Integer seccaoChoice) { + this.seccaoChoice = seccaoChoice; + } + + public com.sun.rave.web.ui.model.Option[] getSeccaoOptions() { + return seccaoOptions; + } + + public void setSeccaoOptions(com.sun.rave.web.ui.model.Option[] seccaoOptions) { + this.seccaoOptions = seccaoOptions; + } + + 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 estabelecimentoOutroChoice; + + public Integer getEstabelecimentoOutroChoice() { + return estabelecimentoOutroChoice; + } + + public void setEstabelecimentoOutroChoice(Integer estabelecimentoOutroChoice) { + this.estabelecimentoOutroChoice = estabelecimentoOutroChoice; + } + + private com.sun.rave.web.ui.model.Option[] estabelecimentosOutroOptions; + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosOutroOptions() { + return estabelecimentosOutroOptions; + } + + public void setEstabelecimentosOutroOptions(com.sun.rave.web.ui.model.Option[] estabelecimentosOutroOptions) { + this.estabelecimentosOutroOptions = estabelecimentosOutroOptions; + } + + + private Integer estabelecimentoMedChoice; + + public Integer getEstabelecimentoMedChoice() { + return estabelecimentoMedChoice; + } + + public void setEstabelecimentoMedChoice(Integer estabelecimentoMedChoice) { + this.estabelecimentoMedChoice = estabelecimentoMedChoice; + } + + private com.sun.rave.web.ui.model.Option[] estabelecimentosMedOptions; + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosMedOptions() { + return estabelecimentosMedOptions; + } + + public void setEstabelecimentosMedOptions(com.sun.rave.web.ui.model.Option[] estabelecimentosMedOptions) { + this.estabelecimentosMedOptions = estabelecimentosMedOptions; + } + + 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 Integer causaChoice; + + public Integer getCausaChoice() { + return causaChoice; + } + + public void setCausaChoice(Integer causaChoice) { + this.causaChoice = causaChoice; + } + + private com.sun.rave.web.ui.model.Option[] causasOptions; + + public com.sun.rave.web.ui.model.Option[] getCausasOptions() { + return causasOptions; + } + + public void setCausasOptions(com.sun.rave.web.ui.model.Option[] causasOptions) { + this.causasOptions = causasOptions; + } + + private int idSequence; + + public int getIdSequence() { + return idSequence; + } + + public void setIdSequence(int idSequence) { + this.idSequence = idSequence; + } + + private NewUser newUser; + + public NewUser getNewUser() { + return newUser; + } + + public void setNewUser(NewUser newUser) { + this.newUser = newUser; + } + + private Utilizador editUser; + + public Utilizador getEditUser() { + return editUser; + } + + public void setEditUser(Utilizador editUser) { + this.editUser = editUser; + } + + private boolean userDeleted; + + public boolean isUserDeleted() { + return userDeleted; + } + + public void setUserDeleted(boolean userDeleted) { + this.userDeleted = userDeleted; + } + + private boolean mudarPassword; + + public boolean isMudarPassword() { + return mudarPassword; + } + + public void setMudarPassword(boolean mudarPassword) { + this.mudarPassword = mudarPassword; + } + + private Medico medico; + + public Medico getMedico() { + return medico; + } + + public void setMedico(Medico medico) { + this.medico = medico; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java new file mode 100644 index 00000000..7980ae83 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TecnicoSaude.java @@ -0,0 +1,44 @@ +/* + * 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java new file mode 100644 index 00000000..749160c9 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/TipoUtilizador.java @@ -0,0 +1,67 @@ +/* + * 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Top.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Top.java new file mode 100644 index 00000000..d183ddf6 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Top.java @@ -0,0 +1,203 @@ +/* + * 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 { + // + private int __placeholder; + + /** + *

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; + } + //
+ + public Top() { + } + + /** + *

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 + + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("Page1 Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization 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/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java new file mode 100644 index 00000000..446c026e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Trabalhador.java @@ -0,0 +1,95 @@ +/* + * 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; + private Integer estabelecimento_id; + private String estabelecimento; + + + /** 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; + } + + public String getEstabelecimento() { + return estabelecimento; + } + + public void setEstabelecimento(String estabelecimento) { + this.estabelecimento = estabelecimento; + } + + public Integer getEstabelecimento_id() { + return estabelecimento_id; + } + + public void setEstabelecimento_id(Integer estabelecimento_id) { + this.estabelecimento_id = estabelecimento_id; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java new file mode 100644 index 00000000..6e375480 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/Utilizador.java @@ -0,0 +1,249 @@ +/* + * 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; + +import java.sql.Date; + +/** + * + * @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; + + private Integer acesso; + private String responsavel_loja; + private String gestor_geral; + + private String numero_mecanografico; + private String categoria; //descricao do 'tipo'' + private String nome_estabelecimento; + + private String primeiro_login; + + private String apagado; + + private Date data_password; + + /** 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; + } + + public Integer getAcesso() { + return acesso; + } + + public void setAcesso(Integer acesso) { + this.acesso = acesso; + } + + public String getResponsavel_loja() { + return responsavel_loja; + } + + public void setResponsavel_loja(String responsavel_loja) { + this.responsavel_loja = responsavel_loja; + } + + public String getNumero_mecanografico() { + return numero_mecanografico; + } + + public void setNumero_mecanografico(String numero_mecanografico) { + this.numero_mecanografico = numero_mecanografico; + } + + public String getCategoria() { + return categoria; + } + + public void setCategoria(String categoria) { + this.categoria = categoria; + } + + public String getNome_estabelecimento() { + return nome_estabelecimento; + } + + public void setNome_estabelecimento(String nome_estabelecimento) { + this.nome_estabelecimento = nome_estabelecimento; + } + + public String getGestor_geral() { + return gestor_geral; + } + + public void setGestor_geral(String gestor_geral) { + this.gestor_geral = gestor_geral; + } + + public String getPrimeiro_login() { + return primeiro_login; + } + + public void setPrimeiro_login(String primeiro_login) { + this.primeiro_login = primeiro_login; + } + + public String getApagado() { + return apagado; + } + + public void setApagado(String apagado) { + this.apagado = apagado; + } + + public Date getData_password() { + return data_password; + } + + public void setData_password(Date data_password) { + this.data_password = data_password; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java new file mode 100644 index 00000000..92ebac19 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/analiseacidentestrabalho/ViewAnaliseAcidenteTrabalho.java @@ -0,0 +1,4440 @@ +/* + * 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 global.Global; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +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 { + // + private int __placeholder; + + /** + *

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 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 gridDadosAcidenteSegView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteSegView() { + return gridDadosAcidenteSegView; + } + + public void setGridDadosAcidenteSegView(HtmlPanelGrid hpg) { + this.gridDadosAcidenteSegView = 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 gridTurnoSeccaoLocal = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTurnoSeccaoLocal() { + return gridTurnoSeccaoLocal; + } + + public void setGridTurnoSeccaoLocal(HtmlPanelGrid hpg) { + this.gridTurnoSeccaoLocal = hpg; + } + + private HtmlPanelGrid gridTarefa = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTarefa() { + return gridTarefa; + } + + public void setGridTarefa(HtmlPanelGrid hpg) { + this.gridTarefa = hpg; + } + + private StaticText lblTarefa = new StaticText(); + + public StaticText getLblTarefa() { + return lblTarefa; + } + + public void setLblTarefa(StaticText st) { + this.lblTarefa = st; + } + + private HtmlPanelGrid gridSubstancias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSubstancias() { + return gridSubstancias; + } + + public void setGridSubstancias(HtmlPanelGrid hpg) { + this.gridSubstancias = hpg; + } + + private StaticText lblSubstancias = new StaticText(); + + public StaticText getLblSubstancias() { + return lblSubstancias; + } + + public void setLblSubstancias(StaticText st) { + this.lblSubstancias = st; + } + + private HtmlPanelGrid gridCondicoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCondicoes() { + return gridCondicoes; + } + + public void setGridCondicoes(HtmlPanelGrid hpg) { + this.gridCondicoes = hpg; + } + + private StaticText lblCondicoes = new StaticText(); + + public StaticText getLblCondicoes() { + return lblCondicoes; + } + + public void setLblCondicoes(StaticText st) { + this.lblCondicoes = st; + } + + private HtmlPanelGrid gridTestemunhas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridTestemunhas() { + return gridTestemunhas; + } + + public void setGridTestemunhas(HtmlPanelGrid hpg) { + this.gridTestemunhas = hpg; + } + + private StaticText lblTestemunhas = new StaticText(); + + public StaticText getLblTestemunhas() { + return lblTestemunhas; + } + + public void setLblTestemunhas(StaticText st) { + this.lblTestemunhas = st; + } + + private HtmlPanelGrid gridCausas = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridCausas() { + return gridCausas; + } + + public void setGridCausas(HtmlPanelGrid hpg) { + this.gridCausas = hpg; + } + + private StaticText lblCausas = new StaticText(); + + public StaticText getLblCausas() { + return lblCausas; + } + + public void setLblCausas(StaticText st) { + this.lblCausas = st; + } + + private HtmlPanelGrid gridDescricao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDescricao() { + return gridDescricao; + } + + public void setGridDescricao(HtmlPanelGrid hpg) { + this.gridDescricao = hpg; + } + + private StaticText lblDescricao = new StaticText(); + + public StaticText getLblDescricao() { + return lblDescricao; + } + + public void setLblDescricao(StaticText st) { + this.lblDescricao = st; + } + + private HtmlPanelGrid gridFotografias = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridFotografias() { + return gridFotografias; + } + + public void setGridFotografias(HtmlPanelGrid hpg) { + this.gridFotografias = hpg; + } + + private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel19() { + return gridPanel19; + } + + public void setGridPanel19(HtmlPanelGrid hpg) { + this.gridPanel19 = hpg; + } + + private StaticText lblFotografias = new StaticText(); + + public StaticText getLblFotografias() { + return lblFotografias; + } + + public void setLblFotografias(StaticText st) { + this.lblFotografias = st; + } + + private HtmlPanelGrid gridImages = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImages() { + return gridImages; + } + + public void setGridImages(HtmlPanelGrid hpg) { + this.gridImages = hpg; + } + + private HtmlPanelGrid gridConclusoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridConclusoes() { + return gridConclusoes; + } + + public void setGridConclusoes(HtmlPanelGrid hpg) { + this.gridConclusoes = hpg; + } + + private StaticText lblConclusoes = new StaticText(); + + public StaticText getLblConclusoes() { + return lblConclusoes; + } + + public void setLblConclusoes(StaticText st) { + this.lblConclusoes = st; + } + + private HtmlPanelGrid gridAccoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAccoes() { + return gridAccoes; + } + + public void setGridAccoes(HtmlPanelGrid hpg) { + this.gridAccoes = hpg; + } + + private StaticText lblAccoes = new StaticText(); + + public StaticText getLblAccoes() { + return lblAccoes; + } + + public void setLblAccoes(StaticText st) { + this.lblAccoes = 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 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 String IMAGE_URL = "/resources/images"; + + private final static int IMAGE_WIDTH = 48; + private final static int IMAGE_HEIGHT = 48; + + + private HtmlPanelGrid gridDadosAcidenteRhView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDadosAcidenteRhView() { + return gridDadosAcidenteRhView; + } + + public void setGridDadosAcidenteRhView(HtmlPanelGrid hpg) { + this.gridDadosAcidenteRhView = 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 HtmlPanelGrid gridSHST = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSHST() { + return gridSHST; + } + + public void setGridSHST(HtmlPanelGrid hpg) { + this.gridSHST = hpg; + } + + private HtmlPanelGrid gridColaborador = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaborador() { + return gridColaborador; + } + + public void setGridColaborador(HtmlPanelGrid hpg) { + this.gridColaborador = hpg; + } + + private HtmlPanelGrid gridColaboradores = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridColaboradores() { + return gridColaboradores; + } + + public void setGridColaboradores(HtmlPanelGrid hpg) { + this.gridColaboradores = hpg; + } + + private HtmlPanelGrid gridRecomendacoesViewHS = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesViewHS() { + return gridRecomendacoesViewHS; + } + + public void setGridRecomendacoesViewHS(HtmlPanelGrid hpg) { + this.gridRecomendacoesViewHS = hpg; + } + + private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel23() { + return gridPanel23; + } + + public void setGridPanel23(HtmlPanelGrid hpg) { + this.gridPanel23 = hpg; + } + + private StaticText staticText29 = new StaticText(); + + public StaticText getStaticText29() { + return staticText29; + } + + public void setStaticText29(StaticText st) { + this.staticText29 = st; + } + + private HtmlPanelGrid gridRecomendacoesView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRecomendacoesView() { + return gridRecomendacoesView; + } + + public void setGridRecomendacoesView(HtmlPanelGrid hpg) { + this.gridRecomendacoesView = hpg; + } + + private HtmlPanelGrid gridMedidasViewRH = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasViewRH() { + return gridMedidasViewRH; + } + + public void setGridMedidasViewRH(HtmlPanelGrid hpg) { + this.gridMedidasViewRH = hpg; + } + + private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel24() { + return gridPanel24; + } + + public void setGridPanel24(HtmlPanelGrid hpg) { + this.gridPanel24 = hpg; + } + + private StaticText staticText30 = new StaticText(); + + public StaticText getStaticText30() { + return staticText30; + } + + public void setStaticText30(StaticText st) { + this.staticText30 = st; + } + + private HtmlPanelGrid gridMedidasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedidasView() { + return gridMedidasView; + } + + public void setGridMedidasView(HtmlPanelGrid hpg) { + this.gridMedidasView = hpg; + } + + private HtmlPanelGrid gridMedicoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridMedicoView() { + return gridMedicoView; + } + + public void setGridMedicoView(HtmlPanelGrid hpg) { + this.gridMedicoView = hpg; + } + + private HtmlPanelGrid gridPanel25 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel25() { + return gridPanel25; + } + + public void setGridPanel25(HtmlPanelGrid hpg) { + this.gridPanel25 = hpg; + } + + private StaticText staticText31 = new StaticText(); + + public StaticText getStaticText31() { + return staticText31; + } + + public void setStaticText31(StaticText st) { + this.staticText31 = st; + } + + private HtmlPanelGrid gridLesao = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridLesao() { + return gridLesao; + } + + public void setGridLesao(HtmlPanelGrid hpg) { + this.gridLesao = hpg; + } + + private StaticText lblAreasCorporais = new StaticText(); + + public StaticText getLblAreasCorporais() { + return lblAreasCorporais; + } + + public void setLblAreasCorporais(StaticText st) { + this.lblAreasCorporais = st; + } + + private HtmlPanelGrid gridPanel26 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel26() { + return gridPanel26; + } + + public void setGridPanel26(HtmlPanelGrid hpg) { + this.gridPanel26 = hpg; + } + + private StaticText staticText33 = new StaticText(); + + public StaticText getStaticText33() { + return staticText33; + } + + public void setStaticText33(StaticText st) { + this.staticText33 = st; + } + + private HtmlPanelGrid gridIncapacidade = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridIncapacidade() { + return gridIncapacidade; + } + + public void setGridIncapacidade(HtmlPanelGrid hpg) { + this.gridIncapacidade = hpg; + } + + private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel27() { + return gridPanel27; + } + + public void setGridPanel27(HtmlPanelGrid hpg) { + this.gridPanel27 = hpg; + } + + private StaticText staticText34 = new StaticText(); + + public StaticText getStaticText34() { + return staticText34; + } + + public void setStaticText34(StaticText st) { + this.staticText34 = st; + } + + private HtmlPanelGrid gridRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridRestricoes() { + return gridRestricoes; + } + + public void setGridRestricoes(HtmlPanelGrid hpg) { + this.gridRestricoes = hpg; + } + + private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel28() { + return gridPanel28; + } + + public void setGridPanel28(HtmlPanelGrid hpg) { + this.gridPanel28 = hpg; + } + + private HtmlPanelGrid gridImagesRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImagesRestricoes() { + return gridImagesRestricoes; + } + + public void setGridImagesRestricoes(HtmlPanelGrid hpg) { + this.gridImagesRestricoes = hpg; + } + + private HtmlPanelGrid gridOutrasRestricoes = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridOutrasRestricoes() { + return gridOutrasRestricoes; + } + + public void setGridOutrasRestricoes(HtmlPanelGrid hpg) { + this.gridOutrasRestricoes = hpg; + } + + private StaticText staticText35 = new StaticText(); + + public StaticText getStaticText35() { + return staticText35; + } + + public void setStaticText35(StaticText st) { + this.staticText35 = st; + } + + private HtmlPanelGrid gridPanel29 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel29() { + return gridPanel29; + } + + public void setGridPanel29(HtmlPanelGrid hpg) { + this.gridPanel29 = hpg; + } + + private StaticText staticText36 = new StaticText(); + + public StaticText getStaticText36() { + return staticText36; + } + + public void setStaticText36(StaticText st) { + this.staticText36 = st; + } + + private StaticText stObservacoes = new StaticText(); + + public StaticText getStObservacoes() { + return stObservacoes; + } + + public void setStObservacoes(StaticText st) { + this.stObservacoes = st; + } + + private HtmlPanelGrid gridAcidentadoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAcidentadoView() { + return gridAcidentadoView; + } + + public void setGridAcidentadoView(HtmlPanelGrid hpg) { + this.gridAcidentadoView = hpg; + } + + private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel30() { + return gridPanel30; + } + + public void setGridPanel30(HtmlPanelGrid hpg) { + this.gridPanel30 = hpg; + } + + private StaticText staticText37 = new StaticText(); + + public StaticText getStaticText37() { + return staticText37; + } + + public void setStaticText37(StaticText st) { + this.staticText37 = st; + } + + private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel31() { + return gridPanel31; + } + + public void setGridPanel31(HtmlPanelGrid hpg) { + this.gridPanel31 = hpg; + } + + private HtmlPanelGrid gridDataHora = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridDataHora() { + return gridDataHora; + } + + public void setGridDataHora(HtmlPanelGrid hpg) { + this.gridDataHora = hpg; + } + + private PanelGroup groupPanel6 = new PanelGroup(); + + public PanelGroup getGroupPanel6() { + return groupPanel6; + } + + public void setGroupPanel6(PanelGroup pg) { + this.groupPanel6 = pg; + } + + private StaticText lblDataAcidente = new StaticText(); + + public StaticText getLblDataAcidente() { + return lblDataAcidente; + } + + public void setLblDataAcidente(StaticText st) { + this.lblDataAcidente = st; + } + + private StaticText stDataAcidente1 = new StaticText(); + + public StaticText getStDataAcidente1() { + return stDataAcidente1; + } + + public void setStDataAcidente1(StaticText st) { + this.stDataAcidente1 = st; + } + + private PanelGroup groupPanel7 = new PanelGroup(); + + public PanelGroup getGroupPanel7() { + return groupPanel7; + } + + public void setGroupPanel7(PanelGroup pg) { + this.groupPanel7 = pg; + } + + private StaticText lblHoraAcidente = new StaticText(); + + public StaticText getLblHoraAcidente() { + return lblHoraAcidente; + } + + public void setLblHoraAcidente(StaticText st) { + this.lblHoraAcidente = st; + } + + private StaticText stHoraAcidente1 = new StaticText(); + + public StaticText getStHoraAcidente1() { + return stHoraAcidente1; + } + + public void setStHoraAcidente1(StaticText st) { + this.stHoraAcidente1 = st; + } + + private HtmlPanelGrid gridVerificacaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridVerificacaoView() { + return gridVerificacaoView; + } + + public void setGridVerificacaoView(HtmlPanelGrid hpg) { + this.gridVerificacaoView = hpg; + } + + private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel34() { + return gridPanel34; + } + + public void setGridPanel34(HtmlPanelGrid hpg) { + this.gridPanel34 = hpg; + } + + private StaticText staticText15 = new StaticText(); + + public StaticText getStaticText15() { + return staticText15; + } + + public void setStaticText15(StaticText st) { + this.staticText15 = st; + } + + private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel35() { + return gridPanel35; + } + + public void setGridPanel35(HtmlPanelGrid hpg) { + this.gridPanel35 = hpg; + } + + private HtmlPanelGrid gridAssinaturasView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssinaturasView() { + return gridAssinaturasView; + } + + public void setGridAssinaturasView(HtmlPanelGrid hpg) { + this.gridAssinaturasView = hpg; + } + + private HtmlPanelGrid gridImpressaoView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridImpressaoView() { + return gridImpressaoView; + } + + public void setGridImpressaoView(HtmlPanelGrid hpg) { + this.gridImpressaoView = hpg; + } + + private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel10() { + return gridPanel10; + } + + public void setGridPanel10(HtmlPanelGrid hpg) { + this.gridPanel10 = hpg; + } + + private StaticText staticText3 = new StaticText(); + + public StaticText getStaticText3() { + return staticText3; + } + + public void setStaticText3(StaticText st) { + this.staticText3 = st; + } + + private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel11() { + return gridPanel11; + } + + public void setGridPanel11(HtmlPanelGrid hpg) { + this.gridPanel11 = hpg; + } + + private HtmlPanelGrid gridAssSupView = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAssSupView() { + return gridAssSupView; + } + + public void setGridAssSupView(HtmlPanelGrid hpg) { + this.gridAssSupView = hpg; + } + + private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel12() { + return gridPanel12; + } + + public void setGridPanel12(HtmlPanelGrid hpg) { + this.gridPanel12 = hpg; + } + + private PanelGroup groupPanel5 = new PanelGroup(); + + public PanelGroup getGroupPanel5() { + return groupPanel5; + } + + public void setGroupPanel5(PanelGroup pg) { + this.groupPanel5 = pg; + } + + private Button butVoltar = new Button(); + + public Button getButVoltar() { + return butVoltar; + } + + public void setButVoltar(Button b) { + this.butVoltar = b; + } + + private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel13() { + return gridPanel13; + } + + public void setGridPanel13(HtmlPanelGrid hpg) { + this.gridPanel13 = hpg; + } + + private PanelGroup groupPanel8 = new PanelGroup(); + + public PanelGroup getGroupPanel8() { + return groupPanel8; + } + + public void setGroupPanel8(PanelGroup pg) { + this.groupPanel8 = pg; + } + + private StaticText staticText14 = new StaticText(); + + public StaticText getStaticText14() { + return staticText14; + } + + public void setStaticText14(StaticText st) { + this.staticText14 = st; + } + + private StaticText stAveriguador = new StaticText(); + + public StaticText getStAveriguador() { + return stAveriguador; + } + + public void setStAveriguador(StaticText st) { + this.stAveriguador = st; + } + + private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel14() { + return gridPanel14; + } + + public void setGridPanel14(HtmlPanelGrid hpg) { + this.gridPanel14 = hpg; + } + + private PanelGroup groupPanel9 = new PanelGroup(); + + public PanelGroup getGroupPanel9() { + return groupPanel9; + } + + public void setGroupPanel9(PanelGroup pg) { + this.groupPanel9 = pg; + } + + private StaticText staticText16 = new StaticText(); + + public StaticText getStaticText16() { + return staticText16; + } + + public void setStaticText16(StaticText st) { + this.staticText16 = st; + } + + private ImageComponent image3 = new ImageComponent(); + + public ImageComponent getImage3() { + return image3; + } + + public void setImage3(ImageComponent ic) { + this.image3 = ic; + } + + private StaticText staticText17 = new StaticText(); + + public StaticText getStaticText17() { + return staticText17; + } + + public void setStaticText17(StaticText st) { + this.staticText17 = st; + } + + private HtmlPanelGrid gridAveriguacaoPosterior = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridAveriguacaoPosterior() { + return gridAveriguacaoPosterior; + } + + public void setGridAveriguacaoPosterior(HtmlPanelGrid hpg) { + this.gridAveriguacaoPosterior = hpg; + } + + private StaticText lblAveriguacaoPosterior1 = new StaticText(); + + public StaticText getLblAveriguacaoPosterior1() { + return lblAveriguacaoPosterior1; + } + + public void setLblAveriguacaoPosterior1(StaticText st) { + this.lblAveriguacaoPosterior1 = st; + } + + private StaticText txtAveriguacaoPosterior = new StaticText(); + + public StaticText getTxtAveriguacaoPosterior() { + return txtAveriguacaoPosterior; + } + + public void setTxtAveriguacaoPosterior(StaticText st) { + this.txtAveriguacaoPosterior = st; + } + + private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel15() { + return gridPanel15; + } + + public void setGridPanel15(HtmlPanelGrid hpg) { + this.gridPanel15 = hpg; + } + + private StaticText staticText18 = new StaticText(); + + public StaticText getStaticText18() { + return staticText18; + } + + public void setStaticText18(StaticText st) { + this.staticText18 = st; + } + + private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel16() { + return gridPanel16; + } + + public void setGridPanel16(HtmlPanelGrid hpg) { + this.gridPanel16 = hpg; + } + + private PanelGroup groupPanel10 = new PanelGroup(); + + public PanelGroup getGroupPanel10() { + return groupPanel10; + } + + public void setGroupPanel10(PanelGroup pg) { + this.groupPanel10 = pg; + } + + private StaticText staticText19 = new StaticText(); + + public StaticText getStaticText19() { + return staticText19; + } + + public void setStaticText19(StaticText st) { + this.staticText19 = st; + } + + private StaticText stNomeSuperior = new StaticText(); + + public StaticText getStNomeSuperior() { + return stNomeSuperior; + } + + public void setStNomeSuperior(StaticText st) { + this.stNomeSuperior = st; + } + + private PanelGroup groupPanel11 = new PanelGroup(); + + public PanelGroup getGroupPanel11() { + return groupPanel11; + } + + public void setGroupPanel11(PanelGroup pg) { + this.groupPanel11 = pg; + } + + private StaticText staticText20 = new StaticText(); + + public StaticText getStaticText20() { + return staticText20; + } + + public void setStaticText20(StaticText st) { + this.staticText20 = st; + } + + private StaticText stEmailSuperior = new StaticText(); + + public StaticText getStEmailSuperior() { + return stEmailSuperior; + } + + public void setStEmailSuperior(StaticText st) { + this.stEmailSuperior = st; + } + + private HtmlPanelGrid gridSiprp = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridSiprp() { + return gridSiprp; + } + + public void setGridSiprp(HtmlPanelGrid hpg) { + this.gridSiprp = hpg; + } + + private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel17() { + return gridPanel17; + } + + public void setGridPanel17(HtmlPanelGrid hpg) { + this.gridPanel17 = hpg; + } + + private StaticText staticText24 = new StaticText(); + + public StaticText getStaticText24() { + return staticText24; + } + + public void setStaticText24(StaticText st) { + this.staticText24 = st; + } + + private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel18() { + return gridPanel18; + } + + public void setGridPanel18(HtmlPanelGrid hpg) { + this.gridPanel18 = hpg; + } + + private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel20() { + return gridPanel20; + } + + public void setGridPanel20(HtmlPanelGrid hpg) { + this.gridPanel20 = hpg; + } + + private PanelGroup groupPanel12 = new PanelGroup(); + + public PanelGroup getGroupPanel12() { + return groupPanel12; + } + + public void setGroupPanel12(PanelGroup pg) { + this.groupPanel12 = pg; + } + + private StaticText staticText25 = new StaticText(); + + public StaticText getStaticText25() { + return staticText25; + } + + public void setStaticText25(StaticText st) { + this.staticText25 = st; + } + + private StaticText staticText26 = new StaticText(); + + public StaticText getStaticText26() { + return staticText26; + } + + public void setStaticText26(StaticText st) { + this.staticText26 = st; + } + + private PanelGroup groupPanel13 = new PanelGroup(); + + public PanelGroup getGroupPanel13() { + return groupPanel13; + } + + public void setGroupPanel13(PanelGroup pg) { + this.groupPanel13 = pg; + } + + private StaticText staticText27 = new StaticText(); + + public StaticText getStaticText27() { + return staticText27; + } + + public void setStaticText27(StaticText st) { + this.staticText27 = st; + } + + private StaticText txtTecnicoSuperior = new StaticText(); + + public StaticText getTxtTecnicoSuperior() { + return txtTecnicoSuperior; + } + + public void setTxtTecnicoSuperior(StaticText st) { + this.txtTecnicoSuperior = st; + } + + private StaticText staticText28 = new StaticText(); + + public StaticText getStaticText28() { + return staticText28; + } + + public void setStaticText28(StaticText st) { + this.staticText28 = st; + } + + private StaticText staticText47 = new StaticText(); + + public StaticText getStaticText47() { + return staticText47; + } + + public void setStaticText47(StaticText st) { + this.staticText47 = st; + } + + private StaticText txtCap1 = new StaticText(); + + public StaticText getTxtCap1() { + return txtCap1; + } + + public void setTxtCap1(StaticText st) { + this.txtCap1 = st; + } + + private PanelGroup groupPanel14 = new PanelGroup(); + + public PanelGroup getGroupPanel14() { + return groupPanel14; + } + + public void setGroupPanel14(PanelGroup pg) { + this.groupPanel14 = pg; + } + + private StaticText staticText48 = new StaticText(); + + public StaticText getStaticText48() { + return staticText48; + } + + public void setStaticText48(StaticText st) { + this.staticText48 = st; + } + + private StaticText txtMedicoTrabalho = new StaticText(); + + public StaticText getTxtMedicoTrabalho() { + return txtMedicoTrabalho; + } + + public void setTxtMedicoTrabalho(StaticText st) { + this.txtMedicoTrabalho = st; + } + + private StaticText staticText49 = new StaticText(); + + public StaticText getStaticText49() { + return staticText49; + } + + public void setStaticText49(StaticText st) { + this.staticText49 = st; + } + + private StaticText staticText50 = new StaticText(); + + public StaticText getStaticText50() { + return staticText50; + } + + public void setStaticText50(StaticText st) { + this.staticText50 = st; + } + + private StaticText txtCedula1 = new StaticText(); + + public StaticText getTxtCedula1() { + return txtCedula1; + } + + public void setTxtCedula1(StaticText st) { + this.txtCedula1 = st; + } + + private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel5() { + return gridPanel5; + } + + public void setGridPanel5(HtmlPanelGrid hpg) { + this.gridPanel5 = hpg; + } + + private PanelGroup groupPanel3 = new PanelGroup(); + + public PanelGroup getGroupPanel3() { + return groupPanel3; + } + + public void setGroupPanel3(PanelGroup pg) { + this.groupPanel3 = pg; + } + + private StaticText staticText6 = new StaticText(); + + public StaticText getStaticText6() { + return staticText6; + } + + public void setStaticText6(StaticText st) { + this.staticText6 = st; + } + + private StaticText stNomeAcidentado = new StaticText(); + + public StaticText getStNomeAcidentado() { + return stNomeAcidentado; + } + + public void setStNomeAcidentado(StaticText st) { + this.stNomeAcidentado = st; + } + + private PanelGroup groupPanel4 = new PanelGroup(); + + public PanelGroup getGroupPanel4() { + return groupPanel4; + } + + public void setGroupPanel4(PanelGroup pg) { + this.groupPanel4 = pg; + } + + private StaticText staticText7 = new StaticText(); + + public StaticText getStaticText7() { + return staticText7; + } + + public void setStaticText7(StaticText st) { + this.staticText7 = st; + } + + private StaticText stEstabelecimentoOrigem = new StaticText(); + + public StaticText getStEstabelecimentoOrigem() { + return stEstabelecimentoOrigem; + } + + public void setStEstabelecimentoOrigem(StaticText st) { + this.stEstabelecimentoOrigem = st; + } + + private PanelGroup groupPanel15 = new PanelGroup(); + + public PanelGroup getGroupPanel15() { + return groupPanel15; + } + + public void setGroupPanel15(PanelGroup pg) { + this.groupPanel15 = pg; + } + + private StaticText staticText8 = new StaticText(); + + public StaticText getStaticText8() { + return staticText8; + } + + public void setStaticText8(StaticText st) { + this.staticText8 = st; + } + + private StaticText stDataNascimento = new StaticText(); + + public StaticText getStDataNascimento() { + return stDataNascimento; + } + + public void setStDataNascimento(StaticText st) { + this.stDataNascimento = st; + } + + private PanelGroup groupPanel16 = new PanelGroup(); + + public PanelGroup getGroupPanel16() { + return groupPanel16; + } + + public void setGroupPanel16(PanelGroup pg) { + this.groupPanel16 = pg; + } + + private StaticText staticText9 = new StaticText(); + + public StaticText getStaticText9() { + return staticText9; + } + + public void setStaticText9(StaticText st) { + this.staticText9 = st; + } + + private StaticText stBI = new StaticText(); + + public StaticText getStBI() { + return stBI; + } + + public void setStBI(StaticText st) { + this.stBI = st; + } + + private PanelGroup groupPanel17 = new PanelGroup(); + + public PanelGroup getGroupPanel17() { + return groupPanel17; + } + + public void setGroupPanel17(PanelGroup pg) { + this.groupPanel17 = pg; + } + + private StaticText staticText10 = new StaticText(); + + public StaticText getStaticText10() { + return staticText10; + } + + public void setStaticText10(StaticText st) { + this.staticText10 = st; + } + + private StaticText stMorada = new StaticText(); + + public StaticText getStMorada() { + return stMorada; + } + + public void setStMorada(StaticText st) { + this.stMorada = st; + } + + private StaticText staticText11 = new StaticText(); + + public StaticText getStaticText11() { + return staticText11; + } + + public void setStaticText11(StaticText st) { + this.staticText11 = st; + } + + private StaticText stCodPostal = new StaticText(); + + public StaticText getStCodPostal() { + return stCodPostal; + } + + public void setStCodPostal(StaticText st) { + this.stCodPostal = st; + } + + private PanelGroup groupPanel18 = new PanelGroup(); + + public PanelGroup getGroupPanel18() { + return groupPanel18; + } + + public void setGroupPanel18(PanelGroup pg) { + this.groupPanel18 = pg; + } + + private StaticText staticText12 = new StaticText(); + + public StaticText getStaticText12() { + return staticText12; + } + + public void setStaticText12(StaticText st) { + this.staticText12 = st; + } + + private StaticText stContactoTelefonico = new StaticText(); + + public StaticText getStContactoTelefonico() { + return stContactoTelefonico; + } + + public void setStContactoTelefonico(StaticText st) { + this.stContactoTelefonico = st; + } + + private PanelGroup groupPanel19 = new PanelGroup(); + + public PanelGroup getGroupPanel19() { + return groupPanel19; + } + + public void setGroupPanel19(PanelGroup pg) { + this.groupPanel19 = pg; + } + + private StaticText staticText51 = new StaticText(); + + public StaticText getStaticText51() { + return staticText51; + } + + public void setStaticText51(StaticText st) { + this.staticText51 = st; + } + + private StaticText stDataAdmissao = new StaticText(); + + public StaticText getStDataAdmissao() { + return stDataAdmissao; + } + + public void setStDataAdmissao(StaticText st) { + this.stDataAdmissao = st; + } + + private PanelGroup groupPanel20 = new PanelGroup(); + + public PanelGroup getGroupPanel20() { + return groupPanel20; + } + + public void setGroupPanel20(PanelGroup pg) { + this.groupPanel20 = pg; + } + + private StaticText staticText52 = new StaticText(); + + public StaticText getStaticText52() { + return staticText52; + } + + public void setStaticText52(StaticText st) { + this.staticText52 = st; + } + + private StaticText stFuncao = new StaticText(); + + public StaticText getStFuncao() { + return stFuncao; + } + + public void setStFuncao(StaticText st) { + this.stFuncao = st; + } + + private PanelGroup groupPanel21 = new PanelGroup(); + + public PanelGroup getGroupPanel21() { + return groupPanel21; + } + + public void setGroupPanel21(PanelGroup pg) { + this.groupPanel21 = pg; + } + + private StaticText staticText53 = new StaticText(); + + public StaticText getStaticText53() { + return staticText53; + } + + public void setStaticText53(StaticText st) { + this.staticText53 = st; + } + + private StaticText stTurno = new StaticText(); + + public StaticText getStTurno() { + return stTurno; + } + + public void setStTurno(StaticText st) { + this.stTurno = st; + } + + private PanelGroup groupPanel22 = new PanelGroup(); + + public PanelGroup getGroupPanel22() { + return groupPanel22; + } + + public void setGroupPanel22(PanelGroup pg) { + this.groupPanel22 = pg; + } + + private StaticText lblHorasTurno = new StaticText(); + + public StaticText getLblHorasTurno() { + return lblHorasTurno; + } + + public void setLblHorasTurno(StaticText st) { + this.lblHorasTurno = st; + } + + private StaticText txtHorasTurno = new StaticText(); + + public StaticText getTxtHorasTurno() { + return txtHorasTurno; + } + + public void setTxtHorasTurno(StaticText st) { + this.txtHorasTurno = st; + } + + private PanelGroup groupPanel23 = new PanelGroup(); + + public PanelGroup getGroupPanel23() { + return groupPanel23; + } + + public void setGroupPanel23(PanelGroup pg) { + this.groupPanel23 = pg; + } + + private StaticText lblSeccao = new StaticText(); + + public StaticText getLblSeccao() { + return lblSeccao; + } + + public void setLblSeccao(StaticText st) { + this.lblSeccao = st; + } + + private StaticText txtSeccao = new StaticText(); + + public StaticText getTxtSeccao() { + return txtSeccao; + } + + public void setTxtSeccao(StaticText st) { + this.txtSeccao = st; + } + + private PanelGroup groupPanel24 = new PanelGroup(); + + public PanelGroup getGroupPanel24() { + return groupPanel24; + } + + public void setGroupPanel24(PanelGroup pg) { + this.groupPanel24 = pg; + } + + private StaticText lblLocal = new StaticText(); + + public StaticText getLblLocal() { + return lblLocal; + } + + public void setLblLocal(StaticText st) { + this.lblLocal = st; + } + + private StaticText txtLocal = new StaticText(); + + public StaticText getTxtLocal() { + return txtLocal; + } + + public void setTxtLocal(StaticText st) { + this.txtLocal = st; + } + + private HtmlPanelGrid gridHeader1 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridHeader1() { + return gridHeader1; + } + + public void setGridHeader1(HtmlPanelGrid hpg) { + this.gridHeader1 = hpg; + } + + private PanelGroup groupPanel25 = new PanelGroup(); + + public PanelGroup getGroupPanel25() { + return groupPanel25; + } + + public void setGroupPanel25(PanelGroup pg) { + this.groupPanel25 = pg; + } + + private StaticText lblUser = new StaticText(); + + public StaticText getLblUser() { + return lblUser; + } + + public void setLblUser(StaticText st) { + this.lblUser = st; + } + + private StaticText staticText21 = new StaticText(); + + public StaticText getStaticText21() { + return staticText21; + } + + public void setStaticText21(StaticText st) { + this.staticText21 = st; + } + + private Hyperlink lnkAnalisesAcidente = new Hyperlink(); + + public Hyperlink getLnkAnalisesAcidente() { + return lnkAnalisesAcidente; + } + + public void setLnkAnalisesAcidente(Hyperlink h) { + this.lnkAnalisesAcidente = h; + } + + private StaticText staticText38 = new StaticText(); + + public StaticText getStaticText38() { + return staticText38; + } + + public void setStaticText38(StaticText st) { + this.staticText38 = st; + } + + private Hyperlink lnkNewUser1 = new Hyperlink(); + + public Hyperlink getLnkNewUser1() { + return lnkNewUser1; + } + + public void setLnkNewUser1(Hyperlink h) { + this.lnkNewUser1 = h; + } + + private StaticText staticText39 = new StaticText(); + + public StaticText getStaticText39() { + return staticText39; + } + + public void setStaticText39(StaticText st) { + this.staticText39 = st; + } + + private Hyperlink lnkEditUser = new Hyperlink(); + + public Hyperlink getLnkEditUser() { + return lnkEditUser; + } + + public void setLnkEditUser(Hyperlink h) { + this.lnkEditUser = h; + } + + private StaticText staticText40 = new StaticText(); + + public StaticText getStaticText40() { + return staticText40; + } + + public void setStaticText40(StaticText st) { + this.staticText40 = st; + } + + private Hyperlink lnkLogout1 = new Hyperlink(); + + public Hyperlink getLnkLogout1() { + return lnkLogout1; + } + + public void setLnkLogout1(Hyperlink h) { + this.lnkLogout1 = h; + } + + private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel6() { + return gridPanel6; + } + + public void setGridPanel6(HtmlPanelGrid hpg) { + this.gridPanel6 = hpg; + } + + private PanelGroup groupPanel26 = new PanelGroup(); + + public PanelGroup getGroupPanel26() { + return groupPanel26; + } + + public void setGroupPanel26(PanelGroup pg) { + this.groupPanel26 = pg; + } + + private ImageComponent image4 = new ImageComponent(); + + public ImageComponent getImage4() { + return image4; + } + + public void setImage4(ImageComponent ic) { + this.image4 = ic; + } + + private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel7() { + return gridPanel7; + } + + public void setGridPanel7(HtmlPanelGrid hpg) { + this.gridPanel7 = hpg; + } + + private StaticText staticText41 = new StaticText(); + + public StaticText getStaticText41() { + return staticText41; + } + + public void setStaticText41(StaticText st) { + this.staticText41 = st; + } + + private HtmlPanelGrid gridPanel21 = new HtmlPanelGrid(); + + public HtmlPanelGrid getGridPanel21() { + return gridPanel21; + } + + public void setGridPanel21(HtmlPanelGrid hpg) { + this.gridPanel21 = hpg; + } + + private PanelGroup groupPanel27 = new PanelGroup(); + + public PanelGroup getGroupPanel27() { + return groupPanel27; + } + + public void setGroupPanel27(PanelGroup pg) { + this.groupPanel27 = pg; + } + + private StaticText staticText42 = new StaticText(); + + public StaticText getStaticText42() { + return staticText42; + } + + public void setStaticText42(StaticText st) { + this.staticText42 = st; + } + + private StaticText stHeaderNr = new StaticText(); + + public StaticText getStHeaderNr() { + return stHeaderNr; + } + + public void setStHeaderNr(StaticText st) { + this.stHeaderNr = st; + } + + private PanelGroup groupPanel28 = new PanelGroup(); + + public PanelGroup getGroupPanel28() { + return groupPanel28; + } + + public void setGroupPanel28(PanelGroup pg) { + this.groupPanel28 = pg; + } + + private StaticText staticText43 = new StaticText(); + + public StaticText getStaticText43() { + return staticText43; + } + + public void setStaticText43(StaticText st) { + this.staticText43 = st; + } + + private StaticText stHeaderDate = new StaticText(); + + public StaticText getStHeaderDate() { + return stHeaderDate; + } + + public void setStHeaderDate(StaticText st) { + this.stHeaderDate = st; + } + + private ImageComponent image5 = new ImageComponent(); + + public ImageComponent getImage5() { + return image5; + } + + public void setImage5(ImageComponent ic) { + this.image5 = ic; + } + /** + *

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 superclasssuperclass + super.init(); + // Perform application initialization that must complete + // *before* managed components are initialized + // TODO - add your own initialiation code here + + // + // Initialize automatically managed components + // *Note* - this logic should NOT be modified + try { + _init(); + } catch (Exception e) { + log("ViewAnaliseAcidenteTrabalho Initialization Failure", e); + throw e instanceof FacesException ? (FacesException) e: new FacesException(e); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + if (!getSessionBean1().isLoggedIn()) { + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) { + // . . . handle exception . . . + System.out.println("LOGGED IN = " + e.getMessage()); + } + } + else + { + lblUser.setText( getSessionBean1().getCurrentUser().getLogin() ); + initializePage(); + } + + } + + /** + *

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).

+ */ + public void destroy() { + } + + /** + *

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 + + if (getSessionBean1().isLoggedIn()) { +// try { +// getExternalContext().redirect("Login.jsp"); +// } catch(Exception e) {} + + try + { + javax.servlet.http.HttpSession session = + (javax.servlet.http.HttpSession) getExternalContext().getSession(true); + session.invalidate(); + } + catch(Exception ex){} + + } + + try { + getExternalContext().redirect("Login.jsp"); + } catch(Exception e) {} + //return "login"; + return null; + } + + 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(); + fillHeader(a); + 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(); + } + + + int estado = a.getEstado().intValue(); + switch(estado) + { + case Global.ESTADO_SEG: + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + break; + case Global.ESTADO_RH1: + gridDadosAcidenteRhView.setRendered(false); + gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + break; + case Global.ESTADO_HS: + gridRecomendacoesViewHS.setRendered(false); + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + break; + case Global.ESTADO_RH2: //medidas + gridMedidasViewRH.setRendered(false); + gridMedicoView.setRendered(false); + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + + break; +// case Global.ESTADO_MEDICINA: +// gridMedicoView.setRendered(false); +// gridVerificacaoView.setRendered(false); +// gridImpressaoView.setRendered(false); +// +// fillAcidentado(ac); +// fillDadosAcidenteSeg(a); +// fillDadosAcidenteRh(a); +// fillRecomendacoesHs(a); +// fillMedidasRh(a); +// break; + case Global.ESTADO_CONSOLIDACAO: + gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + break; + case Global.ESTADO_ASSINATURA_SEG: + //gridMedidasViewRH.setRendered(false); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + break; + + case Global.ESTADO_ASSINATURA_RH: + //gridMedidasViewRH.setRendered(false); + //gridMedicoView.setRendered(false); + //gridVerificacaoView.setRendered(false); + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + break; + + +// case Global.ESTADO_IMPRESSAO: +// gridImpressaoView.setRendered(false); +// +// fillAcidentado(ac); +// fillDadosAcidenteSeg(a); +// fillDadosAcidenteRh(a); +// fillRecomendacoesHs(a); +// fillMedidasRh(a); +// fillMedico(a); +// fillVerificacao(a); +// break; + + case Global.ESTADO_FECHAR: + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + //fillImpressao(a); + break; + case Global.ESTADO_CONCLUIDO: + gridImpressaoView.setRendered(false); + + fillAcidentado(ac); + fillDadosAcidenteSeg(a); + fillDadosAcidenteRh(a); + fillRecomendacoesHs(a); + fillMedidasRh(a); + fillMedico(a); + fillVerificacao(a); + + break; + } + } + + private void fillHeader(AnaliseAcidente a) + { + 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){}; + } + + 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); + stNomeSuperior.setText(a.getNome_superior_hierarquico()); + stEmailSuperior.setText(a.getEmail_superior_hierarquico()); + stEstabelecimentoOrigem.setText(a.getEstabelecimento_origem()); + } + + 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()); + + stAveriguador.setText(a.getAveriguador()); + + if(a.getData_acidente() == null) + { + lblDataAcidente.setRendered(false); + stDataAcidente1.setRendered(false); + } + else + { + try + { + java.util.Date ddate = new java.util.Date(a.getData_acidente().getTime()); + stDataAcidente1.setText(utils.Utils.dateToYYYYMMDD(ddate)); + } + catch(Exception ex){}; + } + + if(a.getHora_acidente() == null) + { + lblHoraAcidente.setRendered(false); + stHoraAcidente1.setRendered(false); + } + else + { + Calendar cal = Calendar.getInstance(); + + // set the calendar to have your time + cal.setTimeInMillis(a.getHora_acidente().getTime()); + + int hour = cal.get(Calendar.HOUR_OF_DAY); + int minutes = cal.get(Calendar.MINUTE); + try + { + stHoraAcidente1.setText(utils.Utils.timeToHHMM(hour + ":" + minutes)); + } + catch(Exception ex){} + } + + boolean booTurnoSeccaoLocal = false; + if(a.getHoras_turno() == null) + { + lblHorasTurno.setRendered(false); + txtHorasTurno.setRendered(false); + } + else if(a.getHoras_turno().intValue() == 0) + { + lblHorasTurno.setRendered(false); + txtHorasTurno.setRendered(false); + } + else + { + txtHorasTurno.setText(a.getHoras_turno().toString()); + booTurnoSeccaoLocal = true; + } + +// if(a.getSeccao() == null) +// { +// lblSeccao.setRendered(false); +// txtSeccao.setRendered(false); +// } +// else if(a.getSeccao().trim().length() == 0) +// { +// lblSeccao.setRendered(false); +// txtSeccao.setRendered(false); +// } +// else +// { +// txtSeccao.setText(a.getSeccao()); +// booTurnoSeccaoLocal = true; +// } + + try + { + Seccao s = adp.getSeccao(a.getSeccao_id()); + txtSeccao.setText(s.getDescricao()); + booTurnoSeccaoLocal = true; + } + catch(Exception ex) + { + ex.printStackTrace(); + lblSeccao.setRendered(false); + txtSeccao.setRendered(false); + } + + + if(a.getLocal_trabalho() == null) + { + lblLocal.setRendered(false); + txtLocal.setRendered(false); + } + else if(a.getLocal_trabalho().trim().length() == 0) + { + lblLocal.setRendered(false); + txtLocal.setRendered(false); + } + else + { + txtLocal.setText(a.getLocal_trabalho()); + booTurnoSeccaoLocal = true; + } + + if(!booTurnoSeccaoLocal) + { + gridTurnoSeccaoLocal.setRendered(false); + } + + if(a.getTarefa() == null) + { + gridTarefa.setRendered(false); + lblTarefa.setRendered(false); + txtTarefa.setRendered(false); + } + else if(a.getTarefa().trim().length() == 0) + { + gridTarefa.setRendered(false); + lblTarefa.setRendered(false); + txtTarefa.setRendered(false); + } + else + { + txtTarefa.setText(a.getTarefa()); + } + + if(a.getSubstancias() == null) + { + gridSubstancias.setRendered(false); + lblSubstancias.setRendered(false); + txtSubstancias.setRendered(false); + } + else if(a.getSubstancias().trim().length() == 0) + { + gridSubstancias.setRendered(false); + lblSubstancias.setRendered(false); + txtSubstancias.setRendered(false); + } + else + { + txtSubstancias.setText(a.getSubstancias()); + } + +// if(a.getSuperior_hierarquico() == null) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior.setRendered(false); +// } +// else if(a.getSuperior_hierarquico().trim().length() == 0) +// { +// gridSuperior.setRendered(false); +// lblSuperior.setRendered(false); +// txtSuperior.setRendered(false); +// } +// else +// { +// txtSuperior.setText(a.getSuperior_hierarquico()); +// } + + if(a.getCondicoes() == null) + { + gridCondicoes.setRendered(false); + lblCondicoes.setRendered(false); + txtCondicoes.setRendered(false); + } + else if(a.getCondicoes().trim().length() == 0) + { + gridCondicoes.setRendered(false); + lblCondicoes.setRendered(false); + txtCondicoes.setRendered(false); + } + else + { + txtCondicoes.setText(a.getCondicoes()); + } + + + if(a.getTestemunhas() == null) + { + gridTestemunhas.setRendered(false); + lblTestemunhas.setRendered(false); + txtTestemunhas.setRendered(false); + } + else if(a.getTestemunhas().trim().length() == 0) + { + gridTestemunhas.setRendered(false); + lblTestemunhas.setRendered(false); + txtTestemunhas.setRendered(false); + + } + else + { + txtTestemunhas.setText(a.getTestemunhas()); + } + +// txtCausas.setText(a.getCausas()); + try + { + Causa c = adp.getCausa(a.getCausas()); + txtCausas.setText(c.getCausa()); + } + catch(Exception ex) + { + ex.printStackTrace(); + gridCausas.setRendered(false); + } + + if(a.getDescricao() == null) + { + gridDescricao.setRendered(false); + lblDescricao.setRendered(false); + txtDescricao.setRendered(false); + } + else if(a.getTestemunhas().trim().length() == 0) + { + gridDescricao.setRendered(false); + lblDescricao.setRendered(false); + txtDescricao.setRendered(false); + } + else + { + txtDescricao.setText(a.getDescricao()); + } + + if(a.getConclusoes() == null) + { + gridConclusoes.setRendered(false); + lblConclusoes.setRendered(false); + txtConclusoes.setRendered(false); + } + else if(a.getConclusoes().trim().length() == 0) + { + gridConclusoes.setRendered(false); + lblConclusoes.setRendered(false); + txtConclusoes.setRendered(false); + } + else + { + txtConclusoes.setText(a.getConclusoes()); + } + + if(a.getAccoes() == null) + { + gridAccoes.setRendered(false); + lblAccoes.setRendered(false); + txtAccoes.setRendered(false); + } + else if(a.getAccoes().trim().length() == 0) + { + gridAccoes.setRendered(false); + lblAccoes.setRendered(false); + txtAccoes.setRendered(false); + } + else + { + txtAccoes.setText(a.getAccoes()); + } + + if(a.getAveriguacao_posterior().matches("n")) + { + gridAveriguacaoPosterior.setRendered(false); + } + else + { + if(a.getAveriguacao_obs().trim().length() > 0) + { + txtAveriguacaoPosterior.setText("Averiguação posterior: " + a.getAveriguacao_obs()); + } + } + + + + //fill images + String folderName = a.getAnalise_nr().substring(0,2) + a.getAnalise_nr().substring(3); + System.out.println("FOLDER NAME : " + folderName); + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + folderName); + + + File apacheAnaliseFolder = new File(theApplicationsServletContext.getRealPath( Global.RESOURCES_IMAGE_FOLDER ) + "/analises/" + folderName); + if(apacheAnaliseFolder.exists()) + { + Global global = new Global(); + global.deleteFolderFiles(apacheAnaliseFolder); + } + else + { + apacheAnaliseFolder.mkdir(); + } + + + String imageFileFolder = Global.IMAGE_FOLDER + "/" + folderName; + try + { + File f = new File(imageFileFolder); + + if(f.exists()) + { + File images[] = f.listFiles(); + Arrays.sort(images); + for(int i=0;i 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 if( a.getOutros_acidentes_com_colaborador().matches("n") ) + { + st1.setText("Não se verificaram outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado."); + gridColaborador.getChildren().add(st1); + } + else //t + { + gridColaborador.setRendered(false); + } + + 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 if( a.getAcidentes_outros_colaboradores().matches("n") ) + { + st2.setText("Não se verificaram ocorrências/incidentes com outros colaboradores."); + gridColaboradores.getChildren().add(st2); + } + else //t + { + gridColaboradores.setRendered(false); + } + } + + 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); + if(a.getEspecif1() != null) + { + if(a.getEspecif1().trim().length() > 0) + { + 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); + if(a.getEspecif2() != null) + { + if(a.getEspecif2().trim().length() > 0) + { + 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); + if(a.getEspecif3() != null) + { + if(a.getEspecif3().trim().length() > 0) + { + 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); + if(a.getEspecif4() != null) + { + if(a.getEspecif4().trim().length() > 0) + { + 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); + } + + System.out.println("GRID LESAO : " + gridLesao.getChildren().size()); + if(gridLesao.getChildren().size() == 0) + { + lblAreasCorporais.setRendered(false); + } + + //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 fillVerificacao(AnaliseAcidente a) + { +// StaticText st = new StaticText(); +// st.setId("stVerificacao1"); +// st.setEscape(false); +// String txtVer = "Verificado por " + a.getNome_resp_seg() + " a "; +// //txtVer += a.getData_assinatura_seg(); +// +// try +// { +// java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); +// txtVer += utils.Utils.dateToYYYYMMDD(ddate); +// } +// catch(Exception ex){}; +// st.setText(txtVer); +// gridAssinaturasView.getChildren().add(st); +// +// st = new StaticText(); +// st.setId("stVerificacao2"); +// st.setEscape(false); +// txtVer = "Verificado por " + a.getNome_resp_rh() + " a "; +// //txtVer += a.getData_assinatura_rh(); +// try +// { +// java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); +// txtVer += utils.Utils.dateToYYYYMMDD(ddate); +// } +// catch(Exception ex){}; +// st.setText(txtVer); +// gridAssinaturasView.getChildren().add(st); + + StaticText st = null; + String txtVer = null; + if(a.getAveriguador() != null) + { + if(a.getAveriguador().trim().length() > 0) + { + st = new StaticText(); + st.setId("stVerificacao1"); + st.setEscape(false); + txtVer = "Averiguado por " + a.getAveriguador() + " (Departamento de Segurança) a "; + //txtVer += a.getData_assinatura_seg(); + + try + { + java.util.Date ddate = new java.util.Date(a.getData_inicio_processo().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + } + + if(a.getAss_consolidacao().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao2"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_consolidacao() + " (Técnico de HST) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_consolidacao().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + if(a.getAss_resp_seg().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao3"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_seg() + " (Responsável de Segurança) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_seg().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + if(a.getAss_resp_rh().matches("y")) + { + st = new StaticText(); + st.setId("stVerificacao4"); + st.setEscape(false); + txtVer = "Verificado por " + a.getNome_resp_rh() + " (Responsável de RH) a "; + //txtVer += a.getData_assinatura_rh(); + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_rh().getTime()); + txtVer += utils.Utils.dateToYYYYMMDD(ddate) + "."; + } + catch(Exception ex){}; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + Acidentado ac = adp.getAcidentado(a.getAcidentado_id()); + if(ac.getNome_superior_hierarquico() != null) + { + if(ac.getNome_superior_hierarquico().trim().length() > 0) + { + st = new StaticText(); + st.setId("stVerificacao5"); + st.setEscape(false); + txtVer = "Com conhecimento de " + ac.getNome_superior_hierarquico() + " (Responsável hierárquico)"; + + if(ac.getEmail_superior_hierarquico() != null) + { + if(ac.getEmail_superior_hierarquico().trim().length() > 0) + { + try + { + java.util.Date ddate = new java.util.Date(ac.getData_email_superior_hierarquico().getTime()); + txtVer += " a " + utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex){}; + } + } + txtVer += "."; + st.setText(txtVer); + gridAssinaturasView.getChildren().add(st); + } + } + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + HtmlPanelGrid grid = new HtmlPanelGrid(); + grid.setId("rodape1"); + grid.setColumns(1); + grid.setStyle("width: 100%"); + grid.setColumnClasses("gridColCenter"); + st = new StaticText(); + st.setId("stRodape1"); + st.setEscape(false); + st.setText("- processamento informático - acesso autenticado -"); + grid.getChildren().add(st); + gridAssinaturasView.getChildren().add(grid); + } + + private void fillImpressao(AnaliseAcidente a) + { + StaticText st = new StaticText(); + st.setId("stImpressaoView1"); + st.setEscape(false); + String stData = ""; + try + { + java.util.Date ddate = new java.util.Date(a.getData_assinatura_superior().getTime()); + stData += utils.Utils.dateToYYYYMMDD(ddate); + } + catch(Exception ex){}; + + String txt = "Assinado na Ficha de Análise de Acidente em papel por " + a.getNome_superior() + ", superior hierárquico / superior de "; + txt += getSessionBean1().getAcidentado().getNome() + ", a " + stData; + gridAssSupView.getChildren().add(st); + } + + private void fillImages() + { + ServletContext theApplicationsServletContext = + (ServletContext) this.getExternalContext().getContext(); + try + { +// String imageFileFolder = theApplicationsServletContext.getRealPath(Global.IMAGE_FOLDER + "/" + getSessionBean1().getCurrentAnalise().getId()); + String imageFileFolder = Global.IMAGE_FOLDER + "/" + getSessionBean1().getCurrentAnalise().getId(); + File f = new File(imageFileFolder); + if( f.exists() ) + { + File files[] = f.listFiles(); + + for(int i=0;i " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_ASSINATURA_SEG + " AND (averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> '')) OR (estado > " + Global.ESTADO_ASSINATURA_SEG + " AND estado < " + Global.ESTADO_CONCLUIDO + "))" + " ORDER BY analise_nr"; +// sql ="SELECT * FROM analises_acidentes WHERE estabelecimento_id = " + estabelecimento_id + " AND ((estado = 7 and ass_resp_seg = 'y') OR (estado > 1 AND estado < 7 AND (averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> ''))) OR (estado > 7 AND estado < 10))"; + } + else + { +// sql ="SELECT * FROM analises_acidentes WHERE estabelecimento_id = " + estabelecimento_id + " AND ((estado > " + Global.ESTADO_SEG + " AND estado < 8 AND (averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> ''))) OR (estado > 7 AND estado < 10))"; + sql ="SELECT * FROM analises_acidentes WHERE estabelecimento_id = " + estabelecimento_id + " AND ((estado > " + Global.ESTADO_SEG + " AND estado < " + Global.ESTADO_FECHAR + " AND (averiguacao_posterior = 'n' OR (averiguacao_posterior = 'y' AND averiguacao_obs <> ''))) OR estado = " + Global.ESTADO_FECHAR + ")" + " ORDER BY analise_nr"; + } + + System.out.println("SEG SEGUIMENTO SQL : " + sql); + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoHsList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE estado < " + Global.ESTADO_HS + " OR (estado > " + Global.ESTADO_HS + " AND estado < " + Global.ESTADO_CONSOLIDACAO + ") OR (estado > " + Global.ESTADO_CONSOLIDACAO + " AND estado < " + Global.ESTADO_FECHAR + ")" + " ORDER BY analise_nr"; // AND estabelecimento_id = " + estabelecimento_id; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoRhList(Integer estabelecimento_id, String responsavel_loja) throws Exception + { + Statement st = createStatement(); + String sql = null; + + if(responsavel_loja.matches("y")) + { +// sql ="SELECT * FROM analises_acidentes WHERE (estado = 1 OR estado = 3 OR estado = 6 OR (estado = 7 AND estado_assinatura < 2) OR estado = 9) AND estabelecimento_id = " + estabelecimento_id; +// sql ="SELECT * FROM analises_acidentes WHERE (estado = 1 OR estado = 3 OR estado = 6 OR (estado = 7 AND estado_assinatura < 2) OR (estado = 7 and ass_resp_rh = 'y') OR estado = 9) AND estabelecimento_id = " + estabelecimento_id; + sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + " OR estado = " + Global.ESTADO_FECHAR + ") AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + else + { + sql ="SELECT * FROM analises_acidentes WHERE (estado = " + Global.ESTADO_SEG + " OR estado = " + Global.ESTADO_HS + " OR estado = " + Global.ESTADO_CONSOLIDACAO + " OR estado = " + Global.ESTADO_ASSINATURA_SEG + " OR estado = " + Global.ESTADO_ASSINATURA_RH + " OR estado = " + Global.ESTADO_FECHAR + ") AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoMedList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE estado < 5 OR (estado = 6 AND estado_assinatura <> 2) OR (estado = 6 AND estado_assinatura = 2 AND ass_med = 'y') OR (estado > 6 AND estado < 9) AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoDirSiprpList() throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE estado < " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoDirGerRhList() throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM analises_acidentes WHERE estado < " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + public ArrayList getAnalisesSeguimentoGestorList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + if(estabelecimento_id == null) + { + sql ="SELECT * FROM analises_acidentes WHERE estado < " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql ="SELECT * FROM analises_acidentes WHERE estado < " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + return list; + } + + + + public ArrayList getAnalisesConcluidasList(Integer estabelecimento_id) throws Exception + { + Statement st = createStatement(); + String sql = ""; + if(estabelecimento_id == null) + { + sql ="SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql ="SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + + return list; + } + + public ArrayList getAnalisesConcluidasHsList() throws Exception + { + Statement st = createStatement(); + String sql ="SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + + return list; + } + + public ArrayList searchAanalisesConcluidasList(Integer estabelecimento_id, Integer ano, Integer mes, Integer dia, String por, String nome) throws Exception + { +// Strings strings = new Strings(); + Calendar cal = Calendar.getInstance(); +// ArrayList list = new ArrayList(); +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement st = createStatement(); + String sql = ""; + if(por != null) + { + por = por.toUpperCase(); + } + if(nome != null) + { + nome = nome.toUpperCase(); + } + + if( ano != null) + { + if( mes != null) + { + if( dia != null) + { + cal.set( cal.YEAR, ano.intValue() ); + cal.set( cal.MONTH, mes.intValue() -1 ); + cal.set( cal.DATE, dia.intValue() ); + java.sql.Date data_acidente = new java.sql.Date( cal.getTime().getTime() ); + if(por != null && nome != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + else if(por != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + } + else if( nome != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente = '" + data_acidente + "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + else + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes WHERE data_acidente = '" + data_acidente + "' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes WHERE data_acidente = '" + data_acidente + "' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + } + else + { + cal.set( cal.YEAR, ano.intValue() ); + cal.set( cal.MONTH, mes.intValue() -1 ); + cal.set( cal.DATE, 1 ); + java.sql.Date data_acidente_from = new java.sql.Date( cal.getTime().getTime() ); + cal.set( cal.DATE, 31 ); + java.sql.Date data_acidente_to = new java.sql.Date( cal.getTime().getTime() ); + if(por != null && nome != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + else if(por != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + } + else if( nome != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + else + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + } + } // dia + } // mes + else + { + cal.set( cal.YEAR, ano.intValue() ); + cal.set( cal.MONTH, 0 ); + cal.set( cal.DATE, 1 ); + java.sql.Date data_acidente_from = new java.sql.Date( cal.getTime().getTime() ); + cal.set( cal.MONTH, 11 ); + cal.set( cal.DATE, 31 ); + java.sql.Date data_acidente_to = new java.sql.Date( cal.getTime().getTime() ); + if(por != null && nome != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + else if(por != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + } + else if( nome != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + else + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes WHERE data_acidente >= '" + data_acidente_from + "' AND data_acidente <= '" + data_acidente_to + "' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + } + } // ano + else + { + if(por != null && nome != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND (numero_mecanografico LIKE '%" + por + "%' OR nome LIKE '%" + nome + "%') AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + } + else if(por != null) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND numero_mecanografico LIKE '%" + por + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + } + else if( nome != null ) + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes, acidentados WHERE acidentado_id = acidentados.id AND nome LIKE '%" + nome + "%' AND estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + } + else + { + if(estabelecimento_id == null) + { + sql = "SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " ORDER BY analise_nr"; + } + else + { + sql = "SELECT * FROM analises_acidentes WHERE estado = " + Global.ESTADO_CONCLUIDO + " AND estabelecimento_id = " + estabelecimento_id + " ORDER BY analise_nr"; + } + + } + } + ResultSet rs = st.executeQuery(sql); + ArrayList list = fillAnaliseFields(rs); + + return list; + } + + private ArrayList fillAnaliseFields(ResultSet rs) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + Statement stlocal1 = dblocal.createStatement(); + + ArrayList list = new ArrayList(); + + rs.first(); + int nr = 0; + do + { + AnaliseAcidente a = new AnaliseAcidente(); + a.setId(new Integer(rs.getInt("id"))); + //System.out.println("ANALISE ID : " + a.getId()); + nr++; + a.setNr(new Integer(nr)); + a.setData_acidente(rs.getDate("data_acidente")); + a.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + a.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + String sqllocal1 = "SELECT nome_plain FROM estabelecimentos WHERE id = " + a.getEstabelecimento_id(); + ResultSet rslocal1 = stlocal1.executeQuery(sqllocal1); + rslocal1.first(); + a.setNome_estabelecimento(rslocal1.getString("nome_plain")); + a.setEstado(new Integer(rs.getInt("estado"))); + a.setEstado_assinatura(new Integer(rs.getInt("estado_assinatura"))); + a.setFase(getFase(a.getEstado().intValue())); + a.setAcidentado_id(new Integer( rs.getInt("acidentado_id"))); + Acidentado ac = getAcidentado(a.getAcidentado_id()); + String sqllocal = "SELECT nome, numero_mecanografico FROM trabalhadores WHERE id = " + ac.getTrabalhador_id(); + ResultSet rslocal = stlocal.executeQuery(sqllocal); + rslocal.first(); + String nome_acidentado = rslocal.getString("nome"); + a.setNome_acidentado(utils.Utils.unicodeToHTML(nome_acidentado)); + a.setNumero_mecanografico(rslocal.getString("numero_mecanografico")); + Object horas_turno = rs.getObject("horas_turno"); + if(horas_turno == null) + { + a.setHoras_turno(null); + } + else + { + a.setHoras_turno(new Integer(rs.getInt("horas_turno"))); + } + + a.setAveriguador(rs.getString("averiguador")); + //a.setSeccao(rs.getString("seccao")); + a.setDepartamento_id( new Integer(rs.getInt("departamento_id")) ); + a.setSeccao_id( new Integer(rs.getInt("seccao_id")) ); + a.setLocal_trabalho(rs.getString("local_trabalho")); + a.setTarefa(rs.getString("tarefa")); + a.setSubstancias(rs.getString("substancias")); +// a.setSuperior_hierarquico(rs.getString("superior_hierarquico")); + a.setCondicoes(rs.getString("condicoes")); + a.setTestemunhas(rs.getString("testemunhas")); + a.setCausas( new Integer(rs.getInt("causas")) ); + a.setDescricao(rs.getString("descricao")); + a.setConclusoes(rs.getString("conclusoes")); + a.setAccoes(rs.getString("accoes")); + a.setAveriguacao_posterior(rs.getString("averiguacao_posterior")); + a.setAveriguacao_obs(rs.getString("averiguacao_obs")); + + a.setHora_acidente(rs.getTime("hora_acidente")); + a.setFormacao_shst(rs.getString("formacao_shst")); + Object o = rs.getString("formacao_shst_nao_porque"); + if(o == null) + { + a.setFormacao_shst_nao_porque(""); + } + else + { + a.setFormacao_shst_nao_porque(rs.getString("formacao_shst_nao_porque")); + } + a.setOutros_acidentes_com_colaborador(rs.getString("outros_acidentes_com_colaborador")); + a.setNr_acidentes_com_colaborador(new Integer(rs.getInt("nr_acidentes_com_colaborador"))); + a.setNr_relatorio_acidente_colaborador1(new Integer(rs.getInt("nr_relatorio_acidente_colaborador1"))); + a.setNr_relatorio_acidente_colaborador2(new Integer(rs.getInt("nr_relatorio_acidente_colaborador2"))); + a.setNr_relatorio_acidente_colaborador3(new Integer(rs.getInt("nr_relatorio_acidente_colaborador3"))); + a.setNr_relatorio_acidente_colaborador4(new Integer(rs.getInt("nr_relatorio_acidente_colaborador4"))); + a.setAcidentes_outros_colaboradores(rs.getString("acidentes_outros_colaboradores")); + a.setNr_acidentes_outros_colaboradores(new Integer(rs.getInt("nr_acidentes_outros_colaboradores"))); + a.setNr_relatorio_acidente_outros_colaboradores1(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores1"))); + a.setNr_relatorio_acidente_outros_colaboradores2(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores2"))); + a.setNr_relatorio_acidente_outros_colaboradores3(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores3"))); + a.setNr_relatorio_acidente_outros_colaboradores4(new Integer(rs.getInt("nr_relatorio_acidente_outros_colaboradores4"))); + + a.setLesao_cabeca(rs.getString("lesao_cabeca")); + a.setLesao_pescoco(rs.getString("lesao_pescoco")); + a.setLesao_tronco(rs.getString("lesao_tronco")); + a.setLesao_membro_sup_dir(rs.getString("lesao_membro_sup_dir")); + a.setLesao_membro_sup_esq(rs.getString("lesao_membro_sup_esq")); + a.setLesao_membro_inf_dir(rs.getString("lesao_membro_inf_dir")); + a.setLesao_membro_inf_esq(rs.getString("lesao_membro_inf_esq")); + Object ob = rs.getString("especif1"); + if(ob == null) + { + a.setEspecif1(""); + } + else + { + a.setEspecif1(rs.getString("especif1")); + } + ob = rs.getString("especif2"); + if(ob == null) + { + a.setEspecif2(""); + } + else + { + a.setEspecif2(rs.getString("especif2")); + } + ob = rs.getString("especif3"); + if(ob == null) + { + a.setEspecif3(""); + } + else + { + a.setEspecif3(rs.getString("especif3")); + } + ob = rs.getString("especif4"); + if(ob == null) + { + a.setEspecif4(""); + } + else + { + a.setEspecif4(rs.getString("especif4")); + } + ob = rs.getString("tipo_lesao"); + if(ob == null) + { + a.setTipo_lesao(""); + } + else + { + a.setTipo_lesao(rs.getString("tipo_lesao")); + } + a.setTipo_incapacidade(rs.getString("tipo_incapacidade")); + //a.setCoef_incapacidade(new Integer(( rs.getInt("coef_incapacidade") ))); + a.setCoef_incapacidade((Integer) rs.getObject("coef_incapacidade")); + a.setData_aval_incapacidade(rs.getDate("data_aval_incapacidade")); + a.setData_rev_incapacidade(rs.getDate("data_rev_incapacidade")); + a.setPeriodo_incapacidade_de(rs.getDate("periodo_incapacidade_de")); + a.setPeriodo_incapacidade_a(rs.getDate("periodo_incapacidade_a")); + a.setImg_flexao(rs.getString("img_flexao")); + a.setImg_ext1(rs.getString("img_ext1")); + a.setImg_ext2(rs.getString("img_ext2")); + a.setImg_cab2(rs.getString("img_cab2")); + a.setImg_cab3(rs.getString("img_cab3")); + a.setImg_ma2(rs.getString("img_ma2")); + a.setImg_ma3(rs.getString("img_ma3")); + a.setImg_ma5(rs.getString("img_ma5")); + a.setImg_ma6(rs.getString("img_ma6")); + a.setImg_ma8(rs.getString("img_ma8")); + a.setImg_ma10(rs.getString("img_ma10")); + a.setImg_rot1(rs.getString("img_rot1")); + a.setImg_rot2(rs.getString("img_rot2")); + a.setImg_cab1(rs.getString("img_cab1")); + a.setImg_cab4(rs.getString("img_cab4")); + a.setImg_ma1(rs.getString("img_ma1")); + a.setImg_ma4(rs.getString("img_ma4")); + a.setImg_ma7(rs.getString("img_ma7")); + a.setImg_ma9(rs.getString("img_ma9")); + a.setRestricao_carga(new Integer( rs.getInt("restricao_carga") )); + a.setRestricao_motricidade(rs.getString("restricao_motricidade")); + a.setRestricao_conducao(rs.getString("restricao_conducao")); + a.setRestricao_vibracoes(rs.getString("restricao_vibracoes")); + ob = rs.getString("restricao_outras"); + if(ob == null) + { + a.setRestricao_outras(""); + } + else + { + a.setRestricao_outras(rs.getString("restricao_outras")); + } + ob = rs.getString("med_observ"); + if(ob == null) + { + a.setMed_observ(""); + } + else + { + a.setMed_observ(rs.getString("med_observ")); + } + a.setAnalise_nr(rs.getString("analise_nr")); + a.setMedico_id(new Integer(rs.getInt("medico_id"))); + a.setTecnico_saude_id(new Integer(rs.getInt("tecnico_saude_id"))); + + //a.setAss_hs(rs.getString("ass_hs")); + //a.setAss_seg(rs.getString("ass_seg")); + a.setAss_resp_seg(rs.getString("ass_resp_seg")); + //a.setAss_med(rs.getString("ass_med")); + a.setAss_resp_rh(rs.getString("ass_resp_rh")); + a.setAss_consolidacao(rs.getString("ass_consolidacao")); + a.setData_consolidacao(rs.getDate("data_consolidacao")); + a.setData_assinatura_seg(rs.getDate("data_assinatura_seg")); + a.setData_assinatura_rh(rs.getDate("data_assinatura_rh")); + a.setNome_resp_seg(rs.getString("nome_resp_seg")); + a.setNome_resp_rh(rs.getString("nome_resp_rh")); + a.setCorrecao(rs.getString("correcao")); + a.setObservacoes_correcao(rs.getString("observacoes_correcao")); + a.setEstado_antes_correcao( new Integer(rs.getInt("estado_antes_correcao"))); + a.setAss_superior(rs.getString("ass_superior")); + a.setNome_superior(rs.getString("nome_superior")); + a.setData_assinatura_superior(rs.getDate("data_assinatura_superior")); + a.setData_inicio_processo(rs.getDate("data_inicio_processo")); + a.setNome_resp_consolidacao(rs.getString("nome_resp_consolidacao")); + //System.out.println("ANALISE NR : " + a.getAnalise_nr()); + list.add(a); + }while(rs.next()); + dblocal.close(); + + + return list; + } + + public ArrayList searchTrabalhador(Integer empresa_id, Integer estabelecimento_id, String nrMecanografico, String nome) throws Exception + { + ArrayList list = new ArrayList(); + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql = ""; + + + // trabalhadores do estabelecimento + if(nrMecanografico != null) + { + if(nome != null) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id; + } + } + else + { + if(nome != null) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id = " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id; + } + } + + System.out.println("TRABALHADORES SQL B : " + sql); + ResultSet rslocal = stlocal.executeQuery(sql); + if(rslocal.isBeforeFirst()) + { + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId(new Integer(rslocal.getInt(1))); //id + String nome_trab = rslocal.getString(2); + t.setNome(utils.Utils.unicodeToHTML(nome_trab)); + t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); + t.setNumero_mecanografico(rslocal.getString("numero_mecanografico")); + t.setEstabelecimento_id(new Integer( rslocal.getInt(7) )); + //if(nome != null) + //{ + t.setEstabelecimento(utils.Utils.unicodeToHTML(rslocal.getString(8))); + //} + + list.add(t); + }while(rslocal.next()); + } + + + //restantes trabalhadores + + if(nrMecanografico != null) + { + if(nome != null) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND (trabalhadores.nome LIKE '%" + nome + "%' OR LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id; + } + } + else + { + if(nome != null) + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND estabelecimento_id <> " + estabelecimento_id + " AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id; + } + } + + +// if(nrMecanografico != null) +// { +// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; +// } +// else if(nome != null) +// { +// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; +// } + System.out.println("TRABALHADORES SQL : " + sql); + rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId(new Integer(rslocal.getInt(1))); //id + String nome_trab = rslocal.getString(2); + t.setNome(utils.Utils.unicodeToHTML(nome_trab)); + t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); + t.setNumero_mecanografico(rslocal.getString("numero_mecanografico")); + t.setEstabelecimento_id(new Integer( rslocal.getInt(7) )); + //if(nome != null) + //{ + t.setEstabelecimento(utils.Utils.unicodeToHTML(rslocal.getString(8))); + //} + + list.add(t); + }while(rslocal.next()); + dblocal.close(); + return list; + } + + public ArrayList searchTrabalhador(Integer empresa_id, String nrMecanografico, String nome) throws Exception + { + ArrayList list = new ArrayList(); + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql = ""; + + StringTokenizer st = null; + + if(nrMecanografico != null) + { + if(nome != null) + { + String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; + String sql2 = ""; + String sql3 = ") AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id; + st = new StringTokenizer (nome); + int n = 0; + while (st.hasMoreTokens ()) { + if(n > 0) + { + sql2 += "AND "; + } + sql2 += "trabalhadores.nome LIKE '%" + st.nextToken () + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND (trabalhadores.nome LIKE '%" + nome + "%' AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%') AND estabelecimentos.empresa_id = " + empresa_id; + } + else + { + sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND LOWER(numero_mecanografico) LIKE '%" + nrMecanografico.toLowerCase() + "%' AND estabelecimentos.empresa_id = " + empresa_id; + } + } + else + { + if(nome != null) + { + //sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%' AND estabelecimentos.empresa_id = " + empresa_id; + String sql1 = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.id, estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND ("; + String sql2 = ""; + String sql3 = ") AND estabelecimentos.empresa_id = " + empresa_id; + st = new StringTokenizer (nome); + int n = 0; + while (st.hasMoreTokens ()) { + if(n > 0) + { + sql2 += "AND "; + } + sql2 += "trabalhadores.nome LIKE '%" + st.nextToken () + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + + } + } + + System.out.println("TRABALHADORES SQL A : " + sql); +// if(nrMecanografico != null) +// { +// sql = "SELECT * FROM trabalhadores WHERE LOWER(numero_mecanografico) = '" + nrMecanografico.toLowerCase() + "'"; +// } +// else if(nome != null) +// { +// sql = "SELECT trabalhadores.id, trabalhadores.nome, data_nascimento, funcao_proposta, data_admissao, numero_mecanografico , estabelecimentos.nome FROM trabalhadores, estabelecimentos WHERE estabelecimento_id = estabelecimentos.id AND trabalhadores.nome LIKE '%" + nome + "%'"; +// } + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + Trabalhador t = new Trabalhador(); + t.setId(new Integer(rslocal.getInt(1))); //id + String nome_trab = rslocal.getString(2); + t.setNome(utils.Utils.unicodeToHTML(nome_trab)); + t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); + t.setNumero_mecanografico(rslocal.getString("numero_mecanografico")); + t.setEstabelecimento_id(new Integer( rslocal.getInt(7) )); + //if(nome != null) + //{ + t.setEstabelecimento(utils.Utils.unicodeToHTML(rslocal.getString(8))); + //} + + list.add(t); + }while(rslocal.next()); + dblocal.close(); + return list; + } + + public ArrayList getTrabalhadoresListByEstabelecimento(Integer estabelecimento_id) throws Exception + { + Utils utils = new Utils(); + ArrayList list = new ArrayList(); + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT * FROM trabalhadores WHERE estabelecimento_id = " + estabelecimento_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + int nr = 0; + do + { + Trabalhador t = new Trabalhador(); + t.setId(new Integer(rslocal.getInt("id"))); + String nome = rslocal.getString("nome"); + t.setNome(utils.unicodeToHTML(nome)); + t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); + list.add(t); + }while(rslocal.next()); + dblocal.close(); + + return list; + } + + public Trabalhador getTrabalhador(Integer id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT * FROM trabalhadores WHERE id = " + id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + Trabalhador t = new Trabalhador(); + t.setId(new Integer(rslocal.getInt("id"))); + t.setNome(rslocal.getString("nome")); + t.setData_nascimento(rslocal.getDate("data_nascimento")); + t.setFuncao(rslocal.getString("funcao_proposta")); + t.setData_admissao(rslocal.getDate("data_admissao")); + dblocal.close(); + return t; + } + + public Acidentado getAcidentado(Integer acidentado_id) throws Exception + { + Strings strings = new Strings(); + Acidentado a = new Acidentado(); + Statement st = createStatement(); + String sql ="SELECT * FROM acidentados WHERE id = " + acidentado_id; + ResultSet rs = st.executeQuery(sql); + rs.first(); + a.setId(new Integer(rs.getInt("id"))); + a.setNome(rs.getString("nome")); + a.setData_nascimento(rs.getDate("data_nascimento")); + a.setBilhete_identidade(rs.getString("bilhete_identidade")); + a.setMorada(rs.getString("morada")); + a.setCod_postal(rs.getString("cod_postal")); + a.setLocalidade(rs.getString("localidade")); + a.setContacto_telefonico(rs.getString("contacto_telefonico")); + a.setData_admissao(rs.getDate("data_admissao")); + a.setTurno(rs.getString("turno")); + String funcao = rs.getString("funcao"); + a.setFuncao(utils.Utils.unicodeToHTML(funcao)); + a.setTrabalhador_id(new Integer(rs.getInt("trabalhador_id"))); + a.setNumero_mecanografico(rs.getString("numero_mecanografico")); + a.setNome_superior_hierarquico(rs.getString("nome_superior_hierarquico")); + a.setEmail_superior_hierarquico(rs.getString("email_superior_hierarquico")); + a.setEstabelecimento_origem(rs.getString("estabelecimento_origem")); + a.setData_email_superior_hierarquico(rs.getDate("data_email_superior_hierarquico")); + //a.setAnalise_acidente_id(new Integer("analise_acidente_id")); + return a; + } + + public String getEmpresaNome(Integer empresa_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT designacao_social FROM empresas WHERE id = " + empresa_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String nome = rslocal.getString("designacao_social"); + dblocal.close(); + return nome; + } + + + + public String getEstabelecimentoNome(Integer estabelecimento_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT nome FROM estabelecimentos WHERE id = " + estabelecimento_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String nome = rslocal.getString("nome"); + dblocal.close(); + return Utils.unicodeToHTML(nome); + } + + public String getMedicoNome(Integer medico_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT nome FROM medicos WHERE id = " + medico_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String nome = rslocal.getString("nome"); + dblocal.close(); + return Utils.unicodeToHTML(nome); + } + + public Medico getMedico(Integer id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT * FROM medicos WHERE id = " + id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + Medico m = new Medico(); + m.setId(new Integer( rslocal.getInt("id") )); + m.setNome(rslocal.getString("nome")); + m.setNumero_cedula(rslocal.getString("numero_cedula")); + dblocal.close(); + return m; + } + + public String getTecnicoSaudeNome(Integer tecnico_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT nome FROM marcacoes_tecnicos_hst WHERE id = " + tecnico_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String nome = rslocal.getString("nome"); + dblocal.close(); + return nome; + } + + + public Integer getMaxAcidentadoId() + { + Statement st = createStatement(); + String sql = "SELECT max(acidentados.id)+1 AS MAXACIDENTADOID FROM acidentados"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXACIDENTADOID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + public Integer createAcidentado(Acidentado a) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxAcidentadoId(); + String sql = "INSERT INTO acidentados (id, nome, data_nascimento, bilhete_identidade, morada, cod_postal, localidade, contacto_telefonico, data_admissao, turno, funcao, trabalhador_id, numero_mecanografico, nome_superior_hierarquico, email_superior_hierarquico, estabelecimento_origem, data_email_superior_hierarquico) VALUES ("; + sql += newId + ", '"; + sql += a.getNome() + "', "; + if(a.getData_nascimento() == null) + { + sql += null + ", '"; + } + else + { + sql += "'" + a.getData_nascimento() + "', '"; + } + //sql += a.getData_nascimento() + "', '"; + sql += a.getBilhete_identidade() + "', '"; + sql += a.getMorada() + "', '"; + sql += a.getCod_postal() + "', '"; + sql += a.getLocalidade() + "', '"; + sql += a.getContacto_telefonico() + "', "; + if(a.getData_admissao() == null) + { + sql += null + ", '"; + } + else + { + sql += "'" + a.getData_admissao() + "', '"; + } +// sql += a.getData_admissao() + "', '"; + sql += a.getTurno() + "', '"; + sql += a.getFuncao() + "', "; + sql += a.getTrabalhador_id() + ", '"; + sql += a.getNumero_mecanografico() + "', '"; + sql += a.getNome_superior_hierarquico() + "', '"; + sql += a.getEmail_superior_hierarquico() + "', '"; + sql += a.getEstabelecimento_origem() + "', "; + if(a.getData_email_superior_hierarquico() == null) + { + sql += null + ")"; + } + else + { + sql += "'" + a.getData_email_superior_hierarquico() + "')"; + } + //sql += a.getAnalise_acidente_id() + ")"; + System.out.println("SQL ACIDENTADO : " + sql); + st.execute(sql); + + return newId; + } + + public void updateAcidentado(Acidentado a) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE acidentados SET nome = '" + a.getNome() + "', "; + if(a.getData_nascimento() == null) + { + sql += "data_nascimento = " + null + ", "; + } + else + { + sql += "data_nascimento = '" + a.getData_nascimento() + "', "; + } +// sql += "data_nascimento = '" + a.getData_nascimento() + "', "; + sql += "bilhete_identidade = '" + a.getBilhete_identidade() + "', "; + sql += "morada = '" + a.getMorada() + "', "; + sql += "cod_postal = '" + a.getCod_postal() + "', "; + sql += "localidade = '" + a.getLocalidade() + "', "; + sql += "contacto_telefonico = '" + a.getContacto_telefonico() + "', "; + if(a.getData_admissao() == null) + { + sql += "data_admissao = " + null + ", "; + } + else + { + sql += "data_admissao = '" + a.getData_admissao() + "', "; + } +// sql += "data_admissao = '" + a.getData_admissao() + "', "; + sql += "turno = '" + a.getTurno() + "', "; + sql += "funcao = '" + a.getFuncao() + "', "; + sql += "trabalhador_id = " + a.getTrabalhador_id() + ", "; + sql += "numero_mecanografico = '" + a.getNumero_mecanografico() + "', "; + sql += "nome_superior_hierarquico = '" + a.getNome_superior_hierarquico() + "', "; + sql += "email_superior_hierarquico = '" + a.getEmail_superior_hierarquico() + "', "; + sql += "estabelecimento_origem = '" + a.getEstabelecimento_origem() + "', "; + if(a.getData_email_superior_hierarquico() == null) + { + sql += "data_email_superior_hierarquico = " + null + " "; + } + else + { + sql += "data_email_superior_hierarquico = '" + a.getData_email_superior_hierarquico() + "' "; + } + //sql += "analise_acidente_id = '" + a.getAnalise_acidente_id() + " "; + sql += "WHERE id = " + a.getId(); + System.out.println("SQL UPDATE ACIDENTADO : " + sql); + st.execute(sql); + } + + public Integer getMaxAnaliseId() + { + Statement st = createStatement(); + String sql = "SELECT max(analises_acidentes.id)+1 AS MAXANALISEID FROM analises_acidentes"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXANALISEID")); + if(newId.intValue() == 0 ) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + + public AnaliseAcidente createAnalise(AnaliseAcidente a) throws Exception + { + Controle c = getControle(); + Statement st = createStatement(); + Integer newId = getMaxAnaliseId(); + + //calc analise_nr + java.util.Date now = new java.util.Date(); + Calendar cal = new GregorianCalendar(); + cal.setTime(now); + int ano = cal.get(Calendar.YEAR); + if(c.getAnalise_year().intValue() != ano) + { + c.setAnalise_year(new Integer(ano)); + c.setLast_analise_nr(new Integer(0)); + } + //String seq_str = new Integer(10000 + newId.intValue()).toString(); + int i_analise_nr = c.getLast_analise_nr().intValue() + 1; + c.setLast_analise_nr(new Integer(i_analise_nr)); + updateControle(c); + String seq_str = new Integer(10000 + i_analise_nr).toString(); + String ano_str = new Integer(ano).toString(); + String analise_nr = ano_str.substring(2) + "/" + seq_str.substring(1); + a.setAnalise_nr(analise_nr); + a.setId(newId); + + String sql = "INSERT INTO analises_acidentes (id, averiguador, data_acidente, acidentado_id, estado, empresa_id, estabelecimento_id, horas_turno, departamento_id, seccao_id, local_trabalho, tarefa, substancias, condicoes, testemunhas, causas, descricao, conclusoes, accoes, hora_acidente, medico_id, tecnico_saude_id, averiguacao_posterior, averiguacao_obs, data_inicio_processo, analise_nr, coef_incapacidade) VALUES ("; + sql += newId + ", '"; + sql += a.getAveriguador() + "', '"; + sql += a.getData_acidente() + "', "; + sql += a.getAcidentado_id() + ", "; + sql += a.getEstado() + ", "; + sql += a.getEmpresa_id() + ", "; + sql += a.getEstabelecimento_id() + ", "; + sql += a.getHoras_turno() + ", "; + sql += a.getDepartamento_id() + ", "; + sql += a.getSeccao_id() + ", '"; + sql += a.getLocal_trabalho() + "', '"; + sql += a.getTarefa() + "', '"; + sql += a.getSubstancias() + "', '"; +// sql += a.getSuperior_hierarquico() + "', '"; + sql += a.getCondicoes() + "', '"; + sql += a.getTestemunhas() + "', "; + sql += a.getCausas() + ", '"; + sql += a.getDescricao() + "', '"; + sql += a.getConclusoes() + "', '"; + sql += a.getAccoes() + "', "; + if(a.getHora_acidente() == null) + { + sql += null + ", "; + } + else + { + sql += "'" + a.getHora_acidente() + "', "; + } + + sql += a.getMedico_id() + ", "; + sql += a.getTecnico_saude_id() + ", '"; + sql += a.getAveriguacao_posterior() + "', '"; + sql += a.getAveriguacao_obs() + "', "; + if(a.getData_inicio_processo() == null) + { + sql += null + ", "; + } + else + { + sql += "'" + a.getData_inicio_processo() + "', '"; + } + + sql += analise_nr + "', "; + sql += null + ")"; +// sql += a.getFormacao_shst() + "', '"; +// sql += a.getFormacao_shst_nao_porque() + "', '"; +// sql += a.getOutros_acidentes_com_colaborador() + "', "; +// sql += a.getNr_acidentes_com_colaborador() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador1() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador2() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador3() + ", "; +// sql += a.getNr_relatorio_acidente_colaborador4() + ", '"; +// sql += a.getAcidentes_outros_colaboradores()+ "', "; +// sql += a.getNr_acidentes_outros_colaboradores()+ ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores1() + ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores2() + ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores3() + ", "; +// sql += a.getNr_relatorio_acidente_outros_colaboradores4() + ")"; + System.out.println("SQL : " + sql); + st.execute(sql); + + return a; + } + + public void updateAnalise(AnaliseAcidente a) throws Exception + { + if(a.getEspecif1().matches("null")) + { + a.setEspecif1(""); + } + if(a.getEspecif2().matches("null")) + { + a.setEspecif2(""); + } + if(a.getEspecif3().matches("null")) + { + a.setEspecif3(""); + } + if(a.getEspecif4().matches("null")) + { + a.setEspecif4(""); + } + if(a.getRestricao_outras().matches("null")) + { + a.setRestricao_outras(""); + } + if(a.getTipo_lesao().matches("null")) + { + a.setTipo_lesao(""); + } + if(a.getMed_observ().matches("null")) + { + a.setMed_observ(""); + } + if(a.getFormacao_shst_nao_porque().matches("null")) + { + a.setFormacao_shst_nao_porque(""); + } + Statement st = createStatement(); + String sql = "UPDATE analises_acidentes SET data_acidente = '" + a.getData_acidente() + "', "; + sql += "acidentado_id = " + a.getAcidentado_id() + ", "; + sql += "estado = " + a.getEstado() + ", "; + sql += "empresa_id = " + a.getEmpresa_id() + ", "; + sql += "estabelecimento_id = " + a.getEstabelecimento_id() + ", "; + sql += "horas_turno = " + a.getHoras_turno() + ", "; + sql += "departamento_id = " + a.getDepartamento_id() + ", "; + sql += "seccao_id = " + a.getSeccao_id() + ", "; + sql += "local_trabalho = '" + a.getLocal_trabalho() + "', "; + sql += "tarefa = '" + a.getTarefa() + "', "; + sql += "substancias = '" + a.getSubstancias() + "', "; +// sql += "superior_hierarquico = '" + a.getSuperior_hierarquico() + "', "; + sql += "condicoes = '" + a.getCondicoes() + "', "; + sql += "testemunhas = '" + a.getTestemunhas() + "', "; + sql += "causas = " + a.getCausas() + ", "; + sql += "descricao = '" + a.getDescricao() + "', "; + sql += "conclusoes = '" + a.getConclusoes() + "', "; + sql += "accoes = '" + a.getAccoes() + "', "; + sql += "averiguador = '" + a.getAveriguador() + "', "; + if(a.getHora_acidente() == null) + { + sql += "hora_acidente = " + null + ", "; + } + else + { + sql += "hora_acidente = '" + a.getHora_acidente() + "', "; + } + + sql += "formacao_shst = '" + a.getFormacao_shst() + "', "; + sql += "formacao_shst_nao_porque = '" + a.getFormacao_shst_nao_porque() + "', "; + sql += "outros_acidentes_com_colaborador = '" + a.getOutros_acidentes_com_colaborador() + "', "; + sql += "nr_acidentes_com_colaborador = " + a.getNr_acidentes_com_colaborador() + ", "; + sql += "nr_relatorio_acidente_colaborador1 = " + a.getNr_relatorio_acidente_colaborador1() + ", "; + sql += "nr_relatorio_acidente_colaborador2 = " + a.getNr_relatorio_acidente_colaborador2() + ", "; + sql += "nr_relatorio_acidente_colaborador3 = " + a.getNr_relatorio_acidente_colaborador3() + ", "; + sql += "nr_relatorio_acidente_colaborador4 = " + a.getNr_relatorio_acidente_colaborador4() + ", "; + sql += "acidentes_outros_colaboradores = '" + a.getAcidentes_outros_colaboradores() + "', "; + sql += "nr_acidentes_outros_colaboradores = " + a.getNr_acidentes_outros_colaboradores() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores1 = " + a.getNr_relatorio_acidente_outros_colaboradores1() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores2 = " + a.getNr_relatorio_acidente_outros_colaboradores2() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores3 = " + a.getNr_relatorio_acidente_outros_colaboradores3() + ", "; + sql += "nr_relatorio_acidente_outros_colaboradores4 = " + a.getNr_relatorio_acidente_outros_colaboradores4() + ", "; + sql += "lesao_cabeca = '" + a.getLesao_cabeca() + "', "; + sql += "lesao_pescoco = '" + a.getLesao_pescoco() + "', "; + sql += "lesao_tronco = '" + a.getLesao_tronco() + "', "; + sql += "lesao_membro_sup_dir = '" + a.getLesao_membro_sup_dir() + "', "; + sql += "lesao_membro_sup_esq = '" + a.getLesao_membro_sup_esq() + "', "; + sql += "lesao_membro_inf_dir = '" + a.getLesao_membro_inf_dir() + "', "; + sql += "lesao_membro_inf_esq = '" + a.getLesao_membro_inf_esq() + "', "; + sql += "especif1 = '" + a.getEspecif1() + "', "; + sql += "especif2 = '" + a.getEspecif2() + "', "; + sql += "especif3 = '" + a.getEspecif3() + "', "; + sql += "especif4 = '" + a.getEspecif4() + "', "; + sql += "tipo_lesao = '" + a.getTipo_lesao() + "', "; + sql += "tipo_incapacidade = '" + a.getTipo_incapacidade() + "', "; + sql += "coef_incapacidade = " + a.getCoef_incapacidade() + ", "; + if(a.getData_aval_incapacidade() == null) + { + sql += "data_aval_incapacidade = " + null + ", "; + } + else + { + sql += "data_aval_incapacidade = '" + a.getData_aval_incapacidade() + "', "; + } + if(a.getData_rev_incapacidade() == null) + { + sql += "data_rev_incapacidade = " + null + ", "; + } + else + { + sql += "data_rev_incapacidade = '" + a.getData_rev_incapacidade() + "', "; + } + if(a.getPeriodo_incapacidade_de() == null) + { + sql += "periodo_incapacidade_de = " + null + ", "; + } + else + { + sql += "periodo_incapacidade_de = '" + a.getPeriodo_incapacidade_de() + "', "; + } + if(a.getPeriodo_incapacidade_a() == null) + { + sql += "periodo_incapacidade_a = " + null + ", "; + } + else + { + sql += "periodo_incapacidade_a = '" + a.getPeriodo_incapacidade_a() + "', "; + } + sql += "img_flexao = '" + a.getImg_flexao() + "', "; + sql += "img_ext1 = '" + a.getImg_ext1() + "', "; + sql += "img_ext2 = '" + a.getImg_ext2() + "', "; + sql += "img_cab2 = '" + a.getImg_cab2() + "', "; + sql += "img_cab3 = '" + a.getImg_cab3() + "', "; + sql += "img_ma2 = '" + a.getImg_ma2() + "', "; + sql += "img_ma3 = '" + a.getImg_ma3() + "', "; + sql += "img_ma5 = '" + a.getImg_ma5() + "', "; + sql += "img_ma6 = '" + a.getImg_ma6() + "', "; + sql += "img_ma8 = '" + a.getImg_ma8() + "', "; + sql += "img_ma10 = '" + a.getImg_ma10() + "', "; + sql += "img_rot1 = '" + a.getImg_rot1() + "', "; + sql += "img_rot2 = '" + a.getImg_rot2() + "', "; + sql += "img_cab1 = '" + a.getImg_cab1() + "', "; + sql += "img_cab4 = '" + a.getImg_cab4() + "', "; + sql += "img_ma1 = '" + a.getImg_ma1() + "', "; + sql += "img_ma4 = '" + a.getImg_ma4() + "', "; + sql += "img_ma7 = '" + a.getImg_ma7() + "', "; + sql += "img_ma9 = '" + a.getImg_ma9() + "', "; + sql += "restricao_carga = " + a.getRestricao_carga() + ", "; + sql += "restricao_motricidade = '" + a.getRestricao_motricidade() + "', "; + sql += "restricao_conducao = '" + a.getRestricao_conducao() + "', "; + sql += "restricao_vibracoes = '" + a.getRestricao_vibracoes() + "', "; + sql += "restricao_outras = '" + a.getRestricao_outras() + "', "; + sql += "med_observ = '" + a.getMed_observ() + "', "; + sql += "estado_assinatura = " + a.getEstado_assinatura() + ", "; + sql += "tecnico_saude_id = " + a.getTecnico_saude_id() + ", "; + sql += "medico_id = " + a.getMedico_id() + ", "; + sql += "ass_consolidacao = '" + a.getAss_consolidacao() + "', "; + sql += "ass_resp_seg = '" + a.getAss_resp_seg() + "', "; + sql += "ass_resp_rh = '" + a.getAss_resp_rh() + "', "; + if(a.getData_consolidacao() == null) + { + sql += "data_consolidacao = " + null + ", "; + } + else + { + sql += "data_consolidacao = '" + a.getData_consolidacao() + "', "; + } + if(a.getData_assinatura_seg() == null) + { + sql += "data_assinatura_seg = " + null + ", "; + } + else + { + sql += "data_assinatura_seg = '" + a.getData_consolidacao() + "', "; + } + if(a.getData_assinatura_rh() == null) + { + sql += "data_assinatura_rh = " + null + ", "; + } + else + { + sql += "data_assinatura_rh = '" + a.getData_consolidacao() + "', "; + } + sql += "nome_resp_seg = '" + a.getNome_resp_seg() + "', "; + sql += "nome_resp_rh = '" + a.getNome_resp_rh() + "', "; + sql += "correcao = '" + a.getCorrecao() + "', "; + sql += "observacoes_correcao = '" + a.getObservacoes_correcao() + "', "; + sql += "estado_antes_correcao = " + a.getEstado_antes_correcao() + ", "; + sql += "ass_superior = '" + a.getAss_superior() + "', "; + sql += "nome_superior = '" + a.getNome_superior() + "', "; + sql += "averiguacao_posterior = '" + a.getAveriguacao_posterior() + "', "; + sql += "averiguacao_obs = '" + a.getAveriguacao_obs() + "', "; + sql += "nome_resp_consolidacao = '" + a.getNome_resp_consolidacao() + "', "; + if(a.getData_assinatura_superior() == null) + { + sql += "data_assinatura_superior = " + null + " "; + } + else + { + sql += "data_assinatura_superior = '" + a.getData_assinatura_superior() + "' "; + } + sql += "WHERE id = " + a.getId(); + System.out.println("SQL UPDATE : " + sql); + st.execute(sql); + } + + public void changeEstado(Correcao c) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE analises_acidentes SET correcao = '" + c.getCorrecao() + "', estado = " + c.getEstado_corr() + ", estado_antes_correcao = " + c.getEstado_actual() + ", observacoes_correcao = '" + c.getObservacoes() + "' WHERE id = " + c.getAnalise_id(); + st.execute(sql); + } + + public Integer getMaxRecomendacaoId() + { + Statement st = createStatement(); + String sql = "SELECT max(recomendacoes.id)+1 AS MAXRECOMENDACAOID FROM recomendacoes"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXRECOMENDACAOID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + public Integer createRecomendacao(Recomendacao r) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxRecomendacaoId(); + String sql = "INSERT INTO recomendacoes (id, analise_id, recomendacao) VALUES ("; + sql += newId + ", "; + sql += r.getAnalise_id() + ", '"; + sql += r.getRecomendacao() + "')"; + st.execute(sql); + + return newId; + } + + public void updateRecomendacao(Recomendacao r) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE recomendacoes SET analise_id = " + r.getAnalise_id() + ", "; + sql += "recomendacao = '" + r.getRecomendacao() + "' "; + sql += "WHERE id = " + r.getId(); + //System.out.println("SQL : " + sql); + st.execute(sql); + } + + public void deleteRecomendacoesByAnalise(Integer analise_id) throws Exception + { + Statement st = createStatement(); + String sql = "DELETE FROM recomendacoes WHERE analise_id = " + analise_id; + st.execute(sql); + } + + public ArrayList getRecomendacoesByAnalise(Integer analiseId) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM recomendacoes WHERE analise_id = " + analiseId; + //System.out.println("SQL : " + sql); + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Recomendacao r = new Recomendacao(); + r.setId(new Integer(rs.getInt("id"))); + r.setAnalise_id(new Integer(rs.getInt("analise_id"))); + r.setRecomendacao(rs.getString("recomendacao")); + list.add(r); + }while(rs.next()); + return list; + } + + public Integer getMaxMedidaId() + { + Statement st = createStatement(); + String sql = "SELECT max(medidas.id)+1 AS MAXMEDIDAID FROM medidas"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXMEDIDAID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + return new Integer(1); + } + } + + public Integer createMedida(Medida m) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxMedidaId(); + String sql = "INSERT INTO medidas (id, analise_id, medida) VALUES ("; + sql += newId + ", "; + sql += m.getAnalise_id() + ", '"; + sql += m.getMedida() + "')"; + st.execute(sql); + + return newId; + } + + public void updateMedida(Medida m) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE medidas SET analise_id = " + m.getAnalise_id() + ", "; + sql += "medida = '" + m.getMedida() + "' "; + sql += "WHERE id = " + m.getId(); + //System.out.println("SQL : " + sql); + st.execute(sql); + } + + public void deleteMedidasByAnalise(Integer analise_id) throws Exception + { + Statement st = createStatement(); + String sql = "DELETE FROM medidas WHERE analise_id = " + analise_id; + st.execute(sql); + } + + public ArrayList getMedidasByAnalise(Integer analiseId) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = "SELECT * FROM medidas WHERE analise_id = " + analiseId; + //System.out.println("SQL : " + sql); + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Medida m = new Medida(); + m.setId(new Integer(rs.getInt("id"))); + m.setAnalise_id(new Integer(rs.getInt("analise_id"))); + m.setMedida(rs.getString("medida")); + list.add(m); + }while(rs.next()); + return list; + } + + + + public String getNumeroCedula(Integer medico_id) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + String sql ="SELECT numero_cedula FROM medicos WHERE id = " + medico_id; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + String numero_cedula = rslocal.getString("numero_cedula"); + dblocal.close(); + return numero_cedula; + } + + public String getTipoDescricao(Integer tipo) throws Exception + { + Statement st = createStatement(); + String sql = "SELECT descricao FROM tipos_utilizadores WHERE tipo = " + tipo; + ResultSet rs = st.executeQuery(sql); + rs.first(); + String descricao = rs.getString("descricao"); + return descricao; + } + + public com.sun.rave.web.ui.model.Option[] getTiposList() throws Exception + { + ArrayList list = new ArrayList(); + TipoUtilizador t = new TipoUtilizador(); + t.setId(new Integer(0)); + t.setTipo(new Integer(0)); + t.setDescricao(""); + list.add(t); + Statement st = createStatement(); + String sql ="SELECT * FROM tipos_utilizadores WHERE activo = 'y' ORDER BY ordem"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + t = new TipoUtilizador(); + t.setId(new Integer(rs.getInt("id"))); + t.setTipo(new Integer(rs.getInt("tipo"))); + t.setDescricao(rs.getString("descricao")); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add(t); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TipoUtilizador) iter.next(); + + listOptions[i] = new Option(t.getTipo(), t.getDescricao()); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTiposList(Integer permissao) throws Exception + { + ArrayList list = new ArrayList(); + TipoUtilizador t = new TipoUtilizador(); + t.setId(new Integer(0)); + t.setTipo(new Integer(0)); + t.setDescricao(""); + list.add(t); + Statement st = createStatement(); + String sql ="SELECT * FROM tipos_utilizadores WHERE activo = 'y' ORDER BY ordem"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + t = new TipoUtilizador(); + if(permissao.intValue() == 7) //director rh + { + t.setTipo(new Integer(rs.getInt("tipo"))); + if(t.getTipo().intValue() == 1 || t.getTipo().intValue() == 2 || t.getTipo().intValue() == 6) // seguranca || rh || gestor + { + t.setId(new Integer(rs.getInt("id"))); + t.setDescricao(rs.getString("descricao")); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add(t); + } + } + else + { + t.setId(new Integer(rs.getInt("id"))); + t.setTipo(new Integer(rs.getInt("tipo"))); + t.setDescricao(rs.getString("descricao")); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add(t); + } + + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TipoUtilizador) iter.next(); + + listOptions[i] = new Option(t.getTipo(), t.getDescricao()); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getEstabelecimentosList(Integer empresa_id, Boolean booGestor) throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + ArrayList list = new ArrayList(); + Estabelecimento e = new Estabelecimento(); + e.setId(new Integer(-1)); + + e.setNome_plain("-Seleccionar-"); + + list.add(e); + if(booGestor.equals(new Boolean(true))) + { + e = new Estabelecimento(); + e.setId(new Integer(0)); + e.setNome_plain("-Todos os estabelecimentos-"); + list.add(e); + } + String sql ="SELECT * FROM estabelecimentos WHERE empresa_id = " + empresa_id + " AND inactivo = 'n' ORDER BY nome_plain"; + + + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + e = new Estabelecimento(); + e.setId(new Integer(rslocal.getInt("id"))); + //e.setNome_plain(rslocal.getString("nome_plain")); + e.setNome(rslocal.getString("nome")); + //t.setActivo(rs.getString("activo")); + //t.setOrdem(new Integer(rs.getInt("ordem"))); + list.add(e); + }while(rslocal.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + e = (Estabelecimento) iter.next(); + + listOptions[i] = new Option(e.getId(), Utils.unicodeToHTML(e.getNome())); + i++; + } + dblocal.close(); + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + ArrayList list = new ArrayList(); + Medico m = new Medico(); + m.setId(new Integer(0)); + m.setNome("-Seleccionar-"); + list.add(m); + String sql ="SELECT * FROM medicos WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + m = new Medico(); + m.setId(new Integer(rslocal.getInt("id"))); + m.setNome(rslocal.getString("nome")); + list.add(m); + }while(rslocal.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + m = (Medico) iter.next(); + + listOptions[i] = new Option(m.getId(), Utils.unicodeToHTML(m.getNome())); + i++; + } + dblocal.close(); + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception + { + Dblocal dblocal = new Dblocal(); + dblocal.connect(); + Statement stlocal = dblocal.createStatement(); + ArrayList list = new ArrayList(); + TecnicoSaude t = new TecnicoSaude(); + t.setId(new Integer(0)); + t.setNome("-Seleccionar-"); + list.add(t); + String sql ="SELECT * FROM marcacoes_tecnicos_hst WHERE inactivo = 'n'"; + ResultSet rslocal = stlocal.executeQuery(sql); + rslocal.first(); + do + { + t = new TecnicoSaude(); + t.setId(new Integer(rslocal.getInt("id"))); + t.setNome(rslocal.getString("nome")); + list.add(t); + }while(rslocal.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TecnicoSaude) iter.next(); + + listOptions[i] = new Option(t.getId(), Utils.unicodeToHTML(t.getNome())); + i++; + } + dblocal.close(); + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getCausasList() throws Exception + { + ArrayList list = new ArrayList(); + Causa c = new Causa(); + c.setId(new Integer(0)); + c.setCausa("-Seleccionar-"); + list.add(c); + Statement st = createStatement(); + String sql = "SELECT * FROM causas WHERE activa = 'y'"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + c = new Causa(); + c.setId( new Integer(rs.getInt("id")) ); + c.setCausa(rs.getString("causa")); + list.add(c); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + c = (Causa) iter.next(); + + listOptions[i] = new Option(c.getId(), c.getCausa()); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getDepartamentosList() throws Exception + { + ArrayList list = new ArrayList(); + Departamento d = new Departamento(); + + d.setId(new Integer(0)); + d.setDescricao("-Todos-"); + list.add(d); + Statement st = createStatement(); + String sql = "SELECT * FROM departamentos WHERE activo = 'y'"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + d = new Departamento(); + d.setId( new Integer(rs.getInt("id")) ); + d.setDescricao(rs.getString("descricao")); + list.add(d); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + d = (Departamento) iter.next(); + + listOptions[i] = new Option(d.getId(), d.getDescricao()); + i++; + } + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getSeccoesList(Integer departamento_id) throws Exception + { + ArrayList list = new ArrayList(); + Seccao s = new Seccao(); + + s.setId(new Integer(0)); + s.setDescricao("-Seleccionar-"); + list.add(s); + Statement st = createStatement(); + String sql = ""; + if(departamento_id == null) // todos + { + sql = "SELECT * FROM seccoes WHERE activo = 'y'"; + } + else + { + sql = "SELECT * FROM seccoes WHERE activo = 'y' AND departamento_id = " + departamento_id; + } + + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + s = new Seccao(); + s.setId( new Integer(rs.getInt("id")) ); + s.setDescricao(rs.getString("descricao")); + s.setDepartamento_id( new Integer(rs.getInt("departamento_id")) ); + list.add(s); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + s = (Seccao) iter.next(); + + listOptions[i] = new Option(s.getId(), s.getDescricao()); + i++; + } + return listOptions; + } + + + + public Causa getCausa(Integer id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM causas WHERE id = " + id; + + ResultSet rs = st.executeQuery(sql); + rs.first(); + Causa c = new Causa(); + c.setId( new Integer(rs.getInt("id")) ); + c.setCausa(rs.getString("causa")); + return c; + } + + public Seccao getSeccao(Integer id) throws Exception + { + Statement st = createStatement(); + String sql = null; + + sql ="SELECT * FROM seccoes WHERE id = " + id + " AND activo = 'y'"; + + ResultSet rs = st.executeQuery(sql); + rs.first(); + Seccao s = new Seccao(); + s.setId( new Integer(rs.getInt("id")) ); + s.setDescricao(rs.getString("descricao")); + return s; + } + + public ArrayList getAnosListFromAnalises() throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = null; + + sql ="select distinct extract(year from data_acidente) as ano from analises_acidentes where estado = 10 order by ano"; + + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Double dAno = new Double(rs.getDouble("ano")); + Integer iAno = new Integer(dAno.intValue()); + list.add(iAno); + }while(rs.next()); + return list; + } + + + + private String getFase(int estado) + { + if(estado == Global.ESTADO_SEG) + { + return "FASE 1 - SEG - ABERTURA"; + } + else if(estado == Global.ESTADO_RH1) + { + return "FASE 2 - RH - ACOMPANHAMENTO"; + } + else if(estado == Global.ESTADO_HS) + { + return "FASE 3 - SIPRP - RECOMENDAÇÕES"; + } + else if(estado == Global.ESTADO_RH2) + { + return "FASE 4 - RH - MEDIDAS + LESÃO"; + } +// else if(estado == Global.ESTADO_MEDICINA) +// { +// return "Medicina"; +// } + else if(estado == Global.ESTADO_CONSOLIDACAO) + { + return "FASE 5 - SIPRP - CONSOLIDAÇÃO"; + } +// else if(estado == Global.ESTADO_ASSINATURAS) +// { +// return "Verificação"; +// } +// else if(estado == Global.ESTADO_IMPRESSAO) +// { +// return "Impressão"; +// } + else if(estado == Global.ESTADO_ASSINATURA_SEG) + { + return "FASE 6 - SEG - VERIFICAÇÃO SEG."; + } + else if(estado == Global.ESTADO_ASSINATURA_RH) + { + return "FASE 7 - RH - VERIFICAÇÃO RH + IMPRESSÃO"; + } + else if(estado == Global.ESTADO_FECHAR) + { + return "FASE 8 - SIPRP - CONCLUSÃO"; + } + return null; + } + + private Statement createStatement() + { + Db db = new Db(); + return db.createStatement(); + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/AnalisesSeguimentoDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/AnalisesSeguimentoDataProvider.java new file mode 100644 index 00000000..a5f9052a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/AnalisesSeguimentoDataProvider.java @@ -0,0 +1,24 @@ +/* + * AnalisesSeguimentoDataProvider.java + * + * Created on September 20, 2007, 1:42 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class AnalisesSeguimentoDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of AnalisesSeguimentoDataProvider */ + public AnalisesSeguimentoDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/Db.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/Db.java new file mode 100644 index 00000000..0b7f0be7 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/Db.java @@ -0,0 +1,59 @@ +/* + * Db.java + * + * Created on September 19, 2007, 5:10 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import javax.faces.context.FacesContext; +import javax.servlet.http.HttpSession; + +/** + * + * @author lluis + */ +public class Db { + //String connectionURL = "jdbc:postgresql://storage:5432/siprp"; + String connectionURL = "jdbc:postgresql://localhost:5436/siprp"; + String User = "postgres"; + String Pass = null; + Connection connection = null; + + /** Creates a new instance of Db */ + public Db() { + } + + public Connection connect() throws Exception + { + Class.forName("org.postgresql.Driver").newInstance(); + connection = DriverManager.getConnection(connectionURL, User, Pass); + HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true); + session.setAttribute("connection", connection); + return connection; + } + + public Statement createStatement() + { + HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false); + connection = (Connection) session.getAttribute("connection"); + Statement st; + try + { + st = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + return st; + } + catch(Exception ex) + { + ex.printStackTrace(); + return null; + } + } +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/Dblocal.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/Dblocal.java new file mode 100644 index 00000000..dbb075f5 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/Dblocal.java @@ -0,0 +1,65 @@ +/* + * Dblocal.java + * + * Created on September 20, 2007, 2:07 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import javax.faces.context.FacesContext; +import javax.servlet.http.HttpSession; + +/** + * + * @author lluis + */ +public class Dblocal { + //String connectionURL = "jdbc:postgresql://storage:5432/siprp_local"; + String connectionURL = "jdbc:postgresql://localhost:5436/siprp_local_3"; + String User = "postgres"; + String Pass = null; + Connection connection = null; + + /** Creates a new instance of Dblocal */ + public Dblocal() { + } + + public Connection connect() throws Exception + { + Class.forName("org.postgresql.Driver").newInstance(); + connection = DriverManager.getConnection(connectionURL, User, Pass); + HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true); + session.setAttribute("connection_local", connection); + return connection; + } + + public Statement createStatement() + { + HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false); + connection = (Connection) session.getAttribute("connection_local"); + Statement st; + try + { + st = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + return st; + } + catch(Exception ex) + { + ex.printStackTrace(); + return null; + } + } + + public void close() throws Exception + { + connection.close(); + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/TrabalhadoresListDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/TrabalhadoresListDataProvider.java new file mode 100644 index 00000000..0edc8ae4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/TrabalhadoresListDataProvider.java @@ -0,0 +1,24 @@ +/* + * TrabalhadoresListDataProvider.java + * + * Created on September 26, 2007, 4:25 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db; + +import com.sun.data.provider.impl.ObjectListDataProvider; + +/** + * + * @author lluis + */ +public class TrabalhadoresListDataProvider extends ObjectListDataProvider { + + /** Creates a new instance of TrabalhadoresListDataProvider */ + public TrabalhadoresListDataProvider() { + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/db/UtilizadoresDataProvider.java b/trunk/AnaliseAcidentesTrabalho/src/java/db/UtilizadoresDataProvider.java new file mode 100644 index 00000000..e9e6411f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/db/UtilizadoresDataProvider.java @@ -0,0 +1,526 @@ +/* + * UtilizadoresDataProvider.java + * + * Created on September 20, 2007, 10:03 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package db; + +import analiseacidentestrabalho.Medico; +import analiseacidentestrabalho.Permissao; +import analiseacidentestrabalho.TecnicoSaude; +import analiseacidentestrabalho.Utilizador; +import com.sun.rave.web.ui.model.Option; +import global.Global; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.ListIterator; +import java.util.StringTokenizer; +import utils.Utils; + +/** + * + * @author lluis + */ +public class UtilizadoresDataProvider { + + /** Creates a new instance of UtilizadoresDataProvider */ + public UtilizadoresDataProvider() { + } + + public Integer getMaxUserId() + { + Statement st = createStatement(); + String sql = "SELECT max(utilizadores.id)+1 AS MAXUSERID FROM utilizadores"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXUSERID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + ex.printStackTrace(); + return new Integer(1); + } + } + + public Integer createNewUtilizador(Utilizador u) throws Exception + { + Statement st = createStatement(); + Integer newUserId = getMaxUserId(); + + String sql = "INSERT INTO utilizadores (id, login, password, data_password, email, empresa_id, estabelecimento_id, administrador, tipo, numero_cedula, cap, nome, medico_id, funcionario_hst_id, activo, responsavel_loja, gestor_geral, numero_mecanografico) VALUES ("; + sql += newUserId + ", '"; + sql += u.getLogin() + "', '"; + sql += u.getPassword() + "', "; + if(u.getData_password() == null) + { + sql += null + ", '"; + } + else + { + sql += "'" + u.getData_password() + "', '"; + } + sql += u.getEmail() + "', "; + sql += u.getEmpresa_id() + ", "; + sql += u.getEstabelecimento_id() + ", '"; + sql += u.getAdministrador() + "', "; + sql += u.getTipo() + ", '"; + sql += u.getNumero_cedula() + "', '"; + sql += u.getCap() + "', '"; + sql += u.getNome() + "', "; + sql += u.getMedico_id() + ", "; + sql += u.getFuncionario_hst_id() + ", '"; + sql += u.getActivo() + "', '"; + sql += u.getResponsavel_loja() + "', '"; + sql += u.getGestor_geral() + "', '"; + sql += u.getNumero_mecanografico() + "')"; + System.out.println("USER SQL : " + sql); + st.execute(sql); + return newUserId; + } + + public void updateUtilizador(Utilizador u) throws Exception + { + Statement st = createStatement(); + String sql = ""; + if(u.getData_password() == null) + { + sql = "UPDATE utilizadores SET login = '" + u.getLogin() + "', password = '" + u.getPassword() + "', data_password = " + null + ", email = '" + u.getEmail() + "', empresa_id = " + u.getEmpresa_id() + ", estabelecimento_id = " + u.getEstabelecimento_id() + ", administrador = '" + u.getAdministrador() + "', tipo = " + u.getTipo() + ", numero_cedula = '" + u.getNumero_cedula() + "', cap = '" + u.getCap() + "', nome = '" + u.getNome() + "', medico_id = " + u.getMedico_id() + ", funcionario_hst_id = " + u.getFuncionario_hst_id() + ", activo = '" + u.getActivo() + "', responsavel_loja = '" + u.getResponsavel_loja() + "', gestor_geral = '" + u.getGestor_geral() + "', primeiro_login = '" + u.getPrimeiro_login() + "' WHERE id = " + u.getId(); + } + else + { + sql = "UPDATE utilizadores SET login = '" + u.getLogin() + "', password = '" + u.getPassword() + "', data_password = '" + u.getData_password() + "', email = '" + u.getEmail() + "', empresa_id = " + u.getEmpresa_id() + ", estabelecimento_id = " + u.getEstabelecimento_id() + ", administrador = '" + u.getAdministrador() + "', tipo = " + u.getTipo() + ", numero_cedula = '" + u.getNumero_cedula() + "', cap = '" + u.getCap() + "', nome = '" + u.getNome() + "', medico_id = " + u.getMedico_id() + ", funcionario_hst_id = " + u.getFuncionario_hst_id() + ", activo = '" + u.getActivo() + "', responsavel_loja = '" + u.getResponsavel_loja() + "', gestor_geral = '" + u.getGestor_geral() + "', primeiro_login = '" + u.getPrimeiro_login() + "' WHERE id = " + u.getId(); + } + + System.out.println("SQL UPDATE USER : " + sql); + st.execute(sql); + } + + public void deleteUser(Integer userId) throws Exception + { + Statement st = createStatement(); + String sql = "UPDATE utilizadores SET apagado = 'y', activo = 'n' WHERE id = " + userId; + st.execute(sql); + } + + public Utilizador getUtilizador(String login) throws Exception + { + Utilizador u = new Utilizador(); + Statement st = createStatement(); + String sql = "SELECT * FROM utilizadores WHERE LOWER(login) = '" + login.toLowerCase() + "' AND apagado = 'n'"; + ResultSet rs = st.executeQuery(sql); + rs.first(); + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setData_password(rs.getDate("data_password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + u.setResponsavel_loja(rs.getString("responsavel_loja")); + u.setGestor_geral(rs.getString("gestor_geral")); + u.setPrimeiro_login(rs.getString("primeiro_login")); + u.setApagado(rs.getString("apagado")); + return u; + } + + public Utilizador getUtilizador(Integer id) throws Exception + { + Utilizador u = new Utilizador(); + Statement st = createStatement(); + String sql = "SELECT * FROM utilizadores WHERE id = " + id; + ResultSet rs = st.executeQuery(sql); + rs.first(); + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setData_password(rs.getDate("data_password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + u.setResponsavel_loja(rs.getString("responsavel_loja")); + u.setGestor_geral(rs.getString("gestor_geral")); + u.setApagado(rs.getString("apagado")); + return u; + } + + public ArrayList getUtilizadoresListByTipo(Integer tipo, String responsavel_loja) throws Exception + { + ArrayList list = new ArrayList(); + Statement st = createStatement(); + String sql = ""; + if(responsavel_loja.matches("y")) + { + sql = "SELECT * FROM utilizadores WHERE responsavel_loja = 'y' AND tipo = " + tipo; + } + else + { + sql = "SELECT * FROM utilizadores WHERE tipo = " + tipo; + } + + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Utilizador u = new Utilizador(); + u.setId(new Integer(rs.getInt("id"))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setData_password(rs.getDate("data_password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(rs.getString("nome")); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString("activo")); + u.setResponsavel_loja(rs.getString("responsavel_loja")); + list.add(u); + }while(rs.next()); + return list; + } + + public ArrayList getUtilizadoresList(String por, String nome, Integer estabelecimento_id, String activo, String booDirRh) throws Exception + { + StringTokenizer stk = null; + AnalisesDataProvider adp = new AnalisesDataProvider(); + ArrayList list = new ArrayList(); + Statement st = createStatement(); + + String sql = ""; + String sql1 = ""; + String sql2 = ""; + String sql3 = ""; + if(por != null && nome != null && estabelecimento_id != null) + { + sql1 = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND ("; + sql3 = ") AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + stk = new StringTokenizer (nome); + int n = 0; + while (stk.hasMoreTokens ()) { + if(n > 0) + { + sql2 += "AND "; + } + sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + //sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND LOWER(nome) LIKE '%" + nome + "%' AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' ORDER BY numero_mecanografico"; + } + else if(por != null && nome != null) + { + sql1 = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND ("; + sql3 = ") AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + stk = new StringTokenizer (nome); + int n = 0; + while (stk.hasMoreTokens ()) { + if(n > 0) + { + sql2 += "AND "; + } + sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + //sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND LOWER(nome) LIKE '%" + nome + "%' AND utilizadores.activo ='" + activo + "' ORDER BY numero_mecanografico"; + } + else if(por != null && estabelecimento_id != null) + { + sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + } + else if(nome != null && estabelecimento_id != null) + { + sql1 = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND ("; + sql3 = ") AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + stk = new StringTokenizer (nome); + int n = 0; + while (stk.hasMoreTokens ()) { + if(n > 0) + { + sql2 += "AND "; + } + sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + //sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(nome) LIKE '%" + nome + "%' AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' ORDER BY numero_mecanografico"; + } + else if(por != null) + { + sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(numero_mecanografico) LIKE '%" + por + "%' AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + } + else if(nome != null) + { + sql1 = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND ("; + sql3 = ") AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + stk = new StringTokenizer (nome); + int n = 0; + while (stk.hasMoreTokens ()) { + if(n > 0) + { + sql2 += "AND "; + } + sql2 += "LOWER(nome) LIKE '%" + stk.nextToken () + "%' "; + n++; + } + sql = sql1 + sql2 + sql3; + //sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND LOWER(nome) LIKE '%" + nome + "%' AND utilizadores.activo ='" + activo + "' ORDER BY numero_mecanografico"; + } + else if(estabelecimento_id != null) + { + sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND estabelecimento_id = " + estabelecimento_id + " AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + } + else // all null + { + sql = "SELECT * FROM utilizadores, tipos_utilizadores WHERE utilizadores.tipo = tipos_utilizadores.tipo AND utilizadores.activo ='" + activo + "' AND apagado = 'n' AND utilizadores.tipo <> " + Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP + " ORDER BY numero_mecanografico"; + } + System.out.println("UTILIZADORES SQL : " + sql); + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Utilizador u = new Utilizador(); + u.setId(new Integer(rs.getInt(1))); + u.setLogin(rs.getString("login")); + u.setPassword(rs.getString("password")); + u.setData_password(rs.getDate("data_password")); + u.setEmail(rs.getString("email")); + u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); + u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); + u.setAdministrador(rs.getString("administrador")); + u.setTipo(new Integer(rs.getInt("tipo"))); + u.setNumero_cedula(rs.getString("numero_cedula")); + u.setCap(rs.getString("cap")); + u.setNome(Utils.unicodeToHTML(rs.getString("nome")) ); + u.setMedico_id(new Integer(rs.getInt("medico_id"))); + u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); + u.setActivo(rs.getString(14)); + u.setResponsavel_loja(rs.getString("responsavel_loja")); + u.setGestor_geral(rs.getString("gestor_geral")); + u.setNumero_mecanografico(rs.getString("numero_mecanografico")); + u.setCategoria(rs.getString("descricao")); + u.setApagado(rs.getString("apagado")); + try + { + u.setNome_estabelecimento( adp.getEstabelecimentoNome(u.getEstabelecimento_id()) ); + } + catch(Exception e) + { + e.printStackTrace(); + } + if(booDirRh.matches("y")) + { + if(u.getTipo().intValue() == 1 || u.getTipo().intValue() == 2 || u.getTipo().intValue() == 6) + { + list.add(u); + } + } + else + { + list.add(u); + } + + }while(rs.next()); + return list; + } + + public ArrayList getResponsavelRhList(Integer estabelecimento_id) + { + ArrayList list = new ArrayList(); + Utilizador u = null; + Statement st = createStatement(); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = " + Global.TIPO_UTILIZADOR_RH + " AND apagado = 'n' AND responsavel_loja = 'y' AND estabelecimento_id = " + estabelecimento_id; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + u = new Utilizador(); + u.setId(new Integer(rs.getInt("id"))); + u.setNome(rs.getString("nome")); + u.setLogin(rs.getString("login")); + u.setEmail(rs.getString("email")); + list.add(u); + }while(rs.next()); + return list; + } + catch(Exception ex) + { + return null; + } + } + + public Medico getMedico(Integer estabelecimento_id) + { + Medico m = null; + Statement st = createStatement(); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = " + Global.TIPO_UTILIZADOR_MEDICO + " AND apagado = 'n' AND estabelecimento_id = " + estabelecimento_id; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + m = new Medico(); + m.setId(new Integer(rs.getInt("id"))); + m.setNome(rs.getString("nome")); + m.setNumero_cedula(rs.getString("numero_cedula")); + return m; + } + catch(Exception ex) + { + return null; + } + } + + + public com.sun.rave.web.ui.model.Option[] getMedicosList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement st = createStatement(); + ArrayList list = new ArrayList(); +// Medico m = new Medico(); +// m.setId(new Integer(0)); +// m.setNome("-Seleccionar-"); +// list.add(m); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = 5 AND apagado = 'n' "; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + Medico m = new Medico(); + m.setId(new Integer(rs.getInt("id"))); + m.setNome(Utils.unicodeToHTML(rs.getString("nome"))); + list.add(m); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + Medico m = (Medico) iter.next(); + + listOptions[i] = new Option(m.getId(), Utils.unicodeToHTML(m.getNome())); + i++; + } +// dblocal.close(); + return listOptions; + } + + public com.sun.rave.web.ui.model.Option[] getTecnicosSaudeList() throws Exception + { +// Dblocal dblocal = new Dblocal(); +// dblocal.connect(); +// Statement stlocal = dblocal.createStatement(); + Statement st = createStatement(); + ArrayList list = new ArrayList(); + TecnicoSaude t = new TecnicoSaude(); + t.setId(new Integer(0)); + t.setNome(""); + list.add(t); + String sql ="SELECT * FROM utilizadores WHERE activo = 'y' AND tipo = " + Global.TIPO_UTILIZADOR_HS; + ResultSet rs = st.executeQuery(sql); + rs.first(); + do + { + t = new TecnicoSaude(); + t.setId(new Integer(rs.getInt("id"))); + t.setNome(Utils.unicodeToHTML(rs.getString("nome"))); + list.add(t); + }while(rs.next()); + com.sun.rave.web.ui.model.Option[] listOptions = new com.sun.rave.web.ui.model.Option[list.size()]; + ListIterator iter = list.listIterator(); + int i = 0; + while(iter.hasNext()) + { + t = (TecnicoSaude) iter.next(); + + listOptions[i] = new Option(t.getId(), Utils.unicodeToHTML(t.getNome())); + i++; + } +// dblocal.close(); + return listOptions; + } + + public Integer getMaxPermissaoId() + { + Statement st = createStatement(); + String sql = "SELECT max(permissoes.id)+1 AS MAXPERMISSAOID FROM permissoes"; + try + { + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer newId = new Integer(rs.getInt("MAXPERMISSAOID")); + if(newId.intValue() == 0) + { + newId = new Integer(1); + } + return newId; + } + catch(Exception ex) + { + ex.printStackTrace(); + return new Integer(1); + } + } + + public Integer createPermissao(Permissao p) throws Exception + { + Statement st = createStatement(); + Integer newId = getMaxPermissaoId(); + + String sql = "INSERT INTO permissoes (id, user_id, codigo_permissao) VALUES (" + newId + ", " + p.getUser_id() + ", " + p.getCodigo_permissao() + ")"; + st.execute(sql); + return newId; + } + + public Integer getPermissionCode(Integer userId) throws Exception + { + Statement st = createStatement(); + String sql = "SELECT * FROM permissoes WHERE user_id = " + userId; + ResultSet rs = st.executeQuery(sql); + rs.first(); + Integer permission = new Integer(rs.getInt("codigo_permissao")); + return permission; + } + + private Statement createStatement() + { + Db db = new Db(); + return db.createStatement(); + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/pagestate/AnaliseAcidenteTrabalhoState.java b/trunk/AnaliseAcidentesTrabalho/src/java/pagestate/AnaliseAcidenteTrabalhoState.java new file mode 100644 index 00000000..7be51517 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/pagestate/AnaliseAcidenteTrabalhoState.java @@ -0,0 +1,464 @@ +/* + * AnaliseAcidenteTrabalhoState.java + * + * Created on September 27, 2007, 5:18 PM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package pagestate; + +/** + * + * @author lluis + */ +public class AnaliseAcidenteTrabalhoState { + private Object header_nr; + private Object header_date; + private int estado; + private Object empresa; + private Object estabelecimento; + private Object trabalhador; + private Object data_nascimento; + private Object data_admissao; + private Object funcao; + + private Object bi; + private Object morada; + private Object cod_postal1; + private Object cod_postal2; + private Object localidade; + private Object contacto_telefonico; + private Object turno; + + private Object data_acidente; + private Object horas_turno; + private Object seccao; + private Object local_trabalho; + private Integer hours; + private Integer minutes; + private Object tarefa; + private Object substancias; + + private Object superior_hierarquico; + private Object condicoes; + private Object testemunhas; + private Object causas; + private Object descricao; + private Object conclusoes; + private Object accoes; + + + private String formacao_shst; + private Object formacao_shsht_n_why; + private String acidentes_colaborador; + private Object nr_acidentes_colaborador; + private String acidentes_colaboradores; + private Object nr_acidentes_colaboradores; + + private Object nr_relatorio_acidentes_colaborador_1; + private Object nr_relatorio_acidentes_colaborador_2; + private Object nr_relatorio_acidentes_colaborador_3; + private Object nr_relatorio_acidentes_colaborador_4; + + private Object nr_relatorio_acidentes_colaboradores_1; + private Object nr_relatorio_acidentes_colaboradores_2; + private Object nr_relatorio_acidentes_colaboradores_3; + private Object nr_relatorio_acidentes_colaboradores_4; + + private Object averiguador; + private String averiguacao_posterior; + private Object averiguacao_obs; + + /** Creates a new instance of AnaliseAcidenteTrabalhoState */ + public AnaliseAcidenteTrabalhoState() { + } + + public Object getEstabelecimento() { + return estabelecimento; + } + + public void setEstabelecimento(Object estabelecimento) { + this.estabelecimento = estabelecimento; + } + + public Object getTrabalhador() { + return trabalhador; + } + + public void setTrabalhador(Object trabalhador) { + this.trabalhador = trabalhador; + } + + public Object getData_nascimento() { + return data_nascimento; + } + + public void setData_nascimento(Object data_nascimento) { + this.data_nascimento = data_nascimento; + } + + public Object getHoras_turno() { + return horas_turno; + } + + public void setHoras_turno(Object horas_turno) { + this.horas_turno = horas_turno; + } + + public Object getSeccao() { + return seccao; + } + + public void setSeccao(Object seccao) { + this.seccao = seccao; + } + + public Object getLocal_trabalho() { + return local_trabalho; + } + + public void setLocal_trabalho(Object local_trabalho) { + this.local_trabalho = local_trabalho; + } + + public Object getTarefa() { + return tarefa; + } + + public void setTarefa(Object tarefa) { + this.tarefa = tarefa; + } + + public Object getSubstancias() { + return substancias; + } + + public void setSubstancias(Object substancias) { + this.substancias = substancias; + } + + public Object getSuperior_hierarquico() { + return superior_hierarquico; + } + + public void setSuperior_hierarquico(Object superior_hierarquico) { + this.superior_hierarquico = superior_hierarquico; + } + + public Object getCondicoes() { + return condicoes; + } + + public void setCondicoes(Object condicoes) { + this.condicoes = condicoes; + } + + public Object getTestemunhas() { + return testemunhas; + } + + public void setTestemunhas(Object testemunhas) { + this.testemunhas = testemunhas; + } + + public Object getCausas() { + return causas; + } + + public void setCausas(Object causas) { + this.causas = causas; + } + + public Object getDescricao() { + return descricao; + } + + public void setDescricao(Object descricao) { + this.descricao = descricao; + } + + public Object getAccoes() { + return accoes; + } + + public void setAccoes(Object accoes) { + this.accoes = accoes; + } + + public Object getConclusoes() { + return conclusoes; + } + + public void setConclusoes(Object conclusoes) { + this.conclusoes = conclusoes; + } + + public Object getEmpresa() { + return empresa; + } + + public void setEmpresa(Object empresa) { + this.empresa = empresa; + } + + public int getEstado() { + return estado; + } + + public void setEstado(int estado) { + this.estado = estado; + } + + public Object getBi() { + return bi; + } + + public void setBi(Object bi) { + this.bi = bi; + } + + public Object getMorada() { + return morada; + } + + public void setMorada(Object morada) { + this.morada = morada; + } + + public Object getCod_postal1() { + return cod_postal1; + } + + public void setCod_postal1(Object cod_postal1) { + this.cod_postal1 = cod_postal1; + } + + public Object getCod_postal2() { + return cod_postal2; + } + + public void setCod_postal2(Object cod_postal2) { + this.cod_postal2 = cod_postal2; + } + + public Object getLocalidade() { + return localidade; + } + + public void setLocalidade(Object localidade) { + this.localidade = localidade; + } + + public Object getContacto_telefonico() { + return contacto_telefonico; + } + + public void setContacto_telefonico(Object contacto_telefonico) { + this.contacto_telefonico = contacto_telefonico; + } + + public Object getTurno() { + return turno; + } + + public void setTurno(Object turno) { + this.turno = turno; + } + + public Integer getHours() { + return hours; + } + + public void setHours(Integer hours) { + this.hours = hours; + } + + public Integer getMinutes() { + return minutes; + } + + public void setMinutes(Integer minutes) { + this.minutes = minutes; + } + + public String getFormacao_shst() { + return formacao_shst; + } + + public void setFormacao_shst(String formacao_shst) { + this.formacao_shst = formacao_shst; + } + + public Object getFormacao_shsht_n_why() { + return formacao_shsht_n_why; + } + + public void setFormacao_shsht_n_why(Object formacao_shsht_n_why) { + this.formacao_shsht_n_why = formacao_shsht_n_why; + } + + public String getAcidentes_colaborador() { + return acidentes_colaborador; + } + + public void setAcidentes_colaborador(String acidentes_colaborador) { + this.acidentes_colaborador = acidentes_colaborador; + } + + public Object getNr_acidentes_colaborador() { + return nr_acidentes_colaborador; + } + + public void setNr_acidentes_colaborador(Object nr_acidentes_colaborador) { + this.nr_acidentes_colaborador = nr_acidentes_colaborador; + } + + public String getAcidentes_colaboradores() { + return acidentes_colaboradores; + } + + public void setAcidentes_colaboradores(String acidentes_colaboradores) { + this.acidentes_colaboradores = acidentes_colaboradores; + } + + public Object getNr_acidentes_colaboradores() { + return nr_acidentes_colaboradores; + } + + public void setNr_acidentes_colaboradores(Object nr_acidentes_colaboradores) { + this.nr_acidentes_colaboradores = nr_acidentes_colaboradores; + } + + public Object getNr_relatorio_acidentes_colaborador_1() { + return nr_relatorio_acidentes_colaborador_1; + } + + public void setNr_relatorio_acidentes_colaborador_1(Object nr_relatorio_acidentes_colaborador_1) { + this.nr_relatorio_acidentes_colaborador_1 = nr_relatorio_acidentes_colaborador_1; + } + + public Object getNr_relatorio_acidentes_colaborador_2() { + return nr_relatorio_acidentes_colaborador_2; + } + + public void setNr_relatorio_acidentes_colaborador_2(Object nr_relatorio_acidentes_colaborador_2) { + this.nr_relatorio_acidentes_colaborador_2 = nr_relatorio_acidentes_colaborador_2; + } + + public Object getNr_relatorio_acidentes_colaborador_3() { + return nr_relatorio_acidentes_colaborador_3; + } + + public void setNr_relatorio_acidentes_colaborador_3(Object nr_relatorio_acidentes_colaborador_3) { + this.nr_relatorio_acidentes_colaborador_3 = nr_relatorio_acidentes_colaborador_3; + } + + public Object getNr_relatorio_acidentes_colaborador_4() { + return nr_relatorio_acidentes_colaborador_4; + } + + public void setNr_relatorio_acidentes_colaborador_4(Object nr_relatorio_acidentes_colaborador_4) { + this.nr_relatorio_acidentes_colaborador_4 = nr_relatorio_acidentes_colaborador_4; + } + + public Object getNr_relatorio_acidentes_colaboradores_1() { + return nr_relatorio_acidentes_colaboradores_1; + } + + public void setNr_relatorio_acidentes_colaboradores_1(Object nr_relatorio_acidentes_colaboradores_1) { + this.nr_relatorio_acidentes_colaboradores_1 = nr_relatorio_acidentes_colaboradores_1; + } + + public Object getNr_relatorio_acidentes_colaboradores_2() { + return nr_relatorio_acidentes_colaboradores_2; + } + + public void setNr_relatorio_acidentes_colaboradores_2(Object nr_relatorio_acidentes_colaboradores_2) { + this.nr_relatorio_acidentes_colaboradores_2 = nr_relatorio_acidentes_colaboradores_2; + } + + public Object getNr_relatorio_acidentes_colaboradores_3() { + return nr_relatorio_acidentes_colaboradores_3; + } + + public void setNr_relatorio_acidentes_colaboradores_3(Object nr_relatorio_acidentes_colaboradores_3) { + this.nr_relatorio_acidentes_colaboradores_3 = nr_relatorio_acidentes_colaboradores_3; + } + + public Object getNr_relatorio_acidentes_colaboradores_4() { + return nr_relatorio_acidentes_colaboradores_4; + } + + public void setNr_relatorio_acidentes_colaboradores_4(Object nr_relatorio_acidentes_colaboradores_4) { + this.nr_relatorio_acidentes_colaboradores_4 = nr_relatorio_acidentes_colaboradores_4; + } + + public Object getHeader_nr() { + return header_nr; + } + + public void setHeader_nr(Object header_nr) { + this.header_nr = header_nr; + } + + public Object getHeader_date() { + return header_date; + } + + public void setHeader_date(Object header_date) { + this.header_date = header_date; + } + + public Object getFuncao() { + return funcao; + } + + public void setFuncao(Object funcao) { + this.funcao = funcao; + } + + public Object getData_acidente() { + return data_acidente; + } + + public void setData_acidente(Object data_acidente) { + this.data_acidente = data_acidente; + } + + public Object getData_admissao() { + return data_admissao; + } + + public void setData_admissao(Object data_admissao) { + this.data_admissao = data_admissao; + } + + public Object getAveriguador() { + return averiguador; + } + + public void setAveriguador(Object averiguador) { + this.averiguador = averiguador; + } + + public String getAveriguacao_posterior() { + return averiguacao_posterior; + } + + public void setAveriguacao_posterior(String averiguacao_posterior) { + this.averiguacao_posterior = averiguacao_posterior; + } + + public Object getAveriguacao_obs() { + return averiguacao_obs; + } + + public void setAveriguacao_obs(Object averiguacao_obs) { + this.averiguacao_obs = averiguacao_obs; + } + + + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/pdf/Pdf.java b/trunk/AnaliseAcidentesTrabalho/src/java/pdf/Pdf.java new file mode 100644 index 00000000..e02f8c17 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/pdf/Pdf.java @@ -0,0 +1,168 @@ +/* + * Pdf.java + * + * Created on November 13, 2007, 11:33 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package pdf; + +import analiseacidentestrabalho.Acidentado; +import analiseacidentestrabalho.AnaliseAcidente; +import com.lowagie.text.Chunk; +import com.lowagie.text.Document; +import com.lowagie.text.Font; +import com.lowagie.text.FontFactory; +import com.lowagie.text.Paragraph; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.BaseFont; +import com.lowagie.text.pdf.PdfAction; +import com.lowagie.text.pdf.PdfPCell; +import com.lowagie.text.pdf.PdfPTable; +import com.lowagie.text.pdf.PdfWriter; +import db.AnalisesDataProvider; +import java.awt.Color; +import java.io.FileOutputStream; +import javax.faces.context.FacesContext; + +/** + * + * @author lluis + */ +public class Pdf { + + PdfPCell cell = null; + Paragraph p = null; + private final static int FONT_SIZE = 5; + /** Creates a new instance of Pdf */ + public Pdf() { + } + + public void generatePdf(String folder, AnaliseAcidente a) + { + PdfPTable table = null; + FacesContext ctx = FacesContext.getCurrentInstance(); + ////HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse(); + Document document = new Document(); + ////response.setContentType("application/pdf"); + + try + { + ////PdfWriter writer = PdfWriter.getInstance(document, response.getOutputStream()); + PdfWriter.getInstance(document, new FileOutputStream(folder + "/" + a.getId().toString() + ".pdf")); + document.open(); + //document.add(new Paragraph("Hello World")); + //document.add(new Paragraph(new Date().toString())); + + table = createTableEmpresa(a); + document.add(table); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + document.close(); + } + + private PdfPTable createTableHeader(AnaliseAcidente a) + { + PdfPTable table = new PdfPTable(3); + return table; + } + + private PdfPTable createTableEmpresa(AnaliseAcidente a) + { + String empresa_str = ""; + String estabelecimento_str = ""; + String trabalhador_str = ""; + AnalisesDataProvider adp = new AnalisesDataProvider(); + try + { + String nome_empresa = adp.getEmpresaNome(a.getEmpresa_id()); + empresa_str = utils.Utils.unicodeToHTML(nome_empresa); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + try + { + estabelecimento_str = adp.getEstabelecimentoNome(a.getEstabelecimento_id()); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + Acidentado ac = null; + try + { + ac = adp.getAcidentado(a.getAcidentado_id()); + trabalhador_str = ac.getNome(); + } + catch(Exception ex) + { + ex.printStackTrace(); + } + + //TableEvents event = new TableEvents(); + + float[] widths = { 1f, 4f }; + PdfPTable table = new PdfPTable(widths); + table.getDefaultCell().setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP | Rectangle.BOTTOM); + //PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3")); + //cell.setColspan(3); + //table.addCell(cell); + + + + + cell = new PdfPCell(new Paragraph("Empresa:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(empresa_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)) )); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Estabelecimento:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(estabelecimento_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + + cell = new PdfPCell(new Paragraph("Trabalhador:", FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + + table.addCell(cell); + + cell = new PdfPCell(new Paragraph(trabalhador_str, FontFactory.getFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, FONT_SIZE, Font.NORMAL, new Color(255, 255, 255)))); + cell.setBorder(Rectangle.NO_BORDER); + cell.setBackgroundColor(new Color(102, 133, 151)); + table.addCell(cell); + table.getDefaultCell().setBackgroundColor(new Color(102, 133, 151)); + table.getDefaultCell().setPadding(0f); + table.setSpacingAfter(0f); + table.setSpacingBefore(0f); + return table; + } + + private PdfPTable createTableEmpresaHs(AnaliseAcidente a) + { + PdfPTable table = new PdfPTable(3); + return table; + } + + + + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/utils/Strings.java b/trunk/AnaliseAcidentesTrabalho/src/java/utils/Strings.java new file mode 100644 index 00000000..1fbfc2d0 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/utils/Strings.java @@ -0,0 +1,151 @@ +/* + * Strings.java + * + * Created on October 8, 2007, 9:17 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package utils; + +/** + * + * @author lluis + */ +public class Strings { + public static String unicodeToHTML( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + + String output = text; + output = output.replace( "\\u0009", " " ); + output = output.replace( "\\u000a", "
" ); + + output = output.replace( "\\u00a0", " " ); + output = output.replace( "\\u00aa", "ª" ); + output = output.replace( "\\u00ba", "º" ); + + output = output.replace( "\\u00c0", "À" ); + output = output.replace( "\\u00c1", "Á" ); + output = output.replace( "\\u00c2", "Â" ); + output = output.replace( "\\u00c3", "Ã" ); + output = output.replace( "\\u00c7", "Ç" ); + output = output.replace( "\\u00c8", "È" ); + output = output.replace( "\\u00c9", "É" ); + + output = output.replace( "\\u00ca", "Ê" ); + output = output.replace( "\\u00cc", "Ì" ); + output = output.replace( "\\u00cd", "Í" ); + output = output.replace( "\\u00ce", "Î" ); + output = output.replace( "\\u00d2", "ò" ); + output = output.replace( "\\u00d3", "ó" ); + output = output.replace( "\\u00d4", "ô" ); + output = output.replace( "\\u00d5", "õ" ); + output = output.replace( "\\u00d9", "Ù" ); + output = output.replace( "\\u00da", "Ú" ); + output = output.replace( "\\u00db", "Û" ); + + output = output.replace( "\\u00e0", "à" ); + output = output.replace( "\\u00e1", "á" ); + output = output.replace( "\\u00e2", "â" ); + output = output.replace( "\\u00e3", "ã" ); + output = output.replace( "\\u00e7", "ç" ); + output = output.replace( "\\u00e8", "è" ); + output = output.replace( "\\u00e9", "é" ); + output = output.replace( "\\u00ea", "ê" ); + output = output.replace( "\\u00ec", "ì" ); + output = output.replace( "\\u00ed", "í" ); + output = output.replace( "\\u00ee", "î" ); + output = output.replace( "\\u00f2", "ò" ); + output = output.replace( "\\u00f3", "ó" ); + output = output.replace( "\\u00f4", "ô" ); + output = output.replace( "\\u00f5", "õ" ); + output = output.replace( "\\u00f9", "ù" ); + output = output.replace( "\\u00fa", "ú" ); + output = output.replace( "\\u00fb", "û" ); + + output = output.replace( "\\u0153", "œ" ); + + output = output.replace( "\\u2013", "-" ); + output = output.replace( "\\u2014", "-" ); + output = output.replace( "\\u2018|\\u2019", "'" ); + output = output.replace( "\\u201c|\\u201d", "\"" ); + + output = output.replace( "\\u2022", "*" ); + output = output.replace( "\\u2026", "..." ); + + return output; + } + + public static String textToUnicode( String text ) + { + String output = text; + output = output.replace( "À", "\\u00c0" ); + output = output.replace( "Á", "\\u00c1" ); + output = output.replace( "Â", "\\u00c2" ); + output = output.replace( "Ã", "\\u00c3" ); + output = output.replace( "Ç", "\\u00c7" ); + output = output.replace( "È", "\\u00c8" ); + output = output.replace( "É", "\\u00c9" ); + + output = output.replace( "Ê", "\\u00ca" ); + output = output.replace( "Ì", "\\u00cc" ); + output = output.replace( "Í", "\\u00cd" ); + output = output.replace( "Î", "\\u00ce" ); + output = output.replace( "ò", "\\u00d2" ); + output = output.replace( "ó", "\\u00d3" ); + output = output.replace( "ô", "\\u00d4" ); + output = output.replace( "õ", "\\u00d5" ); + output = output.replace( "Ù", "\\u00d9" ); + output = output.replace( "Ú", "\\u00da" ); + output = output.replace( "Û", "\\u00db" ); + + output = output.replace( "à", "\\u00e0" ); + output = output.replace( "á", "\\u00e1" ); + output = output.replace( "â", "\\u00e2" ); + output = output.replace( "ã", "\\u00e3" ); + output = output.replace( "ç", "\\u00e7" ); + output = output.replace( "è", "\\u00e8" ); + output = output.replace( "é", "\\u00e9" ); + output = output.replace( "ê", "\\u00ea" ); + output = output.replace( "ì", "\\u00ec" ); + output = output.replace( "í", "\\u00ed" ); + output = output.replace( "î", "\\u00ee" ); + output = output.replace( "ò", "\\u00f2" ); + output = output.replace( "ó", "\\u00f3" ); + output = output.replace( "ô", "\\u00f4" ); + output = output.replace( "õ", "\\u00f5" ); + output = output.replace( "ù", "\\u00f9" ); + output = output.replace( "ú", "\\u00fa" ); + output = output.replace( "û", "\\u00fb" ); + + return output; + } + + public static String RTFToUnicode( String text ) + { + if( text == null || text.length() < 4 ) + { + return text; + } + String output = text; + output = output.replaceAll( "\\'", "\\u00" ); + return output; + } + + public static String unicodeToRTF( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + String output = text; + output = output.replaceAll( "\\\\u00", "\\\\'" ); + return output; + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/src/java/utils/Utils.java b/trunk/AnaliseAcidentesTrabalho/src/java/utils/Utils.java new file mode 100644 index 00000000..27393896 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/src/java/utils/Utils.java @@ -0,0 +1,191 @@ +/* + * Utils.java + * + * Created on October 12, 2007, 9:39 AM + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package utils; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; + +/** + * + * @author lluis + */ +public class Utils { + + /** Creates a new instance of Utils */ + public Utils() { + } + + public static String unicodeToHTML( String text ) + { + if( text == null || text.length() < 6 ) + { + return text; + } + + String output = text; + output = output.replaceAll( "\\\\u0009", " " ); + output = output.replaceAll( "\\\\u000a", "
" ); + + output = output.replaceAll( "\\\\u00a0", " " ); + output = output.replaceAll( "\\\\u00aa", "ª" ); + output = output.replaceAll( "\\\\u00ba", "º" ); + + output = output.replaceAll( "\\\\u00c0", "À" ); + output = output.replaceAll( "\\\\u00c1", "Á" ); + output = output.replaceAll( "\\\\u00c2", "Â" ); + output = output.replaceAll( "\\\\u00c3", "Ã" ); + output = output.replaceAll( "\\\\u00c7", "Ç" ); + output = output.replaceAll( "\\\\u00c8", "È" ); + output = output.replaceAll( "\\\\u00c9", "É" ); + output = output.replaceAll( "\\\\u00d3", "Ó" ); + output = output.replaceAll( "\\\\u00d2", "Ò" ); + + output = output.replaceAll( "\\\\u00ca", "Ê" ); + output = output.replaceAll( "\\\\u00cc", "Ì" ); + output = output.replaceAll( "\\\\u00cd", "Í" ); + output = output.replaceAll( "\\\\u00ce", "Î" ); + output = output.replaceAll( "\\\\u00d2", "ò" ); + output = output.replaceAll( "\\\\u00d3", "ó" ); + output = output.replaceAll( "\\\\u00d4", "ô" ); + output = output.replaceAll( "\\\\u00d5", "õ" ); + output = output.replaceAll( "\\\\u00d9", "Ù" ); + output = output.replaceAll( "\\\\u00da", "Ú" ); + output = output.replaceAll( "\\\\u00db", "Û" ); + + output = output.replaceAll( "\\\\u00e0", "à" ); + output = output.replaceAll( "\\\\u00e1", "á" ); + output = output.replaceAll( "\\\\u00e2", "â" ); + output = output.replaceAll( "\\\\u00e3", "ã" ); + output = output.replaceAll( "\\\\u00e7", "ç" ); + output = output.replaceAll( "\\\\u00e8", "è" ); + output = output.replaceAll( "\\\\u00e9", "é" ); + output = output.replaceAll( "\\\\u00ea", "ê" ); + output = output.replaceAll( "\\\\u00ec", "ì" ); + output = output.replaceAll( "\\\\u00ed", "í" ); + output = output.replaceAll( "\\\\u00ee", "î" ); + output = output.replaceAll( "\\\\u00f2", "ò" ); + output = output.replaceAll( "\\\\u00f3", "ó" ); + output = output.replaceAll( "\\\\u00f4", "ô" ); + output = output.replaceAll( "\\\\u00f5", "õ" ); + output = output.replaceAll( "\\\\u00f9", "ù" ); + output = output.replaceAll( "\\\\u00fa", "ú" ); + output = output.replaceAll( "\\\\u00fb", "û" ); + + output = output.replaceAll( "\\\\u0153", "œ" ); + + output = output.replaceAll( "\\\\u2013", "-" ); + output = output.replaceAll( "\\\\u2014", "-" ); + output = output.replaceAll( "\\\\u2018|\\\\u2019", "'" ); + output = output.replaceAll( "\\\\u201c|\\\\u201d", "\"" ); + + output = output.replaceAll( "\\\\u2022", "*" ); + output = output.replaceAll( "\\\\u2026", "..." ); + + return output; + } + + public static String textToUnicode( String text ) + { + String output = text; + + output = output.replaceAll( "À", "\\\\\\\\\\\\\\\\u00c0" ); + output = output.replaceAll( "Á", "\\\\\\\\\\\\\\\\u00c1" ); + output = output.replaceAll( "Â", "\\\\\\\\\\\\\\\\u00c2" ); + output = output.replaceAll( "Ã", "\\\\\\\\\\\\\\\\u00c3" ); + output = output.replaceAll( "Ç", "\\\\\\\\\\\\\\\\u00c7" ); + output = output.replaceAll( "È", "\\\\\\\\\\\\\\\\u00c8" ); + output = output.replaceAll( "É", "\\\\\\\\\\\\\\\\u00c9" ); + output = output.replaceAll( "Ó", "\\\\\\\\\\\\\\\\u00d3" ); + output = output.replaceAll( "Ò", "\\\\\\\\\\\\\\\\u00d2" ); + + output = output.replaceAll( "Ê", "\\\\\\\\\\\\\\\\u00ca" ); + output = output.replaceAll( "Ì", "\\\\\\\\\\\\\\\\u00cc" ); + output = output.replaceAll( "Í", "\\\\\\\\\\\\\\\\u00cd" ); + output = output.replaceAll( "Î", "\\\\\\\\\\\\\\\\u00ce" ); + output = output.replaceAll( "ò", "\\\\\\\\\\\\\\\\u00d2" ); + output = output.replaceAll( "ó", "\\\\\\\\\\\\\\\\u00d3" ); + output = output.replaceAll( "ô", "\\\\\\\\\\\\\\\\u00d4" ); + output = output.replaceAll( "õ", "\\\\\\\\\\\\\\\\u00d5" ); + output = output.replaceAll( "Ù", "\\\\\\\\\\\\\\\\u00d9" ); + output = output.replaceAll( "Ú", "\\\\\\\\\\\\\\\\u00da" ); + output = output.replaceAll( "Û", "\\\\\\\\\\\\\\\\u00db" ); + + output = output.replaceAll( "à", "\\\\\\\\\\\\\\\\u00e0" ); + output = output.replaceAll( "á", "\\\\\\\\\\\\\\\\u00e1" ); + output = output.replaceAll( "â", "\\\\\\\\\\\\\\\\u00e2" ); + output = output.replaceAll( "ã", "\\\\\\\\\\\\\\\\u00e3" ); + output = output.replaceAll( "ç", "\\\\\\\\\\\\\\\\u00e7" ); + output = output.replaceAll( "è", "\\\\\\\\\\\\\\\\u00e8" ); + output = output.replaceAll( "é", "\\\\\\\\\\\\\\\\u00e9" ); + output = output.replaceAll( "ê", "\\\\\\\\\\\\\\\\u00ea" ); + output = output.replaceAll( "ì", "\\\\\\\\\\\\\\\\u00ec" ); + output = output.replaceAll( "í", "\\\\\\\\\\\\\\\\u00ed" ); + output = output.replaceAll( "î", "\\\\\\\\\\\\\\\\u00ee" ); + output = output.replaceAll( "ò", "\\\\\\\\\\\\\\\\u00f2" ); + output = output.replaceAll( "ó", "\\\\\\\\\\\\\\\\u00f3" ); + output = output.replaceAll( "ô", "\\\\\\\\\\\\\\\\u00f4" ); + output = output.replaceAll( "õ", "\\\\\\\\\\\\\\\\u00f5" ); + output = output.replaceAll( "ù", "\\\\\\\\\\\\\\\\u00f9" ); + output = output.replaceAll( "ú", "\\\\\\\\\\\\\\\\u00fa" ); + output = output.replaceAll( "û", "\\\\\\\\\\\\\\\\u00fb" ); + + return output; + } + + public static String getPageFrom(String referer) + { + String pageFrom = referer.substring(referer.lastIndexOf("/")+1); + return pageFrom; + } + + public static 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; + } + + public static String dateToYYYYMMDD(Date ddate) + { + Calendar cal = new GregorianCalendar(); + cal.setTime(ddate); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); + String date_str = dateFormat.format(cal.getTime()); + return date_str; + } + + public static String timeToHHMM(String ttime) throws Exception + { + SimpleDateFormat formatter = new SimpleDateFormat("HH:mm"); + //String s = formatter.format(date); + Date date = (Date)formatter.parse(ttime); + return formatter.format(date); + } + +} diff --git a/trunk/AnaliseAcidentesTrabalho/web/AnaliseAcidenteTrabalho.jsp b/trunk/AnaliseAcidentesTrabalho/web/AnaliseAcidenteTrabalho.jsp new file mode 100644 index 00000000..4dbf4591 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/AnaliseAcidenteTrabalho.jsp @@ -0,0 +1,1476 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &nbsp; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/Dummy.jsp b/trunk/AnaliseAcidentesTrabalho/web/Dummy.jsp new file mode 100644 index 00000000..73e9d70a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/Dummy.jsp @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/Erro.jsp b/trunk/AnaliseAcidentesTrabalho/web/Erro.jsp new file mode 100644 index 00000000..6c54bd5e --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/Erro.jsp @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/FichaUtilizador.jsp b/trunk/AnaliseAcidentesTrabalho/web/FichaUtilizador.jsp new file mode 100644 index 00000000..dbb99a29 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/FichaUtilizador.jsp @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/Footer.jspf b/trunk/AnaliseAcidentesTrabalho/web/Footer.jspf new file mode 100644 index 00000000..1bf9523a --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/Footer.jspf @@ -0,0 +1,12 @@ + +
+ + + + + + + + + +
diff --git a/trunk/AnaliseAcidentesTrabalho/web/FormHS.jsp b/trunk/AnaliseAcidentesTrabalho/web/FormHS.jsp new file mode 100644 index 00000000..911448f2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/FormHS.jsp @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/FormMedico.jsp b/trunk/AnaliseAcidentesTrabalho/web/FormMedico.jsp new file mode 100644 index 00000000..8471517f --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/FormMedico.jsp @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/FormRH.jsp b/trunk/AnaliseAcidentesTrabalho/web/FormRH.jsp new file mode 100644 index 00000000..b0b06b14 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/FormRH.jsp @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/FormSeguranca.jsp b/trunk/AnaliseAcidentesTrabalho/web/FormSeguranca.jsp new file mode 100644 index 00000000..1bca8e06 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/FormSeguranca.jsp @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/Header.jspf b/trunk/AnaliseAcidentesTrabalho/web/Header.jspf new file mode 100644 index 00000000..e3793e85 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/Header.jspf @@ -0,0 +1,8 @@ + +
+ + + + + +
diff --git a/trunk/AnaliseAcidentesTrabalho/web/LoadImage.jsp b/trunk/AnaliseAcidentesTrabalho/web/LoadImage.jsp new file mode 100644 index 00000000..20cbd07d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/LoadImage.jsp @@ -0,0 +1,33 @@ + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + +
+
+
+
+
+
diff --git a/trunk/AnaliseAcidentesTrabalho/web/Login.jsp b/trunk/AnaliseAcidentesTrabalho/web/Login.jsp new file mode 100644 index 00000000..21e24972 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/Login.jsp @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+
diff --git a/trunk/AnaliseAcidentesTrabalho/web/META-INF/context.xml b/trunk/AnaliseAcidentesTrabalho/web/META-INF/context.xml new file mode 100644 index 00000000..e3929bc2 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/RecuperarPassword.jsp b/trunk/AnaliseAcidentesTrabalho/web/RecuperarPassword.jsp new file mode 100644 index 00000000..ce51cb5b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/RecuperarPassword.jsp @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+
diff --git a/trunk/AnaliseAcidentesTrabalho/web/Top.jspf b/trunk/AnaliseAcidentesTrabalho/web/Top.jspf new file mode 100644 index 00000000..a35f7542 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/Top.jspf @@ -0,0 +1,19 @@ + +
+ + + + + + + + + + + + + + + +
diff --git a/trunk/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp b/trunk/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp new file mode 100644 index 00000000..ddc784e4 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/ViewAnaliseAcidenteTrabalho.jsp @@ -0,0 +1,437 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/faces-config.xml b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/faces-config.xml new file mode 100644 index 00000000..8f46eebf --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/faces-config.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/managed-beans.xml b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/managed-beans.xml new file mode 100644 index 00000000..beec62ad --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/managed-beans.xml @@ -0,0 +1,130 @@ + + + + + SessionBean1 + analiseacidentestrabalho.SessionBean1 + session + + + Login + analiseacidentestrabalho.Login + request + + + ApplicationBean1 + analiseacidentestrabalho.ApplicationBean1 + application + + + RequestBean1 + analiseacidentestrabalho.RequestBean1 + request + + + RecuperarPassword + analiseacidentestrabalho.RecuperarPassword + request + + + Header + analiseacidentestrabalho.Header + request + + + Dummy + analiseacidentestrabalho.Dummy + request + + + Footer + analiseacidentestrabalho.Footer + request + + + FormSeguranca + analiseacidentestrabalho.FormSeguranca + request + + + Erro + analiseacidentestrabalho.Erro + request + + + Top + analiseacidentestrabalho.Top + request + + + LoadImage + analiseacidentestrabalho.LoadImage + request + + + AnaliseAcidenteTrabalho + analiseacidentestrabalho.AnaliseAcidenteTrabalho + request + + + ViewAnaliseAcidenteTrabalho + analiseacidentestrabalho.ViewAnaliseAcidenteTrabalho + request + + + FormRH + analiseacidentestrabalho.FormRH + request + + + FormHS + analiseacidentestrabalho.FormHS + request + + + FichaUtilizador + analiseacidentestrabalho.FichaUtilizador + request + + + FormMedico + analiseacidentestrabalho.FormMedico + request + + + FormDirSiprp + analiseacidentestrabalho.FormDirSiprp + request + + + EnviarCorrecao + analiseacidentestrabalho.EnviarCorrecao + request + + + GestaoUtilizadores + analiseacidentestrabalho.GestaoUtilizadores + request + + + NovoUtilizador + analiseacidentestrabalho.NovoUtilizador + request + + + UtilizadorFields + analiseacidentestrabalho.UtilizadorFields + request + + + FormDirGerRh + analiseacidentestrabalho.FormDirGerRh + request + + + FormGestor + analiseacidentestrabalho.FormGestor + request + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/navigation.xml b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/navigation.xml new file mode 100644 index 00000000..b034d40b --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/navigation.xml @@ -0,0 +1,416 @@ + + + + + /Login.jsp + + recuperar_password + /RecuperarPassword.jsp + + + erro + /Erro.jsp + + + form_seguranca + /FormSeguranca.jsp + + + form_rh + /FormRH.jsp + + + form_hs + /FormHS.jsp + + + form_medico + /FormMedico.jsp + + + form_dir_ger_rh + /FormDirGerRh.jsp + + + form_dir_siprp + /FormDirSiprp.jsp + + + create_user + /FichaUtilizador.jsp + + + user + /FichaUtilizador.jsp + + + form_gestor + /FormGestor.jsp + + + + /RecuperarPassword.jsp + + login + /Login.jsp + + + + /FormSeguranca.jsp + + login + /Login.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + user + /FichaUtilizador.jsp + + + + /FormRH.jsp + + login + /Login.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + user + /FichaUtilizador.jsp + + + + /FormHS.jsp + + login + /Login.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + user + /FichaUtilizador.jsp + + + + /FormMedico.jsp + + login + /Login.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + user + /FichaUtilizador.jsp + + + + /FormGestor.jsp + + login + /Login.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + user + /FichaUtilizador.jsp + + + + /FormDirGerRh.jsp + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + gestao_utilizadores + /GestaoUtilizadores.jsp + + + user + /FichaUtilizador.jsp + + + login + /Login.jsp + + + + /FormDirSiprp.jsp + + login + /Login.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + user + /FichaUtilizador.jsp + + + gestao_utilizadores + /GestaoUtilizadores.jsp + + + + /AnaliseAcidenteTrabalho.jsp + + load_image + /LoadImage.jsp + + + form_seguranca + /FormSeguranca.jsp + + + form_rh + /FormRH.jsp + + + form_hs + /FormHS.jsp + + + form_medico + /FormMedico.jsp + + + correcao + /EnviarCorrecao.jsp + + + user + /FichaUtilizador.jsp + + + login + /Login.jsp + + + + /LoadImage.jsp + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + + /FichaUtilizador.jsp + + form_seguranca + /FormSeguranca.jsp + + + form_rh + /FormRH.jsp + + + form_hs + /FormHS.jsp + + + form_medico + /FormMedico.jsp + + + form_gestor + /FormGestor.jsp + + + form_dir_ger_rh + /FormDirGerRh.jsp + + + form_dir_siprp + /FormDirSiprp.jsp + + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + view_analise + /ViewAnaliseAcidenteTrabalho.jsp + + + gestao_utilizadores + /GestaoUtilizadores.jsp + + + novo_utilizador + /NovoUtilizador.jsp + + + login + /Login.jsp + + + + /ViewAnaliseAcidenteTrabalho.jsp + + login + /Login.jsp + + + user + /FichaUtilizador.jsp + + + form_seguranca + /FormSeguranca.jsp + + + form_rh + /FormRH.jsp + + + form_hs + /FormHS.jsp + + + form_medico + /FormMedico.jsp + + + form_gestor + /FormGestor.jsp + + + form_dir_ger_rh + /FormDirGerRh.jsp + + + form_dir_siprp + /FormDirSiprp.jsp + + + + /EnviarCorrecao.jsp + + analise_acidente + /AnaliseAcidenteTrabalho.jsp + + + form_hs + /FormHS.jsp + + + login + /Login.jsp + + + + /GestaoUtilizadores.jsp + + novo_utilizador + /NovoUtilizador.jsp + + + user_fields + /UtilizadorFields.jsp + + + user + /FichaUtilizador.jsp + + + form_dir_ger_rh + /FormDirGerRh.jsp + + + form_dir_siprp + /FormDirSiprp.jsp + + + login + /Login.jsp + + + + /NovoUtilizador.jsp + + new_user_fields + /UtilizadorFields.jsp + + + gestao_utilizadores + /GestaoUtilizadores.jsp + + + user + /FichaUtilizador.jsp + + + form_dir_ger_rh + /FormDirGerRh.jsp + + + form_dir_siprp + /FormDirSiprp.jsp + + + login + /Login.jsp + + + + /UtilizadorFields.jsp + + novo_utilizador + /NovoUtilizador.jsp + + + gestao_utilizadores + /GestaoUtilizadores.jsp + + + form_dir_ger_rh + /FormDirGerRh.jsp + + + form_dir_siprp + /FormDirSiprp.jsp + + + login + /Login.jsp + + + diff --git a/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/web.xml b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/web.xml new file mode 100644 index 00000000..b23abf6d --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/WEB-INF/web.xml @@ -0,0 +1,14 @@ + +javax.faces.STATE_SAVING_METHODserverjavax.faces.CONFIG_FILES/WEB-INF/navigation.xml,/WEB-INF/managed-beans.xmlcom.sun.faces.validateXmltruecom.sun.faces.verifyObjectsfalseUploadFiltercom.sun.rave.web.ui.util.UploadFilter + The maximum allowed upload size in bytes. If this is set + to a negative value, there is no maximum. The default + value is 1000000. + maxSize1000000 + The size (in bytes) of an uploaded file which, if it is + exceeded, will cause the file to be written directly to + disk instead of stored in memory. Files smaller than or + equal to this size will be stored in memory. The default + value is 4096. + sizeThreshold4096UploadFilterFaces ServletFaces Servletjavax.faces.webapp.FacesServlet 1 ExceptionHandlerServletcom.sun.errorhandler.ExceptionHandlererrorHostlocalhosterrorPort24444ThemeServletcom.sun.rave.web.ui.theme.ThemeServletFaces Servlet/faces/*ExceptionHandlerServlet/error/ExceptionHandlerThemeServlet/theme/* + faces/Login.jsp + javax.servlet.ServletException/error/ExceptionHandlerjava.io.IOException/error/ExceptionHandlerjavax.faces.FacesException/error/ExceptionHandlercom.sun.rave.web.ui.appbase.ApplicationException/error/ExceptionHandler*.jspftrue diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/SIPRP_logo_small.jpg b/trunk/AnaliseAcidentesTrabalho/web/resources/images/SIPRP_logo_small.jpg new file mode 100644 index 00000000..240f2358 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/SIPRP_logo_small.jpg differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/black_spacer.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/black_spacer.gif new file mode 100644 index 00000000..d370e341 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/black_spacer.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_auchan_small.jpg b/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_auchan_small.jpg new file mode 100644 index 00000000..376eee0e Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_auchan_small.jpg differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_auchan_small1.jpg b/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_auchan_small1.jpg new file mode 100644 index 00000000..f9e50690 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_auchan_small1.jpg differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_evolute_small.png b/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_evolute_small.png new file mode 100644 index 00000000..0198da2b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/logo_evolute_small.png differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ca2.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ca2.gif new file mode 100644 index 00000000..97c08970 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ca2.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ca3.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ca3.gif new file mode 100644 index 00000000..07b00dc5 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ca3.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext1.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext1.gif new file mode 100644 index 00000000..6278e9de Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext1.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext2.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext2.gif new file mode 100644 index 00000000..d50ab9f5 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext2.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext3.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext3.gif new file mode 100644 index 00000000..cb2a14e3 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ext3.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle2.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle2.gif new file mode 100644 index 00000000..dbf9cb41 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle2.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle3.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle3.gif new file mode 100644 index 00000000..5406a2be Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle3.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle4.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle4.gif new file mode 100644 index 00000000..7342e330 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/fle4.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma10.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma10.gif new file mode 100644 index 00000000..94748d7b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma10.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma2.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma2.gif new file mode 100644 index 00000000..a1f65bf0 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma2.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma3.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma3.gif new file mode 100644 index 00000000..3ec7862b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma3.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma5.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma5.gif new file mode 100644 index 00000000..c6719c98 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma5.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma6.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma6.gif new file mode 100644 index 00000000..f1b5170b Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma6.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma8.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma8.gif new file mode 100644 index 00000000..b98a9b2a Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/medico/ma8.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/images/plus_more.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/images/plus_more.gif new file mode 100644 index 00000000..f10da648 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/images/plus_more.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/plus_more.gif b/trunk/AnaliseAcidentesTrabalho/web/resources/plus_more.gif new file mode 100644 index 00000000..f10da648 Binary files /dev/null and b/trunk/AnaliseAcidentesTrabalho/web/resources/plus_more.gif differ diff --git a/trunk/AnaliseAcidentesTrabalho/web/resources/stylesheet.css b/trunk/AnaliseAcidentesTrabalho/web/resources/stylesheet.css new file mode 100644 index 00000000..1d50d012 --- /dev/null +++ b/trunk/AnaliseAcidentesTrabalho/web/resources/stylesheet.css @@ -0,0 +1,202 @@ +/* Style rules to make data tables look better */ +body {background-color: #bbd400} +.list-header { + background-color: #eeeeee; + font-size: larger; + font-weight: bold; +} + +.list-paging-header { + background-color: white; +} + +.gridColLeft { + text-align : left; +} + +.gridColCenter { + text-align: center; +} + +.gridColRight { + text-align: right; +} + +.gridColRightBottom { + text-align: right; + vertical-align: bottom; +} + +.gridColLeft5{ + text-align: left; + width: 5%; +} + +.gridColLeft10{ + text-align: left; + width: 10%; +} + +.gridColLeft15{ + text-align: left; + width: 15%; +} + +.gridColLeft20{ + text-align: left; + width: 20%; +} + +.gridColLeft25{ + text-align: left; + width: 25%; +} + +.gridColLeft30{ + text-align: left; + width: 30%; +} + +.gridColLeft50{ + text-align: left; + width: 50%; +} + +.gridColLeft70{ + text-align: left; + width: 70%; +} + +.gridColLeft75{ + text-align: left; + width: 75%; +} + +.gridColLeft85{ + text-align: left; + width: 85%; +} + +.gridColLeft90{ + text-align: left; + width: 90%; +} + +.gridColLeft95{ + text-align: left; + width: 95%; +} + +.gridColRight85{ + text-align: right; + width: 85%; +} + +.gridBlockHeader{ + background-color : #668597; + text-align: left; +} + +.restricoes{ + border-spacing: 0; + padding: 0px; +} + +.assinaturas{ + border-spacing: 0; + padding: 0px; +} +.gridColRestricoes{ + border_bottom: solid 1px #000000; +} + +.gridLayoutTopCols { + vertical-align : top; + width : 50%; + border : solid 1px #000000; + background-color: #f6f4e8; +} + +.gridCellBordered { + border-bottom : solid 1px #000000; +} + +.footer { + bottom: 0; + height: 10%; + position: fixed; + right: 0; + top: 95%; + width: 100% +} + +.centerBlock{ + text-align: center; + left: 0; + right: 0; + margin-left: auto; + margin-right: auto;} + +.labelBold{ + font-weight : bold; +} + +.labelMsg{ + font-weight : bold; + color: #cc0033; + font-size :14px ; +} +.list-row-even { +} + +.list-row-odd { + background-color: #eeeeee; +} + +/* Style rules for message severity levels */ + +.infoMessage { + color: black; +} + +.warnMessage { + color: orange; + font-weight: bold; +} + +.errorMessage { + color: red; + font-weight: bold; +} + +.fatalMessage { + color: red; + font-style: italic; + font-weight: bold; +} + + +.labelTrabalhador { + color: #000000; +} + +.labelTrabalhador:hover { + font-weight: bold; + text-decoration : none; +} + +.labelCSS{ + font-weight : bold; +} + +.show{ + display : inline; +} + +.hide{ + display : none ; +} + +.lnkRed{ + color : #990000 ; +}