From daf6f05b67d8132ad38e5fa603314eb1a90b91cd Mon Sep 17 00:00:00 2001 From: Nuno Taborda Date: Wed, 24 Sep 2008 21:51:59 +0000 Subject: [PATCH] =?UTF-8?q?Inclus=C3=A3o=20do=20m=C3=B3dulo=20de=20Planos?= =?UTF-8?q?=20de=20Actua=C3=A7=C3=A3o=20(netbeans=20project)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.coded.pt/svn/SIPRP@747 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/PlanosActuacao/build.xml | 66 ++ trunk/PlanosActuacao/nbproject/ant-deploy.xml | 28 + trunk/PlanosActuacao/nbproject/build-impl.xml | 895 ++++++++++++++++++ .../nbproject/faces-config.NavData | 11 + .../nbproject/genfiles.properties | 8 + .../nbproject/private/private.properties | 24 + .../nbproject/private/private.xml | 4 + .../nbproject/project.properties | 83 ++ trunk/PlanosActuacao/nbproject/project.xml | 65 ++ trunk/PlanosActuacao/src/conf/MANIFEST.MF | 2 + trunk/PlanosActuacao/src/java/db/Db.java | 55 ++ .../src/java/db/entidades/Medida.java | 40 + .../src/java/db/entidades/PlanoActuacao.java | 40 + .../src/java/db/entidades/PostoTrabalho.java | 49 + .../src/java/db/entidades/Risco.java | 49 + .../src/java/db/entidades/User.java | 231 +++++ .../db/providers/GenericDataProvider.java | 45 + .../java/db/providers/PlanosDataProvider.java | 256 +++++ .../src/java/global/Global.java | 28 + trunk/PlanosActuacao/src/java/mail/Mail.java | 76 ++ .../src/java/mail/SendMail.java | 39 + .../java/planosactuacao/ApplicationBean1.java | 104 ++ .../src/java/planosactuacao/Bundle.properties | 3 + .../src/java/planosactuacao/EditarPlano.java | 139 +++ .../src/java/planosactuacao/Erro.java | 151 +++ .../src/java/planosactuacao/ListaPlanos.java | 139 +++ .../src/java/planosactuacao/Login.java | 204 ++++ .../src/java/planosactuacao/RequestBean1.java | 108 +++ .../src/java/planosactuacao/SessionBean1.java | 136 +++ trunk/PlanosActuacao/web/EditarPlano.jsp | 23 + trunk/PlanosActuacao/web/Erro.jsp | 29 + trunk/PlanosActuacao/web/ListaPlanos.jsp | 23 + trunk/PlanosActuacao/web/Login.jsp | 39 + trunk/PlanosActuacao/web/META-INF/context.xml | 2 + .../web/WEB-INF/faces-config.xml | 51 + trunk/PlanosActuacao/web/WEB-INF/web.xml | 100 ++ .../web/resources/stylesheet.css | 84 ++ 37 files changed, 3429 insertions(+) create mode 100644 trunk/PlanosActuacao/build.xml create mode 100644 trunk/PlanosActuacao/nbproject/ant-deploy.xml create mode 100644 trunk/PlanosActuacao/nbproject/build-impl.xml create mode 100644 trunk/PlanosActuacao/nbproject/faces-config.NavData create mode 100644 trunk/PlanosActuacao/nbproject/genfiles.properties create mode 100644 trunk/PlanosActuacao/nbproject/private/private.properties create mode 100644 trunk/PlanosActuacao/nbproject/private/private.xml create mode 100644 trunk/PlanosActuacao/nbproject/project.properties create mode 100644 trunk/PlanosActuacao/nbproject/project.xml create mode 100644 trunk/PlanosActuacao/src/conf/MANIFEST.MF create mode 100644 trunk/PlanosActuacao/src/java/db/Db.java create mode 100644 trunk/PlanosActuacao/src/java/db/entidades/Medida.java create mode 100644 trunk/PlanosActuacao/src/java/db/entidades/PlanoActuacao.java create mode 100644 trunk/PlanosActuacao/src/java/db/entidades/PostoTrabalho.java create mode 100644 trunk/PlanosActuacao/src/java/db/entidades/Risco.java create mode 100644 trunk/PlanosActuacao/src/java/db/entidades/User.java create mode 100644 trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java create mode 100644 trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java create mode 100644 trunk/PlanosActuacao/src/java/global/Global.java create mode 100644 trunk/PlanosActuacao/src/java/mail/Mail.java create mode 100644 trunk/PlanosActuacao/src/java/mail/SendMail.java create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/ApplicationBean1.java create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/Bundle.properties create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/Erro.java create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/Login.java create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/RequestBean1.java create mode 100644 trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java create mode 100644 trunk/PlanosActuacao/web/EditarPlano.jsp create mode 100644 trunk/PlanosActuacao/web/Erro.jsp create mode 100644 trunk/PlanosActuacao/web/ListaPlanos.jsp create mode 100644 trunk/PlanosActuacao/web/Login.jsp create mode 100644 trunk/PlanosActuacao/web/META-INF/context.xml create mode 100644 trunk/PlanosActuacao/web/WEB-INF/faces-config.xml create mode 100644 trunk/PlanosActuacao/web/WEB-INF/web.xml create mode 100644 trunk/PlanosActuacao/web/resources/stylesheet.css diff --git a/trunk/PlanosActuacao/build.xml b/trunk/PlanosActuacao/build.xml new file mode 100644 index 00000000..df3a7991 --- /dev/null +++ b/trunk/PlanosActuacao/build.xml @@ -0,0 +1,66 @@ + + + + + + Builds, tests, and runs the project PlanosActuacao. + + + diff --git a/trunk/PlanosActuacao/nbproject/ant-deploy.xml b/trunk/PlanosActuacao/nbproject/ant-deploy.xml new file mode 100644 index 00000000..a6f1480c --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/ant-deploy.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/nbproject/build-impl.xml b/trunk/PlanosActuacao/nbproject/build-impl.xml new file mode 100644 index 00000000..80ef579c --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/build-impl.xml @@ -0,0 +1,895 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + +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) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/nbproject/faces-config.NavData b/trunk/PlanosActuacao/nbproject/faces-config.NavData new file mode 100644 index 00000000..c224e374 --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/faces-config.NavData @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/nbproject/genfiles.properties b/trunk/PlanosActuacao/nbproject/genfiles.properties new file mode 100644 index 00000000..9676046e --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/genfiles.properties @@ -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 diff --git a/trunk/PlanosActuacao/nbproject/private/private.properties b/trunk/PlanosActuacao/nbproject/private/private.properties new file mode 100644 index 00000000..7bff1239 --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/private/private.properties @@ -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 diff --git a/trunk/PlanosActuacao/nbproject/private/private.xml b/trunk/PlanosActuacao/nbproject/private/private.xml new file mode 100644 index 00000000..c1f155a7 --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/trunk/PlanosActuacao/nbproject/project.properties b/trunk/PlanosActuacao/nbproject/project.properties new file mode 100644 index 00000000..2399d4a9 --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/project.properties @@ -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 diff --git a/trunk/PlanosActuacao/nbproject/project.xml b/trunk/PlanosActuacao/nbproject/project.xml new file mode 100644 index 00000000..c7fc1ede --- /dev/null +++ b/trunk/PlanosActuacao/nbproject/project.xml @@ -0,0 +1,65 @@ + + + org.netbeans.modules.web.project + + + + PlanosActuacao + 1.6 + + + ${libs.jsf12.classpath} + WEB-INF/lib + + + ${libs.jstl11.classpath} + WEB-INF/lib + + + ${libs.jsf12-support.classpath} + WEB-INF/lib + + + ${libs.woodstock-components.classpath} + WEB-INF/lib + + + ${libs.woodstock-theme-default.classpath} + WEB-INF/lib + + + ${file.reference.activation.jar} + WEB-INF/lib + + + ${file.reference.mail.jar} + WEB-INF/lib + + + ${file.reference.postgresql-8.0-315.jdbc3.jar} + WEB-INF/lib + + + ${file.reference.postgresql-8.1-407.jdbc3.jar} + WEB-INF/lib + + + ${file.reference.postgresql-8.2-506.jdbc4.jar} + WEB-INF/lib + + + + + ${libs.exceptionhandler-runtime.classpath} + WEB-INF/lib + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/src/conf/MANIFEST.MF b/trunk/PlanosActuacao/src/conf/MANIFEST.MF new file mode 100644 index 00000000..59499bce --- /dev/null +++ b/trunk/PlanosActuacao/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/trunk/PlanosActuacao/src/java/db/Db.java b/trunk/PlanosActuacao/src/java/db/Db.java new file mode 100644 index 00000000..44369311 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/Db.java @@ -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; + } + } +} diff --git a/trunk/PlanosActuacao/src/java/db/entidades/Medida.java b/trunk/PlanosActuacao/src/java/db/entidades/Medida.java new file mode 100644 index 00000000..9db3f182 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/entidades/Medida.java @@ -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; + } +} diff --git a/trunk/PlanosActuacao/src/java/db/entidades/PlanoActuacao.java b/trunk/PlanosActuacao/src/java/db/entidades/PlanoActuacao.java new file mode 100644 index 00000000..d07eb907 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/entidades/PlanoActuacao.java @@ -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; + } +} diff --git a/trunk/PlanosActuacao/src/java/db/entidades/PostoTrabalho.java b/trunk/PlanosActuacao/src/java/db/entidades/PostoTrabalho.java new file mode 100644 index 00000000..130e33ff --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/entidades/PostoTrabalho.java @@ -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; + } +} diff --git a/trunk/PlanosActuacao/src/java/db/entidades/Risco.java b/trunk/PlanosActuacao/src/java/db/entidades/Risco.java new file mode 100644 index 00000000..b252bb8a --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/entidades/Risco.java @@ -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; + } +} diff --git a/trunk/PlanosActuacao/src/java/db/entidades/User.java b/trunk/PlanosActuacao/src/java/db/entidades/User.java new file mode 100644 index 00000000..e3ba7be5 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/entidades/User.java @@ -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; + } +} diff --git a/trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java b/trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java new file mode 100644 index 00000000..7307b61c --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java @@ -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(); + } +} diff --git a/trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java b/trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java new file mode 100644 index 00000000..68f34e58 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java @@ -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; + } +} diff --git a/trunk/PlanosActuacao/src/java/global/Global.java b/trunk/PlanosActuacao/src/java/global/Global.java new file mode 100644 index 00000000..70809610 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/global/Global.java @@ -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; + +} diff --git a/trunk/PlanosActuacao/src/java/mail/Mail.java b/trunk/PlanosActuacao/src/java/mail/Mail.java new file mode 100644 index 00000000..57bbd522 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/mail/Mail.java @@ -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+=""; + html+= texto_email; + 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); + } + } +} + diff --git a/trunk/PlanosActuacao/src/java/mail/SendMail.java b/trunk/PlanosActuacao/src/java/mail/SendMail.java new file mode 100644 index 00000000..36115906 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/mail/SendMail.java @@ -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; + } + } +} diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/ApplicationBean1.java b/trunk/PlanosActuacao/src/java/planosactuacao/ApplicationBean1.java new file mode 100644 index 00000000..1bc2e261 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/ApplicationBean1.java @@ -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; + +/** + *

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

+ * + *

An instance of this class will be created for you automatically, + * the first time your application evaluates a value binding expression + * or method binding expression that references a managed bean using + * this class.

+ * + * @author lluis + */ +public class ApplicationBean1 extends AbstractApplicationBean { + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + //
+ + /** + *

Construct a new application data bean instance.

+ */ + public ApplicationBean1() { + } + + /** + *

This method is called when this bean is initially added to + * application scope. Typically, this occurs as a result of evaluating + * a value binding or method binding expression, which utilizes the + * managed bean facility to instantiate this bean and store it into + * application scope.

+ * + *

You may customize this method to initialize and cache application wide + * data values (such as the lists of valid options for dropdown list + * components), or to allocate resources that are required for the + * lifetime of the application.

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

This method is called when this bean is removed from + * application scope. Typically, this occurs as a result of + * the application being shut down by its owning container.

+ * + *

You may customize this method to clean up resources allocated + * during the execution of the init() method, or + * at any later time during the lifetime of the application.

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

Return an appropriate character encoding based on the + * Locale defined for the current JavaServer Faces + * view. If no more suitable encoding can be found, return + * "UTF-8" as a general purpose default.

+ * + *

The default implementation uses the implementation from + * our superclass, AbstractApplicationBean.

+ */ + @Override + public String getLocaleCharacterEncoding() { + return super.getLocaleCharacterEncoding(); + } +} diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/Bundle.properties b/trunk/PlanosActuacao/src/java/planosactuacao/Bundle.properties new file mode 100644 index 00000000..57ed665a --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/Bundle.properties @@ -0,0 +1,3 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java b/trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java new file mode 100644 index 00000000..0601b660 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java @@ -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; + +/** + *

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.

+ * + * @author lluis + */ +public class EditarPlano extends AbstractPageBean { + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public EditarPlano() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @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 + + // + // 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); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() { + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

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

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1) getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1) getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1) getBean("ApplicationBean1"); + } + +} + diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/Erro.java b/trunk/PlanosActuacao/src/java/planosactuacao/Erro.java new file mode 100644 index 00000000..96a8ce9b --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/Erro.java @@ -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; + +/** + *

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.

+ * + * @author lluis + */ +public class Erro extends AbstractPageBean { + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + private StaticText txtMsg = new StaticText(); + + public StaticText getTxtMsg() { + return txtMsg; + } + + public void setTxtMsg(StaticText st) { + this.txtMsg = st; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public Erro() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @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 + + // + // 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); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() { + txtMsg.setText( getSessionBean1().getMsg() ); + getSessionBean1().setMsg(""); + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

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

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1) getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1) getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1) getBean("ApplicationBean1"); + } + +} + diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java b/trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java new file mode 100644 index 00000000..dfa9499f --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java @@ -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; + +/** + *

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.

+ * + * @author lluis + */ +public class ListaPlanos extends AbstractPageBean { + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public ListaPlanos() { + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @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 + + // + // 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); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() { + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

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

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1) getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1) getBean("ApplicationBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1) getBean("SessionBean1"); + } + +} + diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/Login.java b/trunk/PlanosActuacao/src/java/planosactuacao/Login.java new file mode 100644 index 00000000..68771d2d --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/Login.java @@ -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; + +/** + *

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.

+ * + * @author lluis + */ +public class Login extends AbstractPageBean { + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + private 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; + } + + //
+ + /** + *

Construct a new Page bean instance.

+ */ + public Login() { + connect(); + } + + /** + *

Callback method that is called whenever a page is navigated to, + * either directly via a URL, or indirectly via page navigation. + * Customize this method to acquire resources that will be needed + * for event handlers and lifecycle methods, whether or not this + * page is performing post back processing.

+ * + *

Note that, if the current request is a postback, the property + * values of the components do not represent any + * values submitted with this request. Instead, they represent the + * property values that were saved for this view when it was rendered.

+ */ + @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 + + // + // 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); + } + + // + // Perform application initialization that must complete + // *after* managed components are initialized + // TODO - add your own initialization code here + } + + /** + *

Callback method that is called after the component tree has been + * restored, but before any event processing takes place. This method + * will only be called on a postback request that + * is processing a form submit. Customize this method to allocate + * resources that will be required in your event handlers.

+ */ + @Override + public void preprocess() { + } + + /** + *

Callback method that is called just before rendering takes place. + * This method will only be called for the page that + * will actually be rendered (and not, for example, on a page that + * handled a postback and then navigated to a different page). Customize + * this method to allocate resources that will be required for rendering + * this page.

+ */ + @Override + public void prerender() { + } + + /** + *

Callback method that is called after rendering is completed for + * this request, if init() was called (regardless of whether + * or not this was the page that was actually rendered). Customize this + * method to release resources acquired in the init(), + * preprocess(), or prerender() methods (or + * acquired during execution of an event handler).

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

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected RequestBean1 getRequestBean1() { + return (RequestBean1) getBean("RequestBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1) getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @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"; + } + +} + diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/RequestBean1.java b/trunk/PlanosActuacao/src/java/planosactuacao/RequestBean1.java new file mode 100644 index 00000000..c40493b5 --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/RequestBean1.java @@ -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; + +/** + *

Request scope data bean for your application. Create properties + * here to represent data that should be made available across different + * pages in the same HTTP request, so that the page bean classes do not + * have to be directly linked to each other.

+ * + *

An instance of this class will be created for you automatically, + * the first time your application evaluates a value binding expression + * or method binding expression that references a managed bean using + * this class.

+ * + * @author lluis + */ +public class RequestBean1 extends AbstractRequestBean { + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + //
+ + /** + *

Construct a new request data bean instance.

+ */ + public RequestBean1() { + } + + /** + *

This method is called when this bean is initially added to + * request scope. Typically, this occurs as a result of evaluating + * a value binding or method binding expression, which utilizes the + * managed bean facility to instantiate this bean and store it into + * request scope.

+ * + *

You may customize this method to allocate resources that are required + * for the lifetime of the current request.

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

This method is called when this bean is removed from + * request scope. This occurs automatically when the corresponding + * HTTP response has been completed and sent to the client.

+ * + *

You may customize this method to clean up resources allocated + * during the execution of the init() method, or + * at any later time during the lifetime of the request.

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

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected SessionBean1 getSessionBean1() { + return (SessionBean1) getBean("SessionBean1"); + } + + /** + *

Return a reference to the scoped data bean.

+ * + * @return reference to the scoped data bean + */ + protected ApplicationBean1 getApplicationBean1() { + return (ApplicationBean1) getBean("ApplicationBean1"); + } + +} diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java b/trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java new file mode 100644 index 00000000..630ce50b --- /dev/null +++ b/trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java @@ -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; + +/** + *

Session scope data bean for your application. Create properties + * here to represent cached data that should be made available across + * multiple HTTP requests for an individual user.

+ * + *

An instance of this class will be created for you automatically, + * the first time your application evaluates a value binding expression + * or method binding expression that references a managed bean using + * this class.

+ * + * @author lluis + */ +public class SessionBean1 extends AbstractSessionBean { + + private String msg; + // + + /** + *

Automatically managed component initialization. WARNING: + * This method is automatically generated, so any user-specified code inserted + * here is subject to being replaced.

+ */ + private void _init() throws Exception { + } + //
+ + /** + *

Construct a new session data bean instance.

+ */ + public SessionBean1() { + msg = ""; + } + + /** + *

This method is called when this bean is initially added to + * session scope. Typically, this occurs as a result of evaluating + * a value binding or method binding expression, which utilizes the + * managed bean facility to instantiate this bean and store it into + * session scope.

+ * + *

You may customize this method to initialize and cache data values + * or resources that are required for the lifetime of a particular + * user session.

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

This method is called when the session containing it is about to be + * passivated. Typically, this occurs in a distributed servlet container + * when the session is about to be transferred to a different + * container instance, after which the activate() method + * will be called to indicate that the transfer is complete.

+ * + *

You may customize this method to release references to session data + * or resources that can not be serialized with the session itself.

+ */ + @Override + public void passivate() { + } + + /** + *

This method is called when the session containing it was + * reactivated.

+ * + *

You may customize this method to reacquire references to session + * data or resources that could not be serialized with the + * session itself.

+ */ + @Override + public void activate() { + } + + /** + *

This method is called when this bean is removed from + * session scope. Typically, this occurs as a result of + * the session timing out or being terminated by the application.

+ * + *

You may customize this method to clean up resources allocated + * during the execution of the init() method, or + * at any later time during the lifetime of the application.

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

Return a reference to the scoped data bean.

+ * + * @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; + } + +} diff --git a/trunk/PlanosActuacao/web/EditarPlano.jsp b/trunk/PlanosActuacao/web/EditarPlano.jsp new file mode 100644 index 00000000..9795fdf5 --- /dev/null +++ b/trunk/PlanosActuacao/web/EditarPlano.jsp @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/web/Erro.jsp b/trunk/PlanosActuacao/web/Erro.jsp new file mode 100644 index 00000000..17c9dd7c --- /dev/null +++ b/trunk/PlanosActuacao/web/Erro.jsp @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/web/ListaPlanos.jsp b/trunk/PlanosActuacao/web/ListaPlanos.jsp new file mode 100644 index 00000000..3af72684 --- /dev/null +++ b/trunk/PlanosActuacao/web/ListaPlanos.jsp @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/web/Login.jsp b/trunk/PlanosActuacao/web/Login.jsp new file mode 100644 index 00000000..fb2c4c09 --- /dev/null +++ b/trunk/PlanosActuacao/web/Login.jsp @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/PlanosActuacao/web/META-INF/context.xml b/trunk/PlanosActuacao/web/META-INF/context.xml new file mode 100644 index 00000000..2ee21b55 --- /dev/null +++ b/trunk/PlanosActuacao/web/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/trunk/PlanosActuacao/web/WEB-INF/faces-config.xml b/trunk/PlanosActuacao/web/WEB-INF/faces-config.xml new file mode 100644 index 00000000..8c2a53f6 --- /dev/null +++ b/trunk/PlanosActuacao/web/WEB-INF/faces-config.xml @@ -0,0 +1,51 @@ + + + + + + + SessionBean1 + planosactuacao.SessionBean1 + session + + + Login + planosactuacao.Login + request + + + ApplicationBean1 + planosactuacao.ApplicationBean1 + application + + + RequestBean1 + planosactuacao.RequestBean1 + request + + + Erro + planosactuacao.Erro + request + + + EditarPlano + planosactuacao.EditarPlano + request + + + ListaPlanos + planosactuacao.ListaPlanos + request + + + /Login.jsp + + lista_planos + /ListaPlanos.jsp + + + diff --git a/trunk/PlanosActuacao/web/WEB-INF/web.xml b/trunk/PlanosActuacao/web/WEB-INF/web.xml new file mode 100644 index 00000000..3ca2889e --- /dev/null +++ b/trunk/PlanosActuacao/web/WEB-INF/web.xml @@ -0,0 +1,100 @@ + + + + javax.faces.STATE_SAVING_METHOD + client + + + com.sun.faces.validateXml + true + + + com.sun.faces.verifyObjects + false + + + UploadFilter + com.sun.webui.jsf.util.UploadFilter + + The maximum allowed upload size in bytes. If this is set to a negative value, there is no maximum. The default value is 1000000. + maxSize + 1000000 + + + 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. + sizeThreshold + 4096 + + + + UploadFilter + Faces Servlet + + + Faces Servlet + javax.faces.webapp.FacesServlet + + javax.faces.LIFECYCLE_ID + com.sun.faces.lifecycle.PARTIAL + + 1 + + + ExceptionHandlerServlet + com.sun.errorhandler.ExceptionHandler + + errorHost + localhost + + + errorPort + 24444 + + + + ThemeServlet + com.sun.webui.theme.ThemeServlet + + + Faces Servlet + /faces/* + + + ExceptionHandlerServlet + /error/ExceptionHandler + + + ThemeServlet + /theme/* + + + + 30 + + + + faces/Login.jsp + + + javax.servlet.ServletException + /error/ExceptionHandler + + + java.io.IOException + /error/ExceptionHandler + + + javax.faces.FacesException + /error/ExceptionHandler + + + com.sun.rave.web.ui.appbase.ApplicationException + /error/ExceptionHandler + + + + *.jspf + true + + + diff --git a/trunk/PlanosActuacao/web/resources/stylesheet.css b/trunk/PlanosActuacao/web/resources/stylesheet.css new file mode 100644 index 00000000..4b72c958 --- /dev/null +++ b/trunk/PlanosActuacao/web/resources/stylesheet.css @@ -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; +} +