view gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java @ 409:df78178e1180

Moved user interface creation to an own action. This makes avoids code duplication and makes it easier to write new action to handle special interactions, because there is no need for parsing the describe document and creating the user interface after this. gnv/trunk@599 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 22 Jan 2010 11:28:25 +0000
parents b5733f9f386b
children 15ac78a91d1b
line wrap: on
line source
/**
 *
 */
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.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 * @author Tim Englich <tim.englich@intevation.de>
 * 
 */
public class ArtifactDatabaseActionBase extends Action {

    protected final static String SUCCSESS_FORWARD_ID = "success";
    protected final static String EXCEPTION_FORWARD_ID = "success";

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

    /**
     * Constructor
     */
    public ArtifactDatabaseActionBase() {
        super();
    }

    /**
     * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping,
     *      org.apache.struts.action.ActionForm,
     *      javax.servlet.http.HttpServletRequest,
     *      javax.servlet.http.HttpServletResponse)
     */
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response) throws Exception {
        log.debug("ArtifactDatabaseActionBase.execute");

        ActionForward forward = mapping.findForward(SUCCSESS_FORWARD_ID);
        return forward;
    }

    /**
     * Returns the ExceptionForward for the ArtifactDatabaseActions
     * 
     * @param mapping
     * @return
     */
    protected ActionForward getExceptionForward(ActionMapping mapping) {
        log.debug("ArtifactDatabaseActionBase.getExceptionForward");
        ActionForward lForward = mapping.findForward(EXCEPTION_FORWARD_ID);
        return lForward;
    }
}

http://dive4elements.wald.intevation.org