forked from Coded/SIPRP
Inclusão do módulo de Planos de Actuação (netbeans project)
git-svn-id: https://svn.coded.pt/svn/SIPRP@747 bb69d46d-e84e-40c8-a05a-06db0d633741lxbfYeaa
parent
6307ef7c55
commit
daf6f05b67
@ -0,0 +1,66 @@
|
||||
<?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.) -->
|
||||
<project name="PlanosActuacao" default="default" basedir=".">
|
||||
<description>Builds, tests, and runs the project PlanosActuacao.</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,895 @@
|
||||
<?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="PlanosActuacao-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="enable.jsdebugger">
|
||||
<and>
|
||||
<isset property="debug.client.available"/>
|
||||
<istrue value="${debug.client.available}"/>
|
||||
</and>
|
||||
</condition>
|
||||
<condition property="do.debug.server">
|
||||
<or>
|
||||
<not>
|
||||
<isset property="debug.server"/>
|
||||
</not>
|
||||
<istrue value="${debug.server}"/>
|
||||
<not>
|
||||
<isset property="enable.jsdebugger"/>
|
||||
</not>
|
||||
<and>
|
||||
<not>
|
||||
<istrue value="${debug.server}"/>
|
||||
</not>
|
||||
<not>
|
||||
<istrue value="${debug.client}"/>
|
||||
</not>
|
||||
</and>
|
||||
</or>
|
||||
</condition>
|
||||
<condition property="do.debug.client">
|
||||
<and>
|
||||
<istrue value="${debug.client}"/>
|
||||
<isset property="enable.jsdebugger"/>
|
||||
</and>
|
||||
</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="${conf.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}"/>
|
||||
<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>
|
||||
</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=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file)
|
||||
or ant -Dj2ee.platform.classpath=<server_classpath> (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="${javac.debug}" name="debug"/>
|
||||
<element name="customize" optional="true"/>
|
||||
<sequential>
|
||||
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" includeantruntime="false" 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="**/*Test.java" name="includes"/>
|
||||
<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}" includes="@{includes}"/>
|
||||
</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"/>
|
||||
</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 if="enable.jsdebugger" 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 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="dt_socket">
|
||||
<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 "${ant.java.version}"/>
|
||||
<condition property="have-jdk-older-than-1.4">
|
||||
<or>
|
||||
<contains string="${version-output}" substring="java version "1.0"/>
|
||||
<contains string="${version-output}" substring="java version "1.1"/>
|
||||
<contains string="${version-output}" substring="java version "1.2"/>
|
||||
<contains string="${version-output}" substring="java version "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>
|
||||
</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=dt_socket,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-macrodef-copy-ear-war">
|
||||
<macrodef name="copy-ear-war">
|
||||
<attribute name="file"/>
|
||||
<attribute name="propname"/>
|
||||
<sequential>
|
||||
<basename file="@{file}" property="base_@{propname}"/>
|
||||
<zipfileset id="tld.files_@{propname}" includes="META-INF/*.tld META-INF/tlds/*.tld" src="@{file}"/>
|
||||
<pathconvert property="tld.files.path_@{propname}" refid="tld.files_@{propname}"/>
|
||||
<condition property="hastlds_@{propname}" value="yes">
|
||||
<contains casesensitive="false" string="${tld.files.path_@{propname}}" substring=".tld"/>
|
||||
</condition>
|
||||
<condition property="copy.to.dir_@{propname}" value="${build.web.dir}/WEB-INF/lib">
|
||||
<isset property="hastlds_@{propname}"/>
|
||||
</condition>
|
||||
<condition property="copy.to.dir_@{propname}" value="${dist.ear.dir}">
|
||||
<not>
|
||||
<isset property="hastlds_@{propname}"/>
|
||||
</not>
|
||||
</condition>
|
||||
<copy file="@{file}" todir="${copy.to.dir_@{propname}}"/>
|
||||
<condition property="@{propname}" value="${base_@{propname}}">
|
||||
<not>
|
||||
<isset property="hastlds_@{propname}"/>
|
||||
</not>
|
||||
</condition>
|
||||
<condition property="@{propname}" value="">
|
||||
<isset property="hastlds_@{propname}"/>
|
||||
</condition>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
</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-macrodef-copy-ear-war" 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}"/>
|
||||
</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}"/>
|
||||
</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="${conf.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>
|
||||
<customize>
|
||||
<patternset includes="${javac.includes}"/>
|
||||
</customize>
|
||||
</webproject2:javac>
|
||||
<copy todir="${build.classes.dir}">
|
||||
<fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
|
||||
</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}"/>
|
||||
<classpath path="${java.home}/../lib/tools.jar:${copyfiles.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}"/>
|
||||
<classpath path="${java.home}/../lib/tools.jar:${copyfiles.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">
|
||||
<basename file="${libs.jsf12.classpath.libfile.6}" property="included.lib.libs.jsf12.classpath.6"/>
|
||||
<basename file="${libs.jsf12.classpath.libfile.5}" property="included.lib.libs.jsf12.classpath.5"/>
|
||||
<basename file="${libs.jsf12.classpath.libfile.4}" property="included.lib.libs.jsf12.classpath.4"/>
|
||||
<basename file="${libs.jsf12.classpath.libfile.3}" property="included.lib.libs.jsf12.classpath.3"/>
|
||||
<basename file="${libs.jsf12.classpath.libfile.2}" property="included.lib.libs.jsf12.classpath.2"/>
|
||||
<basename file="${libs.jsf12.classpath.libfile.1}" property="included.lib.libs.jsf12.classpath.1"/>
|
||||
<copy-ear-war file="${libs.jsf12.classpath.libfile.6}" propname="included.lib.libs.jsf12.classpath.6.X"/>
|
||||
<copy-ear-war file="${libs.jsf12.classpath.libfile.5}" propname="included.lib.libs.jsf12.classpath.5.X"/>
|
||||
<copy-ear-war file="${libs.jsf12.classpath.libfile.4}" propname="included.lib.libs.jsf12.classpath.4.X"/>
|
||||
<copy-ear-war file="${libs.jsf12.classpath.libfile.3}" propname="included.lib.libs.jsf12.classpath.3.X"/>
|
||||
<copy-ear-war file="${libs.jsf12.classpath.libfile.2}" propname="included.lib.libs.jsf12.classpath.2.X"/>
|
||||
<copy-ear-war file="${libs.jsf12.classpath.libfile.1}" propname="included.lib.libs.jsf12.classpath.1.X"/>
|
||||
<basename file="${libs.jstl11.classpath.libfile.2}" property="included.lib.libs.jstl11.classpath.2"/>
|
||||
<basename file="${libs.jstl11.classpath.libfile.1}" property="included.lib.libs.jstl11.classpath.1"/>
|
||||
<copy-ear-war file="${libs.jstl11.classpath.libfile.2}" propname="included.lib.libs.jstl11.classpath.2.X"/>
|
||||
<copy-ear-war file="${libs.jstl11.classpath.libfile.1}" propname="included.lib.libs.jstl11.classpath.1.X"/>
|
||||
<basename file="${libs.jsf12-support.classpath.libfile.4}" property="included.lib.libs.jsf12-support.classpath.4"/>
|
||||
<basename file="${libs.jsf12-support.classpath.libfile.3}" property="included.lib.libs.jsf12-support.classpath.3"/>
|
||||
<basename file="${libs.jsf12-support.classpath.libfile.2}" property="included.lib.libs.jsf12-support.classpath.2"/>
|
||||
<basename file="${libs.jsf12-support.classpath.libfile.1}" property="included.lib.libs.jsf12-support.classpath.1"/>
|
||||
<copy-ear-war file="${libs.jsf12-support.classpath.libfile.4}" propname="included.lib.libs.jsf12-support.classpath.4.X"/>
|
||||
<copy-ear-war file="${libs.jsf12-support.classpath.libfile.3}" propname="included.lib.libs.jsf12-support.classpath.3.X"/>
|
||||
<copy-ear-war file="${libs.jsf12-support.classpath.libfile.2}" propname="included.lib.libs.jsf12-support.classpath.2.X"/>
|
||||
<copy-ear-war file="${libs.jsf12-support.classpath.libfile.1}" propname="included.lib.libs.jsf12-support.classpath.1.X"/>
|
||||
<basename file="${libs.woodstock-components.classpath.libfile.5}" property="included.lib.libs.woodstock-components.classpath.5"/>
|
||||
<basename file="${libs.woodstock-components.classpath.libfile.4}" property="included.lib.libs.woodstock-components.classpath.4"/>
|
||||
<basename file="${libs.woodstock-components.classpath.libfile.3}" property="included.lib.libs.woodstock-components.classpath.3"/>
|
||||
<basename file="${libs.woodstock-components.classpath.libfile.2}" property="included.lib.libs.woodstock-components.classpath.2"/>
|
||||
<basename file="${libs.woodstock-components.classpath.libfile.1}" property="included.lib.libs.woodstock-components.classpath.1"/>
|
||||
<copy-ear-war file="${libs.woodstock-components.classpath.libfile.5}" propname="included.lib.libs.woodstock-components.classpath.5.X"/>
|
||||
<copy-ear-war file="${libs.woodstock-components.classpath.libfile.4}" propname="included.lib.libs.woodstock-components.classpath.4.X"/>
|
||||
<copy-ear-war file="${libs.woodstock-components.classpath.libfile.3}" propname="included.lib.libs.woodstock-components.classpath.3.X"/>
|
||||
<copy-ear-war file="${libs.woodstock-components.classpath.libfile.2}" propname="included.lib.libs.woodstock-components.classpath.2.X"/>
|
||||
<copy-ear-war file="${libs.woodstock-components.classpath.libfile.1}" propname="included.lib.libs.woodstock-components.classpath.1.X"/>
|
||||
<basename file="${libs.woodstock-theme-default.classpath}" property="included.lib.libs.woodstock-theme-default.classpath"/>
|
||||
<copy-ear-war file="${libs.woodstock-theme-default.classpath}" propname="included.lib.libs.woodstock-theme-default.classpath.X"/>
|
||||
<basename file="${file.reference.activation.jar}" property="included.lib.file.reference.activation.jar"/>
|
||||
<copy-ear-war file="${file.reference.activation.jar}" propname="included.lib.file.reference.activation.jar.X"/>
|
||||
<basename file="${file.reference.mail.jar}" property="included.lib.file.reference.mail.jar"/>
|
||||
<copy-ear-war file="${file.reference.mail.jar}" propname="included.lib.file.reference.mail.jar.X"/>
|
||||
<basename file="${file.reference.postgresql-8.0-315.jdbc3.jar}" property="included.lib.file.reference.postgresql-8.0-315.jdbc3.jar"/>
|
||||
<copy-ear-war file="${file.reference.postgresql-8.0-315.jdbc3.jar}" propname="included.lib.file.reference.postgresql-8.0-315.jdbc3.jar.X"/>
|
||||
<basename file="${file.reference.postgresql-8.1-407.jdbc3.jar}" property="included.lib.file.reference.postgresql-8.1-407.jdbc3.jar"/>
|
||||
<copy-ear-war file="${file.reference.postgresql-8.1-407.jdbc3.jar}" propname="included.lib.file.reference.postgresql-8.1-407.jdbc3.jar.X"/>
|
||||
<basename file="${file.reference.postgresql-8.2-506.jdbc4.jar}" property="included.lib.file.reference.postgresql-8.2-506.jdbc4.jar"/>
|
||||
<copy-ear-war file="${file.reference.postgresql-8.2-506.jdbc4.jar}" propname="included.lib.file.reference.postgresql-8.2-506.jdbc4.jar.X"/>
|
||||
<copy file="${libs.exceptionhandler-runtime.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="${included.lib.libs.jsf12.classpath.1.X} ${included.lib.libs.jsf12.classpath.2.X} ${included.lib.libs.jsf12.classpath.3.X} ${included.lib.libs.jsf12.classpath.4.X} ${included.lib.libs.jsf12.classpath.5.X} ${included.lib.libs.jsf12.classpath.6.X} ${included.lib.libs.jstl11.classpath.1.X} ${included.lib.libs.jstl11.classpath.2.X} ${included.lib.libs.jsf12-support.classpath.1.X} ${included.lib.libs.jsf12-support.classpath.2.X} ${included.lib.libs.jsf12-support.classpath.3.X} ${included.lib.libs.jsf12-support.classpath.4.X} ${included.lib.libs.woodstock-components.classpath.1.X} ${included.lib.libs.woodstock-components.classpath.2.X} ${included.lib.libs.woodstock-components.classpath.3.X} ${included.lib.libs.woodstock-components.classpath.4.X} ${included.lib.libs.woodstock-components.classpath.5.X} ${included.lib.libs.woodstock-theme-default.classpath} ${included.lib.file.reference.activation.jar} ${included.lib.file.reference.mail.jar} ${included.lib.file.reference.postgresql-8.0-315.jdbc3.jar} ${included.lib.file.reference.postgresql-8.1-407.jdbc3.jar} ${included.lib.file.reference.postgresql-8.2-506.jdbc4.jar} "/>
|
||||
</manifest>
|
||||
<delete dir="${dist.ear.dir}/temp"/>
|
||||
</target>
|
||||
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
|
||||
<copy file="${libs.jsf12.classpath.libfile.6}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12.classpath.libfile.5}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12.classpath.libfile.4}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12.classpath.libfile.3}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12.classpath.libfile.2}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12.classpath.libfile.1}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jstl11.classpath.libfile.2}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jstl11.classpath.libfile.1}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12-support.classpath.libfile.4}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12-support.classpath.libfile.3}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12-support.classpath.libfile.2}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.jsf12-support.classpath.libfile.1}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.woodstock-components.classpath.libfile.5}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.woodstock-components.classpath.libfile.4}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.woodstock-components.classpath.libfile.3}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.woodstock-components.classpath.libfile.2}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.woodstock-components.classpath.libfile.1}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.woodstock-theme-default.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${file.reference.activation.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${file.reference.mail.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${file.reference.postgresql-8.0-315.jdbc3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${file.reference.postgresql-8.1-407.jdbc3.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${file.reference.postgresql-8.2-506.jdbc4.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copy file="${libs.exceptionhandler-runtime.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,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,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,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}:${ws.debug.classpaths}"/>
|
||||
</classpath>
|
||||
<sourcepath>
|
||||
<path path="${web.docbase.dir}:${ws.web.docbase.dirs}"/>
|
||||
</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>
|
||||
<sourcepath>
|
||||
<pathelement location="${src.dir}"/>
|
||||
</sourcepath>
|
||||
<packageset dir="${src.dir}" includes="*/**"/>
|
||||
<fileset dir="${src.dir}" includes="*.java"/>
|
||||
</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="**/*.java"/>
|
||||
</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}" srcdir="${test.src.dir}">
|
||||
<customize>
|
||||
<patternset includes="${javac.includes}"/>
|
||||
</customize>
|
||||
</webproject2:javac>
|
||||
<copy todir="${build.test.classes.dir}">
|
||||
<fileset dir="${test.src.dir}" excludes="**/*.java"/>
|
||||
</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/>
|
||||
</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 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 name="-post-clean">
|
||||
<!-- Empty placeholder for easier customization. -->
|
||||
<!-- You can override this target in the ../build.xml file. -->
|
||||
</target>
|
||||
<target depends="init,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,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scene Scope="Project" version="2">
|
||||
<Scope Scope="Faces Configuration Only"/>
|
||||
<Scope Scope="Project">
|
||||
<Node id="ListaPlanos.jsp" x="127" y="211" zoom="true"/>
|
||||
<Node id="Erro.jsp" x="150" y="150" zoom="true"/>
|
||||
<Node id="EditarPlano.jsp" x="400" y="150" zoom="true"/>
|
||||
<Node id="Login.jsp" x="161" y="299" zoom="false"/>
|
||||
</Scope>
|
||||
<Scope Scope="All Faces Configurations"/>
|
||||
</Scene>
|
||||
@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=0b61db7f
|
||||
build.xml.script.CRC32=fa3993b7
|
||||
build.xml.stylesheet.CRC32=cfd7ba16
|
||||
# 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=0b61db7f
|
||||
nbproject/build-impl.xml.script.CRC32=64f15e59
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=8926891b
|
||||
@ -0,0 +1,24 @@
|
||||
deploy.ant.properties.file=/home/lluis/.netbeans/6.1/tomcat60.properties
|
||||
j2ee.platform.classpath=/usr/local/apache-tomcat-6.0.16/lib/jasper.jar:/usr/local/apache-tomcat-6.0.16/lib/tomcat-i18n-ja.jar:/usr/local/apache-tomcat-6.0.16/lib/catalina.jar:/usr/local/apache-tomcat-6.0.16/lib/catalina-ant.jar:/usr/local/apache-tomcat-6.0.16/lib/tomcat-coyote.jar:/usr/local/apache-tomcat-6.0.16/lib/servlet-api.jar:/usr/local/apache-tomcat-6.0.16/lib/jsp-api.jar:/usr/local/apache-tomcat-6.0.16/lib/tomcat-i18n-es.jar:/usr/local/apache-tomcat-6.0.16/lib/jasper-el.jar:/usr/local/apache-tomcat-6.0.16/lib/annotations-api.jar:/usr/local/apache-tomcat-6.0.16/lib/catalina-ha.jar:/usr/local/apache-tomcat-6.0.16/lib/catalina-tribes.jar:/usr/local/apache-tomcat-6.0.16/lib/el-api.jar:/usr/local/apache-tomcat-6.0.16/lib/tomcat-i18n-fr.jar:/usr/local/apache-tomcat-6.0.16/lib/tomcat-dbcp.jar:/usr/local/apache-tomcat-6.0.16/bin/tomcat-juli.jar
|
||||
j2ee.server.instance=tomcat60:home=/usr/local/apache-tomcat-6.0.16:base=apache-tomcat-6.0.16_base
|
||||
javac.debug=true
|
||||
javadoc.preview=true
|
||||
jaxws.endorsed.dir=/usr/local/netbeans-6.1/java2/modules/ext/jaxws21/api
|
||||
libs.jsf12-support.classpath.libfile.1=/usr/local/netbeans-6.1/visualweb2/modules/ext/jsfcl.jar
|
||||
libs.jsf12-support.classpath.libfile.2=/usr/local/netbeans-6.1/visualweb2/modules/ext/appbase.jar
|
||||
libs.jsf12-support.classpath.libfile.3=/home/lluis/.netbeans/6.1/modules/ext/dataprovider.jar
|
||||
libs.jsf12-support.classpath.libfile.4=/home/lluis/.netbeans/6.1/modules/ext/sqlx.jar
|
||||
libs.jsf12.classpath.libfile.1=/usr/local/netbeans-6.1/enterprise5/modules/ext/jsf-1_2/commons-beanutils.jar
|
||||
libs.jsf12.classpath.libfile.2=/usr/local/netbeans-6.1/enterprise5/modules/ext/jsf-1_2/commons-collections.jar
|
||||
libs.jsf12.classpath.libfile.3=/usr/local/netbeans-6.1/enterprise5/modules/ext/jsf-1_2/commons-digester.jar
|
||||
libs.jsf12.classpath.libfile.4=/usr/local/netbeans-6.1/enterprise5/modules/ext/jsf-1_2/commons-logging.jar
|
||||
libs.jsf12.classpath.libfile.5=/usr/local/netbeans-6.1/enterprise5/modules/ext/jsf-1_2/jsf-api.jar
|
||||
libs.jsf12.classpath.libfile.6=/usr/local/netbeans-6.1/enterprise5/modules/ext/jsf-1_2/jsf-impl.jar
|
||||
libs.jstl11.classpath.libfile.1=/usr/local/netbeans-6.1/enterprise5/modules/ext/standard.jar
|
||||
libs.jstl11.classpath.libfile.2=/usr/local/netbeans-6.1/enterprise5/modules/ext/jstl.jar
|
||||
libs.woodstock-components.classpath.libfile.1=/usr/local/netbeans-6.1/visualweb2/modules/ext/webui-jsf.jar
|
||||
libs.woodstock-components.classpath.libfile.2=/usr/local/netbeans-6.1/enterprise5/modules/ext/commons-fileupload-1.0.jar
|
||||
libs.woodstock-components.classpath.libfile.3=/usr/local/netbeans-6.1/visualweb2/modules/ext/json-2.jar
|
||||
libs.woodstock-components.classpath.libfile.4=/usr/local/netbeans-6.1/visualweb2/modules/ext/jsf-extensions-common-0.1.jar
|
||||
libs.woodstock-components.classpath.libfile.5=/usr/local/netbeans-6.1/visualweb2/modules/ext/jsf-extensions-dynamic-faces-0.1.jar
|
||||
user.properties.file=/home/lluis/.netbeans/6.1/build.properties
|
||||
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
|
||||
</project-private>
|
||||
@ -0,0 +1,83 @@
|
||||
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
|
||||
debug.classpath=${build.classes.dir}:${javac.classpath}
|
||||
debug.client=false
|
||||
debug.server=true
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
display.browser=true
|
||||
dist.dir=dist
|
||||
dist.ear.war=${dist.dir}/${war.ear.name}
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
dist.war=${dist.dir}/${war.name}
|
||||
file.reference.activation.jar=jars/activation.jar
|
||||
file.reference.mail.jar=jars/mail.jar
|
||||
file.reference.postgresql-8.0-315.jdbc3.jar=jars/postgresql-8.0-315.jdbc3.jar
|
||||
file.reference.postgresql-8.1-407.jdbc3.jar=jars/postgresql-8.1-407.jdbc3.jar
|
||||
file.reference.postgresql-8.2-506.jdbc4.jar=jars/postgresql-8.2-506.jdbc4.jar
|
||||
j2ee.platform=1.5
|
||||
j2ee.server.type=Tomcat60
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${libs.jsf12.classpath}:\
|
||||
${libs.jstl11.classpath}:\
|
||||
${libs.jsf12-support.classpath}:\
|
||||
${libs.woodstock-components.classpath}:\
|
||||
${libs.woodstock-theme-default.classpath}:\
|
||||
${file.reference.activation.jar}:\
|
||||
${file.reference.mail.jar}:\
|
||||
${file.reference.postgresql-8.0-315.jdbc3.jar}:\
|
||||
${file.reference.postgresql-8.1-407.jdbc3.jar}:\
|
||||
${file.reference.postgresql-8.2-506.jdbc4.jar}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.debug=true
|
||||
javac.deprecation=false
|
||||
javac.source=1.5
|
||||
javac.target=1.5
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}:\
|
||||
${libs.junit.classpath}:\
|
||||
${libs.junit_4.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.preview=true
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
jspcompilation.classpath=${jspc.classpath}:${javac.classpath}
|
||||
lib.dir=${web.docbase.dir}/WEB-INF/lib
|
||||
platform.active=default_platform
|
||||
resource.dir=setup
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running a class with a main method
|
||||
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value):
|
||||
runmain.jvmargs=
|
||||
source.encoding=ISO-8859-1
|
||||
source.root=src
|
||||
src.dir=${source.root}/java
|
||||
test.src.dir=test
|
||||
war.content.additional=\
|
||||
${libs.exceptionhandler-runtime.classpath}
|
||||
war.ear.name=PlanosActuacao.war
|
||||
war.name=PlanosActuacao.war
|
||||
web.docbase.dir=web
|
||||
webinf.dir=web/WEB-INF
|
||||
@ -0,0 +1,65 @@
|
||||
<?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="woodstock-theme-default" jsf.pagebean.package="planosactuacao" jsf.project.libraries.dir="lib" jsf.project.version="4.0" jsf.startPage="Login.jsp"/>
|
||||
<data xmlns="http://www.netbeans.org/ns/web-project/3">
|
||||
<name>PlanosActuacao</name>
|
||||
<minimum-ant-version>1.6</minimum-ant-version>
|
||||
<web-module-libraries>
|
||||
<library files="6">
|
||||
<file>${libs.jsf12.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="4">
|
||||
<file>${libs.jsf12-support.classpath}</file>
|
||||
<path-in-war>WEB-INF/lib</path-in-war>
|
||||
</library>
|
||||
<library files="5">
|
||||
<file>${libs.woodstock-components.classpath}</file>
|
||||
<path-in-war>WEB-INF/lib</path-in-war>
|
||||
</library>
|
||||
<library files="1">
|
||||
<file>${libs.woodstock-theme-default.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.0-315.jdbc3.jar}</file>
|
||||
<path-in-war>WEB-INF/lib</path-in-war>
|
||||
</library>
|
||||
<library files="1">
|
||||
<file>${file.reference.postgresql-8.1-407.jdbc3.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>
|
||||
</web-module-libraries>
|
||||
<web-module-additional-libraries>
|
||||
<library files="1">
|
||||
<file>${libs.exceptionhandler-runtime.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,2 @@
|
||||
Manifest-Version: 1.0
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* 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"; //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,40 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package db.entidades;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class Medida {
|
||||
private Integer id;
|
||||
private String descricao;
|
||||
private String activa;
|
||||
|
||||
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 getActiva() {
|
||||
return activa;
|
||||
}
|
||||
|
||||
public void setActiva(String activa) {
|
||||
this.activa = activa;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package db.entidades;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class PlanoActuacao {
|
||||
private Integer id;
|
||||
private Integer estabelecimento_id;
|
||||
private Integer estado;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getEstabelecimento_id() {
|
||||
return estabelecimento_id;
|
||||
}
|
||||
|
||||
public void setEstabelecimento_id(Integer estabelecimento_id) {
|
||||
this.estabelecimento_id = estabelecimento_id;
|
||||
}
|
||||
|
||||
public Integer getEstado() {
|
||||
return estado;
|
||||
}
|
||||
|
||||
public void setEstado(Integer estado) {
|
||||
this.estado = estado;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package db.entidades;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class PostoTrabalho {
|
||||
private Integer id;
|
||||
private Integer risco_id;
|
||||
private String descricao;
|
||||
private String activo;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public Integer getRisco_id() {
|
||||
return risco_id;
|
||||
}
|
||||
|
||||
public void setRisco_id(Integer risco_id) {
|
||||
this.risco_id = risco_id;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package db.entidades;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class Risco {
|
||||
private Integer id;
|
||||
private Integer plano_id;
|
||||
private String descricao;
|
||||
private String activo;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public Integer getPlano_id() {
|
||||
return plano_id;
|
||||
}
|
||||
|
||||
public void setPlano_id(Integer plano_id) {
|
||||
this.plano_id = plano_id;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,231 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package db.entidades;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class User {
|
||||
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;
|
||||
|
||||
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 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 Integer getCodigo_permissao() {
|
||||
return codigo_permissao;
|
||||
}
|
||||
|
||||
public void setCodigo_permissao(Integer codigo_permissao) {
|
||||
this.codigo_permissao = codigo_permissao;
|
||||
}
|
||||
|
||||
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 getGestor_geral() {
|
||||
return gestor_geral;
|
||||
}
|
||||
|
||||
public void setGestor_geral(String gestor_geral) {
|
||||
this.gestor_geral = gestor_geral;
|
||||
}
|
||||
|
||||
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 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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package db.providers;
|
||||
|
||||
import db.Db;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class GenericDataProvider {
|
||||
|
||||
public Integer getMaxTableId(String table)
|
||||
{
|
||||
Statement st = createStatement();
|
||||
String id = table + ".id";
|
||||
String sql = "SELECT max(" + id + ")+1 AS MAXID FROM " + table;
|
||||
try
|
||||
{
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
rs.first();
|
||||
Integer newId = new Integer(rs.getInt("MAXID"));
|
||||
if(newId.intValue() == 0)
|
||||
{
|
||||
newId = new Integer(1);
|
||||
}
|
||||
return newId;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
return new Integer(1);
|
||||
}
|
||||
}
|
||||
|
||||
protected Statement createStatement()
|
||||
{
|
||||
Db db = new Db();
|
||||
return db.createStatement();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,256 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package db.providers;
|
||||
|
||||
import db.entidades.Medida;
|
||||
import db.entidades.PlanoActuacao;
|
||||
import db.entidades.PostoTrabalho;
|
||||
import db.entidades.Risco;
|
||||
import db.entidades.User;
|
||||
import global.Global;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class PlanosDataProvider extends GenericDataProvider{
|
||||
|
||||
// PLANOS
|
||||
public Integer createPlano(PlanoActuacao p) throws Exception
|
||||
{
|
||||
Statement st = createStatement();
|
||||
Integer newId = getMaxTableId("planos_actuacao");
|
||||
String sql = "";
|
||||
|
||||
//To Do sql string here :
|
||||
|
||||
System.out.println("SQL CREATE PLANO : " + sql);
|
||||
st.execute(sql);
|
||||
|
||||
return newId;
|
||||
}
|
||||
|
||||
public void updatePlano(PlanoActuacao p) throws Exception
|
||||
{
|
||||
Statement st = createStatement();
|
||||
String sql = "";
|
||||
|
||||
//To Do sql string here :
|
||||
|
||||
sql += "WHERE id = " + p.getId();
|
||||
System.out.println("SQL UPDATE PLANO : " + sql);
|
||||
st.execute(sql);
|
||||
}
|
||||
|
||||
public ArrayList getPlanosActivos(User u) throws Exception
|
||||
{
|
||||
int userType = u.getTipo().intValue();
|
||||
Statement st = createStatement();
|
||||
String sql = "select * from planos_actuacao ";
|
||||
|
||||
switch(userType)
|
||||
{
|
||||
case Global.TECNICO_HS:
|
||||
sql += "WHERE estado = 1 OR estado = 5";
|
||||
break;
|
||||
|
||||
case Global.RESPONSAVEL_SEGURANCA:
|
||||
sql += "WHERE estado = 2";
|
||||
break;
|
||||
|
||||
case Global.DIRECTOR_LOJA:
|
||||
sql += "WHERE estado = 3";
|
||||
break;
|
||||
|
||||
case Global.DIRECTOR_NACIONAL_SEGURANCA:
|
||||
sql += "WHERE estado = 4";
|
||||
break;
|
||||
}
|
||||
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
ArrayList list = fillPlanoFields(rs);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public ArrayList getPlanosConcluidos(User u) throws Exception
|
||||
{
|
||||
Statement st = createStatement();
|
||||
String sql = "select * from planos_actuacao where estado = 6";
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
ArrayList list = fillPlanoFields(rs);
|
||||
return list;
|
||||
}
|
||||
|
||||
private ArrayList fillPlanoFields(ResultSet rs) throws Exception
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
if(rs.isBeforeFirst())
|
||||
{
|
||||
rs.first();
|
||||
do
|
||||
{
|
||||
PlanoActuacao pa = new PlanoActuacao();
|
||||
pa.setId( new Integer( rs.getInt("id") ) );
|
||||
pa.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id")));
|
||||
pa.setEstado( new Integer( rs.getInt("estado") ) );
|
||||
list.add(pa);
|
||||
|
||||
}while(rs.next());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// POSTOS TRABALHO
|
||||
public void createPostoTrabalhoByRisco(Integer postoTrabalhoId, Integer riscoId, Integer planoId) throws Exception
|
||||
{
|
||||
Statement st = createStatement();
|
||||
Integer newId = getMaxTableId("postos_trabalho_risco");
|
||||
|
||||
String sql = "INSERT INTO postos_trabalho_risco (id, posto_trabalho_id, risco_id, plano_id) VALUES (";
|
||||
sql += newId + ", ";
|
||||
sql += postoTrabalhoId + ", ";
|
||||
sql += riscoId + ", ";
|
||||
sql += planoId + ")";
|
||||
|
||||
System.out.println("SQL CREATE POSTO TRABALHO BY RISCO : " + sql);
|
||||
st.execute(sql);
|
||||
}
|
||||
|
||||
public PostoTrabalho getPostoTrabalho(Integer postoTrabalhoId) throws Exception
|
||||
{
|
||||
PostoTrabalho pt = null;
|
||||
Statement st = createStatement();
|
||||
String sql = "SELECT * FROM postos_trabalho WHERE id = " + postoTrabalhoId + " AND activo = 'y'";
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
|
||||
if(rs.isBeforeFirst())
|
||||
{
|
||||
rs.first();
|
||||
pt = new PostoTrabalho();
|
||||
pt.setId( new Integer( rs.getInt("id") ) );
|
||||
pt.setDescricao( rs.getString("descricao") );
|
||||
pt.setActivo( rs.getString("activo") );
|
||||
}
|
||||
return pt;
|
||||
}
|
||||
|
||||
public ArrayList getPostosTrabalhoByRisco(Integer planoId, Integer riscoId) throws Exception
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
Statement st = createStatement();
|
||||
String sql = "SELECT * FROM postos_trabalho_risco WHERE plano_id = " + planoId + " AND risco_id = " + riscoId;
|
||||
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
|
||||
if(rs.isBeforeFirst())
|
||||
{
|
||||
rs.first();
|
||||
do
|
||||
{
|
||||
Integer postoTrabalhoId = new Integer( rs.getInt("posto_trabalho_id") );
|
||||
PostoTrabalho pt = getPostoTrabalho(postoTrabalhoId);
|
||||
pt.setRisco_id(riscoId);
|
||||
list.add(pt);
|
||||
}while(rs.next());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
// RISCOS
|
||||
public void createRiscoByPlano(Integer riscoId, Integer planoId) throws Exception
|
||||
{
|
||||
Statement st = createStatement();
|
||||
Integer newId = getMaxTableId("riscos_plano_actuacao");
|
||||
|
||||
String sql = "INSERT INTO riscos_plano_actuacao (id, risco_id, plano_id) VALUES (";
|
||||
sql += newId + ", ";
|
||||
sql += riscoId + ", ";
|
||||
sql += planoId + ")";
|
||||
|
||||
System.out.println("SQL CREATE RISCO BY PLANO : " + sql);
|
||||
st.execute(sql);
|
||||
}
|
||||
|
||||
public Risco getRisco(Integer riscoId) throws Exception
|
||||
{
|
||||
Risco r = null;
|
||||
Statement st = createStatement();
|
||||
String sql = "SELECT * FROM riscos WHERE id = " + riscoId + " AND activo = 'y'";
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
|
||||
if(rs.isBeforeFirst())
|
||||
{
|
||||
rs.first();
|
||||
r = new Risco();
|
||||
r.setId( new Integer( rs.getInt("id") ) );
|
||||
r.setDescricao( rs.getString("descricao") );
|
||||
r.setActivo( rs.getString("activo") );
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
public ArrayList getRiscosByPlano(Integer planoId) throws Exception
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
Statement st = createStatement();
|
||||
String sql = "SELECT * FROM riscos_plano_actuacao WHERE plano_id = " + planoId;
|
||||
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
|
||||
if(rs.isBeforeFirst())
|
||||
{
|
||||
rs.first();
|
||||
do
|
||||
{
|
||||
Integer riscoId = new Integer( rs.getInt("risco_id") );
|
||||
Risco r = getRisco(riscoId);
|
||||
r.setPlano_id(planoId);
|
||||
list.add(r);
|
||||
}while(rs.next());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
// MEDIDAS
|
||||
public void createMedidaByRisco(Integer medidaId, Integer riscoId, Integer planoId) throws Exception
|
||||
{
|
||||
Statement st = createStatement();
|
||||
Integer newId = getMaxTableId("medidas_plano_actuacao_risco");
|
||||
|
||||
String sql = "INSERT INTO postos_trabalho_risco (id, medida_id, risco_id, plano_id) VALUES (";
|
||||
sql += newId + ", ";
|
||||
sql += medidaId + ", ";
|
||||
sql += riscoId + ", ";
|
||||
sql += planoId + ")";
|
||||
|
||||
System.out.println("SQL CREATE MEDIDA BY RISCO : " + sql);
|
||||
st.execute(sql);
|
||||
}
|
||||
|
||||
public Medida getMedida(Integer medidaId) throws Exception
|
||||
{
|
||||
Medida m= null;
|
||||
Statement st = createStatement();
|
||||
String sql = "SELECT * FROM madidas_plano_actuacao WHERE id = " + medidaId + " AND activo = 'y'";
|
||||
ResultSet rs = st.executeQuery(sql);
|
||||
|
||||
if(rs.isBeforeFirst())
|
||||
{
|
||||
rs.first();
|
||||
m = new Medida();
|
||||
m.setId( new Integer( rs.getInt("id") ) );
|
||||
m.setDescricao( rs.getString("descricao") );
|
||||
m.setActiva( rs.getString("activo") );
|
||||
}
|
||||
return m;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package global;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class Global {
|
||||
|
||||
//tipos utilizadores
|
||||
public static final int RESPONSAVEL_SEGURANCA = 1;
|
||||
public static final int TECNICO_HS = 3;
|
||||
public static final int DIRECTOR_LOJA = 9;
|
||||
public static final int DIRECTOR_NACIONAL_SEGURANCA = 10;
|
||||
|
||||
//Estados do plano
|
||||
public static final int ESTADO_CRIACAO_TSHS = 1;
|
||||
public static final int ESTADO_EDICAO_SEGURANCA = 2;
|
||||
public static final int ESTADO_VALIDACAO_DIR_LOJA = 3;
|
||||
public static final int ESTADO_VALIDACAO_DNS = 4;
|
||||
public static final int ESTADO_VERIFICACAO_TSHS = 5;
|
||||
public static final int ESTADO_CONCLUIDO = 6;
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package mail;
|
||||
|
||||
import javax.mail.*;
|
||||
import javax.mail.Authenticator;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class Mail {
|
||||
|
||||
private final static String SERVIDOR_SMTP = "mail2.evolute.pt";
|
||||
private 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 void send(String emailTo, String emailFrom, String assunto, String texto_email) throws Exception
|
||||
{
|
||||
Properties props = new Properties();
|
||||
//props.put("mail.transport.protocol", "smtp");
|
||||
props.put("mail.smtp.host", SERVIDOR_SMTP);
|
||||
props.put("mail.from", emailFrom);
|
||||
props.put("mail.smtp.auth", "true");
|
||||
props.put("mail.smtp.user", "lluis");
|
||||
props.put("mail.smtp.password", "654321");
|
||||
// Session session1 = Session.getInstance(props);
|
||||
Authenticator auth = new SMTPAuthenticator();
|
||||
Session session = Session.getDefaultInstance(props, auth);
|
||||
|
||||
Message msg = new MimeMessage(session);
|
||||
msg.setFrom(new InternetAddress(emailFrom));
|
||||
InternetAddress[] address = {new InternetAddress(emailTo)};
|
||||
msg.setRecipients(Message.RecipientType.TO, address);
|
||||
((MimeMessage)msg).setSubject(assunto, "UTF-8");
|
||||
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+= texto_email;
|
||||
html+="<body></html>";
|
||||
msgBodyPart.setContent(html, "text/html");
|
||||
multipart.addBodyPart(msgBodyPart);
|
||||
msg.setContent(multipart);
|
||||
Transport.send(msg);
|
||||
System.out.println("Email Enviado !!!! ");
|
||||
|
||||
}
|
||||
|
||||
private class SMTPAuthenticator extends Authenticator {
|
||||
public PasswordAuthentication getPasswordAuthentication() {
|
||||
String username = "lluis";
|
||||
String password = "654321";
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package mail;
|
||||
|
||||
import db.entidades.PlanoActuacao;
|
||||
import db.entidades.User;
|
||||
import global.Global;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class SendMail extends Mail{
|
||||
|
||||
public void sendMail(User u, PlanoActuacao p)
|
||||
{
|
||||
int estado = p.getEstado().intValue();
|
||||
switch(estado)
|
||||
{
|
||||
case Global.ESTADO_CRIACAO_TSHS:
|
||||
break;
|
||||
|
||||
case Global.ESTADO_EDICAO_SEGURANCA:
|
||||
break;
|
||||
|
||||
case Global.ESTADO_VALIDACAO_DIR_LOJA:
|
||||
break;
|
||||
|
||||
case Global.ESTADO_VALIDACAO_DNS:
|
||||
break;
|
||||
|
||||
case Global.ESTADO_VERIFICACAO_TSHS:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* ApplicationBean1.java
|
||||
*
|
||||
* Created on Aug 25, 2008, 11:20:16 AM
|
||||
*/
|
||||
|
||||
package planosactuacao;
|
||||
|
||||
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>
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class ApplicationBean1 extends AbstractApplicationBean {
|
||||
// <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 {
|
||||
}
|
||||
// </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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
public String getLocaleCharacterEncoding() {
|
||||
return super.getLocaleCharacterEncoding();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
# To change this template, choose Tools | Templates
|
||||
# and open the template in the editor.
|
||||
|
||||
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* PlanoActuacao.java
|
||||
*
|
||||
* Created on Aug 26, 2008, 3:10:59 PM
|
||||
*/
|
||||
|
||||
package planosactuacao;
|
||||
|
||||
import com.sun.rave.web.ui.appbase.AbstractPageBean;
|
||||
import javax.faces.FacesException;
|
||||
|
||||
/**
|
||||
* <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 EditarPlano 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 {
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
/**
|
||||
* <p>Construct a new Page bean instance.</p>
|
||||
*/
|
||||
public EditarPlano() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <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>
|
||||
*/
|
||||
@Override
|
||||
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("PlanoActuacao 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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
public void prerender() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Callback method that is called after rendering is completed for
|
||||
* this request, if <code>init()</code> was called (regardless of whether
|
||||
* or not this was the page that was actually rendered). Customize this
|
||||
* method to release resources acquired in the <code>init()</code>,
|
||||
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
|
||||
* acquired during execution of an event handler).</p>
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected RequestBean1 getRequestBean1() {
|
||||
return (RequestBean1) getBean("RequestBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected SessionBean1 getSessionBean1() {
|
||||
return (SessionBean1) getBean("SessionBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected ApplicationBean1 getApplicationBean1() {
|
||||
return (ApplicationBean1) getBean("ApplicationBean1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Erro.java
|
||||
*
|
||||
* Created on Aug 26, 2008, 10:54:11 AM
|
||||
*/
|
||||
|
||||
package planosactuacao;
|
||||
|
||||
import com.sun.rave.web.ui.appbase.AbstractPageBean;
|
||||
import com.sun.webui.jsf.component.StaticText;
|
||||
import javax.faces.FacesException;
|
||||
|
||||
/**
|
||||
* <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 Erro 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 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>
|
||||
*/
|
||||
@Override
|
||||
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("Erro 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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected RequestBean1 getRequestBean1() {
|
||||
return (RequestBean1) getBean("RequestBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected SessionBean1 getSessionBean1() {
|
||||
return (SessionBean1) getBean("SessionBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected ApplicationBean1 getApplicationBean1() {
|
||||
return (ApplicationBean1) getBean("ApplicationBean1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* ListaPlanos.java
|
||||
*
|
||||
* Created on Aug 29, 2008, 2:57:16 PM
|
||||
*/
|
||||
|
||||
package planosactuacao;
|
||||
|
||||
import com.sun.rave.web.ui.appbase.AbstractPageBean;
|
||||
import javax.faces.FacesException;
|
||||
|
||||
/**
|
||||
* <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 ListaPlanos 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 {
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
/**
|
||||
* <p>Construct a new Page bean instance.</p>
|
||||
*/
|
||||
public ListaPlanos() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <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>
|
||||
*/
|
||||
@Override
|
||||
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("ListaPlanos 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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
public void prerender() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Callback method that is called after rendering is completed for
|
||||
* this request, if <code>init()</code> was called (regardless of whether
|
||||
* or not this was the page that was actually rendered). Customize this
|
||||
* method to release resources acquired in the <code>init()</code>,
|
||||
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
|
||||
* acquired during execution of an event handler).</p>
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected RequestBean1 getRequestBean1() {
|
||||
return (RequestBean1) getBean("RequestBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected ApplicationBean1 getApplicationBean1() {
|
||||
return (ApplicationBean1) getBean("ApplicationBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected SessionBean1 getSessionBean1() {
|
||||
return (SessionBean1) getBean("SessionBean1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Login.java
|
||||
*
|
||||
* Created on Aug 26, 2008, 11:21:02 AM
|
||||
*/
|
||||
|
||||
package planosactuacao;
|
||||
|
||||
import com.sun.rave.web.ui.appbase.AbstractPageBean;
|
||||
import com.sun.webui.jsf.component.Button;
|
||||
import com.sun.webui.jsf.component.PasswordField;
|
||||
import com.sun.webui.jsf.component.TextField;
|
||||
import java.sql.Connection;
|
||||
import javax.faces.FacesException;
|
||||
|
||||
/**
|
||||
* <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 Login 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 TextField txtUtilizador = new TextField();
|
||||
|
||||
public TextField getTxtUtilizador() {
|
||||
return txtUtilizador;
|
||||
}
|
||||
|
||||
public void setTxtUtilizador(TextField tf) {
|
||||
this.txtUtilizador = tf;
|
||||
}
|
||||
private PasswordField txtPassword = new PasswordField();
|
||||
|
||||
public PasswordField getTxtPassword() {
|
||||
return txtPassword;
|
||||
}
|
||||
|
||||
public void setTxtPassword(PasswordField pf) {
|
||||
this.txtPassword = pf;
|
||||
}
|
||||
private Button butLogin = new Button();
|
||||
|
||||
public Button getButLogin() {
|
||||
return butLogin;
|
||||
}
|
||||
|
||||
public void setButLogin(Button b) {
|
||||
this.butLogin = b;
|
||||
}
|
||||
|
||||
// </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>
|
||||
*/
|
||||
@Override
|
||||
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("Login 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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
public void prerender() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Callback method that is called after rendering is completed for
|
||||
* this request, if <code>init()</code> was called (regardless of whether
|
||||
* or not this was the page that was actually rendered). Customize this
|
||||
* method to release resources acquired in the <code>init()</code>,
|
||||
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
|
||||
* acquired during execution of an event handler).</p>
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected RequestBean1 getRequestBean1() {
|
||||
return (RequestBean1) getBean("RequestBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected SessionBean1 getSessionBean1() {
|
||||
return (SessionBean1) getBean("SessionBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected ApplicationBean1 getApplicationBean1() {
|
||||
return (ApplicationBean1) getBean("ApplicationBean1");
|
||||
}
|
||||
|
||||
private void connect()
|
||||
{
|
||||
db.Db db = new db.Db();
|
||||
try
|
||||
{
|
||||
Connection connection = db.connect();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
getSessionBean1().setMsg("Erro na ligação à Base de Dados");
|
||||
//***** terminate session
|
||||
try {
|
||||
getExternalContext().redirect("faces/Erro.jsp");
|
||||
} catch(Exception e) {
|
||||
// . . . handle exception . . .
|
||||
e.printStackTrace();
|
||||
}
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public String lnkPasswordRecovery_action() {
|
||||
// TODO: Process the action. Return value is a navigation
|
||||
// case name where null will return to the same page.
|
||||
return null;
|
||||
}
|
||||
|
||||
public String butLogin_action() {
|
||||
// TODO: Process the action. Return value is a navigation
|
||||
// case name where null will return to the same page.
|
||||
return "lista_planos";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* RequestBean1.java
|
||||
*
|
||||
* Created on Aug 25, 2008, 11:20:16 AM
|
||||
*/
|
||||
|
||||
package planosactuacao;
|
||||
|
||||
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>
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class RequestBean1 extends AbstractRequestBean {
|
||||
// <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 {
|
||||
}
|
||||
// </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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected SessionBean1 getSessionBean1() {
|
||||
return (SessionBean1) getBean("SessionBean1");
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected ApplicationBean1 getApplicationBean1() {
|
||||
return (ApplicationBean1) getBean("ApplicationBean1");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* SessionBean1.java
|
||||
*
|
||||
* Created on Aug 25, 2008, 11:20:16 AM
|
||||
*/
|
||||
|
||||
package planosactuacao;
|
||||
|
||||
import com.sun.rave.web.ui.appbase.AbstractSessionBean;
|
||||
import javax.faces.FacesException;
|
||||
|
||||
/**
|
||||
* <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>
|
||||
*
|
||||
* @author lluis
|
||||
*/
|
||||
public class SessionBean1 extends AbstractSessionBean {
|
||||
|
||||
private String msg;
|
||||
// <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 {
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
/**
|
||||
* <p>Construct a new session data bean instance.</p>
|
||||
*/
|
||||
public SessionBean1() {
|
||||
msg = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* <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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
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>
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Return a reference to the scoped data bean.</p>
|
||||
*
|
||||
* @return reference to the scoped data bean
|
||||
*/
|
||||
protected ApplicationBean1 getApplicationBean1() {
|
||||
return (ApplicationBean1) getBean("ApplicationBean1");
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
Document : PlanoActuacao
|
||||
Created on : Aug 26, 2008, 3:10:59 PM
|
||||
Author : lluis
|
||||
-->
|
||||
|
||||
<jsp:root version="2.1" 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:webuijsf="http://www.sun.com/webui/webuijsf">
|
||||
<jsp:directive.page contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1"/>
|
||||
<f:view>
|
||||
<webuijsf:page id="page1">
|
||||
<webuijsf:html id="html1">
|
||||
<webuijsf:head id="head1">
|
||||
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
|
||||
</webuijsf:head>
|
||||
<webuijsf:body id="body1" style="-rave-layout: grid">
|
||||
<webuijsf:form id="form1">
|
||||
</webuijsf:form>
|
||||
</webuijsf:body>
|
||||
</webuijsf:html>
|
||||
</webuijsf:page>
|
||||
</f:view>
|
||||
</jsp:root>
|
||||
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
Document : Erro
|
||||
Created on : Aug 26, 2008, 10:54:11 AM
|
||||
Author : lluis
|
||||
-->
|
||||
<jsp:root version="2.1" 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:webuijsf="http://www.sun.com/webui/webuijsf">
|
||||
<jsp:directive.page contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1"/>
|
||||
<f:view>
|
||||
<webuijsf:page id="page1">
|
||||
<webuijsf:html id="html1">
|
||||
<webuijsf:head id="head1">
|
||||
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
|
||||
</webuijsf:head>
|
||||
<webuijsf:body id="body1" style="-rave-layout: grid">
|
||||
<webuijsf:form id="form1">
|
||||
<h:panelGrid columns="1" id="gridPanel1" style="height: 24px; left: 0px; top: 120px; position: absolute; width: 100%"
|
||||
styleClass="centerBlock" width="576">
|
||||
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridPanel2" style="height: 96px" styleClass="centerBlock" width="504">
|
||||
<webuijsf:label id="label1" style="font-size: 18px" text="Erro"/>
|
||||
<webuijsf:staticText binding="#{Erro.txtMsg}" escape="false" id="txtMsg" style="height: 24px; width: 96px" styleClass="fatalMessage"/>
|
||||
</h:panelGrid>
|
||||
</h:panelGrid>
|
||||
</webuijsf:form>
|
||||
</webuijsf:body>
|
||||
</webuijsf:html>
|
||||
</webuijsf:page>
|
||||
</f:view>
|
||||
</jsp:root>
|
||||
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
Document : ListaPlanos
|
||||
Created on : Aug 29, 2008, 2:57:16 PM
|
||||
Author : lluis
|
||||
-->
|
||||
|
||||
<jsp:root version="2.1" 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:webuijsf="http://www.sun.com/webui/webuijsf">
|
||||
<jsp:directive.page contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1"/>
|
||||
<f:view>
|
||||
<webuijsf:page id="page1">
|
||||
<webuijsf:html id="html1">
|
||||
<webuijsf:head id="head1">
|
||||
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
|
||||
</webuijsf:head>
|
||||
<webuijsf:body id="body1" style="-rave-layout: grid">
|
||||
<webuijsf:form id="form1">
|
||||
</webuijsf:form>
|
||||
</webuijsf:body>
|
||||
</webuijsf:html>
|
||||
</webuijsf:page>
|
||||
</f:view>
|
||||
</jsp:root>
|
||||
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
Document : Login
|
||||
Created on : Aug 26, 2008, 11:21:02 AM
|
||||
Author : lluis
|
||||
-->
|
||||
<jsp:root version="2.1" 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:webuijsf="http://www.sun.com/webui/webuijsf">
|
||||
<jsp:directive.page contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1"/>
|
||||
<f:view>
|
||||
<webuijsf:page id="page1">
|
||||
<webuijsf:html id="html1">
|
||||
<webuijsf:head id="head1">
|
||||
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
|
||||
</webuijsf:head>
|
||||
<webuijsf:body id="body1" style="-rave-layout: grid">
|
||||
<webuijsf:form id="form1">
|
||||
<h:panelGrid columns="1" id="gridPanel1" style="height: 96px; left: 0px; top: 300px; position: absolute; width: 100%"
|
||||
styleClass="centerBlock" width="456">
|
||||
<h:panelGrid columns="1" id="gridPanel2" style="height: 24px" styleClass="centerBlock" width="400">
|
||||
<h:panelGrid columns="1" id="gridPanel3" style="border: 1px solid black; height: 24px; width: 100%">
|
||||
<h:panelGrid columnClasses="gridColLeft, gridColRight" columns="2" id="gridPanel4" style="height: 24px; width: 100%">
|
||||
<webuijsf:staticText id="staticText2" style="height: 24px; width: 144px" styleClass="label" text="Utilizador:"/>
|
||||
<webuijsf:textField binding="#{Login.txtUtilizador}" columns="40" id="txtUtilizador" style="height: 36px; width: 100%"/>
|
||||
<webuijsf:staticText id="staticText3" style="height: 24px; width: 144px" styleClass="label" text="Palavra-chave:"/>
|
||||
<webuijsf:passwordField binding="#{Login.txtPassword}" columns="40" id="txtPassword"/>
|
||||
<webuijsf:hyperlink actionExpression="#{Login.lnkPasswordRecovery_action}" id="lnkPasswordRecovery" text="Recuperar palavra-chave"/>
|
||||
<webuijsf:button actionExpression="#{Login.butLogin_action}" binding="#{Login.butLogin}" id="butLogin"
|
||||
style="width: 95px" text="Entrar"/>
|
||||
</h:panelGrid>
|
||||
</h:panelGrid>
|
||||
<webuijsf:staticText id="txtMsg" style="height: 24px; width: 168px" styleClass="errorMessage"/>
|
||||
</h:panelGrid>
|
||||
</h:panelGrid>
|
||||
</webuijsf:form>
|
||||
</webuijsf:body>
|
||||
</webuijsf:html>
|
||||
</webuijsf:page>
|
||||
</f:view>
|
||||
</jsp:root>
|
||||
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Context path="/PlanosActuacao"/>
|
||||
@ -0,0 +1,51 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
<!-- =========== FULL CONFIGURATION FILE ================================== -->
|
||||
|
||||
<faces-config version="1.2"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
|
||||
<managed-bean>
|
||||
<managed-bean-name>SessionBean1</managed-bean-name>
|
||||
<managed-bean-class>planosactuacao.SessionBean1</managed-bean-class>
|
||||
<managed-bean-scope>session</managed-bean-scope>
|
||||
</managed-bean>
|
||||
<managed-bean>
|
||||
<managed-bean-name>Login</managed-bean-name>
|
||||
<managed-bean-class>planosactuacao.Login</managed-bean-class>
|
||||
<managed-bean-scope>request</managed-bean-scope>
|
||||
</managed-bean>
|
||||
<managed-bean>
|
||||
<managed-bean-name>ApplicationBean1</managed-bean-name>
|
||||
<managed-bean-class>planosactuacao.ApplicationBean1</managed-bean-class>
|
||||
<managed-bean-scope>application</managed-bean-scope>
|
||||
</managed-bean>
|
||||
<managed-bean>
|
||||
<managed-bean-name>RequestBean1</managed-bean-name>
|
||||
<managed-bean-class>planosactuacao.RequestBean1</managed-bean-class>
|
||||
<managed-bean-scope>request</managed-bean-scope>
|
||||
</managed-bean>
|
||||
<managed-bean>
|
||||
<managed-bean-name>Erro</managed-bean-name>
|
||||
<managed-bean-class>planosactuacao.Erro</managed-bean-class>
|
||||
<managed-bean-scope>request</managed-bean-scope>
|
||||
</managed-bean>
|
||||
<managed-bean>
|
||||
<managed-bean-name>EditarPlano</managed-bean-name>
|
||||
<managed-bean-class>planosactuacao.EditarPlano</managed-bean-class>
|
||||
<managed-bean-scope>request</managed-bean-scope>
|
||||
</managed-bean>
|
||||
<managed-bean>
|
||||
<managed-bean-name>ListaPlanos</managed-bean-name>
|
||||
<managed-bean-class>planosactuacao.ListaPlanos</managed-bean-class>
|
||||
<managed-bean-scope>request</managed-bean-scope>
|
||||
</managed-bean>
|
||||
<navigation-rule>
|
||||
<from-view-id>/Login.jsp</from-view-id>
|
||||
<navigation-case>
|
||||
<from-outcome>lista_planos</from-outcome>
|
||||
<to-view-id>/ListaPlanos.jsp</to-view-id>
|
||||
</navigation-case>
|
||||
</navigation-rule>
|
||||
</faces-config>
|
||||
@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
<context-param>
|
||||
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
|
||||
<param-value>client</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>com.sun.faces.validateXml</param-name>
|
||||
<param-value>true</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>com.sun.faces.verifyObjects</param-name>
|
||||
<param-value>false</param-value>
|
||||
</context-param>
|
||||
<filter>
|
||||
<filter-name>UploadFilter</filter-name>
|
||||
<filter-class>com.sun.webui.jsf.util.UploadFilter</filter-class>
|
||||
<init-param>
|
||||
<description>The maximum allowed upload size in bytes. If this is set to a negative value, there is no maximum. The default value is 1000000.</description>
|
||||
<param-name>maxSize</param-name>
|
||||
<param-value>1000000</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<description>The size (in bytes) of an uploaded file which, if it is exceeded, will cause the file to be written directly to disk instead of stored in memory. Files smaller than or equal to this size will be stored in memory. The default value is 4096.</description>
|
||||
<param-name>sizeThreshold</param-name>
|
||||
<param-value>4096</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>UploadFilter</filter-name>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
</filter-mapping>
|
||||
<servlet>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>javax.faces.LIFECYCLE_ID</param-name>
|
||||
<param-value>com.sun.faces.lifecycle.PARTIAL</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>ExceptionHandlerServlet</servlet-name>
|
||||
<servlet-class>com.sun.errorhandler.ExceptionHandler</servlet-class>
|
||||
<init-param>
|
||||
<param-name>errorHost</param-name>
|
||||
<param-value>localhost</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>errorPort</param-name>
|
||||
<param-value>24444</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
<servlet>
|
||||
<servlet-name>ThemeServlet</servlet-name>
|
||||
<servlet-class>com.sun.webui.theme.ThemeServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<url-pattern>/faces/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>ExceptionHandlerServlet</servlet-name>
|
||||
<url-pattern>/error/ExceptionHandler</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>ThemeServlet</servlet-name>
|
||||
<url-pattern>/theme/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<session-config>
|
||||
<session-timeout>
|
||||
30
|
||||
</session-timeout>
|
||||
</session-config>
|
||||
<welcome-file-list>
|
||||
<welcome-file>faces/Login.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
<error-page>
|
||||
<exception-type>javax.servlet.ServletException</exception-type>
|
||||
<location>/error/ExceptionHandler</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<exception-type>java.io.IOException</exception-type>
|
||||
<location>/error/ExceptionHandler</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<exception-type>javax.faces.FacesException</exception-type>
|
||||
<location>/error/ExceptionHandler</location>
|
||||
</error-page>
|
||||
<error-page>
|
||||
<exception-type>com.sun.rave.web.ui.appbase.ApplicationException</exception-type>
|
||||
<location>/error/ExceptionHandler</location>
|
||||
</error-page>
|
||||
<jsp-config>
|
||||
<jsp-property-group>
|
||||
<url-pattern>*.jspf</url-pattern>
|
||||
<is-xml>true</is-xml>
|
||||
</jsp-property-group>
|
||||
</jsp-config>
|
||||
</web-app>
|
||||
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* After modifying this style sheet, refresh the page being designed to see the effect of the modification.
|
||||
* Click the Refresh button in the Visual Designer toolbar to refresh the page.
|
||||
*/
|
||||
|
||||
/* Style rules to make Java Server faces Standarad data tables look better */
|
||||
|
||||
.list-header {
|
||||
background-color: #eeeeee;
|
||||
font-size: larger;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.list-paging-header {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.list-paging-footer {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.list-row-even {
|
||||
}
|
||||
|
||||
.list-row-odd {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
/* Labels */
|
||||
|
||||
.label{
|
||||
font-size : 12px;
|
||||
font-weight : bold;
|
||||
}
|
||||
|
||||
/* center blocks */
|
||||
|
||||
.centerBlock{
|
||||
text-align: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;}
|
||||
|
||||
/* Grid panel column alignment */
|
||||
|
||||
.gridColLeft {
|
||||
text-align : left;
|
||||
}
|
||||
|
||||
.gridColCenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.gridColRight {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Style rules for message severity levels */
|
||||
|
||||
.infoMessage {
|
||||
font-size : 13px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.warnMessage {
|
||||
font-size : 13px;
|
||||
color: orange;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.errorMessage {
|
||||
color: #990000;
|
||||
font-weight: bold;
|
||||
font-size : 13px;
|
||||
}
|
||||
|
||||
.fatalMessage {
|
||||
color: red;
|
||||
font-style: italic;
|
||||
font-size : 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue