Package org.exoplatform.web.application

Examples of org.exoplatform.web.application.ApplicationMessage


        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        UIApplication uiApp = context.getUIApplication();
        String pass1x = getUIStringInput(PASSWORD1X).getValue();
        String pass2x = getUIStringInput(PASSWORD2X).getValue();
        if (!pass1x.equals(pass2x)) {
            uiApp.addMessage(new ApplicationMessage("UIAccountForm.msg.password-is-not-match", null, ApplicationMessage.ERROR));
            return false;
        }
        String username = getUIStringInput(USERNAME).getValue();
        if (newUser) {
            User user = service.getUserHandler().createUserInstance(username);
            invokeSetBindingField(user);
            // user.setPassword(Util.encodeMD5(pass1x)) ;
            if (service.getUserHandler().findUserByName(user.getUserName()) != null) {
                Object[] args = { user.getUserName() };
                uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", args, ApplicationMessage.ERROR));
                return false;
            }

            Query query = new Query();
            query.setEmail(getUIStringInput("email").getValue());
            if (service.getUserHandler().findUsers(query).getAll().size() > 0) {
                Object[] args = { user.getUserName() };
                uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.email-exist", args, ApplicationMessage.ERROR));
                return false;
            }

            service.getUserHandler().createUser(user, true);
            reset();
View Full Code Here


                return;
            }
            UIFormPageIterator uiInputIterator = uiInputContainer.findFirstComponentOfType(UIFormPageIterator.class);
            if (uiInputIterator.getAvailable() < 1) {
                String[] args = { "UITabPane.title.UIListPermissionSelector" };
                throw new MessageException(new ApplicationMessage("EmptyIteratorValidator.msg.empty", args,
                        ApplicationMessage.INFO));
            }
        }
View Full Code Here

            UIWorkingWorkspace uiWorkingWS = event.getSource();

            UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermissionOnPortal(currentPortal.getSiteType().getName(), currentPortal.getName(),
                    currentPortal.getEditPermission())) {
                portalApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditLayout-Permission",
                        new String[] { currentPortal.getName() }));
                return;
            }

            DataStorage dataStorage = portalApp.getApplicationComponent(DataStorage.class);
View Full Code Here

        public void execute(Event<UIWorkingWorkspace> event) throws Exception {
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication uiApp = event.getSource().getAncestorOfType(UIPortalApplication.class);
            UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
            if (!userACL.hasCreatePortalPermission()) {
                uiApp.addMessage(new ApplicationMessage("UIPortalBrowser.msg.Invalid-createPermission", null));
                return;
            }
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPortalForm uiNewPortal = uiMaskWS.createUIComponent(UIPortalForm.class, "CreatePortal", "UIPortalForm");
            uiNewPortal.initPortalTemplateTab();
View Full Code Here

                query.setEmail(newEmail);
                if (service.getUserHandler().findUsers(query).getAll().size() > 0 && !oldEmail.equals(newEmail)) {
                    // Be sure it keep old value
                    user.setEmail(oldEmail);
                    Object[] args = { userName };
                    uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.email-exist", args));
                    return;
                }
                user.setFirstName(uiForm.getUIStringInput("firstName").getValue());
                user.setLastName(uiForm.getUIStringInput("lastName").getValue());
                user.setDisplayName(uiForm.getUIStringInput("displayName").getValue());
                user.setEmail(newEmail);
                uiApp.addMessage(new ApplicationMessage("UIAccountProfiles.msg.update.success", null));
                service.getUserHandler().saveUser(user, true);

                state.setAttribute(CacheUserProfileFilter.USER_PROFILE, user);
                UIWorkingWorkspace uiWorkingWS = Util.getUIPortalApplication().getChild(UIWorkingWorkspace.class);
                uiWorkingWS.updatePortletsByName("UserInfoPortlet");
View Full Code Here

            } catch (Exception ex) {
                authenticated = false;
            }

            if (!authenticated) {
                uiApp.addMessage(new ApplicationMessage("UIAccountChangePass.msg.currentpassword-is-not-match", null, 1));
                uiForm.reset();
                event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
                return;
            }

            if (!newPass.equals(confirmnewPass)) {
                uiApp.addMessage(new ApplicationMessage("UIAccountChangePass.msg.password-is-not-match", null, 1));
                uiForm.reset();
                event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
                return;
            }
            user.setPassword(newPass);
            uiApp.addMessage(new ApplicationMessage("UIAccountChangePass.msg.change.pass.success", null));
            service.getUserHandler().saveUser(user, true);
            uiForm.reset();
            event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
            UIAccountSetting ui = uiForm.getParent();
            ui.getChild(UIAccountProfiles.class).setRendered(true);
View Full Code Here

                pcontext.ignoreAJAXUpdateOnPortlets(false);
                pcontext.setResponseComplete(true);
                pcontext.getWriter().write(EventListener.RESULT_OK);
            } else {
                org.exoplatform.webui.core.UIApplication uiApp = pcontext.getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIPage.msg.EditPermission.null", null));
            }
        }
View Full Code Here

                    try {
                        oauthProviderTypeToUnlink.getOauthProviderProcessor().revokeToken(accessToken);
                    } catch (OAuthException oe) {
                        if (OAuthExceptionCode.TOKEN_REVOCATION_FAILED.equals(oe.getExceptionCode())) {
                            Throwable t = oe.getCause() != null ? oe.getCause() : oe;
                            ApplicationMessage appMessage = new ApplicationMessage("UIAccountSocial.msg.failed-revoke", null, ApplicationMessage.WARNING);
                            appMessage.setArgsLocalized(false);
                            uiApp.addMessage(appMessage);
                            log.warn("Revocation of accessToken failed for user " + userName + ". Details: " + t.getClass() + ": " + t.getMessage());
                        } else {
                            throw oe;
                        }
                    }
                }

                Object[] args = { oauthProviderTypeToUnlink.getFriendlyName(), userName};
                ApplicationMessage appMessage = new ApplicationMessage("UIAccountSocial.msg.successful-unlink", args);
                appMessage.setArgsLocalized(false);
                uiApp.addMessage(appMessage);

                prContext.setAttribute(UserProfileLifecycle.USER_PROFILE_ATTRIBUTE_NAME, userProfile);
                uiForm.updateUIFields();
                prContext.addUIComponentToUpdateByAjax(uiForm);
View Full Code Here

            String uri = context.getRequestParameter(OBJECTID);
            UIPageNodeSelector uiPageNodeSelector = pageSetInfo.getChild(UIPageNodeSelector.class);
            try {
                uiPageNodeSelector.setSelectedURI(uri);
                if (!uiPageNodeSelector.getSelectedNode().getURI().equals(uri)) {
                    context.getUIApplication().addMessage(new ApplicationMessage("UIWizardPageSetInfo.msg.node.deleted", null));
                }
            } catch (NavigationServiceException ex) {
                context.getUIApplication().addMessage(
                        new ApplicationMessage("UIWizardPageSetInfo.msg.navigation.deleted", null));
                uiWizard.createEvent("Abort", Phase.PROCESS, context).broadcast();
                return;
            }

            event.getRequestContext().addUIComponentToUpdateByAjax(uiWizard);
View Full Code Here

                Util.getPortalRequestContext().setResponseComplete(true);
            } catch (Exception e) {
                UIPortletApplication uiPortlet = uiGadget.getAncestorOfType(UIPortletApplication.class);
                context.addUIComponentToUpdateByAjax(uiPortlet);
                context.setAttribute(UIGadget.SAVE_PREF_FAIL, true);
                throw new MessageException(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null,
                        ApplicationMessage.ERROR));
            }

            //
            if (uiGadget.isLossData()) {
View Full Code Here

TOP

Related Classes of org.exoplatform.web.application.ApplicationMessage

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.