Package org.exoplatform.webui.application

Examples of org.exoplatform.webui.application.WebuiRequestContext


                    return;
                }
            }

            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 },
View Full Code Here


        }
    }

    public static class SaveActionListener extends EventListener<UILanguageSelector> {
        public void execute(Event<UILanguageSelector> event) throws Exception {
            WebuiRequestContext rContext = event.getRequestContext();
            String language = event.getRequestContext().getRequestParameter("language");
            PortalRequestContext prqCtx = PortalRequestContext.getCurrentInstance();

            UIPortalApplication uiApp = Util.getUIPortalApplication();
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
View Full Code Here

            switchToEditMode(page);
        }
    }

    public void switchToEditMode(Page page) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();

        // 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();
View Full Code Here

            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPortletForm uiPortletForm = uiMaskWS.createUIComponent(UIPortletForm.class, null, null);

            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

            UIComponent opener = uiPopup.getParent();

            ActionResponse response = event.getRequestContext().getResponse();
            response.setEvent(new QName("NavigationChange"), null);

            WebuiRequestContext pcontext = event.getRequestContext();
            pcontext.addUIComponentToUpdateByAjax(opener);
        }
View Full Code Here

    public static class SelectPageActionListener extends EventListener<UIPageBrowser> {
        public void execute(Event<UIPageBrowser> event) throws Exception {
            UIPageBrowser uiPageBrowser = event.getSource();
            String id = event.getRequestContext().getRequestParameter(OBJECTID);
            WebuiRequestContext ctx = event.getRequestContext();
            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);
            if (uiForm != null) {
                ctx.addUIComponentToUpdateByAjax(uiForm.getParent());
            } else {
                ctx.addUIComponentToUpdateByAjax(uiPageSelector.getParent());
            }
            UIFormPopupWindow uiPopup = uiPageSelector.getChild(UIFormPopupWindow.class);
            uiPopup.setUIComponent(null);
            uiPopup.setShow(false);
        }
View Full Code Here

        virtualList.dataBind(source);
    }

    public static class AddNavigationActionListener extends EventListener<UIAddGroupNavigation> {
        public void execute(Event<UIAddGroupNavigation> event) throws Exception {
            WebuiRequestContext ctx = event.getRequestContext();
            UIAddGroupNavigation uicomp = event.getSource();

            // get navigation id
            String ownerId = event.getRequestContext().getRequestParameter(OBJECTID);
            ownerId = URLDecoder.decode(ownerId);

            UIPortalApplication uiPortalApp = Util.getUIPortal().getAncestorOfType(UIPortalApplication.class);

            // ensure this navigation does not exist
            NavigationService navigationService = uicomp.getApplicationComponent(NavigationService.class);
            NavigationContext navigation = navigationService.loadNavigation(SiteKey.group(ownerId));
            if (navigation != null && navigation.getState() != null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageNavigationForm.msg.existPageNavigation",
                        new String[] { ownerId }));
            } else {
                // Create portal config of the group when it does not exist
                DataStorage dataService = uicomp.getApplicationComponent(DataStorage.class);
                if (dataService.getPortalConfig("group", ownerId) == null) {
                    UserPortalConfigService configService = uicomp.getApplicationComponent(UserPortalConfigService.class);
                    configService.createGroupSite(ownerId);
                }

                // create navigation for group
                SiteKey key = SiteKey.group(ownerId);
                NavigationContext existing = navigationService.loadNavigation(key);
                if (existing == null) {
                    navigationService.saveNavigation(new NavigationContext(key, new NavigationState(0)));
                }
            }

            // Update group navigation list
            ctx.addUIComponentToUpdateByAjax(uicomp);

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

    public UIPageTemplateOptions(InitParams initParams) throws Exception {
        super("UIPageTemplateOptions", null, String.class);
        if (initParams == null)
            return;
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        Param param = initParams.getParam("PageLayout");
        categories_ = (List<SelectItemCategory<String>>) param.getFreshObject(context);
        selectedItemOption_ = getDefaultItemOption();
        List<SelectItemOption<String>> itemOptions = new ArrayList<SelectItemOption<String>>();
View Full Code Here

    private List<SelectItemOption<String>> OPTIONS = new ArrayList<SelectItemOption<String>>(2);

    private Query<Page> lastQuery_;

    public UIPageBrowser() throws Exception {
        WebuiRequestContext contextui = WebuiRequestContext.getCurrentInstance();
        ResourceBundle res = contextui.getApplicationResourceBundle();
        OPTIONS.add(new SelectItemOption<String>(res.getString("UIPageSearchForm.label.option.portal"), "portal"));
        OPTIONS.add(new SelectItemOption<String>(res.getString("UIPageSearchForm.label.option.group"), "group"));

        UIPageSearchForm uiSearchForm = addChild(UIPageSearchForm.class, null, null);
        uiSearchForm.setOptions(OPTIONS);
View Full Code Here

    public String getCssClassName() {
        return cssClassName;
    }

    public List<UserNode> getNavigations() throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
        List<UserNode> nodes = new ArrayList<UserNode>();
        if (context.getRemoteUser() != null) {
            UserNode currRootNode = getCurrentNavigation();
            if (currRootNode != null) {
                nodes.add(currRootNode);
            }
        } else {
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.application.WebuiRequestContext

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.