当前位置: 首页>>代码示例>>Java>>正文


Java ExtLibUtil.getViewScope方法代码示例

本文整理汇总了Java中com.ibm.xsp.extlib.util.ExtLibUtil.getViewScope方法的典型用法代码示例。如果您正苦于以下问题:Java ExtLibUtil.getViewScope方法的具体用法?Java ExtLibUtil.getViewScope怎么用?Java ExtLibUtil.getViewScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.xsp.extlib.util.ExtLibUtil的用法示例。


在下文中一共展示了ExtLibUtil.getViewScope方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: save

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public String save() throws Exception {
	DominoDocument doc = this.getDoc();

	Map<String, Object> viewScope = ExtLibUtil.getViewScope();
	viewScope.put("$REF", doc.getValue("$REF"));

	boolean isNewNote = doc.isNewNote();
	if(doc.save()) {
		Database database = doc.getParentDatabase();
		if(database.isFTIndexed()) {
			database.updateFTIndex(false);
		}
		JSFUtil.addMessage("confirmation", doc.getValue("Form") + " " + (isNewNote ? "created" : "updated") + " successfully.");
		return "xsp-success";
	} else {
		JSFUtil.addMessage("error", "Save failed");
		return "xsp-failure";
	}
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:20,代码来源:BasicDocumentController.java

示例2: addSelected

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public void addSelected() {
	Map<String, Object> viewScope=ExtLibUtil.getViewScope();
	
	Object names=viewScope.get("selectedNames");
	
	if(names instanceof String) {
		add((String) names);
	} else {
		// It should be a list of Strings, we hope.
		for(Object o:(List<?>) names) {
			add((String)o);
		}
	}
	
	viewScope.remove("selectedNames");
}
 
开发者ID:sbasegmez,项目名称:Blogged,代码行数:17,代码来源:ParticipantList.java

示例3: getValue

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public Object getValue(final Object keyObject) {
	if (!(keyObject instanceof String)) {
		throw new IllegalArgumentException();
	}
	String key = (String) keyObject;

	try {
		Object result = null;
		if ("new".equals(key)) {
			result = create();
		} else if (ModelUtils.isUnid(key)) {
			Database database = getDatabase();
			Document doc = database.getDocumentByUNID(key);
			result = createFromDocument(doc);
		} else {
			Map<String, Object> cacheScope = ExtLibUtil.getViewScope();
			String cacheKey = getClass().getName() + key;
			if (!cacheScope.containsKey(cacheKey)) {
				if (key.contains("^^")) {
					String[] bits = key.split("\\^\\^");
					cacheScope.put(cacheKey, getNamedCollection(bits[0], bits.length == 1 ? "" : bits[1]));
				} else {
					cacheScope.put(cacheKey, getNamedCollection(key, null));
				}

			}
			result = cacheScope.get(cacheKey);
		}
		return result;
	} catch (Exception ne) {
		// I'll want to know about this
		throw new RuntimeException(ne);
	}
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:35,代码来源:AbstractDominoManager.java

示例4: beforePageLoad

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
	@Override
	public void beforePageLoad() throws Exception {
//		super.afterPageLoad();
		
		FacesContext facesContext = FacesContext.getCurrentInstance();
		Map<String, String> param = (Map<String, String>)ExtLibUtil.resolveVariable(facesContext, "param");

		ViewState state = (ViewState)ExtLibUtil.resolveVariable(facesContext, "state");
		byte[] bytes = (byte[])state.document().getItemValue("State" + param.get("index"), byte[].class);
		
		ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
		//ObjectInputStream ois = new ObjectInputStream(bis);
		Class<? extends ObjectInputStream> inputClass = (Class<? extends ObjectInputStream>)Class.forName("com.ibm.xsp.application.AbstractSerializingStateManager$FastObjectInputStream");
		Constructor<?> inputConstructor = inputClass.getConstructor(FacesContext.class, InputStream.class);
		ObjectInputStream ois = (ObjectInputStream)inputConstructor.newInstance(facesContext, bis);

		// Read the components in
		Object treeStructure = ois.readObject();
		//Object componentStructure = ois.readObject();
		Method readObjectEx = inputClass.getMethod("readObjectEx");
		Object componentStructure = readObjectEx.invoke(ois);
		
//		IComponentNode localIComponentNode = (IComponentNode)treeStructure;
//		UIViewRootEx view = (UIViewRootEx)localIComponentNode.restore(facesContext);
//		Object viewState = componentStructure;
//		view.processRestoreState(facesContext, viewState);
//		System.out.println("view is " + view);
		
		Map<String, Object> viewScope = ExtLibUtil.getViewScope();
		viewScope.put("contextTreeStructure", treeStructure);
		viewScope.put("contextComponentStructure", componentStructure);
	}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:34,代码来源:viewStateRevision.java

示例5: getFilesCached

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public List<File> getFilesCached(String pid) {
	Map<String, Object> scope=ExtLibUtil.getViewScope();

	List<File> files=(List<File>)scope.get("files"+pid);

	if(files==null) {
		files=getFiles(pid);
		scope.put("files"+pid, files);
	}

	return files;
}
 
开发者ID:sbasegmez,项目名称:ic14demos,代码行数:14,代码来源:BaseCampService.java

示例6: postOpenDocument

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public void postOpenDocument() throws Exception {
	DominoDocument doc = this.getDoc();
	Map<String, Object> viewScope = ExtLibUtil.getViewScope();
	viewScope.put("$REF", doc.getValue("$REF"));
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:6,代码来源:BasicDocumentController.java


注:本文中的com.ibm.xsp.extlib.util.ExtLibUtil.getViewScope方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。