/*
 * $Id: LoginLicenseFramesetForm.java,v 1.1 2007/08/08 12:14:46 marbobo Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 *
 * $Log: LoginLicenseFramesetForm.java,v $
 * Revision 1.1  2007/08/08 12:14:46  marbobo
 * + License-Funktionalität komplett umgeschrieben
 * + Bugfix bzgl. Beschreibungsfelder von Entitäten
 * + Bugfix mailing
 *
 */

package vkc.view.form;

import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;

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

import vkc.db.entities.VKCUser;
import vkc.view.WebShare;

/**
 * Form bean für die aktuellen License Seite
 * @author marbobo
 */
public final class LoginLicenseFramesetForm extends ActionForm {
    private String linkType = null;
    private String objectId = null;
    private String loginType = null;

    private VKCUser user = null;

    /**
     * Reset der Eingabefelder auf Defaultwerte
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
   		linkType = null;
   		objectId = null;
   	    loginType = null;

   		user = (VKCUser) request.getSession().getAttribute(WebShare.TEMP_USER_KEY);
    }

    /**
     * Validierung der Eingabefelder
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        
		return errors;
    }

    public String getLinkType() {
		return linkType;
	}

	public String getObjectId() {
		return objectId;
	}
	
	public HashMap getLinkParameter() {	
		HashMap params = new HashMap();
	    
		if (getLinkType() != null) {
		    params.put("linkType", getLinkType());
		}
		
		if (getObjectId() != null) {
		    params.put("objectId", getObjectId());
		}
		
		if (getLoginType() != null) {
		    params.put("loginType", getLoginType());
		}
		
		return params;
	}

    public VKCUser getUser() {
        return user;
    }

	public void setLinkType(String string) {
		linkType = string;
	}

	public void setObjectId(String string) {
		objectId = string;
	}

    public void setUser(VKCUser u) {
        user = u;
    }

	public String getLoginType() {
		return loginType;
	}

	public void setLoginType(String loginType) {
		this.loginType = loginType;
	}
}