src/it/finsiel/siged/mvc/presentation/action/amministrazione/firmadigitale/AggiornaCRLAction.java
public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        ActionMessages errors = new ActionMessages();
        AggiornaCRLForm crlForm = (AggiornaCRLForm) form;

        if (form == null) {
            crlForm = new AggiornaCRLForm();
            request.setAttribute(mapping.getAttribute(), crlForm);
        }
        if (request.getParameter("aggiorna") != null) {
            errors = FirmaDigitaleDelegate.getInstance()
                    .aggiornaListaCertificatiRevocati();
            ActionMessages msg = new ActionMessages();
            msg.add("salvato",
                    new ActionMessage("firmadigitale.crl.aggiornate"));
            saveMessages(request, msg);
        } else if (request.getParameter("importaCa") != null) {
            errors = crlForm.validate(mapping, request);
            if (errors.isEmpty()) {
                // upload del file ed estrazione in chiaro
                uploadDocumentoPrincipale(crlForm, request, errors);
                if (errors.isEmpty()) {
                    try {
                        // elimino tutti i dati presenti
                        FirmaDigitaleDelegate.getInstance().cancellaTutteCA();
                        // inserisco i nuovi
                        errors = FirmaDigitaleDelegate.getInstance()
                                .aggiornaListaCA(
                                        crlForm.getDocumentoP7M().getPath());
                    } catch (DataException e) {
                        errors.add("generale", new ActionMessage(
                                "database.cannot.save"));
                    }
                }
            }
        } else {
            // TODO: add warning list, visualizzare tutte le CA che non hanno
            // CRL DP
        }
        saveErrors(request, errors);

        return (mapping.findForward("input"));
    }
/**
     * Process the specified HTTP request, and create the corresponding HTTP
     * response (or forward to another web component that will create it).
     * Return an <code>ActionForward</code> instance describing where and how
     * control should be forwarded, or <code>null</code> if the response has
     * already been completed.
     * 
     * @param mapping
     *            The ActionMapping used to select this instance
     * @param form
     *            The optional ActionForm bean for this request (if any)
     * @param request
     *            The HTTP request we are processing
     * @param response
     *            The HTTP response we are creating
     * 
     * @exception Exception
     *                if business logic throws an exception
     */
Process the specified HTTP request, and create the corresponding HTTP
response (or forward to another web component that will create it).
Return an ActionForward instance describing where and how
control should be forwarded, or null if the response has
already been completed.

@param mapping
The ActionMapping used to select this instance
@param form
The optional ActionForm bean for this request (if any)
@param request
The HTTP request we are processing
@param response
The HTTP response we are creating

@exception Exception
if business logic throws an exception
Process the specified HTTP request and create the corresponding HTTP response ( or forward to another web component that will create it ) . Return an ActionForward instance describing where and how control should be forwarded or null if the response has already been completed . @param mapping The ActionMapping used to select this instance @param form The optional ActionForm bean for this request ( if any ) @param request The HTTP request we are processing @param response The HTTP response we are creating @exception Exception if business logic throws an exception
public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        ActionMessages errors = new ActionMessages();
        AggiornaCRLForm crlForm = (AggiornaCRLForm) form;
        if (form == null) {
            crlForm = new AggiornaCRLForm();
            request.setAttribute(mapping.getAttribute(), crlForm);
        }
        if (request.getParameter("aggiorna") != null) {
            errors = FirmaDigitaleDelegate.getInstance()
                    .aggiornaListaCertificatiRevocati();
            ActionMessages msg = new ActionMessages();
            msg.add("salvato",
                    new ActionMessage("firmadigitale.crl.aggiornate"));
            saveMessages(request, msg);
        } else if (request.getParameter("importaCa") != null) {
            errors = crlForm.validate(mapping, request);
            if (errors.isEmpty()) {
                uploadDocumentoPrincipale(crlForm, request, errors);
                if (errors.isEmpty()) {
                    try {
                        FirmaDigitaleDelegate.getInstance().cancellaTutteCA();
                        errors = FirmaDigitaleDelegate.getInstance()
                                .aggiornaListaCA(
                                        crlForm.getDocumentoP7M().getPath());
                    } catch (DataException e) {
                        errors.add("generale", new ActionMessage(
                                "database.cannot.save"));
                    }
                }
            }
        } else {
        }
        saveErrors(request, errors);
        return (mapping.findForward("input"));
    }
public ActionForward execute ( ActionMapping mapping , ActionForm form , HttpServletRequest request , HttpServletResponse response ) throws Exception { ActionMessages errors = new ActionMessages ( ) ; AggiornaCRLForm crlForm = ( AggiornaCRLForm ) form ; if ( form == null ) { crlForm = new AggiornaCRLForm ( ) ; request . setAttribute ( mapping . getAttribute ( ) , crlForm ) ; } if ( request . getParameter ( "aggiorna" ) != null ) { errors = FirmaDigitaleDelegate . getInstance ( ) . aggiornaListaCertificatiRevocati ( ) ; ActionMessages msg = new ActionMessages ( ) ; msg . add ( "salvato" , new ActionMessage ( "firmadigitale.crl.aggiornate" ) ) ; saveMessages ( request , msg ) ; } else if ( request . getParameter ( "importaCa" ) != null ) { errors = crlForm . validate ( mapping , request ) ; if ( errors . isEmpty ( ) ) { uploadDocumentoPrincipale ( crlForm , request , errors ) ; if ( errors . isEmpty ( ) ) { try { FirmaDigitaleDelegate . getInstance ( ) . cancellaTutteCA ( ) ; errors = FirmaDigitaleDelegate . getInstance ( ) . aggiornaListaCA ( crlForm . getDocumentoP7M ( ) . getPath ( ) ) ; } catch ( DataException e ) { errors . add ( "generale" , new ActionMessage ( "database.cannot.save" ) ) ; } } } } else { } saveErrors ( request , errors ) ; return ( mapping . findForward ( "input" ) ) ; }
Process the specified HTTP request, and create the corresponding HTTP
 response (or forward to another web component that will create it).
Process the specified HTTP request and create the corresponding HTTP response ( or forward to another web component that will create it ) .
// upload del file ed estrazione in chiaro // elimino tutti i dati presenti // inserisco i nuovi // TODO: add warning list, visualizzare tutte le CA che non hanno // CRL DP