Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.UserPortalConfigService


         }

         // Create group when it does not exist
         if (dataService.getPortalConfig("group", ownerId) == null)
         {
            UserPortalConfigService configService = uicomp.getApplicationComponent(UserPortalConfigService.class);
            configService.createGroupSite(ownerId);
         }

         // create navigation for group
         dataService.create(pageNav);
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
         //Check editing permission
View Full Code Here

      {
         PortalRequestContext prContext = Util.getPortalRequestContext();
         UINavigationManagement uiManagement = event.getSource();
         UINavigationNodeSelector uiNodeSelector = uiManagement.getChild(UINavigationNodeSelector.class);
         DataStorage dataService = uiManagement.getApplicationComponent(DataStorage.class);
         UserPortalConfigService portalConfigService = uiManagement.getApplicationComponent(UserPortalConfigService.class);
        
         PageNavigation navigation = uiNodeSelector.getEdittedNavigation();
         String editedOwnerType = navigation.getOwnerType();
         String editedOwnerId = navigation.getOwnerId();
         // Check existed
         PageNavigation persistNavigation =  dataService.getPageNavigation(editedOwnerType, editedOwnerId);
         if (persistNavigation == null)
         {
            UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore", null));
            UIPopupWindow uiPopup = uiManagement.getParent();
            uiPopup.setShow(false);
            UIPortalApplication uiPortalApp = (UIPortalApplication)prContext.getUIApplication();
            UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
            prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
            prContext.setFullRender(true);
            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

      UIPortal uiPortal = Util.getUIPortal();
      String remoteUser = prContext.getRemoteUser();
      String ownerUser = prContext.getPortalOwner();

      PortalConfig portalConfig = (PortalConfig)PortalDataMapper.buildModelObject(editPortal);
      UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
      DataStorage dataStorage = getApplicationComponent(DataStorage.class);

      if (!isPortalExist(editPortal))
      {
         return;
      }
     
      SkinService skinService = getApplicationComponent(SkinService.class);
      skinService.invalidatePortalSkinCache(editPortal.getName(), editPortal.getSkin());
      try
      {
         dataStorage.save(portalConfig);
      }
      catch (StaleModelException ex)
      {
         //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
View Full Code Here

      else
      {
         portalOwner = Util.getPortalRequestContext().getPortalOwner();
      }

      UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);

      return configService.getUserPortalConfig(portalOwner, remoteUser) != null;
   }
View Full Code Here

   }

   private List<PageNavigation> getExistedNavigation(String portalName, String ownerType) throws Exception
   {
      PortalRequestContext prContext = Util.getPortalRequestContext();
      UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
      UserPortalConfig config = configService.getUserPortalConfig(portalName, prContext.getRemoteUser());
      List<PageNavigation> navis = config.getNavigations();
      if (ownerType != null)
      {
         Iterator<PageNavigation> itr = navis.iterator();
         while (itr.hasNext())
View Full Code Here

  
   private boolean isPageExist() throws Exception
   {
      WebuiRequestContext context = Util.getPortalRequestContext();
      ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
      UserPortalConfigService userPortalConfigService =
         (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
      Page page = null;
      PageNode pageNode = Util.getUIPortal().getSelectedNode();
      if (pageNode != null)
      {
         try
         {
            if (pageNode.getPageReference() != null)
            {
               page = userPortalConfigService.getPage(pageNode.getPageReference(), context.getRemoteUser());
            }
         }
         catch (NoSuchDataException nsde)
         {
            return false;
View Full Code Here

         UITree uitree = uiPortalNodeSelector.getChild(UITree.class);
         UIRightClickPopupMenu popup = uitree.getUIRightClickPopupMenu();
         popup.setActions(new String[]{"AddNode", "EditPageNode", "EditSelectedNode", "CopyNode", "CutNode",
            "CloneNode", "DeleteNode", "MoveUp", "MoveDown"});

         UserPortalConfigService service = uiPopupMenu.getApplicationComponent(UserPortalConfigService.class);
         if (targetNode == null)
         {
            newNode.setUri(newNode.getName());
            targetNav.addNode(newNode);
            if (selectedNode.isCloneNode())
View Full Code Here

         {
            if (nav != null && nav.getNodes().size() > 0)
            {
               WebuiRequestContext context = Util.getPortalRequestContext();
               ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
               UserPortalConfigService userPortalConfigService = (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
              
               for (PageNode pageNode : nav.getNodes())
               {
                  Page page = userPortalConfigService.getPage(pageNode.getPageReference(), context.getRemoteUser());
                  if (page != null)
                  {
                     defaultNode = pageNode;
                     break;
                  }
View Full Code Here

      public void execute(Event<UIPageBrowser> event) throws Exception
      {
         UIPageBrowser uiPageBrowser = event.getSource();
         PortalRequestContext pcontext = Util.getPortalRequestContext();
         String id = pcontext.getRequestParameter(OBJECTID);
         UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
         DataStorage dataService = uiPageBrowser.getApplicationComponent(DataStorage.class);

         UIPortalApplication uiPortalApp = (UIPortalApplication)pcontext.getUIApplication();
         if (service.getPage(id) == null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[]{id}, 1));
            pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
            return;
         }
         Page page = service.getPage(id, pcontext.getRemoteUser());
         if (page == null || !page.isModifiable())
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[]{id}, 1));
            pcontext.addUIComponentToUpdateByAjax(uiPortalApp.getUIPopupMessages());
            return;
View Full Code Here

TOP

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

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.