Package org.exoplatform.web.application

Examples of org.exoplatform.web.application.ApplicationMessage


            /*
             * if it is a edition of the current page and it is not available to current remote user anymore.
             */
            PageKey pageKey = PageKey.parse(pageId);
            if (page.getStorageId() != null && portalConfigService.getPageService().loadPage(pageKey) == null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { pageId },
                        ApplicationMessage.WARNING));
                uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
                uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
                Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(true);

View Full Code Here


        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

            context.addUIComponentToUpdateByAjax(uicomponent);
        } catch (NoSuchDataException e) {
            UIPortalApplication uiApp = Util.getUIPortalApplication();
            uiApp.refreshCachedUI();
            ApplicationMessage msg = new ApplicationMessage("UIPortlet.message.staleData", null,
                    ApplicationMessage.WARNING);
            uiApp.addMessage(msg);
        } catch (Exception e) {
            String message = e.getLocalizedMessage();
            log.error("Error processing the action: " + message, e);
            Object[] args = { message };
            context.addUIComponentToUpdateByAjax(uicomponent);
            throw new MessageException(new ApplicationMessage("UIPortletLifecycle.msg.process-error", args,
                    ApplicationMessage.ERROR));
        }

    }
View Full Code Here

                    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 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

            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

            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);

            // Check existence of the page
            PageContext pageContext = (id != null) ? service.getPage(PageKey.parse(id)) : null;
            if (pageContext == null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { id }, 1));
                return;
            }

            // Check current user 's permissions on the page
            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(pageContext)) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.edit.NotEditPage", new String[] { id }, 1));
                return;
            }

            // Need this code to override editpage action in extension project
            UIPageFactory clazz = UIPageFactory.getInstance(pageContext.getState().getFactoryId());
View Full Code Here

        public void execute(Event<UIComponent> event) throws Exception {
            UIComponent uiComponentTobeRemoved = event.getSource();
            String id = uiComponentTobeRemoved.getId();
            UIPortalApplication uiApp = Util.getUIPortalApplication();
            if (uiComponentTobeRemoved.findFirstComponentOfType(UIPageBody.class) != null) {
                uiApp.addMessage(new ApplicationMessage("UIPortalApplication.msg.deletePageBody", new Object[] {},
                        ApplicationMessage.WARNING));
                return;
            }

            UIPortalComposer portalComposer = uiApp.findFirstComponentOfType(UIPortalComposer.class);
View Full Code Here

            // create new page
            if (uiPage == null) {
                PageService pageService = uiPageForm.getApplicationComponent(PageService.class);
                PageContext existPage = pageService.loadPage(page.getPageKey());
                if (existPage != null) {
                    uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.sameName", null));
                    return;
                }
                page.setModifiable(true);
                if (page.getChildren() == null) {
                    page.setChildren(new ArrayList<ModelObject>());
View Full Code Here

            String tokenId = event.getRequestContext().getRequestParameter("tokenId");

            WebuiRequestContext requestContext = event.getRequestContext();
            GateInToken token = tokenService.getToken(tokenId);
            if (token == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.expration", null));
                requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
                return;
            }

            OrganizationService orgSrc = uiPortal.getApplicationComponent(OrganizationService.class);
            // get user
            User user = orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername());
            if (user == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.user-delete", null));
                return;
            }

            UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
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.