Package org.exoplatform.portal.webui.workspace

Examples of org.exoplatform.portal.webui.workspace.UIMaskWorkspace


                uiPortlet.setCurrentPortletMode(PortletMode.VIEW);
            }
            UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
            PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
            // add by Pham Dinh Tan
            UIMaskWorkspace uiMaskWorkspace = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            uiMaskWorkspace.broadcast(event, Phase.DECODE);
            pcontext.ignoreAJAXUpdateOnPortlets(true);
        }
View Full Code Here


                uiPortal = Util.getUIPortal();
                portalOwner = Util.getPortalRequestContext().getPortalOwner();
            }

            UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPortalForm portalForm = uiMaskWS.createUIComponent(UIPortalForm.class, null, "UIPortalForm");
            portalForm.setPortalOwner(portalOwner);
            portalForm.setBindingBean();
            if (SiteType.USER.equals(uiPortal.getSiteType())) {
                portalForm.removeChildById("PermissionSetting");
            }
            uiMaskWS.setWindowSize(700, -1);
            event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
        }
View Full Code Here

    public static class SaveActionListener extends EventListener<UIPageForm> {
        public void execute(Event<UIPageForm> event) throws Exception {
            UIPageForm uiPageForm = event.getSource();
            UIPortalApplication uiPortalApp = uiPageForm.getAncestorOfType(UIPortalApplication.class);
            PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
            UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPage uiPage = uiPageForm.getUIPage();
            if (uiPage == null)
                return;

            Page page = new Page();
            uiPageForm.invokeSetBindingBean(page);
            uiPage.setAccessPermissions(page.getAccessPermissions());
            uiPage.setEditPermission(page.getEditPermission());
            uiPage.setTitle(page.getTitle());
            uiPage.setShowMaxWindow(page.isShowMaxWindow());

            uiMaskWS.createEvent("Close", Phase.DECODE, pcontext).broadcast();
            pcontext.getJavascriptManager().require("SHARED/portalComposer", "portalComposer")
                    .addScripts("portalComposer.toggleSaveButton();");
        }
View Full Code Here

            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 user = orgService.getUserHandler().findUserByName(uiForm.getUserName(), UserStatus.ANY);
                if (user == null) {
                    uiApp.addMessage(new ApplicationMessage("UIForgetPassword.msg.user-not-exist", null));
                    return;
                } else if (!user.isEnabled()) {
                    uiApp.addMessage(new ApplicationMessage("UIForgetPassword.msg.user-is-disabled", null));
                    return;
                } else {
                    try {
                        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));
                    } catch (Exception e) {
                        uiApp.addMessage(new ApplicationMessage("UIResetPassword.msg.change-password-fail", null, ApplicationMessage.ERROR));
                    }
                }
View Full Code Here

    public static class AccountSettingsActionListener extends EventListener<UIPortal> {
        public void execute(Event<UIPortal> event) throws Exception {
            UIPortal uiPortal = event.getSource();
            UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);

            // Modified by nguyenanhkien2a@gmail.com
            // We should check account for existing
            String username = Util.getPortalRequestContext().getRemoteUser();
            OrganizationService service = uiPortal.getApplicationComponent(OrganizationService.class);
            User useraccount = service.getUserHandler().findUserByName(username);

            if (useraccount != null) {
                UIAccountSetting uiAccountForm = uiMaskWS.createUIComponent(UIAccountSetting.class, null, null);
                uiMaskWS.setUIComponent(uiAccountForm);
                uiMaskWS.setShow(true);
                event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
            } else {
                // Show message detail to user and then logout if user press ok button
                JavascriptManager jsManager = Util.getPortalRequestContext().getJavascriptManager();
                jsManager.require("SHARED/base").addScripts(
View Full Code Here

    public static class SaveActionListener extends EventListener<UIPageForm> {
        public void execute(Event<UIPageForm> event) throws Exception {
            UIPageForm uiPageForm = event.getSource();
            UIPortalApplication uiPortalApp = uiPageForm.getAncestorOfType(UIPortalApplication.class);
            PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
            UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPage uiPage = uiPageForm.getUIPage();
            if (uiPage == null)
                return;

            Page page = new Page();
            uiPageForm.invokeSetBindingBean(page);
            uiPage.setAccessPermissions(page.getAccessPermissions());
            uiPage.setEditPermission(page.getEditPermission());
            if(uiPageForm.canChangeMovePermission(uiPage.getSiteKey())) {
                uiPage.setMoveAppsPermissions(page.getMoveAppsPermissions());
                uiPage.setMoveContainersPermissions(page.getMoveContainersPermissions());
            } else {
                /* set defaults if the page does not exist yet */
                UserPortalConfigService configService = uiPageForm.getApplicationComponent(UserPortalConfigService.class);
                PageKey pageKey = new PageKey(new SiteKey(page.getOwnerType(), page.getOwnerId()), page.getName());
                if (configService.getPageService().loadPage(pageKey) == null) {
                    configService.setDefaultPermissions(page);
                    uiPage.setMoveAppsPermissions(page.getMoveAppsPermissions());
                    uiPage.setMoveContainersPermissions(page.getMoveContainersPermissions());
                }
            }

            uiPage.setTitle(page.getTitle());
            uiPage.setShowMaxWindow(page.isShowMaxWindow());

            uiMaskWS.createEvent("Close", Phase.DECODE, pcontext).broadcast();
            pcontext.getJavascriptManager().require("SHARED/portalComposer", "portalComposer")
                    .addScripts("portalComposer.toggleSaveButton();");

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

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

            UIMaskWorkspace uiMaskWorkspace = uiForm.getParent();
            WebuiRequestContext rContext = event.getRequestContext();
            uiMaskWorkspace.createEvent("Close", Phase.DECODE, rContext).broadcast();
            if (!uiForm.getId().equals("CreatePortal") && uiPortalApp.getModeState() != UIPortalApplication.NORMAL_MODE) {
                rContext.getJavascriptManager().require("SHARED/portalComposer", "portalComposer")
                        .addScripts("portalComposer.toggleSaveButton();");
            }
        }
View Full Code Here

            pconfig = (PortalConfig) PortalDataMapper.buildModelObject(uiPortal);
            dataService.save(pconfig);

            UIPortalApplication uiPortalApp = event.getSource().getAncestorOfType(UIPortalApplication.class);
            UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            uiMaskWS.createEvent("Close", Phase.DECODE, pcontext).broadcast();

            UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChild(UIWorkingWorkspace.class);
            uiWorkingWS.updatePortletsByName("PortalNavigationPortlet");
            uiWorkingWS.updatePortletsByName("UserToolbarSitePortlet");
        }
View Full Code Here

        public void execute(Event<UISkinSelector> event) throws Exception {
            WebuiRequestContext rContext = event.getRequestContext();
            String skin = rContext.getRequestParameter("skin");
            UIPortal uiPortal = Util.getUIPortal();
            UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            uiMaskWS.createEvent("Close", Phase.DECODE, rContext).broadcast();
            // event.getRequestContext().addUIComponentToUpdateByAjax(uiApp) ;
            Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(false);
            if (skin == null || skin.trim().length() < 1)
                return;
            uiApp.setSkin(skin);
View Full Code Here

    public static class ShowLoginFormActionListener extends EventListener<UIPortalComponent> {
        public void execute(Event<UIPortalComponent> event) throws Exception {
            UIPortal uiPortal = Util.getUIPortal();
            UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UILogin uiLogin = uiMaskWS.createUIComponent(UILogin.class, null, null);
            uiMaskWS.setUIComponent(uiLogin);
            uiMaskWS.setWindowSize(630, -1);
            event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWS);
        }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.webui.workspace.UIMaskWorkspace

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.