Package org.exoplatform.webui.application

Examples of org.exoplatform.webui.application.WebuiApplication


    @Override
    public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception {
        context.setStateManager(this);

        //
        WebuiApplication app = (WebuiApplication) context.getApplication();

        //
        ApplicationState appState = null;
        HttpSession session = getSession(context);
        String key = getKey(context);
        if (session != null) {
            appState = (ApplicationState) session.getAttribute(APPLICATION_ATTRIBUTE_PREFIX + key);
        }

        UIApplication uiapp = null;
        if (appState != null) {
            if (log.isDebugEnabled()) {
                log.debug("Found application " + key + " :" + appState.getApplication());
            }
            if (Safe.equals(context.getRemoteUser(), appState.getUserName())) {
                uiapp = appState.getApplication();
            }
        } else {
            log.debug("Application " + key + " not found");
        }

        //
        if (uiapp == null) {
            ConfigurationManager cmanager = app.getConfigurationManager();
            String uirootClass = cmanager.getApplication().getUIRootComponent().trim();
            Class<? extends UIApplication> type = (Class<UIApplication>) Thread.currentThread().getContextClassLoader()
                    .loadClass(uirootClass);
            uiapp = app.createUIComponent(type, null, null, context);
        }

        //
        return uiapp;
    }
View Full Code Here


    @Override
    public UIApplication restoreUIRootComponent(WebuiRequestContext context) throws Exception {
        context.setStateManager(this);

        //
        WebuiApplication app = (WebuiApplication) context.getApplication();

        //
        ApplicationState appState = null;
        HttpSession session = getSession(context);
        if (session != null) {
            appState = (ApplicationState) session.getAttribute(APPLICATION_KEY);
        }

        //

        //
        UIApplication uiapp = null;
        if (appState != null) {
            if (Safe.equals(context.getRemoteUser(), appState.getUserName())) {
                uiapp = appState.getApplication();
            }
        }

        //
        if (appState != null) {
            log.debug("Found application " + APPLICATION_KEY + " :" + appState.getApplication());
        } else {
            log.debug("Application " + APPLICATION_KEY + " not found");
        }

        //
        if (uiapp == null) {
            ConfigurationManager cmanager = app.getConfigurationManager();
            String uirootClass = cmanager.getApplication().getUIRootComponent().trim();
            Class<? extends UIApplication> type = (Class<UIApplication>) Thread.currentThread().getContextClassLoader()
                    .loadClass(uirootClass);
            uiapp = app.createUIComponent(type, null, null, context);
        }

        //
        return uiapp;
    }
View Full Code Here

        if (context.useAjax() && !prcontext.getFullRender()) {
            if (markup != null) {
                markup.writeTo(prcontext.getWriter());
            }
        } else {
            WebuiApplication app = (WebuiApplication) prcontext.getApplication();
            ApplicationResourceResolver resolver = app.getResourceResolver();
            WebuiBindingContext bcontext = new WebuiBindingContext(resolver, context.getWriter(), uicomponent, prcontext);
            bcontext.put(UIComponent.UICOMPONENT, uicomponent);
            bcontext.put("portletContent", markup);
            try {
                renderTemplate(uicomponent.getTemplate(), bcontext);
View Full Code Here

    @Override
    public UIPage createUIPage(WebuiRequestContext context) throws Exception {
        if (context == null) {
            context = WebuiRequestContext.getCurrentInstance();
        }
        WebuiApplication app = (WebuiApplication) context.getApplication();
        UIPage uiPage = app.createUIComponent(UIPage.class, null, null, context);
        return uiPage;
    }
View Full Code Here

   @SuppressWarnings("unchecked")
   public <T extends UIComponent> T replaceChild(String targetChildId, Class<T> type, String configId, String id)
      throws Exception
   {
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      WebuiApplication app = (WebuiApplication)context.getApplication();
      UIComponent comp = app.createUIComponent(type, configId, id, context);
      comp = replaceChild(targetChildId, comp);
      return (T)comp;
   }
View Full Code Here

   }

   public <T extends UIComponent> T addChild(Class<T> type, String configId, String id) throws Exception
   {
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      WebuiApplication app = (WebuiApplication)context.getApplication();
      T comp = app.createUIComponent(type, configId, id, context);
      addChild(comp);
      return comp;
   }
View Full Code Here

   }

   public void setComponentConfig(Class<?> clazz, String id)
   {
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      WebuiApplication app = (WebuiApplication)context.getApplication();
      this.config = app.getConfigurationManager().getComponentConfig(clazz, id);
   }
View Full Code Here

   }

   public <T extends UIComponent> T createUIComponent(WebuiRequestContext context, Class<T> type, String configId,
      String componentId) throws Exception
   {
      WebuiApplication app = (WebuiApplication)context.getApplication();
      T comp = app.createUIComponent(type, configId, componentId, context);
      return comp;
   }
View Full Code Here

        setId(componentId);
    }

    public void setComponentConfig(Class<?> clazz, String id) {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        WebuiApplication app = (WebuiApplication) context.getApplication();
        this.config = app.getConfigurationManager().getComponentConfig(clazz, id);
    }
View Full Code Here

        return createUIComponent(context, type, configId, componentId);
    }

    public <T extends UIComponent> T createUIComponent(WebuiRequestContext context, Class<T> type, String configId,
            String componentId) throws Exception {
        WebuiApplication app = (WebuiApplication) context.getApplication();
        T comp = app.createUIComponent(type, configId, componentId, context);
        return comp;
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.application.WebuiApplication

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.