package de.tvo.workplace;

import org.eclnt.workplace.WorkpageStartInfo;

import com.google.gson.GsonBuilder;

import jakarta.xml.bind.annotation.XmlTransient;

/**
 * DE: 
 *
 * EN: 
 * 
 * 
 * Program changes
 * **************************************************************************************
 * Date			* Ticket	* KonzFirm	* Responsible	* programmer    *
 * Change										*
 * **************************************************************************************
 *
 * @author VogelT
 * @version 1.0
 *
 */
public class DefaultWorkpageStarterInfo extends WorkpageStartInfo {

	private static final long serialVersionUID = 1L;
	
	@XmlTransient
	private SessionVars m_sessionVars;
	@XmlTransient
	public SessionVars getSessionVars() { return m_sessionVars; }
	public void setSessionVars(SessionVars sessionVars) { m_sessionVars = sessionVars; }
//
//	@XmlTransient
//	private Rights m_rights;
//	@XmlTransient
//	public Rights getRights() { return m_rights; }
//	public void setRights(Rights rights) { m_rights = rights; }
//	
//	//Merker Variable fuer das Menu
	@XmlTransient
	private String m_startPageBeanName;
	@XmlTransient
	public String getStartPageBeanName() {return m_startPageBeanName;}
	public void setStartPageBeanName(String startPageBeanName) {m_startPageBeanName = startPageBeanName;}
	
	public DefaultWorkpageStarterInfo() {
		super();
	}

	public DefaultWorkpageStarterInfo(WorkpageStartInfo wpsi) {
		this.setCloseSupported(wpsi.getCloseSupported());
		this.setComment(wpsi.getComment());
		this.setDecorated(wpsi.isDecorated());
		this.setExcludeFromSavePerspective(wpsi.getExcludeFromSavePerspective());
		this.setFunctionClassName(wpsi.getFunctionClassName());
		this.setId(wpsi.getId());
		this.setImage(wpsi.getImage());
		this.setJspPage(wpsi.getJspPage());
		this.setOpenAsPopupByDefault(wpsi.getOpenAsPopupByDefault());
		this.setOpenMultipleInstances(wpsi.getOpenMultipleInstances());
		this.setPageBeanName(wpsi.getPageBeanName());
		this.setPopupSupported(wpsi.getPopupSuppoted());
		this.setSelectorTitle(wpsi.getSelectorTitle());
		this.setStartSubWorkpageContainerId(wpsi.getStartSubWorkpageContainerId());
		this.setText(wpsi.getText());
		this.setWindowTitle(wpsi.getWindowTitle());
		this.setParamMap(wpsi.getParamMap());
//		this.m_rights = new GsonBuilder().create().fromJson(this.getParam("RIGHTS"), Rights.class);
		this.m_sessionVars = new GsonBuilder().create().fromJson(this.getParam("SESSIONVARS"), SessionVars.class);
		this.m_startPageBeanName = this.getParam("PAGEBEAN");
	}
	
}
