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

📄 globalcheckedresourcemanager.java

📁 EOS的一个很好的例子.包括页面构件、展现构件
💻 JAVA
字号:
package com.primeton.eos.fbframe.fbrole.bizlet;

import org.w3c.dom.*;
import java.util.*;

import com.primeton.tp.core.dataservice.map.*;
import com.primeton.tp.core.dataservice.permission.data.DataPrivilegeHelper;
import com.primeton.tp.core.api.BizContext;
import com.primeton.eos.bizlets.util.BNXmlUtil;
import com.primeton.eos.fbframe.fbrole.security.impl.*;

/**
 * @author zhangxueyong
 * @version 1.0
 * @date 2005-10-11
 * @class_displayName GlobalCheckedResourceManager
 */

public class GlobalCheckedResourceManager {
	
	/**
	 * 
	 * 通过运算逻辑重新加载需要验证的jsp集合 。
	 * 
	 */
	public static int BL_reloadGlobalCheckedResources(Document doc, BizContext param)
		throws Exception {
		
		
		GlobalCheckedBizsManager.getInstance().reload();
		GlobalCheckedJspsManager.getInstance().reload();
		GlobalCheckedPrsManager.getInstance().reload();
		
		return 1;
	}
	
	/**
	 * 
	 * 通过运算逻辑重新加载需要验证的jsp集合 。
	 * 
	 */
	public static int BL_reloadGlobalCheckedJsps(Document doc, BizContext param)
		throws Exception {
		
		GlobalCheckedJspsManager gb = GlobalCheckedJspsManager.getInstance();
		gb.reload();
		
		return 1;
	}
	
	/**
	 * 
	 * 通过运算逻辑重新加载需要验证的展现逻辑集合 。
	 * 
	 */
	public static int BL_reloadGlobalCheckedPrs(Document doc, BizContext param)
		throws Exception {
		
		GlobalCheckedPrsManager gb = GlobalCheckedPrsManager.getInstance();
		gb.reload();
		
		return 1;
	}

	/**
	 *
	 * 通过运算逻辑重新加载需要验证的业务逻辑集合 。 
	 *
	 */
	public static int BL_reloadGlobalCheckedBizs(Document doc, BizContext param)
		throws Exception {
		
		GlobalCheckedBizsManager gb = GlobalCheckedBizsManager.getInstance();
		gb.reload();
		
		return 1;
	}

	/**
	 * 获得EOS系统中数据实体定义的包列表
	 * 
	 * @param doc type: Document, DOM;
	 * @param param type: BizContext;
	 * @return: int ,运算逻辑返回值,如果失败返回0,成功返回1 
	 * @throws Exception 
	 * <p>
	 * ** bizlet 的显示名称 **
	 * @bizlet_displayName BL_getEOSPackages
	 * @bizlet_param passing="in_out" type="EOSEntityList" value="list[@type="EOSPackage"]" name="" desc=""
	 */
	public static int BL_getEOSPackages(Document doc, BizContext param) throws Exception{
		Element packList = (Element)param.getParaObjectAt(0);
		BNXmlUtil.removeAllChild(packList);
		//获取系统缓存中的包列表
		AppDictMap appdictmap = MapFactory.theOne().getAppDictMap(param.getDBBroker().getAppID());
		Collection collection = appdictmap.getAllEnvMaps();
		if (collection != null) {
			Iterator iter = collection.iterator();
			ArrayList arr = new ArrayList();
			Hashtable map = new Hashtable();
			while (iter.hasNext()) {
				EnvMap envMap = (EnvMap) iter.next();
				arr.add(envMap.environmentName);
				map.put(envMap.environmentName, envMap.displayName);
			}
			Collections.sort(arr);
			int empty = 0;
			for (int i=0; i<arr.size(); i++) {
				if (arr.get(i) == null || "".equals((String)arr.get(i))) {
					empty++;
					continue;
				}
				Element pack = doc.createElement("EOSPackage");
				BNXmlUtil.setNodeValue(pack, "packageName", (String)arr.get(i));
				BNXmlUtil.setNodeValue(pack, "displayName", (String)map.get((String)arr.get(i)));
				packList.appendChild(pack);
			}
			packList.setAttribute("rowNum", String.valueOf(arr.size() - empty));
		}
		
		return 1;
	}
	/**
	 * 根据包名获得EOS系统中定义的实体名称列表,如果包名为空返回所有的实体列表
	 * 
	 * @param doc type: Document, DOM;
	 * @param param type: BizContext;
	 * @return: int ,运算逻辑返回值,如果失败返回0,成功返回1 
	 * @throws Exception 
	 * <p>
	 * ** bizlet 的显示名称 **
	 * @bizlet_displayName BL_getEOSEntities
	 * @bizlet_param passing="in_out" type="EOSEntityList" value="list[@type="EOSEntity"]" name="" desc="保存EOS的实体名列表"
	 * @bizlet_param passing="in_out" type="variable" value="/" name="" desc="包名,可以没有这个参数"
	 */
	public static int BL_getEOSEntities(Document doc, BizContext param) throws Exception{
		Element entityList = (Element)param.getParaObjectAt(0);
		String packName = null;
		if (param.getLength() > 1)
			packName = (String)param.getParaObjectAt(1);
		//从缓存中缓存中获取数据映射列表
		AppDictMap appdictmap = MapFactory.theOne().getAppDictMap(param.getDBBroker().getAppID());
		Collection entities = null;
		if (packName == null || "".equals(packName)) {
			entities = appdictmap.getAllEntitys();
		} else {
			entities = appdictmap.getEntityListByPackageName(packName);
		}
		if (entities != null) {
			Iterator iter = entities.iterator();
			ArrayList arr = new ArrayList();
			Hashtable map = new Hashtable();
			while (iter.hasNext()) {
				EntityMap entity = (EntityMap)iter.next();
				arr.add(entity.entityName);
				map.put(entity.entityName, entity);
			}
			//根据实体名称排序
			Collections.sort(arr);
			int empty = 0;
			for (int i=0; i<arr.size(); i++) {
				if (arr.get(i) == null || "".equals((String)arr.get(i))) {
					empty++;
					continue;
				}
				Element ent = doc.createElement("EOSEntity");
				BNXmlUtil.setNodeValue(ent, "entityName", (String)arr.get(i));
				BNXmlUtil.setNodeValue(ent, "displayName", ((EntityMap)map.get((String)arr.get(i))).displayName);
				BNXmlUtil.setNodeValue(ent, "entityType", String.valueOf(((EntityMap)map.get((String)arr.get(i))).entityType));
				entityList.appendChild(ent);
			}
			//设置结果集记录数
			entityList.setAttribute("rowNum", String.valueOf(arr.size() - empty));
		}
		
		return 1;
	}
	/**
	 * 刷新JVM内存中数据约束条件
	 * 
	 * @param doc type: Document, DOM;
	 * @param param type: BizContext;
	 * @return: int ,运算逻辑返回值,如果失败返回0,成功返回1 
	 * @throws Exception 
	 * <p>
	 * ** bizlet 的显示名称 **
	 * @bizlet_displayName BL_refreshDataPrivilege
	 */
	public synchronized static int BL_refreshDataPrivilege(Document doc, BizContext param) throws Exception{
		DataPrivilegeHelper.load(param.getDBBroker().getAppID());
		return 1;
	}
}

⌨️ 快捷键说明

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