/*
 * $Id: SearchCategoryAction.java,v 1.2 2007/08/14 14:50:01 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * $Log: SearchCategoryAction.java,v $
 * Revision 1.2  2007/08/14 14:50:01  marbobo
 * + Licenseverwaltung komplett umgeschrieben
 * + Kategoriesuche und verlorene Kategorien anzeigen komplett umgeschrieben
 * + Fehler beim Speichern von Beschreibenungsfeldern für Entitäten beseitigt.
 *
 */
package vkc.view.action;

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

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import vkc.util.VKCStringUtils;
import vkc.view.form.SearchCategoryForm;

public final class SearchCategoryAction extends Action {
    private ActionForward DEFAULT_FORWARD = new ActionForward("/templates/${template.name}/common/searchCategory.jsp");

    public ActionForward execute(ActionMapping mapping, 
                                 ActionForm f, 
                                 HttpServletRequest request, 
                                 HttpServletResponse response) 
    throws Exception {
        SearchCategoryForm form = (SearchCategoryForm)f;
        
        if (request.getParameter("decodeSearchQuery") != null) {
            form.setSearchQuery(VKCStringUtils.base64Decode(form.getSearchQuery()));
        }
        
        return DEFAULT_FORWARD;
    }
}