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


Java ExtLibUtil.resolveVariable方法代码示例

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


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

示例1: processNode

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void processNode(DefaultMutableTreeNode node, BasicContainerTreeNode root) throws Exception {
	Map<String, String> param = (Map<String, String>)ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), "param");
	BasicContainerTreeNode entryChild = new BasicContainerTreeNode();
	Map<String, Object> nodeInfo = (Map<String, Object>)node.getUserObject();
	entryChild.setLabel(String.valueOf(nodeInfo));
	entryChild.setHref("/viewStateRevision.xsp?id=" + URLEncoder.encode(param.get("id"), "UTF-8") + "&index=" + nodeInfo.get("index"));
	if(root == null) {
		addChild(entryChild);
	} else {
		root.addChild(entryChild);
	}
	Enumeration<DefaultMutableTreeNode> children = node.children();
	while(children.hasMoreElements()) {
		processNode(children.nextElement(), entryChild);
	}
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:18,代码来源:ViewStateHistory.java

示例2: findObject

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public Object findObject(FacesContext context) {
    String names = getObjectNames();
    if(StringUtil.isNotEmpty(names)) {
        String[] n = StringUtil.splitString(names,',');
        if(n.length==1) {
            return ExtLibUtil.resolveVariable(context, n[0]);
        } else {
            Object[] o = new Object[n.length];
            for(int i=0; i<o.length; i++) {
                ExtLibUtil.resolveVariable(context, n[i]);
            }
            return o;
        }
    }
    Object value = getValue();
    return value;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:UIDumpObject.java

示例3: isUsingInputPlainText

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private boolean isUsingInputPlainText(FacesContext context, UIInput component) {
    
    // most browsers use <input type=datetime, but for iOS defaulting to type=text
    boolean isUseInputPlainTextOnIOS = true;
    String option = ((FacesContextEx)context).getProperty("xsp.theme.mobile.iOS.native.dateTime"); //$NON-NLS-1$
    if( null != option ){
        // explicitly configured whether to use type=datetime on iOS
        boolean isNativeOnIOS = "true".equals(option); //$NON-NLS-1$
        isUseInputPlainTextOnIOS = ! isNativeOnIOS;
    }
    if( isUseInputPlainTextOnIOS ){
        Object deviceBeanObj = ExtLibUtil.resolveVariable(context, "deviceBean"); //$NON-NLS-1$
        if( deviceBeanObj instanceof DeviceBean ){
            DeviceBean deviceBean = (DeviceBean)deviceBeanObj;
            boolean isIOS = deviceBean.isIphone()|| deviceBean.isIpad() || deviceBean.isIpod();
            if( isIOS ){
                // is iOS, so by use type=text
                return true;
            }
            // else other devices use type=datetime, not type=text
        }
    }
    // else always use type=datetime, don't need to whether check browser OS is iOS.
    return false;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:InputDateRenderer.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: ViewStateHistory

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public ViewStateHistory() {
	try {
		ViewState state = (ViewState)ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), "state");
		DefaultMutableTreeNode tree = state.document().getItemValue("RevisionTree", DefaultMutableTreeNode.class);
		processNode(tree, null);
	} catch(Throwable t) {
		t.printStackTrace();
		BasicLeafTreeNode exceptionChild = new BasicLeafTreeNode();
		exceptionChild.setLabel(t.toString());
		addChild(exceptionChild);
	}
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:13,代码来源:ViewStateHistory.java

示例6: save

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public boolean save() {
	if (isCategory()) {
		throw new UnsupportedOperationException("Categories cannot be saved");
	}

	try {
		if (querySave()) {
			Document doc = document(true);

			if(doc.save()) {
				if(documentId_.isEmpty()) {
					documentId_ = doc.getUniversalID();
				}

				postSave();

				// Attempt to update the FT index
				Database database = doc.getParentDatabase();
				lotus.domino.Session sessionAsSigner = (lotus.domino.Session)ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), "sessionAsSigner");
				lotus.domino.Database signerDB = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath());
				if(signerDB.isFTIndexed()) {
					signerDB.updateFTIndex(false);
				}

				return true;
			}
		}
		return false;
	} catch (Exception ne) {
		ModelUtils.publishException(ne);
		return false;
	}
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:34,代码来源:AbstractDominoModel.java

示例7: switchRevision

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public void switchRevision() throws Exception {
		UIViewRootEx2 view = (UIViewRootEx2)FacesContext.getCurrentInstance().getViewRoot();
		int index = (Integer)ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), "index");
//		System.out.println("asked to switch to revision " + index);
		Map<String, Object> applicationScope = ExtLibUtil.getApplicationScope();
		applicationScope.put("revision" + view.getUniqueViewId(), index);
//		System.out.println("Stored revision as 'revision" + view.getUniqueViewId() + "'");
	}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:9,代码来源:home.java

示例8: uploadBCFile

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public void uploadBCFile(File file, String target) {
	String communityId="";
	
	if(StringUtil.isEmpty(target) || target.equals("myFiles")) {
		// To My Files
	} else {
		communityId=DevelopiUtils.strRight(target, "|");
	}
	
	FileService fs=new FileService(getEndpoint());
	FacesContext facesContext = FacesContext.getCurrentInstance();
	BaseCampService bcs=(BaseCampService)ExtLibUtil.resolveVariable(facesContext, "bcs");

	String errorMessage="";
	
	try {

		InputStream is=RestUtils.xhrGetStream(bcs.getEndpoint(), bcs.getDownloadUri(file.getUrl()));
		
		if(StringUtil.isEmpty(communityId)) {
			fs.uploadFile(is, file.getName(), -1);
		} else {
			fs.uploadCommunityFile(is, communityId, file.getName(), -1);
		}
	
	    facesContext.addMessage("messages1", new FacesMessage(FacesMessage.SEVERITY_INFO, file.getName()+" successfully transferred...", ""));
	    return;
			
	} catch (FileServiceException e) {
		errorMessage="Error uploading file to the FileService...";
		e.printStackTrace();
	}

       facesContext.addMessage("messages1", new FacesMessage(FacesMessage.SEVERITY_ERROR, errorMessage, ""));

}
 
开发者ID:sbasegmez,项目名称:ic14demos,代码行数:37,代码来源:ConnectionsService.java

示例9: detectNewRendererType

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private String detectNewRendererType(FacesContext context, UIComponent component) {
    Object deviceBeanObj = ExtLibUtil.resolveVariable(context, "deviceBean"); //$NON-NLS-1$
    if( deviceBeanObj instanceof DeviceBean ){
        DeviceBean deviceBean = (DeviceBean)deviceBeanObj;
        if( deviceBean.isMobile() || deviceBean.isTablet() || deviceBean.isIpod() ){
            // SPR#LHEY9QKFZ8 use mobile InputDateRenderer (type=date)
            // because the web renderer isn't accessible on mobile.
            return "com.ibm.xsp.extlib.mobile.InputDate"; //$NON-NLS-1$
        }
    }
    // default to web renderer.
    return "com.ibm.xsp.DateTimeHelper"; //$NON-NLS-1$
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:14,代码来源:InputDateDetectRenderer.java

示例10: getDoc

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
protected DominoDocument getDoc() {
	return (DominoDocument)ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), "doc");
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:4,代码来源:BasicDocumentController.java

示例11: resolveVariable

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
protected static Object resolveVariable(String varName) {
	return ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), varName);
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:4,代码来源:BasicXPageController.java

示例12: getDatabase

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
protected Database getDatabase() {
	return (Database)ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), "database");
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:4,代码来源:AbstractDominoManager.java

示例13: evaluate

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
protected List<Object> evaluate(final String formula) {
	Document doc = document();
	Session session = (Session) ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), "session");
	return session.evaluate(formula, doc);
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:6,代码来源:AbstractDominoModel.java

示例14: getDominoDoc

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private DominoDocument getDominoDoc() {
	return (DominoDocument) ExtLibUtil.resolveVariable(FacesContext.getCurrentInstance(), DOCSOURCE_NAME);
}
 
开发者ID:sbasegmez,项目名称:Blogged,代码行数:4,代码来源:ParticipantList.java


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