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.modificador.presentacion.configurar.objetos.resultados.ResultadosBuscarObjetoControllerImpl.java

/**
 * @see es.pode.modificador.presentacion.configurar.objetos.resultados.ResultadosBuscarObjetoController#seleccionar(org.apache.struts.action.ActionMapping,
 *      es.pode.modificador.presentacion.configurar.objetos.resultados.SeleccionarForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *///from   w  w  w  .  ja  va 2s.  com
public final void seleccionar(ActionMapping mapping,
        es.pode.modificador.presentacion.configurar.objetos.resultados.SeleccionarForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    List paths = form.getPaths();
    BusquedaSession sesion = getBusquedaSession(request);
    List resultados = sesion.getResultados();
    if (paths != null) {
        List actuales = sesion.getSeleccionados();
        if (actuales == null) {
            actuales = new ArrayList();
        }
        boolean alreadyAdded = false;
        for (Iterator iter = paths.iterator(); iter.hasNext();) {
            String path = (String) iter.next();
            for (Iterator iterator = resultados.iterator(); iterator.hasNext();) {
                DocVO element = (DocVO) iterator.next();
                if (element.getLocalizadorODE().equals(path)) {
                    if (!actuales.contains(element)) {
                        actuales.add(element);
                    } else {
                        //Est repetido
                        alreadyAdded = true;
                    }
                }
            }
        }

        getBusquedaSession(request).setSeleccionados(actuales);
        setBusquedaSession(request, sesion);
        //Mensaje de ya existente
        if (alreadyAdded) {
            throw new ValidatorException("{resultadosBusqueda.repeated}");
        }
    }
}

From source file:es.pode.gestorFlujo.presentacion.objetosPersonales.importar.ImportarControllerImpl.java

/**
 * @param form// w  w w. j  a v  a 2  s . c  om
 * @param request
 * @param estadoActual
 * @param formFile
 * @param caja
 * @param odeOrder
 * @throws ValidatorException
 */
private void comprobarFormFile(es.pode.gestorFlujo.presentacion.objetosPersonales.importar.ImportarODEForm form,
        HttpServletRequest request, CurrentState estadoActual, FormFile formFile, String caja, String odeOrder)
        throws ValidatorException {
    if (formFile != null && formFile.getFileName().length() != 0) {
        if (logger.isDebugEnabled())
            logger.debug("El espacio libre restante:" + form.getEspacioLibre());
        if (estadoActual.diferencia > 0) {
            estadoActual.hemoshechoalgo = true;
            try {
                ResultadoImportacion resultadoParcial = new ResultadoImportacion();
                resultadoParcial.setTitulo(formFile.getFileName());
                ResultadoOperacionVO unResultado = new ResultadoOperacionVO();
                unResultado = importarUnODE(formFile, formFile.getFileName(),
                        request.getLocale().getLanguage());
                if (unResultado.getIdResultado().equals("0.0")) {
                    resultadoParcial.setValido(null);
                    estadoActual.nr_archivos_subidos++;
                    estadoActual.archivosSubidos = estadoActual.archivosSubidos + formFile.getFileName() + ",";
                    estadoActual.diferencia = estadoActual.diferencia - unResultado.getTamainoODE();
                } else if (unResultado.getIdResultado().equals("0.1")) {
                    logger.debug("Borrados vocabularios controlados y fechas incorrectas");
                    resultadoParcial.setValido(RESULTADO_SI);
                    resultadoParcial.setMensajes(unResultado.getDescripcion().split(splitter));
                    estadoActual.nr_archivos_subidos++;
                    estadoActual.archivosSubidos = estadoActual.archivosSubidos + formFile.getFileName() + ",";
                    estadoActual.diferencia = estadoActual.diferencia - unResultado.getTamainoODE();
                } else {
                    resultadoParcial.setValido(RESULTADO_NO);
                    logger.error("El archivo de la " + caja + " no se ha podido importar: "
                            + unResultado.getDescripcion());
                    //               saveErrorMessage(request, "gestorFlujo.error.importar.validar", new String[] {
                    //                     form.getFicheroODE1().getFileName(), unResultado.getDescripcion() });               
                    resultadoParcial.setMensajes(unResultado.getDescripcion().split(splitter));
                    estadoActual.diferencia = form.getEspacioLibre();
                }
                estadoActual.resultado.add(resultadoParcial);
                //               resultado.add(resultadoParcial);

            } catch (Exception ex) {
                logger.error("Excepcion al importar el ode " + caja + ": ", ex);
                throw new ValidatorException("{gestorFlujo.error.inesperado}");
            }
        } else {
            //            diferencia=form.getEspacioLibre();
            ResultadoImportacion resultadoParcial = new ResultadoImportacion();
            String[] textos = new String[1];
            String texto = "El " + odeOrder
                    + " no se ha podido importar, pues excede la cuota libre del usuario:"
                    + estadoActual.diferencia;
            textos[0] = texto;
            logger.error("El " + odeOrder + " no se ha podido importar, pues excede la cuota libre del usuario:"
                    + estadoActual.diferencia);
            resultadoParcial.setMensajes(textos);
            resultadoParcial.setTitulo(formFile.getFileName());
            resultadoParcial.setValido(RESULTADO_NO);
            estadoActual.resultado.add(resultadoParcial);
            //            resultado.add(resultadoParcial);

        }

    }
}

From source file:es.pode.administracion.presentacion.noticias.crear.CrearControllerImpl.java

public void crearNoticiaUno(ActionMapping mapping, CrearNoticiaUnoForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    /**//from  ww w. j a va  2 s.c  o  m
     * **************************************************************************************************************************************
     * ********************************************** SE COMPRUEBA LA CATEGORIA *************************************************************
     * **************************************************************************************************************************************
     * */
    if (form.getCategoria() == null) {
        logger.error("Categoria es un campo obligatorio");
        throw new ValidatorException("{errors.noticia.categoria}");
    }
    CategoriaNoticiaVO categoria = this.getSrvNoticiasService().obtenerCategoria(form.getCategoria());
    ArrayList idiomasList = new ArrayList();
    CategoriaIdiomaNoticiaVO[] idiomasCategorias = categoria.getCategoriaIdioma();
    for (int i = 0; i < idiomasCategorias.length; i++)
        idiomasList.add(idiomasCategorias[i].getIdioma());

    form.setIdiomasCategoriasBBDDAsArray((String[]) idiomasList.toArray(new String[0]));

    //Se comprueba si el formulario fue invalido pero se recuperan los valores introducidos
    if ((form.getCastellano() != null && form.getCastellano().length > 0)
            || (form.getCatalan() != null && form.getCatalan().length > 0)
            || (form.getEuskera() != null && form.getEuskera().length > 0)
            || (form.getIngles() != null && form.getIngles().length > 0)
            || (form.getValenciano() != null && form.getValenciano().length > 0)
            || (form.getGallego() != null && form.getGallego().length > 0)) {
        logger.debug(
                "El formulario no ha validado, pero se recuperan los valores introducidos en cada globo (castellano, ingles, catalan, gallego, valenciano y euskera)");
        String[] castellano = form.getCastellano();
        String[] catalan = form.getCatalan();
        String[] euskera = form.getEuskera();
        String[] ingles = form.getIngles();
        String[] valenciano = form.getValenciano();
        String[] gallego = form.getGallego();

        form.setIdiomas(dameIdiomas(castellano, catalan, ingles, euskera, gallego, valenciano));
        form.setIdiomasAlta(dameIdiomas(castellano, catalan, ingles, euskera, gallego, valenciano));
        form.setTitulo(dameTitulos(castellano, catalan, ingles, euskera, gallego, valenciano));
        form.setResumen(dameResumenes(castellano, catalan, ingles, euskera, gallego, valenciano));
        form.setCuerpo(dameCuerpos(castellano, catalan, ingles, euskera, gallego, valenciano));
        form.setNombreCategoria(dameCategorias(castellano, catalan, ingles, euskera, gallego, valenciano));
    } else {

        /**
        * **************************************************************************************************************************************
        * ********************************************** SE COMPRUEBA LA IMAGEN ****************************************************************
        * **************************************************************************************************************************************
        * */
        //Se puede elegir con o sin imagen
        // 2 Sin imagen 3 con imagen
        if (form.getActivarImagen().toString().equals(TRES)) {
            logger.debug("Noticia con imagen");
            if (form.getImagen().getFileSize() == 0) {
                //No se ha seleccionado una imagen
                logger.error("Error se debe seleccionar una imagen");
                throw new ValidatorException("{errors.noticias.imagenVacio}");
            } else {
                if (form.getImagen().getFileSize() > 0) {
                    //comprobamos que sea una imagen de tipo jpg, gif, o png
                    if (form.getImagen().getContentType().equalsIgnoreCase("image/jpeg")
                            || form.getImagen().getContentType().equalsIgnoreCase("image/png")
                            || form.getImagen().getContentType().equalsIgnoreCase("image/gif")
                            || form.getImagen().getContentType().equalsIgnoreCase("image/pjpeg")) {
                        //Se ha seleccionado una imagen
                        //Se comprueba si se ha seleccionado el alineamiento
                        if (form.getAlineamiento() == null) {
                            logger.error("Error se debe seleccionar un alineamiento");
                            throw new ValidatorException("{errors.noticias.alineamientoVacio}");
                        }
                        if (logger.isDebugEnabled())
                            logger.debug(
                                    "El valor de la imagen seleccionado es valido [" + form.getImagen() + "]");
                        form.setNombreImagen(form.getImagen().getFileName());
                        request.getSession().setAttribute(IMAGEN, form.getImagen());

                    } else {
                        logger.error("Error en la imagen");
                        throw new ValidatorException("{errors.noticias.noImagen}");
                    }
                }
            }
        }

        ArrayList nombreCategoria = new ArrayList();
        ArrayList idiomas = new ArrayList();

        if (logger.isDebugEnabled())
            logger.debug("Se obtiene la categoria con identificador [" + form.getCategoria() + "]");
        try {

            /**
             * **************************************************************************************************************************************
             * ********************************************** SE ALMACENA LOS DATOS *****************************************************************
             * **************************************************************************************************************************************
             * */
            //          Se almacena los datos
            if (categoria != null) {
                CategoriaIdiomaNoticiaVO[] categoriasIdiomas = categoria.getCategoriaIdioma();
                for (int i = 0; categoriasIdiomas != null && i < categoriasIdiomas.length; i++) {
                    if (categoriasIdiomas[i].getNombreCategoria() != null
                            && !("").equals(categoriasIdiomas[i].getNombreCategoria())) {
                        nombreCategoria.add(categoriasIdiomas[i].getNombreCategoria());
                        idiomas.add(categoriasIdiomas[i].getIdioma());
                    }
                }
            }

            request.getSession().setAttribute(CATEGORIAVO, categoria);
        } catch (Exception e) {
            logger.error("Error obteniendo la categoria");
            throw new ValidatorException("{errors.categoria.ver}");
        }

        form.setIdiomas(idiomas);
        form.setNombreCategoria(nombreCategoria);
    }

}

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

public final java.lang.String selectAction(ActionMapping mapping,
        es.pode.empaquetador.presentacion.avanzado.organizaciones.elementos.gestor.SelectActionForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    /*/*from   w  w w .ja  va2s .c  om*/
    * 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(COPIAR_ACTION))) {
        result = COPIAR;
    } else if (actionSubmit.equals(i18n.getString(CORTAR_ACTION))) {
        result = CORTAR;
    } else if (actionSubmit.equals(i18n.getString(PEGAR_ACTION))) {
        result = "Pegar";
    } else if (actionSubmit.equals(i18n.getString(ELIMINAR_ACTION))) {
        result = "Eliminar";
    } else if (actionSubmit
            .equals(i18n.getString("portal_empaquetado_gestorOrganizaciones.crearGrupoElemento"))) {
        result = "CrearGrupo";
    } else if (actionSubmit.equals(i18n.getString("portal_empaquetado_gestorOrganizaciones.crearElemento"))) {
        result = "CrearElemento";
    }

    return result;
}

From source file:es.pode.empaquetador.presentacion.avanzado.recursos.crear.elementos.CrearRecursoAvanzadoElementosControllerImpl.java

@Override
public final java.lang.String selectActionCrear(ActionMapping mapping,
        es.pode.empaquetador.presentacion.avanzado.recursos.crear.elementos.SelectActionCrearForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    String result = null;/*from   www . ja  v a2 s .  c  o  m*/
    String actionSubmit = form.getAction();
    java.util.Locale locale = (Locale) request.getSession().getAttribute(ConstantesAgrega.DEFAULT_LOCALE);
    ResourceBundle i18n = ResourceBundle.getBundle("application-resources", locale);
    if (logger.isDebugEnabled())
        logger.debug("selectActionCrear: action = " + form.getAction() + " de ["
                + i18n.getString("portalempaquetado.avanzado.recursos.cancelar") + " , "
                + i18n.getString("portalempaquetado.avanzado.recursos.aceptar"));
    if (form.getAction() == (null)) {
        throw new ValidatorException("{portal_empaquetado.exception}");
    } else if (actionSubmit.equals(i18n.getString("portalempaquetado.avanzado.recursos.cancelar"))) {
        if (logger.isDebugEnabled())
            logger.debug("Metodo SelectActionCrear;actionSubmit vale [" + actionSubmit + "]");
        if (logger.isDebugEnabled())
            logger.debug("result va a valer Cancelar");

        result = "Cancelar";
    } else if (actionSubmit.equals(i18n.getString("portalempaquetado.avanzado.recursos.aceptar"))) {
        if (logger.isDebugEnabled())
            logger.debug("Metodo SelectActionCrear;actionSubmit vale [" + actionSubmit + "]");
        if (logger.isDebugEnabled())
            logger.debug("result va a valer Crear");

        result = "Crear";
    } else {
        Logger.getLogger(this.getClass())
                .error("El valor del submit no es correcto (actionSubmit = " + actionSubmit + ";");
    }
    return result;
}

From source file:es.pode.administracion.presentacion.adminusuarios.altaUsuarioPendiente.AltaUsuarioPendienteControllerImpl.java

/**
 * @see es.pode.administracion.presentacion.adminusuarios.altaUsuarioPendiente.AltaUsuarioPendienteController#submit(org.apache.struts.action.ActionMapping, es.pode.administracion.presentacion.adminusuarios.altaUsuarioPendiente.SubmitForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 *//* w  ww.  jav  a  2  s  . com*/
public final void submit(ActionMapping mapping,
        es.pode.administracion.presentacion.adminusuarios.altaUsuarioPendiente.SubmitForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    try {
        AltaUsuarioPendienteBSession altaUsuarioBSession = this.getAltaUsuarioPendienteBSession(request);
        UsuarioVO usuarioSesion = altaUsuarioBSession.getUsuarioPendiente();
        String[] ids = form.getIdRowSelectionAsArray();
        SrvAdminUsuariosService srvAdminUsuariosService = this.getSrvAdminUsuariosService();

        if (ids == null) {
            log("No se ha seleccionado ningun grupo");
            throw new ValidatorException("{errors.altaUsuarioPendiente.gruposVacio}");
            //usuarioSesion.setGrupos(null);

        } else {
            GrupoVO[] grupoVO = new GrupoVO[ids.length];
            Long idL = null;
            for (int i = 0; i < ids.length; i++) {
                idL = new Long(ids[i]);

                GrupoVO grupoG = srvAdminUsuariosService.descripcionGrupo(idL);
                grupoVO[i] = grupoG;

            }
            usuarioSesion.setGrupos(grupoVO);
        }
        this.getAltaUsuarioPendienteBSession(request).setUsuarioPendiente(usuarioSesion);
    } catch (ValidatorException ve) {
        log.error("Se produce un error ValidatorException " + ve);
        throw ve;
    } catch (Exception e) {
        log.error("Error al obtener los grupos seleccionados ", e);
    }
}

From source file:es.pode.modificador.presentacion.pendientes.ModificacionesPendientesControllerImpl.java

public void exportarTarea(ActionMapping mapping, ExportarTareaForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    final int BUFFER_SIZE = 2048;
    Long idModificacion = form.getIdModificacion();
    ModificacionVO mod = this.getSrvHerramientaModificacion().obtenerModificacion(idModificacion);
    String nombre = mod.getNombre();
    ConfiguracionTarea tarea = this.getSrvHerramientaModificacion().obtenerConfiguracionTarea(idModificacion);
    DataHandler data;/*from   ww w.j a  v  a  2  s  .c om*/
    try {
        data = this.getSrvHerramientaModificacion().exportarModificacion(tarea);
    } catch (Exception e) {
        logger.debug("Error al exportar modificacion: " + e);
        throw new ValidatorException("{exportarModificacion.error}");
    }

    response.setContentType("text/xml");
    response.setHeader("Content-Disposition",
            "attachment;filename=" + nombre.replace(' ', '_').trim() + ".xml");
    OutputStream out = response.getOutputStream();
    InputStream in = data.getInputStream();
    logger.debug("Descargando fichero Configuracion.xml");
    byte[] buffer = new byte[BUFFER_SIZE];
    int count;
    while ((count = in.read(buffer, 0, BUFFER_SIZE)) != -1) {
        out.write(buffer, 0, count);
    }

    out.flush();
}

From source file:es.pode.administracion.presentacion.planificador.modificarTarea.ObtenerTareaControllerImpl.java

/**
 * Metodo que obtiene los datos de la tarea de carga de odes que se selecciona
 *///from  w  ww.  j a  v  a2s.  c  om
public final void obtenerTareaModificarCargaODEs(ActionMapping mapping, ObtenerTareaModificarCargaODEsForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    if (tz == null)
        tz = utilidades.asignarZonaHoraria();

    TareaVO tarea = new TareaVO();

    try {

        //cargamos la tarea con lo valores esenciales para recuperar los demas valores de esta misma tarea 
        tarea.setTrabajo(((ObtenerTCargaODEsFormImpl) form).getTrabajo());
        tarea.setGrupoTrabajo(((ObtenerTCargaODEsFormImpl) form).getGrupoTrabajo());
        tarea.setTrigger(((ObtenerTCargaODEsFormImpl) form).getTrigger());
        tarea.setGrupoTrigger(((ObtenerTCargaODEsFormImpl) form).getGrupoTrigger());
        tarea.setPeriodicidad(((ObtenerTCargaODEsFormImpl) form).getPeriodicidad());

        //llamamos al servicio para que carge los valores en la tarea del tipo correspondiente
        TareaCargaODEsVO tareaCargaODEs = this.getSrvPlanificadorService()
                .obtenerTareaModificarCargaODEs(tarea);

        //asignamos a las fechas la franja horaria correspondiente
        tareaCargaODEs.getFechaInicio().setTimeZone(tz);

        //rellenamos los datos especificos de este tipo de tarea
        ((ObtenerTCargaODEsFormImpl) form).setPeriodicidad(tareaCargaODEs.getPeriodicidad());
        ((ObtenerTCargaODEsFormImpl) form).setPathODEs(tareaCargaODEs.getPathODE());
        ((ObtenerTCargaODEsFormImpl) form).setPathODEsCarg(tareaCargaODEs.getPathODEsCargados());
        ((ObtenerTCargaODEsFormImpl) form).setPathODEsNoCarg(tareaCargaODEs.getPathODEsNoCargados());
        ((ObtenerTCargaODEsFormImpl) form).setTipoTarea(tareaCargaODEs.getTipoTarea());
        int anio = (tareaCargaODEs.getFechaInicio().get(Calendar.YEAR));
        Integer anioI = new Integer(anio);
        anioI.toString();

        ((ObtenerTCargaODEsFormImpl) form)
                .setAnio((new Integer(tareaCargaODEs.getFechaInicio().get(Calendar.YEAR))).toString());
        ((ObtenerTCargaODEsFormImpl) form)
                .setMes((new Integer(tareaCargaODEs.getFechaInicio().get(Calendar.MONTH) + 1)).toString());
        ((ObtenerTCargaODEsFormImpl) form)
                .setDia((new Integer(tareaCargaODEs.getFechaInicio().get(Calendar.DAY_OF_MONTH))).toString());
        ((ObtenerTCargaODEsFormImpl) form)
                .setHora((new Integer(tareaCargaODEs.getFechaInicio().get(Calendar.HOUR_OF_DAY))).toString());
        ((ObtenerTCargaODEsFormImpl) form)
                .setMinutos((new Integer(tareaCargaODEs.getFechaInicio().get(Calendar.MINUTE))).toString());
        ((ObtenerTCargaODEsFormImpl) form).setMsgPublicado(tareaCargaODEs.getMsgPublicado());
        ((ObtenerTCargaODEsFormImpl) form).setMsgNoPublicado(tareaCargaODEs.getMsgNoPublicado());
        ((ObtenerTCargaODEsFormImpl) form).setMsgDescCargaODEs(tareaCargaODEs.getMsgDescripcionTrabajo());
        ((ObtenerTCargaODEsFormImpl) form).setSobrescribir(tareaCargaODEs.getSobrescribir());

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

From source file:es.pode.administracion.presentacion.planificador.descripcionTarea.DescripcionTareaControllerImpl.java

public final void obtenerTareaReindexado(ActionMapping mapping,
        es.pode.administracion.presentacion.planificador.descripcionTarea.ObtenerTareaReindexadoForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {

    if (tz == null)
        tz = utilidades.asignarZonaHoraria();

    TareaVO tarea = new TareaVO();

    try {//from w  w w .  j  av  a2s. co m

        tarea.setTrabajo(((DescripcionTareaFormImpl) form).getTrabajo());
        tarea.setGrupoTrabajo(((DescripcionTareaFormImpl) form).getGrupoTrabajo());
        tarea.setTrigger(((DescripcionTareaFormImpl) form).getTrigger());
        tarea.setGrupoTrigger(((DescripcionTareaFormImpl) form).getGrupoTrigger());
        tarea.setPeriodicidad(((DescripcionTareaFormImpl) form).getPeriodicidad());

        TareaReindexadoVO tareaReindexado = this.getSrvPlanificadorService().obtenerTareaReindexado(tarea);

        tareaReindexado.getFechaInicio().setTimeZone(tz);

        ((DescripcionTareaFormImpl) form).setPeriodicidad(tareaReindexado.getPeriodicidad());
        ((DescripcionTareaFormImpl) form).setRepositorio(tareaReindexado.getRepositorioIndices());
        ((DescripcionTareaFormImpl) form).setTipoTarea(tareaReindexado.getTipoTarea());
        ((DescripcionTareaFormImpl) form)
                .setAnio(new Integer(tareaReindexado.getFechaInicio().get(Calendar.YEAR)));
        ((DescripcionTareaFormImpl) form)
                .setMes(new Integer(tareaReindexado.getFechaInicio().get(Calendar.MONTH) + 1));
        ((DescripcionTareaFormImpl) form)
                .setDia(new Integer(tareaReindexado.getFechaInicio().get(Calendar.DAY_OF_MONTH)));
        ((DescripcionTareaFormImpl) form)
                .setHora(new Integer(tareaReindexado.getFechaInicio().get(Calendar.HOUR_OF_DAY)));
        ((DescripcionTareaFormImpl) form)
                .setMinutos(new Integer(tareaReindexado.getFechaInicio().get(Calendar.MINUTE)));
        ((DescripcionTareaFormImpl) form).setMsgReindexado(tareaReindexado.getMsgReindexado());
        ((DescripcionTareaFormImpl) form).setMsgNoReindexado(tareaReindexado.getMsgNoReindexado());
        ((DescripcionTareaFormImpl) form).setMsgDescReindexado(tareaReindexado.getMsgDescripcionTrabajo());
    } catch (Exception e) {
        log.error("Error: " + e);
        throw new ValidatorException("{tareas.error}");
    }
}

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

/**
 * @see es.pode.empaquetador.presentacion.basico.gestor.GestorBasicoController#pegar(org.apache.struts.action.ActionMapping,
 *      es.pode.empaquetador.presentacion.basico.gestor.PegarForm,
 *      javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *///from w  w w .j  av  a2  s  . c  o m
public final void pegar(ActionMapping mapping, es.pode.empaquetador.presentacion.basico.gestor.PegarForm form,
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    EmpaquetadorSession sesion = this.getEmpaquetadorSession(request);
    List portapapeles = sesion.getPortapapeles();

    if (sesion.isModoPegar() == true) {
        if (portapapeles != null && portapapeles.size() > 0) {

            String identificador = sesion.getIdLocalizador();
            List idCollection = this.getEmpaquetadorSession(request).getIdCollection();
            Object elemento = idCollection.get(idCollection.size() - 1);
            String destino;
            if (elemento instanceof GrupoVO) {
                destino = ((GrupoVO) elemento).getIdentifier();
            } else {
                destino = ((OrganizacionVO) elemento).getIdentifier();
            }

            //ficheros a copiar del portapapeles
            String[] elementos = new String[portapapeles.size()];
            for (int i = 0; i < portapapeles.size(); i++) {
                elementos[i] = ((GrupoVO) portapapeles.get(i)).getIdentifier();
            }

            if (sesion.getAccion().equals("Cortar")) {
                this.getSrvGestorManifestService().moverElementos(identificador, elementos, destino);
            } else if (sesion.getAccion().equals("Copiar")) {
                this.getSrvGestorManifestService().copiarElementos(identificador, elementos, destino);
            }
        } else {
            throw new ValidatorException("{portal_empaquetado.exception.session}");
        }
    } else {
        throw new ValidatorException("{portal_empaquetado.exception}");
    }
}