Package com.ibm.xsp.context

Examples of com.ibm.xsp.context.FacesContextEx


    String value = c.getValueAsString();
    value = prettify(value,false);
    if(value!=null) {
      c.setValue(value);
    } else {
      FacesContextEx ctx = FacesContextEx.getCurrentInstance();
      String msg = "Invalid file content";
      FacesMessage m = new FacesMessage(FacesMessage.SEVERITY_WARN, msg, msg);
      ctx.addMessage(c != null ? c.getClientId(ctx) : null, m);
    }
  }
View Full Code Here


    String value = c.getValueAsString();
    value = prettify(value,true);
    if(value!=null) {
      c.setValue(value);
    } else {
      FacesContextEx ctx = FacesContextEx.getCurrentInstance();
      String msg = "Invalid file content";
      FacesMessage m = new FacesMessage(FacesMessage.SEVERITY_WARN, msg, msg);
      ctx.addMessage(c != null ? c.getClientId(ctx) : null, m);
    }
  }
View Full Code Here

    return "connections,connectionsOA2,smartcloud,smartcloudOA2,sametime,domino,twitter,dropbox";
  }
   
    @Override
  public void prepareEndpoints(PlaygroundEnvironment env) {
      FacesContextEx context = FacesContextEx.getCurrentInstance();
   
      pushProperty(context,env,"sbt.endpoint.connections");
      pushProperty(context,env,"sbt.endpoint.smartcloud");
      pushProperty(context,env,"sbt.endpoint.domino");
      pushProperty(context,env,"sbt.endpoint.sametime");
View Full Code Here

    return instance;
  }

  protected ClassLoader getContextClassLoader() {
    // Get it from the faces context, if available
    FacesContextEx ctx = FacesContextEx.getCurrentInstance();
    if(ctx!=null) {
      return ctx.getContextClassLoader();
    }
    // Else, execute this is a privileged block
        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
            public ClassLoader run() {
            return Thread.currentThread().getContextClassLoader();
View Full Code Here

    XspApplication app = (XspApplication)super.getApplicationUnchecked();
    if(app==null) {
      // There is no application created
      // This might be because we are in a faces request, and no call to the SBT library had been made so far
      // In this case, we create the application object and we destroy it when the XPages application is destroyed
      FacesContextEx facesContext = FacesContextEx.getCurrentInstance();
      if(facesContext!=null) {
        final XspApplication newApp = app = (XspApplication)initApplication(facesContext.getExternalContext().getContext());
        ApplicationEx facesApplication = facesContext.getApplicationEx();
        facesApplication.addApplicationListener(new ApplicationListener() {
          public void applicationDestroyed(ApplicationEx application) {
          }
          public void applicationCreated(ApplicationEx application) {
            destroyApplication(newApp);
View Full Code Here

  }

  public XspContext getContextUnchecked() {
    XspContext ctx = (XspContext)super.getContextUnchecked();
    if(ctx==null) {
      FacesContextEx facesContext = FacesContextEx.getCurrentInstance();
      if(facesContext!=null) {
        Application app = getApplicationUnchecked();
        // We initialize a temporary context
        ExternalContext extCtx = facesContext.getExternalContext();
        final XspContext newContext = ctx = (XspContext)initContext(app, extCtx.getRequest(), extCtx.getResponse());
        // we should clear the context when the JSF context is discarded
        facesContext.addRequestListener(new FacesContextListener() {
          public void beforeRenderingPhase(FacesContext facesContext) {
          }
          public void beforeContextReleased(FacesContext facesContext) {
            destroyContext(newContext);
          }
View Full Code Here

  @Override
  public Context createContext(Application application, Object request, Object response) {
    boolean deleteFacesContext = false;
    // FacesContext must had been created by initContext(), when not in a faces request
    FacesContextEx facesContext = FacesContextEx.getCurrentInstance();
    if(facesContext==null) {
      // We create a temporary context
      facesContext = createFacesContext(application, request, response);
      deleteFacesContext = true;
    }
View Full Code Here

        HttpServletRequest request=(HttpServletRequest)servletRequest;
        HttpServletResponse response=(HttpServletResponse)servletResponse;
       
        // Create a temporary FacesContext and make it available
        FacesContextFactory contextFactory = (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
        FacesContextEx context = (FacesContextEx)contextFactory.getFacesContext(servletContext, request, response, dummyLifeCycle);
        return context;
    }
View Full Code Here

      if(action!=null) {
        action.updateCompletion(100,100);
        action.updateTask(msg);
      }

      FacesContextEx ctx = FacesContextEx.getCurrentInstance();
      if(ctx!=null) {
        FacesMessage m = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
        FacesContextEx.getCurrentInstance().addMessage(null, m);
      }
    } catch(Exception ex) {
      String msg = StringUtil.format("Error while importing assets from source \"{0}\"", sourceName);

      FacesContextEx ctx = FacesContextEx.getCurrentInstance();
      if(ctx!=null) {
        FacesMessage m = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
        FacesContextEx.getCurrentInstance().addMessage(null, m);
      }
View Full Code Here

  private void doBeforeEveryPhase(final PhaseEvent arg0) {
    FacesContext ctx = arg0.getFacesContext();
    Factory.setClassLoader(Thread.currentThread().getContextClassLoader());

    if (ctx instanceof FacesContextEx) {
      FacesContextEx ctxex = (FacesContextEx) ctx;
      ctxex.addRequestListener(this);

    }
  }
View Full Code Here

TOP

Related Classes of com.ibm.xsp.context.FacesContextEx

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.