package cn.hmsoft.skill.control;

import java.util.HashMap;
import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import cn.hmsoft.application.SpringHelper;
import cn.hmsoft.frame.data.dao.FrameResDao;
import cn.hmsoft.frame.data.model.FrameOptr;
import cn.hmsoft.frame.data.model.FrameRes;
import cn.hmsoft.frame.data.model.FrameRole;
import cn.hmsoft.skill.helper.SkillParamHelper;

public class SkillInitializeLisener implements ServletContextListener {

	@Override
	public void contextDestroyed(ServletContextEvent context) {

	}

	@Override
	public void contextInitialized(ServletContextEvent context) {
		// 初始化enrol的东西
		/*SkillParamHelper.GobalSchoolOptr = SpringHelper.AppGobalDao.find(FrameOptr.class, "login_name", "school");
		SkillParamHelper.GobalSchoolRole = SpringHelper.AppGobalDao.find(FrameRole.class, 1);
		SkillParamHelper.GobalSchoolOptr.setResMap(new HashMap<Integer,Integer>());
		
		List<FrameRes> listRes = SpringHelper.getBean(FrameResDao.class).listBySql("select * from frame_res where res_status='Active' and res_id in (select res_id from frame_role_res where role_id=?) order by res_level,res_order", SkillParamHelper.GobalSchoolOptr.getOptr_dept());
		for (FrameRes res : listRes) {
			SkillParamHelper.GobalSchoolOptr.getResMap().put(res.getRes_id(), res.getRes_id());
		}*/
	}

}
