Example usage for org.apache.commons.validator ValidatorException ValidatorException

List of usage examples for org.apache.commons.validator ValidatorException ValidatorException

Introduction

In this page you can find the example usage for org.apache.commons.validator ValidatorException ValidatorException.

Prototype

public ValidatorException(String message) 

Source Link

Document

Constructs an Exception with the specified detail message.

Usage

From source file:es.pode.administracion.presentacion.adminusuarios.bajaGrupo.BajaControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.adminusuarios.bajaGrupo.BajaController#obtenerIdiomas(org.apache.struts.action.ActionMapping,
 *      es.pode.administracion.presentacion.adminusuarios.bajaGrupo.ObtenerIdiomasForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *///from   w w  w.  j  ava 2 s.com
public final void obtenerIdiomas(ActionMapping mapping,
        es.pode.administracion.presentacion.adminusuarios.bajaGrupo.ObtenerIdiomasForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    try {

        SrvAdminUsuariosService srvAdminUsuariosService = this.getSrvAdminUsuariosService();

        Iterator iter = (form.getIds()).iterator();
        GrupoVO[] grupos = new GrupoVO[form.getIds().size()];
        int i = 0;
        String listaId = "";
        while (iter.hasNext()) {

            Long id = new Long((String) iter.next());
            listaId = listaId + id.toString() + " ";

            GrupoVO grupoVO = srvAdminUsuariosService.descripcionGrupo(id);
            grupos[i] = grupoVO;
            i = i + 1;
        }
        form.setListaId(listaId.trim());
        form.setGrupos(grupos);
        if ((listaId.length() == 0) || (grupos.length == 0)) {
            saveErrorMessage(request, "errors.borrarGrupo");
        }

    } catch (Exception e) {
        log.error("Error: " + e);
        throw new ValidatorException("{errors.borrarGrupo}");
    }
}

From source file:es.pode.administracion.presentacion.descargas.activas.ActivasControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.descargas.activas.ActivasController#eliminar(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.descargas.activas.EliminarForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *///w w  w  . ja  v a  2s .c om
public final void eliminar(ActionMapping mapping,
        es.pode.administracion.presentacion.descargas.activas.EliminarForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    if (form.getIds() == null) {
        throw new ValidatorException("{descargasActivas.no.seleccionados}");
    }
    getSrvDescargas().eliminarDescargas((Long[]) form.getIds().toArray(new Long[] {}));
}

From source file:es.pode.administracion.presentacion.nodos.bajaNodo.BajaNodoControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.nodos.bajaNodo.BajaNodoController#obtenerNodos(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.nodos.bajaNodo.ObtenerNodosForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//*from w w  w .  j  a  v  a  2  s  .  c om*/
public final void obtenerNodos(ActionMapping mapping,
        es.pode.administracion.presentacion.nodos.bajaNodo.ObtenerNodosForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    try {
        log.info("Entramos en obtenerNodos");
        SrvNodoService srvNodoService = this.getSrvNodoService();

        Iterator iter = (form.getIds()).iterator();
        NodoVO[] nodos = new NodoVO[form.getIds().size()];
        int i = 0;
        String listaId = "";
        while (iter.hasNext()) {
            log.info("Iteramos");
            Long id = new Long((String) iter.next());
            listaId = listaId + id.toString() + " ";

            NodoVO nodoVO = srvNodoService.obtenerNodo(id);
            nodos[i] = nodoVO;
            i = i + 1;
        }
        log.info("Salimos con la lista " + listaId);
        form.setListaId(listaId.trim());
        form.setNodos(nodos);

    } catch (Exception e) {
        log.error("Se ha producido un error al recuperar los nodos: " + e);
        throw new ValidatorException("{errors.borrarNodo}");
    }

}

From source file:es.pode.empaquetador.presentacion.avanzado.recursos.gestor.GestorRecursosControllerImpl.java

public final void submit(ActionMapping mapping,
        es.pode.empaquetador.presentacion.avanzado.recursos.gestor.SubmitForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    EmpaquetadorSession sesEmpaq = this.getEmpaquetadorSession(request);
    java.util.Locale locale = (Locale) request.getSession().getAttribute(ConstantesAgrega.DEFAULT_LOCALE);
    ResourceBundle i18n = ResourceBundle.getBundle("application-resources", locale);

    String accion = form.getAction();
    if ((accion.equals(i18n.getString("presentacion.avanzado.recursos.gestor.submit.exportar")))
            || (accion.equals(i18n.getString("presentacion.avanzado.recursos.gestor.submit.eliminar")))) {

        List elementos = form.getIdentifierRowSelection();
        if (elementos != null && elementos.size() > 0) {
            List SubmanifestPath = sesEmpaq.getSubmanifestPath();
            OdeVO ultimoElemSubmPath = (OdeVO) SubmanifestPath.get(SubmanifestPath.size() - 1);

            RecursoVO[] recur = ultimoElemSubmPath.getRecursos();

            List recurRecuperados = new ArrayList();
            for (int i = 0; i < recur.length; i++) {
                if (elementos.contains(recur[i].getIdentifier())) {
                    recurRecuperados.add(recur[i]);
                }//from   www.j a v a 2  s.c o m
            }

            form.setRecursosVO(recurRecuperados);
        } //fin_if (elementos!=null && elementos.size()!=0)
        else {
            throw new ValidatorException(
                    "{presentacion.avanzado.recursos.gestor.submit.error.seleccionar.recursos}");
        }

    }

}

From source file:es.pode.empaquetador.presentacion.avanzado.organizaciones.gestor.GestorOrganizacionesControllerImpl.java

public final java.lang.String selectAction(ActionMapping mapping,
        es.pode.empaquetador.presentacion.avanzado.organizaciones.gestor.SelectActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    /*//from  w  w  w.  ja  v a2  s.  c o  m
    * Metodo de decision para el action. Analiza los parametros
    * actionSubmit (value de los botones submit) para redirigir al caso de uso
    * correspondiente. El actionSubmit llegara
    * internacionalizado, por lo que es necesario acceder al ResouceBundle
    * para obtener el valor correcto en la comparacion.
    */

    String result = null;
    String actionSubmit = form.getAction();
    java.util.Locale locale = (Locale) request.getSession().getAttribute(ConstantesAgrega.DEFAULT_LOCALE);
    ResourceBundle i18n = ResourceBundle.getBundle("application-resources", locale);

    if (form.getAction() == (null)) {
        throw new ValidatorException("{portal_empaquetado.exception}");
    }

    else if (actionSubmit.equals(i18n.getString("portal_empaquetado_gestorOrganizaciones.aceptar"))) {
        result = "Crear";
    } else if (actionSubmit.equals(i18n.getString("portal_empaquetado_gestorOrganizaciones.cancelar"))) {
        result = "Cancelar";
    }

    else if (actionSubmit.equals(i18n.getString("portal_empaquetado_gestorOrganizaciones.principal"))) {
        result = "Principal";
    } else if (actionSubmit.equals(i18n.getString("portal_empaquetado_gestorOrganizaciones.eliminar"))) {
        result = "Eliminar";
    }

    return result;
}

From source file:es.pode.empaquetador.presentacion.basico.gestor.GestorBasicoControllerImpl.java

/**
 * @see es.pode.empaquetador.presentacion.basico.gestor.GestorBasicoController#submit(org.apache.struts.action.ActionMapping,
 *      es.pode.empaquetador.presentacion.basico.gestor.SubmitForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *///from w  ww . j  a v a  2s  .c o  m
public final void submit(ActionMapping mapping, es.pode.empaquetador.presentacion.basico.gestor.SubmitForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    EmpaquetadorSession sesEmpaq = this.getEmpaquetadorSession(request);
    List identificadores = form.getIdentifierRowSelection();
    java.util.Locale locale = (Locale) request.getSession().getAttribute(ConstantesAgrega.DEFAULT_LOCALE);
    ResourceBundle i18n = ResourceBundle.getBundle("application-resources", locale);
    String accion = form.getActionSubmit();
    String combo = form.getActionCombo();
    if ((accion.equals(i18n.getString("gestor_basico.eliminar")))
            || (accion.equals(i18n.getString("gestor_basico.copiar")))
            || (accion.equals(i18n.getString("gestor_basico.cortar")))
            || (accion.equals(i18n.getString("gestor_basico.masAcciones.submit"))
                    && "Desagregar".equals(combo))) {
        if ((identificadores == null) || (identificadores.size() == 0)) {
            if (accion.equals(i18n.getString("gestor_basico.copiar")))
                throw new ValidatorException(
                        "{portalempaquetado.gestorbasico.carpetas.copiar.error.noseleccionado}");
            else if ((accion.equals(i18n.getString("gestor_basico.cortar"))))
                throw new ValidatorException(
                        "{portalempaquetado.gestorbasico.carpetas.cortar.error.noseleccionado}");
            else if ((accion.equals(i18n.getString("gestor_basico.eliminar"))))
                throw new ValidatorException(
                        "{portalempaquetado.gestorbasico.carpetas.eliminar.error.noseleccionado}");
            else if ((accion.equals(i18n.getString("gestor_basico.masAcciones.submit"))
                    && "Desagregar".equals(combo)))
                throw new ValidatorException(
                        "{portalempaquetado.gestorbasico.carpetas.desagregar.error.noseleccionado}");
        } else {
            form.setIdentificadores(identificadores);
        }
    } else if ((accion.equals(i18n.getString("gestor_basico.pegar")))) {
        if ((sesEmpaq.getPortapapeles() == null) || (sesEmpaq.getPortapapeles().size() == 0)) {
            throw new ValidatorException("{portal_empaquetado.exception}");
        }
    }

}

From source file:es.pode.administracion.presentacion.faqs.verFaq.VerFaqControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.faqs.verFaq.VerFaqController#obtenerFaqs(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.faqs.verFaq.ObtenerFaqsForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//*from  w  ww  .j  a  va  2s  .c  o  m*/
public final void obtenerFaqs(ActionMapping mapping,
        es.pode.administracion.presentacion.faqs.verFaq.ObtenerFaqsForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    try {
        /**
         * **************************************************************************************************************************************
         * ****************************************** SE OBTIENEN LOS IDIOMAS TRADUCIBLES *******************************************************
         * **************************************************************************************************************************************
         * */
        if (logger.isDebugEnabled())
            logger.debug("Obtenemos los idiomas traducibles");

        String[] idiomasPlataforma = I18n.getInstance().obtenerIdiomasPlataforma();
        if (logger.isDebugEnabled())
            logger.debug("Hay [" + idiomasPlataforma.length + "] en la plataforma");

        String idiomaLogado = LdapUserDetailsUtils.getIdioma();
        String idiomaPrioritario = I18n.getInstance().obtenerIdiomaDefectoPlataforma();
        String idiomaSecundario = I18n.getInstance().obtenerIdiomaSecundarioPlataforma();
        if (logger.isDebugEnabled())
            logger.debug(
                    "El idioma del usuario es [" + idiomaLogado + "], idioma prioritario de la plataforma es ["
                            + idiomaPrioritario + "] y el secundario es [" + idiomaSecundario + "]");

        // Rellena el combo de categorias         
        NoticiasControllerImpl noticiasController = new NoticiasControllerImpl();
        Collection categorias = Arrays.asList(this.getSrvFaqService()
                .obtenerCategoriasTraducidas(noticiasController.devuelveIdiomasTraducibles(idiomasPlataforma,
                        idiomaLogado, idiomaPrioritario, idiomaSecundario)));
        form.setCategoriaBackingList(categorias, "id", "nombre");

        //      Se obtiene los datos de la faq
        if (logger.isDebugEnabled())
            logger.debug("Se obtiene los datos de la faq con identificador [" + form.getId() + "]");
        FaqVO faq = this.getSrvFaqService().consultaFaq(form.getId());
        request.getSession().setAttribute(VERFAQVO, faq);
        form.setCategoria(faq.getCategoria().getId());

    } catch (Exception e) {
        logger.error("Error obteniendo la faq a ver");
        throw new ValidatorException("{error.obteniendo.faq.ver}");
    }

}

From source file:es.pode.administracion.presentacion.adminusuarios.altaUsuario.AltaUsuarioControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.adminusuarios.altaUsuario.AltaUsuarioController#recuperarGrupos(org.apache.struts.action.ActionMapping,
 *      es.pode.administracion.presentacion.adminusuarios.altaUsuario.RecuperarGruposForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *//* w ww .  j a  v  a2  s  .c  o  m*/
public final void recuperarGrupos(ActionMapping mapping,
        es.pode.administracion.presentacion.adminusuarios.altaUsuario.RecuperarGruposForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    String idiomaSelected = LdapUserDetailsUtils.getIdioma();
    I18n i18n = I18n.getInstance();
    LocalizacionIdiomaVO[] localizadorNavegacionIdioma = i18n
            .obtenerIdiomasPlataformaLocalizados(idiomaSelected);
    form.setIdiomaBackingList(Arrays.asList(localizadorNavegacionIdioma), "idLocalizacion", "name");
    LocalizacionIdiomaVO[] localizadorBusquedaIdioma = i18n.obtenerIdiomasBuscablesLocalizados(idiomaSelected);
    form.setIdiomaBusquedaBackingList(Arrays.asList(localizadorBusquedaIdioma), "idLocalizacion", "name");

    String usuario = form.getUsuario();
    LdapUserDetailsUtils.esAdministrador();
    try {
        // VALIDACIONES DE LOS CAMPOS DEL FORMULARIO
        String nombre = form.getNombre();
        String apellido1 = form.getApellido1();
        String apellido2 = form.getApellido2();

        Pattern mask = Pattern.compile("[^\\\\?\\\\!\\>\\#\\&\\<\\@\\$\\/\\\'\\\"]+");
        // Validaciones para password
        Pattern maskPwd = Pattern.compile("[^\\\\?\\\\!\\>\\#\\&\\<\\@\\$\\/\\\'\\\"]+");

        Matcher matcher = null;

        if (nombre.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("nombre.length() <= 0");
            throw new ValidatorException("{errors.altausuario.nombre}");
        }
        matcher = mask.matcher(nombre);
        if (!matcher.matches()) {
            if (log.isDebugEnabled())
                log.debug("nombre caracter ilegal");

            throw new ValidatorException("{errors.altausuario.nombre.caracterIlegal}");
        }

        if (apellido1.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("apellido1.length() <= 0");

            throw new ValidatorException("{errors.altausuario.apellido1}");
        }
        matcher = mask.matcher(apellido1);
        if (!matcher.matches()) {
            if (log.isDebugEnabled())
                log.debug("apellido1 caracter ilegal");
            throw new ValidatorException("{errors.altausuario.apellido1.caracterIlegal}");
        }

        if (apellido2.length() > 0) {
            matcher = mask.matcher(apellido2);
            if (!matcher.matches()) {
                if (log.isDebugEnabled())
                    log.debug("apellido2 caracter ilegal");
                throw new ValidatorException("{errors.altausuario.apellido2.caracterIlegal}");
            }
        }

        String nif = form.getNif();

        /*
            * if (!(validarNif(nif)).booleanValue()) { throw new
            * ValidatorException("{errors.altausuario.nifErroneo}"); }
            */

        String email = form.getEmail();

        if (email.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("email.length() <= 0");
            throw new ValidatorException("{errors.altausuario.email}");
        }
        if (!((email.indexOf("@") > 0) && (email.indexOf(".") > 0)) || (email.indexOf(" ") > 0)) {
            throw new ValidatorException("{errors.altausuario.emailIncorrecto}");
        }
        // Mas validaciones del campo email
        if (validaEmail(email) == Boolean.FALSE) {
            if (log.isDebugEnabled())
                log.debug("el email es erroneo " + email);
            throw new ValidatorException("{errors.altausuario.emailIncorrecto}");
        }
        if (usuario.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("usuario length() <= 0");
            throw new ValidatorException("{errors.altausuario.usuario}");
        }
        matcher = mask.matcher(usuario);
        if (!matcher.matches()) {
            if (log.isDebugEnabled())
                log.debug("nombre caracter ilegal");
            throw new ValidatorException("{errors.altausuario.usuario.caracterIlegal}");
        }
        //el usuario debe ir en minsculas - COMENTADO
        /*
        if (usuario.compareTo(usuario.toLowerCase())!=0){
           log("el usuario debe estar en minsculas");
           throw new ValidatorException("{errors.altausuario.usuario.minusculas}");
        }
        */

        String clave = form.getClave();
        if (clave.length() < 7) {
            if (log.isDebugEnabled())
                log.debug("clave .length() <= 7");
            throw new ValidatorException("{errors.altausuario.clave}");
        }
        matcher = maskPwd.matcher(clave);
        if (!matcher.matches()) {
            if (log.isDebugEnabled())
                log.debug("contrasea caracter ilegal");
            throw new ValidatorException("{errors.altausuario.clave.caracterIlegal}");
        }

        String repitaClave = form.getRepitaClave();
        if (!(clave.equalsIgnoreCase(repitaClave))) {
            throw new ValidatorException("{errors.altausuario.claveDistintas}");
        }

        String openIdUrl = form.getOpenIdUrl();
        if (openIdUrl != null && openIdUrl.length() > 0) {
            UsuarioVO usuariovo = this.getSrvAdminUsuariosService().obtenerUsuarioConOpenId(openIdUrl);
            if (usuariovo != null) {
                if (log.isDebugEnabled())
                    log.debug("Ese identificador de openId ya existe en la base de datos");
                throw new ValidatorException("{errors.altausuario.existe.openId}");
            }

        }
        String idiomaBusqueda = form.getIdiomaBusqueda();

        if (idiomaBusqueda == null) {
            throw new ValidatorException("{errors.altausuario.idiomaBusqueda}");
        }
        if (idiomaBusqueda.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("empaquetador .length() <= 0");
            throw new ValidatorException("{errors.altausuario.idiomaBusqueda}");
        }

        String idioma = form.getIdioma();
        if (idioma == null) {
            throw new ValidatorException("{errors.altausuario.idioma}");
        }
        if (idioma.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("empaquetador .length() <= 0");
            throw new ValidatorException("{errors.altausuario.idioma}");
        }

        String tipoEmpaquetador = form.getTipoEmpaquetador();
        if (tipoEmpaquetador == null) {
            throw new ValidatorException("{errors.altausuario.tipoEmpaquetador}");
        }
        if (tipoEmpaquetador.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("empaquetador .length() <= 0");
            throw new ValidatorException("{errors.altausuario.tipoEmpaquetador}");
        }

        String tipoCatalogador = form.getTipoCatalogador();
        if (tipoCatalogador == null) {
            throw new ValidatorException("{errors.altausuario.tipoCatalogador}");
        }
        if (tipoCatalogador.length() <= 0) {
            if (log.isDebugEnabled())
                log.debug("catalogador.length() <= 0");
            throw new ValidatorException("{errors.altausuario.tipoCatalogador}");
        }

        long cuota = 0;
        if (form.getCuota().length() > 0) {

            //comprobamos que la cuota son unicamente numeros
            Pattern maskNum = Pattern.compile("[0-9]+");
            matcher = maskNum.matcher(form.getCuota());
            if (!matcher.matches()) {
                if (log.isDebugEnabled())
                    log.debug("cuota caracter ilegal");
                throw new ValidatorException("{errors.altausuario.cuota.caracterIlegal}");
            }

            //pasamos de mbytes a bytes la cuota
            cuota = Long.valueOf(form.getCuota()).longValue() * 1024 * 1024;
        } else {//Por defecto,si no introducen nign valor le podremos 5 Mb
            cuota = Long.valueOf(
                    AgregaPropertiesImpl.getInstance().getProperty(AgregaProperties.VALOR_CUOTA_DEFECTO))
                    .longValue() * 1024 * 1024;
        }

        // Una vez recojo todos los datos del formulario compruebo si el
        // usuario(NIF) ya esta dado de alta si lo esta y no tiene fecha
        // de
        // baja
        // saco un mensaje de error.
        UsuarioVO usuarioExistente = this.getSrvAdminUsuariosService().obtenerUsuario(nif.toUpperCase());

        if (usuarioExistente == null) {
            if (log.isDebugEnabled())
                log.debug("No existe en BD otro usuario con ese mismo nif");

            // Chequeamos si el usuario introducido ya esta en la BD en ese
            // caso
            // sacamos un mensaje de error
            Boolean existeUsuario = this.getSrvAdminUsuariosService().existeUsuario(usuario);
            if (existeUsuario.booleanValue()) {
                log.error("El usuario introducido en el formulario ya se encuentra registrado");
                throw new ValidatorException("{errors.altausuario.usuarioExistente}");
            } else {
                if (log.isDebugEnabled())
                    log.debug("El usuario introducido en el formulario no se encuentra en la BD");
                UsuarioVO usuarioVO = new UsuarioVO();
                usuarioVO.setApellido1(apellido1);
                usuarioVO.setApellido2(apellido2);
                usuarioVO.setClave(clave);
                usuarioVO.setEmail(email);
                usuarioVO.setIdiomaBusqueda(idiomaBusqueda);
                usuarioVO.setNIF(nif.toUpperCase());
                usuarioVO.setNombre(nombre);
                usuarioVO.setUsuario(usuario);
                usuarioVO.setTipoEmpaquetador(tipoEmpaquetador);
                usuarioVO.setFechaAlta(new GregorianCalendar());
                usuarioVO.setFechaSolicitudAlta(null);
                usuarioVO.setIdioma(idioma);
                usuarioVO.setCuota(new Long(cuota));
                usuarioVO.setTipoCatalogador(tipoCatalogador);
                usuarioVO.setOpenIdUrl(openIdUrl);
                AltaUsuarioBSession altaUsuarioBSesion = this.getAltaUsuarioBSession(request);
                if (log.isDebugEnabled())
                    log.debug("altaUsuarioBSesion " + altaUsuarioBSesion);
                altaUsuarioBSesion.setUsuario(usuarioVO);
            }

        } else {
            if (usuarioExistente.getFechaBaja() == null) {
                if (log.isDebugEnabled())
                    log.debug("Saco un mensaje de error ya existe un usuario con ese nif");
                throw new ValidatorException("{errors.altausuario.nifExistente}");
            } else {
                // Se mantendr la fecha de alta y el usuario, se
                // modificara
                // la clave en el servidor ldap
                if (log.isDebugEnabled())
                    log.debug("Voy a hacer una modificacion mantengo el usuario, la fecha de alta y el nif");
                usuarioExistente.setApellido1(apellido1);
                usuarioExistente.setApellido2(apellido2);
                usuarioExistente.setClave(clave);
                usuarioExistente.setEmail(email);
                usuarioExistente.setIdiomaBusqueda(idiomaBusqueda);
                usuarioExistente.setNombre(nombre);
                usuarioExistente.setTipoEmpaquetador(tipoEmpaquetador);
                usuarioExistente.setIdioma(idioma);
                usuarioExistente.setOpenIdUrl(openIdUrl);
                usuarioExistente.setFechaBaja(null);
                usuarioExistente.setFechaSolicitudAlta(null);
                if (log.isDebugEnabled())
                    log.debug("Antes de guardar en sesion el usuarioVO ");
                this.getAltaUsuarioBSession(request).setUsuario(usuarioExistente);
                if (log.isDebugEnabled())
                    log.debug("Se guarda en sesion el usuarioVO ");
            }
        }
    } catch (ValidatorException validator) {
        log.error("Se produce la siguiente excepcion ", validator);
        throw validator;
    } catch (Exception e) {
        log.error("Se produce la siguiente excepcion ", e);
        throw new ValidatorException("{errors.altausuario}");
    }
    try {
        GrupoVO[] grupoVO = this.getSrvAdminUsuariosService().listarGrupos();
        form.setGruposAsArray(grupoVO);
    } catch (Exception e) {
        log.error("Error al recoger los parametros del usuario y comprobar si esta registrado en el sistema "
                + e);
        throw new ValidatorException("{errors.altausuario}");
    }
}

From source file:es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.BajaCatalogadoresControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.BajaCatalogadoresController#bajaCatalogadores(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.BajaCatalogadoresForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//*from   w  w w  . ja  v a2s. c o m*/
public final void bajaCatalogadores(ActionMapping mapping,
        es.pode.administracion.presentacion.catalogacion.bajaCatalogadores.BajaCatalogadoresForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    String listaId = request.getParameter("listaId");
    if (log.isDebugEnabled())
        log.debug("los ids de usuario que se quieren eliminar son " + listaId);
    Object[] objeto = listaId.split(" ");
    ResourceBundle ficheroRecursos = null;

    try {

        SrvAdminUsuariosService srvAdminUsuariosService = this.getSrvAdminUsuariosService();
        ValidaBajaGrupoTrabajoVO validaBaja = srvAdminUsuariosService.bajaGrupoTrabajo(obtenerIds(objeto));
        Locale locale = request.getLocale();
        ficheroRecursos = this.getFicherRecursos(locale);
        form.setDescripcionBaja(ficheroRecursos.getString(validaBaja.getDescripcion()));
        form.setGruposTrabajoBorrados(validaBaja.getItemsDeleted());
    } catch (Exception e) {
        log.error("Se ha producido un error al eliminar el usuario " + e);
        throw new ValidatorException("{errors.borrarUsuario}");
    }
}

From source file:es.pode.administracion.presentacion.adminusuarios.bajaUsuario.BajaUsuarioControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.adminusuarios.bajaUsuario.BajaUsuarioController#bajaUsuario(org.apache.struts.action.ActionMapping,
 *      es.pode.administracion.presentacion.adminusuarios.bajaUsuario.BajaUsuarioForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *//* w  w w  .j a v a  2  s. co  m*/
public final void bajaUsuario(ActionMapping mapping,
        es.pode.administracion.presentacion.adminusuarios.bajaUsuario.BajaUsuarioForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    String listaId = request.getParameter("listaId");
    if (log.isDebugEnabled())
        log.debug("los ids de usuario que se quieren eliminar son " + listaId);
    Object[] objeto = listaId.split(" ");

    ResourceBundle ficheroRecursos = null;
    try {

        String login = LdapUserDetailsUtils.getLogin();
        SrvAdminUsuariosService srvAdminUsuariosService = this.getSrvAdminUsuariosService();
        UsuarioVO emailAdmin = srvAdminUsuariosService.obtenerDatosUsuario(login);
        ValidaBajaUsuarioVO validaBaja = srvAdminUsuariosService.bajaUsuario(obtenerIds(objeto), emailAdmin);
        Locale locale = request.getLocale();
        ficheroRecursos = this.getFicherRecursos(locale);
        form.setUsuariosDeleted(validaBaja.getItemsDeleted());
        form.setDescripcionBaja(ficheroRecursos.getString(validaBaja.getDescripcion()));
        form.setUsuariosDeleted(validaBaja.getItemsDeleted());

    } catch (Exception e) {
        log.error("Se ha producido un error al eliminar el usuario " + e);
        throw new ValidatorException("{errors.borrarUsuario}");
    }

}