Package org.exoplatform.webui.core

Examples of org.exoplatform.webui.core.UIApplication


            for (ApplicationLifecycle<RequestContext> lifecycle : getApplicationLifecycle())
            {
               lifecycle.onStartRequest(this, context);
            }
         }
         UIApplication uiApp = getStateManager().restoreUIRootComponent(context);
         context.setUIApplication(uiApp);
         if (!context.isResponseComplete())
         {
            UIPortletApplication uiPortletApp = (UIPortletApplication)uiApp;
            uiPortletApp.processRender(this, context);
         }
         uiApp.setLastAccessApplication(System.currentTimeMillis());
      }
      finally
      {

         // Close the writer
View Full Code Here


            UIChangePassword uiForm = event.getSource();
            String password = uiForm.getUIStringInput(PASSWORD).getValue();
            String newpassword = uiForm.getUIStringInput(NEW_PASSWORD).getValue();
            String confirmnewpassword = uiForm.getUIStringInput(CONFIRM_NEW_PASSWORD).getValue();
            WebuiRequestContext request = event.getRequestContext();
            UIApplication uiApp = request.getUIApplication();
            OrganizationService orgService = uiForm.getApplicationComponent(OrganizationService.class);
            uiForm.reset();
            boolean isNew = true;
            if (!orgService.getUserHandler().authenticate(user_.getUserName(), password)) {
                uiApp.addMessage(new ApplicationMessage("UIResetPassword.msg.Invalid-account", null));
                isNew = false;
            }
            if (!newpassword.equals(confirmnewpassword)) {
                uiApp.addMessage(new ApplicationMessage("UIResetPassword.msg.password-is-not-match", null));
                isNew = false;
            }

            UIMaskWorkspace uiMaskWorkspace = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            if (isNew) {
                user_.setPassword(newpassword);
                orgService.getUserHandler().saveUser(user_, true);
                uiMaskWorkspace.createEvent("Close", Phase.DECODE, request).broadcast();
                uiApp.addMessage(new ApplicationMessage("UIResetPassword.msg.change-password-successfully", null));
            }
            request.addUIComponentToUpdateByAjax(uiMaskWorkspace);
        }
View Full Code Here

        public void execute(Event<UIResetPassword> event) throws Exception {
            UIResetPassword uiForm = event.getSource();
            String newpassword = uiForm.getUIStringInput(NEW_PASSWORD).getValue();
            String confirmnewpassword = uiForm.getUIStringInput(CONFIRM_NEW_PASSWORD).getValue();
            WebuiRequestContext request = event.getRequestContext();
            UIApplication uiApp = request.getUIApplication();
            UIMaskWorkspace uiMaskWorkspace = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            OrganizationService orgService = uiForm.getApplicationComponent(OrganizationService.class);
            RemindPasswordTokenService tokenService = uiForm.getApplicationComponent(RemindPasswordTokenService.class);

            uiForm.reset();
            boolean setPassword = true;

            if (!newpassword.equals(confirmnewpassword)) {
                uiApp.addMessage(new ApplicationMessage("UIResetPassword.msg.password-is-not-match", null));
                setPassword = false;
            }

            Token token = tokenService.deleteToken(uiForm.getTokenId());
            if (token == null || token.isExpired()) {
                uiApp.addMessage(new ApplicationMessage("UIForgetPassword.msg.expration", null));
                setPassword = false;
            }

            if (setPassword) {
                user_.setPassword(newpassword);
                orgService.getUserHandler().saveUser(user_, true);
                uiMaskWorkspace.createEvent("Close", Phase.DECODE, request).broadcast();
                uiApp.addMessage(new ApplicationMessage("UIResetPassword.msg.change-password-successfully", null));
            }
            request.addUIComponentToUpdateByAjax(uiMaskWorkspace);
        }
View Full Code Here

        }

        //

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

        return uiapp;
    }

    @Override
    public void storeUIRootComponent(final WebuiRequestContext context) throws Exception {
        UIApplication uiapp = context.getUIApplication();

        //
        if (uiapp != null) {
            HttpSession session = getSession(context);
View Full Code Here

    @SuppressWarnings("unchecked")
    protected void processRequest(PortalRequestContext context, PortalApplication app) throws Exception {
        WebuiRequestContext.setCurrentInstance(context);
        PortalRequestImpl.createInstance(context);

        UIApplication uiApp = app.getStateManager().restoreUIRootComponent(context);

        List<ApplicationLifecycle> lifecycles = app.getApplicationLifecycle();
        try {
            if (context.getUIApplication() != uiApp)
                context.setUIApplication(uiApp);
            for (ApplicationLifecycle lifecycle : lifecycles)
                lifecycle.onStartRequest(app, context);

            if (uiApp != null) {
                uiApp.processDecode(context);
            }

            if (!context.isResponseComplete() && !context.getProcessRender()) {
                startRequestPhaseLifecycle(app, context, lifecycles, Phase.ACTION);
                uiApp.processAction(context);
                endRequestPhaseLifecycle(app, context, lifecycles, Phase.ACTION);
            }

            if (!context.isResponseComplete()) {
                startRequestPhaseLifecycle(app, context, lifecycles, Phase.RENDER);
                uiApp.processRender(context);
                endRequestPhaseLifecycle(app, context, lifecycles, Phase.RENDER);
            }

            if (uiApp != null)
                uiApp.setLastAccessApplication(System.currentTimeMillis());

            // Store ui root
            app.getStateManager().storeUIRootComponent(context);
        } catch (StaleModelException staleModelEx) {
            // Minh Hoang TO:
View Full Code Here

        user.setFullName(getDisplayName());
        user.setEmail(getEmail());
    }

    public boolean save(UserHandler userHandler, WebuiRequestContext context) throws Exception {
        UIApplication uiApp = context.getUIApplication();
        String pass = getPassword();
        String confirm_pass = getUIStringInput(CONFIRM_PASSWORD).getValue();

        if (!pass.equals(confirm_pass)) {
            uiApp.addMessage(new ApplicationMessage("UIAccountForm.msg.password-is-not-match", null));
            return false;
        }

        String username = getUserName();

        // Check if user name already existed
        if (userHandler.findUserByName(username) != null) {
            Object[] args = { username };
            uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", args));
            return false;
        }

        // Check if mail address is already used
        Query query = new Query();
        query.setEmail(getEmail());
        if (userHandler.findUsers(query).getAll().size() > 0) {
            Object[] args = { username };
            uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.email-exist", args));
            return false;
        }

        User user = userHandler.createUserInstance(username);
        bindingFields(user);
View Full Code Here

                    UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
                    UIPortal editPortal = (UIPortal) uiEditWS.getUIComponent();
                    uiForm.invokeSetBindingBean(editPortal);
                }
            } else {
                UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));

                UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
                prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
                prContext.setFullRender(true);
            }
View Full Code Here

            String template = uiForm.getChild(UIFormInputItemSelector.class).getSelectedItemOption().getValue().toString();
            String portalName = uiForm.getUIStringInput(FIELD_NAME).getValue();
            DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
            PortalConfig config = dataService.getPortalConfig(portalName);
            if (config != null) {
                UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.sameName", null));
                return;
            }

            UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
            service.createUserPortalConfig(SiteType.PORTAL.getName(), portalName, template);
View Full Code Here

            UIPageBrowser uiPageBrowser = event.getSource();
            WebuiRequestContext context = event.getRequestContext();
            String id = context.getRequestParameter(OBJECTID);

            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
            UIApplication uiApp = context.getUIApplication();
            PageContext page = (id != null) ? service.getPageService().loadPage(PageKey.parse(id)) : null;

            if (page == null) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { id }, 1));
                return;
            }

            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(page)) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[] { id }, 1));
                return;
            }

            UIPortal uiPortal = Util.getUIPortal();
            UserNode userNode = uiPortal.getSelectedUserNode();
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.core.UIApplication

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.