view gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java @ 1022:28a0628b11b0

Added license file and license header. gnv/trunk@1258 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:15:08 +0000
parents 0441e78cd900
children
line wrap: on
line source
/*
 * Copyright (c) 2010 by Intevation GmbH
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LGPL.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 */

package de.intevation.gnv.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import de.intevation.gnv.action.sessionmodel.SessionModel;
import de.intevation.gnv.action.sessionmodel.SessionModelFactory;

/**
 * This controller is used to step back to the fis selection. It is called when
 * pushing the step-back button besides the currently selected fis.
 *
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */
public class SelectFisAction extends ArtifactDatabaseActionBase {

    /**
     * the logger, used to log exceptions and additonaly information
     */
    private static Logger logger = Logger.getLogger(SelectFisAction.class);

    @Override
    public ActionForward execute(
        ActionMapping       mapping,
        ActionForm          form,
        HttpServletRequest  request,
        HttpServletResponse response
    ) {
        logger.info("Goto fis selection.");

        try {

            SessionModelFactory fac = SessionModelFactory.getInstance();
            SessionModel sm         = fac.getSessionModel(request);

            sm.resetModel();

            return new FetchArtifactFactoriesAction().execute(
                mapping, form, request, response);
        }
        catch (Exception e) {
            logger.error(e, e);

            request.setAttribute(
                CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID,
                e.getMessage());

            return super.getExceptionForward(mapping);
        }
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org