Examples of UserPortalConfigService


Examples of org.exoplatform.portal.config.UserPortalConfigService

    private void loadMakableGroupNavigations() throws Exception {
        if (groupIdSelectBox == null) {
            UIFormInputSet uiSettingSet = getChildById("PageSetting");
            PortalRequestContext pcontext = Util.getPortalRequestContext();
            UserPortalConfigService userPortalConfigService = getApplicationComponent(UserPortalConfigService.class);
            List<String> groups = userPortalConfigService.getMakableNavigations(pcontext.getRemoteUser(), true);
            if (groups.size() > 0) {
                Collections.sort(groups);
                List<SelectItemOption<String>> groupsItem = new ArrayList<SelectItemOption<String>>();
                for (String group : groups) {
                    groupsItem.add(new SelectItemOption<String>(group));
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

        List<SelectItemOption<String>> ownerTypes = new ArrayList<SelectItemOption<String>>();
        if (pConfig != null && acl.hasEditPermission(pConfig)) {
            ownerTypes.add(new SelectItemOption<String>(SiteType.PORTAL.getName()));
        }

        UserPortalConfigService userPortalConfigService = getApplicationComponent(UserPortalConfigService.class);
        List<String> groups = userPortalConfigService.getMakableNavigations(pcontext.getRemoteUser(), true);
        if (groups.size() > 0) {
            ownerTypes.add(new SelectItemOption<String>(SiteType.GROUP.getName()));
        }

        ownerTypes.add(new SelectItemOption<String>(SiteType.USER.getName()));
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

                handleError(ex.getError(), uiNodeSelector);
                return;
            }

            UIApplication uiApp = context.getUIApplication();
            UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
            String pageId = node.getPageRef();
            // Page page = (pageId != null) ? service.getPage(pageId) : null;
            PageContext page = (pageId != null) ? service.getPageService().loadPage(PageKey.parse(pageId)) : null;
            if (page != null) {
                UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
                if (!userACL.hasPermission(page)) {
                    uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.UserNotPermission", new String[] { pageId }, 1));
                    return;
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

            } catch (NavigationServiceException ex) {
                handleError(ex.getError(), uiNodeSelector);
                return;
            }

            UserPortalConfigService userService = uiNodeSelector.getApplicationComponent(UserPortalConfigService.class);

            // get selected page
            String pageId = node.getPageRef();
            PageContext pageContext = (pageId != null) ? userService.getPageService().loadPage(PageKey.parse(pageId)) : null;
            if (pageContext != null) {
                UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
                if (!userACL.hasEditPermission(pageContext)) {
                    uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.UserNotPermission", new String[] { pageId }, 1));
                    return;
                }

                uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
                // uiWorkingWS.setRenderedChild(UIPortalToolPanel.class);
                // uiWorkingWS.addChild(UIPortalComposer.class, "UIPageEditor",
                // null);

                UIWorkingWorkspace uiWorkingWS = uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
                UIPortalToolPanel uiToolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class).setRendered(true);
                uiWorkingWS.setRenderedChild(UIEditInlineWorkspace.class);

                UIPortalComposer portalComposer = uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class)
                        .setRendered(true);
                portalComposer.setShowControl(true);
                portalComposer.setEditted(false);
                portalComposer.setCollapse(false);
                portalComposer.setId("UIPageEditor");
                portalComposer.setComponentConfig(UIPortalComposer.class, "UIPageEditor");

                uiToolPanel.setShowMaskLayer(false);
                uiToolPanel.setWorkingComponent(UIPage.class, null);
                UIPage uiPage = (UIPage) uiToolPanel.getUIComponent();

                if (pageContext.getState().getDisplayName() == null)
                    pageContext.getState().builder().displayName(node.getLabel());

                Page page = userService.getDataStorage().getPage(pageId);
                pageContext.update(page);

                // convert Page to UIPage
                PortalDataMapper.toUIPage(uiPage, page);
                Util.getPortalRequestContext().addUIComponentToUpdateByAjax(uiWorkingWS);
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

    public static class DeletePortalActionListener extends EventListener<UISiteManagement> {
        public void execute(Event<UISiteManagement> event) throws Exception {
            UISiteManagement uicomp = event.getSource();
            String portalName = event.getRequestContext().getRequestParameter(OBJECTID);

            UserPortalConfigService service = uicomp.getApplicationComponent(UserPortalConfigService.class);
            String defaultPortalName = service.getDefaultPortal();

            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication uiPortalApp = Util.getUIPortalApplication();

            if (defaultPortalName.equals(portalName)) {
                uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.delete-default-portal",
                        new String[] { defaultPortalName }, ApplicationMessage.WARNING));
                return;
            }

            DataStorage dataStorage = uicomp.getApplicationComponent(DataStorage.class);
            UserACL acl = uicomp.getApplicationComponent(UserACL.class);

            PortalConfig pConfig = dataStorage.getPortalConfig(portalName);
            if (pConfig != null) {
                if (acl.hasPermission(pConfig)) {
                    service.removeUserPortalConfig(portalName);
                } else {
                    uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
                            new String[] { pConfig.getName() }));
                    return;
                }
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

    public static class EditPortalLayoutActionListener extends EventListener<UISiteManagement> {
        public void execute(Event<UISiteManagement> event) throws Exception {
            UISiteManagement uicomp = event.getSource();
            String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
            UserPortalConfigService service = uicomp.getApplicationComponent(UserPortalConfigService.class);
            DataStorage dataStorage = uicomp.getApplicationComponent(DataStorage.class);
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication portalApp = (UIPortalApplication) prContext.getUIApplication();
            UIWorkingWorkspace uiWorkingWS = portalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

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

Examples of org.exoplatform.portal.config.UserPortalConfigService

        builder.withTemporalCheck();
        toolbarFilterConfig = builder.build();
    }

    public List<String> getAllPortalNames() throws Exception {
        UserPortalConfigService dataStorage = getApplicationComponent(UserPortalConfigService.class);
        return dataStorage.getAllPortalNames();
    }
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

        public void execute(Event<UINavigationManagement> event) throws Exception {
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UINavigationManagement uiManagement = event.getSource();
            UINavigationNodeSelector uiNodeSelector = uiManagement.getChild(UINavigationNodeSelector.class);
            UserPortalConfigService portalConfigService = uiManagement.getApplicationComponent(UserPortalConfigService.class);

            UIPopupWindow uiPopup = uiManagement.getParent();
            uiPopup.createEvent("ClosePopup", Phase.PROCESS, event.getRequestContext()).broadcast();

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

            UserNavigation navigation = uiNodeSelector.getEdittedNavigation();
            SiteKey siteKey = navigation.getKey();
            String editedOwnerId = siteKey.getName();

            // Check existed
            UserPortalConfig userPortalConfig;
            if (SiteType.PORTAL.equals(siteKey.getType())) {
                userPortalConfig = portalConfigService.getUserPortalConfig(editedOwnerId, event.getRequestContext()
                        .getRemoteUser());
                if (userPortalConfig == null) {
                    prContext.getUIApplication().addMessage(
                            new ApplicationMessage("UIPortalForm.msg.notExistAnymore", null, ApplicationMessage.ERROR));
                    return;
                }
            } else {
                userPortalConfig = portalConfigService.getUserPortalConfig(prContext.getPortalOwner(), event
                        .getRequestContext().getRemoteUser());
            }

            UserNavigation persistNavigation = userPortalConfig.getUserPortal().getNavigation(siteKey);
            if (persistNavigation == null) {
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

   public void loadGroups() throws Exception
   {

      PortalRequestContext pContext = Util.getPortalRequestContext();
      UserPortalConfigService dataService = getApplicationComponent(UserPortalConfigService.class);
      UserACL userACL = getApplicationComponent(UserACL.class);
      OrganizationService orgService = getApplicationComponent(OrganizationService.class);
      List<String> listGroup = null;
      // get all group that user has permission
      if (userACL.isUserInGroup(userACL.getAdminGroups()) && !userACL.getSuperUser().equals(pContext.getRemoteUser()))
      {
         Collection<?> temp = (List)orgService.getGroupHandler().findGroupsOfUser(pContext.getRemoteUser());
         if (temp != null)
         {
            listGroup = new ArrayList<String>();
            for (Object group : temp)
            {
               Group m = (Group)group;
               String groupId = m.getId().trim();
               listGroup.add(groupId);
            }
         }
      }
      else
      {
         listGroup = dataService.getMakableNavigations(pContext.getRemoteUser(), false);
      }

      if (listGroup == null)
      {
         listGroup = new ArrayList<String>();
      }

      UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
      Set<String> groupIdsHavingNavigation = configService.findGroupHavingNavigation();
      listGroup.removeAll(groupIdsHavingNavigation);

      UIVirtualList virtualList = getChild(UIVirtualList.class);
      virtualList.dataBind(new ObjectPageList<String>(listGroup, listGroup.size()));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.