Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.UserPortalConfig


        SiteKey siteKey = SiteKey.portal(requestSiteName);
        String uri = requestPath;

        // Resolve the user node if node path is indicated
        if (!requestPath.equals("")) {
            UserPortalConfig cfg = userPortalService.getUserPortalConfig(requestSiteName, request.getRemoteUser(),
                    userPortalContext);
            if (cfg != null) {
                UserPortal userPortal = cfg.getUserPortal();
                UserNodeFilterConfig.Builder builder = UserNodeFilterConfig.builder().withAuthMode(
                        UserNodeFilterConfig.AUTH_READ);
                UserNode userNode = userPortal.resolvePath(builder.build(), requestPath);

                if (userNode != null) {
View Full Code Here


            if (PortalConfig.PORTAL_TYPE.equals(ownerType)) {
                String[] accessPermissions = {};
                String editPermission = "";
                String portalIdSelected = uiForm.portalIdSelectBox.getValue();
                UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
                UserPortalConfig userConfig = service.getUserPortalConfig(portalIdSelected, Util.getPortalRequestContext()
                        .getRemoteUser());
                if (userConfig != null) {
                    PortalConfig config = userConfig.getPortalConfig();
                    accessPermissions = config.getAccessPermissions();
                    editPermission = config.getEditPermission();
                    uiForm.findFirstComponentOfType(UIListPermissionSelector.class).setValue(accessPermissions);
                    uiForm.findFirstComponentOfType(UIPermissionSelector.class).setValue(editPermission);
                }
View Full Code Here

        }
        return url;
    }

    public UserPortal getUserPortal() {
        UserPortalConfig upc = getUserPortalConfig();
        if (upc != null) {
            return upc.getUserPortal();
        } else {
            return null;
        }
    }
View Full Code Here

    public SiteKey getSiteKey() {
        return siteKey;
    }

    public String getPortalOwner() {
        UserPortalConfig userPortalConfig = getUserPortalConfig();
        if (userPortalConfig != null) {
            return userPortalConfig.getPortalName();
        } else {
            return null;
        }
    }
View Full Code Here

            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
            /*
             * if (edittedNavigation == null) { uiApplication.addMessage(new
             * ApplicationMessage("UISiteManagement.msg.portal-not-exist", new String[]{portalName})); return; }
             *
             * UserACL userACL = uicomp.getApplicationComponent(UserACL.class); if
             * (!userACL.hasEditPermission(edittedNavigation)) { uiApplication.addMessage(new
             * ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));; return; }
             */

            UIPopupWindow popUp = uicomp.getChild(UIPopupWindow.class);
            UINavigationManagement naviManager = popUp.createUIComponent(UINavigationManagement.class, null, null, popUp);
            uicomp.naviManager = naviManager;

            naviManager.setSiteKey(SiteKey.portal(portalName));

            UserPortal userPortal = userPortalConfig.getUserPortal();
            UserNavigation edittedNavigation = userPortal.getNavigation(SiteKey.portal(portalName));

            UINavigationNodeSelector selector = naviManager.getChild(UINavigationNodeSelector.class);
            selector.setScope(uicomp.getScope());
            selector.setEdittedNavigation(edittedNavigation);
View Full Code Here

            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) {
                prContext.getUIApplication().addMessage(
                        new ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore", null,
                                ApplicationMessage.ERROR));
                return;
View Full Code Here

         UIPortalApplication uiApp = Util.getUIPortalApplication();

         UIPortal uiPortal = uiApp.getShowedUIPortal();

         UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
         UserPortalConfig userConfig =
            service.getUserPortalConfig(uiPortal.getName(), event.getRequestContext().getRemoteUser());
         if (userConfig == null)
            userConfig = uiApp.getUserPortalConfig();
        
         //Todo nguyenanhkien2a@gmail.com
View Full Code Here

            return;
         }
        
         if(PortalConfig.PORTAL_TYPE.equals(navigation.getOwnerType()))
         {
            UserPortalConfig portalConfig = portalConfigService.getUserPortalConfig(navigation.getOwnerId(), prContext.getRemoteUser());
            if(portalConfig != null)
            {
               dataService.save(navigation);
            }
            else
View Full Code Here

         //Temporary solution for concurrency-related issue. The StaleModelException should be
         //caught in the ApplicationLifecycle
         rebuildUIPortal(uiPortalApp, editPortal, dataStorage);
      }
      uiPortalApp.getUserPortalConfig().setPortal(portalConfig);
      UserPortalConfig userPortalConfig = configService.getUserPortalConfig(ownerUser, remoteUser);
      if (userPortalConfig != null)
      {
         editPortal.setModifiable(userPortalConfig.getPortalConfig().isModifiable());
      }
      else
      {
         editPortal.setModifiable(false);
      }
View Full Code Here

   }

   private void rebuildUIPortal(UIPortalApplication uiPortalApp, UIPortal uiPortal, DataStorage storage) throws Exception
   {
      PortalConfig portalConfig = storage.getPortalConfig(uiPortal.getOwnerType(), uiPortal.getOwner());
      UserPortalConfig userPortalConfig = uiPortalApp.getUserPortalConfig();
      userPortalConfig.setPortal(portalConfig);
      uiPortal.getChildren().clear();
      PortalDataMapper.toUIPortal(uiPortal, userPortalConfig);
     
      uiPortalApp.putCachedUIPortal(uiPortal);
     
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.UserPortalConfig

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.