package q02b.cuestionarioVAPM.router;



//import java.util.HashMap;



import org.apache.struts.action.ActionErrors;

import org.apache.struts.action.ActionForward;

import org.apache.struts.action.ActionMapping;



//import q02b.exe.cuestionariosSMAnu.valueobjects.Q02bCuestionarioSMFiltro;

//import q02b.exe.utils.Q02bFormatData;

//import q02b.exe.utils.Q02bVoUtils;

import es.ejie.frmk.infraestructura.traza.Q70Traza;

import es.ejie.frmk.presentacion.operacion.Q70DefaultRouterClass;

import es.ejie.frmk.presentacion.sesiondatos.Q70ContextoEJIE;



public class Q02bRouterAfterInsertCuestionariosVAPM extends Q70DefaultRouterClass {



	//private static Q70Traza tr = Q70Traza.getSingleton();

	//private static final String COMPONENTE = "Q70_ROUTERCLASS";

	

	final static String VARIABLE_INICIO= "inicio";

	final static String VARIABLE_ACCION= "accion";	

	final static String VARIABLE_PORTADA= "JSP_PORTADA";

	final static String VARIABLE_REPETIR= "KEY_GUARDAR_REPETIR";

	

	final static String MAPPING_ERROR = "error";	

	final static String MAPPING_PORTADA="irPortada";

	final static String MAPPING_ALTA="irAlta";

	//final static String MAPPING_ERROR_NO_CUES= "error.oi.noCuestionariosSMAnu";

	

		/**

		 * @see es.ejie.frmk.presentacion.operacion.paso.ActionPasoOP#processForward(es.ejie.frmk.presentacion.sesiondatos.ContextoEJIE, org.apache.struts.action.ActionErrors, org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

		 */  

	public  ActionForward processForward(Q70ContextoEJIE contexto,ActionErrors errores,ActionMapping mapping) throws Exception 

	{    

			ActionForward salida = new ActionForward();			

			String inicio = (String)contexto.get(VARIABLE_INICIO);

			if(((String)contexto.get(VARIABLE_ACCION)).equals(VARIABLE_REPETIR)){

				salida = mapping.findForward(MAPPING_ALTA);

			}

			else if(inicio.equals(VARIABLE_PORTADA)){

				salida = mapping.findForward(MAPPING_PORTADA);

			}			

			return salida;

	}

	

	

}

