medidas) {
+ this.medidas = medidas;
+ }
}
diff --git a/trunk/PlanosActuacao/src/java/db/entidades/User.java b/trunk/PlanosActuacao/src/java/db/entidades/Utilizador.java
similarity index 99%
rename from trunk/PlanosActuacao/src/java/db/entidades/User.java
rename to trunk/PlanosActuacao/src/java/db/entidades/Utilizador.java
index e3ba7be5..9ff62553 100644
--- a/trunk/PlanosActuacao/src/java/db/entidades/User.java
+++ b/trunk/PlanosActuacao/src/java/db/entidades/Utilizador.java
@@ -11,7 +11,7 @@ import java.util.Date;
*
* @author lluis
*/
-public class User {
+public class Utilizador {
private Integer id;
private String login;
private String password;
diff --git a/trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java b/trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java
index 7307b61c..e32962c7 100644
--- a/trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java
+++ b/trunk/PlanosActuacao/src/java/db/providers/GenericDataProvider.java
@@ -15,7 +15,23 @@ import java.sql.Statement;
*/
public class GenericDataProvider {
- public Integer getMaxTableId(String table)
+ public void checkConnection()
+ {
+ Db db = new Db();
+ if(db.getConnection() == null)
+ {
+ try
+ {
+ db.connect();
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ protected Integer getMaxTableId(String table)
{
Statement st = createStatement();
String id = table + ".id";
diff --git a/trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java b/trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java
index 68f34e58..98577767 100644
--- a/trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java
+++ b/trunk/PlanosActuacao/src/java/db/providers/PlanosDataProvider.java
@@ -9,7 +9,7 @@ import db.entidades.Medida;
import db.entidades.PlanoActuacao;
import db.entidades.PostoTrabalho;
import db.entidades.Risco;
-import db.entidades.User;
+import db.entidades.Utilizador;
import global.Global;
import java.sql.ResultSet;
import java.sql.Statement;
@@ -48,7 +48,7 @@ public class PlanosDataProvider extends GenericDataProvider{
st.execute(sql);
}
- public ArrayList getPlanosActivos(User u) throws Exception
+ public ArrayList getPlanosActivos(Utilizador u) throws Exception
{
int userType = u.getTipo().intValue();
Statement st = createStatement();
@@ -79,7 +79,7 @@ public class PlanosDataProvider extends GenericDataProvider{
return list;
}
- public ArrayList getPlanosConcluidos(User u) throws Exception
+ public ArrayList getPlanosConcluidos(Utilizador u) throws Exception
{
Statement st = createStatement();
String sql = "select * from planos_actuacao where estado = 6";
diff --git a/trunk/PlanosActuacao/src/java/db/providers/UtilizadoresDataProvider.java b/trunk/PlanosActuacao/src/java/db/providers/UtilizadoresDataProvider.java
new file mode 100644
index 00000000..17620ee9
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/db/providers/UtilizadoresDataProvider.java
@@ -0,0 +1,46 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package db.providers;
+
+import db.*;
+import db.entidades.Utilizador;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+/**
+ *
+ * @author lluis
+ */
+public class UtilizadoresDataProvider extends GenericDataProvider{
+
+ public Utilizador getUtilizador(Integer id) throws Exception
+ {
+ Utilizador u = new Utilizador();
+ Statement st = createStatement();
+ String sql = "SELECT * FROM utilizadores WHERE id = " + id;
+ ResultSet rs = st.executeQuery(sql);
+ rs.first();
+ u.setId(new Integer(rs.getInt("id")));
+ u.setLogin(rs.getString("login"));
+ u.setPassword(rs.getString("password"));
+ u.setData_password(rs.getDate("data_password"));
+ u.setEmail(rs.getString("email"));
+ u.setEmpresa_id(new Integer(rs.getInt("empresa_id")));
+ u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id")));
+ u.setAdministrador(rs.getString("administrador"));
+ u.setTipo(new Integer(rs.getInt("tipo")));
+ u.setNumero_cedula(rs.getString("numero_cedula"));
+ u.setCap(rs.getString("cap"));
+ u.setNome(rs.getString("nome"));
+ u.setMedico_id(new Integer(rs.getInt("medico_id")));
+ u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id")));
+ u.setActivo(rs.getString("activo"));
+ u.setResponsavel_loja(rs.getString("responsavel_loja"));
+ u.setGestor_geral(rs.getString("gestor_geral"));
+ u.setApagado(rs.getString("apagado"));
+ return u;
+ }
+}
diff --git a/trunk/PlanosActuacao/src/java/global/Global.java b/trunk/PlanosActuacao/src/java/global/Global.java
index 70809610..f5f185e8 100644
--- a/trunk/PlanosActuacao/src/java/global/Global.java
+++ b/trunk/PlanosActuacao/src/java/global/Global.java
@@ -13,16 +13,31 @@ public class Global {
//tipos utilizadores
public static final int RESPONSAVEL_SEGURANCA = 1;
+ public static final int RH = 2;
public static final int TECNICO_HS = 3;
+ public static final int GESTOR = 6;
+ public static final int DIRECTOR_GERAL_RH = 7;
+ public static final int DIRECTOR_SIPRP = 8;
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;
+ //Fases do plano
+ public static final int FASE_SIPRP_EMISSAO = 1;
+ public static final int FASE_SEGURANCA_PREENCHIMENTO = 2;
+ public static final int FASE_DIR_LOJA_VALIDACAO = 3;
+ public static final int FASE_DNS_PARECER = 4;
+ public static final int FASE_SIPRP_CONCLUSAO = 5;
+ public static final int FASE_CONCLUIDO = 6;
+
+ //Fases do plano - texto
+ public static final String FASE_SIPRP_EMISSAO_TXT = "SIPRP(Emissão)";
+ public static final String FASE_SEGURANCA_PREENCHIMENTO_TXT = "Segurança Auchan(Preenchimento)";
+ public static final String FASE_DIR_LOJA_VALIDACAO_TXT = "Director de loja(Validação)";
+ public static final String FASE_DNS_PARECER_TXT = "DNS(Parecer)";
+ public static final String FASE_SIPRP_CONCLUSAO_TXT = "SIPRP(Verificação/Conclusão)";
+
+ public static final String[] FASES_TEXTO = new String[]{"SIPRP(Emissão)", "Segurança Auchan(Preenchimento)", "Director de loja(Validação)", "DNS(Parecer)", "SIPRP(Verificação/Conclusão)", "Concluído"};
+
+ public static final String ANALISE_ACIDENTES_URL = "http://localhost:8084/AnaliseAcidentesTrabalho/faces/"; //testes
}
diff --git a/trunk/PlanosActuacao/src/java/mail/SendMail.java b/trunk/PlanosActuacao/src/java/mail/SendMail.java
index 36115906..cb7dcf3c 100644
--- a/trunk/PlanosActuacao/src/java/mail/SendMail.java
+++ b/trunk/PlanosActuacao/src/java/mail/SendMail.java
@@ -6,7 +6,7 @@
package mail;
import db.entidades.PlanoActuacao;
-import db.entidades.User;
+import db.entidades.Utilizador;
import global.Global;
/**
@@ -15,25 +15,25 @@ import global.Global;
*/
public class SendMail extends Mail{
- public void sendMail(User u, PlanoActuacao p)
+ public void sendMail(Utilizador 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;
+// 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/phaselistener/MainPhaseListener.java b/trunk/PlanosActuacao/src/java/phaselistener/MainPhaseListener.java
new file mode 100644
index 00000000..5e5de6d7
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/phaselistener/MainPhaseListener.java
@@ -0,0 +1,88 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package phaselistener;
+
+import javax.faces.application.NavigationHandler;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import javax.servlet.http.HttpServletRequest;
+import planosactuacao.SessionBean1;
+import utils.JSFHTTPUtils;
+import utils.JSFUtils;
+
+/**
+ *
+ * @author lluis
+ */
+public class MainPhaseListener implements PhaseListener{
+ private boolean firstEntry = true;
+
+ public void afterPhase(PhaseEvent pe) {
+ if(pe.getPhaseId() == PhaseId.RENDER_RESPONSE)
+ {
+ FacesContext fc = pe.getFacesContext();
+ SessionBean1 session = JSFUtils.getSessionBean(fc);
+ String view = fc.getViewRoot().getViewId();
+ if(view.matches("/EditarPlano.jsp"))
+ {
+ session.setDisableMenu(true);
+ }
+ else
+ {
+ session.setDisableMenu(false);
+ }
+ System.out.println("VIEW : " + view);
+ }
+ }
+
+ public void beforePhase(PhaseEvent pe) {
+ if(pe.getPhaseId() == PhaseId.RENDER_RESPONSE)
+ {
+ FacesContext fc = pe.getFacesContext();
+ SessionBean1 session = JSFUtils.getSessionBean(fc);
+ String referer = JSFHTTPUtils.getReferer(pe.getFacesContext());
+ System.out.println("REFERER >>" + referer + "<<");
+
+ //check if comes from AnalisesAcidentes. If so, set loggedIn to true:
+ if(referer.indexOf("AnaliseAcidentes") != -1)
+ {
+ session.setLoggedIn(true);
+ String user = JSFUtils.getRequestParameter(fc, "user");
+ System.out.println("USER >" + user.toString() + "<");
+ }
+
+
+ //Determin Session Time out
+
+ HttpServletRequest req = (HttpServletRequest) fc.getExternalContext().getRequest();
+ UIViewRoot view = fc.getViewRoot();
+
+ if(!req.isRequestedSessionIdValid() && view.getViewId().indexOf("Login") == -1 ){
+ NavigationHandler nh = fc.getApplication().getNavigationHandler();
+ nh.handleNavigation(fc, null, "login");
+ }
+
+ //Determin if user is logged in
+ //HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
+
+ //SessionBean1 session = JSFUtils.getSessionBean(fc);
+ boolean loggedIn = session.isLoggedIn();
+ System.out.println("LOGGED IN : " + loggedIn);
+ if(!loggedIn && view.getViewId().indexOf("Login") == -1 ){
+ NavigationHandler nh = fc.getApplication().getNavigationHandler();
+ nh.handleNavigation(fc, null, "login");
+ }
+ }
+ }
+
+ public PhaseId getPhaseId() {
+ return PhaseId.ANY_PHASE;
+ }
+
+}
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/Dummy.java b/trunk/PlanosActuacao/src/java/planosactuacao/Dummy.java
new file mode 100644
index 00000000..f6aad5e5
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/Dummy.java
@@ -0,0 +1,170 @@
+/*
+ * Dummy.java
+ *
+ * Created on Oct 6, 2008, 10:43:13 AM
+ */
+
+package planosactuacao;
+
+import com.sun.rave.web.ui.appbase.AbstractPageBean;
+import com.sun.webui.jsf.component.Calendar;
+import com.sun.webui.jsf.component.TextArea;
+import com.sun.webui.jsf.component.TextField;
+import com.sun.webui.jsf.model.DefaultTableDataProvider;
+import javax.faces.component.html.HtmlPanelGrid;
+import tabledataproviders.*;
+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 Dummy 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 HtmlPanelGrid grid = new HtmlPanelGrid();
+
+ public HtmlPanelGrid getGrid() {
+ return grid;
+ }
+
+ public void setGrid(HtmlPanelGrid hpg) {
+ this.grid = hpg;
+ }
+
+ //
+
+ /**
+ * Construct a new Page bean instance.
+ */
+ public Dummy() {
+ }
+
+ /**
+ * Callback method that is called whenever a page is navigated to,
+ * either directly via a URL, or indirectly via page navigation.
+ * Customize this method to acquire resources that will be needed
+ * for event handlers and lifecycle methods, whether or not this
+ * page is performing post back processing.
+ *
+ * Note that, if the current request is a postback, the property
+ * values of the components do not represent any
+ * values submitted with this request. Instead, they represent the
+ * property values that were saved for this view when it was rendered.
+ */
+ @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("Dummy Initialization Failure", e);
+ throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
+ }
+
+ //
+ // Perform application initialization that must complete
+ // *after* managed components are initialized
+ // TODO - add your own initialization code here
+ }
+
+ /**
+ * Callback method that is called after the component tree has been
+ * restored, but before any event processing takes place. This method
+ * will only be called on a postback request that
+ * is processing a form submit. Customize this method to allocate
+ * resources that will be required in your event handlers.
+ */
+ @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() {
+ Calendar cal = new Calendar();
+ cal.setDateFormatPattern("dd-MM-yyyy");
+
+ grid.getChildren().add(cal);
+ }
+
+ /**
+ * 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 ApplicationBean1 getApplicationBean1() {
+ return (ApplicationBean1) getBean("ApplicationBean1");
+ }
+
+ /**
+ * 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");
+ }
+
+ public String lnkAnaliseAcidentes_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ return null;
+ }
+
+ public String lnkLogout_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ return null;
+ }
+
+}
+
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java b/trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java
index 0601b660..5962f6c8 100644
--- a/trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/EditarPlano.java
@@ -7,7 +7,21 @@
package planosactuacao;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
+import com.sun.webui.jsf.component.Button;
+import com.sun.webui.jsf.component.Calendar;
+import com.sun.webui.jsf.component.PanelGroup;
+import com.sun.webui.jsf.component.StaticText;
+import com.sun.webui.jsf.component.TextArea;
+import com.sun.webui.jsf.component.TextField;
+import db.entidades.Medida;
+import db.entidades.PlanoActuacao;
+import db.entidades.PostoTrabalho;
+import db.entidades.Risco;
+import java.util.Vector;
import javax.faces.FacesException;
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.context.FacesContext;
+import utils.JSFUtils;
/**
* Page bean that corresponds to a similarly named JSP page. This
@@ -30,7 +44,85 @@ public class EditarPlano extends AbstractPageBean {
}
//
+ HtmlPanelGrid grid;
+ PanelGroup pg;
+ StaticText st;
+ private HtmlPanelGrid gridLayout = new HtmlPanelGrid();
+
+ //Plano actuacao
+ PlanoActuacao plano;
+ Vector medidas = new Vector();
+ Vector riscos = new Vector();
+ Vector postos = new Vector();
+
+ HtmlPanelGrid gridPlano = new HtmlPanelGrid();
+ HtmlPanelGrid gridRisco;
+
+
+
+ int risco_id = 0;
+ int medida_id = 0;
+ int posto_id = 0;
+
+ //page components
+ TextField txtResponsavelExecucao;
+ TextArea txtRecursos;
+ Calendar dtInicio;
+ Calendar dtFim;
+
+ public HtmlPanelGrid getGridLayout() {
+ return gridLayout;
+ }
+
+ public void setGridLayout(HtmlPanelGrid hpg) {
+ this.gridLayout = hpg;
+ }
+ private Button butGravarPlano = new Button();
+
+ public Button getButGravarPlano() {
+ return butGravarPlano;
+ }
+
+ public void setButGravarPlano(Button b) {
+ this.butGravarPlano = b;
+ }
+ private Button butGravarRisco = new Button();
+
+ public Button getButGravarRisco() {
+ return butGravarRisco;
+ }
+
+ public void setButGravarRisco(Button b) {
+ this.butGravarRisco = b;
+ }
+ private Button butEnviar = new Button();
+
+ public Button getButEnviar() {
+ return butEnviar;
+ }
+
+ public void setButEnviar(Button b) {
+ this.butEnviar = b;
+ }
+ private Button butLimparDados = new Button();
+
+ public Button getButLimparDados() {
+ return butLimparDados;
+ }
+
+ public void setButLimparDados(Button b) {
+ this.butLimparDados = b;
+ }
+ private Button butCancelar = new Button();
+
+ public Button getButCancelar() {
+ return butCancelar;
+ }
+ public void setButCancelar(Button b) {
+ this.butCancelar = b;
+ }
+
/**
* Construct a new Page bean instance.
*/
@@ -71,6 +163,7 @@ public class EditarPlano extends AbstractPageBean {
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
+
}
/**
@@ -94,6 +187,24 @@ public class EditarPlano extends AbstractPageBean {
*/
@Override
public void prerender() {
+ System.out.println("PRERENDER");
+ FacesContext fc = getFacesContext();
+ //boolean isPostback = JSFUtils.isPostBack12(fc);
+ //boolean isPostback = JSFUtils.isPostBack(fc);
+ boolean isPostback = JSFUtils.isPostback();
+ System.out.println("POSTBACK : " + isPostback);
+ if(!isPostback)
+ {
+ initializePlano();
+ initialize();
+ fillPlano();
+ }
+ else
+ {
+ riscos = getSessionBean1().getRiscos();
+ medidas = getSessionBean1().getMedidas();
+ postos = getSessionBean1().getPostos();
+ }
}
/**
@@ -134,6 +245,435 @@ public class EditarPlano extends AbstractPageBean {
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1) getBean("ApplicationBean1");
}
+
+ public String hyperlink1_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ return "lista_planos";
+ }
+
+ private void fillPlano()
+ {
+ String indent = " ";
+ Risco r = getNextRisco(plano.getId());
+ fillRisco(r);
+ }
+
+ private void fillRisco(Risco r)
+ {
+ String indent = " ";
+ if(gridLayout.getChildren().size() > 0)
+ {
+ gridLayout.getChildren().clear();
+ }
+ gridRisco = new HtmlPanelGrid();
+ gridRisco.setWidth("100%");
+ gridRisco.setStyle("border: solid 1px #000000");
+ gridRisco.setColumns(1);
+ gridRisco.setColumnClasses("gridColLeft");
+
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setStyle("color: #2c4d7a");
+ st.setText("RISCO 1" + ": ");
+ pg.getChildren().add(st);
+ st = new StaticText();
+ st.setEscape(false);
+ st.setText(r.getDescricao());
+ pg.getChildren().add(st);
+ gridRisco.getChildren().add(pg);
+
+ st = new StaticText();
+ st.setEscape(false);
+ st.setText(" ");
+ gridRisco.getChildren().add(st);
+
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setText("Valor:" + " ");
+ pg.getChildren().add(st);
+ st = new StaticText();
+ st.setEscape(false);
+ st.setText(r.getValor().toString());
+ pg.getChildren().add(st);
+ gridRisco.getChildren().add(pg);
+
+ st = new StaticText();
+ st.setEscape(false);
+ st.setText(" ");
+ gridRisco.getChildren().add(st);
+
+ //medidas
+ Vector meds = getMedidas(r.getId());
+ for(int i = 0; i < meds.size(); i++)
+ {
+ Medida m = medidas.get(i);
+ if(m.getRisco_id().intValue() == r.getId().intValue())
+ {
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setText(indent + "Medida" + ": ");
+ pg.getChildren().add(st);
+ st = new StaticText();
+ st.setEscape(false);
+ st.setText(m.getDescricao());
+ pg.getChildren().add(st);
+ gridRisco.getChildren().add(pg);
+
+ //postos trabalho
+ Vector posts = getPostosTrabalho(m.getId());
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setText(indent + indent + "Postos de trabalho afectados" + ": ");
+ pg.getChildren().add(st);
+ st = new StaticText();
+ st.setEscape(false);
+ String spostos = "";
+ for(int j = 0; j < posts.size(); j++)
+ {
+ PostoTrabalho p = posts.get(j);
+ spostos += p.getDescricao(); // + " ";
+ if(j < (posts.size() -1) )
+ {
+ spostos += "; ";
+ }
+ }
+ st.setText(spostos);
+ pg.getChildren().add(st);
+ gridRisco.getChildren().add(pg);
+ }
+ }
+
+ st = new StaticText();
+ st.setEscape(false);
+ st.setText(" ");
+ gridRisco.getChildren().add(st);
+
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setText("Responsável de execução:");
+ pg.getChildren().add(st);
+ txtResponsavelExecucao = new TextField();
+ txtResponsavelExecucao.setColumns(100);
+ pg.getChildren().add(txtResponsavelExecucao);
+ gridRisco.getChildren().add(pg);
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setText("Recursos necessários à implementação da medida:");
+ pg.getChildren().add(st);
+ gridRisco.getChildren().add(pg);
+ txtRecursos = new TextArea();
+ txtRecursos.setColumns(200);
+ gridRisco.getChildren().add(txtRecursos);
+
+ HtmlPanelGrid grd = new HtmlPanelGrid();
+ grd.setColumns(2);
+ grd.setColumnClasses("gridCol15, gridCol85");
+ grd.setId("pgDtInicio");
+ grd.setStyle("width: 100%");
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setText("Data prevista de início:");
+ grd.getChildren().add(st);
+ dtInicio = new Calendar();
+ grd.getChildren().add(dtInicio);
+ gridRisco.getChildren().add(grd);
+
+ grd = new HtmlPanelGrid();
+ grd.setColumns(2);
+ grd.setColumnClasses("gridCol15, gridCol85");
+ grd.setId("pgDtFim");
+ grd.setStyle("width: 100%");
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setText("Data prevista de conclusão:");
+ grd.getChildren().add(st);
+ dtFim = new Calendar();
+
+ grd.getChildren().add(dtFim);
+ gridRisco.getChildren().add(grd);
+
+ gridLayout.getChildren().add(gridRisco);
+
+ }
+
+ private void initializePlano()
+ {
+ getSessionBean1().setRiscosIdx(0);
+ //plano
+ plano = new PlanoActuacao();
+ plano.setId(new Integer(1));
+ plano.setEstabelecimento_id(new Integer(1));
+ plano.setEstado(new Integer(1));
+ getSessionBean1().setPlanoId(new Integer(1));
+ plano.setDescricao("Plano 1");
+
+ //riscos
+ Risco r = new Risco();
+ r.setId(new Integer(1));
+ r.setPlano_id(new Integer(1));
+ r.setDescricao("Risco A");
+ r.setValor(new Integer(4));
+ riscos.add(r);
+
+ r = new Risco();
+ r.setId(new Integer(2));
+ r.setPlano_id(new Integer(1));
+ r.setDescricao("Risco B");
+ r.setValor(new Integer(6));
+ riscos.add(r);
+
+ r = new Risco();
+ r.setId(new Integer(3));
+ r.setPlano_id(new Integer(1));
+ r.setDescricao("Risco C");
+ r.setValor(new Integer(12));
+ riscos.add(r);
+
+ //medidas
+ Medida m = new Medida();
+ m.setId(new Integer(1));
+ m.setRisco_id(new Integer(1));
+ m.setDescricao("Medida a");
+ medidas.add(m);
+
+ m = new Medida();
+ m.setId(new Integer(2));
+ m.setRisco_id(new Integer(1));
+ m.setDescricao("Medida b");
+ medidas.add(m);
+
+ m = new Medida();
+ m.setId(new Integer(3));
+ m.setRisco_id(new Integer(2));
+ m.setDescricao("Medida c");
+ medidas.add(m);
+
+ m = new Medida();
+ m.setId(new Integer(4));
+ m.setRisco_id(new Integer(2));
+ m.setDescricao("Medida d");
+ medidas.add(m);
+
+ m = new Medida();
+ m.setId(new Integer(5));
+ m.setRisco_id(new Integer(2));
+ m.setDescricao("Medida e");
+ medidas.add(m);
+
+ m = new Medida();
+ m.setId(new Integer(6));
+ m.setRisco_id(new Integer(3));
+ m.setDescricao("Medida f");
+ medidas.add(m);
+
+ m = new Medida();
+ m.setId(new Integer(7));
+ m.setRisco_id(new Integer(3));
+ m.setDescricao("Medida g");
+ medidas.add(m);
+
+ //postos trabalho
+ PostoTrabalho p = new PostoTrabalho();
+ p.setId(new Integer(1));
+ p.setMedida_id(new Integer(1));
+ p.setDescricao("posto 1");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(2));
+ p.setMedida_id(new Integer(1));
+ p.setDescricao("posto 2");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(3));
+ p.setMedida_id(new Integer(1));
+ p.setDescricao("posto 3");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(4));
+ p.setMedida_id(new Integer(2));
+ p.setDescricao("posto 4");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(5));
+ p.setMedida_id(new Integer(2));
+ p.setDescricao("posto 5");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(6));
+ p.setMedida_id(new Integer(3));
+ p.setDescricao("posto 6");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(7));
+ p.setMedida_id(new Integer(3));
+ p.setDescricao("posto 7");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(8));
+ p.setMedida_id(new Integer(4));
+ p.setDescricao("posto 8");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(9));
+ p.setMedida_id(new Integer(4));
+ p.setDescricao("posto 9");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(10));
+ p.setMedida_id(new Integer(5));
+ p.setDescricao("posto 10");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(11));
+ p.setMedida_id(new Integer(5));
+ p.setDescricao("posto 11");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(12));
+ p.setMedida_id(new Integer(6));
+ p.setDescricao("posto 12");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(13));
+ p.setMedida_id(new Integer(6));
+ p.setDescricao("posto 13");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(14));
+ p.setMedida_id(new Integer(7));
+ p.setDescricao("posto 14");
+ postos.add(p);
+
+ p = new PostoTrabalho();
+ p.setId(new Integer(15));
+ p.setMedida_id(new Integer(7));
+ p.setDescricao("posto 15");
+ postos.add(p);
+ getSessionBean1().setRiscos(riscos);
+ getSessionBean1().setMedidas(medidas);
+ getSessionBean1().setPostos(postos);
+ }
+
+ private Risco getNextRisco(Integer planoId)
+ {
+ System.out.println("GET NEXT RISCO");
+ System.out.println("RISCOS SIZE : " + riscos.size());
+ riscos = getSessionBean1().getRiscos();
+ risco_id = getSessionBean1().getRiscosIdx();
+ Risco r = riscos.get(risco_id);
+ if(r != null)
+ {
+ if(r.getPlano_id().intValue() != planoId.intValue())
+ {
+ r = null;
+ risco_id = 0;
+ }
+ }
+ risco_id++;
+ getSessionBean1().setRiscosIdx(risco_id);
+ return r;
+ }
+
+ private Vector getMedidas(Integer riscoId)
+ {
+ Vector meds = new Vector();
+ medidas = getSessionBean1().getMedidas();
+ for(int i = 0; i < medidas.size(); i++)
+ {
+ Medida m = medidas.get(i);
+ if(m.getRisco_id().intValue() == riscoId.intValue())
+ {
+ meds.add(m);
+ }
+ }
+ return meds;
+ }
+
+ private Vector getPostosTrabalho(Integer medidaId)
+ {
+ Vector posts = new Vector();
+ postos = getSessionBean1().getPostos();
+ for(int i = 0; i < postos.size(); i++)
+ {
+ PostoTrabalho p = postos.get(i);
+ if(p.getMedida_id().intValue() == medidaId.intValue())
+ {
+ posts.add(p);
+ }
+ }
+ return posts;
+ }
+
+ private void initialize()
+ {
+ gridPlano.setWidth("100%");
+ gridPlano.setColumns(1);
+ gridPlano.setColumnClasses("gridColCenter");
+ //plano
+ st = new StaticText();
+ st.setEscape(false);
+ st.setStyleClass("label");
+ st.setStyle("font-size: 16px");
+ st.setText(plano.getDescricao());
+ gridPlano.getChildren().add(st);
+
+ gridLayout.getChildren().add(gridPlano);
+ }
+
+ public String butGravarPlano_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ return null;
+ }
+
+ public String butGravarRisco_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ System.out.println("BUT NEXT RISCO");
+ Risco r = getNextRisco(getSessionBean1().getPlanoId());
+ fillRisco(r);
+ return null;
+ }
+
+ public String butEnviar_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ processEnviar();
+ return null;
+ }
+
+ private void processEnviar()
+ {
+
+ }
}
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/Footer.java b/trunk/PlanosActuacao/src/java/planosactuacao/Footer.java
new file mode 100644
index 00000000..9736bfc2
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/Footer.java
@@ -0,0 +1,139 @@
+/*
+ * Footer.java
+ *
+ * Created on Oct 6, 2008, 3:01:32 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 Footer 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 Footer() {
+ }
+
+ /**
+ * 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("Footer 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 ApplicationBean1 getApplicationBean1() {
+ return (ApplicationBean1) getBean("ApplicationBean1");
+ }
+
+ /**
+ * 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");
+ }
+
+}
+
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/Header.java b/trunk/PlanosActuacao/src/java/planosactuacao/Header.java
new file mode 100644
index 00000000..e9508a5b
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/Header.java
@@ -0,0 +1,170 @@
+/*
+ * Header.java
+ *
+ * Created on Oct 6, 2008, 10:35:36 AM
+ */
+
+package planosactuacao;
+
+import com.sun.rave.web.ui.appbase.AbstractFragmentBean;
+import db.entidades.Utilizador;
+import global.Global;
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import utils.JSFHTTPUtils;
+import utils.JSFUtils;
+
+/**
+ * Fragment bean that corresponds to a similarly named JSP page
+ * fragment. This class contains component definitions (and initialization
+ * code) for all components that you have defined on this fragment, as well as
+ * lifecycle methods and event handlers where you may add behavior
+ * to respond to incoming events.
+ *
+ * @author lluis
+ */
+public class Header extends AbstractFragmentBean {
+ //
+
+ /**
+ * 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 {
+ }
+ //
+
+ public Header() {
+ }
+
+ /**
+ * Callback method that is called whenever a page containing
+ * this page fragment is navigated to, either directly via a URL,
+ * or indirectly via page navigation. Override this method to acquire
+ * resources that will be needed for event handlers and lifecycle methods.
+ *
+ * The default implementation does nothing.
+ */
+ @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
+
+ FacesContext fc = getFacesContext();
+ String referer = JSFHTTPUtils.getReferer(fc);
+ System.out.println("HEADER - REFERER : " + referer);
+
+ //
+ // Initialize automatically managed components
+ // *Note* - this logic should NOT be modified
+ try {
+ _init();
+ } catch (Exception e) {
+ log("Page1 Initialization Failure", e);
+ throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
+ }
+
+ //
+ // Perform application initialization that must complete
+ // *after* managed components are initialized
+ // TODO - add your own initialization code here
+
+ }
+
+ /**
+ * Callback method that is called after rendering is completed for
+ * this request, if init() was called. Override this
+ * method to release resources acquired in the init()
+ * resources that will be needed for event handlers and lifecycle methods.
+ *
+ * The default implementation does nothing.
+ */
+ @Override
+ public void destroy() {
+ }
+
+ public String lnkLogout_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ FacesContext fc = getFacesContext();
+ try
+ {
+ JSFUtils.logout(fc);
+ //JSFUtils.navigateTo(fc, "login");
+ try
+ {
+ JSFUtils.redirect(fc, "http://localhost:8084/AnaliseAcidentesTrabalho/faces/Login.jsp");
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ }
+ catch(Exception ex)
+ {
+
+ }
+ return null;
+ }
+
+ public String lnkAnaliseAcidentes_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+
+ FacesContext fc = getFacesContext();
+ SessionBean1 session = JSFUtils.getSessionBean(fc);
+ Utilizador u = session.getCurrentUser();
+
+ String url = Global.ANALISE_ACIDENTES_URL;
+ int tipo = u.getTipo().intValue();
+ switch(tipo)
+ {
+ case Global.RESPONSAVEL_SEGURANCA:
+ url += "FormSeguranca.jsp?user=" + u.getId().intValue();
+ break;
+
+ case Global.RH:
+ url += "FormRH.jsp?user=" + u.getId().intValue();
+ break;
+
+ case Global.TECNICO_HS:
+ url += "FormHS.jsp?user=" + u.getId().intValue();
+ break;
+
+ case Global.GESTOR:
+ url += "FormGestor.jsp?user=" + u.getId().intValue();
+ break;
+
+ case Global.DIRECTOR_LOJA:
+ url += "FormGestor.jsp?user=" + u.getId().intValue();
+ break;
+ case Global.DIRECTOR_GERAL_RH:
+ url += "FormDirGerRh.jsp?user=" + u.getId().intValue();
+ break;
+
+ case Global.DIRECTOR_SIPRP:
+ url += "FormDirSiprp.jsp?user=" + u.getId().intValue();
+ break;
+
+ case Global.DIRECTOR_NACIONAL_SEGURANCA:
+ url += "FormGestor.jsp?user=" + u.getId().intValue();
+ break;
+ }
+
+ try
+ {
+ JSFUtils.redirect(fc.getCurrentInstance(), url);
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ return null;
+ }
+
+}
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java b/trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java
index dfa9499f..16ffb937 100644
--- a/trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/ListaPlanos.java
@@ -7,7 +7,16 @@
package planosactuacao;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
+import com.sun.webui.jsf.component.Table;
+import com.sun.webui.jsf.component.TableRowGroup;
+import db.entidades.PlanoActuacao;
+import db.providers.UtilizadoresDataProvider;
+import db.entidades.Utilizador;
+import java.util.ArrayList;
+import java.util.Calendar;
import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import utils.JSFUtils;
/**
* Page bean that corresponds to a similarly named JSP page. This
@@ -28,6 +37,42 @@ public class ListaPlanos extends AbstractPageBean {
*/
private void _init() throws Exception {
}
+ private Table table1 = new Table();
+
+ public Table getTable1() {
+ return table1;
+ }
+
+ public void setTable1(Table t) {
+ this.table1 = t;
+ }
+ private TableRowGroup tableRowGroup1 = new TableRowGroup();
+
+ public TableRowGroup getTableRowGroup1() {
+ return tableRowGroup1;
+ }
+
+ public void setTableRowGroup1(TableRowGroup trg) {
+ this.tableRowGroup1 = trg;
+ }
+ private TableRowGroup tableRowGroup2 = new TableRowGroup();
+
+ public TableRowGroup getTableRowGroup2() {
+ return tableRowGroup2;
+ }
+
+ public void setTableRowGroup2(TableRowGroup trg) {
+ this.tableRowGroup2 = trg;
+ }
+ private TableRowGroup tableRowGroup3 = new TableRowGroup();
+
+ public TableRowGroup getTableRowGroup3() {
+ return tableRowGroup3;
+ }
+
+ public void setTableRowGroup3(TableRowGroup trg) {
+ this.tableRowGroup3 = trg;
+ }
//
@@ -94,6 +139,37 @@ public class ListaPlanos extends AbstractPageBean {
*/
@Override
public void prerender() {
+ //UIComponent emptyCol = tableRowGroup1.getEmptyDataText();
+
+
+ tableRowGroup1.setEmptyDataMsg("Sem registos");
+ tableRowGroup2.setEmptyDataMsg("Sem registos");
+ tableRowGroup3.setEmptyDataMsg("Sem registos");
+
+ FacesContext fc = getFacesContext();
+ String user_id = JSFUtils.getRequestParameter(fc, "user");
+ try
+ {
+ Integer userId = new Integer(Integer.parseInt(user_id));
+
+ try
+ {
+ UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
+ udp.checkConnection();
+ Utilizador u = udp.getUtilizador(userId);
+ getSessionBean1().setCurrentUser(u);
+ }
+ catch(Exception ex1)
+ {
+ ex1.printStackTrace();
+ }
+ }
+ catch(Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ initialize();
}
/**
@@ -134,6 +210,82 @@ public class ListaPlanos extends AbstractPageBean {
protected SessionBean1 getSessionBean1() {
return (SessionBean1) getBean("SessionBean1");
}
+
+ public String hyperlink1_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ return "editar_plano";
+ }
+
+ public String goEditarPlano_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ return "editar_plano";
+ }
+
+ public String goImprimirPlano_action() {
+ // TODO: Process the action. Return value is a navigation
+ // case name where null will return to the same page.
+ return null;
+ }
+
+
+ private void initialize()
+ {
+ //Dummy : to remove later
+ ArrayList listActivos = new ArrayList();
+ PlanoActuacao pa = new PlanoActuacao();
+
+ Calendar cal = Calendar.getInstance();
+
+ cal.set( cal.YEAR, 2008 );
+ cal.set( cal.MONTH, cal.SEPTEMBER );
+ cal.set( cal.DATE, 3 );
+
+ cal.set( cal.HOUR_OF_DAY, 0 );
+ cal.set( cal.MINUTE, 0 );
+ cal.set( cal.SECOND, 0 );
+ cal.set( cal.MILLISECOND, 0 );
+
+ java.sql.Date dataVisita =
+ new java.sql.Date( cal.getTime().getTime() );
+
+ pa.setData_visita(dataVisita);
+ pa.setEstabelecimento_id(new Integer(12));
+ pa.setFase(2);
+ pa.setFase_nome("SIPRP (Emissão)");
+ pa.setLoja_nome("Setubal");
+ pa.setTecnico_hs_id(new Integer(7));
+ pa.setTecnico_hs_nome("Ana");
+ listActivos.add(pa);
+
+ pa = new PlanoActuacao();
+
+ cal.set( cal.YEAR, 2008 );
+ cal.set( cal.MONTH, cal.OCTOBER );
+ cal.set( cal.DATE, 12 );
+
+ cal.set( cal.HOUR_OF_DAY, 0 );
+ cal.set( cal.MINUTE, 0 );
+ cal.set( cal.SECOND, 0 );
+ cal.set( cal.MILLISECOND, 0 );
+
+ dataVisita =
+ new java.sql.Date( cal.getTime().getTime() );
+
+ pa.setData_visita(dataVisita);
+ pa.setEstabelecimento_id(new Integer(12));
+ pa.setFase(2);
+ pa.setFase_nome("DNS (Parecer)");
+ pa.setLoja_nome("Cascais");
+ pa.setTecnico_hs_id(new Integer(7));
+ pa.setTecnico_hs_nome("Sónia");
+ listActivos.add(pa);
+
+
+ getSessionBean1().getPlanosActualDataProvider().setList(listActivos);
+ //End Dummy
+ }
}
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java b/trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java
index 630ce50b..648d17b6 100644
--- a/trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/SessionBean1.java
@@ -7,6 +7,11 @@
package planosactuacao;
import com.sun.rave.web.ui.appbase.AbstractSessionBean;
+import db.entidades.Medida;
+import db.entidades.PostoTrabalho;
+import db.entidades.Risco;
+import db.entidades.Utilizador;
+import java.util.Vector;
import javax.faces.FacesException;
/**
@@ -23,7 +28,19 @@ import javax.faces.FacesException;
*/
public class SessionBean1 extends AbstractSessionBean {
+ private boolean loggedIn = false;
+ private Utilizador currentUser = null;
private String msg;
+
+ private Integer planoId;
+ private Vector riscos = new Vector();
+ private Vector medidas = new Vector();
+ private Vector postos = new Vector();
+ private int riscosIdx = 0;
+
+ private tabledataproviders.PlanosActualDataProvider planosActualDataProvider;
+ private tabledataproviders.PlanosSeguimentoDataProvider planosSeguimentoDataProvider;
+ private tabledataproviders.PlanosConcluidosDataProvider planosConcluidosDataProvider;
//
/**
@@ -34,12 +51,26 @@ public class SessionBean1 extends AbstractSessionBean {
private void _init() throws Exception {
}
//
+
+ //menu
+ private boolean disableMenu;
+ private boolean disableMenuAnalises;
+ private boolean disableMenuPlanos;
+ private boolean disableMenuUtilizadores;
+ private boolean disableMenuDadosUtilizador;
+
/**
* Construct a new session data bean instance.
*/
public SessionBean1() {
msg = "";
+
+ planosActualDataProvider = new tabledataproviders.PlanosActualDataProvider();
+ planosSeguimentoDataProvider = new tabledataproviders.PlanosSeguimentoDataProvider();
+ planosConcluidosDataProvider = new tabledataproviders.PlanosConcluidosDataProvider();
+ planoId = null;
+
}
/**
@@ -133,4 +164,128 @@ public class SessionBean1 extends AbstractSessionBean {
this.msg = msg;
}
+ public boolean isLoggedIn() {
+ return loggedIn;
+ }
+
+ public void setLoggedIn(boolean loggedIn) {
+ this.loggedIn = loggedIn;
+ }
+
+ public tabledataproviders.PlanosActualDataProvider getPlanosActualDataProvider() {
+ return planosActualDataProvider;
+ }
+
+ public void setPlanosActualDataProvider(tabledataproviders.PlanosActualDataProvider planosActualDataProvider) {
+ this.planosActualDataProvider = planosActualDataProvider;
+ }
+
+ public tabledataproviders.PlanosSeguimentoDataProvider getPlanosSeguimentoDataProvider() {
+ return planosSeguimentoDataProvider;
+ }
+
+ public void setPlanosSeguimentoDataProvider(tabledataproviders.PlanosSeguimentoDataProvider planosSeguimentoDataProvider) {
+ this.planosSeguimentoDataProvider = planosSeguimentoDataProvider;
+ }
+
+ public tabledataproviders.PlanosConcluidosDataProvider getPlanosConcluidosDataProvider() {
+ return planosConcluidosDataProvider;
+ }
+
+ public void setPlanosConcluidosDataProvider(tabledataproviders.PlanosConcluidosDataProvider planosConcluidosDataProvider) {
+ this.planosConcluidosDataProvider = planosConcluidosDataProvider;
+ }
+
+ public Integer getPlanoId() {
+ return planoId;
+ }
+
+ public void setPlanoId(Integer planoId) {
+ this.planoId = planoId;
+ }
+
+ public Vector getRiscos() {
+ return riscos;
+ }
+
+ public void setRiscos(Vector riscos) {
+ this.riscos = riscos;
+ }
+
+ public Vector getMedidas() {
+ return medidas;
+ }
+
+ public void setMedidas(Vector medidas) {
+ this.medidas = medidas;
+ }
+
+ public Vector getPostos() {
+ return postos;
+ }
+
+ public void setPostos(Vector postos) {
+ this.postos = postos;
+ }
+
+ public int getRiscosIdx() {
+ return riscosIdx;
+ }
+
+ public void setRiscosIdx(int riscosIdx) {
+ this.riscosIdx = riscosIdx;
+ }
+
+ public Utilizador getCurrentUser() {
+ return currentUser;
+ }
+
+ public void setCurrentUser(Utilizador currentUser) {
+ this.currentUser = currentUser;
+ }
+
+ public boolean isDisableMenu() {
+ return disableMenu;
+ }
+
+ public void setDisableMenu(boolean disableMenu) {
+ setDisableMenuAnalises(disableMenu);
+ setDisableMenuPlanos(disableMenu);
+ setDisableMenuUtilizadores(disableMenu);
+ setDisableMenuDadosUtilizador(disableMenu);
+ this.disableMenu = disableMenu;
+ }
+
+ public boolean isDisableMenuAnalises() {
+ return disableMenuAnalises;
+ }
+
+ public void setDisableMenuAnalises(boolean disableMenuAnalises) {
+ this.disableMenuAnalises = disableMenuAnalises;
+ }
+
+ public boolean isDisableMenuPlanos() {
+ return disableMenuPlanos;
+ }
+
+ public void setDisableMenuPlanos(boolean disableMenuPlanos) {
+ this.disableMenuPlanos = disableMenuPlanos;
+ }
+
+ public boolean isDisableMenuUtilizadores() {
+ return disableMenuUtilizadores;
+ }
+
+ public void setDisableMenuUtilizadores(boolean disableMenuUtilizadores) {
+ this.disableMenuUtilizadores = disableMenuUtilizadores;
+ }
+
+ public boolean isDisableMenuDadosUtilizador() {
+ return disableMenuDadosUtilizador;
+ }
+
+ public void setDisableMenuDadosUtilizador(boolean disableMenuDadosUtilizador) {
+ this.disableMenuDadosUtilizador = disableMenuDadosUtilizador;
+ }
+
}
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/ViewPlano.java b/trunk/PlanosActuacao/src/java/planosactuacao/ViewPlano.java
new file mode 100644
index 00000000..69eb4c8f
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/ViewPlano.java
@@ -0,0 +1,139 @@
+/*
+ * ViewPlano.java
+ *
+ * Created on Oct 20, 2008, 10:39:31 AM
+ */
+
+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 ViewPlano 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 ViewPlano() {
+ }
+
+ /**
+ * 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("ViewPlano 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 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");
+ }
+
+ /**
+ * Return a reference to the scoped data bean.
+ *
+ * @return reference to the scoped data bean
+ */
+ protected RequestBean1 getRequestBean1() {
+ return (RequestBean1) getBean("RequestBean1");
+ }
+
+}
+
diff --git a/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosActualDataProvider.java b/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosActualDataProvider.java
new file mode 100644
index 00000000..da83da58
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosActualDataProvider.java
@@ -0,0 +1,18 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package tabledataproviders;
+
+import com.sun.data.provider.impl.ObjectListDataProvider;
+
+/**
+ *
+ * @author lluis
+ */
+public class PlanosActualDataProvider extends ObjectListDataProvider {
+ public PlanosActualDataProvider(){
+
+ }
+}
diff --git a/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosConcluidosDataProvider.java b/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosConcluidosDataProvider.java
new file mode 100644
index 00000000..2b6e511e
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosConcluidosDataProvider.java
@@ -0,0 +1,18 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package tabledataproviders;
+
+import com.sun.data.provider.impl.ObjectListDataProvider;
+
+/**
+ *
+ * @author lluis
+ */
+public class PlanosConcluidosDataProvider extends ObjectListDataProvider {
+ public PlanosConcluidosDataProvider(){
+
+ }
+}
diff --git a/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosSeguimentoDataProvider.java b/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosSeguimentoDataProvider.java
new file mode 100644
index 00000000..2615d17d
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/tabledataproviders/PlanosSeguimentoDataProvider.java
@@ -0,0 +1,18 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package tabledataproviders;
+
+import com.sun.data.provider.impl.ObjectListDataProvider;
+
+/**
+ *
+ * @author lluis
+ */
+public class PlanosSeguimentoDataProvider extends ObjectListDataProvider {
+ public PlanosSeguimentoDataProvider(){
+
+ }
+}
diff --git a/trunk/PlanosActuacao/src/java/utils/JSFHTTPUtils.java b/trunk/PlanosActuacao/src/java/utils/JSFHTTPUtils.java
new file mode 100644
index 00000000..51d05a2b
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/utils/JSFHTTPUtils.java
@@ -0,0 +1,23 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package utils;
+
+import java.util.Map;
+import javax.faces.context.FacesContext;
+
+/**
+ *
+ * @author lluis
+ */
+public class JSFHTTPUtils {
+
+ public static String getReferer(FacesContext context)
+ {
+ Map headerMap = context.getCurrentInstance().getExternalContext().getRequestHeaderMap();
+ String referer = (String) headerMap.get("referer");
+ return referer;
+ }
+}
diff --git a/trunk/PlanosActuacao/src/java/utils/JSFUtils.java b/trunk/PlanosActuacao/src/java/utils/JSFUtils.java
new file mode 100644
index 00000000..7f1bead4
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/utils/JSFUtils.java
@@ -0,0 +1,103 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package utils;
+
+import java.util.Iterator;
+import java.util.Map;
+import javax.faces.application.Application;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.render.ResponseStateManager;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import planosactuacao.SessionBean1;
+
+/**
+ *
+ * @author lluis
+ */
+public class JSFUtils {
+
+
+ public static SessionBean1 getSessionBean(FacesContext fc)
+ {
+ FacesContext context = fc.getCurrentInstance();
+ SessionBean1 session = (SessionBean1) context.getApplication().getELResolver().getValue(context.getELContext(), null, "SessionBean1");
+ return session;
+ }
+
+ //
+ // isPostBack - JSF 1.1 implementation
+ //
+ public static boolean isPostBack(FacesContext fc)
+ {
+ Map parameterMap = fc.getExternalContext().getRequestParameterMap();
+
+ if(parameterMap.size() > 0)
+ {
+ Iterator iter = parameterMap.keySet().iterator();
+ while(iter.hasNext())
+ {
+ String par = (String) iter.next();
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean isPostback() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Map requestScope = (Map) facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{requestScope}", Map.class).getValue(facesContext.getELContext());
+ //Map requestScope = (Map)facesContext.getApplication().createValueBinding(?#{requestScope}?).getValue(facesContext);
+ boolean ispostback = ((Boolean)requestScope.get("ispostback")).booleanValue();
+ System.out.println("POSTBACK A : " + ispostback);
+ return ispostback;
+ }
+
+ //
+ // isPostBack - JSF 1.2 implementation
+ //
+ public static boolean isPostBack12(FacesContext fc)
+ {
+ ResponseStateManager rsm = fc.getRenderKit().getResponseStateManager();
+ if(rsm.isPostback(fc))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public static void logout(FacesContext fc) throws Exception
+ {
+ ExternalContext ectx = fc.getCurrentInstance().getExternalContext();
+ HttpSession session = (HttpSession) ectx.getSession(false);
+ session.invalidate();
+ }
+
+ public static void navigateTo(FacesContext fc, String outcome)
+ {
+ FacesContext context = fc.getCurrentInstance();
+ Application app = context.getApplication();
+ app.getNavigationHandler().handleNavigation(context, null, outcome);
+ }
+
+ public static void redirect(FacesContext context, String url) throws Exception
+ {
+ HttpServletResponse response = (HttpServletResponse) context.getCurrentInstance().getExternalContext().getResponse();
+ response.sendRedirect(url);
+ context.responseComplete();
+ }
+
+ public static String getRequestParameter(FacesContext fc, String parameter)
+ {
+ Map parameters = fc.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ return (String) parameters.get(parameter);
+ }
+
+
+
+
+}
diff --git a/trunk/PlanosActuacao/src/java/viewhandler/CustomViewHandler.java b/trunk/PlanosActuacao/src/java/viewhandler/CustomViewHandler.java
new file mode 100644
index 00000000..83199b57
--- /dev/null
+++ b/trunk/PlanosActuacao/src/java/viewhandler/CustomViewHandler.java
@@ -0,0 +1,75 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package viewhandler;
+
+import java.io.IOException;
+import java.util.Locale;
+import java.util.Map;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+/**
+ *
+ * @author lluis
+ */
+public class CustomViewHandler extends ViewHandler{
+ protected ViewHandler baseViewHandler;
+
+ public CustomViewHandler(ViewHandler viewHandler) {
+ super();
+ this.baseViewHandler = viewHandler;
+ }
+
+ public Locale calculateLocale(FacesContext facesContext) {
+ return baseViewHandler.calculateLocale(facesContext);
+ }
+
+ public String calculateRenderKitId(FacesContext facesContext) {
+ return baseViewHandler.calculateRenderKitId(facesContext);
+ }
+
+ public UIViewRoot createView(FacesContext facesContext, String arg1) {
+ setPostback(facesContext, false);
+ return baseViewHandler.createView(facesContext, arg1);
+ }
+
+ public String getActionURL(FacesContext facesContext, String arg1) {
+ return baseViewHandler.getActionURL(facesContext, arg1);
+ }
+
+ public String getResourceURL(FacesContext facesContext, String arg1) {
+ return baseViewHandler.getResourceURL(facesContext, arg1);
+ }
+
+ public void renderView(FacesContext facesContext, UIViewRoot arg1) throws IOException, FacesException {
+ baseViewHandler.renderView(facesContext, arg1);
+
+ }
+
+ public UIViewRoot restoreView(FacesContext facesContext, String arg1) {
+ setPostback(facesContext, true);
+ return baseViewHandler.restoreView(facesContext, arg1);
+ }
+
+ public void writeState(FacesContext facesContext) throws IOException {
+ baseViewHandler.writeState(facesContext);
+ }
+
+ public Map getRequestScope(FacesContext facesContext) {
+ //return (Map)facesContext.getApplication().createValueBinding(?#{requestScope}?).getValue(facesContext);
+ //return (Map)facesContext.getApplication().
+ return (Map) facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{requestScope}", Map.class).getValue(facesContext.getELContext());
+ }
+
+ public void setPostback(FacesContext facesContext, boolean value) {
+ getRequestScope(facesContext).put("ispostback", new Boolean(value));
+ }
+
+
+}
diff --git a/trunk/PlanosActuacao/web/Dummy.jsp b/trunk/PlanosActuacao/web/Dummy.jsp
new file mode 100644
index 00000000..41525ed3
--- /dev/null
+++ b/trunk/PlanosActuacao/web/Dummy.jsp
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/trunk/PlanosActuacao/web/EditarPlano.jsp b/trunk/PlanosActuacao/web/EditarPlano.jsp
index 9795fdf5..33988af5 100644
--- a/trunk/PlanosActuacao/web/EditarPlano.jsp
+++ b/trunk/PlanosActuacao/web/EditarPlano.jsp
@@ -4,7 +4,6 @@
Created on : Aug 26, 2008, 3:10:59 PM
Author : lluis
-->
-
@@ -12,9 +11,37 @@
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/trunk/PlanosActuacao/web/Footer.jsp b/trunk/PlanosActuacao/web/Footer.jsp
new file mode 100644
index 00000000..9e3306f5
--- /dev/null
+++ b/trunk/PlanosActuacao/web/Footer.jsp
@@ -0,0 +1,29 @@
+
+
+
+
+
+
diff --git a/trunk/PlanosActuacao/web/Header.jspf b/trunk/PlanosActuacao/web/Header.jspf
new file mode 100644
index 00000000..cc9577c2
--- /dev/null
+++ b/trunk/PlanosActuacao/web/Header.jspf
@@ -0,0 +1,38 @@
+
+
+
+
+
diff --git a/trunk/PlanosActuacao/web/ListaPlanos.jsp b/trunk/PlanosActuacao/web/ListaPlanos.jsp
index 3af72684..c78ed8cc 100644
--- a/trunk/PlanosActuacao/web/ListaPlanos.jsp
+++ b/trunk/PlanosActuacao/web/ListaPlanos.jsp
@@ -4,17 +4,131 @@
Created on : Aug 29, 2008, 2:57:16 PM
Author : lluis
-->
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/trunk/PlanosActuacao/web/ViewPlano.jsp b/trunk/PlanosActuacao/web/ViewPlano.jsp
new file mode 100644
index 00000000..30f1edd1
--- /dev/null
+++ b/trunk/PlanosActuacao/web/ViewPlano.jsp
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/trunk/PlanosActuacao/web/WEB-INF/faces-config.xml b/trunk/PlanosActuacao/web/WEB-INF/faces-config.xml
index 8c2a53f6..395a6561 100644
--- a/trunk/PlanosActuacao/web/WEB-INF/faces-config.xml
+++ b/trunk/PlanosActuacao/web/WEB-INF/faces-config.xml
@@ -6,6 +6,15 @@
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">
+
+ viewhandler.CustomViewHandler
+
+ pt
+
+
+
+ phaselistener.MainPhaseListener
+
SessionBean1
planosactuacao.SessionBean1
@@ -48,4 +57,38 @@
/ListaPlanos.jsp
+
+ /ListaPlanos.jsp
+
+ editar_plano
+ /EditarPlano.jsp
+
+
+
+ /EditarPlano.jsp
+
+ lista_planos
+ /ListaPlanos.jsp
+
+
+
+ Header
+ planosactuacao.Header
+ request
+
+
+ Dummy
+ planosactuacao.Dummy
+ request
+
+
+ Footer
+ planosactuacao.Footer
+ request
+
+
+ ViewPlano
+ planosactuacao.ViewPlano
+ request
+
diff --git a/trunk/PlanosActuacao/web/WEB-INF/web.xml b/trunk/PlanosActuacao/web/WEB-INF/web.xml
index 3ca2889e..8fbdd8e4 100644
--- a/trunk/PlanosActuacao/web/WEB-INF/web.xml
+++ b/trunk/PlanosActuacao/web/WEB-INF/web.xml
@@ -73,7 +73,7 @@
- faces/Login.jsp
+ faces/Dummy.jsp
javax.servlet.ServletException
diff --git a/trunk/PlanosActuacao/web/resources/images/SIPRP_logo_small.jpg b/trunk/PlanosActuacao/web/resources/images/SIPRP_logo_small.jpg
new file mode 100755
index 00000000..240f2358
Binary files /dev/null and b/trunk/PlanosActuacao/web/resources/images/SIPRP_logo_small.jpg differ
diff --git a/trunk/PlanosActuacao/web/resources/images/logo_auchan_small.jpg b/trunk/PlanosActuacao/web/resources/images/logo_auchan_small.jpg
new file mode 100755
index 00000000..376eee0e
Binary files /dev/null and b/trunk/PlanosActuacao/web/resources/images/logo_auchan_small.jpg differ
diff --git a/trunk/PlanosActuacao/web/resources/images/logo_evolute_small.png b/trunk/PlanosActuacao/web/resources/images/logo_evolute_small.png
new file mode 100644
index 00000000..0198da2b
Binary files /dev/null and b/trunk/PlanosActuacao/web/resources/images/logo_evolute_small.png differ
diff --git a/trunk/PlanosActuacao/web/resources/stylesheet.css b/trunk/PlanosActuacao/web/resources/stylesheet.css
index 4b72c958..839c5fdc 100644
--- a/trunk/PlanosActuacao/web/resources/stylesheet.css
+++ b/trunk/PlanosActuacao/web/resources/stylesheet.css
@@ -5,6 +5,8 @@
/* Style rules to make Java Server faces Standarad data tables look better */
+body {background-color: #f8f8f0;}
+
.list-header {
background-color: #eeeeee;
font-size: larger;
@@ -56,7 +58,42 @@
text-align: right;
}
+.gridCol10{
+ width: 10%;
+}
+.gridCol15{
+ width: 15%;
+}
+.gridCol20{
+ width: 20%;
+}
+.gridCol30{
+ width: 30%;
+}
+.gridCol70{
+ width: 70%;
+}
+.gridCol80{
+ width: 80%;
+}
+.gridCol85{
+ width: 85%;
+}
+.gridCol90{
+ width: 90%;
+}
+
+.gridPlanosList{
+ background-color: #f6f4e8;
+ border: solid 1px #000000;
+}
+
/* Style rules for message severity levels */
+.labelMsg{
+ font-weight : bold;
+ color: #cc0033;
+ font-size :14px ;
+}
.infoMessage {
font-size : 13px;