• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FacesContextEx类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ibm.xsp.context.FacesContextEx的典型用法代码示例。如果您正苦于以下问题:Java FacesContextEx类的具体用法?Java FacesContextEx怎么用?Java FacesContextEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FacesContextEx类属于com.ibm.xsp.context包,在下文中一共展示了FacesContextEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isRunningOnBluemix

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public boolean isRunningOnBluemix() {
    if( null != _onBluemix ){
        return _onBluemix.booleanValue();
    }
    // when on bluemix, xsp.bluemix.platform=1 will exist
    // inside the global xsp.properties file...
    boolean detectedOnBluemix;
    String isBluemixPlatform = ((FacesContextEx) FacesContext.getCurrentInstance()).getProperty("xsp.bluemix.platform"); // $NON-NLS-1$
    if (StringUtil.isEmpty(isBluemixPlatform) || StringUtil.equals(isBluemixPlatform, "0")) { // $NON-NLS-1$
        detectedOnBluemix = false;
    }else{
        detectedOnBluemix = (null != java.lang.System.getenv("VCAP_APP_PORT")); // $NON-NLS-1$
    }
    _onBluemix = Boolean.valueOf(detectedOnBluemix);
    return detectedOnBluemix;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:17,代码来源:BluemixContext.java


示例2: createChildren

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
private void createChildren(FacesContextEx context) {
    // Load the current page (corresponds to an .xsp, may be a custom control) 
    FacesPageDriver driver = DynamicUIUtil.findPageDriver(context, this);
    FacesPage page = DynamicUIUtil.loadPage(context, driver, sourcePageName);

    // create a temporary container facet where the temporary mobilePage control will be created.
    UIMobilePageTempContainer tempContainer = new UIMobilePageTempContainer();
    TypedUtil.getFacets(this).put("temp", tempContainer); //$NON-NLS-1$
    try{

        // Create the components that are children of the xe:appPage in the XPage source.
        // This will create another UIMobilePage control under the UIMobilePageTempContainer,
        // and that temporary UIMobilePage will call the buildDynamicContents method above
        // which will create the XPage source children of the xe:appPage underneath
        // this UIMobilePageContent control (i.e. not under the temporary UIMobilePage control)
        // Historically, the component id are stored in lower case in the XPage .java file.
        String createId = getMobilePage().getId();
        page.addComponent(context, null, tempContainer, createId.toLowerCase());

    }finally{
        // remove the temporary container, and
        // the temporary UIMobilePage control under that container.
        TypedUtil.getFacets(this).remove("temp"); //$NON-NLS-1$
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:UIMobilePageContent.java


示例3: writeDataView

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
@Override
protected void writeDataView(FacesContext context, ResponseWriter w,
        AbstractDataView c, ViewDefinition viewDef) throws IOException {
    
    super.writeDataView(context, w, c, viewDef);
    if(viewDef.isInfiniteScroll)
    {
        String theme = "?";
        if( context instanceof FacesContextEx ){
            theme = ((FacesContextEx)context).getStyleKitId();
        }
        String msg = "The \"infiniteScroll\" property is not supported for the current theme ({0})."; // $NLX-DataViewRenderer.infiniteScrollpropertyhaslimiteds-1$
        msg = StringUtil.format(msg, theme);
        throw new IOException(msg);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:17,代码来源:DataViewRenderer.java


示例4: service

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
    // Create a temporary FacesContext and make it available
    FacesContext context = initContext(servletRequest, servletResponse);
    
    ApplicationEx app = ((FacesContextEx)context).getApplicationEx();
    if(app.getController() == null){
        HttpServletResponse resp=(HttpServletResponse)servletResponse;
        resp.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
        resp.setContentType("text/html"); //$NON-NLS-1$
        resp.setCharacterEncoding("UTF-8"); //$NON-NLS-1$
        PrintWriter w = new PrintWriter(new OutputStreamWriter(resp.getOutputStream(),"utf-8")); //$NON-NLS-1$
        // TODO SPR# PHAN9B6BC6 uncomment next line to provide proper error message
        // String errMsg = "The server session has expired. Please reload the main page to start a new session"; // $NLS-XspYaddaYadda-1$
        // TODO remove this string as it is being used temporarily to fix a problem arising after string translation deadline 
        w.println(ResourceHandler.getString("DominoUtils.SessionNotAvailable")); //$NON-NLS-1$
        w.flush();
        return;
    }
    try {
        // Do whatever you need
        super.service(servletRequest, servletResponse);
    } finally {
        releaseContext(context);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:FacesContextServlet.java


示例5: encodeBegin

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
@Override
public void encodeBegin(FacesContext context) throws IOException {
    if(!DIALOG_NEXT) {
        // If the original dialog mode, the content is created by the popup panel
        //if(getDialog().pendingAction==null) {
            FacesContextEx ctx = (FacesContextEx)context;
            if(getDialog().isDialogCreateRequest(ctx)) {
                // If the content is already created, then we first delete it
                // and then recreate it
                createContent(ctx);
            } else {
                // Else, we delete the content if the request is out of the dialog
                if(isContentCreated() && !getDialog().isKeepComponents()) {
                    if(!getDialog().isDialogRequest(ctx)) {
                        deleteContent(ctx);
                    }
                }
            }
        //}
    }
    super.encodeBegin(context);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:UIDialog.java


示例6: deleteContent

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
@Override
protected void deleteContent(FacesContextEx context) {
    if(!getDialog().isKeepComponents()) {
        // Remove the EventHandlers add to the dialog
        List<UIComponent> l = TypedUtil.getChildren(getDialog());
        for(int i=0; i<l.size(); ) {
            UIComponent c = l.get(i);
            if(c instanceof UIEventHandler) {
                l.remove(i);
            } else {
                i++;
            }
        }
        // Then delete the content of the panel
        super.deleteContent(context);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:UIDialog.java


示例7: show

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public void show(Map<String,String> parameters) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    Map<String,String> p = new HashMap<String, String>();
    if(parameters!=null) {
        p.putAll(parameters);
    }
    p.put("$$createdialog", "false"); // $NON-NLS-1$ $NON-NLS-2$
    Action pendingAction = new Action(context,this,ACTION_SHOW_DIALOG,p);
    ExtLibUtil.postScript(context, pendingAction.generateClientScript());
    // Force the content to be recreated here so the JS code can access the dialog
    // components right after it is closed
    // Note that we should then prevent the dialog from being recreated during
    // the rendering phase of the popup panel, else the values will be lost
    PopupContent popup = getPopupContent();
    popup.createContent(context);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:17,代码来源:UIDialog.java


示例8: testNavigatorContainerNode

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public void testNavigatorContainerNode() throws Exception {
        FacesContext context = TestProject.createFacesContext(this); // [0]first get request
        ((FacesContextEx)context).setSessionProperty("xsp.theme", "oneuiv3.0.2");
        String name = "/pages/testNavigatorContainerNode.xsp";
        UIViewRoot root = TestProject.loadView(this, context, name);
        ResponseBuffer.initContext(context);
        
        // this used to throw a NullPointerException:
        String page = ResponseBuffer.encode(root, context);
//        System.out.println("NavigatorContainerNodeTest.testNavigatorContainerNode()\n"+page);
        
        // verify container node renders ok:
        String expectedContent = "";
        expectedContent+="<li><div";
        expectedContent+=" class=\"lotusMenuSubsection\"";
        expectedContent+=" style=\"margin-top: 0\"";
        expectedContent+="><ul>";
        AssertUtil.assertContains(page, expectedContent);
    }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:NavigatorContainerNodeTest.java


示例9: isDialogCreateRequest

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public boolean isDialogCreateRequest(FacesContextEx context) {
    // The current panel is the current one if the request is
    // a partial refresh, where the panel is the target component
    // The request must also include a $$showdialog=true param in the URL
    Map<String, String> params = TypedUtil.getRequestParameterMap(context.getExternalContext());
    if(StringUtil.equals(params.get("$$showdialog"),"true")) { // $NON-NLS-1$ $NON-NLS-2$
        // If the creation had been prohibited, then do not create it
        if(StringUtil.equals(params.get("$$createdialog"),"false")) { // $NON-NLS-1$ $NON-NLS-2$
            return false;
        }
        if(context.isAjaxPartialRefresh()) {
            String id = context.getPartialRefreshId();
            if(DIALOG_NEXT) {
                if(StringUtil.equals(getPopupContent(), id)) {
                    return true;
                }
            } else {
                if(StringUtil.equals(getPopupContent().getClientId(context), id)) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:UIDialog.java


示例10: publishControlData

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
@Override
protected List<ShadowedObject> publishControlData(FacesContext context) {
    List<ShadowedObject> shadowed = super.publishControlData(context);
    DataSource dataSource = getDataSource();
    if( null != dataSource ){
        // make the data source "var" available to computed values in the
        // contained children and facet controls.
        DataPublisher publisher = ((FacesContextEx)context).getDataPublisher();
        List<ShadowedObject> extraShadowed = publisher.pushDataSource(this, dataSource);
        if( null != shadowed ){
            shadowed.addAll( extraShadowed );
        }else{
            shadowed = extraShadowed;
        }
    }
    return shadowed;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:UIDataSourceIterator.java


示例11: show

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public void show(String facet, Map<String,String> parameters) {
    FacesContextEx context = FacesContextEx.getCurrentInstance();
    
    if( StringUtil.isEmpty(facet) ){
        // when the empty string is passed in, load -default-
        facet = PSEUDO_FACET_DEFAULT;
    }
    if ( PSEUDO_FACET_DEFAULT.equals(facet) ){
        // recompute the default facet and load that
        facet = getDefaultFacet();
        if( StringUtil.isEmpty(facet) || PSEUDO_FACET_DEFAULT.equals(facet) ){
            // when the defaultFacet is empty, load -children-
            facet = PSEUDO_FACET_CHILDREN;
        }
    }
    // facet is non-empty here
    if( !StringUtil.equals(PSEUDO_FACET_EMPTY, facet) ) {
        pushParameters(context, parameters);
        TypedUtil.getRequestMap(context.getExternalContext()).put(XSPCONTENT_PARAM,facet);
        createContent(context);
    } else {
        deleteContent(context);
        currentFacet = facet;
    }
    updateHash(facet, parameters);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:UIDynamicContent.java


示例12: invokeOnComponent

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
@Override
   public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
	// Handle partial refresh here
	FacesContextEx ctx = (FacesContextEx)context;
	if(ctx.isRenderingPhase()) {
		UIComponent subTree = getSubTreeComponent();
		if(subTree!=null) {
			this.oldSubTree = ctx.getSubTreeComponent();
			ctx.setSubTreeComponent(subTree);
			try {
				return super.invokeOnComponent(context, clientId, callback);
			} finally {
				ctx.setSubTreeComponent(oldSubTree instanceof UIComponent?(UIComponent)oldSubTree:null);
				oldSubTree = null;
			}
		}
	}
	return super.invokeOnComponent(context, clientId, callback);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:UIDynamicControl.java


示例13: publishControlData

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
/**
 * @see DataPublisher#publishControlData(javax.faces.component.UIComponent)
 * @param context
 * @return
 */
@Override
protected List<ShadowedObject> publishControlData(FacesContext context) {
    List<ShadowedObject> shadowedData = super.publishControlData(context);
    
    // publish the configuration under requestScope['_xsp.app.conf']
    String variableName = CONFIGURATION_KEY;
    ApplicationConfiguration objectToPublish = getConfiguration();
    
    DataPublisher dataPublisher = ((FacesContextEx)context).getDataPublisher();
    if( null == shadowedData || shadowedData.isEmpty() ){ // note when isEmpty will be Collections.emptyList
        shadowedData = dataPublisher.createShadowedList();
    }
    dataPublisher.pushObject(shadowedData, variableName, objectToPublish);
    return shadowedData;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:21,代码来源:UIApplicationLayout.java


示例14: parseNameFormat

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
private NameFormat parseNameFormat(String nameFormatStr){
    if( null != nameFormatStr && nameFormatStr.length() > 0 ){
        // from returnNameFormat="common" to COMMON (only 4 possible values, don't care about locale)
        String upper = nameFormatStr.toUpperCase(Locale.US);
        try{
            NameFormat specified = NameFormat.valueOf(upper);
            return specified;
        }catch(IllegalArgumentException ex){
            // unknown string in XPage source default to unformatted,
            // not usually log (traceDebug is disabled by default).
            if( ExtlibDominoLogger.DOMINO.isTraceDebugEnabled() ){
                String debugMsg = "Unknown property value for valueNameFormat=\"{0}\" on the tag xe:dominoNABNamePicker in the XPage {1}."; //$NON-NLS-1$
                String pageName = "<unknown>"; //$NON-NLS-1$
                FacesContextEx context = FacesContextEx.getCurrentInstance();
                UIViewRootEx viewRoot = (null == context)? null : (UIViewRootEx)context.getViewRoot();
                String viewPageName = (null == viewRoot)? null : viewRoot.getPageName();
                if( null != viewPageName){
                    pageName = viewPageName;
                }
                debugMsg = StringUtil.format(debugMsg, nameFormatStr, pageName);
                ExtlibDominoLogger.DOMINO.traceDebugp(this, "parseNameFormat", ex, debugMsg); //$NON-NLS-1$
            }
        }
    }
    return NameFormat.UNFORMATTED;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:DominoNABNamePickerData.java


示例15: buildControl

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public static UIComponent buildControl(FacesContext context, DynamicComponentFactory factory, UIComponent parent, IControl control, boolean applyTheme) throws FacesException {
    // We create the component ad we add it to the parent *before* actually constructing it
    // This is required by some component, like UIIncludeCompiste, which look for the viewroot in
    // the control hierarchy.
    UIComponent component = control.getComponent();
    if(component.getParent()==null && parent!=null) {
        TypedUtil.getChildren(parent).add(component);
    }
    // Ok, now we build it
    MainBuilder builder = new MainBuilder(factory, control, component);
       UIComponent c = build(context, builder);
	if(c!=null) {
	    if(applyTheme) {
	        ((FacesContextEx)context).getStyleKit().applyStyles(context, c);
	    }
	}
	return c;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:19,代码来源:ControlBuilder.java


示例16: get

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public static OneUIResources get(FacesContextEx context) {
    OneUIResources r = (OneUIResources)context.getAttributes().get("extlib.oneui.Resources"); // $NON-NLS-1$
    if(r!=null) {
        return r;
    }
    Version v = ThemeUtil.getOneUIVersion(context);
    if(v==ThemeUtil.ONEUI_IDX_V13) {
        r = OneUIIDXv13Resources.instance;
    } else if(v==ThemeUtil.ONEUI_V3) {
        r = OneUIv3Resources.instance;
    } else if(v==ThemeUtil.ONEUI_V302) {
        r = OneUIv302Resources.instance;
    } else if(v==ThemeUtil.ONEUI_V21) {
        r = OneUIv21Resources.instance;
    } else {
        // Default to v2
        r = OneUIv2Resources.instance;
    }
    context.getAttributes().put("extlib.oneui.Resources",r); // $NON-NLS-1$
    return r;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:22,代码来源:OneUIResources.java


示例17: isUsingInputPlainText

import com.ibm.xsp.context.FacesContextEx; //导入依赖的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


示例18: invokeOnComponent

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
@Override
public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback) throws FacesException {
    // Handle partial refresh here
    FacesContextEx ctx = (FacesContextEx)context;
    if(ctx.isRenderingPhase()) {
        this.oldSubTree = ctx.getSubTreeComponent();
        ctx.setSubTreeComponent(this);
        try {
            return super.invokeOnComponent(context, clientId, callback);
        } finally {
            ctx.setSubTreeComponent(oldSubTree instanceof UIComponent?(UIComponent)oldSubTree:null);
            oldSubTree = null;
        }
    } else {
        return super.invokeOnComponent(context, clientId, callback);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:UIMobilePageContent.java


示例19: getBuildPackVersion

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
public String getBuildPackVersion() {
    checkOnBluemix();
    // when on bluemix, xsp.buildpack.version=<version> will exist
    // inside the global xsp.properties file...
    String buildpackVersion = ((FacesContextEx) FacesContext.getCurrentInstance()).getProperty("xsp.buildpack.version"); // $NON-NLS-1$
    if (StringUtil.isEmpty(buildpackVersion)) {
        return null;
    }
    return buildpackVersion;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:BluemixContext.java


示例20: createNotImplementedEx

import com.ibm.xsp.context.FacesContextEx; //导入依赖的package包/类
protected NotImplementedException createNotImplementedEx(FacesContext context){
    String theme = null;
    if( context instanceof FacesContextEx ){
        theme = ((FacesContextEx)context).getStyleKitId();
    }
    String renderKitId = null;
    UIViewRoot viewRoot = context.getViewRoot();
    if( null != viewRoot ){
        renderKitId = viewRoot.getRenderKitId();
    }
    String msg = "This control is not implemented for the current theme ({0}) and render-kit({1}), try a different theme, perhaps {2}."; // $NLX-NotImplementedRenderer_ThisControlIsNotImplemented-1$
    msg = StringUtil.format(msg, theme, renderKitId, getSuggestedTheme());
    throw new NotImplementedException(msg);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:15,代码来源:NotImplementedRenderer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NamespaceContextEx类代码示例发布时间:2022-05-23
下一篇:
Java AdErrorEvent类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap