git-svn-id: https://svn.coded.pt/svn/SIPRP@1272 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
A Fragateiro 16 years ago
parent f5ce4a544f
commit efb7893ea8

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="SIPRPSoft/src"/>
<classpathentry kind="src" path="common/src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/jdo.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/jdom.jar"/>
<classpathentry kind="lib" path="lib.tools/servlet-api.jar"/>
<classpathentry kind="lib" path="web/lib/commons-fileupload-1.0.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/jxl-2.6.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/jpox-1.0.4.jar"/>
<classpathentry kind="lib" path="web/lib/velocity-dep-1.4.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/jai_imageio.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/nlog4j-1.2.25.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/avalon-framework-4.2.0.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/postgresql-8.0-317.jdbc3.jar"/>
<classpathentry kind="lib" path="web/lib/commons-email-1.0-dev.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/iText-2.0.7.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/PDFRenderer.jar"/>
<classpathentry kind="lib" path="AnaliseAcidentesTrabalho/jars/activation.jar"/>
<classpathentry kind="lib" path="AnaliseAcidentesTrabalho/lib/jai_imageio.jar"/>
<classpathentry kind="lib" path="lib.netbeans/webui.jar"/>
<classpathentry kind="lib" path="lib.netbeans/jsf-api.jar"/>
<classpathentry kind="lib" path="lib.netbeans/jsf-impl.jar"/>
<classpathentry kind="lib" path="lib.netbeans/dataprovider.jar"/>
<classpathentry kind="lib" path="lib.netbeans/appbase.jar"/>
<classpathentry kind="lib" path="common/lib/evolute.jar" sourcepath="/evolute/src"/>
<classpathentry kind="lib" path="common/lib/log4j-1.2.8.jar"/>
<classpathentry kind="lib" path="common/lib/mail.jar"/>
<classpathentry kind="lib" path="common/lib/TableLayout.jar"/>
<classpathentry kind="lib" path="common/lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="common/lib/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="common/lib/commons-logging-1.1.jar"/>
<classpathentry kind="lib" path="common/lib/jcalendar-1.3.2.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/xmlgraphics-commons-1.3.1.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/commons-io-1.4.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/batik-all-1.7.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/commons-logging-1.0.4.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/serializer-2.7.0.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/xalan-2.7.0.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/xercesImpl-2.7.1.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/fop.jar"/>
<classpathentry kind="lib" path="common/lib/ashwood-2.0.jar"/>
<classpathentry kind="lib" path="common/lib/cayenne-server-3.0M6.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/evospellchecker.jar"/>
<classpathentry kind="lib" path="SIPRPSoft/lib/jazzy-core.jar"/>
<classpathentry kind="lib" path="lib/swingx.jar"/>
<classpathentry kind="lib" path="lib/evospellchecker.jar"/>
<classpathentry kind="output" path="SIPRPSoft/build/classes"/>
</classpath>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SIPRP</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="AnaliseAcidentesTrabalho" default="default" basedir=".">
<description>Builds, tests, and runs the project AnaliseAcidentesTrabalho.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-dist: called before archive building
-post-dist: called after archive building
-post-clean: called after cleaning build products
-pre-run-deploy: called before deploying
-post-run-deploy: called after deploying
Example of pluging an obfuscator after the compilation could look like
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Other way how to customize the build is by overriding existing main targets.
The target of interest are:
init-macrodef-javac: defines macro for javac compilation
init-macrodef-junit: defines macro for junit execution
init-macrodef-debug: defines macro for class debugging
do-dist: archive building
run: execution of project
javadoc-build: javadoc generation
Example of overriding the target for project execution could look like
<target name="run" depends="<PROJNAME>-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that overridden target depends on jar target and not only on
compile target as regular run target does. Again, for list of available
properties which you can use check the target you are overriding in
nbproject/build-impl.xml file.
-->
</project>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="-deploy-ant" basedir=".">
<target name="-init" if="deploy.ant.enabled">
<property file="${deploy.ant.properties.file}"/>
<tempfile property="temp.module.folder" prefix="tomcat" destdir="${java.io.tmpdir}"/>
<unwar src="${deploy.ant.archive}" dest="${temp.module.folder}">
<patternset includes="META-INF/context.xml"/>
</unwar>
<xmlproperty file="${temp.module.folder}/META-INF/context.xml"/>
<delete dir="${temp.module.folder}"/>
</target>
<target name="-deploy-ant" if="deploy.ant.enabled" depends="-init">
<echo message="Deploying ${deploy.ant.archive} to ${Context(path)}"/>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"
classpath="${tomcat.home}/lib/catalina-ant.jar"/>
<deploy url="${tomcat.url}/manager" username="${tomcat.username}"
password="${tomcat.password}" path="${Context(path)}"
war="${deploy.ant.archive}"/>
<property name="deploy.ant.client.url" value="${tomcat.url}${Context(path)}"/>
</target>
<target name="-undeploy-ant" if="deploy.ant.enabled" depends="-init">
<echo message="Undeploying ${Context(path)}"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"
classpath="${tomcat.home}/lib/catalina-ant.jar"/>
<undeploy url="${tomcat.url}/manager" username="${tomcat.username}"
password="${tomcat.password}" path="${Context(path)}"/>
</target>
</project>

@ -0,0 +1,855 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- dist
- execution
- debugging
- javadoc
- junit compilation
- junit execution
- junit debugging
- cleanup
-->
<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"/>
<target depends="dist,javadoc" description="Build whole project." name="default"/>
<!--
INITIALIZATION SECTION
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="-pre-init" name="-init-private">
<property file="nbproject/private/private.properties"/>
</target>
<target depends="-pre-init,-init-private" name="-init-user">
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
</target>
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
<property file="nbproject/project.properties"/>
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/>
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
<condition property="have.tests">
<or>
<available file="${test.src.dir}"/>
</or>
</condition>
<condition property="have.sources">
<or>
<available file="${src.dir}"/>
</or>
</condition>
<condition property="netbeans.home+have.tests">
<and>
<isset property="netbeans.home"/>
<isset property="have.tests"/>
</and>
</condition>
<condition property="no.javadoc.preview">
<isfalse value="${javadoc.preview}"/>
</condition>
<property name="javac.compilerargs" value=""/>
<condition property="no.deps">
<and>
<istrue value="${no.dependencies}"/>
</and>
</condition>
<condition property="no.dist.ear.dir">
<not>
<isset property="dist.ear.dir"/>
</not>
</condition>
<property name="build.web.excludes" value="${build.classes.excludes}"/>
<condition property="do.compile.jsps">
<istrue value="${compile.jsps}"/>
</condition>
<condition property="do.debug.server">
<or>
<not>
<isset property="debug.server"/>
</not>
<istrue value="${debug.server}"/>
<and>
<not>
<istrue value="${debug.server}"/>
</not>
<not>
<istrue value="${debug.client}"/>
</not>
</and>
</or>
</condition>
<condition property="do.debug.client">
<istrue value="${debug.client}"/>
</condition>
<condition property="do.display.browser">
<istrue value="${display.browser}"/>
</condition>
<condition property="do.display.browser.debug">
<and>
<isset property="do.display.browser"/>
<not>
<isset property="do.debug.client"/>
</not>
</and>
</condition>
<available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
<available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
<condition property="do.war.package.with.custom.manifest">
<isset property="has.custom.manifest"/>
</condition>
<condition property="do.war.package.without.custom.manifest">
<not>
<isset property="has.custom.manifest"/>
</not>
</condition>
<condition property="do.tmp.war.package.with.custom.manifest">
<and>
<isset property="has.custom.manifest"/>
<isfalse value="${directory.deployment.supported}"/>
</and>
</condition>
<condition property="do.tmp.war.package.without.custom.manifest">
<and>
<not>
<isset property="has.custom.manifest"/>
</not>
<isfalse value="${directory.deployment.supported}"/>
</and>
</condition>
<property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
<condition else="" property="application.args.param" value="${application.args}">
<and>
<isset property="application.args"/>
<not>
<equals arg1="${application.args}" arg2="" trim="true"/>
</not>
</and>
</condition>
<property name="source.encoding" value="${file.encoding}"/>
<condition property="javadoc.encoding.used" value="${javadoc.encoding}">
<and>
<isset property="javadoc.encoding"/>
<not>
<equals arg1="${javadoc.encoding}" arg2=""/>
</not>
</and>
</condition>
<property name="javadoc.encoding.used" value="${source.encoding}"/>
<property name="includes" value="**"/>
<property name="excludes" value=""/>
<condition else="" property="javac.compilerargs.jaxws" value="-Djava.endorsed.dirs='${jaxws.endorsed.dir}'">
<and>
<isset property="jaxws.endorsed.dir"/>
<available file="nbproject/jaxws-build.xml"/>
</and>
</condition>
<property name="runmain.jvmargs" value=""/>
</target>
<target depends="init" name="-init-cos" unless="deploy.on.save">
<condition property="deploy.on.save" value="true">
<istrue value="${j2ee.deploy.on.save}"/>
</condition>
</target>
<target name="-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="build.web.dir">Must set build.web.dir</fail>
<fail unless="build.generated.dir">Must set build.generated.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
<fail unless="dist.war">Must set dist.war</fail>
<fail unless="j2ee.platform.classpath">
The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
Either open the project in the IDE and assign the server or setup the server classpath manually.
For example like this:
ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
</fail>
</target>
<target name="-init-macrodef-property">
<macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${@{value}}"/>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-javac">
<macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
<attribute default="${src.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="${javac.debug}" name="debug"/>
<element name="customize" optional="true"/>
<sequential>
<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}">
<classpath>
<path path="@{classpath}"/>
</classpath>
<compilerarg line="${javac.compilerargs} ${javac.compilerargs.jaxws}"/>
<customize/>
</javac>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-junit">
<macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<sequential>
<junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
</batchtest>
<classpath>
<path path="${run.test.classpath}:${j2ee.platform.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg line="${runmain.jvmargs}"/>
</junit>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-java">
<macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
<attribute default="${main.class}" name="classname"/>
<element name="customize" optional="true"/>
<sequential>
<java classname="@{classname}" fork="true">
<jvmarg line="${runmain.jvmargs}"/>
<classpath>
<path path="${debug.classpath}:${j2ee.platform.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-nbjsdebug">
<macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
<attribute default="${client.url}" name="webUrl"/>
<sequential>
<nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
</sequential>
</macrodef>
</target>
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
<attribute default="${main.class}" name="name"/>
<attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
<sequential>
<nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
<classpath>
<path path="@{classpath}"/>
</classpath>
</nbjpdastart>
</sequential>
</macrodef>
<macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
<attribute default="${build.classes.dir}" name="dir"/>
<sequential>
<nbjpdareload>
<fileset dir="@{dir}" includes="${fix.classes}">
<include name="${fix.includes}*.class"/>
</fileset>
</nbjpdareload>
</sequential>
</macrodef>
<macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
<sequential>
<nbjpdaappreloaded/>
</sequential>
</macrodef>
</target>
<target name="-init-debug-args">
<property name="version-output" value="java version &quot;${ant.java.version}"/>
<condition property="have-jdk-older-than-1.4">
<or>
<contains string="${version-output}" substring="java version &quot;1.0"/>
<contains string="${version-output}" substring="java version &quot;1.1"/>
<contains string="${version-output}" substring="java version &quot;1.2"/>
<contains string="${version-output}" substring="java version &quot;1.3"/>
</or>
</condition>
<condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
<istrue value="${have-jdk-older-than-1.4}"/>
</condition>
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
<os family="windows"/>
</condition>
<condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
<isset property="debug.transport"/>
</condition>
</target>
<target depends="-init-debug-args" name="-init-macrodef-debug">
<macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
<attribute default="${main.class}" name="classname"/>
<attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
<attribute default="${application.args.param}" name="args"/>
<element name="customize" optional="true"/>
<sequential>
<java classname="@{classname}" fork="true">
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<jvmarg line="${runmain.jvmargs}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<arg line="@{args}"/>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-taskdefs">
<fail unless="libs.CopyLibs.classpath">
The libs.CopyLibs.classpath property is not set up.
This property must point to
org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
of NetBeans IDE installation and is usually located at
&lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
Either open the project in the IDE and make sure CopyLibs library
exists or setup the property manually. For example like this:
ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
</fail>
<taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs" name="init"/>
<!--
COMPILATION SECTION
-->
<target depends="init" if="no.dist.ear.dir" name="deps-module-jar" unless="no.deps"/>
<target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps"/>
<target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
<target depends="init,deps-jar" name="-pre-pre-compile">
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-copy-webdir">
<copy todir="${build.web.dir}">
<fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
</copy>
<copy todir="${build.web.dir}/WEB-INF">
<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}"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target if="has.custom.manifest" name="-copy-manifest">
<mkdir dir="${build.meta.inf.dir}"/>
<copy todir="${build.meta.inf.dir}">
<fileset dir="${conf.dir}" includes="MANIFEST.MF"/>
</copy>
</target>
<target if="has.persistence.xml" name="-copy-persistence-xml">
<mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
<copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
<fileset dir="${persistence.xml.dir}" includes="persistence.xml"/>
</copy>
</target>
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
<target name="-pre-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</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}"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target name="-post-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
<target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
<mkdir dir="${build.generated.dir}/src"/>
<java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
<arg value="-uriroot"/>
<arg file="${basedir}/${build.web.dir}"/>
<arg value="-d"/>
<arg file="${basedir}/${build.generated.dir}/src"/>
<arg value="-die1"/>
<arg value="-compilerSourceVM ${javac.source}"/>
<arg value="-compilerTargetVM ${javac.target}"/>
<arg value="-javaEncoding ${source.encoding}"/>
<classpath path="${java.home}/../lib/tools.jar:${jspctask.classpath}:${jspcompilation.classpath}"/>
</java>
<mkdir dir="${build.generated.dir}/classes"/>
<webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
</target>
<target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
<fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
<mkdir dir="${build.generated.dir}/src"/>
<java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
<arg value="-uriroot"/>
<arg file="${basedir}/${build.web.dir}"/>
<arg value="-d"/>
<arg file="${basedir}/${build.generated.dir}/src"/>
<arg value="-die1"/>
<arg value="-jspc.files"/>
<arg path="${jsp.includes}"/>
<arg value="-compilerSourceVM ${javac.source}"/>
<arg value="-compilerTargetVM ${javac.target}"/>
<arg value="-javaEncoding ${source.encoding}"/>
<classpath path="${java.home}/../lib/tools.jar:${jspctask.classpath}:${jspcompilation.classpath}"/>
</java>
<mkdir dir="${build.generated.dir}/classes"/>
<webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
<customize>
<patternset includes="${javac.jsp.includes}"/>
</customize>
</webproject2:javac>
</target>
<target name="compile-single-jsp">
<fail unless="jsp.includes">Must select a file in the IDE or set jsp.includes</fail>
<antcall target="-do-compile-single-jsp"/>
</target>
<!--
DIST BUILDING SECTION
-->
<target name="-pre-dist">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest" name="-do-dist-without-manifest">
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}">
<fileset dir="${build.web.dir}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
<fileset dir="${build.web.dir}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}">
<fileset dir="${build.web.dir}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
<dirname file="${dist.war}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
<jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
<fileset dir="${build.web.dir}"/>
</jar>
</target>
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
<copyfiles files="${libs.jsf-designtime.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.jsf-designtime.classpath" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.jsfsupport-designtime.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.jsfsupport-designtime.classpath" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.webui-designtime.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.webui-designtime.classpath" todir="${dist.ear.dir}"/>
<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="${file.reference.activation.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.activation.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="${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"/>
<copyfiles files="${libs.jdbcsupport-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.exceptionhandler-runtime.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"/>
<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} "/>
</manifest>
</target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
<copyfiles files="${libs.jsf-designtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.jsfsupport-designtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.webui-designtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<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="${file.reference.activation.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="${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"/>
<copyfiles files="${libs.jdbcsupport-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.exceptionhandler-runtime.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"/>
</target>
<target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" 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">
<fileset dir="${build.web.dir}"/>
</jar>
</target>
<target name="-post-dist">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
<target depends="init,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
<!--
EXECUTION SECTION
-->
<target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
<target name="-pre-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-post-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-pre-nbmodule-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
</target>
<target name="-post-nbmodule-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
</target>
<target name="-run-deploy-am">
<!-- Task to deploy to the Access Manager runtime. -->
</target>
<target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy" name="run-deploy">
<nbjpdaappreloaded/>
</target>
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
<target name="-init-deploy-ant" unless="netbeans.home">
<property name="deploy.ant.archive" value="${dist.war}"/>
<property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
<property name="deploy.ant.resource.dir" value="${resource.dir}"/>
<property name="deploy.ant.enabled" value="true"/>
</target>
<target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
<target if="netbeans.home" name="-run-undeploy-nb">
<fail message="Undeploy is not supported from within the IDE"/>
</target>
<target depends="init,-pre-dist,dist,-post-dist" name="verify">
<nbverify file="${dist.war}"/>
</target>
<target depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
<target if="do.display.browser" name="-init-display-browser">
<condition property="do.display.browser.nb">
<isset property="netbeans.home"/>
</condition>
<condition property="do.display.browser.cl">
<isset property="deploy.ant.enabled"/>
</condition>
</target>
<target if="do.display.browser.nb" name="-display-browser-nb">
<nbbrowse url="${client.url}"/>
</target>
<target if="do.display.browser.cl" name="-get-browser" unless="browser">
<condition property="browser" value="rundll32">
<os family="windows"/>
</condition>
<condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
<os family="windows"/>
</condition>
<condition property="browser" value="/usr/bin/open">
<os family="mac"/>
</condition>
<property environment="env"/>
<condition property="browser" value="${env.BROWSER}">
<isset property="env.BROWSER"/>
</condition>
<condition property="browser" value="/usr/bin/firefox">
<available file="/usr/bin/firefox"/>
</condition>
<condition property="browser" value="/usr/local/firefox/firefox">
<available file="/usr/local/firefox/firefox"/>
</condition>
<condition property="browser" value="/usr/bin/mozilla">
<available file="/usr/bin/mozilla"/>
</condition>
<condition property="browser" value="/usr/local/mozilla/mozilla">
<available file="/usr/local/mozilla/mozilla"/>
</condition>
<condition property="browser" value="/usr/sfw/lib/firefox/firefox">
<available file="/usr/sfw/lib/firefox/firefox"/>
</condition>
<condition property="browser" value="/opt/csw/bin/firefox">
<available file="/opt/csw/bin/firefox"/>
</condition>
<condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
<available file="/usr/sfw/lib/mozilla/mozilla"/>
</condition>
<condition property="browser" value="/opt/csw/bin/mozilla">
<available file="/opt/csw/bin/mozilla"/>
</condition>
</target>
<target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
<fail unless="browser">
Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
</fail>
<property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
<echo>Launching ${browse.url}</echo>
<exec executable="${browser}" spawn="true">
<arg line="${browser.args} ${browse.url}"/>
</exec>
</target>
<target depends="init,-init-cos,compile-single" name="run-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<webproject1:java classname="${run.class}"/>
</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"/>
<antcall target="connect-debugger"/>
<antcall target="debug-display-browser"/>
<antcall target="connect-client-debugger"/>
</target>
<target if="do.debug.server" name="connect-debugger" unless="is.debugged">
<nbjpdaconnect address="${jpda.address}" host="${jpda.host}" name="${name}" transport="${jpda.transport}">
<classpath>
<path path="${debug.classpath}:${j2ee.platform.classpath}"/>
</classpath>
<sourcepath>
<path path="${web.docbase.dir}"/>
</sourcepath>
</nbjpdaconnect>
</target>
<target if="do.display.browser.debug" name="debug-display-browser">
<nbbrowse url="${client.url}"/>
</target>
<target if="do.debug.client" name="connect-client-debugger">
<webproject1:nbjsdebugstart webUrl="${client.url}"/>
</target>
<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">
<webproject1:nbjpdastart name="${debug.class}"/>
</target>
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<webproject1:debug classname="${debug.class}"/>
</target>
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
<target depends="init" name="-pre-debug-fix">
<fail unless="fix.includes">Must set fix.includes</fail>
<property name="javac.includes" value="${fix.includes}.java"/>
</target>
<target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
<webproject1:nbjpdareload/>
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
<!--
JAVADOC SECTION
-->
<target depends="init" name="javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}:${j2ee.platform.classpath}"/>
</classpath>
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/*.java"/>
</fileset>
</javadoc>
</target>
<target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
<nbbrowse file="${dist.javadoc.dir}/index.html"/>
</target>
<target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
<!--
JUNIT COMPILATION SECTION
-->
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
<mkdir dir="${build.test.classes.dir}"/>
</target>
<target name="-pre-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
<webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target name="-post-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
<target name="-pre-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target name="-post-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
<!--
JUNIT EXECUTION SECTION
-->
<target depends="init" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
<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>
</target>
<target depends="init" if="have.tests" name="test-report"/>
<target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
<target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
<target depends="init" if="have.tests" name="-pre-test-run-single">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
<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>
</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"/>
<!--
JUNIT DEBUGGING SECTION
-->
<target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
<delete file="${test.report.file}"/>
<!-- must exist, otherwise the XML formatter would fail -->
<mkdir dir="${build.test.results.dir}"/>
<webproject1:debug args="${test.class}" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
<customize>
<arg value="showoutput=true"/>
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
</customize>
</webproject1:debug>
</target>
<target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
<webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
</target>
<target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
<webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
<!--
CLEANUP SECTION
-->
<target depends="init" if="no.dist.ear.dir" name="deps-clean" unless="no.deps"/>
<target depends="init" name="do-clean">
<condition property="build.dir.to.clean" value="${build.web.dir}">
<isset property="dist.ear.dir"/>
</condition>
<property name="build.dir.to.clean" value="${build.web.dir}"/>
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
</delete>
<delete dir="${build.dir}"/>
<available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
<delete dir="${dist.dir}"/>
</target>
<target depends="do-clean" if="status.clean-failed" name="check-clean">
<echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
<echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
</target>
<target depends="init" if="netbeans.home" name="undeploy-clean">
<nbundeploy failOnError="false" startServer="false"/>
</target>
<target name="-post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
<target depends="clean" description="Clean build products." name="clean-ear"/>
</project>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scene Scope="Project" version="2">
<Scope Scope="Faces Configuration Only"/>
<Scope Scope="Project">
<Node id="GestaoUtilizadores.jsp" x="900" y="150" zoom="true"/>
<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="FormRH.jsp" x="400" y="150" zoom="true"/>
<Node id="FormSeguranca.jsp" x="1150" y="300" zoom="true"/>
<Node id="AnaliseAcidenteTrabalho.jsp" x="150" 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"/>
<Node id="FormMedico.jsp" x="650" y="600" zoom="true"/>
<Node id="FormHS.jsp" x="900" y="450" zoom="true"/>
<Node id="EnviarCorrecao.jsp" x="400" y="450" zoom="true"/>
<Node id="UtilizadorFields.jsp" x="150" y="600" zoom="true"/>
<Node id="Dummy.jsp" x="150" y="750" zoom="true"/>
<Node id="LoadImage.jsp" x="400" y="600" zoom="true"/>
<Node id="ViewAnaliseAcidenteTrabalho.jsp" x="650" y="300" zoom="true"/>
<Node id="Login.jsp" x="400" y="300" zoom="true"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>

@ -0,0 +1,8 @@
build.xml.data.CRC32=306dea99
build.xml.script.CRC32=97b5d0ef
build.xml.stylesheet.CRC32=c0ebde35
# 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

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<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="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="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="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"/>
</Scope>
<Scope Scope="All Faces Configurations"/>
</Scene>

@ -0,0 +1,103 @@
build.classes.dir=${build.web.dir}/WEB-INF/classes
build.classes.excludes=**/*.java,**/*.form
build.dir=build
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}
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}
excludes=
file.reference.activation.jar=jars/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.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.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
includes=**
j2ee.platform=1.4
j2ee.server.type=Tomcat60
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}:\
${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}
# 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
# Property libs.rowset-ri.classpath is set here just to make sharing of project simpler.
# The library definition has always preference over this property.
libs.rowset-ri.classpath=../../../../.netbeans/6.0/modules/ext/rowset-1.0.1.jar
persistence.xml.dir=${conf.dir}
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

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.project</type>
<configuration>
<creator-data xmlns="http://www.sun.com/creator/ns" jsf.current.theme="theme-default" jsf.pagebean.package="analiseacidentestrabalho" jsf.project.libraries.dir="lib" jsf.project.version="3.0" jsf.startPage="Login.jsp" migrated="true"/>
<data xmlns="http://www.netbeans.org/ns/web-project/3">
<name>AnaliseAcidentesTrabalho</name>
<minimum-ant-version>1.6</minimum-ant-version>
<web-module-libraries>
<library files="2">
<file>${libs.jsf-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="4">
<file>${libs.jsfsupport-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<file>${libs.webui-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${libs.jdbcsupport-designtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${libs.theme-default.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<file>${libs.jstl11.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<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>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.postgresql-8.2-506.jdbc4.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${libs.rowset-ri.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<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>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.fop.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.jdom.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>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${file.reference.batik.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
</web-module-libraries>
<web-module-additional-libraries>
<library files="6">
<file>${libs.jsf-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="4">
<file>${libs.jsfsupport-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<file>${libs.webui-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${libs.jdbcsupport-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${libs.exceptionhandler-runtime.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="1">
<file>${libs.theme-default.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library files="2">
<file>${libs.jstl11.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
</web-module-additional-libraries>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<driver project-version="3.0" class="org.postgresql.Driver">
<!-- <url value="jdbc:postgresql://storage:5432/siprp_local"/> -->
<url value="jdbc:postgresql://localhost:5436/siprp_local_3"/>
<connectionPool min="1" max="1"/>
<login userName="postgres" password=""/>
</driver>

@ -0,0 +1,331 @@
/*
* Acesso.java
*
* Created on Oct 15, 2008, 9:49:21 AM
*/
package analiseacidentestrabalho;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.DropDown;
import com.sun.rave.web.ui.component.StaticText;
import db.AnalisesDataProvider;
import db.UtilizadoresDataProvider;
import global.Global;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.FacesContext;
import utils.JSFUtils;
import utils.Utils;
/**
* <p>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.</p>
*
* @author lluis
*/
public class Acesso extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
/**
* <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() throws Exception {
}
private StaticText stWelcome = new StaticText();
public StaticText getStWelcome() {
return stWelcome;
}
public void setStWelcome(StaticText st) {
this.stWelcome = st;
}
private DropDown drpEstabelecimentos = new DropDown();
public DropDown getDrpEstabelecimentos() {
return drpEstabelecimentos;
}
public void setDrpEstabelecimentos(DropDown dd) {
this.drpEstabelecimentos = dd;
}
private HtmlPanelGrid gridEstabelecimento = new HtmlPanelGrid();
public HtmlPanelGrid getGridEstabelecimento() {
return gridEstabelecimento;
}
public void setGridEstabelecimento(HtmlPanelGrid hpg) {
this.gridEstabelecimento = hpg;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
public Acesso() {
}
/**
* <p>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.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log("Acesso Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// 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 . . .
}
}
}
/**
* <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>
*/
public void preprocess() {
}
/**
* <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>
*/
public void prerender() {
Utilizador u = getSessionBean1().getCurrentUser();
//String nomeUnicode = Utils.textToUnicode(u.getNome());
//System.out.println("NOME UNICODE : " + nomeUnicode);
String nomeHtml = Utils.unicodeToHTML( u.getNome() );
stWelcome.setText("Bem vindo(a) " + nomeHtml);
if(u.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR)
{
initializeEstabelecimentos();
}
else
{
gridEstabelecimento.setRendered(false);
}
}
/**
* <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>
*
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
public String lnkAnalisesAcidente_action() {
// TODO: Replace with your code
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
return null;
}
public String lnkEditUser_action() {
// TODO: Replace with your code
return null;
}
public String lnkAjuda_action() {
// TODO: Replace with your code
return null;
}
public String lnkLogout_action() {
// TODO: Replace with your code
FacesContext fc = getFacesContext();
try
{
JSFUtils.logout(fc);
}
catch(Exception ex)
{
ex.printStackTrace();
}
return "login";
}
public String lnkAnalises_action() {
// TODO: Replace with your code
Utilizador u = getSessionBean1().getCurrentUser();
UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
try
{
Integer permissao = udp.getPermissionCode(u.getId());
switch(permissao.intValue())
{
case 1: //seguranca
return "form_seguranca";
case 2: //rh
return "form_rh";
case 3: //hs
return "form_hs";
case 6: //gestor
Integer estabelecimento = null;
if(u.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR)
{
estabelecimento = (Integer) drpEstabelecimentos.getSelected();
// if(estabelecimento.intValue() == -1)
// {
// getSessionBean1().setMsg("Falta estabelecimento!");
// return null;
// }
// else
// {
// u.setEstabelecimento(estabelecimento_outro);
u.setEstabelecimento_gestor(estabelecimento);
}
return "form_gestor";
case 7: //dir ger rh
return "form_dir_ger_rh";
case 8: //dir_siprp
return "form_dir_siprp";
default:
return "gestor";
}
}
catch(Exception ex)
{
ex.printStackTrace();
return "gestor";
}
}
public String lnkPlanos_action() {
// TODO: Replace with your code
Utilizador u = getSessionBean1().getCurrentUser();
// String curUser = "?user=" + u.getId().toString();
FacesContext fc = getFacesContext().getCurrentInstance();
Integer estabelecimento = null;
if(u.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR)
{
estabelecimento = (Integer) drpEstabelecimentos.getSelected();
// if(estabelecimento.intValue() == -1)
// {
// getSessionBean1().setMsg("Falta estabelecimento!");
// return null;
// }
// else
// {
// u.setEstabelecimento(estabelecimento_outro);
u.setEstabelecimento_gestor(estabelecimento);
}
Global.redirectToPlanos(fc, u);
// FacesContext fc = getFacesContext().getCurrentInstance();
// Utilizador u = getSessionBean1().getCurrentUser();
// String curUser = "?user=" + u.getId().toString();
// try
// {
// JSFUtils.redirect(fc, Global.PLANOS_ACTUACAO_URL + curUser);
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// }
return null;
}
private void initializeEstabelecimentos()
{
AnalisesDataProvider adp = new AnalisesDataProvider();
try
{
com.sun.rave.web.ui.model.Option[] listGestorOptions = adp.getEstabelecimentosGestorList( getSessionBean1().getCurrentUser().getEmpresa_id(), new Boolean(true));
//listGestorOptions[0].setLabel("-Seleccionar-");
getSessionBean1().setEstabelecimentosGestorOptions( listGestorOptions );
drpEstabelecimentos.setSelected(new Integer(0));
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}

@ -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;
}
}

@ -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;
/**
* <p>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.</p>
*
* <p>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.</p>
*/
public class ApplicationBean1 extends AbstractApplicationBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() throws Exception {
}
// </editor-fold>
/**
* <p>Construct a new application data bean instance.</p>
*/
public ApplicationBean1() {
}
/**
* <p>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.</p>
*
* <p>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.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <p>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.</p>
*
* <p>You may customize this method to clean up resources allocated
* during the execution of the <code>init()</code> method, or
* at any later time during the lifetime of the application.</p>
*/
public void destroy() {
}
/**
* <p>Return an appropriate character encoding based on the
* <code>Locale</code> defined for the current JavaServer Faces
* view. If no more suitable encoding can be found, return
* "UTF-8" as a general purpose default.</p>
*
* <p>The default implementation uses the implementation from
* our superclass, <code>AbstractApplicationBean</code>.</p>
*/
public String getLocaleCharacterEncoding() {
return super.getLocaleCharacterEncoding();
}
}

@ -0,0 +1,40 @@
/*
* Causa.java
*
* Created on November 27, 2007, 4:21 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class Causa {
private Integer id;
private String causa;
/** Creates a new instance of Causa */
public Causa() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCausa() {
return causa;
}
public void setCausa(String causa) {
this.causa = causa;
}
}

@ -0,0 +1,49 @@
/*
* Controle.java
*
* Created on January 7, 2008, 3:03 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class Controle {
private Integer id;
private Integer analise_year;
private Integer last_analise_nr;
/** Creates a new instance of Controle */
public Controle() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAnalise_year() {
return analise_year;
}
public void setAnalise_year(Integer analise_year) {
this.analise_year = analise_year;
}
public Integer getLast_analise_nr() {
return last_analise_nr;
}
public void setLast_analise_nr(Integer last_analise_nr) {
this.last_analise_nr = last_analise_nr;
}
}

@ -0,0 +1,75 @@
/*
* Correcao.java
*
* Created on November 29, 2007, 10:42 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class Correcao {
private Integer analise_id;
private String correcao; // 'y'/ 'n'
private Integer estado_actual;
private Integer estado_corr;
private String descricao; //descricao do estado a corrigir
private String observacoes;
/** Creates a new instance of Correcao */
public Correcao() {
}
public Integer getEstado_actual() {
return estado_actual;
}
public void setEstado_actual(Integer estado_actual) {
this.estado_actual = estado_actual;
}
public Integer getEstado_corr() {
return estado_corr;
}
public void setEstado_corr(Integer estado_corr) {
this.estado_corr = estado_corr;
}
public String getObservacoes() {
return observacoes;
}
public void setObservacoes(String observacoes) {
this.observacoes = observacoes;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public Integer getAnalise_id() {
return analise_id;
}
public void setAnalise_id(Integer analise_id) {
this.analise_id = analise_id;
}
public String getCorrecao() {
return correcao;
}
public void setCorrecao(String correcao) {
this.correcao = correcao;
}
}

@ -0,0 +1,49 @@
/*
* Departamento.java
*
* Created on December 28, 2007, 11:16 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class Departamento {
private Integer id;
private String descricao;
private String activo;
/** Creates a new instance of Departamento */
public Departamento() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
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;
}
}

@ -0,0 +1,434 @@
/*
* 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 com.sun.rave.web.ui.model.SingleSelectOptionsList;
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;
import javax.servlet.ServletContext;
/**
* <p>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.</p>
*/
public class Dummy extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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 HiddenField hiddenField1 = new HiddenField();
public HiddenField getHiddenField1() {
return hiddenField1;
}
public void setHiddenField1(HiddenField hf) {
this.hiddenField1 = hf;
}
private HiddenField hidConfEnviar = new HiddenField();
public HiddenField getHidConfEnviar() {
return hidConfEnviar;
}
public void setHidConfEnviar(HiddenField hf) {
this.hidConfEnviar = hf;
}
private HiddenField hidConfDelete = new HiddenField();
public HiddenField getHidConfDelete() {
return hidConfDelete;
}
public void setHidConfDelete(HiddenField hf) {
this.hidConfDelete = hf;
}
private SingleSelectOptionsList dropDown1DefaultOptions = new SingleSelectOptionsList();
public SingleSelectOptionsList getDropDown1DefaultOptions() {
return dropDown1DefaultOptions;
}
public void setDropDown1DefaultOptions(SingleSelectOptionsList ssol) {
this.dropDown1DefaultOptions = ssol;
}
private SingleSelectOptionsList dropDown2DefaultOptions = new SingleSelectOptionsList();
public SingleSelectOptionsList getDropDown2DefaultOptions() {
return dropDown2DefaultOptions;
}
public void setDropDown2DefaultOptions(SingleSelectOptionsList ssol) {
this.dropDown2DefaultOptions = ssol;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
public Dummy() {
}
/**
* <p>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.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <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>
*/
public void preprocess() {
}
/**
* <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>
*/
public void prerender() {
//txtIn.setText("OLA");
}
/**
* <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>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
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 lnkAjuda_action() {
// // TODO: Replace with your code
// ServletContext theApplicationsServletContext =
// (ServletContext) this.getExternalContext().getContext();
// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL);
// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf";
//
// Global global = new Global();
// try
// {
// global.showPdf(pdfFilePath);
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// }
// return null;
// }
public String butVoltar_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 butEliminar_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 lnkPlanosActuacao_action() {
// TODO: Replace with your code
return null;
}
public String lnkAnalisesAcidente_action() {
// TODO: Replace with your code
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
return null;
}
public String lnkAjuda_action() {
// TODO: Replace with your code
return null;
}
public String lnkGerirUtilizadores_action() {
// TODO: Replace with your code
return null;
}
public String lnkAnalises_action() {
// TODO: Replace with your code
return null;
}
public String lnkPlanos_action() {
// TODO: Replace with your code
return null;
}
}

@ -0,0 +1,22 @@
/*
* EditUser.java
*
* Created on December 5, 2007, 2:02 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class EditUser extends Utilizador{
/** Creates a new instance of EditUser */
public EditUser() {
}
}

@ -0,0 +1,762 @@
/*
* EnviarCorrecao.java
*
* Created on November 28, 2007, 5:27 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.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.TextArea;
import db.AnalisesDataProvider;
import db.EstadosCorrecaoDataProvider;
import global.Global;
import java.util.ArrayList;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.event.ValueChangeEvent;
import javax.servlet.ServletContext;
/**
* <p>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.</p>
*/
public class EnviarCorrecao extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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 HtmlPanelGrid gridLayoutTop1 = new HtmlPanelGrid();
public HtmlPanelGrid getGridLayoutTop1() {
return gridLayoutTop1;
}
public void setGridLayoutTop1(HtmlPanelGrid hpg) {
this.gridLayoutTop1 = hpg;
}
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 HtmlPanelGrid gridMain1 = new HtmlPanelGrid();
public HtmlPanelGrid getGridMain1() {
return gridMain1;
}
public void setGridMain1(HtmlPanelGrid hpg) {
this.gridMain1 = 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 StaticText staticText6 = new StaticText();
public StaticText getStaticText6() {
return staticText6;
}
public void setStaticText6(StaticText st) {
this.staticText6 = st;
}
private TextArea txtObservacoes = new TextArea();
public TextArea getTxtObservacoes() {
return txtObservacoes;
}
public void setTxtObservacoes(TextArea ta) {
this.txtObservacoes = ta;
}
private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid();
public HtmlPanelGrid getGridPanel2() {
return gridPanel2;
}
public void setGridPanel2(HtmlPanelGrid hpg) {
this.gridPanel2 = hpg;
}
private Button butCancelar = new Button();
public Button getButCancelar() {
return butCancelar;
}
public void setButCancelar(Button b) {
this.butCancelar = b;
}
private TableColumn tableColumn1 = new TableColumn();
public TableColumn getTableColumn1() {
return tableColumn1;
}
public void setTableColumn1(TableColumn tc) {
this.tableColumn1 = tc;
}
private Hyperlink lnkEstadoCorr = new Hyperlink();
public Hyperlink getLnkEstadoCorr() {
return lnkEstadoCorr;
}
public void setLnkEstadoCorr(Hyperlink h) {
this.lnkEstadoCorr = h;
}
private StaticText staticText5 = new StaticText();
public StaticText getStaticText5() {
return staticText5;
}
public void setStaticText5(StaticText st) {
this.staticText5 = st;
}
private Button butConfirmar = new Button();
public Button getButConfirmar() {
return butConfirmar;
}
public void setButConfirmar(Button b) {
this.butConfirmar = b;
}
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 lblUser = new StaticText();
public StaticText getLblUser() {
return lblUser;
}
public void setLblUser(StaticText st) {
this.lblUser = st;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
public EnviarCorrecao() {
}
/**
* <p>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.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log("EnviarCorrecao Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <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>
*/
public void preprocess() {
}
/**
* <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>
*/
public void prerender() {
lblUser.setText( getSessionBean1().getCurrentUser().getLogin());
fillTabelaEstados();
txtMsg.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
}
/**
* <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>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
public String lnkEditUser_action() {
// TODO: Replace with your code
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 lnkDataAcidente_action() {
// TODO: Replace with your code
return null;
}
public String lnkNr_action() {
// TODO: Replace with your code
return null;
}
public String lnkPor_action() {
// TODO: Replace with your code
return null;
}
public String lnkNomeAcidentado_action() {
// TODO: Replace with your code
return null;
}
public String lnkFase_action() {
// TODO: Replace with your code
return null;
}
public String lnkDataAcidenteSeg_action() {
// TODO: Replace with your code
return null;
}
public String lnkNrSeg_action() {
// TODO: Replace with your code
return null;
}
public String lnkPorSeg_action() {
// TODO: Replace with your code
return null;
}
public String lnkNomeAcidentadoSeg_action() {
// TODO: Replace with your code
return null;
}
public String lnkFaseSeg_action() {
// TODO: Replace with your code
return null;
}
public void drpAno_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
}
public void drpMes_processValueChange(ValueChangeEvent event) {
// TODO: Replace with your code
}
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.
return null;
}
public String lnkDataConcluida_action() {
// TODO: Replace with your code
return null;
}
public String lnkNrConcluida_action() {
// TODO: Replace with your code
return null;
}
public String lnkPorConcluida_action() {
// TODO: Replace with your code
return null;
}
public String lnkNomeConcluida_action() {
// TODO: Replace with your code
return null;
}
public String lnkEstabConcluida_action() {
// TODO: Replace with your code
return null;
}
private void fillTabelaEstados()
{
ArrayList list = new ArrayList();
Correcao c = null;
int estado = getSessionBean1().getCurrentAnalise().getEstado().intValue();
switch(estado)
{
case Global.ESTADO_HS:
c = new Correcao();
c.setCorrecao("y");
c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId());
c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado());
c.setEstado_corr(new Integer(Global.ESTADO_SEG));
c.setDescricao("FASE 1 - SEG - ABERTURA");
list.add(c);
c = new Correcao();
c.setCorrecao("y");
c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId());
c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado());
c.setEstado_corr(new Integer(Global.ESTADO_RH1));
c.setDescricao("FASE 2 - RH - ACOMPANHAMENTO");
list.add(c);
getSessionBean1().getEstadosCorrecaoDataProvider().setList(list);
break;
case Global.ESTADO_CONSOLIDACAO:
c = new Correcao();
c.setCorrecao("y");
c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId());
c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado());
c.setEstado_corr(new Integer(Global.ESTADO_RH2));
c.setDescricao("FASE 4 - RH - MEDIDAS + LESÃO");
list.add(c);
// c = new Correcao();
// c.setCorrecao("y");
// c.setAnalise_id(getSessionBean1().getCurrentAnalise().getId());
// c.setEstado_actual(getSessionBean1().getCurrentAnalise().getEstado());
// c.setEstado_corr(new Integer(Global.ESTADO_MEDICINA));
// c.setDescricao("Medicina");
// list.add(c);
getSessionBean1().getEstadosCorrecaoDataProvider().setList(list);
break;
}
}
public String lnkEstadoCorr_action() {
// TODO: Replace with your code
RowKey rk = tableRowGroup1.getRowKey();
int k = Integer.parseInt(rk.getRowId());
EstadosCorrecaoDataProvider provider = (EstadosCorrecaoDataProvider) tableRowGroup1.getSourceData();
ArrayList list = (ArrayList) provider.getList();
Correcao c = (Correcao)list.get(k);
getSessionBean1().setCorrecao(c);
// c.setObservacoes("");
// if(txtObservacoes.getText() != null)
// {
// String obs = (String) txtObservacoes.getText();
// c.setObservacoes(obs);
// }
// AnalisesDataProvider adp = new AnalisesDataProvider();
// try
// {
// adp.changeEstado(c);
//
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// }
// return "form_hs";
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
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 "form_hs";
return "analise_acidente";
}
public String lnkAjuda_action() {
// TODO: Replace with your code
// ServletContext theApplicationsServletContext =
// (ServletContext) this.getExternalContext().getContext();
// String pdfFolderPath = theApplicationsServletContext.getRealPath(Global.PDF_FOLDER_URL);
// String pdfFilePath = pdfFolderPath + "/Ajuda.pdf";
//
// Global global = new Global();
// try
// {
// global.showPdf(pdfFilePath);
// }
// catch(Exception ex)
// {
// ex.printStackTrace();
// }
return null;
}
public String butConfirmar_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
Correcao c = getSessionBean1().getCorrecao();
if(c != null)
{
c.setObservacoes("");
if(txtObservacoes.getText() != null)
{
String obs = (String) txtObservacoes.getText();
c.setObservacoes(obs);
}
AnalisesDataProvider adp = new AnalisesDataProvider();
try
{
adp.changeEstado(c);
}
catch(Exception ex)
{
ex.printStackTrace();
}
return "form_hs";
}
else
{
getSessionBean1().setMsg("Tem de indicar para onde enviar a correc&ccedil;&atilde;o");
return null;
}
}
public String lnkAnalisesAcidente_action() {
// TODO: Replace with your code
return null;
}
public String lnkPlanosActuacao_action() {
// TODO: Replace with your code
return null;
}
}

@ -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;
/**
* <p>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.</p>
*/
public class Erro extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
public Erro() {
}
/**
* <p>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.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <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>
*/
public void preprocess() {
}
/**
* <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>
*/
public void prerender() {
txtMsg.setText( getSessionBean1().getMsg() );
getSessionBean1().setMsg("");
System.out.println("ERROR PAGE");
}
/**
* <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>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
}

@ -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;
}
}

@ -0,0 +1,39 @@
/*
* Estado.java
*
* Created on November 29, 2007, 10:01 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class Estado {
private Integer estado;
private String descricao;
/** Creates a new instance of Estado */
public Estado() {
}
public Integer getEstado() {
return estado;
}
public void setEstado(Integer estado) {
this.estado = estado;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
}

@ -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;
/**
* <p>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.</p>
*/
public class Footer extends AbstractFragmentBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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;
}
// </editor-fold>
public Footer() {
}
/**
* <p>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.</p>
*
* <p>The default implementation does nothing.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Visual-Web-managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called. Override this
* method to release resources acquired in the <code>init()</code>
* resources that will be needed for event handlers and lifecycle methods.</p>
*
* <p>The default implementation does nothing.</p>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
}

@ -0,0 +1,130 @@
/*
* 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;
/**
* <p>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.</p>
*/
public class Header extends AbstractFragmentBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() throws Exception {
}
// </editor-fold>
public Header() {
}
/**
* <p>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.</p>
*
* <p>The default implementation does nothing.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Visual-Web-managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called. Override this
* method to release resources acquired in the <code>init()</code>
* resources that will be needed for event handlers and lifecycle methods.</p>
*
* <p>The default implementation does nothing.</p>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
public String lnkAnalisesAcidente_action() {
// TODO: Replace with your code
return null;
}
public String lnkPlanosActuacao_action() {
// TODO: Replace with your code
return null;
}
public String lnkNewUser_action() {
// TODO: Replace with your code
return null;
}
public String lnkEditUser_action() {
// TODO: Replace with your code
return null;
}
public String lnkAjuda_action() {
// TODO: Replace with your code
return null;
}
public String lnkLogout_action() {
// TODO: Replace with your code
return null;
}
}

@ -0,0 +1,473 @@
/*
* 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;
/**
* <p>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.</p>
*/
public class LoadImage extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
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() {
}
/**
* <p>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.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// 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();
}
}
}
/**
* <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>
*/
public void preprocess() {
}
/**
* <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>
*/
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("");
}
/**
* <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>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
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);
int imageName = firstImageNr + files.length + 1;
justFileName = new Integer(imageName).toString();
if(imageName < 10)
{
justFileName = "0" + justFileName;
}
//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&atilde;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);
}
}
}

@ -0,0 +1,658 @@
/*
* 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 global.Global;
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;
import javax.faces.context.FacesContext;
import utils.JSFUtils;
/**
* <p>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.</p>
*/
public class Login extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
public Login() {
connect();
}
/**
* <p>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.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <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>
*/
public void preprocess() {
}
/**
* <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>
*/
public void prerender() {
txtMsg.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
}
/**
* <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>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
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&aacute;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
{
if(u.getResponsavel_loja().matches("y"))
{
sRet = "acesso";
}
else
{
sRet = "form_seguranca";
}
}
else if(permissao.intValue() == 2) // rh
{
if(u.getResponsavel_loja().matches("y"))
{
sRet = "acesso";
}
else
{
sRet = "form_rh";
}
//sRet = "form_rh";
}
else if(permissao.intValue() == 3) // hs
{
//sRet = "form_hs";
sRet = "acesso";
}
else if(permissao.intValue() == 5) // medico
{
sRet = "form_medico";
}
else if(permissao.intValue() == 6) // gestor
{
//sRet = "form_gestor";
sRet = "acesso";
}
else if(permissao.intValue() == 7) // director geral rh
{
//sRet = "form_rh";
//sRet = "form_dir_ger_rh";
sRet = "acesso";
}
else if(permissao.intValue() == 8) // director siprp
{
//sRet = "form_dir_siprp";
sRet = "acesso";
}
else if(permissao.intValue() == 9) // director loja
{
sRet = "acesso";
}
else if(permissao.intValue() == 10) // director nacional de seguranca
{
sRet = "acesso";
}
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&atilde;o tem permiss&atilde;o para entrar na aplica&ccedil;&atilde;o !");
}
}
}
else
{
getSessionBean1().setMsg("Utilizador inv&aacute;lido ! ");
}
}
catch(Exception ex)
{
ex.printStackTrace();
getSessionBean1().setMsg("Utilizador inv&aacute;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&ccedil;&atilde;o &agrave; 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;
}
}

@ -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);
}
}

@ -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;
}
}

@ -0,0 +1,176 @@
/*
* NewUser.java
*
* Created on December 4, 2007, 11:29 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class NewUser {
private Integer tipo;
private String tipo_descricao;
private String nome;
private Integer estabelecimento;
private String estabelecimento_descricao;
private String login;
private String password;
private String email;
private String numero_mecanografico;
private Integer empresa_id;
private String numero_cedula;
private String cap;
private Integer funcionario_hst_id;
private Integer medico_id;
private String responsavel_loja;
private String gestor_geral;
private String activo;
/** Creates a new instance of NewUser */
public NewUser() {
}
public Integer getTipo() {
return tipo;
}
public void setTipo(Integer tipo) {
this.tipo = tipo;
}
public String getTipo_descricao() {
return tipo_descricao;
}
public void setTipo_descricao(String tipo_descricao) {
this.tipo_descricao = tipo_descricao;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public Integer getEstabelecimento() {
return estabelecimento;
}
public void setEstabelecimento(Integer estabelecimento) {
this.estabelecimento = estabelecimento;
}
public String getEstabelecimento_descricao() {
return estabelecimento_descricao;
}
public void setEstabelecimento_descricao(String estabelecimento_descricao) {
this.estabelecimento_descricao = estabelecimento_descricao;
}
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 String getNumero_mecanografico() {
return numero_mecanografico;
}
public void setNumero_mecanografico(String numero_mecanografico) {
this.numero_mecanografico = numero_mecanografico;
}
public Integer getEmpresa_id() {
return empresa_id;
}
public void setEmpresa_id(Integer empresa_id) {
this.empresa_id = empresa_id;
}
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 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 Integer getMedico_id() {
return medico_id;
}
public void setMedico_id(Integer medico_id) {
this.medico_id = medico_id;
}
public String getResponsavel_loja() {
return responsavel_loja;
}
public void setResponsavel_loja(String responsavel_loja) {
this.responsavel_loja = responsavel_loja;
}
public String getActivo() {
return activo;
}
public void setActivo(String activo) {
this.activo = activo;
}
public String getGestor_geral() {
return gestor_geral;
}
public void setGestor_geral(String gestor_geral) {
this.gestor_geral = gestor_geral;
}
}

@ -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;
}
}

@ -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;
}
}

@ -0,0 +1,527 @@
/*
* 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 global.Global;
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;
/**
* <p>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.</p>
*/
public class RecuperarPassword extends AbstractPageBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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;
}
// </editor-fold>
/**
* <p>Construct a new Page bean instance.</p>
*/
public RecuperarPassword() {
}
/**
* <p>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.</p>
*
* <p>Note that, if the current request is a postback, the property
* values of the components do <strong>not</strong> represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// 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 . . .
// }
// }
}
/**
* <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>
*/
public void preprocess() {
}
/**
* <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>
*/
public void prerender() {
txtMsg.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
}
/**
* <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>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
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(), Global.ENDERECO_ENVIO);
getSessionBean1().setMsg("A sua password foi enviada para o seu email");
return "login";
}
catch(Exception ex)
{
getSessionBean1().setMsg("Erro no envio da password !");
ex.printStackTrace();
}
}
else
{
getSessionBean1().setMsg("Os dados n&atilde;o coincidem com os registos !");
}
}
catch(Exception ex)
{
getSessionBean1().setMsg("Utilizador inv&aacute;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", "mail2.evolute.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><head> <meta content='text/html;charset=ISO-8859-1' http-equiv='Content-Type'></head>";
html+="<body bgcolor='#ffffff' text='#000000'>";
html+="<h3>Envio da password de " + login + " :</h3>";
html+="<p>Password: " + password + "</p>";
html+="<body></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&aacute;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;
// }
}

@ -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;
/**
* <p>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.</p>
*
* <p>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.</p>
*/
public class RequestBean1 extends AbstractRequestBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() throws Exception {
}
// </editor-fold>
/**
* <p>Construct a new request data bean instance.</p>
*/
public RequestBean1() {
}
/**
* <p>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.</p>
*
* <p>You may customize this method to allocate resources that are required
* for the lifetime of the current request.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <p>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.</p>
*
* <p>You may customize this method to clean up resources allocated
* during the execution of the <code>init()</code> method, or
* at any later time during the lifetime of the request.</p>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
}

@ -0,0 +1,58 @@
/*
* Seccao.java
*
* Created on December 28, 2007, 11:17 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package analiseacidentestrabalho;
/**
*
* @author lluis
*/
public class Seccao {
private Integer id;
private String descricao;
private Integer departamento_id;
private String activo;
/** Creates a new instance of Seccao */
public Seccao() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public Integer getDepartamento_id() {
return departamento_id;
}
public void setDepartamento_id(Integer departamento_id) {
this.departamento_id = departamento_id;
}
public String getActivo() {
return activo;
}
public void setActivo(String activo) {
this.activo = activo;
}
}

@ -0,0 +1,743 @@
/*
* 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;
/**
* <p>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.</p>
*
* <p>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.</p>
*/
public class SessionBean1 extends AbstractSessionBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() throws Exception {
}
// </editor-fold>
private String logoEmpresaUrl = "";
/**
* <p>Construct a new session data bean instance.</p>
*/
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);
setFromAjuda(false);
setGravado(false);
setSubmetido(false);
setFromAnaliseDeletion(false);
setIeBug(false);
setCorrecao(null);
}
/**
* <p>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.</p>
*
* <p>You may customize this method to initialize and cache data values
* or resources that are required for the lifetime of a particular
* user session.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <p>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 <code>activate()</code> method
* will be called to indicate that the transfer is complete.</p>
*
* <p>You may customize this method to release references to session data
* or resources that can not be serialized with the session itself.</p>
*/
public void passivate() {
}
/**
* <p>This method is called when the session containing it was
* reactivated.</p>
*
* <p>You may customize this method to reacquire references to session
* data or resources that could not be serialized with the
* session itself.</p>
*/
public void activate() {
}
/**
* <p>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.</p>
*
* <p>You may customize this method to clean up resources allocated
* during the execution of the <code>init()</code> method, or
* at any later time during the lifetime of the application.</p>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
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 estabelecimentoGestorChoice;
public Integer getEstabelecimentoGestorChoice() {
return estabelecimentoGestorChoice;
}
public void setEstabelecimentoGestorChoice(Integer estabelecimentoGestorChoice) {
this.estabelecimentoGestorChoice = estabelecimentoGestorChoice;
}
private com.sun.rave.web.ui.model.Option[] estabelecimentosGestorOptions;
public com.sun.rave.web.ui.model.Option[] getEstabelecimentosGestorOptions() {
return estabelecimentosGestorOptions;
}
public void setEstabelecimentosGestorOptions(com.sun.rave.web.ui.model.Option[] estabelecimentosGestorOptions) {
this.estabelecimentosGestorOptions = estabelecimentosGestorOptions;
}
//
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;
}
private boolean fromAjuda;
public boolean isFromAjuda() {
return fromAjuda;
}
public void setFromAjuda(boolean fromAjuda) {
this.fromAjuda = fromAjuda;
}
private boolean submetido;
private boolean gravado;
public boolean isSubmetido() {
return submetido;
}
public void setSubmetido(boolean submetido) {
this.submetido = submetido;
}
public boolean isGravado() {
return gravado;
}
public void setGravado(boolean gravado) {
this.gravado = gravado;
}
private boolean fromAnaliseDeletion;
public boolean isFromAnaliseDeletion() {
return fromAnaliseDeletion;
}
public void setFromAnaliseDeletion(boolean fromAnaliseDeletion) {
this.fromAnaliseDeletion = fromAnaliseDeletion;
}
private boolean ieBug;
public boolean isIeBug() {
return ieBug;
}
public void setIeBug(boolean ieBug) {
this.ieBug = ieBug;
}
private analiseacidentestrabalho.Correcao correcao;
public analiseacidentestrabalho.Correcao getCorrecao() {
return correcao;
}
public void setCorrecao(analiseacidentestrabalho.Correcao correcao) {
this.correcao = correcao;
}
public String getLogoEmpresaUrl() {
return logoEmpresaUrl;
}
public void setLogoEmpresaUrl(String logoEmpresaUrl) {
this.logoEmpresaUrl = logoEmpresaUrl;
}
}

@ -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);
}
}

@ -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;
}
}

@ -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;
/**
* <p>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.</p>
*/
public class Top extends AbstractFragmentBean {
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
private int __placeholder;
/**
* <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() 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;
}
// </editor-fold>
public Top() {
}
/**
* <p>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.</p>
*
* <p>The default implementation does nothing.</p>
*/
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
// <editor-fold defaultstate="collapsed" desc="Visual-Web-managed Component Initialization">
// 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);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
/**
* <p>Callback method that is called after rendering is completed for
* this request, if <code>init()</code> was called. Override this
* method to release resources acquired in the <code>init()</code>
* resources that will be needed for event handlers and lifecycle methods.</p>
*
* <p>The default implementation does nothing.</p>
*/
public void destroy() {
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}
/**
* <p>Return a reference to the scoped data bean.</p>
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}
}

@ -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;
}
}

@ -0,0 +1,265 @@
/*
* 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;
private Integer estabelecimento_gestor = null;
/** 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;
}
/**
* @return the estabelecimento_gestor
*/
public Integer getEstabelecimento_gestor() {
return estabelecimento_gestor;
}
/**
* @param estabelecimento_gestor the estabelecimento_gestor to set
*/
public void setEstabelecimento_gestor(Integer estabelecimento_gestor) {
this.estabelecimento_gestor = estabelecimento_gestor;
}
}

@ -0,0 +1,24 @@
/*
* AnalisesActualDataProvider.java
*
* Created on September 20, 2007, 1:41 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 AnalisesActualDataProvider extends ObjectListDataProvider {
/** Creates a new instance of AnalisesActualDataProvider */
public AnalisesActualDataProvider() {
}
}

@ -0,0 +1,24 @@
/*
* AnalisesConcluidasDataProvider.java
*
* Created on September 20, 2007, 1:43 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 AnalisesConcluidasDataProvider extends ObjectListDataProvider {
/** Creates a new instance of AnalisesConcluidasDataProvider */
public AnalisesConcluidasDataProvider() {
}
}

@ -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() {
}
}

@ -0,0 +1,60 @@
/*
* 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_20100629"; //testes
String connectionURL = "jdbc:postgresql://localhost:5436/siprp"; //real
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;
}
}
}

@ -0,0 +1,66 @@
/*
* 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_3"; //testes
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();
}
}

@ -0,0 +1,24 @@
/*
* EstadosCorrecaoDataProvider.java
*
* Created on November 29, 2007, 9:50 AM
*
* 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 EstadosCorrecaoDataProvider extends ObjectListDataProvider {
/** Creates a new instance of EstadosCorrecaoDataProvider */
public EstadosCorrecaoDataProvider() {
}
}

@ -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() {
}
}

@ -0,0 +1,24 @@
/*
* UtilizadoresListDataProvider.java
*
* Created on November 30, 2007, 2:51 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 UtilizadoresActivosListDataProvider extends ObjectListDataProvider {
/** Creates a new instance of UtilizadoresListDataProvider */
public UtilizadoresActivosListDataProvider() {
}
}

@ -0,0 +1,533 @@
/*
* 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, Integer estabelecimento_id) throws Exception
{
ArrayList list = new ArrayList();
Statement st = createStatement();
String sql = "";
String estabelecimento_constraint = "";
if(tipo.intValue() == Global.TIPO_UTILIZADOR_RH || tipo.intValue() == Global.TIPO_UTILIZADOR_SEGURANCA)
{
estabelecimento_constraint = " AND estabelecimento_id = " + estabelecimento_id;
}
if(responsavel_loja.matches("y"))
{
sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND responsavel_loja = 'y' AND tipo = " + tipo + estabelecimento_constraint;
}
else
{
sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND tipo = " + tipo + estabelecimento_constraint;
}
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"))
{
int uType = u.getTipo().intValue();
if ( uType == Global.TIPO_UTILIZADOR_SEGURANCA || uType == Global.TIPO_UTILIZADOR_RH || uType == Global.TIPO_UTILIZADOR_GESTOR
|| uType == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA )
{
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();
}
}

@ -0,0 +1,24 @@
/*
* UtilizadoresInactivosListDataProvider.java
*
* Created on November 30, 2007, 4:48 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 UtilizadoresInactivosListDataProvider extends ObjectListDataProvider {
/** Creates a new instance of UtilizadoresInactivosListDataProvider */
public UtilizadoresInactivosListDataProvider() {
}
}

@ -0,0 +1,168 @@
/*
* Global.java
*
* Created on November 23, 2007, 10:08 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package global;
import analiseacidentestrabalho.Utilizador;
//import com.sun.org.apache.bcel.internal.generic.GETFIELD;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.faces.context.FacesContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import utils.JSFUtils;
/**
*
* @author lluis2
*/
public class Global {
public final static int ESTADO_SEG = 1;
public final static int ESTADO_RH1 = 2;
public final static int ESTADO_HS = 3;
public final static int ESTADO_RH2 = 4;
//public final static int ESTADO_MEDICINA = 5;
public final static int ESTADO_CONSOLIDACAO = 5;
//public final static int ESTADO_ASSINATURAS = 7;
public final static int ESTADO_ASSINATURA_SEG = 6;
public final static int ESTADO_ASSINATURA_RH = 7;
//public final static int ESTADO_IMPRESSAO = 8;
public final static int ESTADO_FECHAR = 8;
public final static int ESTADO_CONCLUIDO = 9;
public final static int ESTADO_ASSINATURA_1 = 1;
public final static int ESTADO_ASSINATURA_2 = 2;
public final static int ESTADO_ASSINATURA_3 = 3;
public final static int TIPO_UTILIZADOR_SEGURANCA = 1;
public final static int TIPO_UTILIZADOR_RH = 2;
public final static int TIPO_UTILIZADOR_HS = 3;
public final static int TIPO_UTILIZADOR_MEDICO = 5;
public final static int TIPO_UTILIZADOR_GESTOR = 6;
public final static int TIPO_UTILIZADOR_DIRECTOR_GERAL_RH = 7;
public final static int TIPO_UTILIZADOR_DIRECTOR_SIPRP = 8;
public final static int TIPO_UTILIZADOR_DIRECTOR_LOJA = 9;
public final static int TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA = 10;
public final static int AUCHAN = 32;
public final static String SERVIDOR_SMTP = "smtp.netcabo.pt";
public final static String SERVIDOR_SMTP_PASSWORD = "EVOLUTE";
public final static String ENDERECO_ENVIO = "acidentes.auchan@siprp.pt";
//public final static String ENDERECO_ENVIO = "lluis@evolute.pt"; //testes
public final static String IMAGE_FOLDER = "/home/siprp/imagens_acidentes";
//public final static String IMAGE_FOLDER = "/home/lluis/imagens_acidentes";
public final static String RESOURCES_IMAGE_FOLDER = "/resources/images";
public static final String PDF_FOLDER_URL = "/resources/pdf";
//public static final String PLANOS_ACTUACAO_URL = "http://localhost:8084/PlanosActuacao/faces/ListaPlanos.jsp"; //testes
//public static final String PLANOS_ACTUACAO_URL = "http://192.168.111.24:8084/PlanosActuacao/faces/ListaPlanos.jsp"; //testes portatil
public static final String PLANOS_ACTUACAO_URL = "https://www.siprp.pt/PlanosActuacao/faces/ListaPlanos.jsp"; //real
public static final String LOGOS_FOLDER = "/resources/images";
/** Creates a new instance of Global */
public Global() {
}
public void copyImage(File fSource, File fDest)
{
try
{
InputStream in = new FileInputStream(fSource);
OutputStream out = new FileOutputStream(fDest);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
public void deleteFolderFiles(File folder)
{
File files[] = folder.listFiles();
for(int i=0;i<files.length;i++)
{
if(files[i].isFile())
{
files[i].delete();
}
}
}
public void showPdf(String pdfFilePath) throws Exception
{
File pdfFile = new File(pdfFilePath);
FileInputStream fis = new FileInputStream(pdfFile);
byte[] buf = new byte[(int)pdfFile.length()];
while ((fis.read(buf)) > 0)
{
//fos.write(buf, 0, buf.length);
}
fis.close();
FacesContext ctx = FacesContext.getCurrentInstance();
if (!ctx.getResponseComplete())
{
HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
String contentType = "application/pdf";
response.setContentType(contentType);
response.setHeader("Content-Disposition","attachment;filename=\"" + "Ajuda.pdf" + "\"");
ServletOutputStream out = response.getOutputStream();
//out.write(model.getInfo().getBytes());
out.write(buf, 0, buf.length);
out.flush();
out.close();
ctx.responseComplete();
ctx.release();
}
}
public static void redirectToPlanos(FacesContext fc, Utilizador currentUser)
{
String curUser = "?user=" + currentUser.getId().toString();
String estab = "";
if(currentUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR)
{
//obtem estabelecimento da lista de estabelecimentos
estab = "&estab_gestor=" + currentUser.getEstabelecimento_gestor().intValue();
}
fc = fc.getCurrentInstance();
try
{
JSFUtils.redirect(fc, Global.PLANOS_ACTUACAO_URL + curUser + estab);
//JSFUtils.dispatch(fc, Global.PLANOS_ACTUACAO_URL + curUser);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}

@ -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;
}
}

@ -0,0 +1,330 @@
X-Account-Key: account2
X-Mozilla-Keys:
Return-Path: <lluis@evolute.pt>
Delivered-To: 4-malves@evolute.pt
Received: (qmail 19936 invoked from network); 26 Dec 2007 15:28:46 +0000
Received: from localhost (127.0.0.1)
by localhost with SMTP; 26 Dec 2007 15:28:46 +0000
Received: from a213-22-140-174.cpe.netcabo.pt
(a213-22-140-174.cpe.netcabo.pt [213.22.140.174]) by webmail.evolute.pt
(Horde MIME library) with HTTP; Wed, 26 Dec 2007 15:28:45 +0000
Message-ID: <20071226152845.ecq9t84xcswo4wow@webmail.evolute.pt>
Date: Wed, 26 Dec 2007 15:28:45 +0000
From: lluis@evolute.pt
To: malves@evolute.pt
Subject: Logotipos
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="=_6xaiexiy7y80"
Content-Transfer-Encoding: 7bit
User-Agent: Internet Messaging Program (IMP) H3 (4.1.1)
X-Spam-Checker-Version: SpamAssassin 3.0.6 (2005-12-07) on plesk.evolute.pt
X-Spam-Level:
X-Spam-Status: No, score=1.0 required=7.0 tests=AWL,HELO_DYNAMIC_HCC,
HELO_DYNAMIC_IPADDR,NO_REAL_NAME,RCVD_IN_SORBS_DUL autolearn=no
version=3.0.6
This message is in MIME format.
--=_6xaiexiy7y80
Content-Type: text/plain;
charset=ISO-8859-1;
DelSp="Yes";
format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
--=_6xaiexiy7y80
Content-Type: image/gif;
name="auchan_logo.gif"
Content-Disposition: attachment;
filename="auchan_logo.gif"
Content-Transfer-Encoding: base64
R0lGODlhJwHRAPAAAAAA/wD//yH5BAEAAP0ALAAAAAAnAdEAhx2YWxulWRayazaYWSuaZjyIYzmb
aDqcciinXj2iTjimWzeobzjBa0mXWkiOYUebZ0ibc1OMZlOPclWaZlObckWjW1alWkamaUepdUi0
akeyeFSlaFSpdVeybFW0eGSeXW+Ba2mZZ3eTaWylXmSnaGerdmq1aWi2d3WpaHKpdHmza3a1eDmw
iEerhUmqkEmzhUq4lFWsg1a1hVe3mFi3o2ari2OskmW1hGe1mHW3hnW0lW+8rVDDi1vCq2fDhmnC
m3fEjnvHlXHIsHTSy5R9XJh6Zq16Wa97Y/g1T/lIOs5zVNlmVthwXMJ2Y9xpadd/Zu1HWexWWvtJ
SfpLWfxWS/tYWulVZPtMY/xaZf5bculoXP5kS/xj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y5m
Zuh80IdzvpNzgMOHYxws6GjeWAQFeAEBciMO4BMWkFj6+kICyDz04AfjK+GyWq6MiIIrULI9YsYs
IKspMAOgxol8GIZcQOy2SrWgOGrcQCwqi6wBShe/OoBETCCUSw9oMLISvgh/WkaiwAUh6+k55YJq
fQgLWp64u5y0a77f2AcSaAD/CIiBXXKZOWkoCCAAuXa2C/4OfvgDDu0C6qyc6+1YPCZBLCArEQWL
KjDo2B7qEWSrVKuCy8YNd8iAZBuzM+QV+dSfFkAARqzqPKqnsXjjYjg+5wSbPQQD2HaIebAcIiOL
h2M+72YNekALULir/03ALrNclXaPX1CrPZ6CMgidX4ggMHC4ytmnPuYFlVCHOU21Cdo3HsvW3WAG
BPKpSfGpblMgIDDu8tiHeZgHlQAGfVI7zXErRKKCC4/t5Am7Qcogyx4OeJADBfDRBfAACUaAAXCE
ALHLY1S1fcscxbFxh5jeY9Ycj+SCOswI/94N8HmEG/AADwgCR8CEcRAQxFGrgxF0RowQxoZIh/bW
77GjMSzXEcuwy4fDoOTzwG8WHs6Z7a+YcNSG8zinDGhwJw6dOxBaLmItzAkCIeviN/sG9M4YtSqI
zrGDu7MzbJxwJOQ5bRLd5UfnDHXQiY3Yt6oY1KG4ZGE4pM7Ry5/2dOFA61aH9ViX9Vmn9Vq39VvH
9VxnjoAAACH/C1NUQVJESVYgNS4wCQGiDgAAXgoAAAA7
--=_6xaiexiy7y80
Content-Type: image/gif;
name="siprp_logo.gif"
Content-Disposition: attachment;
filename="siprp_logo.gif"
Content-Transfer-Encoding: base64
R0lGODlhUgHeAPAAAAAA/wD//yH5BAEAACAALAAAAABSAd4Ah8IxPcVMVMpiZ850eIF/g4yKjZWU
l5+eoKmnqrGwsrm4utODh9eRlNqeod6qreK1t8LBw8nIytHQ0dfX2N/e3+bAwunKy+3U1fHd3ubm
5uzs7PXm5/ju7/Pz8/v3+P39/fwD+wAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAA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JmBmngZqeVnoRGhpNbvekjWoU/AhXopeNl3p6
FroSJeoQXTps5emfUOGNUbV7qdipXTqi5aaeEjGp0NRbeSoUGTBiJjVOyKiJPHqePiqoS5oRo0oA
b1arRcFkI4alAYYACsBQG5FuS2Z+0jqtuxkS03qt5TeND0EB48etIdat4Pqt4tpb2Fqu+CgV16pN
6rqu7Nqu7vquHxMQACH/C1NUQVJESVYgNS4wCQE+DwAAAwoAAAA7
--=_6xaiexiy7y80--

@ -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;
}
}

@ -0,0 +1,592 @@
package pdf;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.sql.Time;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;
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 com.evolute.utils.fop.FOPCreator;
import com.evolute.utils.fop.PDFCreator;
public class PdfGenerator
{
protected final String imagePath;
protected final Estabelecimento estabelecimento;
protected final Utilizador tecnicoSuperior;
protected final Utilizador medico;
protected final AnaliseAcidente analiseAcidente;
protected final Acidentado acidentado;
protected final Seccao seccao;
protected final Recomendacao recomendacoes[];
protected final Medida medidas[];
protected final Causa causa;
protected final URL urlSiprp;
protected final URL urlAuchan;
//protected Vector<URL> imagens = new Vector<URL>();
protected Vector imagens = new Vector();
public static void main( String args[] )
throws Exception
{
AnaliseAcidente analise = new AnaliseAcidente();
analise.setAnalise_nr( "12/3" );
byte[] pdf =
new PdfGenerator( "/home/fpalma/Desktop",
new Estabelecimento(),
new Utilizador(),
new Utilizador(),
analise,
new Acidentado(),
new Seccao(),
new Recomendacao[ 0 ],
new Medida[ 0 ],
new Causa() ).generatePdf();
File pdfFile = new File( "/home/fpalma/Desktop/siprp.pdf" );
pdfFile.createNewFile();
FileOutputStream fos = new FileOutputStream( pdfFile );
fos.write( pdf );
fos.close();
System.out.println( "DONE" );
}
public PdfGenerator(
String imagePath,
Estabelecimento estabelecimento,
Utilizador tecnicoSuperior,
Utilizador medico,
AnaliseAcidente analiseAcidente,
Acidentado acidentado,
Seccao seccao,
Recomendacao recomendacoes[],
Medida medidas[],
Causa causa )
{
this.imagePath = imagePath;
this.estabelecimento = estabelecimento;
this.tecnicoSuperior = tecnicoSuperior;
this.medico = medico;
this.analiseAcidente = analiseAcidente;
this.acidentado = acidentado;
this.seccao = seccao;
this.recomendacoes = recomendacoes;
this.medidas = medidas;
this.causa = causa;
this.urlSiprp = getClass().getResource( "siprp_logo.gif" );
this.urlAuchan = getClass().getResource( "auchan_logo.gif" );
carregarURLs();
}
protected void carregarURLs()
{
String fullPath =
imagePath + "/" +
analiseAcidente.getAnalise_nr().substring(0,2) +
analiseAcidente.getAnalise_nr().substring(3);
File dir = null;
try
{
dir = new File( fullPath );
if( dir == null || !dir.exists() || !dir.isDirectory() )
{
return;
}
File files[] = dir.listFiles();
for( int f = 0; f < files.length; f++ )
{
imagens.add( files[ f ].toURI().toURL() );
}
}
catch( Exception ex )
{
return;
}
}
public byte[] generatePdf()
throws Exception
{
Document doc = new Document( createXml() );
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new XMLOutputter().output( doc, baos );
ByteArrayOutputStream out = new ByteArrayOutputStream();
InputStream xmlIn = new ByteArrayInputStream( baos.toByteArray() );
InputStream xslStream = getClass().getClassLoader().getResourceAsStream( "pdf/analise_acidentes_trabalho.xsl" );
FOPCreator.getFOPCreator().createFOfromXML( xmlIn, xslStream, out );
return PDFCreator.getPDFCreator().createPdfFromFo( out.toByteArray() );
}
protected Element createXml()
{
Element rootElement = new Element( "AnaliseAcidente" );
Element logoTipoSIPRPElement = new Element( "LogotipoSIPRP" );
logoTipoSIPRPElement.setText( urlSiprp.toString() );
rootElement.addContent( logoTipoSIPRPElement );
Element logoTipoAuchanElement = new Element( "LogotipoAuchan" );
logoTipoAuchanElement.setText( urlAuchan.toString() );
rootElement.addContent( logoTipoAuchanElement );
Element numeroElement = new Element( "Numero" );
numeroElement.setText( analiseAcidente.getAnalise_nr() );
rootElement.addContent( numeroElement );
Date data = analiseAcidente.getData_acidente();
rootElement.addContent( createDataElement( "Data", data ) );
rootElement.addContent( createEntidadeEmpregadoraElement() );
rootElement.addContent( createSeguroElement() );
rootElement.addContent( createEmpresaSHSTElement() );
rootElement.addContent( createAcidentadoElement() );
rootElement.addContent( createAcidenteElement() );
rootElement.addContent( createRecomendacoesSIPRPElement() );
rootElement.addContent( createMedidasElement() );
rootElement.addContent( createTomadaConhecimentoElement() );
return rootElement;
}
protected Element createEntidadeEmpregadoraElement()
{
Element entidadeEmpregadoraElement = new Element( "EntidadeEmpregadora" );
Element identificacaoElement = new Element( "IdentificacaoCompleta" );
identificacaoElement.setText( "Companhia Portuguesa de Hipermercados, S.A., com sede na Travessa Teixeira J\u00fanior, 1 - 1300-553 Lisboa" );
entidadeEmpregadoraElement.addContent( identificacaoElement );
Element actividadeElement = new Element( "Actividade" );
actividadeElement.setText( "Com\u00e9rcio a Retalho em Supermercados e Hipermercados" );
entidadeEmpregadoraElement.addContent( actividadeElement );
Element lojaElement = new Element( "Loja" );
lojaElement.setText( estabelecimento.getNome() );
entidadeEmpregadoraElement.addContent( lojaElement );
return entidadeEmpregadoraElement;
}
protected Element createSeguroElement()
{
Element seguroElement = new Element( "Seguro" );
Element empresaElement = new Element( "Empresa" );
empresaElement.setText( "Mapfre Seguros Gerais, S.A." );
seguroElement.addContent( empresaElement );
Element apoliceElement = new Element( "Apolice" );
apoliceElement.setText( "1500591100500" );
seguroElement.addContent( apoliceElement );
return seguroElement;
}
protected Element createEmpresaSHSTElement()
{
Element empresaSHSTElement = new Element( "EmpresaSHST" );
Element identificacaoElement = new Element( "IdentificacaoCompleta" );
identificacaoElement.setText(
"SIPRP - Sociedade Ib\u00e9rica de Preven\u00e7\u00e3o de Riscos Profissionais Lda., "
+ "com sede no Edif\u00edcio Atrium Saldanha, Pra\u00e7a Duque de Saldanha, 1 - 9\u00ba G"
+ " - 1050-094 Lisboa " );
empresaSHSTElement.addContent( identificacaoElement );
Element tecnicoSuperiorHSTElement = new Element( "TecnicoSuperiorHST" );
Element nomeTecnicoSuperiorHSTElement = new Element( "Nome" );
nomeTecnicoSuperiorHSTElement.setText( tecnicoSuperior.getNome() );
tecnicoSuperiorHSTElement.addContent( nomeTecnicoSuperiorHSTElement );
Element capElement = new Element( "CAP" );
capElement.setText( tecnicoSuperior.getCap() );
tecnicoSuperiorHSTElement.addContent( capElement );
empresaSHSTElement.addContent( tecnicoSuperiorHSTElement );
Element medicoTrabalhoElement = new Element( "MedicoTrabalho" );
Element nomeMedicoTrabalhoElement = new Element( "Nome" );
nomeMedicoTrabalhoElement.setText( medico.getNome() );
medicoTrabalhoElement.addContent( nomeMedicoTrabalhoElement );
Element cedulaElement = new Element( "Cedula" );
cedulaElement.setText( medico.getNumero_cedula() );
medicoTrabalhoElement.addContent( cedulaElement );
empresaSHSTElement.addContent( medicoTrabalhoElement );
return empresaSHSTElement;
}
protected Element createAcidentadoElement()
{
Element acidentadoElement = new Element( "Acidentado" );
Element nomeElement = new Element( "Nome" );
nomeElement.setText( acidentado.getNome() );
acidentadoElement.addContent( nomeElement );
Element estabelecimentoOrigemElement = new Element( "EstabelecimentoOrigem" );
Element nomeEstabelecimentoOrigemElement = new Element( "Nome" );
nomeEstabelecimentoOrigemElement.setText( acidentado.getEstabelecimento_origem() );
estabelecimentoOrigemElement.addContent( nomeEstabelecimentoOrigemElement );
acidentadoElement.addContent( estabelecimentoOrigemElement );
Date dataNascimento = acidentado.getData_nascimento();
acidentadoElement.addContent( createDataElement( "DataNascimento", dataNascimento ) );
Element biElement = new Element( "BilheteIdentidade" );
Element numeroBiElement = new Element( "Numero" );
numeroBiElement.setText( acidentado.getBilhete_identidade() );
biElement.addContent( numeroBiElement );
acidentadoElement.addContent( biElement );
Element moradaElement = new Element( "Morada" );
moradaElement.setText( acidentado.getMorada() + ", " + acidentado.getCod_postal() + " " + acidentado.getLocalidade() );
acidentadoElement.addContent( moradaElement );
Element telefoneElement = new Element( "Telefone" );
telefoneElement.setText( acidentado.getContacto_telefonico() );
acidentadoElement.addContent( telefoneElement );
Date dataAdmissao = acidentado.getData_admissao();
acidentadoElement.addContent( createDataElement( "DataAdmissao", dataAdmissao ) );
Element funcaoElement = new Element( "Funcao" );
funcaoElement.setText( acidentado.getFuncao() );
acidentadoElement.addContent( funcaoElement );
Element turnoElement = new Element( "Turno" );
String turno = acidentado.getTurno();
if( "m".equals( turno ) )
{
turno = "Manh\u00e3";
}
else if( "t".equals( turno ) )
{
turno = "Tarde";
}
else if( "n".equals( turno ) )
{
turno = "Noite";
}
turnoElement.setText( turno );
acidentadoElement.addContent( turnoElement );
Element superiorElement = new Element( "Superior" );
Element nomeSuperiorElement = new Element( "Nome" );
nomeSuperiorElement.setText( acidentado.getNome_superior_hierarquico() );
superiorElement.addContent( nomeSuperiorElement );
Element emailSuperiorElement = new Element( "Email" );
emailSuperiorElement.setText( acidentado.getEmail_superior_hierarquico() );
superiorElement.addContent( emailSuperiorElement );
acidentadoElement.addContent( superiorElement );
return acidentadoElement;
}
protected Element createAcidenteElement()
{
Element acidenteElement = new Element( "Acidente" );
Element averiguadorElement = new Element( "Averiguador" );
Element nomeAveriguadorElement = new Element( "Nome" );
nomeAveriguadorElement.setText( analiseAcidente.getAveriguador() );
averiguadorElement.addContent( nomeAveriguadorElement );
acidenteElement.addContent( averiguadorElement );
Date dataOcorrencia = analiseAcidente.getData_acidente();
acidenteElement.addContent( createDataElement( "DataOcorrencia", dataOcorrencia ) );
Time horaOcorrencia = analiseAcidente.getHora_acidente();
acidenteElement.addContent( createHoraElement( "HoraOcorrencia", horaOcorrencia ) );
Element horasTrabalhadasElement = new Element( "HorasTrabalhadas" );
horasTrabalhadasElement.setText( "" + analiseAcidente.getHoras_turno() );
acidenteElement.addContent( horasTrabalhadasElement );
Element localElement = new Element( "Local" );
Element seccaoElement = new Element( "Seccao" );
seccaoElement.setText( seccao.getDescricao() );
localElement.addContent( seccaoElement );
Element localEspecificoElement = new Element( "LocalEspecifico" );
localEspecificoElement.setText( analiseAcidente.getLocal_trabalho() );
localElement.addContent( localEspecificoElement );
acidenteElement.addContent( localElement );
Element actividadeElement = new Element( "Actividade" );
Element descricaoActividadeElement = new Element( "Descricao" );
descricaoActividadeElement.setText( analiseAcidente.getTarefa() );
actividadeElement.addContent( descricaoActividadeElement );
Element objectosActividadeElement = new Element( "Objectos" );
objectosActividadeElement.setText( analiseAcidente.getSubstancias() );
actividadeElement.addContent( objectosActividadeElement );
Element condicoesActividadeElement = new Element( "Condicoes" );
condicoesActividadeElement.setText( analiseAcidente.getCondicoes() );
actividadeElement.addContent( condicoesActividadeElement );
acidenteElement.addContent( actividadeElement );
Element testemunhasElement = new Element( "Testemunhas" );
testemunhasElement.setText( analiseAcidente.getTestemunhas() );
acidenteElement.addContent( testemunhasElement );
Element causasElement = new Element( "Causas" );
causasElement.setText( causa.getCausa() );
acidenteElement.addContent( causasElement );
Element descricaoElement = new Element( "Descricao" );
descricaoElement.setText( analiseAcidente.getDescricao() );
acidenteElement.addContent( descricaoElement );
Element imagensElement = new Element( "Imagens" );
if( imagens.size() > 0 )
{
Element temImagensElement = new Element( "TemImagens" );
temImagensElement.setText( "y" );
imagensElement.addContent( temImagensElement );
for( int i = 0; i < imagens.size(); i++ )
{
String imagem = imagens.get( i ).toString();
Element imagemElement = new Element( "Imagem" );
imagemElement.setText( imagem );
imagensElement.addContent( imagemElement );
}
}
acidenteElement.addContent( imagensElement );
Element conclusoesElement = new Element( "Conclusoes" );
conclusoesElement.setText( analiseAcidente.getConclusoes() );
acidenteElement.addContent( conclusoesElement );
Element accoesTomadasElement = new Element( "AccoesTomadas" );
accoesTomadasElement.setText( analiseAcidente.getAccoes() );
acidenteElement.addContent( accoesTomadasElement );
Element formacaoSHSTElement = new Element( "FormacaoSHST" );
Element teveFormacaoSHSTElement = new Element( "TeveFormacao" );
teveFormacaoSHSTElement.setText( analiseAcidente.getFormacao_shst() );
formacaoSHSTElement.addContent( teveFormacaoSHSTElement );
Element motivoFormacaoSHSTElement = new Element( "Motivo" );
motivoFormacaoSHSTElement.setText( analiseAcidente.getFormacao_shst_nao_porque() );
formacaoSHSTElement.addContent( motivoFormacaoSHSTElement );
acidenteElement.addContent( formacaoSHSTElement );
Element outrasOcorrenciasMesmoPostoElement = new Element( "OutrasOcorrenciasMesmoPosto" );
Element quantidadeOutrasOcorrenciasMesmoPostoElement = new Element( "Quantidade" );
boolean outrasOcorrenciasMesmoPosto = "y".equals( analiseAcidente.getOutros_acidentes_com_colaborador() );
quantidadeOutrasOcorrenciasMesmoPostoElement.setText(
outrasOcorrenciasMesmoPosto ? "" + analiseAcidente.getNr_acidentes_com_colaborador() : "0" );
outrasOcorrenciasMesmoPostoElement.addContent( quantidadeOutrasOcorrenciasMesmoPostoElement );
Element relatoriosOutrasOcorrenciasMesmoPostoElement = new Element( "Relatorios" );
Integer relatorioMesmoPosto1 = analiseAcidente.getNr_relatorio_acidente_colaborador1();
Integer relatorioMesmoPosto2 = analiseAcidente.getNr_relatorio_acidente_colaborador2();
Integer relatorioMesmoPosto3 = analiseAcidente.getNr_relatorio_acidente_colaborador3();
Integer relatorioMesmoPosto4 = analiseAcidente.getNr_relatorio_acidente_colaborador4();
String numerosRelatoriosOutrasOcorrenciasMesmoPosto[] =
new String[]{
relatorioMesmoPosto1 != null ? "" + relatorioMesmoPosto1 : null,
relatorioMesmoPosto2 != null ? "" + relatorioMesmoPosto2 : null,
relatorioMesmoPosto3 != null ? "" + relatorioMesmoPosto3 : null,
relatorioMesmoPosto4 != null ? "" + relatorioMesmoPosto4 : null
};
for( int r = 0; r < numerosRelatoriosOutrasOcorrenciasMesmoPosto.length; r++ )
{
if( numerosRelatoriosOutrasOcorrenciasMesmoPosto[ r ] == null )
{
continue;
}
String numeroRelatorio = numerosRelatoriosOutrasOcorrenciasMesmoPosto[ r ];
Element relatorioElement = new Element( "Relatorio" );
relatorioElement.setText( numeroRelatorio );
relatoriosOutrasOcorrenciasMesmoPostoElement.addContent( relatorioElement );
}
outrasOcorrenciasMesmoPostoElement.addContent( relatoriosOutrasOcorrenciasMesmoPostoElement );
acidenteElement.addContent( outrasOcorrenciasMesmoPostoElement );
Element outrasOcorrenciasOutrosTrabalhadoresElement = new Element( "OutrasOcorrenciasOutrosTrabalhadores" );
Element quantidadeOutrasOcorrenciasOutrosTrabalhadoresElement = new Element( "Quantidade" );
boolean outrasOcorrenciasOutrosTrabalhadores = "y".equals( analiseAcidente.getAcidentes_outros_colaboradores() );
quantidadeOutrasOcorrenciasOutrosTrabalhadoresElement.setText(
outrasOcorrenciasOutrosTrabalhadores ? "" + analiseAcidente.getNr_acidentes_outros_colaboradores() : "0" );
outrasOcorrenciasOutrosTrabalhadoresElement.addContent( quantidadeOutrasOcorrenciasOutrosTrabalhadoresElement );
Element relatoriosOutrasOcorrenciasOutrosTrabalhadoresElement = new Element( "Relatorios" );
Integer relatorioOtrosTrabalhadores1 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores1();
Integer relatorioOtrosTrabalhadores2 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores2();
Integer relatorioOtrosTrabalhadores3 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores3();
Integer relatorioOtrosTrabalhadores4 = analiseAcidente.getNr_relatorio_acidente_outros_colaboradores4();
String numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores[] =
new String[]{
relatorioOtrosTrabalhadores1 != null ? "" + relatorioOtrosTrabalhadores1 : null,
relatorioOtrosTrabalhadores2 != null ? "" + relatorioOtrosTrabalhadores2 : null,
relatorioOtrosTrabalhadores3 != null ? "" + relatorioOtrosTrabalhadores3 : null,
relatorioOtrosTrabalhadores4 != null ? "" + relatorioOtrosTrabalhadores4 : null
};
for( int r = 0; r < numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores.length; r++ )
{
if( numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores[ r ] == null )
{
continue;
}
String numeroRelatorio = numerosRelatoriosOutrasOcorrenciasOutrosTrabalhadores[ r ];
Element relatorioElement = new Element( "Relatorio" );
relatorioElement.setText( numeroRelatorio );
relatoriosOutrasOcorrenciasOutrosTrabalhadoresElement.addContent( relatorioElement );
}
outrasOcorrenciasOutrosTrabalhadoresElement.addContent( relatoriosOutrasOcorrenciasOutrosTrabalhadoresElement );
acidenteElement.addContent( outrasOcorrenciasOutrosTrabalhadoresElement );
Element lesaoElement = new Element( "Lesao" );
Element areasLesaoElement = new Element( "Areas" );
boolean cabeca = "y".equals( analiseAcidente.getLesao_cabeca() );
boolean pescoco = "y".equals( analiseAcidente.getLesao_pescoco() );
boolean tronco = "y".equals( analiseAcidente.getLesao_tronco() );
boolean superiorDireito = "y".equals( analiseAcidente.getLesao_membro_sup_dir() );
String detalheSuperiorDireito = analiseAcidente.getEspecif1();
boolean superiorEsquerdo = "y".equals( analiseAcidente.getLesao_membro_sup_esq() );
String detalheSuperiorEsquerdo = analiseAcidente.getEspecif2();
boolean inferiorDireito = "y".equals( analiseAcidente.getLesao_membro_inf_dir() );
String detalheInferiorDireito = analiseAcidente.getEspecif3();
boolean inferiorEsquerdo = "y".equals( analiseAcidente.getLesao_membro_inf_esq() );
String detalheInferiorEsquerdo = analiseAcidente.getEspecif4();
String areasLesao[][] =
new String[][]{
cabeca ? new String[] { "Cabe\u00e7a", "" } : null,
pescoco ? new String[] { "Pesco\u00e7o", "" } : null,
tronco ? new String[] { "Tronco", "" } : null,
superiorDireito ? new String[] { "Membro Superior Direito", detalheSuperiorDireito } : null,
superiorEsquerdo ? new String[] { "Membro Superior Esquerdo", detalheSuperiorEsquerdo } : null,
inferiorDireito ? new String[] { "Membro Inferior Direito", detalheInferiorDireito } : null,
inferiorEsquerdo ? new String[] { "Membro Inferior Esquerdo", detalheInferiorEsquerdo } : null,
};
for( int a = 0; a < areasLesao.length; a++ )
{
if( areasLesao[ a ] == null )
{
continue;
}
String area[] = areasLesao[ a ];
Element areaLesaoElement = new Element( "Area" );
Element nomeAreaLesaoElement = new Element( "Nome" );
nomeAreaLesaoElement.setText( area[ 0 ] );
areaLesaoElement.addContent( nomeAreaLesaoElement );
Element detalheAreaLesaoElement = new Element( "Detalhe" );
detalheAreaLesaoElement.setText( area[ 1 ] );
areaLesaoElement.addContent( detalheAreaLesaoElement );
areasLesaoElement.addContent( areaLesaoElement );
}
lesaoElement.addContent( areasLesaoElement );
Element tipoLesaoElement = new Element( "Tipo" );
tipoLesaoElement.setText( analiseAcidente.getTipo_lesao() );
lesaoElement.addContent( tipoLesaoElement );
acidenteElement.addContent( lesaoElement );
Element incapacidadeElement = new Element( "Incapacidade" );
Element tipoIncapacidadeElement = new Element( "Tipo" );
String tipoIncapacidade = analiseAcidente.getTipo_incapacidade();
if( "n".equals( tipoIncapacidade ) )
{
tipoIncapacidade = "Nenhuma";
}
else if( "t".equals( tipoIncapacidade ) )
{
tipoIncapacidade = "Tempor\u00e1ria";
}
else if( "p".equals( tipoIncapacidade ) )
{
tipoIncapacidade = "Permanente";
}
tipoIncapacidadeElement.setText( tipoIncapacidade );
incapacidadeElement.addContent( tipoIncapacidadeElement );
Element coeficienteIncapacidadeElement = new Element( "Coeficiente" );
coeficienteIncapacidadeElement.setText( "" + analiseAcidente.getCoef_incapacidade() );
incapacidadeElement.addContent( coeficienteIncapacidadeElement );
Date dataAvaliacao = analiseAcidente.getData_aval_incapacidade();
incapacidadeElement.addContent( createDataElement( "DataAvaliacao", dataAvaliacao ) );
Date dataRevisao = analiseAcidente.getData_rev_incapacidade();
incapacidadeElement.addContent( createDataElement( "DataRevisao", dataRevisao ) );
Element periodoIncapacidadeElement = new Element( "PeriodoIncapacidade" );
Date inicioIncapacidade = analiseAcidente.getPeriodo_incapacidade_de();
periodoIncapacidadeElement.addContent( createDataElement( "Inicio", inicioIncapacidade ) );
Date fimIncapacidade = analiseAcidente.getPeriodo_incapacidade_a();
periodoIncapacidadeElement.addContent( createDataElement( "Fim", fimIncapacidade ) );
incapacidadeElement.addContent( periodoIncapacidadeElement );
acidenteElement.addContent( incapacidadeElement );
return acidenteElement;
}
protected Element createRecomendacoesSIPRPElement()
{
Element recomendacoesSIPRPElement = new Element( "RecomendacoesSIPRP" );
for( int r = 0; r < recomendacoes.length; r++ )
{
Element recomendacaoElement = new Element( "Recomendacao" );
recomendacaoElement.setText( recomendacoes[ r ].getRecomendacao() );
recomendacoesSIPRPElement.addContent( recomendacaoElement );
}
return recomendacoesSIPRPElement;
}
protected Element createMedidasElement()
{
Element medidasElement = new Element( "MedidasAdoptar" );
for( int m = 0; m < medidas.length; m++ )
{
Element medidaElement = new Element( "Medida" );
medidaElement.setText( medidas[ m ].getMedida() );
medidasElement.addContent( medidaElement );
}
return medidasElement;
}
protected Element createTomadaConhecimentoElement()
{
Element tomadaConhecimentoElement = new Element( "TomadaConhecimento" );
tomadaConhecimentoElement.addContent(
createAssinaturaElement( "DepartamentoSeguranca",
analiseAcidente.getAveriguador(),
analiseAcidente.getData_inicio_processo() ) );
tomadaConhecimentoElement.addContent(
createAssinaturaElement( "TecnicoHST",
analiseAcidente.getNome_resp_consolidacao(),
analiseAcidente.getData_consolidacao() ) );
tomadaConhecimentoElement.addContent(
createAssinaturaElement( "ResponsavelSeguranca",
analiseAcidente.getNome_resp_seg(),
analiseAcidente.getData_assinatura_seg() ) );
tomadaConhecimentoElement.addContent(
createAssinaturaElement( "ResponsavelRH",
analiseAcidente.getNome_resp_rh(),
analiseAcidente.getData_assinatura_rh() ) );
tomadaConhecimentoElement.addContent(
createAssinaturaElement( "SuperiorHierarquico",
acidentado.getNome_superior_hierarquico(),
acidentado.getData_email_superior_hierarquico() ) );
return tomadaConhecimentoElement;
}
protected Element createAssinaturaElement( String nome, String nomeStr, Date data )
{
Element assinaturaElement = new Element( nome );
Element nomeElement = new Element( "Nome" );
nomeElement.setText( nomeStr );
assinaturaElement.addContent( nomeElement );
assinaturaElement.addContent( createDataElement( "Data", data ) );
return assinaturaElement;
}
protected Element createDataElement( String nome, Date data )
{
Element dataElement = new Element( nome );
Element anoElement = new Element( "Ano" );
dataElement.addContent( anoElement );
Element mesElement = new Element( "Mes" );
dataElement.addContent( mesElement );
Element diaElement = new Element( "Dia" );
dataElement.addContent( diaElement );
if( data != null )
{
Calendar cal = Calendar.getInstance();
cal.setTime( data );
anoElement.setText( "" + cal.get( Calendar.YEAR ) );
int mes = cal.get( Calendar.MONTH ) + 1;
mesElement.setText( mes > 9 ? ( "" + mes ) : ( "0" + mes ) );
int dia = cal.get( Calendar.DAY_OF_MONTH );
diaElement.setText( dia > 9 ? ( "" + dia ) : ( "0" + dia ) );
}
return dataElement;
}
protected Element createHoraElement( String nome, Date hora )
{
Element horaElement = new Element( nome );
Element horasElement = new Element( "Horas" );
horaElement.addContent( horasElement );
Element minutosElement = new Element( "Minutos" );
horaElement.addContent( minutosElement );
if( hora != null )
{
Calendar cal = Calendar.getInstance();
cal.setTime( hora );
int horas = cal.get( Calendar.HOUR_OF_DAY );
horasElement.setText( horas > 9 ? ( "" + horas ) : ( "0" + horas ) );
int minutos = cal.get( Calendar.MINUTE );
minutosElement.setText( minutos > 9 ? ( "" + minutos ) : ( "0" + minutos ) );
}
return horaElement;
}
}

@ -0,0 +1,841 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.1" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes" />
<xsl:template match="AnaliseAcidente">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="1.5cm" margin-bottom="1.5cm" margin-left="2cm" margin-right="2cm">
<fo:region-body margin-bottom="16pt" margin-top="12pt" />
<fo:region-before extent="10pt" display-align="before" />
<fo:region-after extent="10pt" display-align="after" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="8pt" text-align="right">
Página
<fo:inline>
<fo:page-number />
</fo:inline>
de
<fo:inline>
<fo:page-number-citation ref-id="endofdoc" />
</fo:inline>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<!-- TABELA 1 -->
<fo:table table-layout="fixed" width="100%">
<fo:table-column column-width="proportional-column-width(25)" />
<fo:table-column column-width="proportional-column-width(25)" />
<fo:table-column column-width="proportional-column-width(25)" />
<fo:table-column column-width="proportional-column-width(25)" />
<fo:table-body>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" border-width="thin" number-columns-spanned="1">
<fo:block font-size="8pt" space-before="0.3cm" space-after="0.3cm" margin-left="0.2cm" font-weight="bold" text-align="center">
<xsl:variable name="LogotipoSIPRP" select="LogotipoSIPRP" />
<fo:external-graphic src="url('{$LogotipoSIPRP}')" text-align="center" background-color="rgb(255,255,255)" display-align="center" content-height="33pt" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid" border-width="thin" number-columns-spanned="2">
<fo:block font-size="8pt" text-align="center" space-before="0.3cm" space-before.conditionality="retain" space-after="0.3cm" margin-left="0.2cm" font-weight="bold">ANÁLISE DE ACIDENTE DE TRABALHO</fo:block>
<fo:block>
<fo:table table-layout="fixed" width="100%">
<fo:table-column column-width="proportional-column-width(50)" />
<fo:table-column column-width="proportional-column-width(50)" />
<fo:table-body>
<fo:table-row>
<fo:table-cell border-top-color="black" border-top-style="solid" border-top-width="thin" number-columns-spanned="1">
<fo:block text-align="start" font-size="8pt" space-before="0.3cm" space-after="0.3cm" space-before.conditionality="retain" margin-left="0.2cm" font-weight="bold">
N.º
<xsl:value-of select="Numero" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-left-color="black" border-left-style="solid" border-left-width="thin" border-top-color="black" border-top-style="solid" border-top-width="thin" number-columns-spanned="1">
<fo:block text-align="start" font-size="8pt" space-before="0.3cm" space-after="0.3cm" space-before.conditionality="retain" margin-left="0.2cm" font-weight="bold">
DATA:
<xsl:value-of select="Data/Ano" />
/
<xsl:value-of select="Data/Mes" />
/
<xsl:value-of select="Data/Dia" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid" border-width="thin" number-columns-spanned="1">
<fo:block font-size="8pt" space-before="0.3cm" space-after="0.3cm" margin-left="0.2cm" font-weight="bold" text-align="center">
<xsl:variable name="LogotipoAuchan" select="LogotipoAuchan" />
<fo:external-graphic src="url('{$LogotipoAuchan}')" text-align="center" display-align="center" content-height="33pt" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!-- TABELA 2 -->
<fo:table table-layout="fixed" space-before="5mm" width="100%">
<fo:table-column />
<fo:table-body>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell padding="2pt" border-color="black" border-style="solid" margin-left="0.2cm" font-size="8pt" number-columns-spanned="1">
<fo:block margin-left="0.2cm" space-before="0.1cm">IDENTIFICAÇÃO DA
ENTIDADE EMPREGADORA</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row background-color="rgb(255,204,153)">
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" margin-left="0.2cm" font-size="8pt" number-columns-spanned="1">
<fo:inline font-weight="bold">Identificação
completa:</fo:inline>
<xsl:value-of select="EntidadeEmpregadora/IdentificacaoCompleta" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row background-color="rgb(255,204,153)">
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt" number-columns-spanned="1">
<fo:inline font-weight="bold">Actividade desenvolvida:</fo:inline>
<xsl:value-of select="EntidadeEmpregadora/Actividade" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid">
<fo:block font-size="8pt" space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" number-columns-spanned="1">
<fo:inline font-weight="bold">Loja:</fo:inline>
<xsl:value-of select="EntidadeEmpregadora/Loja" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!-- TABELA 3 -->
<fo:table table-layout="fixed" space-before="5mm" width="100%">
<fo:table-column />
<fo:table-body>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">EMPRESA SEGURADORA</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row background-color="rgb(255,204,153)">
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Identificação
completa:</fo:inline>
<xsl:value-of select="Seguro/Empresa" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row background-color="rgb(255,204,153)">
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Nº de Apólice:</fo:inline>
<xsl:value-of select="Seguro/Apolice" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!-- TABELA 4 -->
<fo:table table-layout="fixed" space-before="5mm" width="100%">
<fo:table-column column-width="proportional-column-width(70)" />
<fo:table-column column-width="proportional-column-width(30)" />
<fo:table-body>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">EMPRESA PRESTADORA DE
SERVIÇOS DE
SEGURANÇA, HIGIENE E
SAÚDE DO TRABALHO</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row background-color="rgb(255,204,153)">
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Identificação
completa:</fo:inline>
<xsl:value-of select="EmpresaSHST/IdentificacaoCompleta" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Técnico(a) Superior
de HST:</fo:inline>
<xsl:value-of select="EmpresaSHST/TecnicoSuperiorHST/Nome" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">C.A.P. nº:</fo:inline>
<xsl:value-of select="EmpresaSHST/TecnicoSuperiorHST/CAP" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Médico(a) do
Trabalho:</fo:inline>
<xsl:value-of select="EmpresaSHST/MedicoTrabalho/Nome" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Cédula Prof. nº:</fo:inline>
<xsl:value-of select="EmpresaSHST/MedicoTrabalho/Cedula" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!--Table5-->
<fo:table table-layout="fixed" space-before="5mm" width="100%">
<fo:table-column column-width="proportional-column-width(50)" />
<fo:table-column column-width="proportional-column-width(50)" />
<fo:table-body>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt" font-weight="bold">ACIDENTADO (A)</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Nome:</fo:inline>
<xsl:value-of select="Acidentado/Nome" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Estabelecimento de
origem:</fo:inline>
<xsl:value-of select="Acidentado/EstabelecimentoOrigem/Nome" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Data Nascimento:</fo:inline>
<xsl:value-of select="Acidentado/DataNascimento/Ano" />
/
<xsl:value-of select="Acidentado/DataNascimento/Mes" />
/
<xsl:value-of select="Acidentado/DataNascimento/Dia" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Bilhete de Identidade
N°:</fo:inline>
<xsl:value-of select="Acidentado/BilheteIdentidade/Numero" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Morada:</fo:inline>
<xsl:value-of select="Acidentado/Morada" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Contacto
telefónico:</fo:inline>
<xsl:value-of select="Acidentado/Telefone" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Data admissão:</fo:inline>
<xsl:value-of select="Acidentado/DataAdmissao/Ano" />
/
<xsl:value-of select="Acidentado/DataAdmissao/Mes" />
/
<xsl:value-of select="Acidentado/DataAdmissao/Dia" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Função:</fo:inline>
<xsl:value-of select="Acidentado/Funcao" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Turno de Trabalho:</fo:inline>
<xsl:value-of select="Acidentado/Turno" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-left-color="black" border-left-style="solid" border-right-color="black" border-right-style="solid" border-top-color="black" border-top-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt" font-weight="bold">Identificação do superior
hierárquico/Responsável do
posto de trabalho</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-left-color="black" border-left-style="solid" border-bottom-color="black" border-bottom-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Nome:</fo:inline>
<xsl:value-of select="Acidentado/Superior/Nome" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-bottom-color="black" border-bottom-style="solid" border-right-color="black" border-right-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">E-mail:</fo:inline>
<xsl:value-of select="Acidentado/Superior/Email" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!--Table6-->
<fo:table table-layout="fixed" space-before="5mm" width="100%">
<fo:table-column column-width="proportional-column-width(50)" />
<fo:table-column column-width="proportional-column-width(50)" />
<fo:table-body>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt" font-weight="bold">DADOS DO ACIDENTE DE
TRABALHO</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Averiguador:</fo:inline>
<xsl:value-of select="Acidente/Averiguador/Nome" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Data da ocorrência:</fo:inline>
<xsl:value-of select="Acidente/DataOcorrencia/Ano" />
/
<xsl:value-of select="Acidente/DataOcorrencia/Mes" />
/
<xsl:value-of select="Acidente/DataOcorrencia/Dia" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Hora do acidente:</fo:inline>
<xsl:value-of select="Acidente/HoraOcorrencia/Horas" />
h
<xsl:value-of select="Acidente/HoraOcorrencia/Minutos" />
m
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Nº horas trabalhadas no
turno:</fo:inline>
<xsl:value-of select="Acidente/HorasTrabalhadas" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Secção:</fo:inline>
<xsl:value-of select="Acidente/Local/Seccao" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Local específico:</fo:inline>
<xsl:value-of select="Acidente/Local/LocalEspecifico" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Tarefa/Actividade que se
encontrava a realizar:</fo:inline>
<xsl:value-of select="Acidente/Actividade/Descricao" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Substâncias,
equipamentos,
ferramentas e objectos
utilizados:</fo:inline>
<xsl:value-of select="Acidente/Actividade/Objectos" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Condições que
contribuíram para o
acidente e respectiva
explicação da
sua existência:</fo:inline>
<xsl:value-of select="Acidente/Actividade/Condicoes" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Testemunhas:</fo:inline>
<xsl:value-of select="Acidente/Testemunhas" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Causas do acidente:</fo:inline>
<xsl:value-of select="Acidente/Causas" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Descrição do
acidente:</fo:inline>
<xsl:value-of select="Acidente/Descricao" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Fotografia(s) e/ou
croqui(s) do local do
acidente:</fo:inline>
<xsl:choose>
<xsl:when test="self::node()[Acidente/Imagens/TemImagens='y']">
<fo:inline font-weight="bold">Ver Anexo</fo:inline>
</xsl:when>
<xsl:otherwise>
<fo:inline font-weight="bold">Nenhum</fo:inline>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="Acidente/Imagens/Imagem">
<!-- Inserir Imagem-->
</xsl:for-each>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Conclusões:</fo:inline>
<xsl:value-of select="Acidente/Conclusoes" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Acções Imediatas
tomadas:</fo:inline>
<xsl:value-of select="Acidente/AccoesTomadas" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<xsl:choose>
<xsl:when test="self::node()[Acidente/FormacaoSHST/TeveFormacao='y']">
<fo:inline font-weight="bold">O colaborador
teve formação em SHST</fo:inline>
</xsl:when>
<xsl:otherwise>
<fo:inline font-weight="bold">O colaborador não
teve formação em SHST</fo:inline>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<xsl:choose>
<xsl:when test="self::node()[Acidente/FormacaoSHST/TeveFormacao='n']">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Motivo:</fo:inline>
<xsl:value-of select="Acidente/FormacaoSHST/Motivo" />
</fo:block>
</xsl:when>
</xsl:choose>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<xsl:choose>
<xsl:when test="self::node()[Acidente/OutrasOcorrenciasMesmoPosto/Quantidade&gt;0]">
<fo:inline font-weight="bold">Verificaram-se outras
ocorrências/incidências
no mesmo posto de
trabalho com o
colaborador acidentado.</fo:inline>
</xsl:when>
<xsl:otherwise>
<fo:inline font-weight="bold">Não se verificaram outras
ocorrências/incidências
no mesmo posto de
trabalho com o
colaborador acidentado.</fo:inline>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<xsl:choose>
<xsl:when test="self::node()[Acidente/OutrasOcorrenciasMesmoPosto/Quantidade&gt;0]">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Quantidade:</fo:inline>
<xsl:value-of select="Acidente/OutrasOcorrenciasMesmoPosto/Quantidade" />
<fo:inline font-weight="bold">Relatórios de acidente nº:</fo:inline>
<xsl:for-each select="Acidente/OutrasOcorrenciasMesmoPosto/Relatorios/Relatorio">
<xsl:value-of select="." />
;
</xsl:for-each>
</fo:block>
</xsl:when>
</xsl:choose>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<xsl:choose>
<xsl:when test="self::node()[Acidente/OutrasOcorrenciasOutrosTrabalhadores/Quantidade&gt;0]">
<fo:inline font-weight="bold">Verificaram-se
ocorrências/incidentes
semelhantes com outros
colaboradores.</fo:inline>
</xsl:when>
<xsl:otherwise>
<fo:inline font-weight="bold">Não se verificaram
ocorrências/incidentes
semelhantes com outros
colaboradores.</fo:inline>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<xsl:choose>
<xsl:when test="self::node()[Acidente/OutrasOcorrenciasOutrosTrabalhadores/Quantidade&gt;0]">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Quantidade:</fo:inline>
<xsl:value-of select="Acidente/OutrasOcorrenciasOutrosTrabalhadores/Quantidade" />
<fo:inline font-weight="bold">Relatórios de acidente nº:</fo:inline>
<xsl:for-each select="Acidente/OutrasOcorrenciasOutrosTrabalhadores/Relatorios/Relatorio">
<xsl:value-of select="." />
;
</xsl:for-each>
</fo:block>
</xsl:when>
</xsl:choose>
</fo:table-cell>
</fo:table-row>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">LESÃO</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Áreas corporais
específicas
lesionadas:</fo:inline>
</fo:block>
<xsl:for-each select="Acidente/Lesao/Areas/Area">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<xsl:value-of select="Nome" />
<xsl:choose>
<xsl:when test="string-length(Detalhe)&gt;0">
:
<xsl:value-of select="Detalhe" />
</xsl:when>
</xsl:choose>
</fo:block>
</xsl:for-each>
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">
Tipo de Lesão:
<xsl:value-of select="Acidente/Lesao/Tipo" />
</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">INCAPACIDADE</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Tipo de Incapacidade:</fo:inline>
<xsl:value-of select="Acidente/Incapacidade/Tipo" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Coeficiente de
Incapacidade</fo:inline>
<xsl:value-of select="Acidente/Incapacidade/Coeficiente" />
%
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Avaliação de
Incapacidade realizada
em</fo:inline>
<xsl:value-of select="Acidente/Incapacidade/DataAvaliacao/Ano" />
/
<xsl:value-of select="Acidente/Incapacidade/DataAvaliacao/Mes" />
/
<xsl:value-of select="Acidente/Incapacidade/DataAvaliacao/Dia" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Revisão de
Incapacidade</fo:inline>
<xsl:value-of select="Acidente/Incapacidade/DataRevisao/Ano" />
/
<xsl:value-of select="Acidente/Incapacidade/DataRevisao/Mes" />
/
<xsl:value-of select="Acidente/Incapacidade/DataRevisao/Dia" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="2">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">Período da Incapacidade
Temporária: de</fo:inline>
<xsl:value-of select="Acidente/Incapacidade/PeriodoIncapacidade/Inicio/Ano" />
/
<xsl:value-of select="Acidente/Incapacidade/PeriodoIncapacidade/Inicio/Mes" />
/
<xsl:value-of select="Acidente/Incapacidade/PeriodoIncapacidade/Inicio/Dia" />
<fo:inline font-weight="bold">a</fo:inline>
<xsl:value-of select="Acidente/Incapacidade/PeriodoIncapacidade/Fim/Ano" />
/
<xsl:value-of select="Acidente/Incapacidade/PeriodoIncapacidade/Fim/Mes" />
/
<xsl:value-of select="Acidente/Incapacidade/PeriodoIncapacidade/Fim/Dia" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<!--Table8-->
<fo:table table-layout="fixed" space-before="5mm" width="100%">
<fo:table-column />
<fo:table-body>
<fo:table-row background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">RECOMENDAÇÕES PROPOSTAS
pela SIPRP</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="RecomendacoesSIPRP/Recomendacao">
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">
<xsl:value-of select="position()" />
.
<xsl:value-of select="." />
</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
<!--Table9-->
<fo:table table-layout="fixed" space-before="5mm" border="0.5pt solid black" width="100%">
<fo:table-column />
<fo:table-header background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">MEDIDAS A ADOPTAR PELA
ENTIDADE EMPREGADORA</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select="MedidasAdoptar/Medida">
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">
<xsl:value-of select="position()" />
.
<xsl:value-of select="." />
</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
<table-row xmlns="http://www.w3.org/1999/XSL/Format">
<table-cell />
</table-row>
</fo:table-body>
</fo:table>
<fo:table table-layout="fixed" space-before="5mm" border="0.5pt solid black" width="100%">
<fo:table-column />
<fo:table-header background-color="rgb(165,0,33)" font-weight="bold">
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
<fo:inline font-weight="bold">TOMADA DE CONHECIMENTO /
TERMO DE
RESPONSABILIDADE</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-color="black" border-style="solid" number-columns-spanned="1">
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
Averiguado por
<xsl:value-of select="TomadaConhecimento/DepartamentoSeguranca/Nome" />
(Departamento de Segurança)
a
<xsl:value-of select="TomadaConhecimento/DepartamentoSeguranca/Data/Ano" />
/
<xsl:value-of select="TomadaConhecimento/DepartamentoSeguranca/Data/Mes" />
/
<xsl:value-of select="TomadaConhecimento/DepartamentoSeguranca/Data/Dia" />
.
</fo:block>
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
Verificado por
<xsl:value-of select="TomadaConhecimento/TecnicoHST/Nome" />
(Técnico
de HST) a
<xsl:value-of select="TomadaConhecimento/TecnicoHST/Data/Ano" />
/
<xsl:value-of select="TomadaConhecimento/TecnicoHST/Data/Mes" />
/
<xsl:value-of select="TomadaConhecimento/TecnicoHST/Data/Dia" />
.
</fo:block>
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
Verificado por
<xsl:value-of select="TomadaConhecimento/ResponsavelSeguranca/Nome" />
(Responsável de Segurança) a
<xsl:value-of select="TomadaConhecimento/ResponsavelSeguranca/Data/Ano" />
/
<xsl:value-of select="TomadaConhecimento/ResponsavelSeguranca/Data/Mes" />
/
<xsl:value-of select="TomadaConhecimento/ResponsavelSeguranca/Data/Dia" />
.
</fo:block>
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
Verificado por
<xsl:value-of select="TomadaConhecimento/ResponsavelRH/Nome" />
(Responsável de RH) a
<xsl:value-of select="TomadaConhecimento/ResponsavelRH/Data/Ano" />
/
<xsl:value-of select="TomadaConhecimento/ResponsavelRH/Data/Mes" />
/
<xsl:value-of select="TomadaConhecimento/ResponsavelRH/Data/Dia" />
.
</fo:block>
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">
Com conhecimento de
<xsl:value-of select="TomadaConhecimento/SuperiorHierarquico/Nome" />
(Superior hierárquico) a
<xsl:value-of select="TomadaConhecimento/SuperiorHierarquico/Data/Ano" />
/
<xsl:value-of select="TomadaConhecimento/SuperiorHierarquico/Data/Mes" />
/
<xsl:value-of select="TomadaConhecimento/SuperiorHierarquico/Data/Dia" />
.
</fo:block>
<fo:block space-before="0.1cm" space-after="0.1cm" margin-left="0.2cm" font-size="8pt">- processamento informático
- acesso autenticado -</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
<!-- <fo:block id="endofdoc"></fo:block>-->
</fo:flow>
</fo:page-sequence>
<xsl:choose>
<xsl:when test="self::node()[Acidente/Imagens/TemImagens='y']">
<fo:page-sequence master-reference="simpleA4">
<fo:static-content flow-name="xsl-region-before">
<fo:block font-size="8pt" text-align="center">ANEXO - Imagens</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="8pt" text-align="right">
Página
<fo:inline>
<fo:page-number />
</fo:inline>
de
<fo:inline>
<fo:page-number-citation ref-id="endofdoc" />
</fo:inline>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:for-each select="Acidente/Imagens/Imagem">
<fo:block>
<xsl:variable name="Imagem" select="." />
<fo:external-graphic src="url('{$Imagem}')" text-align="center" background-color="rgb(255,255,255)" />
</fo:block>
</xsl:for-each>
<fo:block id="endofdoc" />
</fo:flow>
</fo:page-sequence>
</xsl:when>
</xsl:choose>
</fo:root>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -0,0 +1,384 @@
<?xml version="1.0" encoding="UTF-8"?>
<AnaliseAcidente>
<Numero>
1
</Numero>
<Data>
<Ano>
2008
</Ano>
<Mes>
01
</Mes>
<Dia>
01
</Dia>
</Data>
<EntidadeEmpregadora>
<IdentificacaoCompleta>
Companhia Portuguesa de Hipermercados, S.A., com sede na Travessa Teixeira
J&#xfa;nior, 1 - 1300-553 Lisboa
</IdentificacaoCompleta>
<Actividade>
Com&#xe9;rcio a Retalho em Supermercados e Hipermercados
</Actividade>
<Loja>
Jumbo Alfragide
</Loja>
</EntidadeEmpregadora>
<Seguro>
<Empresa>
Mapfre Seguros Gerais, S.A.
</Empresa>
<Apolice>
1500591100500
</Apolice>
</Seguro>
<EmpresaSHST>
<IdentificacaoCompleta>
SIPRP - Sociedade Ib&#xe9;rica de Preven&#xe7;&#xe3;o de Riscos Profissionais Lda.,
com sede no Edif&#xed;cio Atrium Saldanha, Pra&#xe7;a Duque de Saldanha, 1 - 9&#xba; G
- 1050-094 Lisboa
</IdentificacaoCompleta>
<TecnicoSuperiorHST>
<Nome>
Tecnico HST teste
</Nome>
<CAP>
C1A2P3
</CAP>
</TecnicoSuperiorHST>
<MedicoTrabalho>
<Nome>
Medico Trabalho teste
</Nome>
<Cedula>
C123
</Cedula>
</MedicoTrabalho>
</EmpresaSHST>
<Acidentado>
<Nome>
Trablhador acidentado
</Nome>
<EstabelecimentoOrigem>
<Nome>
Jumbo de Alfragide
</Nome>
</EstabelecimentoOrigem>
<DataNascimento>
<Ano>
1980
</Ano>
<Mes>
11
</Mes>
<Dia>
08
</Dia>
</DataNascimento>
<BilheteIdentidade>
<Numero>
1112225585
</Numero>
</BilheteIdentidade>
<Morada>
Rua de Cima, 3&#xba; dto
</Morada>
<Telefone>
215465981
</Telefone>
<DataAdmissao>
<Ano>
2004
</Ano>
<Mes>
10
</Mes>
<Dia>
01
</Dia>
</DataAdmissao>
<Funcao>
Varredor
</Funcao>
<Turno>
Tarde
</Turno>
<Superior>
<Nome>
Ant&#xf3;nio Pedro
</Nome>
<Email>
apedro@hotmail.com
</Email>
</Superior>
</Acidentado>
<Acidente>
<Averiguador>
<Nome>
Jo&#xe3;o Ant&#xf3;nio
</Nome>
</Averiguador>
<DataOcorrencia>
<Ano>
2007
</Ano>
<Mes>
12
</Mes>
<Dia>
23
</Dia>
</DataOcorrencia>
<HoraOcorrencia>
<Horas>
12
</Horas>
<Minutos>
35
</Minutos>
</HoraOcorrencia>
<HorasTrabalhadas>
4
</HorasTrabalhadas>
<Local>
<Seccao>
Congelados
</Seccao>
<LocalEspecifico>
Corredor Esquerdo
</LocalEspecifico>
</Local>
<Actividade>
<Descricao>
A varrer
</Descricao>
<Objectos>
Vassoura
</Objectos>
<Condicoes>
Ch&#xe3;o molhado
</Condicoes>
</Actividade>
<Testemunhas>
Pedro Silva, Marco Pedro
</Testemunhas>
<Causas>
Sono
</Causas>
<Descricao>
Escorregou e caiu
</Descricao>
<Imagens>
<Imagem>
</Imagem>
<Imagem>
</Imagem>
</Imagens>
<Conclusoes>
Conclusao sem indicios nenhuns q a suportem
</Conclusoes>
<AccoesTomadas>
gritar. correr as voltas em panico
</AccoesTomadas>
<FormacaoSHST>
<TeveFormacao>
y
</TeveFormacao>
<Motivo>
</Motivo>
</FormacaoSHST>
<OutrasOcorrenciasMesmoPosto>
<Quantidade>
3
</Quantidade>
<Relatorios>
<Relatorio>
3487
</Relatorio>
<Relatorio>
23424
</Relatorio>
</Relatorios>
</OutrasOcorrenciasMesmoPosto>
<OutrasOcorrenciasOutrosTrabalhadores>
<Quantidade>
0
</Quantidade>
<Relatorios>
<Relatorio>
</Relatorio>
<Relatorio>
</Relatorio>
</Relatorios>
</OutrasOcorrenciasOutrosTrabalhadores>
<Lesao>
<Areas>
<Area>
<Nome>
Cabe&#xe7;a
</Nome>
</Area>
<Area>
<Nome>
Tronco
</Nome>
</Area>
<Area>
<Nome>
Membro Superior Direito
</Nome>
<Detalhe>
M&#xe3;o
</Detalhe>
</Area>
</Areas>
<Tipo>
Grave
</Tipo>
</Lesao>
<Incapacidade>
<Tipo>
Permanente
</Tipo>
<Coeficiente>
10
</Coeficiente>
<DataAvaliacao>
<Ano>
2005
</Ano>
<Mes>
01
</Mes>
<Dia>
01
</Dia>
</DataAvaliacao>
<DataRevisao>
<Ano>
2007
</Ano>
<Mes>
01
</Mes>
<Dia>
01
</Dia>
</DataRevisao>
<PeriodoIncapacidade>
<Inicio>
<Ano>
</Ano>
<Mes>
</Mes>
<Dia>
</Dia>
</Inicio>
<Fim>
<Ano>
</Ano>
<Mes>
</Mes>
<Dia>
</Dia>
</Fim>
</PeriodoIncapacidade>
</Incapacidade>
</Acidente>
<RecomendacoesSIPRP>
<Recomendacao>
beber mta agua
</Recomendacao>
<Recomendacao>
fazer aerobica
</Recomendacao>
</RecomendacoesSIPRP>
<MedidasAdoptar>
<Medida>
despedir o trabalhador
</Medida>
<Medida>
lamber sabao
</Medida>
</MedidasAdoptar>
<TomadaConhecimento>
<DepartamentoSeguranca>
<Nome>
Joao
</Nome>
<Data>
<Ano>
2007
</Ano>
<Mes>
01
</Mes>
<Dia>
01
</Dia>
</Data>
</DepartamentoSeguranca>
<TecnicoHST>
<Nome>
Pedro
</Nome>
<Data>
<Ano>
2007
</Ano>
<Mes>
01
</Mes>
<Dia>
02
</Dia>
</Data>
</TecnicoHST>
<ResponsavelSeguranca>
<Nome>
Simao
</Nome>
<Data>
<Ano>
2007
</Ano>
<Mes>
01
</Mes>
<Dia>
03
</Dia>
</Data>
</ResponsavelSeguranca>
<ResponsavelRH>
<Nome>
Rafael
</Nome>
<Data>
<Ano>
2007
</Ano>
<Mes>
01
</Mes>
<Dia>
04
</Dia>
</Data>
</ResponsavelRH>
<SuperiorHierarquico>
<Nome>
</Nome>
<Data>
<Ano>
</Ano>
<Mes>
</Mes>
<Dia>
</Dia>
</Data>
</SuperiorHierarquico>
</TomadaConhecimento>
</AnaliseAcidente>

@ -0,0 +1,59 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package phaselistener;
import analiseacidentestrabalho.Utilizador;
import global.Global;
import javax.faces.application.NavigationHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import javax.servlet.http.HttpServletRequest;
import analiseacidentestrabalho.SessionBean1;
import utils.JSFUtils;
import utils.Logos;
/**
*
* @author lluis
*/
public class MainPhaseListener implements PhaseListener{
private boolean firstEntry = true;
public void afterPhase(PhaseEvent pe) {
}
public void beforePhase(PhaseEvent pe) {
if(pe.getPhaseId() == PhaseId.RENDER_RESPONSE)
{
FacesContext fc = pe.getFacesContext();
SessionBean1 session = JSFUtils.getSessionBean(fc);
Utilizador u = session.getCurrentUser();
//insert logos
//Integer empresaId = u.getEmpresa_id();
Integer empresaId = new Integer(32);
//System.out.println("LOGO EMPRESA ID : " + empresaId.toString());
Logos logos = new Logos();
String logourl = logos.getLogo(fc, empresaId);
//System.out.println("LOGO URL : " + logourl);
session.setLogoEmpresaUrl(logourl);
}
}
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
}

@ -0,0 +1,138 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package utils;
import analiseacidentestrabalho.SessionBean1;
import java.util.Iterator;
import java.util.Map;
import javax.faces.application.Application;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
*
* @author lluis
*/
public class JSFUtils {
// public static SessionBean1 getSessionBean(FacesContext fc)
// {
// FacesContext context = fc.getCurrentInstance();
// SessionBean1 session = (SessionBean1) context.getApplication().getELResolver().getValue(context.getELContext(), null, "SessionBean1");
// return session;
// }
//
// isPostBack - JSF 1.1 implementation
//
// public static boolean isPostBack(FacesContext fc)
// {
// Map parameterMap = fc.getExternalContext().getRequestParameterMap();
// if(parameterMap.size() > 0)
// {
// return true;
// }
// return false;
// }
public static SessionBean1 getSessionBean(FacesContext fc)
{
FacesContext context = fc.getCurrentInstance();
//HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
//SessionBean1 session = (SessionBean1) context.getApplication().getELResolver().getValue(context.getELContext(), null, "SessionBean1");
//SessionBean1 session = (SessionBean1) context.getApplication().;
final StringBuffer valueBinding = new StringBuffer();
valueBinding.append('#');
valueBinding.append('{');
valueBinding.append("SessionBean1");
valueBinding.append('}');
SessionBean1 session = (SessionBean1) fc.getApplication().
createValueBinding(valueBinding.toString()).getValue(fc);
return session;
}
public static boolean isPostBack(FacesContext fc)
{
Map parameterMap = fc.getExternalContext().getRequestParameterMap();
if(parameterMap.size() > 0)
{
Iterator iter = parameterMap.keySet().iterator();
while(iter.hasNext())
{
String par = (String) iter.next();
}
return true;
}
return false;
}
//
// isPostBack - JSF 1.2 implementation
//
// public static boolean isPostBack12(FacesContext fc)
// {
// ResponseStateManager rsm = fc.getRenderKit().getResponseStateManager();
// if(rsm.isPostback(fc))
// {
// return true;
// }
// return false;
// }
public static void logout(FacesContext fc) throws Exception
{
ExternalContext ectx = fc.getCurrentInstance().getExternalContext();
HttpSession session = (HttpSession) ectx.getSession(false);
session.invalidate();
}
public static void navigateTo(FacesContext fc, String outcome)
{
FacesContext context = fc.getCurrentInstance();
Application app = context.getApplication();
app.getNavigationHandler().handleNavigation(context, null, outcome);
}
public static void redirect(FacesContext context, String url) throws Exception
{
HttpServletResponse response = (HttpServletResponse) context.getCurrentInstance().getExternalContext().getResponse();
response.sendRedirect(url);
context.responseComplete();
}
public static void dispatch(FacesContext context, String url) throws Exception
{
HttpServletResponse response = (HttpServletResponse) context.getCurrentInstance().getExternalContext().getResponse();
HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
RequestDispatcher rd = request.getRequestDispatcher(url);
rd.forward(request, response);
}
public static String getRequestParameter(FacesContext fc, String parameter)
{
Map parameters = fc.getCurrentInstance().getExternalContext().getRequestParameterMap();
return (String) parameters.get(parameter);
}
public static boolean requestHasParameters(FacesContext fc)
{
int size = fc.getCurrentInstance().getExternalContext().getRequestParameterMap().size();
if(size > 0)
{
return true;
}
return false;
}
}

@ -0,0 +1,55 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package utils;
import db.AnalisesDataProvider;
import global.Global;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
/**
*
* @author lluis
*/
public class Logos {
public String getLogo(Integer empresaId)
{
return null;
}
public String getLogo(FacesContext fc, Integer empresaId)
{
try
{
//get image from db :
AnalisesDataProvider adp = new AnalisesDataProvider();
byte[] logo = adp.getLogoByEmpresa(empresaId);
int len = logo.length;
ServletContext context = (ServletContext) fc.getExternalContext().getContext();
File logoFolder = new File(context.getRealPath(Global.LOGOS_FOLDER));
String logoFilename = logoFolder + "/logo_empresa" + empresaId.toString() + ".jpg";
OutputStream outImej = new FileOutputStream(logoFilename);
outImej.write(logo, 0, len);
System.out.println("LOGO PATH : " + logoFilename);
outImej.close();
return Global.LOGOS_FOLDER + "/logo_empresa" + empresaId.toString() + ".jpg";
}
catch(Exception ex)
{
ex.printStackTrace();
return null;
}
}
}

@ -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", "<br>" );
output = output.replace( "\\u00a0", "&nbsp;" );
output = output.replace( "\\u00aa", "&ordf;" );
output = output.replace( "\\u00ba", "&ordm;" );
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", "&#156;" );
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;
}
}

@ -0,0 +1,385 @@
/*
* 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", "<br>" );
output = output.replaceAll( "\\\\u00a0", "&nbsp;" );
output = output.replaceAll( "\\\\u00aa", "&ordf;" );
output = output.replaceAll( "\\\\u00ba", "&ordm;" );
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", "&#156;" );
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 textToHtml( String text )
{
String output = text;
output = output.replaceAll( "À", "&Agrave;" );
output = output.replaceAll( "Á", "&Aacute;" );
output = output.replaceAll( "Â", "&Acirc;" );
output = output.replaceAll( "Ã", "&Atilde;" );
output = output.replaceAll( "Ç", "&Ccedil;" );
output = output.replaceAll( "È", "&Egrave;" );
output = output.replaceAll( "É", "&Eacute;" );
output = output.replaceAll( "Ó", "&Oacute;" );
output = output.replaceAll( "Ò", "&Ograve;" );
output = output.replaceAll( "Ê", "&Ecirc;" );
output = output.replaceAll( "Ì", "&Igrave;" );
output = output.replaceAll( "Í", "&Iacute;" );
output = output.replaceAll( "Î", "&Icirc;" );
output = output.replaceAll( "ò", "&ograve;" );
output = output.replaceAll( "ó", "&oacute;" );
output = output.replaceAll( "ô", "&ocirc;" );
output = output.replaceAll( "õ", "&otilde;" );
output = output.replaceAll( "Ù", "&Ugrave;" );
output = output.replaceAll( "Ú", "&Uacute;" );
output = output.replaceAll( "Û", "&Ucirc;" );
output = output.replaceAll( "à", "&agrave;" );
output = output.replaceAll( "á", "&aacute;" );
output = output.replaceAll( "â", "&acirc;" );
output = output.replaceAll( "ã", "&atilde;" );
output = output.replaceAll( "ç", "&ccedil;" );
output = output.replaceAll( "è", "&egrave;" );
output = output.replaceAll( "é", "&eacute;" );
output = output.replaceAll( "ê", "&ecirc;" );
output = output.replaceAll( "ì", "&igrave;" );
output = output.replaceAll( "í", "&iacute;" );
output = output.replaceAll( "î", "&icirc;" );
output = output.replaceAll( "ò", "&ograve;" );
output = output.replaceAll( "ó", "&oacute;" );
output = output.replaceAll( "ô", "&ocirc;" );
output = output.replaceAll( "õ", "&otilde;" );
output = output.replaceAll( "ù", "&ugrave" );
output = output.replaceAll( "ú", "&uacute;" );
output = output.replaceAll( "û", "&ucirc;" );
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;
System.out.println("IS VALID EMAIL");
int indexOfAtChar=email.indexOf("@");
if(!isValidEmailCharacters(email))
{
return false;
}
if(indexOfAtChar > 0)
{
int indexOfDotChar =
email.indexOf(".",indexOfAtChar);
if(indexOfDotChar > 0)
{
res = true;
}
else
{
res = false;
}
}
else{
res = false;
}
return res;
}
private static boolean isValidEmailCharacters(String email)
{
if(email.indexOf("à") != -1)
{
return false;
}
else if(email.indexOf("á") != -1)
{
return false;
}
else if(email.indexOf("ã") != -1)
{
return false;
}
else if(email.indexOf("â") != -1)
{
return false;
}
else if(email.indexOf("è") != -1)
{
return false;
}
else if(email.indexOf("é") != -1)
{
return false;
}
else if(email.indexOf("ê") != -1)
{
return false;
}
else if(email.indexOf("ì") != -1)
{
return false;
}
else if(email.indexOf("í") != -1)
{
return false;
}
else if(email.indexOf("ò") != -1)
{
return false;
}
else if(email.indexOf("ó") != -1)
{
return false;
}
else if(email.indexOf("ô") != -1)
{
return false;
}
else if(email.indexOf("õ") != -1)
{
return false;
}
else if(email.indexOf("ù") != -1)
{
return false;
}
else if(email.indexOf("ú") != -1)
{
return false;
}
else if(email.indexOf("û") != -1)
{
return false;
}
else if(email.indexOf("ç") != -1)
{
return false;
}
else if(email.indexOf("À") != -1)
{
return false;
}
else if(email.indexOf("Á") != -1)
{
return false;
}
else if(email.indexOf("Ã") != -1)
{
return false;
}
else if(email.indexOf("Â") != -1)
{
return false;
}
else if(email.indexOf("È") != -1)
{
return false;
}
else if(email.indexOf("É") != -1)
{
return false;
}
else if(email.indexOf("Ê") != -1)
{
return false;
}
else if(email.indexOf("Ì") != -1)
{
return false;
}
else if(email.indexOf("Í") != -1)
{
return false;
}
else if(email.indexOf("Ò") != -1)
{
return false;
}
else if(email.indexOf("Ó") != -1)
{
return false;
}
else if(email.indexOf("Ô") != -1)
{
return false;
}
else if(email.indexOf("Õ") != -1)
{
return false;
}
else if(email.indexOf("Ù") != -1)
{
return false;
}
else if(email.indexOf("Ú") != -1)
{
return false;
}
else if(email.indexOf("Û") != -1)
{
return false;
}
else if(email.indexOf("Ç") != -1)
{
return false;
}
return true;
}
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);
}
}

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : Acesso
Created on : Oct 15, 2008, 9:49:21 AM
Author : lluis
-->
<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="page1">
<ui:html id="html1">
<ui:head id="head1">
<ui:link id="link1" url="/resources/stylesheet.css"/>
</ui:head>
<ui:body id="body1" style="-rave-layout: grid">
<ui:form id="form1">
<h:panelGrid columns="1" id="gridBaseLayout" style="left: 0px; top: 60px; position: absolute; width: 100%" styleClass="centerBlock">
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridLayout" style="width: 80%" styleClass="centerBlock">
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel1" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel1" style="height: 24px; width: 310px">
<ui:staticText escape="false" id="lblUser" styleClass="labelBold " text="#{SessionBean1.currentUser.login}"/>
<ui:staticText escape="false" id="staticText1" text="   "/>
<ui:hyperlink action="#{Acesso.lnkLogout_action}" id="lnkLogout" text="sair&gt;&gt;"/>
</ui:panelGroup>
</h:panelGrid>
<ui:staticText escape="false" id="staticText2" style="font-size: XX-large" text="&amp;nbsp;"/>
<ui:staticText escape="false" id="staticText3" style="font-size: xx-large" text="&amp;nbsp;"/>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel2"
style="border: 1px solid black; background-color: #eeeeee; height: 24px; width: 100%" styleClass="centerBlock" width="360">
<h:panelGrid columnClasses="gridColCenter, gridColCenter" columns="2" id="gridLogos1" style="height: 48px; width: 96px" styleClass="centerBlock">
<ui:image id="image1" url="/resources/images/SIPRP_logo_small.jpg"/>
<ui:image height="40" id="image2" url="#{SessionBean1.logoEmpresaUrl}"/>
</h:panelGrid>
<ui:staticText binding="#{Acesso.stWelcome}" escape="false" id="stWelcome" style="font-size: 14px"/>
<ui:staticText escape="false" id="staticText4" style="font-size: xx-large" text="&amp;nbsp;"/>
<ui:staticText escape="false" id="stAccessTo" text="aceder a "/>
<ui:staticText escape="false" id="staticText5" style="font-size: xx-large" text="&amp;nbsp;"/>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel4" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel2">
<ui:hyperlink action="#{Acesso.lnkAnalises_action}" id="lnkAnalises" style="font-size: 16px" text="Análise de Acidentes de Trabalho"/>
<ui:staticText escape="false" id="staticText9" style="height: 24px; width: 22px" text="&amp;nbsp;|&amp;nbsp;"/>
<ui:hyperlink action="#{Acesso.lnkPlanos_action}" id="lnkPlanos" style="font-size: 16px" text="Planos de Actuação"/>
</ui:panelGroup>
</h:panelGrid>
<ui:staticText escape="false" id="staticText11" style="font-size: 18px" text="&amp;nbsp;"/>
<h:panelGrid binding="#{Acesso.gridEstabelecimento}" columnClasses="gridColCenter" columns="1" id="gridEstabelecimento"
style="height: 24px; width: 100%" width="168">
<ui:panelGroup id="groupPanel4">
<ui:staticText escape="false" id="staticText10" text="Seleccionar estabelecimento:&amp;nbsp;"/>
<ui:dropDown binding="#{Acesso.drpEstabelecimentos}" id="drpEstabelecimentos"
items="#{SessionBean1.estabelecimentosGestorOptions}" selected="#{SessionBean1.estabelecimentoGestorChoice}" style="width: 190px"/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
<ui:staticText escape="false" id="staticText8" style="font-size: xx-large" text="&amp;nbsp;"/>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel3" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel3" 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>
</ui:form>
<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"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-6942416-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>

@ -0,0 +1,83 @@
<?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 binding="#{Dummy.page1}" id="page1">
<ui:html binding="#{Dummy.html1}" id="html1">
<ui:head binding="#{Dummy.head1}" id="head1">
<ui:link binding="#{Dummy.link1}" id="link1" url="/resources/stylesheet.css"/>
<style>
table.restricoes td {border-bottom: 1px solid #000000}
table.centerBlock td {border: none}
</style>
<script>
function disable(o)
{
o.disabled=true;
alert(o.disabled);
}
function enable(o)
{
o.disabled=false;
}
</script>
</ui:head>
<ui:body binding="#{Dummy.body1}" id="body1" style="-rave-layout: grid">
<ui:form binding="#{Dummy.form1}" id="form1">
<ui:hiddenField binding="#{Dummy.hiddenField1}" id="hiddenField1"/>
<ui:hiddenField binding="#{Dummy.hidConfEnviar}" id="hidConfEnviar"/>
<ui:hiddenField binding="#{Dummy.hidConfDelete}" id="hidConfDelete"/>
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel1" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel2">
<ui:hyperlink action="#{Dummy.lnkAnalisesAcidente_action}" id="lnkAnalisesAcidente1" text="análise de acidentes de trabalho&gt;&gt;"/>
</ui:panelGroup>
<ui:panelGroup id="groupPanel1" style="height: 24px">
<ui:staticText escape="false" id="lblUser1" styleClass="labelBold "/>
<ui:staticText escape="false" id="staticText1" text="   "/>
<ui:hyperlink action="#{Dummy.lnkPlanosActuacao_action}" disabled="true" id="lnkPlanosActuacao" text="planos actuação"/>
<ui:staticText escape="false" id="staticText2" text=" | "/>
<ui:hyperlink action="#{Dummy.lnkNewUser_action}" disabled="true" id="lnkNewUser1" style="" text="gerir utilizadores"/>
<ui:staticText escape="false" id="staticText3" text=" | "/>
<ui:hyperlink action="#{Dummy.lnkEditUser_action}" id="lnkEditUser1" text="alterar dados utilizador"/>
<ui:staticText escape="false" id="staticText4" text=" | "/>
<ui:hyperlink action="#{Dummy.lnkAjuda_action}" id="lnkAjuda1" onClick="showPdf();" style="" text="ajuda "/>
<ui:staticText id="staticText5" style="width: 0px" text="|"/>
<ui:hyperlink action="#{Dummy.lnkLogout_action}" id="lnkLogout1" text="sair&gt;&gt;"/>
</ui:panelGroup>
</h:panelGrid>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel2" style="height: 24px; left: 192px; top: 192px; position: absolute"
styleClass="centerBlock" width="360">
<h:panelGrid columnClasses="gridColCenter, gridColCenter" columns="2" id="gridLogos1" style="height: 48px; width: 96px" styleClass="centerBlock">
<ui:image id="image1" url="/resources/images/SIPRP_logo_small.jpg"/>
<ui:image height="40" id="image2" url="/resources/images/logo_auchan_small.jpg"/>
</h:panelGrid>
<ui:staticText escape="false" id="stWelcome1" style="font-size: 14px"/>
<ui:staticText escape="false" id="staticText6" style="font-size: xx-large" text="&amp;nbsp;"/>
<ui:staticText escape="false" id="stAccessTo1" text="aceder a "/>
<ui:staticText escape="false" id="staticText7" style="font-size: xx-large" text="&amp;nbsp;"/>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel3" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel3">
<ui:hyperlink action="#{Dummy.lnkAnalises_action}" id="lnkAnalises1" style="font-size: 16px" text="Análise de Acidentes de Trabalho"/>
<ui:staticText escape="false" id="staticText8" style="height: 24px; width: 22px" text="&amp;nbsp;|&amp;nbsp;"/>
<ui:hyperlink action="#{Dummy.lnkPlanos_action}" id="lnkPlanos1" style="font-size: 16px" text="Planos de Actuação"/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
<h:panelGrid columnClasses="gridColLeft" columns="1" id="gridEstabelecimento"
style="height: 24px; left: 96px; top: 216px; position: absolute" width="168">
<ui:panelGroup id="groupPanel5">
<ui:staticText escape="false" id="staticText10" text="Seleccionar estabelecimento:&amp;nbsp;"/>
<ui:dropDown id="dropDown3" items="#{Dummy.dropDown2DefaultOptions.options}" style="width: 190px"/>
</ui:panelGroup>
</h:panelGrid>
<ui:panelGroup id="groupPanel4" style="position: absolute; left: 72px; top: 288px">
<ui:staticText escape="false" id="staticText9" text="Seleccionar estabelecimento:&amp;nbsp;"/>
<ui:dropDown id="dropDown2" items="#{Dummy.dropDown2DefaultOptions.options}" style="width: 190px"/>
</ui:panelGroup>
<ui:dropDown id="dropDown1" items="#{Dummy.dropDown1DefaultOptions.options}" style="position: absolute; left: 216px; top: 120px"/>
</ui:form>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>

@ -0,0 +1,105 @@
<?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 binding="#{EnviarCorrecao.page1}" id="page1">
<ui:html binding="#{EnviarCorrecao.html1}" id="html1">
<ui:head binding="#{EnviarCorrecao.head1}" id="head1">
<ui:link binding="#{EnviarCorrecao.link1}" id="link1" url="/resources/stylesheet.css"/>
<script>
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 binding="#{EnviarCorrecao.body1}" id="body1" style="-rave-layout: grid">
<ui:form binding="#{EnviarCorrecao.form1}" id="form1">
<h:panelGrid binding="#{EnviarCorrecao.gridBase1}" columns="1" id="gridBase1"
style="height: 24px; left: 0px; top: 96px; position: absolute; width: 100%" styleClass="centerBlock" width="648">
<h:panelGrid binding="#{EnviarCorrecao.gridLayout1}" columns="1" id="gridLayout1" style="height: 15px; width: 80%" styleClass="centerBlock">
<h:panelGrid binding="#{EnviarCorrecao.gridPanel1}" columnClasses="gridColLeft, gridColRightBottom" columns="2" id="gridPanel1"
style="border-bottom: solid #000000 1px; height: 24px; width: 100%" width="312">
<ui:panelGroup binding="#{EnviarCorrecao.groupPanel1}" id="groupPanel1" style="height: 24px; width: 216px">
<ui:image binding="#{EnviarCorrecao.image1}" id="image1" url="/resources/images/SIPRP_logo_small.jpg"/>
<ui:image binding="#{EnviarCorrecao.image2}" height="40" id="image2" url="#{SessionBean1.logoEmpresaUrl}" width="150"/>
</ui:panelGroup>
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel4" style="height: 24px; width: 100%">
<ui:panelGroup id="groupPanel2">
<ui:hyperlink action="#{EnviarCorrecao.lnkPlanosActuacao_action}" disabled="true" id="lnkPlanosActuacao1" text="planos actuação&gt;&gt;"/>
</ui:panelGroup>
<ui:panelGroup id="groupPanel3" style="height: 24px; top: 90%">
<ui:staticText binding="#{EnviarCorrecao.lblUser}" escape="false" id="lblUser" styleClass="labelBold "/>
<ui:staticText escape="false" id="staticText1" text="   "/>
<ui:staticText escape="false" id="staticText2" text=" | "/>
<ui:hyperlink action="#{EnviarCorrecao.lnkNewUser_action}" disabled="true" id="lnkNewUser1" style="" text="gerir utilizadores"/>
<ui:staticText escape="false" id="staticText3" text=" | "/>
<ui:hyperlink action="#{EnviarCorrecao.lnkEditUser_action}" id="lnkEditUser1" text="alterar dados utilizador"/>
<ui:staticText escape="false" id="staticText4" text=" | "/>
<ui:hyperlink action="#{EnviarCorrecao.lnkAjuda_action}" id="lnkAjuda1" onClick="showPdf();" style="" text="ajuda "/>
<ui:staticText id="staticText7" style="height: 22px; width: 0px" text="|"/>
<ui:hyperlink action="#{EnviarCorrecao.lnkAnalisesAcidente_action}" disabled="true" id="lnkAnalisesAcidente1" text="análise de acidentes de trabalho"/>
<ui:hyperlink action="#{EnviarCorrecao.lnkLogout_action}" id="lnkLogout1" text="sair&gt;&gt;"/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
<h:panelGrid binding="#{EnviarCorrecao.gridLayoutTop1}" columns="1" id="gridLayoutTop1"
style="height: 15px; position: relative; vertical-align: top; width: 100%" styleClass="centerBlock">
<h:panelGrid binding="#{EnviarCorrecao.gridMain1}" columnClasses="gridColLeft" columns="1" id="gridMain1"
style="height: 24px" styleClass="centerBlock" width="504">
<h:panelGrid binding="#{EnviarCorrecao.gridPanel3}" columnClasses="gridColCenter" columns="1" id="gridPanel3"
style="height: 24px; width: 100%" width="504">
<ui:staticText binding="#{EnviarCorrecao.txtMsg}" escape="false" id="txtMsg" style="color: rgb(204, 0, 0); font-weight: bold; height: 24px"/>
</h:panelGrid>
<ui:staticText binding="#{EnviarCorrecao.staticText5}" escape="false" id="staticText5" style="height: 24px; width: 96px"
styleClass="labelBold" text="Observa&amp;ccedil;&amp;otilde;es"/>
<ui:textArea binding="#{EnviarCorrecao.txtObservacoes}" id="txtObservacoes" style="height: 48px; width: 100%"/>
<ui:table augmentTitle="false" binding="#{EnviarCorrecao.table1}" id="table1" style="height: 24px" width="100%">
<ui:tableRowGroup binding="#{EnviarCorrecao.tableRowGroup1}" id="tableRowGroup1"
sourceData="#{SessionBean1.estadosCorrecaoDataProvider}" sourceVar="currentRow">
<ui:tableColumn binding="#{EnviarCorrecao.tableColumn1}" headerText="Enviar para estado" id="tableColumn1" width="200">
<ui:hyperlink action="#{EnviarCorrecao.lnkEstadoCorr_action}" binding="#{EnviarCorrecao.lnkEstadoCorr}"
id="lnkEstadoCorr" style="height: 24px; width: 72px" text="#{currentRow.value['descricao']}"/>
</ui:tableColumn>
</ui:tableRowGroup>
</ui:table>
<ui:staticText binding="#{EnviarCorrecao.staticText6}" escape="false" id="staticText6" style="height: 24px; width: 48px" text="&amp;nbsp;"/>
<h:panelGrid binding="#{EnviarCorrecao.gridPanel2}" columnClasses="gridColLeft, gridColRight" columns="2"
id="gridPanel2" style="height: 24px; width: 100%" width="288">
<ui:button action="#{EnviarCorrecao.butCancelar_action}" binding="#{EnviarCorrecao.butCancelar}" id="butCancelar"
style="height: 24px; width: 120px" text="Cancelar"/>
<ui:button action="#{EnviarCorrecao.butConfirmar_action}" binding="#{EnviarCorrecao.butConfirmar}" id="butConfirmar"
style="height: 24px; width: 120px" text="Confirmar"/>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<h:panelGrid binding="#{EnviarCorrecao.gridPanel9}" columnClasses="gridColCenter" columns="1" id="gridPanel9" style="height: 24px; width: 100%">
<ui:panelGroup binding="#{EnviarCorrecao.groupPanel8}" id="groupPanel8" style="border-bottom: solid #ffffff 1px; height: 21px; width: 200px">
<ui:staticText binding="#{EnviarCorrecao.staticText10}" id="staticText10" text="Software desenvolvido por "/>
<ui:image binding="#{EnviarCorrecao.image3}" height="21" id="image3" url="/resources/images/logo_evolute_small.png" width="100"/>
<ui:staticText binding="#{EnviarCorrecao.staticText11}" escape="false" id="staticText11" text="&amp;nbsp;&amp;copy; 2008 "/>
</ui:panelGroup>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
</ui:form>
<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"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-6942416-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save