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.nodos.verNodo.VerNodoControllerImpl.java

/**
 * Este metodo muestra los detalles de un nodo determinado
 * @param mapping //from  www  .ja  v a2  s .  com
 * @param form Formulario del tipo CargarNodoForm que contiene los datos que se necesitan pasar para
 *         mostrar los detalles del nodo
 * @param request
 * @param response
 */
public final void cargarNodo(ActionMapping mapping,
        es.pode.administracion.presentacion.nodos.verNodo.CargarNodoForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    try {

        Long id = Long.valueOf(request.getParameter("id"));
        NodoVO nodo = this.getSrvNodoService().obtenerNodo(id);
        CcaaVO ccaa = nodo.getCcaa();

        form.setNodo(nodo.getNodo());
        form.setUrl(nodo.getUrl());
        form.setPuerto(nodo.getPuerto());
        form.setId(nodo.getId());
        form.setUrlWS(nodo.getUrlWS());
        form.setIdNodo(nodo.getIdNodo());
        if (ccaa != null) {
            form.setComunidad(ccaa.getDescripcion());
        }

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

}

From source file:es.pode.administracion.presentacion.adminusuarios.altaGrupo.AltaGrupoControllerImpl.java

/**
 * @see es.pode.adminusuarios.presentacion.altaGrupo.AltaGrupoController#altaGrupo(org.apache.struts.action.ActionMapping,
 *      es.pode.adminusuarios.presentacion.altaGrupo.AltaGrupoForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 * /*from   w  w  w.ja va 2s. c  om*/
 */
public final void altaGrupo(ActionMapping mapping, AltaGrupoForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    try {
        GrupoVO grupoVO = new GrupoVO();
        AltaGrupoBSession altaGrupoBSession = this.getAltaGrupoBSession(request);
        grupoVO.setDescripcion(altaGrupoBSession.getDescripcion());
        String[] ids = form.getIdRowSelectionAsArray();
        if ((ids == null) || (ids.length == 0)) {

            if (log.isDebugEnabled())
                log.debug("No se ha seleccionado ningun permiso");
            throw new ValidatorException("{errors.altagrupo.roles}");
        }

        SrvAdminUsuariosService srvAdminUsuariosService = this.getSrvAdminUsuariosService();
        RolVO[] rolVO = new RolVO[ids.length];

        Long idL = null;
        for (int i = 0; i < ids.length; i++) {
            idL = new Long(ids[i]);
            RolVO rolG = srvAdminUsuariosService.getRol(idL);

            // rolG.setId(idL);
            rolVO[i] = rolG;

        }
        grupoVO.setRols(rolVO);
        if (log.isDebugEnabled())
            log.debug("Elimino de la sesion la descripcion del grupo");
        this.removeAltaGrupoBSession(request);
        Long idCreado = srvAdminUsuariosService.altaGrupo(grupoVO);
        form.setIdModificado(idCreado);
        // /Elimino de la sesion la descripcion del grupo
    } catch (ValidatorException e) {
        throw e;
    } catch (Exception e) {
        log.error("Error: " + e);
        throw new ValidatorException("{errors.altagrupo}");
    }

}

From source file:es.pode.empaquetador.presentacion.basico.desagregar.DesagregarBasicoControllerImpl.java

/**
 * @see es.pode.empaquetador.presentacion.basico.desagregar.DesagregarBasicoController#crearSesion(org.apache.struts.action.ActionMapping, es.pode.empaquetador.presentacion.basico.desagregar.CrearSesionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *///from w  w w. jav  a  2s .c  om
public final void crearSesion(ActionMapping mapping,
        es.pode.empaquetador.presentacion.basico.desagregar.CrearSesionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    try {

        List identificadores = form.getIdentificadores();
        if (identificadores == null) {
            logger.error("Identificadores null en crearSesion de desagregarbasico");
            throw new ValidatorException("{gestor_basico.desagregar.error.identificadores}");
        }
        if (logger.isDebugEnabled())
            logger.debug("Creando sesion desagregar basico para exportar " + identificadores.size()
                    + " items como ode");
        GrupoVO[] hijos = gs.buscarHijosIdCollection(request);
        List grupos = new ArrayList();
        for (int i = 0; i < hijos.length; i++) {
            if (identificadores.contains(hijos[i].getIdentifier()))
                grupos.add(hijos[i]);
        }
        if (logger.isDebugEnabled())
            logger.debug(grupos.size() + " gruposVO encontrados para desagregar");
        this.getDesagregarBasicoSession(request).setGrupos(grupos);
    } catch (Exception e) {
        logger.error(e);
        throw e;
    }
}

From source file:es.pode.gestorFlujo.presentacion.objetosPublicados.ObjetosPublicadosControllerImpl.java

/**
 * @see es.pode.gestorFlujo.presentacion.objetosPublicados.ObjetosPublicadosController#cargarODESPublicados(org.apache.struts.action.ActionMapping, es.pode.gestorFlujo.presentacion.objetosPublicados.CargarODESPublicadosForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//*w w  w .jav  a 2s .  co m*/
public final void cargarODESPublicados(ActionMapping mapping,
        es.pode.gestorFlujo.presentacion.objetosPublicados.CargarODESPublicadosForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    SrvPublicacionService publi = this.getSrvPublicacionService();

    logger.info("Cargando odes publicados para: " + LdapUserDetailsUtils.getUsuario());

    //      Los idiomas del buscador
    try {
        form.setListaODESAsArray(publi.obtenODEsPublicadosPorUsuario(LdapUserDetailsUtils.getUsuario()));
        logger.info("Odes publicados cargados correctamente para: " + LdapUserDetailsUtils.getUsuario());
    } catch (Exception ex) {
        logger.error("Error inesperado cargando objetos publicados para: " + LdapUserDetailsUtils.getUsuario(),
                ex);
        throw new ValidatorException("{gestorFlujo.error.inesperado}");
    }

}

From source file:es.pode.administracion.presentacion.catalogacion.modificarCatalogadores.modificarCatalogadoresControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.catalogacion.modificarCatalogadores.modificarCatalogadoresController#cargarDescripcion(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.catalogacion.modificarCatalogadores.CargarDescripcionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//*from ww  w .  ja  v  a 2 s  .c om*/
public final void cargarDescripcion(ActionMapping mapping,
        es.pode.administracion.presentacion.catalogacion.modificarCatalogadores.CargarDescripcionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    try {

        Long id = form.getId();
        GrupoTrabajoVO grupoTrabajo = this.getSrvAdminUsuariosService().descripcionGrupoTrabajo(id);
        log("Obtengo el grupoTrabajoVO seleccionado");
        form.setNombre(grupoTrabajo.getNombre());
        form.setDescripcion(grupoTrabajo.getDescripcion());
        form.setId(grupoTrabajo.getIdentificador());
    } catch (Exception e) {
        log.error("Error: " + e);
        throw new ValidatorException("{modificarGrupo.error}");
    }
}

From source file:es.pode.administracion.presentacion.adminusuarios.listarGrupos.ListarGruposControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.adminusuarios.listarGrupos.ListarGruposController#recuperarGrupos(org.apache.struts.action.ActionMapping,
 *      es.pode.administracion.presentacion.adminusuarios.listarGrupos.RecuperarGruposForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *///from w w w .j  a va  2  s.c om
public final void recuperarGrupos(ActionMapping mapping,
        es.pode.administracion.presentacion.adminusuarios.listarGrupos.RecuperarGruposForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    try {
        AltaGrupoBSession altaGrupoBSession = this.getAltaGrupoBSession(request);
        this.removeAltaGrupoBSession(request);
        GrupoVO[] grupoVO = this.getSrvAdminUsuariosService().listarGrupos();
        form.setGruposAsArray(grupoVO);
    } catch (Exception e) {
        log.error("Error: " + e);
        throw new ValidatorException("{listarGrupos.error}");
    }
}

From source file:es.pode.modificador.presentacion.informes.ode.InformeODEControllerImpl.java

/**
 * @see es.pode.modificador.presentacion.informes.ode.InformeODEController#obtenerDatos(org.apache.struts.action.ActionMapping, es.pode.modificador.presentacion.informes.ode.ObtenerDatosForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//* w  w w . j a va  2  s .  c  o  m*/
public final void obtenerDatos(ActionMapping mapping,
        es.pode.modificador.presentacion.informes.ode.ObtenerDatosForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    try {
        form.setResultadoTarea(form.getOde().getStatus().getValue());
        form.setDescResultado(form.getOde().getMsgError());
        form.setNombreTarea(this.getInformeSession(request).getNombreTarea());
        Logger.getLogger(this.getClass()).debug("el ode es :" + form.getOde());
        form.setIdiomaBuscadorBackingList(
                IdiomasBuscadorSingleton.getInstance().obtenerIdiomas(LdapUserDetailsUtils.getIdioma()),
                "idLocalizacion", "nombre");
    } catch (Exception e) {
        logger.error("No se pudo obtener el ODE debido a " + e.getMessage());
        throw new ValidatorException("{informeODE.exception}");
    }
}

From source file:es.pode.empaquetador.presentacion.agregar.AgregarSubmanifiestoControllerImpl.java

/**
 * @see es.pode.empaquetador.presentacion.agregar.AgregarSubmanifiestoController#seleccionarOrigen(org.apache.struts.action.ActionMapping, es.pode.empaquetador.presentacion.agregar.SeleccionarOrigenForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//*from   w  w w  . ja v  a 2 s .c  o m*/
public final java.lang.String seleccionarOrigen(ActionMapping mapping,
        es.pode.empaquetador.presentacion.agregar.SeleccionarOrigenForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    java.util.Locale locale = (Locale) request.getSession().getAttribute(ConstantesAgrega.DEFAULT_LOCALE);
    ResourceBundle i18n = ResourceBundle.getBundle("application-resources", locale);
    String origen = form.getOrigen();
    String accion = form.getAction();
    String resultado = null;

    if (accion.equals(i18n.getString("portal_empaquetado_agregarSubmanifiestos.continuar"))) {
        if ((origen.equals("Local")) || (origen.equals("Personales")) || (origen.equals("Repositorio"))) {
            resultado = origen;
        } else {
            throw new ValidatorException("{portal_empaquetado.exception}");
        }

    } else {
        resultado = "Cancelar";
    }
    return resultado;
}

From source file:es.pode.administracion.presentacion.informes.listarInformes.ListarInformesControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.informes.listarInformes.ListarInformesController#listarInformes(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.informes.listarInformes.ListarInformesForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */// ww w  . j  av  a2 s. c  om
public final void listarInformes(ActionMapping mapping,
        es.pode.administracion.presentacion.informes.listarInformes.ListarInformesForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    try {
        SrvInformeService srvInformeService = this.getSrvInformeService();
        InformeVO[] informes = srvInformeService.listarInformes();
        form.setInformesAsArray(cambiarFechaInforme(informes));
    } catch (Exception e) {
        log.error("Se ha producido un error al listar los informes: " + e);
        throw new ValidatorException("{errors.listarInformes}");
    }

}

From source file:es.pode.administracion.presentacion.logs.listar.ListarLogControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.logs.listar.ListarLogController#listarLogs(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.logs.listar.ListarLogsForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *///from   w  ww  .  j  a  va2 s .  com
public final void listarLogs(ActionMapping mapping,
        es.pode.administracion.presentacion.logs.listar.ListarLogsForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    try {

        SrvLogService logService = this.getSrvLogService();
        FileVO[] logs = logService.listarFicherosLog();
        form.setLogsAsArray(logs);
    } catch (Exception e) {
        log.error("Se ha producido un error al listar los ficheros de log: " + e);
        throw new ValidatorException("{errors.listarlogs}");
    }
}