estruturacao + pagina de estatisticas

git-svn-id: https://svn.coded.pt/svn/SIPRP@1355 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Diogo Neves 15 years ago
parent 148bfb764f
commit 4c0033cffc

@ -19,6 +19,13 @@
-->
<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="AnaliseAcidentesTrabalho-impl">
<import file="ant-deploy.xml"/>
<fail message="Please build using Ant 1.7.1 or higher.">
<condition>
<not>
<antversion atleast="1.7.1"/>
</not>
</condition>
</fail>
<target depends="dist,javadoc" description="Build whole project." name="default"/>
<!--
INITIALIZATION SECTION
@ -130,6 +137,9 @@
<isfalse value="${directory.deployment.supported}"/>
</and>
</condition>
<condition property="do.tmp.war.package">
<isfalse value="${directory.deployment.supported}"/>
</condition>
<property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
<condition else="" property="application.args.param" value="${application.args}">
<and>
@ -206,9 +216,17 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="${javac.debug}" name="debug"/>
<attribute default="${empty.dir}" name="gensrcdir"/>
<element name="customize" optional="true"/>
<sequential>
<property location="${build.dir}/empty" name="empty.dir"/>
<mkdir dir="${empty.dir}"/>
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
<src>
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
<include name="*"/>
</dirset>
</src>
<classpath>
<path path="@{classpath}"/>
</classpath>
@ -247,12 +265,13 @@ or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties f
<target name="-init-macrodef-java">
<macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
<attribute default="${main.class}" name="classname"/>
<attribute default="${debug.classpath}" name="classpath"/>
<element name="customize" optional="true"/>
<sequential>
<java classname="@{classname}" fork="true">
<jvmarg line="${runmain.jvmargs}"/>
<classpath>
<path path="${debug.classpath}:${j2ee.platform.classpath}"/>
<path path="@{classpath}:${j2ee.platform.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
@ -378,9 +397,8 @@ exists or setup the property manually. For example like this:
<fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
</copy>
</target>
<target name="-do-ws-compile"/>
<target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest,-do-ws-compile" if="have.sources" name="-do-compile">
<webproject2:javac destdir="${build.classes.dir}"/>
<target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile">
<webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
@ -408,7 +426,7 @@ exists or setup the property manually. For example like this:
</target>
<target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<webproject2:javac excludes="" includes="${javac.includes}"/>
<webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
@ -504,16 +522,20 @@ exists or setup the property manually. For example like this:
<copyfiles files="${libs.jdbcsupport-designtime.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.jdbcsupport-designtime.classpath" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.theme-default.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.theme-default.classpath" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.jstl11.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.jstl11.classpath" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.rowset-ri.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.rowset-ri.classpath" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.activation.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.activation.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.avalon-framework-4.2.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.avalon-framework-4.2.0.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.batik.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.batik.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.fop.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.fop.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.iText-2.0.8.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.iText-2.0.8.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.jai_imageio.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.jai_imageio.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.jdom.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.jdom.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.mail.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.mail.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.postgresql-8.2-506.jdbc4.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.postgresql-8.2-506.jdbc4.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.rowset-ri.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.rowset-ri.classpath" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.iText-2.0.8.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.iText-2.0.8.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.evolute.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.evolute.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.fop.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.fop.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.jdom.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.jdom.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.avalon-framework-4.2.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.avalon-framework-4.2.0.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.batik.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.batik.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.evologger.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.evologger.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.poi-3.5-beta6-20090622.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.poi-3.5-beta6-20090622.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.poi-ooxml-3.5-beta6-20090622.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.poi-ooxml-3.5-beta6-20090622.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.jsf-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.jsfsupport-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.webui-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
@ -523,7 +545,7 @@ exists or setup the property manually. For example like this:
<copyfiles files="${libs.jstl11.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Class-Path" value="${manifest.libs.jsf-designtime.classpath} ${manifest.libs.jsfsupport-designtime.classpath} ${manifest.libs.webui-designtime.classpath} ${manifest.libs.jdbcsupport-designtime.classpath} ${manifest.libs.theme-default.classpath} ${manifest.libs.jstl11.classpath} ${manifest.file.reference.activation.jar} ${manifest.file.reference.mail.jar} ${manifest.file.reference.postgresql-8.2-506.jdbc4.jar} ${manifest.libs.rowset-ri.classpath} ${manifest.file.reference.iText-2.0.8.jar} ${manifest.file.reference.evolute.jar} ${manifest.file.reference.fop.jar} ${manifest.file.reference.jdom.jar} ${manifest.file.reference.avalon-framework-4.2.0.jar} ${manifest.file.reference.batik.jar} "/>
<attribute name="Class-Path" value="${manifest.libs.jsf-designtime.classpath} ${manifest.libs.jsfsupport-designtime.classpath} ${manifest.libs.webui-designtime.classpath} ${manifest.libs.jdbcsupport-designtime.classpath} ${manifest.libs.theme-default.classpath} ${manifest.libs.jstl11.classpath} ${manifest.libs.rowset-ri.classpath} ${manifest.file.reference.activation.jar} ${manifest.file.reference.avalon-framework-4.2.0.jar} ${manifest.file.reference.batik.jar} ${manifest.file.reference.fop.jar} ${manifest.file.reference.iText-2.0.8.jar} ${manifest.file.reference.jai_imageio.jar} ${manifest.file.reference.jdom.jar} ${manifest.file.reference.mail.jar} ${manifest.file.reference.postgresql-8.2-506.jdbc4.jar} ${manifest.file.reference.evolute.jar} ${manifest.file.reference.evologger.jar} ${manifest.file.reference.poi-3.5-beta6-20090622.jar} ${manifest.file.reference.poi-ooxml-3.5-beta6-20090622.jar} "/>
</manifest>
</target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
@ -533,16 +555,20 @@ exists or setup the property manually. For example like this:
<copyfiles files="${libs.jdbcsupport-designtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.theme-default.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.jstl11.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.rowset-ri.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.activation.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.avalon-framework-4.2.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.batik.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.fop.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.iText-2.0.8.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jai_imageio.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jdom.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.mail.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.postgresql-8.2-506.jdbc4.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.rowset-ri.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.iText-2.0.8.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.evolute.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.fop.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.jdom.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.avalon-framework-4.2.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.batik.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.evologger.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.poi-3.5-beta6-20090622.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.poi-ooxml-3.5-beta6-20090622.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.jsf-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.jsfsupport-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.webui-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
@ -551,7 +577,7 @@ exists or setup the property manually. For example like this:
<copyfiles files="${libs.theme-default.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.jstl11.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
</target>
<target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" name="do-ear-dist">
<target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
<dirname file="${dist.ear.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
@ -671,12 +697,17 @@ exists or setup the property manually. For example like this:
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<webproject1:java classname="${run.class}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
</target>
<!--
DEBUGGING SECTION
-->
<target depends="init,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="true"/>
<nbstartserver debugmode="true"/>
<antcall target="connect-debugger"/>
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
<antcall target="debug-display-browser"/>
<antcall target="connect-client-debugger"/>
</target>
@ -696,7 +727,15 @@ exists or setup the property manually. For example like this:
<target if="do.debug.client" name="connect-client-debugger">
<webproject1:nbjsdebugstart webUrl="${client.url}"/>
</target>
<target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
</target>
<target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
<target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
<target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
<webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
</target>
<target depends="init" if="netbeans.home" name="-debug-start-debugger">
<webproject1:nbjpdastart name="${debug.class}"/>
</target>
@ -725,6 +764,9 @@ exists or setup the property manually. For example like this:
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/*.java"/>
</fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
<target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
@ -780,7 +822,7 @@ exists or setup the property manually. For example like this:
<webproject2:junit testincludes="**/*Test.java"/>
</target>
<target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
<fail if="tests.failed">Some tests failed; see details above.</fail>
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init" if="have.tests" name="test-report"/>
<target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
@ -793,7 +835,7 @@ exists or setup the property manually. For example like this:
<webproject2:junit excludes="" includes="${test.includes}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
<fail if="tests.failed">Some tests failed; see details above.</fail>
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
<!--

@ -6,11 +6,12 @@
<Node id="RecuperarPassword.jsp" x="900" y="300" zoom="true"/>
<Node id="FormDirGerRh.jsp" x="150" y="150" zoom="true"/>
<Node id="FormGestor.jsp" x="1150" y="150" zoom="true"/>
<Node id="Erro.jsp" x="650" y="450" zoom="true"/>
<Node id="Acesso.jsp" x="400" y="750" zoom="true"/>
<Node id="Erro.jsp" x="650" y="450" zoom="true"/>
<Node id="FormRH.jsp" x="400" y="150" zoom="true"/>
<Node id="FormSeguranca.jsp" x="1150" y="300" zoom="true"/>
<Node id="EstatisticasProcesso.jsp" x="150" y="900" zoom="true"/>
<Node id="AnaliseAcidenteTrabalho.jsp" x="150" y="300" zoom="true"/>
<Node id="FormSeguranca.jsp" x="1150" y="300" zoom="true"/>
<Node id="NovoUtilizador.jsp" x="150" y="450" zoom="true"/>
<Node id="FormDirSiprp.jsp" x="650" y="150" zoom="true"/>
<Node id="FichaUtilizador.jsp" x="1400" y="150" zoom="true"/>

@ -1,8 +1,8 @@
build.xml.data.CRC32=306dea99
build.xml.data.CRC32=559ae1d5
build.xml.script.CRC32=97b5d0ef
build.xml.stylesheet.CRC32=c0ebde35
build.xml.stylesheet.CRC32=c0ebde35@1.15.2.1
# 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=306dea99
nbproject/build-impl.xml.script.CRC32=88678294
nbproject/build-impl.xml.stylesheet.CRC32=174458fc
nbproject/build-impl.xml.data.CRC32=559ae1d5
nbproject/build-impl.xml.script.CRC32=257f981d
nbproject/build-impl.xml.stylesheet.CRC32=8ab4467e@1.15.2.1

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
<Node id="RecuperarPassword.jsp" x="150" y="600" zoom="true"/>
<Node id="GestaoUtilizadores.jsp" x="1150" y="300" zoom="true"/>
<Node id="FormDirGerRh.jsp" x="150" y="450" zoom="true"/>
<Node id="FormGestor.jsp" x="650" y="300" zoom="true"/>
<Node id="Acesso.jsp" x="650" y="150" zoom="true"/>
<Node id="Erro.jsp" x="900" y="300" zoom="true"/>
<Node id="FormRH.jsp" x="400" y="450" zoom="true"/>
<Node id="EstatisticasProcesso.jsp" x="150" y="900" zoom="true"/>
<Node id="AnaliseAcidenteTrabalho.jsp" x="900" y="150" zoom="true"/>
<Node id="FormSeguranca.jsp" x="400" y="150" zoom="true"/>
<Node id="NovoUtilizador.jsp" x="150" y="300" zoom="true"/>
<Node id="FormDirSiprp.jsp" x="1400" y="150" zoom="true"/>
<Node id="FichaUtilizador.jsp" x="900" y="450" zoom="true"/>
<Node id="FormMedico.jsp" x="400" y="750" zoom="true"/>
<Node id="FormHS.jsp" x="150" y="150" zoom="true"/>
<Node id="EnviarCorrecao.jsp" x="650" y="450" zoom="true"/>
<Node id="UtilizadorFields.jsp" x="150" y="750" zoom="true"/>
<Node id="Dummy.jsp" x="400" y="600" zoom="true"/>
<Node id="LoadImage.jsp" x="650" y="600" zoom="true"/>
<Node id="ViewAnaliseAcidenteTrabalho.jsp" x="1150" y="150" zoom="true"/>
<Node id="Login.jsp" x="400" y="300" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>

@ -2,26 +2,27 @@
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
<Node id="GestaoUtilizadores.jsp" x="400" y="450" zoom="true"/>
<Node id="RecuperarPassword.jsp" x="400" y="150" zoom="true"/>
<Node id="GestaoUtilizadores.jsp" x="400" y="450" zoom="true"/>
<Node id="FormDirGerRh.jsp" x="150" y="750" zoom="true"/>
<Node id="FormGestor.jsp" x="400" y="300" zoom="true"/>
<Node id="Erro.jsp" x="650" y="450" zoom="true"/>
<Node id="Acesso.jsp" x="400" y="750" zoom="false"/>
<Node id="FormRH.jsp" x="400" y="600" zoom="true"/>
<Node id="EstatisticasProcesso.jsp" x="150" y="900" zoom="true"/>
<Node id="FormSeguranca.jsp" x="1150" y="150" zoom="true"/>
<Node id="AnaliseAcidenteTrabalho.jsp" x="150" y="450" zoom="true"/>
<Node id="NovoUtilizador.jsp" x="900" y="150" zoom="true"/>
<Node id="FormDirSiprp.jsp" x="1400" y="150" zoom="true"/>
<Node id="FichaUtilizador.jsp" x="150" y="300" zoom="true"/>
<Node id="FormMedico.jsp" x="900" y="450" zoom="true"/>
<Node id="FormHS.jsp" x="900" y="300" zoom="true"/>
<Node id="FormMedico.jsp" x="900" y="450" zoom="true"/>
<Node id="EnviarCorrecao.jsp" x="150" y="150" zoom="true"/>
<Node id="UtilizadorFields.jsp" x="1150" y="300" zoom="true"/>
<Node id="Dummy.jsp" x="150" y="600" zoom="true"/>
<Node id="LoadImage.jsp" x="650" y="600" zoom="true"/>
<Node id="ViewAnaliseAcidenteTrabalho.jsp" x="650" y="150" zoom="true"/>
<Node id="Login.jsp" x="650" y="300" zoom="true"/>
<Node id="ViewAnaliseAcidenteTrabalho.jsp" x="650" y="150" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>

@ -2,6 +2,7 @@ build.classes.dir=${build.web.dir}/WEB-INF/classes
build.classes.excludes=**/*.java,**/*.form
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
build.web.dir=${build.dir}/web
@ -19,16 +20,21 @@ dist.ear.war=${dist.dir}/${war.ear.name}
dist.javadoc.dir=${dist.dir}/javadoc
dist.war=${dist.dir}/${war.name}
excludes=
file.reference.activation.jar=jars/activation.jar
file.reference.activation.jar=lib/activation.jar
file.reference.avalon-framework-4.2.0.jar=lib/avalon-framework-4.2.0.jar
file.reference.batik.jar=lib/batik.jar
file.reference.evologger.jar=lib/evologger.jar
file.reference.evolute.jar=lib/evolute.jar
file.reference.fop.jar=lib/fop.jar
file.reference.iText-2.0.8.jar=lib/iText-2.0.8.jar
file.reference.jai_imageio.jar=lib/jai_imageio.jar
file.reference.jdom.jar=lib/jdom.jar
file.reference.mail.jar=jars/mail.jar
file.reference.postgresql-8.2-506.jdbc4.jar=jars/postgresql-8.2-506.jdbc4.jar
file.reference.mail.jar=lib/mail.jar
file.reference.poi-3.5-beta6-20090622.jar=lib/poi-3.5-beta6-20090622.jar
file.reference.poi-ooxml-3.5-beta6-20090622.jar=lib/poi-ooxml-3.5-beta6-20090622.jar
file.reference.postgresql-8.2-506.jdbc4.jar=lib/postgresql-8.2-506.jdbc4.jar
includes=**
j2ee.deploy.on.save=false
j2ee.platform=1.4
j2ee.server.type=Tomcat60
jar.compress=false
@ -39,22 +45,26 @@ javac.classpath=\
${libs.jdbcsupport-designtime.classpath}:\
${libs.theme-default.classpath}:\
${libs.jstl11.classpath}:\
${libs.rowset-ri.classpath}:\
${file.reference.activation.jar}:\
${file.reference.avalon-framework-4.2.0.jar}:\
${file.reference.batik.jar}:\
${file.reference.fop.jar}:\
${file.reference.iText-2.0.8.jar}:\
${file.reference.jai_imageio.jar}:\
${file.reference.jdom.jar}:\
${file.reference.mail.jar}:\
${file.reference.postgresql-8.2-506.jdbc4.jar}:\
${libs.rowset-ri.classpath}:\
${file.reference.iText-2.0.8.jar}:\
${file.reference.evolute.jar}:\
${file.reference.fop.jar}:\
${file.reference.jdom.jar}:\
${file.reference.avalon-framework-4.2.0.jar}:\
${file.reference.batik.jar}
${file.reference.evologger.jar}:\
${file.reference.poi-3.5-beta6-20090622.jar}:\
${file.reference.poi-ooxml-3.5-beta6-20090622.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.source=1.6
javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\

@ -7,97 +7,113 @@
<name>AnaliseAcidentesTrabalho</name>
<minimum-ant-version>1.6</minimum-ant-version>
<web-module-libraries>
<library files="2">
<library>
<file>${libs.jsf-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="4">
<library>
<file>${libs.jsfsupport-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<library>
<file>${libs.webui-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<library>
<file>${libs.jdbcsupport-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<library>
<file>${libs.theme-default.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<library>
<file>${libs.jstl11.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<library>
<file>${libs.rowset-ri.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>
<file>${file.reference.activation.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.mail.jar}</file>
<library>
<file>${file.reference.avalon-framework-4.2.0.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.postgresql-8.2-506.jdbc4.jar}</file>
<library>
<file>${file.reference.batik.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${libs.rowset-ri.classpath}</file>
<library>
<file>${file.reference.fop.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<library>
<file>${file.reference.iText-2.0.8.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.evolute.jar}</file>
<library>
<file>${file.reference.jai_imageio.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.fop.jar}</file>
<library>
<file>${file.reference.jdom.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.jdom.jar}</file>
<library>
<file>${file.reference.mail.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.avalon-framework-4.2.0.jar}</file>
<library>
<file>${file.reference.postgresql-8.2-506.jdbc4.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.batik.jar}</file>
<library>
<file>${file.reference.evolute.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>
<file>${file.reference.evologger.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>
<file>${file.reference.poi-3.5-beta6-20090622.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>
<file>${file.reference.poi-ooxml-3.5-beta6-20090622.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
</web-module-libraries>
<web-module-additional-libraries>
<library files="6">
<library>
<file>${libs.jsf-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="4">
<library>
<file>${libs.jsfsupport-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<library>
<file>${libs.webui-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<library>
<file>${libs.jdbcsupport-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<library>
<file>${libs.exceptionhandler-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<library>
<file>${libs.theme-default.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<library>
<file>${libs.jstl11.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>

@ -6,6 +6,7 @@
package analiseacidentestrabalho;
import beans.Utilizador;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.DropDown;
import com.sun.rave.web.ui.component.StaticText;

@ -6,6 +6,16 @@
*/
package analiseacidentestrabalho;
import beans.Estabelecimento;
import beans.Recomendacao;
import beans.Seccao;
import beans.Causa;
import beans.Medico;
import beans.Medida;
import beans.Trabalhador;
import beans.Utilizador;
import beans.Acidentado;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -9,6 +9,8 @@
package analiseacidentestrabalho;
import beans.Utilizador;
/**
*
* @author lluis

@ -6,6 +6,7 @@
*/
package analiseacidentestrabalho;
import beans.Correcao;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -0,0 +1,769 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package analiseacidentestrabalho;
import beans.EstatisticaProcessoBean;
import beans.Utilizador;
import com.evolute.utils.error.ErrorLogger;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Button;
import com.sun.rave.web.ui.component.Hyperlink;
import com.sun.rave.web.ui.component.RadioButton;
import com.sun.rave.web.ui.component.RadioButtonGroup;
import com.sun.rave.web.ui.component.StaticText;
import com.sun.rave.web.ui.component.Table;
import com.sun.rave.web.ui.component.TextField;
import db.EstatisticasConstants;
import db.EstatisticasDataProvider;
import global.Global;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletResponse;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
/**
*
* @author dneves
*/
public class EstatisticasProcesso extends AbstractPageBean
{
private Hyperlink lnkPlanosActuacao = new Hyperlink();
public Hyperlink getLnkPlanosActuacao()
{
return lnkPlanosActuacao;
}
public void setLnkPlanosActuacao( Hyperlink h )
{
this.lnkPlanosActuacao = h;
}
private StaticText lblUser = new StaticText();
public StaticText getLblUser()
{
return lblUser;
}
public void setLblUser( StaticText st )
{
this.lblUser = st;
}
private StaticText txtMsg = new StaticText();
public StaticText getTxtMsg()
{
return txtMsg;
}
public void setTxtMsg( StaticText st )
{
this.txtMsg = st;
}
private TextField textPOR = new TextField();
public TextField getTextPOR()
{
return textPOR;
}
public void setTextPOR( TextField tf )
{
this.textPOR = tf;
}
private TextField textNome = new TextField();
public TextField getTextNome()
{
return textNome;
}
public void setTextNome( TextField tf )
{
this.textNome = tf;
}
private TextField textAnoOcorrencia = new TextField();
public TextField getTextAnoOcorrencia()
{
return textAnoOcorrencia;
}
public void setTextAnoOcorrencia( TextField tf )
{
this.textAnoOcorrencia = tf;
}
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 this.calDataOcorrencia;
}
public void setCalDataOcorrencia( com.sun.rave.web.ui.component.Calendar c )
{
this.calDataOcorrencia = c;
}
private TextField textHoraOcorrencia = new TextField();
public TextField getTextHoraOcorrencia()
{
return textHoraOcorrencia;
}
public void setTextHoraOcorrencia( TextField tf )
{
this.textHoraOcorrencia = tf;
}
private TextField textHorasTrabalhadas = new TextField();
public TextField getTextHorasTrabalhadas()
{
return textHorasTrabalhadas;
}
public void setTextHorasTrabalhadas( TextField tf )
{
this.textHorasTrabalhadas = tf;
}
private Table tableEstatisticas = new Table();
public Table getTableEstatisticas()
{
return tableEstatisticas;
}
public void setTableEstatisticas( Table t )
{
this.tableEstatisticas = t;
}
private TextField textCausas = new TextField();
public TextField getTextCausas() {
return textCausas;
}
public void setTextCausas(TextField textCausas) {
this.textCausas = textCausas;
}
private TextField textDepartamento = new TextField();
public TextField getTextDepartamento() {
return textDepartamento;
}
public void setTextDepartamento(TextField textDepartamento) {
this.textDepartamento = textDepartamento;
}
private TextField textSeccao = new TextField();
public TextField getTextSeccao() {
return textSeccao;
}
public void setTextSeccao(TextField textSeccao) {
this.textSeccao = textSeccao;
}
private TextField textTurno = new TextField();
public TextField getTextTurno() {
return textTurno;
}
public void setTextTurno(TextField textTurno) {
this.textTurno = textTurno;
}
private RadioButtonGroup formacaoSHST = new RadioButtonGroup();
public RadioButtonGroup getFormacaoSHST()
{
return formacaoSHST;
}
public void setFormacaoSHST( RadioButtonGroup bg )
{
this.formacaoSHST = bg;
}
private RadioButton formacaoSHST_true = new RadioButton();
public RadioButton getFormacaoSHST_true() {
return formacaoSHST_true;
}
public void setFormacaoSHST_true(RadioButton formacaoSHST_true) {
this.formacaoSHST_true = formacaoSHST_true;
}
private RadioButton formacaoSHST_false = new RadioButton();
public RadioButton getFormacaoSHST_false() {
return formacaoSHST_false;
}
public void setFormacaoSHST_false(RadioButton formacaoSHST_false) {
this.formacaoSHST_false = formacaoSHST_false;
}
private RadioButton postoAcidentado_true = new RadioButton();
private RadioButton postoAcidentado_false = new RadioButton();
private RadioButton outrosColaboradores_true = new RadioButton();
private RadioButton outrosColaboradores_false = new RadioButton();
public RadioButton getOutrosColaboradores_false() {
return outrosColaboradores_false;
}
public void setOutrosColaboradores_false(RadioButton outrosColaboradores_false) {
this.outrosColaboradores_false = outrosColaboradores_false;
}
public RadioButton getOutrosColaboradores_true() {
return outrosColaboradores_true;
}
public void setOutrosColaboradores_true(RadioButton outrosColaboradores_true) {
this.outrosColaboradores_true = outrosColaboradores_true;
}
public RadioButton getPostoAcidentado_false() {
return postoAcidentado_false;
}
public void setPostoAcidentado_false(RadioButton postoAcidentado_false) {
this.postoAcidentado_false = postoAcidentado_false;
}
public RadioButton getPostoAcidentado_true() {
return postoAcidentado_true;
}
public void setPostoAcidentado_true(RadioButton postoAcidentado_true) {
this.postoAcidentado_true = postoAcidentado_true;
}
private Button buttonExport = new Button();
public Button getButtonExport() {
return buttonExport;
}
public void setButtonExport(Button buttonExport) {
this.buttonExport = buttonExport;
}
private List< EstatisticaProcessoBean > listEstatisticas = new LinkedList< EstatisticaProcessoBean >();
public List< EstatisticaProcessoBean > getListEstatisticas()
{
return this.listEstatisticas;
}
public void setListEstatisticas( List< EstatisticaProcessoBean > l )
{
this.listEstatisticas = l;
}
private boolean canAccess()
{
boolean canAccess = false;
if ( getSessionBean1().isLoggedIn() )
{
Utilizador u = getSessionBean1().getCurrentUser();
if ( u != null && u.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP )
{
canAccess = true;
}
}
return canAccess;
}
@Override
public void init()
{
super.init();
try
{
_init();
}
catch ( Exception e )
{
log("Page1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e : new FacesException(e);
}
if ( ! canAccess() )
{
try
{
getExternalContext().redirect( "Login.jsp" );
}
catch( Exception e )
{
ErrorLogger.logException( e );
}
}
}
protected SessionBean1 getSessionBean1()
{
return ( SessionBean1 ) getBean( "SessionBean1" );
}
/**
* <p>Callback method that is called after the component tree has been
* restored, but before any event processing takes place. This method
* will <strong>only</strong> 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.</p>
*/
@Override
public void preprocess()
{
txtMsg.setText( getSessionBean1().getMsg() );
getSessionBean1().setMsg( "" );
}
/**
* <p>Callback method that is called just before rendering takes place.
* This method will <strong>only</strong> 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.</p>
*/
@Override
public void prerender()
{
System.out.println( "=== ESTATISTICAS_PROCESSO ===" );
lblUser.setText( getSessionBean1().getCurrentUser().getLogin() );
}
/**
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called (regardless of whether
* or not this was the page that was actually rendered). Customize this
* method to release resources acquired in the <code>init()</code>,
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
@Override
public void destroy()
{
}
/**
* <p>Automatically managed component initialization. <strong>WARNING:</strong>
* This method is automatically generated, so any user-specified code inserted
* here is subject to being replaced.</p>
*/
private void _init()
{
}
public String lnkPlanosActuacao_action()
{
Utilizador u = getSessionBean1().getCurrentUser();
FacesContext fc = getFacesContext().getCurrentInstance();
Global.redirectToPlanos(fc, u);
return null;
}
public String lnkNewUser_action()
{
getSessionBean1().setNavFrom( "EstatisticasProcesso" );
return "gestao_utilizadores";
}
public String lnkEditUser_action()
{
getSessionBean1().setNavFrom( "EstatisticasProcesso" );
getSessionBean1().setModoEdicaoUtilizador( "edit" );
return "user";
}
public String lnkLogout_action()
{
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 null;
}
private Map< String, Object > getFormFieldValues()
{
String por = null;
if ( textPOR.getText() != null )
{
por = ( ( String ) textPOR.getText() ).trim();
por = "".equals( por ) ? null : por;
}
String nome = null;
if ( textNome.getText() != null )
{
nome = ( ( String ) textNome.getText() ).trim();
nome = "".equals( nome ) ? null : nome;
}
String anoOcorrencia = null;
if ( textAnoOcorrencia.getText() != null )
{
anoOcorrencia = ( ( String ) textAnoOcorrencia.getText() ).trim();
anoOcorrencia = "".equals( anoOcorrencia ) ? null : anoOcorrencia;
}
Date dataOcorrencia = null;
if ( calDataOcorrencia.getValue() != null )
{
dataOcorrencia = ( Date )calDataOcorrencia.getValue();
}
String horaOcorrencia = null;
if ( textHoraOcorrencia.getText() != null )
{
horaOcorrencia = ( ( String ) textHoraOcorrencia.getText() ).trim();
horaOcorrencia = "".equals( horaOcorrencia ) ? null : horaOcorrencia;
}
String horasTrabalhadas = null;
if ( textHorasTrabalhadas.getText() != null )
{
horasTrabalhadas = ( ( String ) textHorasTrabalhadas.getText() ).trim();
horasTrabalhadas = "".equals( horasTrabalhadas ) ? null : horasTrabalhadas;
}
String departamento = null;
if ( textDepartamento.getText() != null )
{
departamento = ( ( String ) textDepartamento.getText() ).trim();
departamento = "".equals( departamento ) ? null : departamento;
}
String seccao = null;
if ( textSeccao.getText() != null )
{
seccao = ( ( String ) textSeccao.getText() ).trim();
seccao = "".equals( seccao ) ? null : seccao;
}
String causas = null;
if ( textCausas.getText() != null )
{
causas = ( ( String ) textCausas.getText() ).trim();
causas = "".equals( causas ) ? null : causas;
}
String turno = null;
if ( textTurno.getText() != null )
{
turno = ( ( String ) textTurno.getText() ).trim();
turno = "".equals( turno ) ? null : turno;
}
Boolean shst = null;
if ( formacaoSHST_true.getSelected() != null || formacaoSHST_false.getSelected() != null )
{
shst = ( Boolean ) formacaoSHST_true.getSelected();
}
Boolean postoAcidentado = null;
if ( postoAcidentado_true.getSelected() != null || postoAcidentado_false.getSelected() != null )
{
postoAcidentado = ( Boolean ) postoAcidentado_true.getSelected();
}
Boolean outrosAcidentados = null;
if ( outrosColaboradores_true.getSelected() != null || outrosColaboradores_false.getSelected() != null )
{
outrosAcidentados = ( Boolean ) outrosColaboradores_true.getSelected();
}
Map< String, Object > searchProperties = new HashMap< String, Object >();
searchProperties.put( EstatisticasConstants.KEY_POR, por );
searchProperties.put( EstatisticasConstants.KEY_NOME, nome );
searchProperties.put( EstatisticasConstants.KEY_ANO_OCORRENCIA, anoOcorrencia );
searchProperties.put( EstatisticasConstants.KEY_DATA_OCORRENCIA, dataOcorrencia );
searchProperties.put( EstatisticasConstants.KEY_HORA_OCORRENCIA, horaOcorrencia );
searchProperties.put( EstatisticasConstants.KEY_HORAS_TRABALHADAS, horasTrabalhadas );
searchProperties.put( EstatisticasConstants.KEY_DEPARTAMENTO, departamento );
searchProperties.put( EstatisticasConstants.KEY_SECCAO, seccao );
searchProperties.put( EstatisticasConstants.KEY_CAUSAS_ACIDENTE, causas );
searchProperties.put( EstatisticasConstants.KEY_TURNO_TRABALHO, turno );
searchProperties.put( EstatisticasConstants.KEY_FORMACAO_SHST, shst );
searchProperties.put( EstatisticasConstants.KEY_POSTO_ACIDENTADO, postoAcidentado );
searchProperties.put( EstatisticasConstants.KEY_OUTROS_ACIDENTADOS, outrosAcidentados );
return searchProperties;
}
private void getEstatisticas()
{
Map< String, Object > searchProperties = getFormFieldValues();
EstatisticasDataProvider edp = EstatisticasDataProvider.getInstance();
setListEstatisticas( edp.getEstatisticas( searchProperties ) );
}
public String buttonEstatistica_action()
{
getEstatisticas();
buttonExport.setRendered( true );
return null;
}
public String buttonExport_action()
{
System.out.println( "=== EXPORT TO EXCEL ===" );
getEstatisticas();
System.out.println( "-> " + getListEstatisticas().size() );
HSSFWorkbook book = new HSSFWorkbook();
Map< String, HSSFCellStyle > styles = createStyles( book );
HSSFSheet sheet = book.createSheet( "Estatisticas" );
int row = writeFilters( sheet, 0 );
HSSFRow headerRow = getRow( sheet, row );
HSSFCell columnEstado = getCell( headerRow, 0 );
columnEstado.setCellValue( "Estado" );
columnEstado.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER ) );
HSSFCell columnFase = getCell( headerRow, 1 );
columnFase.setCellValue( "Fase" );
columnFase.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER ) );
HSSFCell columnCount = getCell( headerRow, 2 );
columnCount.setCellValue( "Contagem" );
columnCount.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER ) );
row++;
for ( EstatisticaProcessoBean line : getListEstatisticas() )
{
HSSFRow lineRow = getRow( sheet, row );
HSSFCell columnEstadoValue = getCell( lineRow, 0 );
columnEstadoValue.setCellValue( line.getEstado() );
columnEstadoValue.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL ) );
HSSFCell columnFaseValue = getCell( lineRow, 1 );
columnFaseValue.setCellValue( line.getFase() );
columnFaseValue.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL ) );
HSSFCell columnCountValue = getCell( lineRow, 2 );
columnCountValue.setCellValue( line.getCount() );
columnCountValue.setCellStyle( styles.get( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL ) );
row++;
}
sheet.autoSizeColumn( 0, true );
sheet.autoSizeColumn( 1, true );
sheet.autoSizeColumn( 2, true );
try
{
saveWorkbook( book );
}
catch ( Exception ex )
{
ErrorLogger.logException( ex );
getSessionBean1().setMsg( "Erro a gerar o ficheiro." );
}
return null;
}
private Map< String, HSSFCellStyle > createStyles( HSSFWorkbook book )
{
Map< String, HSSFCellStyle > styles = new HashMap< String, HSSFCellStyle >();
HSSFCellStyle style;
HSSFFont headerFont = book.createFont();
headerFont.setFontHeightInPoints( ( short ) 12 );
headerFont.setBoldweight( HSSFFont.BOLDWEIGHT_BOLD );
HSSFFont normalFont = book.createFont();
headerFont.setFontHeightInPoints( ( short ) 12 );
style = book.createCellStyle();
// style.setAlignment( HSSFCellStyle.ALIGN_CENTER );
style.setVerticalAlignment( HSSFCellStyle.VERTICAL_CENTER );
style.setFont( headerFont );
styles.put( EstatisticasConstants.KEY_STYLE_COLUMN_HEADER, style );
style = book.createCellStyle();
style.setVerticalAlignment( HSSFCellStyle.VERTICAL_CENTER );
style.setFont( normalFont );
styles.put( EstatisticasConstants.KEY_STYLE_COLUMN_NORMAL, style );
return styles;
}
private HSSFRow getRow( HSSFSheet sheet, int rowNumber )
{
HSSFRow row = sheet.getRow( rowNumber );
if ( row == null )
{
row = sheet.createRow( rowNumber );
}
return row;
}
private HSSFCell getCell( HSSFRow row, int cellNumber )
{
HSSFCell cell = row.getCell( cellNumber );
if ( cell == null )
{
cell = row.createCell( cellNumber );
}
return cell;
}
private int writeFilters( HSSFSheet sheet, int row )
{
Map< String, Object > searchProperties = getFormFieldValues();
String por = ( String ) searchProperties.get( EstatisticasConstants.KEY_POR );
String nome = ( String ) searchProperties.get( EstatisticasConstants.KEY_NOME );
String anoOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_ANO_OCORRENCIA );
Date dataOcorrencia = ( Date ) searchProperties.get( EstatisticasConstants.KEY_DATA_OCORRENCIA );
String horaOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORA_OCORRENCIA );
String horasTrabalhadas = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORAS_TRABALHADAS );
String departamento = ( String ) searchProperties.get( EstatisticasConstants.KEY_DEPARTAMENTO );
String seccao = ( String ) searchProperties.get( EstatisticasConstants.KEY_SECCAO );
String causas = ( String ) searchProperties.get( EstatisticasConstants.KEY_CAUSAS_ACIDENTE );
String turno = ( String ) searchProperties.get( EstatisticasConstants.KEY_TURNO_TRABALHO );
Boolean formacao_shst = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_FORMACAO_SHST );
Boolean postoAcidentado = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_POSTO_ACIDENTADO );
Boolean outrosAcidentados = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_OUTROS_ACIDENTADOS );
String keyName = null;
HSSFRow currentRow = null;
HSSFCell columnLabel = null;
HSSFCell columnValue = null;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( por );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( nome );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( anoOcorrencia );
row++;
final SimpleDateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" );
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( dataOcorrencia == null ? "" : D_F.format( dataOcorrencia ) );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( horaOcorrencia );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( horasTrabalhadas );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( departamento );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( seccao );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( causas );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
columnValue.setCellValue( turno );
row++;
keyName = EstatisticasConstants.KEY_NAMES[ row ];
currentRow = getRow( sheet, row );
columnLabel = getCell( currentRow, 0 );
columnLabel.setCellValue( keyName );
columnValue = getCell( currentRow, 1 );
String fshst = "";
if ( formacao_shst != null )
{
fshst = formacao_shst ? "Sim" : "Não";
}
columnValue.setCellValue( fshst );
row++;
row++;
return row++;
}
private void saveWorkbook( HSSFWorkbook book )
throws Exception
{
byte[] bytes = book.getBytes();
System.out.println( "BOOK LEN : " + bytes.length );
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response = ( HttpServletResponse ) context.getExternalContext().getResponse();
response.setHeader( "Expires", "0" );
response.setHeader( "Cache-Control", "must-revalidate, post-check=0, pre-check=0" );
response.setHeader( "Pragma", "public" );
response.setContentType( "application/vnd.ms-excel" );
response.addHeader( "Content-disposition", "attachment;filename=\"EstatisticasProcesso.xls\"" );
response.setContentLength( bytes.length );
response.getOutputStream().write( bytes );
response.getOutputStream().flush();
response.getOutputStream().close();
context.responseComplete();
System.out.println( "SHOW workbook DONE" );
}
}

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Permissao;
import beans.Utilizador;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Button;

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,7 @@
*/
package analiseacidentestrabalho;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import beans.AnaliseAcidente;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,7 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,7 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Button;

@ -6,6 +6,9 @@
*/
package analiseacidentestrabalho;
import beans.Medico;
import beans.Trabalhador;
import beans.Utilizador;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;

@ -6,6 +6,7 @@
*/
package analiseacidentestrabalho;
import beans.Utilizador;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Button;

@ -6,7 +6,12 @@
*/
package analiseacidentestrabalho;
import beans.Medico;
import beans.Utilizador;
import beans.Acidentado;
import beans.AnaliseAcidente;
import com.sun.rave.web.ui.appbase.AbstractSessionBean;
import global.Global;
import javax.faces.FacesException;
import pagestate.AnaliseAcidenteTrabalhoState;
@ -33,6 +38,17 @@ public class SessionBean1 extends AbstractSessionBean {
}
// </editor-fold>
private String logoEmpresaUrl = "";
private Boolean canAccessEstatisticas = false;
public Boolean getCanAccessEstatisticas() {
return canAccessEstatisticas;
}
public void setCanAccessEstatisticas(Boolean canAccessEstatisticas) {
this.canAccessEstatisticas = canAccessEstatisticas;
}
/**
* <p>Construct a new session data bean instance.</p>
*/
@ -64,6 +80,7 @@ public class SessionBean1 extends AbstractSessionBean {
setFromAnaliseDeletion(false);
setIeBug(false);
setCorrecao(null);
setCanAccessEstatisticas( false );
}
/**
@ -161,6 +178,8 @@ public class SessionBean1 extends AbstractSessionBean {
public void setCurrentUser(Utilizador currentUser) {
this.currentUser = currentUser;
setCanAccessEstatisticas( currentUser != null && currentUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_SIPRP );
}
private db.AnalisesActualDataProvider analisesActualDataProvider;
@ -721,13 +740,13 @@ public class SessionBean1 extends AbstractSessionBean {
this.ieBug = ieBug;
}
private analiseacidentestrabalho.Correcao correcao;
private beans.Correcao correcao;
public analiseacidentestrabalho.Correcao getCorrecao() {
public beans.Correcao getCorrecao() {
return correcao;
}
public void setCorrecao(analiseacidentestrabalho.Correcao correcao) {
public void setCorrecao(beans.Correcao correcao) {
this.correcao = correcao;
}

@ -6,6 +6,8 @@
*/
package analiseacidentestrabalho;
import beans.Permissao;
import beans.Utilizador;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Button;

@ -6,6 +6,13 @@
*/
package analiseacidentestrabalho;
import beans.Recomendacao;
import beans.Seccao;
import beans.Causa;
import beans.Medida;
import beans.Utilizador;
import beans.Acidentado;
import beans.AnaliseAcidente;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Button;

@ -7,7 +7,7 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
/**
*

@ -7,8 +7,9 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
@ -16,7 +17,8 @@ import java.sql.Time;
*
* @author lluis
*/
public class AnaliseAcidente {
public class AnaliseAcidente implements Serializable
{
private Integer id;
private Integer nr;
private String analise_nr;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Causa {
public class Causa implements Serializable
{
private Integer id;
private String causa;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Controle {
public class Controle implements Serializable
{
private Integer id;
private Integer analise_year;
private Integer last_analise_nr;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Correcao {
public class Correcao implements Serializable
{
private Integer analise_id;
private String correcao; // 'y'/ 'n'
private Integer estado_actual;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Departamento {
public class Departamento implements Serializable
{
private Integer id;
private String descricao;
private String activo;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Estabelecimento {
public class Estabelecimento implements Serializable
{
private Integer id;
private String nome_plain;
private String nome;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Estado {
public class Estado implements Serializable
{
private Integer estado;
private String descricao;
/** Creates a new instance of Estado */

@ -0,0 +1,49 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import java.io.Serializable;
/**
*
* @author dneves
*/
public class EstatisticaProcessoBean implements Serializable
{
private Integer estado = null;
private String fase = null;
private Long count = new Long( 0 );
public EstatisticaProcessoBean()
{
}
public Long getCount() {
return count;
}
public void setCount(Long count) {
this.count = count;
}
public Integer getEstado() {
return estado;
}
public void setEstado(Integer estado) {
this.estado = estado;
}
public String getFase() {
return fase;
}
public void setFase(String fase) {
this.fase = fase;
}
}

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Medico {
public class Medico implements Serializable
{
private Integer id;
private String nome;
private String numero_cedula;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Medida {
public class Medida implements Serializable
{
private Integer id;
private Integer analise_id;
private String medida;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Permissao {
public class Permissao implements Serializable
{
private Integer id;
private Integer user_id;
private Integer codigo_permissao;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Recomendacao {
public class Recomendacao implements Serializable
{
private Integer id;
private Integer analise_id;
private String recomendacao;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Seccao {
public class Seccao implements Serializable
{
private Integer id;
private String descricao;
private Integer departamento_id;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class TecnicoSaude {
public class TecnicoSaude implements Serializable
{
private Integer id;
private String nome;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class TipoUtilizador {
public class TipoUtilizador implements Serializable
{
private Integer id;
private Integer tipo;
private String descricao;

@ -7,13 +7,16 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
/**
*
* @author lluis
*/
public class Trabalhador {
public class Trabalhador implements Serializable
{
private Integer id;
private String nome;
private java.sql.Date data_nascimento;

@ -7,15 +7,17 @@
* and open the template in the editor.
*/
package analiseacidentestrabalho;
package beans;
import java.io.Serializable;
import java.sql.Date;
/**
*
* @author lluis
*/
public class Utilizador {
public class Utilizador implements Serializable
{
private Integer id;
private String login;
private String password;

@ -9,20 +9,20 @@
package db;
import analiseacidentestrabalho.Acidentado;
import analiseacidentestrabalho.AnaliseAcidente;
import analiseacidentestrabalho.Causa;
import analiseacidentestrabalho.Controle;
import analiseacidentestrabalho.Correcao;
import analiseacidentestrabalho.Departamento;
import analiseacidentestrabalho.Estabelecimento;
import analiseacidentestrabalho.Medico;
import analiseacidentestrabalho.Medida;
import analiseacidentestrabalho.Recomendacao;
import analiseacidentestrabalho.Seccao;
import analiseacidentestrabalho.TecnicoSaude;
import analiseacidentestrabalho.TipoUtilizador;
import analiseacidentestrabalho.Trabalhador;
import beans.Acidentado;
import beans.AnaliseAcidente;
import beans.Causa;
import beans.Controle;
import beans.Correcao;
import beans.Departamento;
import beans.Estabelecimento;
import beans.Medico;
import beans.Medida;
import beans.Recomendacao;
import beans.Seccao;
import beans.TecnicoSaude;
import beans.TipoUtilizador;
import beans.Trabalhador;
import com.evolute.utils.strings.StringPlainer;
import com.sun.rave.web.ui.model.Option;
import global.Global;
@ -2800,7 +2800,7 @@ public class AnalisesDataProvider {
private String getFase(int estado)
public String getFase(int estado)
{
if(estado == Global.ESTADO_SEG)
{
@ -2846,6 +2846,10 @@ public class AnalisesDataProvider {
{
return "FASE 8 - SIPRP - CONCLUSÃO";
}
else if ( estado == Global.ESTADO_CONCLUIDO )
{
return "FASE 9 - CONCLUÍDO";
}
return null;
}

@ -21,7 +21,7 @@ import javax.servlet.http.HttpSession;
* @author lluis
*/
public class Dblocal {
// String connectionURL = "jdbc:postgresql://storage:5432/siprp_local_3"; //testes
// String connectionURL = "jdbc:postgresql://storage:5432/siprp_local_3_20100713"; //testes
String connectionURL = "jdbc:postgresql://localhost:5436/siprp_local_3";
String User = "postgres";
String Pass = null;

@ -0,0 +1,42 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package db;
/**
*
* @author dneves
*/
public interface EstatisticasConstants
{
public static final String[] KEY_NAMES = new String[] {
"POR", "Nome", "Ano Ocorrência", "Data Ocorrência", "Hora Ocorrência", "Horas Trabalhadas no Turno",
"Departamento", "Secção", "Causas do Acidente", "Turno de Trabalho", "Formação SHST"
//TODO: falta os 2 ultimos
};
public static final String KEY_POR = "acidentados.numero_mecanografico";
public static final String KEY_NOME = "acidentados.nome";
public static final String KEY_ANO_OCORRENCIA = "date_part( 'year', analises_acidentes.data_acidente )";
public static final String KEY_DATA_OCORRENCIA = "analises_acidentes.data_acidente";
public static final String KEY_HORA_OCORRENCIA = "analises_acidentes.hora_acidente";
public static final String KEY_HORAS_TRABALHADAS = "analises_acidentes.horas_turno";
public static final String KEY_DEPARTAMENTO = "departamentos.descricao";
public static final String KEY_SECCAO = "seccoes.descricao";
public static final String KEY_CAUSAS_ACIDENTE = "analises_acidentes.causas";
public static final String KEY_TURNO_TRABALHO = "acidentados.turno";
public static final String KEY_FORMACAO_SHST = "analises_acidentes.formacao_shst";
public static final String KEY_POSTO_ACIDENTADO = "posto_acidentado";
public static final String KEY_OUTROS_ACIDENTADOS = "outros_acidentados";
public static final String KEY_STYLE_COLUMN_HEADER = "columnHeader";
public static final String KEY_STYLE_COLUMN_NORMAL = "columnNormal";
}

@ -0,0 +1,225 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package db;
import beans.EstatisticaProcessoBean;
import com.evolute.utils.error.ErrorLogger;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author dneves
*/
public class EstatisticasDataProvider
{
private static final SimpleDateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" );
private static final SimpleDateFormat T_F = new SimpleDateFormat( "HH:mm:ss" );
private static EstatisticasDataProvider INSTANCE = null;
private Db db = null;
private EstatisticasDataProvider()
{
db = new Db();
}
public static synchronized EstatisticasDataProvider getInstance()
{
if ( INSTANCE == null )
{
INSTANCE = new EstatisticasDataProvider();
}
return INSTANCE;
}
private Statement createStatement()
{
if ( db == null )
{
db = new Db();
}
return db.createStatement();
}
public List< EstatisticaProcessoBean > getEstatisticas( Map< String, Object > searchProperties )
{
String por = ( String ) searchProperties.get( EstatisticasConstants.KEY_POR );
String nome = ( String ) searchProperties.get( EstatisticasConstants.KEY_NOME );
String anoOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_ANO_OCORRENCIA );
Date dataOcorrencia = ( Date ) searchProperties.get( EstatisticasConstants.KEY_DATA_OCORRENCIA );
String horaOcorrencia = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORA_OCORRENCIA );
String horasTrabalhadas = ( String ) searchProperties.get( EstatisticasConstants.KEY_HORAS_TRABALHADAS );
String departamento = ( String ) searchProperties.get( EstatisticasConstants.KEY_DEPARTAMENTO );
String seccao = ( String ) searchProperties.get( EstatisticasConstants.KEY_SECCAO );
String causas = ( String ) searchProperties.get( EstatisticasConstants.KEY_CAUSAS_ACIDENTE );
String turno = ( String ) searchProperties.get( EstatisticasConstants.KEY_TURNO_TRABALHO );
Boolean formacao_shst = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_FORMACAO_SHST );
Boolean postoAcidentado = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_POSTO_ACIDENTADO );
Boolean outrosAcidentados = ( Boolean ) searchProperties.get( EstatisticasConstants.KEY_OUTROS_ACIDENTADOS );
String tableNames = "analises_acidentes";
String joinConditions = "";
String whereConditions = " analises_acidentes.apagada = 'n' ";
if ( por != null || nome != null || turno != null )
{
tableNames += ", acidentados";
joinConditions += " analises_acidentes.acidentado_id = acidentados.id ";
}
if ( departamento != null )
{
tableNames += ", departamentos";
joinConditions += ( "".equals( joinConditions ) ? "" : " AND " ) + " analises_acidentes.departamento_id = departamentos.id ";
}
if ( seccao != null )
{
tableNames += ", seccoes";
joinConditions += ( "".equals( joinConditions ) ? "" : " AND " ) + " analises_acidentes.seccao_id = seccoes.id ";
}
if ( por != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_POR + " = '" + por + "' ";
}
if ( nome != null )
{
nome = nome.replaceAll( " ", "%" );
whereConditions += " AND " + EstatisticasConstants.KEY_NOME + " ILIKE '%" + nome + "%' ";
}
if ( turno != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_TURNO_TRABALHO + " = '" + turno + "' ";
}
if ( anoOcorrencia != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_ANO_OCORRENCIA + " = '" + anoOcorrencia + "' ";
}
if ( dataOcorrencia != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_DATA_OCORRENCIA + " = '" + D_F.format( dataOcorrencia ) + "' ";
}
if ( horaOcorrencia != null )
{
String hora = null;
try
{
Date dateOcorrencia = T_F.parse( horaOcorrencia );
hora = T_F.format( dateOcorrencia );
}
catch ( ParseException ex )
{
ErrorLogger.logException( ex );
}
if ( hora != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_HORA_OCORRENCIA + " = '" + hora + "' " ;
}
}
if ( horasTrabalhadas != null )
{
Integer nrHoras = null;
try
{
nrHoras = Integer.parseInt( horasTrabalhadas );
}
catch ( Exception e )
{
ErrorLogger.logException( e );
}
if ( nrHoras != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_HORAS_TRABALHADAS + " = " + nrHoras + " ";
}
}
if ( causas != null )
{
causas = causas.replaceAll( " ", "%" );
whereConditions += " AND " + EstatisticasConstants.KEY_CAUSAS_ACIDENTE + " ILIKE '%" + causas + "%' ";
}
if ( departamento != null )
{
departamento = departamento.replaceAll( " ", "%" );
whereConditions += " AND " + EstatisticasConstants.KEY_DEPARTAMENTO + " ILIKE '%" + departamento + "%' ";
}
if ( seccao != null )
{
seccao = seccao.replaceAll( " ", "%" );
whereConditions += " AND " + EstatisticasConstants.KEY_SECCAO + " ILIKE '%" + seccao + "%' ";
}
if ( formacao_shst != null )
{
whereConditions += " AND " + EstatisticasConstants.KEY_FORMACAO_SHST + " = '" + (formacao_shst ? "t" : "f") + "' ";
}
String sql = "SELECT analises_acidentes.estado, COUNT( analises_acidentes.* ) AS count " +
"FROM " + tableNames + " " +
"WHERE " + ( "".equals( joinConditions ) ? "" : joinConditions + " AND " ) + whereConditions + " " +
"GROUP BY analises_acidentes.estado " +
"ORDER BY analises_acidentes.estado";
List< EstatisticaProcessoBean > stats = new LinkedList< EstatisticaProcessoBean >();
try
{
stats = getEstatisticasForSQL(sql);
}
catch ( Exception ex )
{
ErrorLogger.logException( ex );
}
return stats;
}
private List< EstatisticaProcessoBean > getEstatisticasForSQL( String sql ) throws Exception
{
// System.out.println( "\nSQL -> " + sql );
List< EstatisticaProcessoBean > stats = new LinkedList< EstatisticaProcessoBean >();
Statement st = createStatement();
ResultSet rs = st.executeQuery( sql );
AnalisesDataProvider adp = new AnalisesDataProvider();
// System.out.println( "\nListing ..." );
while ( rs.next() )
{
Integer estado = rs.getInt( "estado" );
Long count = rs.getLong( "count" );
String fase = adp.getFase( estado );
// System.out.println( "\tEstado : " + estado + " => " + fase + " : " + count );
if ( fase != null )
{
EstatisticaProcessoBean bean = new EstatisticaProcessoBean();
bean.setEstado( estado );
bean.setFase( fase );
bean.setCount( count );
stats.add( bean );
}
}
// System.out.println( "Listing DONE." );
return stats;
}
}

@ -9,10 +9,10 @@
package db;
import analiseacidentestrabalho.Medico;
import analiseacidentestrabalho.Permissao;
import analiseacidentestrabalho.TecnicoSaude;
import analiseacidentestrabalho.Utilizador;
import beans.Medico;
import beans.Permissao;
import beans.TecnicoSaude;
import beans.Utilizador;
import com.sun.rave.web.ui.model.Option;
import global.Global;
import java.sql.ResultSet;
@ -120,7 +120,8 @@ public class UtilizadoresDataProvider {
Statement st = createStatement();
String sql = "SELECT * FROM utilizadores WHERE LOWER(login) = '" + login.toLowerCase() + "' AND apagado = 'n'";
ResultSet rs = st.executeQuery(sql);
rs.first();
if ( rs.first() )
{
u.setId(new Integer(rs.getInt("id")));
u.setLogin(rs.getString("login"));
u.setPassword(rs.getString("password"));
@ -140,6 +141,7 @@ public class UtilizadoresDataProvider {
u.setGestor_geral(rs.getString("gestor_geral"));
u.setPrimeiro_login(rs.getString("primeiro_login"));
u.setApagado(rs.getString("apagado"));
}
return u;
}

@ -9,7 +9,7 @@
package global;
import analiseacidentestrabalho.Utilizador;
import beans.Utilizador;
//import com.sun.org.apache.bcel.internal.generic.GETFIELD;
import java.io.File;
import java.io.FileInputStream;

@ -9,8 +9,8 @@
package pdf;
import analiseacidentestrabalho.Acidentado;
import analiseacidentestrabalho.AnaliseAcidente;
import beans.Acidentado;
import beans.AnaliseAcidente;
import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Font;

@ -15,14 +15,14 @@ import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.XMLOutputter;
import analiseacidentestrabalho.Acidentado;
import analiseacidentestrabalho.AnaliseAcidente;
import analiseacidentestrabalho.Causa;
import analiseacidentestrabalho.Estabelecimento;
import analiseacidentestrabalho.Medida;
import analiseacidentestrabalho.Recomendacao;
import analiseacidentestrabalho.Seccao;
import analiseacidentestrabalho.Utilizador;
import beans.Acidentado;
import beans.AnaliseAcidente;
import beans.Causa;
import beans.Estabelecimento;
import beans.Medida;
import beans.Recomendacao;
import beans.Seccao;
import beans.Utilizador;
import com.evolute.utils.fop.FOPCreator;
import com.evolute.utils.fop.PDFCreator;

@ -5,7 +5,7 @@
package phaselistener;
import analiseacidentestrabalho.Utilizador;
import beans.Utilizador;
import global.Global;
import javax.faces.application.NavigationHandler;
import javax.faces.component.UIViewRoot;

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2"
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<ui:page id="page">
<ui:html id="html">
<ui:head id="head">
<ui:link id="link_css" url="/resources/stylesheet.css"/>
<script type="text/javascript">
function showPdf()
{
sOptions = " width = '" + screen.availWidth + "'";
sOptions += " height= '" + screen.availHeight + "'";
var wOpen;
wOpen = window.open('./resources/pdfs/Ajuda.pdf','', sOptions );
wOpen.focus();
wOpen.moveTo(0,0);
wOpen.resizeTo( screen.availWidth, screen.availHeight );
}
</script>
</ui:head>
<ui:body id="body" style="-rave-layout: grid">
<h:panelGrid columns="1" id="gridBase" style="height: 24px; left: 0px; top: 60px; position: absolute; width: 100%" styleClass="centerBlock" width="648">
<h:panelGrid columns="1" id="gridLayout" style="height: 15px; width: 80%" styleClass="centerBlock">
<!-- header -->
<ui:form id="form0">
<h:panelGrid columnClasses="gridColLeft, gridColRightBottom" columns="2" id="gridPanel8" style="border-bottom: solid #000000 1px; height: 24px; width: 100%" width="312">
<ui:panelGroup id="groupPanel5" style="height: 24px; width: 216px">
<ui:image id="image1" url="/resources/images/SIPRP_logo_small.jpg"/>
<ui:image height="40" id="image2" url="#{SessionBean1.logoEmpresaUrl}" width="150"/>
</ui:panelGroup>
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel11" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel6">
<ui:hyperlink action="#{EstatisticasProcesso.lnkPlanosActuacao_action}" binding="#{EstatisticasProcesso.lnkPlanosActuacao}" id="lnkPlanosActuacao" text="planos actuação&gt;&gt;"/>
</ui:panelGroup>
<ui:panelGroup id="groupPanel9" style="height: 24px">
<ui:staticText binding="#{EstatisticasProcesso.lblUser}" escape="false" id="lblUser" styleClass="labelBold"/>
<ui:staticText escape="false" id="staticText9" text="   "/>
<ui:hyperlink action="#{EstatisticasProcesso.lnkNewUser_action}" disabled="true" id="lnkNewUser1" style="width: 120px" text="gerir utilizadores"/>
<ui:staticText escape="false" id="staticText12" text=" | "/>
<ui:hyperlink action="#{EstatisticasProcesso.lnkEditUser_action}" id="lnkEditUser1" text="alterar dados utilizador"/>
<ui:staticText escape="false" id="staticText13" text=" | "/>
<ui:hyperlink id="lnkAjuda1" onClick="showPdf();" style="" text="ajuda "/>
<ui:staticText id="staticText15" style="width: 0px" text="|"/>
<ui:hyperlink action="#{EstatisticasProcesso.lnkLogout_action}" id="lnkLogout1" text="sair&gt;&gt;"/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
</ui:form>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel10" style="height: 24px; width: 100%" width="504">
<ui:staticText binding="#{EstatisticasProcesso.txtMsg}" escape="false" id="txtMsg" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
</h:panelGrid>
<!-- body -->
<h:panelGrid columnClasses="gridLayoutTopCols, gridLayoutTopCols" columns="1"
id="gridLayoutTop" style="height: 15px; position: relative; vertical-align: top; width: 100%">
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridEstatisticas" style="background-color: #f6f4e8; height: 24px; position: relative; width: 100%" width="360">
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel1" style="height: 24px; width: 100%">
<ui:staticText id="staticText1" text="Estatisticas" style="font-size: 18px; font-weight: bold; height: 24px;"/>
</h:panelGrid>
<h:form id="formEstatistica">
<h:panelGrid id="panelGrid1" columns="2">
<ui:staticText id="labelPOR" escape="false" text="POR:" styleClass="labelBold" />
<ui:textField id="textPOR" binding="#{EstatisticasProcesso.textPOR}" />
<ui:staticText id="labelNome" escape="false" text="Nome:" styleClass="labelBold" />
<ui:textField id="textNome" binding="#{EstatisticasProcesso.textNome}" />
<ui:staticText id="labelAnoOcorrencia" escape="false" text="Ano de ocorrência:" styleClass="labelBold" />
<ui:textField id="textAnoOcorrencia" binding="#{EstatisticasProcesso.textAnoOcorrencia}" />
<ui:staticText id="labelDataOcorrencia" escape="false" text="Data de ocorrência:" styleClass="labelBold" />
<ui:calendar binding="#{EstatisticasProcesso.calDataOcorrencia}" dateFormatPattern="yyyy-MM-dd" id="calDataOcorrencia" />
<ui:staticText id="labelHoraOcorrencia" escape="false" text="Hora de ocorrência:" styleClass="labelBold" />
<ui:textField id="textHoraOcorrencia" binding="#{EstatisticasProcesso.textHoraOcorrencia}" />
<ui:staticText id="labelHorasTrabalhadas" escape="false" text="Nº horas trabalhadas por turno:" styleClass="labelBold" />
<ui:textField id="textHorasTrabalhadas" binding="#{EstatisticasProcesso.textHorasTrabalhadas}" />
<ui:staticText id="labelDepartamento" escape="false" text="Departamento:" styleClass="labelBold" />
<ui:textField id="textDepartamento" binding="#{EstatisticasProcesso.textDepartamento}" />
<ui:staticText id="labelSeccao" escape="false" text="Secção:" styleClass="labelBold" />
<ui:textField id="textSeccao" binding="#{EstatisticasProcesso.textSeccao}" />
<ui:staticText id="labelCausas" escape="false" text="Causas do acidente:" styleClass="labelBold" />
<ui:textField id="textCausas" binding="#{EstatisticasProcesso.textCausas}" />
<ui:staticText id="labelTurno" escape="false" text="Turno de trabalho:" styleClass="labelBold" />
<ui:textField id="textTurno" binding="#{EstatisticasProcesso.textTurno}" />
<ui:staticText id="labelFormacaoSHST" escape="false" text="Formação em SHST" styleClass="labelBold" />
<ui:panelGroup>
<ui:radioButton binding="#{EstatisticasProcesso.formacaoSHST_true}" id="formacaoSHST_true" name="formacaoSHST" />
<ui:staticText id="labelFormacaoSHST_SIM" escape="false" text="Sim" />
<ui:radioButton binding="#{EstatisticasProcesso.formacaoSHST_false}" id="formacaoSHST_false" name="formacaoSHST" />
<ui:staticText id="labelFormacaoSHST_NAO" escape="false" text="Não" />
</ui:panelGroup>
<!--
<ui:staticText id="labelPostoAcidentado" escape="false" text="outras ocorrências/incidências no mesmo posto de trabalho com o colaborador acidentado" styleClass="labelBold" />
<ui:panelGroup>
<ui:radioButton binding="#{EstatisticasProcesso.postoAcidentado_true}" id="postoAcidentado_true" name="postoAcidentadoRadio" />
<ui:staticText id="labelPostoAcidentado_SIM" escape="false" text="Sim" />
<ui:radioButton binding="#{EstatisticasProcesso.postoAcidentado_false}" id="postoAcidentado_false" name="postoAcidentadoRadio" />
<ui:staticText id="labelPostoAcidentado_NAO" escape="false" text="Não" />
</ui:panelGroup>
<ui:staticText id="labelOutrosColaboradores" escape="false" text="outras ocorrências/incidências semelhantes com outros colaboradores" styleClass="labelBold" />
<ui:panelGroup>
<ui:radioButton binding="#{EstatisticasProcesso.outrosColaboradores_true}" id="outrosColaboradores_true" name="outrosColaboradoresRadio" />
<ui:staticText id="labeloutrosColaboradores_SIM" escape="false" text="Sim" />
<ui:radioButton binding="#{EstatisticasProcesso.outrosColaboradores_false}" id="outrosColaboradores_false" name="outrosColaboradoresRadio" />
<ui:staticText id="labeloutrosColaboradores_NAO" escape="false" text="Não" />
</ui:panelGroup>
-->
<ui:button id="buttonEstatistica" action="#{EstatisticasProcesso.buttonEstatistica_action}" text="Pesquisar" />
</h:panelGrid>
</h:form>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel2" style="height: 24px; width: 100%; margin-top: 50px;">
<ui:staticText id="staticText2" text="Resultados" style="font-size: 18px; font-weight: bold; height: 24px;" />
</h:panelGrid>
<ui:table id="tableEstatisticas" binding="#{EstatisticasProcesso.tableEstatisticas}" augmentTitle="false" style="width: 50%; margin-top: 20px;" styleClass="centerBlock">
<ui:tableRowGroup id="tableEstatisticasRow" rows="10" sourceData="#{EstatisticasProcesso.listEstatisticas}" sourceVar="row">
<ui:tableColumn id="tableEstatisticasColumn_Estado" headerText="Estado" style="width: 33%;">
<ui:staticText id="labelEstado" text="#{row.value['estado']}" />
</ui:tableColumn>
<ui:tableColumn id="tableEstatisticasColumn_Fase" headerText="Fase">
<ui:staticText id="labelFase" text="#{row.value['fase']}" />
</ui:tableColumn>
<ui:tableColumn id="tableEstatisticasColumn_Count" headerText="Contagem" style="width: 33%;">
<ui:staticText id="labelContagem" text="#{row.value['count']}" />
</ui:tableColumn>
</ui:tableRowGroup>
</ui:table>
<h:form>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel3" style="height: 24px; width: 100%; margin-top: 20px; margin-bottom: 20px;">
<ui:button id="buttonExport" binding="#{EstatisticasProcesso.buttonExport}" action="#{EstatisticasProcesso.buttonExport_action}" text="Exportar" rendered="false" />
</h:panelGrid>
</h:form>
</h:panelGrid>
</h:panelGrid>
<!-- footer -->
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel9" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel8" style="border-bottom: solid rgb(255, 255, 255) 1px; height: 21px">
<ui:staticText id="staticText6" text="Software desenvolvido por "/>
<ui:image height="21" id="image3" url="/resources/images/logo_evolute_small.png" width="100"/>
<ui:staticText escape="false" id="staticText7" text="&amp;nbsp;&amp;copy; 2008 "/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<!-- google analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try
{
var pageTracker = _gat._getTracker("UA-6942416-1");
pageTracker._trackPageview();
}
catch( err ) {}
</script>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>

@ -37,6 +37,10 @@
</ui:panelGroup>
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel3" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel2">
<ui:hyperlink action="estatisticasProcesso" id="linkEstatisticas" text="Estatisticas" rendered="#{SessionBean1.canAccessEstatisticas}" />
<ui:staticText escape="false" id="sepUpper" text=" | " rendered="#{SessionBean1.canAccessEstatisticas}" />
<ui:hyperlink action="#{FormDirSiprp.lnkPlanosActuacao_action}" binding="#{FormDirSiprp.lnkPlanosActuacao}"
id="lnkPlanosActuacao" text="planos actuação&gt;&gt;"/>
</ui:panelGroup>

@ -127,4 +127,10 @@
<managed-bean-class>analiseacidentestrabalho.FormGestor</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>EstatisticasProcesso</managed-bean-name>
<managed-bean-class>analiseacidentestrabalho.EstatisticasProcesso</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>

@ -191,6 +191,10 @@
<navigation-case>
<from-outcome>gestao_utilizadores</from-outcome>
<to-view-id>/GestaoUtilizadores.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>estatisticasProcesso</from-outcome>
<to-view-id>/EstatisticasProcesso.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
@ -452,4 +456,18 @@
<to-view-id>/Login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!-- FROM EstatisticasProcesso -->
<navigation-rule>
<from-view-id>/EstatisticasProcesso.jsp</from-view-id>
<navigation-case>
<from-outcome>user</from-outcome>
<to-view-id>/FichaUtilizador.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>gestao_utilizadores</from-outcome>
<to-view-id>/GestaoUtilizadores.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>

Loading…
Cancel
Save