Package org.exoplatform.web.application

Examples of org.exoplatform.web.application.ApplicationMessage


                    prContext.setResponseComplete(true);
                    prContext.getResponse().sendRedirect(request.getContextPath());
                    return;
                } else {
                    UIApplication uiApp = prContext.getUIApplication();
                    uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));
                    prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
                }
            }
        }
View Full Code Here


            UIWorkingWorkspace uiWorkingWS = uiWizard.getAncestorOfType(UIWorkingWorkspace.class);
            uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class).setRendered(false);
            uiWizard.viewStep(SECOND_STEP);

            if (uiWizard.getSelectedStep() < SECOND_STEP) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageCreationWizard.msg.StepByStep", null));
                uiWizard.viewStep(FIRST_STEP);
                uiWizard.updateWizardComponent();
                return;
            }

            if (uiWizard.isSelectedNodeExist()) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageCreationWizard.msg.NameNotSame", null));
                uiWizard.viewStep(FIRST_STEP);
                uiWizard.updateWizardComponent();
                return;
            }

            UIWizardPageSetInfo uiPageSetInfo = uiWizard.getChild(UIWizardPageSetInfo.class);
            UIPageNodeSelector uiNodeSelector = uiPageSetInfo.getChild(UIPageNodeSelector.class);
            uiWizard.updateWizardComponent();
            UserNavigation navigation = uiNodeSelector.getNavigation();
            if (navigation == null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageCreationWizard.msg.notSelectedPageNavigation",
                        new String[] {}));
                uiWizard.viewStep(FIRST_STEP);
                return;
            }

            if (uiPageSetInfo.getUICheckBoxInput(UIWizardPageSetInfo.VISIBLE).isChecked()
                    && uiPageSetInfo.getUICheckBoxInput(UIWizardPageSetInfo.SHOW_PUBLICATION_DATE).isChecked()) {

                Calendar currentCalendar = Calendar.getInstance();
                currentCalendar.set(currentCalendar.get(Calendar.YEAR), currentCalendar.get(Calendar.MONTH),
                        currentCalendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
                Date currentDate = currentCalendar.getTime();

                Calendar startCalendar = uiPageSetInfo.getUIFormDateTimeInput(UIWizardPageSetInfo.START_PUBLICATION_DATE)
                        .getCalendar();
                Date startDate = (startCalendar != null) ? startCalendar.getTime() : currentDate;
                Calendar endCalendar = uiPageSetInfo.getUIFormDateTimeInput(UIWizardPageSetInfo.END_PUBLICATION_DATE)
                        .getCalendar();
                Date endDate = (endCalendar != null) ? endCalendar.getTime() : null;

                // Case 1: current date after start date
                if (currentDate.after(startDate)) {
                    Object[] args = {};
                    uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.currentDateBeforeStartDate", args,
                            ApplicationMessage.WARNING));
                    uiWizard.viewStep(FIRST_STEP);
                    return;

                    // Case 2: start date after end date
                } else if ((endCalendar != null) && (startCalendar != null) && (startDate.after(endDate))) {
                    Object[] args = {};
                    uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.startDateBeforeEndDate", args,
                            ApplicationMessage.WARNING));
                    uiWizard.viewStep(FIRST_STEP);
                    return;

                    // Case 3: start date is null and current date after end date
                } else if ((endCalendar != null) && (currentDate.after(endDate))) {
                    Object[] args = {};
                    uiPortalApp.addMessage(new ApplicationMessage("UIPageNodeForm.msg.currentDateBeforeEndDate", args,
                            ApplicationMessage.WARNING));
                    uiWizard.viewStep(FIRST_STEP);
                    return;
                }
            }
View Full Code Here

                        orgService.getUserHandler().removeUser(newUser.getUserName(), true);

                        // Clear previous message about successful creation of user because we dropped him. Add message about duplicate oauth username
                        Object[] args = new Object[] {gtnOAuthException.getExceptionAttribute(OAuthConstants.EXCEPTION_OAUTH_PROVIDER_USERNAME),
                                gtnOAuthException.getExceptionAttribute(OAuthConstants.EXCEPTION_OAUTH_PROVIDER_NAME)};
                        ApplicationMessage appMessage = new ApplicationMessage("UIAccountSocial.msg.failed-registration", args, ApplicationMessage.WARNING);
                        uiApp.addMessage(appMessage);
                        return;
                    } else {
                        throw gtnOAuthException;
                    }
View Full Code Here

            UIRegisterInputSet registerInput = registerForm.getChild(UIRegisterInputSet.class);

            if (registerInput.save(userHandler, context)) {
                // TODO: Add Account Activating feature
                UIApplication uiApp = context.getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIRegisterForm.registerWithSuccess.message", null));

                // Send mail to administrator after successful registration of user
                PostRegistrationService postRegistrationService = uiApp.getApplicationComponent(PostRegistrationService.class);
                User user = (User) context.getAttribute(ATTR_USER);
                postRegistrationService.sendMailAfterSuccessfulRegistration(user);
View Full Code Here

            String typedUsername = userNameInput.getValue();
            WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
            UIApplication uiApp = context.getUIApplication();
            if (usernameIsUsed(typedUsername, orgService)) {
                uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", new String[] { typedUsername },
                        ApplicationMessage.WARNING));
            } else {
                uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-not-exist", new String[] { typedUsername },
                        ApplicationMessage.INFO));
            }
        }
View Full Code Here

        PageKey pageKey = new PageKey(getSiteKey(), getName());
        PageContext pageContext = pageService.loadPage(pageKey);
        if (pageContext == null) {
            UIPortalApplication uiApp = Util.getUIPortalApplication();
            ApplicationMessage msg = new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { pageKey.format() }, 1);
            uiApp.addMessage(msg);
        } else {
            Page page = dataStorage.getPage(pageKey.format());
            pageContext.update(page);
            switchToEditMode(page);
View Full Code Here

        // check edit permission for page
        UserACL userACL = getApplicationComponent(UserACL.class);
        if (!userACL.hasEditPermission(page)) {
            context.getUIApplication().addMessage(
                    new ApplicationMessage("UIPortalManagement.msg.Invalid-EditPage-Permission", null));
            return;
        }

        UIPortalApplication uiApp = Util.getUIPortalApplication();
        UIWorkingWorkspace uiWorkingWS = uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
View Full Code Here

            if (uiPortletForm.setValues(uiPortlet) == false) {
                uiMaskWS.setUIComponent(null);
                WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
                context.getUIApplication().addMessage(
                        (new ApplicationMessage("UIPortlet.message.portletDeleted", null, ApplicationMessage.ERROR)));
            } else {
                uiMaskWS.setUpdated(true);
                uiMaskWS.setWindowSize(800, -1);
                event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
            }
View Full Code Here

            userNav = userPortal.getNavigation(userNav.getKey());

            if (userNav == null) {
                UIPortalApplication uiPortalApp = (UIPortalApplication) prContext.getUIApplication();
                uiPortalApp.addMessage(new ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore", null));
                UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
                prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
                prContext.setFullRender(true);
                UIPopupWindow uiPopup = uiForm.getParent();
                uiPopup.setShow(false);
View Full Code Here

            UIApplication uiApp = ctx.getUIApplication();
            UIPageSelector uiPageSelector = uiPageBrowser.getAncestorOfType(UIPageSelector.class);
            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasPermission(service.getPageService().loadPage(PageKey.parse(id)))) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.NoPermission", new String[] { id }));
            }
            uiPageSelector.setValue(id);
            // uiPageBrowser.feedDataWithQuery(null);

            UIForm uiForm = uiPageSelector.getAncestorOfType(UIForm.class);
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.