/*
 * $Id: ConverterMaintenanceAction.java,v 1.2 2007/08/14 14:49:57 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * Created on 04.11.2004
 *
 * $Log: ConverterMaintenanceAction.java,v $
 * Revision 1.2  2007/08/14 14:49:57  marbobo
 * + Licenseverwaltung komplett umgeschrieben
 * + Kategoriesuche und verlorene Kategorien anzeigen komplett umgeschrieben
 * + Fehler beim Speichern von Beschreibenungsfeldern für Entitäten beseitigt.
 *
 * Revision 1.1  2004/11/08 12:28:14  koppy
 * initiale version
 *
 */
package vkc.administration.action;

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

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

import vkc.administration.form.ConverterMaintenanceForm;
import vkc.administration.form.SystemMaintenanceForm;
import vkc.db.entities.VKCUser;
import vkc.view.WebShare;

/**
 * This class represents
 * 
 * @author Andreas Koop
 */
public class ConverterMaintenanceAction extends SystemMaintenanceAction {
    public ActionForward execute(ActionMapping mapping, 
                                 ActionForm f, 
                                 HttpServletRequest request, 
                                 HttpServletResponse response) 
    throws ServletException {
        ConverterMaintenanceForm form = (ConverterMaintenanceForm) f;
        VKCUser user = form.getUser();

        if (!user.hasAdminPrivileges()) {
            request.setAttribute(WebShare.INFO_KEY, "vkc.info.access_denied");

            return getInfoForward();
        }

        return new ActionForward("/systemMaintenance.do?selectedContext=" + SystemMaintenanceForm.CONVERTER, false);
    }
}