1 2 Previous Next 20 Replies Latest reply on Dec 4, 2012 10:12 AM by luisaggo Go to original post
      • 15. Re: Problem migrating from Richfaces 3.3.3 to Richfaces 4
        henrycoraluriarte

        puedes pegar el codigo de toda la pagina jsp o xhtml o la que uses

        • 16. Re: Problem migrating from Richfaces 3.3.3 to Richfaces 4
          luisaggo

          Yes.

           

          My first view is for the authentication (IndexProgram.xhtml)...

           

           

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


          <html xmlns="http://www.w3.org/1999/xhtml"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:h="http://java.sun.com/jsf/html"

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:p="http://primefaces.org/ui"

          xmlns:a4j="http://richfaces.org/a4j"

          xmlns:rich="http://richfaces.org/rich">

          <!-- Todas las paginas deben tener esta linea para que las tildes funcionen -->

          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

          <f:loadBundle basename="co.com.gesiti.acreditacion.properties.program"

          var="msg" />

          <h:body>

          <ui:composition template="/template/common.xhtml">

          <ui:define name="body">

          <script src="resources/scripts/jquery.metadata.js"

          type="text/javascript"></script>

          <script type="text/javascript">

          jQuery(document).ready( function() {

          //$("#mainForm:username").focus();

          jQuery("input:text:first").focus();

          });

          </script>

          <h:form>

          <h:panelGroup rendered="#{currentUser.tipoUsuario == null}">

          <table width="100%" align="center" border="0" cellspacing="0"

          cellpadding="0">

          <tr>

          <td class="titulosolo" align="right"><br />

          <h:outputText styleClass="titulosolo" value="Inicio Sesión">

          </h:outputText></td>

          </tr>

          </table>

          <br />

           

          <table width="50%" align="center" border="0" cellspacing="0"

          cellpadding="0" class="tablamultiregistro">

          <tr class="tablamultiregistrotr2">

          <td align="right"><h:outputText value="Nombre de Usuario: " />

          </td>

          <td align="left"><h:inputText

          id="username" value="#{InicioSesion_1.username}"  />

          <h:panelGroup id="ErrorUsernamePanel"

          style="color:red; font-weight:bold">

          <h:message for="username" />

          </h:panelGroup></td>

          </tr>

          <tr class="tablamultiregistrotr1">

          <td align="right"><h:outputText value="Contraseña: " /> </td>

          <td align="left">

          <h:inputSecret id="password" redisplay="true" value="#{InicioSesion_1.password}"

          /> <h:panelGroup id="ErrorPasswordPanel"

          style="color:red; font-weight:bold">

          <h:message for="password" />

          </h:panelGroup></td>

          </tr>



          <tr class="tablamultiregistrotr2">

          <td align="center" colspan="2">

          <a4j:outputPanel id="idProcesoSelect"

          rendered="#{InicioSesion_1.activarProceso}" ajaxRendered="true">

           

          <h:selectOneMenu value="#{InicioSesion_1.idProceso}"

          id="txtProceso">

          <f:selectItems value="#{InicioSesion_1.procesosSelect}" />

          <f:ajax event="change"

          actionListener="#{InicioSesion_1.validateProcesos}"

          ajaxSingle="true" />

          </h:selectOneMenu>

          </a4j:outputPanel>

          </td>

          </tr>



          <tr class="tablamultiregistrotr2">

          <td align="center" colspan="2">

          <h:panelGroup id="errorSummary"

          style="color:red; font-weight:bold">

          <h:outputText value="#{InicioSesion_1.errorSummary}" />

          <br />

          </h:panelGroup>

          <p:commandButton value="Aceptar1" action="#{InicioSesion_1.consultarProcesos}" type="submit"

          ajax="false"

          update="ErrorUsernamePanel,ErrorPasswordPanel,errorSummary,idProcesoSelect" />

           

          <a4j:commandButton type="submit" value="Aceptar"

          action="#{InicioSesion_1.consultarProcesos}"

          styleClass="submit"

          render="ErrorUsernamePanel,ErrorPasswordPanel,errorSummary,idProcesoSelect"

          onclick="this.disabled= true;" oncomplete="this.disabled = false;">

          </a4j:commandButton>

          </td>

          </tr>

           

          <tr class="tablamultiregistrotr2">

          <td align="center" colspan="2">

          <br/>

          <br/>

          <a4j:commandLink value="Recuperar Contraseña" id="link"     action="#{InicioSesion_1.recuperarClave}" />

          </td>

          </tr>

          </table>

           

          </h:panelGroup>

          </h:form>

          </ui:define>

          </ui:composition>

          </h:body>


          </html>

           

          The second is a template that the last view has as the composition (common.xhtml):

           

           

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


          <html xmlns="http://www.w3.org/1999/xhtml"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:h="http://java.sun.com/jsf/html"

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:a4j="http://richfaces.org/a4j"

          xmlns:rich="http://richfaces.org/rich">

          <!-- Todas las paginas deben tener esta linea para que las tildes funcionen -->

          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

          <f:view>

          <f:loadBundle basename="co.com.gesiti.acreditacion.properties.program"

          var="msg" />

          <h:head> 

                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

          <title>Proceso Autoevaluación</title>

          <link href="/#{msg.contexto_app}/resources/stylesheet.css" rel="stylesheet"  type="text/css" />

          <link href="/#{msg.contexto_app}/resources/css/program.css" rel="stylesheet" type="text/css" />

          <!--

          <script type="text/javascript" src="js/header/AC_RunActiveContent.js"></script>

          -->

          <!--<script type="text/javascript" src="js/funciones.js"></script>

          -->

          <script type="text/javascript" src="/#{msg.contexto_app}/resources/scripts/funciones.js"></script>

          <script type="text/javascript" src="/#{msg.contexto_app}/resources/scripts/commons.js"></script><!--

          -->

           

              <script type="text/javascript">

          jQuery.noConflict();

          </script>

          </h:head>

          <h:body>

          <div id="container" class="container">

          <h:form id="mainForm" ajaxSubmit="true">

          <a href="/#{msg.contexto_app}"> <img

          src="/#{msg.contexto_app}/resources/imagenes/bannerSIAA.jpg"

          width="1100" height="99" border="0" /> </a>

          <table cellpadding="0" cellspacing="0">

          <tr>

          <td width="100%">

          <rich:toolbar rendered="#{currentUser.tipoUsuario != null}"

          itemSeparator="grid">

          <rich:dropDownMenu rendered="#{not sessionScope.hasPriv['superAdministrador']}">

          <f:facet name="label">

          <h:panelGroup>

          <h:outputText value="#{msg.menu_model_label}" />

          </h:panelGroup>

          </f:facet>

          <rich:menuItem submitMode="ajax" value="Heredar Modelo"

          action="#{menuBean.inheritanceModelAction}"

          rendered="#{sessionScope.hasPriv['modificarModelo'] and currentUser.permiso != 'Asignado'}">

          </rich:menuItem>

          <rich:menuItem

          onclick="if(!confirm('#{msg.edit_reset_text}')){ return; };"

          submitMode="ajax" value="#{msg.menu_edit_model}"

          action="#{menuBean.editModelAction}" rendered="false" />

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_fuentes_label}"

          action="#{menuBean.manageFuentes}"

          rendered="#{sessionScope.hasPriv['administrarGeneral']}">

          </rich:menuItem>

           

          <rich:menuItem submitMode="ajax" value="Nivel de ponderación"

          action="#{menuBean.configNivelPonderacion}"

          rendered="#{sessionScope.hasPriv['modificarModelo']}">

          </rich:menuItem>

           

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_view_model}"

          action="#{menuBean.showModelAction}" rendered="false" />

           

          <rich:menuItem submitMode="ajax" value="Evaluador"

          action="#{menuBean.evaluador}" />

           

          <rich:menuItem submitMode="ajax" value="Ver Modelo"

          action="#{menuBean.nuevaVistaModeloAction}"

          rendered="#{sessionScope.hasPriv['modificarModelo'] and not sessionScope.hasPriv['administrarGeneral']}" />

           

          <rich:menuItem submitMode="ajax" value="Ver Modelo (Ejemplo)"

          action="#{menuBean.nuevaVistaModeloActionEjemplo}"

          rendered="#{sessionScope.hasPriv['modificarModelo'] and not sessionScope.hasPriv['administrarGeneral']}" />

           

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_score_scale_text}"

          action="#{menuBean.scoreTypeAction}" />


          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_ponderar_label} OLD"

          action="#{menuBean.ponderationModelAction}" rendered="false">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_ponderar_label}"

          action="#{menuBean.ponderationNewModelAction}"

          rendered="false">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_ponderar_label}"

          action="#{menuBean.ponderarModeloAcademicoAction}"

          rendered="#{sessionScope.hasPriv['modificarModelo']}">

          </rich:menuItem>

           

          <!--rich:menuItem submitMode="ajax"

          rendered="#{sessionScope.hasPriv['administrarPrograma']}"

          value="#{msg.menu_ponderacion1_label}"

          action="#{menuBean.reportPondetarionAction}">

          </rich:menuItem-->


          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_calificar_label}"

          action="#{menuBean.scoreModelAction}"

          onclick="alert('#{msg.ponderation_alert_text}');"

          rendered="false">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_calificar_label}"

          action="#{menuBean.calificarModeloAcademicoAction}"

          onclick="alert('#{msg.ponderation_alert_text}');"

          rendered="#{sessionScope.hasPriv['administrarPrograma']}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          rendered="#{sessionScope.hasPriv['administrarGeneral']}"

          value="Administrar Modelos Generales"

          action="#{menuBean.gestionarModelosGenerales}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          rendered="#{sessionScope.hasPriv['consultarProgramas']}"

          value="#{msg.menu_general_report}"

          action="#{menuBean.generalReportAction}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          rendered="#{currentUser.tipoUsuario == 'FAC'}"

          value="#{msg.menu_score_report}"

          action="#{menuBean.reportAction}">

          </rich:menuItem>

          <!--

          <rich:menuItem submitMode="none"

          rendered="#{sessionScope.hasPriv['administrarPrograma']}">

          <h:outputLink value="#{menuBean.reportWordURL}">

          <f:verbatim>Informe de Calificacion</f:verbatim>

          </h:outputLink>

          </rich:menuItem>

          -->

          <rich:menuItem submitMode="ajax"

          value="#{msg.general_cargar_archivo}"

          action="#{menuBean.cargarArchivo}"

          rendered="#{sessionScope.hasPriv['modificarModelo']}">

          </rich:menuItem>

          <rich:menuItem submitMode="none"

          rendered="#{menuBean.tieneArchivo and sessionScope.hasPriv['modificarModelo']}">

          <h:outputLink value="#{menuBean.descargaArchivo}">

          <f:verbatim>Descargar archivo</f:verbatim>

          </h:outputLink>

          </rich:menuItem>

           

           

          </rich:dropDownMenu>


          <rich:dropDownMenu rendered="#{not sessionScope.hasPriv['superAdministrador']}">

          <f:facet name="label">

          <h:panelGroup>

          <h:outputText value="Encuestas" />

          </h:panelGroup>

          </f:facet>


          <rich:menuItem submitMode="ajax" value="Heredar Encuestas"

          action="#{menuBean.heredarEncuestas}"

          rendered="#{sessionScope.hasPriv['administrarPrograma'] or sessionScope.hasPriv['administrarGeneral']}" />


          <rich:menuItem submitMode="ajax" value="Generar Encuestas"

          rendered="#{sessionScope.hasPriv['modificarModelo']}"

          action="#{menuBean.admonEncuestas}" />


          <!--

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_fuentes_label}"

          rendered="#{sessionScope.hasPriv['administrarGeneral']}"

          action="#{menuBean.manageFuentes}">

          </rich:menuItem>

          -->

           

          <rich:menuItem submitMode="ajax" value="Informes Encuestas"

          action="#{menuBean.informesEncuestas}" />


          </rich:dropDownMenu>


          <rich:dropDownMenu rendered="#{not sessionScope.hasPriv['superAdministrador']}">

          <f:facet name="label">

          <h:panelGroup >

          <h:outputText value="Mejoramiento" />

          </h:panelGroup>

          </f:facet>


           

          <rich:menuItem submitMode="ajax"

          value="Generar Plan "

          action="#{menuBean.mejoramientoAction}"

          rendered="#{sessionScope.hasPriv['administrarPrograma']}">

          </rich:menuItem>

           

          <rich:menuItem submitMode="ajax" value="Informe Plan"

          action="#{menuBean.informePlan}"

          rendered="#{sessionScope.hasPriv['administrarPrograma']}" />

           

           

          <rich:menuItem submitMode="ajax" value="Planes de Mejoramiento"

          action="#{menuBean.informePlanes}"

          rendered="#{sessionScope.hasPriv['administrarGeneral']}" />


           

           

          <!--

          <rich:menuItem submitMode="ajax" value="Administrar Plan"

          action="#{menuBean.admonPlan}"

          rendered="#{sessionScope.hasPriv['administrarGeneral']}" />


          -->

           

          </rich:dropDownMenu>

           

          <rich:dropDownMenu

          rendered="#{sessionScope.hasPriv['superAdministrador']}">

          <f:facet name="label">

          <h:panelGroup>

          <h:outputText value="#{msg.menu_superAdmin_label}" />

          </h:panelGroup>

          </f:facet>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_crear_proceso_label}"

          action="#{menuBean.crearProceso}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_listar_procesos_label}"

          action="#{menuBean.listarProcesos}">

          </rich:menuItem>

          </rich:dropDownMenu>

           

          <rich:dropDownMenu

          rendered="#{sessionScope.hasPriv['administrarGeneral'] or sessionScope.hasPriv['superAdministrador']}">

          <f:facet name="label">

          <h:panelGroup>

          <h:outputText value="#{msg.menu_admin_label}" />

          </h:panelGroup>

          </f:facet>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_users_label}"

          action="#{menuBean.manageUsers}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_instrumentos_label}"

          action="#{menuBean.manageInstrumentos}"

          rendered="#{sessionScope.hasPriv['superAdministrador']}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          rendered="#{sessionScope.hasPriv['superAdministrador']}"

          value="Administrar Modelos Generales"

          action="#{menuBean.gestionarModelosGenerales}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_sedes_label}"

          action="#{menuBean.admonSedes}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_facultades_label}"

          action="#{menuBean.admonFacultades}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_departamentos_label}"

          action="#{menuBean.admonDepartamentos}">

          </rich:menuItem>

          <rich:menuItem submitMode="ajax"

          value="#{msg.menu_admin_programas_label}"

          action="#{menuBean.admonProgramas}">

          </rich:menuItem>

          </rich:dropDownMenu>


          <rich:dropDownMenu>

          <f:facet name="label">

          <h:panelGroup>

          <h:outputText value="Tutorial" />

          </h:panelGroup>

          </f:facet>

          <rich:menuItem submitMode="none">

          <h:outputLink value="http://siaa.ucc.edu.co/TutorialAA/">

          <f:verbatim>Ver tutorial</f:verbatim>

          </h:outputLink>

          </rich:menuItem>

          <!--

          <rich:menuItem submitMode="none">

          <h:outputLink value="#{msg.url_tutorial}">

          <f:verbatim>Ver tutorial</f:verbatim>

          </h:outputLink>

          </rich:menuItem>

          -->

          <rich:menuItem submitMode="none">

          <h:outputLink

          value="/ProcesoAcreditacion/auxFiles/ManualdeUsuarioSIAA.pdf"

          target="_blank">

          <f:verbatim>Manual de usuario</f:verbatim>

          </h:outputLink>

          </rich:menuItem>

           

           

          <rich:menuItem submitMode="ajax" value="Ayuda"

          actionListener="#{menuBean.ayuda}"

          target="_blank" 

          immediate="true"

          oncomplete="javascript:window.open('#{request.contextPath}/ayuda.jsf','Ayuda','width=1000,height=300,top=200,left=300,Scrollbars=YES');"/>

           

          <!--

          <rich:menuItem submitMode="ajax" value="Ayuda"

          actionListener="#{menuBean.ayuda}"

          target="_blank" 

          immediate="true"

          oncomplete="javascript:alert('#{menuBean.mensajeAyuda}');"/>

           

          -->


          </rich:dropDownMenu>

           

           

          </rich:toolbar>

          </td>

          <td>

          <rich:toolbar style="float:right; width: 100%"

          rendered="#{currentUser.tipoUsuario != null}">

          <rich:menuItem submitMode="ajax" value="#{msg.menu_exit_label}"

          style="text-align: right;" action="#{menuBean.exitAction}">

          </rich:menuItem>

          </rich:toolbar>

          </td>

          </tr>

          <tr>

          <td width="100%" class="bienvenida">

          <h:outputText rendered="#{currentUser.tipoUsuario != null and currentUser.usuarioProceso != null}"

          styleClass="bienvenida" value="Proceso: #{currentUser.usuarioProceso.primaryKey.proceso.dsnombre}" />

          </td>

           

          <td width="100%">

          <rich:toolbar style="float:right; width: 100%"

          rendered="#{currentUser.tipoUsuario != null}">

          <h:outputText style="text-align: right;" value="Usuario: #{currentUser.nombre}" />

          <h:outputText style="text-align: right;" value=" Rol: #{currentUser.rol.nombre}" />


          </rich:toolbar>

          </td>

          </tr>

          </table>

          <div id="loadingBox"

          style="display: none; z-index: 10000; color: DarkBlue; width: 110px;">

          <h:panelGrid columns="2"

          columnClasses="loadingColumn1,loadingColumn2" width="100%"

          style="border: 1px solid #B1C3D9; color: #000000; font-weight: bold; font-size: 11px; font-family: Arial, Helvetica, sans-serif; background-color: #F5F5F5">

          <h:graphicImage

          value="/resources/imagenes/loading.gif"

          height="32" width="32" />

          <h:outputText value="Cargando..." />

          </h:panelGrid>

          </div>

          <a4j:status onstart="onStartAjaxRequest();"

          onstop="onStopAjaxRequest();"></a4j:status>

          <div id="breadcumps" style="display: block;">

          <rich:list var="miga" value="#{menuBean.migaPan}"

          rendered="#{not empty menuBean.migaPan}" id="migaPan">

          <h:outputText value="#{miga}" />

          </rich:list>

          </div>

          <ui:insert name="body">Contenido </ui:insert>

          <br />

          <div align="center">

          <img src="/#{msg.contexto_app}/resources/imagenes/FAC.jpg"

          width="63" height="47" />

          <br />

          <span class="bienvenida">&copy; Copyright LGAC</span>

          <br />

          <span class="bienvenida"> 2013 </span>

          </div>

          </h:form>

          </div>

          </h:body>

          </f:view>

          </html>

           

           

          and the backing bean is:

           

           

           

          /*

           

          * InicioSesion.java

          *

          * Created on 21/03/2008, 10:14:31 AM

          * Copyright Tavo

          */

          package procesoacreditacion;


          import java.io.IOException;

          import java.sql.SQLException;

          import java.util.ArrayList;

          import java.util.HashMap;

          import java.util.List;

          import java.util.Map;

          import java.util.logging.Level;

          import java.util.logging.Logger;


          import javax.faces.FacesException;

          import javax.faces.component.UIComponent;

          import javax.faces.component.html.HtmlPanelGrid;

          import javax.faces.context.FacesContext;

          import javax.faces.convert.NumberConverter;

          import javax.faces.event.ActionEvent;

          import javax.faces.model.SelectItem;

          import javax.faces.validator.DoubleRangeValidator;


          import co.com.gesiti.acreditacion.model.UsuarioProceso;

          import co.com.gesiti.acreditacion.model.Usuarios;

          import co.com.gesiti.acreditacion.service.UsuarioServices;

          import co.com.gesiti.acreditacion.util.security.SecurityFilter;

          import co.com.gesiti.seguridad.Priv;

          import co.com.gesiti.seguridad.Rol;

          import co.com.gesiti.seguridad.SeguridadService;


          import com.sun.rave.web.ui.appbase.AbstractPageBean;

          import com.sun.webui.jsf.component.Alert;

          import com.sun.webui.jsf.component.Body;

          import com.sun.webui.jsf.component.Button;

          import com.sun.webui.jsf.component.Form;

          import com.sun.webui.jsf.component.Head;

          import com.sun.webui.jsf.component.Html;

          import com.sun.webui.jsf.component.Hyperlink;

          import com.sun.webui.jsf.component.ImageComponent;

          import com.sun.webui.jsf.component.Link;

          import com.sun.webui.jsf.component.Message;

          import com.sun.webui.jsf.component.Page;

          import com.sun.webui.jsf.component.PanelLayout;

          import com.sun.webui.jsf.component.PasswordField;

          import com.sun.webui.jsf.component.StaticText;

          import com.sun.webui.jsf.component.TextField;


          import conexiones.Conexion;

          import dao.daoPonderacion;

          import dao.daoUsuario;


          /**

          * <p>

          * Page bean that corresponds to a similarly named JSP page. This class contains

          * component definitions (and initialization code) for all components that you

          * have defined on this page, as well as lifecycle methods and event handlers

          * where you may add behavior to respond to incoming events.

          * </p>

          */

          public class InicioSesion extends AbstractPageBean {


          private UsuarioServices usuarioServices;


          private SeguridadService seguridadService;

          public String mail;

          public String user;

           

          public String idProceso;


          public boolean enviadoMail;

          private boolean activarProceso;

          public String mensajeMail;

          private List<UsuarioProceso> usuarioProcesos = new ArrayList<UsuarioProceso>();

          private UsuarioProceso usuarioProceso;

           

          public SeguridadService getSeguridadService() {

          return seguridadService;

          }

          public void setSeguridadService(SeguridadService seguridadService) {

          this.seguridadService = seguridadService;

          }

           

           

           

          /**

          * @return the idProceso

          */

          public String getIdProceso() {

          return idProceso;

          }

          /**

          * @param idProceso the idProceso to set

          */

          public void setIdProceso(String idProceso) {

          this.idProceso = idProceso;

          }

          /**

          * @return the usuarioProceso

          */

          public UsuarioProceso getUsuarioProceso() {

          return usuarioProceso;

          }

          /**

          * @param usuarioProceso the usuarioProceso to set

          */

          public void setUsuarioProceso(UsuarioProceso usuarioProceso) {

          this.usuarioProceso = usuarioProceso;

          }

          /**

          * @return the activarProceso

          */

          public boolean isActivarProceso() {

          return activarProceso;

          }

          /**

          * @param activarProceso the activarProceso to set

          */

          public void setActivarProceso(boolean activarProceso) {

          this.activarProceso = activarProceso;

          }

          /**

          * @return the usuarioProcesos

          */

          public List<UsuarioProceso> getUsuarioProcesos() {

          return usuarioProcesos;

          }

          /**

          * @param usuarioProcesos the usuarioProcesos to set

          */

          public void setUsuarioProcesos(List<UsuarioProceso> usuarioProcesos) {

          this.usuarioProcesos = usuarioProcesos;

          }

           

          public void validateProcesos(ActionEvent event) {

           

          if (idProceso != null && !"".equals(idProceso)){

          for (UsuarioProceso usuarioProcesoTemp : getUsuarioProcesos()){

          if (idProceso.equals(String.valueOf(usuarioProcesoTemp.getPrimaryKey().getProceso().getIdproceso()))){

          this.usuarioProceso = usuarioProcesoTemp;

          break;

          }

          }

           

          }else{

          this.usuarioProceso = null;

          }

           

          }

           

          public List<SelectItem> getProcesosSelect() {

           

          Usuarios oUsuario = null;

           

          try {

          oUsuario = usuarioServices.validateUsuario(username, password);

          } catch (Exception e) {

          // TODO Auto-generated catch block

          //e.printStackTrace();

          }

           

           

          if (oUsuario != null) {

          setUsuarioProcesos(usuarioServices.getProcesosUsuario(oUsuario));

          }

           

          List<SelectItem> lista = new ArrayList<SelectItem>();

          if(getUsuarioProcesos().size() > 0)

          lista.add(new SelectItem("", "-- Seleccione un Proceso --"));


          for (UsuarioProceso usuarioProcesoTemp : getUsuarioProcesos()) {

          if (usuarioProcesoTemp.getModelo() != null)

          usuarioProcesoTemp.getModelo().getId();

          lista.add(new SelectItem(String.valueOf(usuarioProcesoTemp.getPrimaryKey().getProceso().getIdproceso()), usuarioProcesoTemp.getPrimaryKey().getProceso().getDsnombre()));

          }


          return lista;

          }

           

           

          /**

          * @return the usuarioServices

          */

          public UsuarioServices getUsuarioServices() {

          return usuarioServices;

          }


          /**

          * @param usuarioServices

          *            the usuarioServices to set

          */

          public void setUsuarioServices(UsuarioServices usuarioServices) {

          this.usuarioServices = usuarioServices;

          }


          Conexion conn = new Conexion();

          public boolean bandera = false;

          // <editor-fold defaultstate="collapsed"

          // desc="Managed Component Definition">

          private int __placeholder;


          /**

          * <p>

          * Automatically managed component initialization. <strong>WARNING:</strong>

          * This method is automatically generated, so any user-specified code

          * inserted here is subject to being replaced.

          * </p>

          */

          private void _init() throws Exception {

          numberConverter1.setMinIntegerDigits(1);

          numberConverter1.setMaxIntegerDigits(40);

          numberConverter1.setMaxFractionDigits(3);

          }


          private Page page1 = new Page();


          public Page getPage1() {

          return page1;

          }


          public void setPage1(Page p) {

          this.page1 = p;

          }


          private Html html1 = new Html();


          public Html getHtml1() {

          return html1;

          }


          public void setHtml1(Html h) {

          this.html1 = h;

          }


          private Head head1 = new Head();


          public Head getHead1() {

          return head1;

          }


          public void setHead1(Head h) {

          this.head1 = h;

          }


          private Link link1 = new Link();


          public Link getLink1() {

          return link1;

          }


          public void setLink1(Link l) {

          this.link1 = l;

          }


          private Body body1 = new Body();


          public Body getBody1() {

          return body1;

          }


          public void setBody1(Body b) {

          this.body1 = b;

          }


          private Form form1 = new Form();


          public Form getForm1() {

          return form1;

          }


          public void setForm1(Form f) {

          this.form1 = f;

          }


          private Link link2 = new Link();


          public Link getLink2() {

          return link2;

          }


          public void setLink2(Link l) {

          this.link2 = l;

          }


          private PanelLayout leftSidebarPanel = new PanelLayout();


          public PanelLayout getLeftSidebarPanel() {

          return leftSidebarPanel;

          }


          public void setLeftSidebarPanel(PanelLayout pl) {

          this.leftSidebarPanel = pl;

          }


          private PanelLayout footerPanel = new PanelLayout();


          public PanelLayout getFooterPanel() {

          return footerPanel;

          }


          public void setFooterPanel(PanelLayout pl) {

          this.footerPanel = pl;

          }


          private StaticText staticText10 = new StaticText();


          public StaticText getStaticText10() {

          return staticText10;

          }


          public void setStaticText10(StaticText st) {

          this.staticText10 = st;

          }


          private PanelLayout mainContentPanel = new PanelLayout();


          public PanelLayout getMainContentPanel() {

          return mainContentPanel;

          }


          public void setMainContentPanel(PanelLayout pl) {

          this.mainContentPanel = pl;

          }


          private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid();


          public HtmlPanelGrid getGridPanel1() {

          return gridPanel1;

          }


          public void setGridPanel1(HtmlPanelGrid hpg) {

          this.gridPanel1 = hpg;

          }


          private Hyperlink hyperlink6 = new Hyperlink();


          public Hyperlink getHyperlink6() {

          return hyperlink6;

          }


          public void setHyperlink6(Hyperlink h) {

          this.hyperlink6 = h;

          }


          private Hyperlink hyperlink7 = new Hyperlink();


          public Hyperlink getHyperlink7() {

          return hyperlink7;

          }


          public void setHyperlink7(Hyperlink h) {

          this.hyperlink7 = h;

          }


          private Hyperlink hyperlink8 = new Hyperlink();


          public Hyperlink getHyperlink8() {

          return hyperlink8;

          }


          public void setHyperlink8(Hyperlink h) {

          this.hyperlink8 = h;

          }


          private Hyperlink hyperlink9 = new Hyperlink();


          public Hyperlink getHyperlink9() {

          return hyperlink9;

          }


          public void setHyperlink9(Hyperlink h) {

          this.hyperlink9 = h;

          }


          private Button iniciarSesion = new Button();


          public Button getIniciarSesion() {

          return iniciarSesion;

          }


          public void setIniciarSesion(Button b) {

          this.iniciarSesion = b;

          }


          private Alert alert1 = new Alert();


          public Alert getAlert1() {

          return alert1;

          }


          public void setAlert1(Alert a) {

          this.alert1 = a;

          }


          private PanelLayout requeridoPanel = new PanelLayout();


          public PanelLayout getRequeridoPanel() {

          return requeridoPanel;

          }


          public void setRequeridoPanel(PanelLayout pl) {

          this.requeridoPanel = pl;

          }


          private StaticText staticText3 = new StaticText();


          public StaticText getStaticText3() {

          return staticText3;

          }


          public void setStaticText3(StaticText st) {

          this.staticText3 = st;

          }


          private StaticText staticText4 = new StaticText();


          public StaticText getStaticText4() {

          return staticText4;

          }


          public void setStaticText4(StaticText st) {

          this.staticText4 = st;

          }


          private StaticText staticText5 = new StaticText();


          public StaticText getStaticText5() {

          return staticText5;

          }


          public void setStaticText5(StaticText st) {

          this.staticText5 = st;

          }


          private StaticText staticText6 = new StaticText();


          public StaticText getStaticText6() {

          return staticText6;

          }


          public void setStaticText6(StaticText st) {

          this.staticText6 = st;

          }


          private StaticText staticText7 = new StaticText();


          public StaticText getStaticText7() {

          return staticText7;

          }


          public void setStaticText7(StaticText st) {

          this.staticText7 = st;

          }


          private StaticText staticText8 = new StaticText();


          public StaticText getStaticText8() {

          return staticText8;

          }


          public void setStaticText8(StaticText st) {

          this.staticText8 = st;

          }


          private StaticText staticText9 = new StaticText();


          public StaticText getStaticText9() {

          return staticText9;

          }


          public void setStaticText9(StaticText st) {

          this.staticText9 = st;

          }


          private PasswordField txtClave = new PasswordField();


          public PasswordField getTxtClave() {

          return txtClave;

          }


          public void setTxtClave(PasswordField pf) {

          this.txtClave = pf;

          }


          private TextField txtUsuario = new TextField();


          public TextField getTxtUsuario() {

          return txtUsuario;

          }


          public void setTxtUsuario(TextField tf) {

          this.txtUsuario = tf;

          }


          private StaticText staticText11 = new StaticText();


          public StaticText getStaticText11() {

          return staticText11;

          }


          public void setStaticText11(StaticText st) {

          this.staticText11 = st;

          }


          private PanelLayout topNavigationPanel = new PanelLayout();


          public PanelLayout getTopNavigationPanel() {

          return topNavigationPanel;

          }


          public void setTopNavigationPanel(PanelLayout pl) {

          this.topNavigationPanel = pl;

          }


          private HtmlPanelGrid topNavigationGrid1 = new HtmlPanelGrid();


          public HtmlPanelGrid getTopNavigationGrid1() {

          return topNavigationGrid1;

          }


          public void setTopNavigationGrid1(HtmlPanelGrid hpg) {

          this.topNavigationGrid1 = hpg;

          }


          private Hyperlink hyperlink2 = new Hyperlink();


          public Hyperlink getHyperlink2() {

          return hyperlink2;

          }


          public void setHyperlink2(Hyperlink h) {

          this.hyperlink2 = h;

          }


          private Hyperlink hyperlink3 = new Hyperlink();


          public Hyperlink getHyperlink3() {

          return hyperlink3;

          }


          public void setHyperlink3(Hyperlink h) {

          this.hyperlink3 = h;

          }


          private Hyperlink hyperlink4 = new Hyperlink();


          public Hyperlink getHyperlink4() {

          return hyperlink4;

          }


          public void setHyperlink4(Hyperlink h) {

          this.hyperlink4 = h;

          }


          private Hyperlink hyperlink5 = new Hyperlink();


          public Hyperlink getHyperlink5() {

          return hyperlink5;

          }


          public void setHyperlink5(Hyperlink h) {

          this.hyperlink5 = h;

          }


          private Hyperlink hyperlink11 = new Hyperlink();


          public Hyperlink getHyperlink11() {

          return hyperlink11;

          }


          public void setHyperlink11(Hyperlink h) {

          this.hyperlink11 = h;

          }


          private StaticText staticText2 = new StaticText();


          public StaticText getStaticText2() {

          return staticText2;

          }


          public void setStaticText2(StaticText st) {

          this.staticText2 = st;

          }


          private NumberConverter numberConverter1 = new NumberConverter();


          public NumberConverter getNumberConverter1() {

          return numberConverter1;

          }


          public void setNumberConverter1(NumberConverter nc) {

          this.numberConverter1 = nc;

          }


          private DoubleRangeValidator doubleRangeValidator1 = new DoubleRangeValidator();


          public DoubleRangeValidator getDoubleRangeValidator1() {

          return doubleRangeValidator1;

          }


          public void setDoubleRangeValidator1(DoubleRangeValidator drv) {

          this.doubleRangeValidator1 = drv;

          }


          private ImageComponent image1 = new ImageComponent();


          public ImageComponent getImage1() {

          return image1;

          }


          public void setImage1(ImageComponent ic) {

          this.image1 = ic;

          }


          private Message message1 = new Message();


          public Message getMessage1() {

          return message1;

          }


          public void setMessage1(Message m) {

          this.message1 = m;

          }


          private Message message2 = new Message();


          public Message getMessage2() {

          return message2;

          }


          public void setMessage2(Message m) {

          this.message2 = m;

          }


          // </editor-fold>

          /**

          * <p>

          * Construct a new Page bean instance.

          * </p>

          */

          public InicioSesion() {

          }


          /**

          * <p>

          * Callback method that is called whenever a page is navigated to, either

          * directly via a URL, or indirectly via page navigation. Customize this

          * method to acquire resources that will be needed for event handlers and

          * lifecycle methods, whether or not this page is performing post back

          * processing.

          * </p>

          *

          * <p>

          * Note that, if the current request is a postback, the property values of

          * the components do <strong>not</strong> represent any values submitted

          * with this request. Instead, they represent the property values that were

          * saved for this view when it was rendered.

          * </p>

          */

          public void init() {

          // Perform initializations inherited from our superclass

          super.init();

          // Perform application initialization that must complete

          // *before* managed components are initialized

          // TODO - add your own initialiation code here


          // <editor-fold defaultstate="collapsed"

          // desc="Managed Component Initialization">

          // Initialize automatically managed components

          // *Note* - this logic should NOT be modified

          try {

          _init();

          } catch (Exception e) {

          log("Page1 Initialization Failure", e);

          throw e instanceof FacesException ? (FacesException) e : new FacesException(e);

          }


          // </editor-fold>

          // Perform application initialization that must complete

          // *after* managed components are initialized

          // TODO - add your own initialization code here

          }


          /**

          * <p>

          * Callback method that is called after the component tree has been

          * restored, but before any event processing takes place. This method will

          * <strong>only</strong> be called on a postback request that is processing

          * a form submit. Customize this method to allocate resources that will be

          * required in your event handlers.

          * </p>

          */

          public void preprocess() {

          }


          /**

          * <p>

          * Callback method that is called just before rendering takes place. This

          * method will <strong>only</strong> be called for the page that will

          * actually be rendered (and not, for example, on a page that handled a

          * postback and then navigated to a different page). Customize this method

          * to allocate resources that will be required for rendering this page.

          * </p>

          */

          public void prerender() {

          // message1.

          // if (!bandera)

          // alert1.setVisible(false);

          }


          /**

          * <p>

          * Callback method that is called after rendering is completed for this

          * request, if <code>init()</code> was called (regardless of whether or not

          * this was the page that was actually rendered). Customize this method to

          * release resources acquired in the <code>init()</code>,

          * <code>preprocess()</code>, or <code>prerender()</code> methods (or

          * acquired during execution of an event handler).

          * </p>

          */

          public void destroy() {

          }


          /**

          * <p>

          * Return a reference to the scoped data bean.

          * </p>

          */

          protected RequestBean1 getRequestBean1() {

          return (RequestBean1) getBean("RequestBean1");

          }


          /**

          * <p>

          * Return a reference to the scoped data bean.

          * </p>

          */

          protected SessionBean1 getSessionBean1() {

          return (SessionBean1) getBean("SessionBean1");

          }


          /**

          * <p>

          * Return a reference to the scoped data bean.

          * </p>

          */

          protected ApplicationBean1 getApplicationBean1() {

          return (ApplicationBean1) getBean("ApplicationBean1");

          }


          private String username;


          private String password;

           

          private String errorSummary;

           

          /**

          * @return the errorSummary

          */

          public String getErrorSummary() {

          return errorSummary;

          }


          /**

          * @param errorSummary the errorSummary to set

          */

          public void setErrorSummary(String errorSummary) {

          this.errorSummary = errorSummary;

          }


          /**

          * @return the username

          */

          public String getUsername() {

          return username;

          }


          /**

          * @param username

          *            the username to set

          */

          public void setUsername(String username) {

          this.username = username;

          }


          /**

          * @return the password

          */

          public String getPassword() {

          return password;

          }


          /**

          * @param password

          *            the password to set

          */

          public void setPassword(String password) {

          this.password = password;

          }

           

           


          @SuppressWarnings("unchecked")

          public String iniciarSesion_action() throws SQLException, IOException {


          Usuarios oUsuario = null;

           

          try {

          oUsuario = usuarioServices.validateUsuario(username, password);

          } catch (Exception e) {

          // TODO Auto-generated catch block

          //e.printStackTrace();

          }

           

          // Usuario oUsuario =

          // daoUsuario.findById(getSessionBean1().getUsuariosRowSetFindById(),

          // txtUsuario.getText().toString());

          if (oUsuario == null) {

          // staticText12.setText("ds");

          alert1.setVisible(true);

          alert1.setType("error");

          alert1

          .setStyle("color: red; font-family: 'Arial','Helvetica',sans-serif; font-size: 11px; height: 22px; left: 0px; top: 144px; position: absolute; width: 550px");

          String errorString = " " + " " + "Nombre de usuario o contraseña incorrecta. Intente de nuevo";

          errorSummary = errorString;

          alert1.setSummary(errorString);

          bandera = true;

          return null;

          }

           

          setErrorSummary("");

           

          String rol = oUsuario.getTipoUsuario().trim();

          Rol rolObj = seguridadService.getRol(rol);

          oUsuario.setRol(rolObj);

           

          if (getUsuarioProceso() != null){

          oUsuario.setUsuarioProceso(getUsuarioProceso());

          }

           

          // Se coloca en sesion el usuario.

          setBean("currentUser", oUsuario);

          getSessionMap().put("modelId", oUsuario.getModeloacreditacionId());


          // rol de usuario

           

          Integer modelo;

          daoUsuario oDaoUsuario = new daoUsuario();

          setUsuarioProceso(null);

          setUsuarioProcesos(new ArrayList<UsuarioProceso>());

          setPassword(null);

          setIdProceso(null);


          Map<String, Boolean> privs = loadPrivs(rol);

          getSessionMap().put(SecurityFilter.USER_PRIVS, privs);

           

          // asignar rol

          getSessionBean1().setRol(rol);

          getSessionBean1().setUsuario(username);

          modelo = oDaoUsuario.obtenerModeloAcreditacionUsuario(conn.establishConnection(), getSessionBean1().getUsuario());

          getSessionBean1().setModelo(modelo);

          // getSessionBean1().

          // asignar pull para especialistas

          // getSessionBean1().setPull(oUsuario.getPull().toString());

          // try {

          // dirigir a la pagina de inicio segun el rol

          if (rol.equals("ADM")) {

          getSessionBean1().getArbolaspectosRowSet().setObject(1, "1");

          getSessionBean1().getArbolaspectosRowSet().setObject(2, "1");

          return "indexProgram";

          // this.getExternalContext().redirect("faces/listarTodasInstitucion.jsp");

          }else if (rol.equals("FON")) {

          return "psi";

          // this.getExternalContext().redirect("faces/listarTodasInstitucion.jsp");

          }else{


          inicializarvariables();

          // txtUsuario.setText(getSessionBean1().getNroFactores());

          return "indexProgram";

          // return null;

          // this.getExternalContext().redirect("IndexPA.jsp");

          }

          // txtUsuario.setText(rol);

           

          // this.getExternalContext().redirect("faces/listarTodasInstitucion.jsp");

          }

           

           

          @SuppressWarnings("unchecked")

          public String consultarProcesos() throws SQLException, IOException {


          Usuarios oUsuario = null;

           

          try {

          oUsuario = usuarioServices.validateUsuario(username, password);

          } catch (Exception e) {

          // TODO Auto-generated catch block

          //e.printStackTrace();

          }

           

           

          if (oUsuario == null) {

          alert1.setVisible(true);

          alert1.setType("error");

          alert1

          .setStyle("color: red; font-family: 'Arial','Helvetica',sans-serif; font-size: 11px; height: 22px; left: 0px; top: 144px; position: absolute; width: 550px");

          String errorString = " " + " " + "Nombre de usuario o contraseña incorrecta. Intente de nuevo";

          errorSummary = errorString;

          alert1.setSummary(errorString);

          bandera = true;

          return null;

          }else{

          List<UsuarioProceso> procesos = usuarioServices.getProcesosUsuario(oUsuario);

           

          if (loadPrivs(oUsuario.getTipoUsuario().trim()).containsKey("superAdministrador") || getUsuarioProceso() != null){

          setActivarProceso(false);

          return iniciarSesion_action();

          }else if (procesos == null || procesos.size() == 0){

          alert1.setVisible(true);

          alert1.setType("error");

          alert1

          .setStyle("color: red; font-family: 'Arial','Helvetica',sans-serif; font-size: 11px; height: 22px; left: 0px; top: 144px; position: absolute; width: 550px");

          String errorString = " " + " " + "No tiene procesos asociados por lo cual no puede ingresar a la aplicación. Por favor contactar al administrador";

          errorSummary = errorString;

          alert1.setSummary(errorString);

          bandera = true;

          setActivarProceso(false);

          return null;

          }else if (isActivarProceso() && getUsuarioProceso() == null){

          alert1.setVisible(true);

          alert1.setType("error");

          alert1

          .setStyle("color: red; font-family: 'Arial','Helvetica',sans-serif; font-size: 11px; height: 22px; left: 0px; top: 144px; position: absolute; width: 550px");

          String errorString = " " + " " + "Debe elegir un proceso";

          errorSummary = errorString;

          alert1.setSummary(errorString);

          bandera = true;

          setActivarProceso(false);

          return null;

          }else {

          setActivarProceso(true);

          setErrorSummary("");

          return "indexProgram";

          }

          }


          }

           

           

          private Map<String, Boolean> loadPrivs(String rol) {

          Map<String, Boolean> privs = new HashMap<String, Boolean>();

          Rol rolObj = seguridadService.getRol(rol);

          if (rolObj.getPrivs() != null) {

          for (Priv priv : rolObj.getPrivs()) {

          privs.put(priv.getNombre(), Boolean.TRUE);

          }

          }

          return privs;

          }


          public void inicializarvariables() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          try {

          daoPonderacion oDaoPonderacion = new daoPonderacion();

          getSessionBean1().getArbolaspectosRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getArbolaspectosRowSet().setObject(2, getSessionBean1().getModelo().toString());

          getSessionBean1().getArbolDataProvider().refresh();

          getSessionBean1().getFactoresRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getFactoresDataProvider().refresh();

          getSessionBean1().getFactoresRowSet1().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getFactoresDataProvider1().refresh();

          getSessionBean1().getCaracteristicasRowSet().setObject(2,

          getSessionBean1().getModelo().toString());

          getSessionBean1().getCaracteristicasDataProvider().refresh();

          getSessionBean1().getCaracteristicasRowSet1().setObject(2,

          getSessionBean1().getModelo().toString());

          getSessionBean1().getCaracteristicasDataProvider1().refresh();

          getSessionBean1().getCaracteristicasRowSet2().setObject(2,

          getSessionBean1().getModelo().toString());

          getSessionBean1().getCaracteristicasDataProvider2().refresh();

          getSessionBean1().getAspectosRowSet().setObject(2, getSessionBean1().getModelo().toString());

          getSessionBean1().getAspectosDataProvider().refresh();

          getSessionBean1().getIndicadoresRowSet().setObject(2, getSessionBean1().getModelo().toString());

          getSessionBean1().getIndicadoresDataProvider().refresh();

          getSessionBean1().getEscalaRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getEscalaDataProvider().refresh();

          getSessionBean1().getInstrumentosRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getInstrumentosDataProvider().refresh();

          getSessionBean1().getFuentesRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getFuentesDataProvider().refresh();

          getSessionBean1().getCriteriosRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getCriteriosDataProvider().refresh();

          getSessionBean1().getMaxfactoresRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxfactoresDataProvider().refresh();

          getSessionBean1().getMaxcaracteristicasRowSet().setObject(1,

          getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxcaracteristicasDataProvider().refresh();

          getSessionBean1().getMaxaspectosRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxaspectosDataProvider().refresh();

          getSessionBean1().getMaxindicadoresRowSet()

          .setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxindicadoresDataProvider().refresh();

          getSessionBean1().getMaxescalaRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxescalaDataProvider().refresh();

          getSessionBean1().getMaxinstrumentosRowSet().setObject(1,

          getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxinstrumentosDataProvider().refresh();

          getSessionBean1().getMaxfuentesRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxfuentesDataProvider().refresh();

          getSessionBean1().getMaxcriteriosRowSet().setObject(1, getSessionBean1().getModelo().toString());

          getSessionBean1().getMaxcriteriosDataProvider().refresh();


          /*

          * Integer estadoConstruccion =

          * oDaoPonderacion.obtenerEstadoConstruccion

          * (getSessionBean1().getModelo()); Integer estadofac =

          * oDaoPonderacion

          * .obtenerEstadoPonFactor(getSessionBean1().getModelo()); String

          * estadocarac =

          * oDaoPonderacion.obtenerEstadoPonCaracteristica(getSessionBean1

          * ().getModelo()); Integer nrocaracconasp =

          * oDaoPonderacion.obtenerCaracteristicasconAspectos

          * (getSessionBean1().getModelo()); Integer nrocaracconind =

          * oDaoPonderacion

          * .obtenerCaracteristicasconIndicadores(getSessionBean1

          * ().getModelo()); Integer nrofacconc =

          * oDaoPonderacion.obtenerFactoresconCaracteristicas

          * (getSessionBean1().getModelo());

          */


          // Esta variable controla si el programa academico ya tiene o no

          // modelo academico creado.

          Integer estadoConstruccion = 1;


          // Esta variable controla si se despliega o no en el proceso de

          // ponderacion, el boton "Caracteristicas".

          Integer estadofac = 1;


          // Esta variable controla si se despliega o no en el proceso de

          // ponderacion, los botones de "Aspectos" y "Indicadores"

          String estadocarac = "1";


          //

          Integer nrocaracconasp = 5;

          Integer nrocaracconind = 1;

          Integer nrofacconc = 1;


          getSessionBean1().setNroFactores(nrofacconc);

          getSessionBean1().setNroCaracteristicasconAspectos(nrocaracconasp);

          getSessionBean1().setNroCaracteristicasconIndicadores(nrocaracconind);


          if (estadoConstruccion.equals(1)) {

          getSessionBean1().setPermiso(true);

          } else {

          getSessionBean1().setPermiso(false);

          }

          if (estadofac.equals(1)) {

          getSessionBean1().setVerPonderacionCaracteristicas(true);

          } else {

          getSessionBean1().setVerPonderacionCaracteristicas(false);

          }

          if (estadocarac.equals("1")) {

          getSessionBean1().setVerPonderacionAoI(true);

          } else {

          getSessionBean1().setVerPonderacionAoI(false);

          // staticText4.setText(estadofac);

          // txtUsuario.setText(estadofac);

          // bandera = true;

          // alert1.setVisible(true);

          // alert1.setType("information");

          // alert1.setStyle("color: #3b5998; font-family: 'Arial','Helvetica',sans-serif; font-size: 11px; height: 22px; left: 105px; top: 144px; position: absolute; vertical-align: middle; width: 550px");

          // alert1.setSummary(estadoConstruccion.toString()+estadofac.toString()+estadocarac);

          }

          } catch (SQLException ex) {

          Logger.getLogger(InicioSesion.class.getName()).log(Level.SEVERE, null, ex);

          }

          }

           

          public String getMail() {

          return mail;

          }

          public void setMail(String mail) {

          this.mail = mail;

          }

          public boolean isEnviadoMail() {

          return enviadoMail;

          }

          public String getUser() {

          return user;

          }

          public void setUser(String user) {

          this.user = user;

          }

          public void setEnviadoMail(boolean enviadoMail) {

          this.enviadoMail = enviadoMail;

          }

          public String getMensajeMail() {

          return mensajeMail;

          }

          public void setMensajeMail(String mensajeMail) {

          this.mensajeMail = mensajeMail;

          }

          public String recuperarClave(){

          return "recuperar";

          }

           

           

           

          public String enviarAlCorreo(){

          try{

          Usuarios usuario = usuarioServices.getUserByUser(user);

           

          if(usuario != null){

          String mensaje= "nombre de usuario: " + usuario.getUsuario() + "  Contraseña: " + usuario.getContrasena();

          enviadoMail=seguridadService.mail("Usuario SIAA", mensaje, usuario.getCorreoelectronico());

          }else{

          setEnviadoMail(false);

          }

           

          }catch (SQLException ex) {

          }

          user="";

          return "MensajeEnviado";

          }

           

          public boolean isEnviadoCorreo() {

          if (isEnviadoMail()){

           

          return true;

          }else{

           

          return false;

          }

          }

           

          public String hyperlink6_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink7_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink8_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink9_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink10_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink1_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink2_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink3_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink4_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public String hyperlink5_action() {

          // TODO: Process the action. Return value is a navigation

          // case name where null will return to the same page.

          return null;

          }


          public void txtUsuario_validate(FacesContext context, UIComponent component, Object value) {

          }

           


           

           

           

          }

           

          • 17. Re: Problem migrating from Richfaces 3.3.3 to Richfaces 4
            henrycoraluriarte

            puedes probar con un p:commandButton o con un  h:commandButton o en el render aumenta el id del form.

            • 18. Re: Problem migrating from Richfaces 3.3.3 to Richfaces 4
              luisaggo

              Hice las 3 pruebas y con ninguna llega el evento al backing bean . Tampoco sale error en los logs cmo puedo hacer debug del tema?

              • 19. Re: Problem migrating from Richfaces 3.3.3 to Richfaces 4
                henrycoraluriarte

                puedes ponerle esta etiqueta h:messages  por q de lo que veo solo tienes message para ciertos componentes y ver si da algun error, el debug si de deja en el eclipse pones el break point y le mandas a correr en debug y se frena en el break point

                 

                 

                h:messages

                • 20. Re: Problem migrating from Richfaces 3.3.3 to Richfaces 4
                  luisaggo

                  El debug lo tengo el problema es precisamente que en el action donde tengo el break point no me llega la petición y no sale error en el log. Voy a validar lo del message, pero si fuera eso en los logs aparece cuando no existe la etiqueta para mostrar el mensaje.

                   

                  muchas gracias!!!

                  1 2 Previous Next