⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rolemgtsearchaction.java

📁 j2ee源码
💻 JAVA
字号:
package com.leeman.wkexs.master.rolemgt.web;

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

import java.beans.PropertyEditor;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

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

import org.apache.commons.beanutils.PropertyUtils;

import com.leeman.common.web.ui.*;

import com.leeman.wkexs.web.base.BaseForm;
import com.leeman.wkexs.web.base.BaseConstants;
import com.leeman.wkexs.web.base.BaseSearchAction;
import com.leeman.wkexs.web.base.BaseCollectionCache;
import com.leeman.common.util.Formatter;
import com.leeman.common.util.EjbGetter;
import com.leeman.common.util.DateUtils;
import com.leeman.wkexs.master.rolemgt.entity.*;
import com.leeman.wkexs.master.rolemgt.handler.*;

public final class RoleMgtSearchAction extends BaseSearchAction
{	
  	public void doInit(ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception
  	{
		RoleMgtCollectionCache cache = new RoleMgtCollectionCache();		
		this.setCollectionCache(request, cache);
  	}
  	  	
  	public void initSearchForm(ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response) throws Exception
  	{
		SearchForm searchForm = (SearchForm) form;
  	}
  	
  	public void doSearch(ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception
  	{		
		SearchForm searchForm = (SearchForm)form;
		
		//Do the Searching
		RoleMgtCollectionCache collectionCache = (RoleMgtCollectionCache)getCollectionCache(request);
		RoleHdrSO searchKey = (RoleHdrSO)collectionCache.getSearchKey();
		CachedPager pager = collectionCache.getSearchPager();
				
		RoleMgtHandler handler = RoleMgtHandlerHelper.getRoleMgtHandler();
		ArrayList result = handler.getList(searchKey, pager.calcCacheRecordStart(), pager.getCacheRecordSize());
		handler.remove();
		
		pager.setCachedRange(pager.calcCacheRecordStart(), result.size());		
		collectionCache.setSearchResults(result);
  	}
  	
  	protected void updateCollectionCache(HttpServletRequest request, ActionForm form) throws Exception
  	{
  		RoleMgtCollectionCache collectionCache = (RoleMgtCollectionCache)getCollectionCache(request);
		SearchForm searchForm = (SearchForm)form;
		RoleHdrSO so = new RoleHdrSO();
		so.setCompany_id(getCompanyId(request));
		so.setRole_id(searchForm.getRole_id().trim());
		so.setRole_name(searchForm.getRole_name().trim());
		collectionCache.setSearchKey(so);	
  	}
	/**
	 * Overrides
	 */
	public void loadFormFromCache(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
		RoleMgtCollectionCache collectionCache = (RoleMgtCollectionCache)getCollectionCache(request);
		RoleHdrSO so = (RoleHdrSO)collectionCache.getSearchKey();
		SearchForm searchForm = (SearchForm)form;
		searchForm.setRole_id(so.getRole_id());
		searchForm.setRole_name(so.getRole_name());
	}
	/**
	 * Overrides
	 */
	public void doNewSearch(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
		super.doNewSearch(mapping, form, request, response);
		this.setInitFocus(request, "document.forms[0].role_id");
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -