Package org.exoplatform.webui.core

Examples of org.exoplatform.webui.core.UIApplication


        protected void handleError(NavigationError error, UINavigationNodeSelector selector) throws Exception {
            selector.initTreeData();
            selector.getUserNodeLabels().clear();
            if (selector.getRootNode() != null) {
                WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
                UIApplication uiApp = context.getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UINavigationNodeSelector.msg." + error.name(), null,
                        ApplicationMessage.ERROR));
            }
        }
View Full Code Here


            WebuiRequestContext ctx = event.getRequestContext();
            UIApplicationOrganizer uiOrganizer = event.getSource();
            ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
            ApplicationCategory existingCate = service.getApplicationCategory(categoryName);
            if (existingCate == null) {
                UIApplication uiApp = ctx.getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIOrganizer.msg.categoryNoExist", null));
                uiOrganizer.reload();
                return;
            }
            uiOrganizer.setSelectedCategory(categoryName);
            ctx.addUIComponentToUpdateByAjax(uiOrganizer);
View Full Code Here

    public abstract static class BaseEditAction extends EventListener<UIGroupNavigationManagement> {
        public void execute(Event<UIGroupNavigationManagement> event) throws Exception {
            UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
            UIGroupNavigationManagement uicomp = event.getSource();
            WebuiRequestContext context = event.getRequestContext();
            UIApplication uiApplication = context.getUIApplication();

            // get navigation id
            String groupName = event.getRequestContext().getRequestParameter(OBJECTID);
            SiteKey siteKey = SiteKey.group(groupName);

            // check edit permission, ensure that user has edit permission on that
            // navigation
            UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermissionOnNavigation(siteKey)) {
                uiApplication
                        .addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.Invalid-editPermission", null));
                return;
            }

            UserNavigation navigation = userPortal.getNavigation(siteKey);
            if (navigation == null) {
                uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.navigation-not-exist", null));
                UIWorkingWorkspace uiWorkingWS = Util.getUIPortalApplication().getChild(UIWorkingWorkspace.class);
                uiWorkingWS.updatePortletsByName("UserToolbarGroupPortlet");
                return;
            }
View Full Code Here

            UIAddApplicationForm uiForm = event.getSource();
            String type = uiForm.getUIFormSelectBox(UIAddApplicationForm.FIELD_TYPE).getValue();
            uiForm.setApplicationList(type);
            uiForm.getChild(UIFormTableIteratorInputSet.class).setRendered(true);
            if (uiForm.getApplications().size() == 0) {
                UIApplication uiApp = event.getRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIAddApplicationForm.msg.typeNoApps", null));
                uiForm.getChild(UIFormTableIteratorInputSet.class).setRendered(false);
            }
            event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
        }
View Full Code Here

            WebuiRequestContext ctx = event.getRequestContext();
            ApplicationRegistryService appRegService = uiForm.getApplicationComponent(ApplicationRegistryService.class);
            ApplicationCategory selectedCate = uiOrganizer.getSelectedCategory();
            if (appRegService.getApplicationCategory(selectedCate.getName()) == null) {
                uiOrganizer.reload();
                UIApplication uiApp = ctx.getUIApplication();
                uiApp.addMessage(new ApplicationMessage("category.msg.changeNotExist", null));
                ctx.addUIComponentToUpdateByAjax(uiOrganizer);
                return;
            }

            if (uiForm.getApplications().size() == 0) {
View Full Code Here

        public void execute(Event<UISiteManagement> event) throws Exception {
            UISiteManagement uicomp = event.getSource();
            String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
            WebuiRequestContext context = event.getRequestContext();
            UIApplication uiApplication = context.getUIApplication();

            // Minh Hoang TO: User could edit navigation if he/she has edit permissions on PortalConfig. That is not
            // at all logical and should be modified after release 3.1 GA
            UserPortalConfigService configService = uicomp.getApplicationComponent(UserPortalConfigService.class);
            UserPortalConfig userPortalConfig = configService.getUserPortalConfig(portalName, context.getRemoteUser(),
                    PortalRequestContext.USER_PORTAL_CONTEXT);
            if (userPortalConfig == null) {
                uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
                        new String[] { portalName }));
                UIWorkingWorkspace uiWorkingWS = Util.getUIPortalApplication().getChildById(
                        UIPortalApplication.UI_WORKING_WS_ID);
                uiWorkingWS.updatePortletsByName("UserToolbarSitePortlet");
                return;
            }

            UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(userPortalConfig.getPortalConfig())) {
                uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));
                return;
            }

            // Minh Hoang TO: For release 3.1, Edit Permission check would be rollback to former checks on PortalConfig
            /*
 
View Full Code Here

            }
            UIGadgetEditor uiEditor = uiManagement.getChild(UIGadgetEditor.class);
            if (uiEditor != null) {
                Source source = uiEditor.getSource();
                if (source != null && name.equals(uiEditor.getSourceName())) {
                    UIApplication uiApp = ctx.getUIApplication();
                    uiApp.addMessage(new ApplicationMessage("UIGadgetManagement.msg.deleteGadgetInUse", null));
                    return;
                }
            }
            service.removeGadget(name);
            WebAppController webController = uiManagement.getApplicationComponent(WebAppController.class);
View Full Code Here

        application_.setAccessPermissions(pers);
        ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
        application_.setModifiedDate(Calendar.getInstance().getTime());
        WebuiRequestContext ctx = WebuiRequestContext.getCurrentInstance();
        if (service.getApplication(application_.getId()) == null) {
            UIApplication uiApp = ctx.getUIApplication();
            uiApp.addMessage(new ApplicationMessage("application.msg.changeNotExist", null));
            return;
        }
        service.update(application_);
        Application selectedApplication = getApplication();
        UIApplicationOrganizer uiApplicationOrganizer = getAncestorOfType(UIApplicationOrganizer.class);
View Full Code Here

            WebuiRequestContext ctx = event.getRequestContext();
            UIGadgetManagement uiManagement = uiInfo.getParent();
            Gadget gadget = uiInfo.getGadget();
            GadgetRegistryService service = uiInfo.getApplicationComponent(GadgetRegistryService.class);
            if (service.getGadget(gadget.getName()) == null) {
                UIApplication uiApp = ctx.getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIGadgetInfo.msg.gadgetNotExist", null));
                uiManagement.reload();
                return;
            }
            service.saveGadget(GadgetUtil.toGadget(gadget.getName(), gadget.getUrl(), gadget.isLocal()));
            uiManagement.initData();
View Full Code Here

            Gadget gadget = uiInfo.getGadget();

            UIGadgetManagement uiManagement = uiInfo.getParent();
            GadgetRegistryService service = uiInfo.getApplicationComponent(GadgetRegistryService.class);
            if (service.getGadget(gadget.getName()) == null) {
                UIApplication uiApp = event.getRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIGadgetInfo.msg.gadgetNotExist", null));
                uiManagement.reload();
                return;
            }
            SourceStorage sourceStorage = uiManagement.getApplicationComponent(SourceStorage.class);
            UIGadgetEditor uiEditor = uiManagement.createUIComponent(UIGadgetEditor.class, null, null);
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.core.UIApplication

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.