Examples of UIPortal


Examples of org.exoplatform.portal.webui.portal.UIPortal

        if (uiPage != null) {
            return userACL.hasEditPermissionOnPage(uiPage.getSiteKey().getTypeName(), uiPage.getSiteKey().getName(),
                    uiPage.getEditPermission());
        } else {
            UIPortal currentUIPortal = portalApp.<UIWorkingWorkspace> findComponentById(UIPortalApplication.UI_WORKING_WS_ID)
                    .findFirstComponentOfType(UIPortal.class);
            UserNode currentNode = currentUIPortal.getSelectedUserNode();
            PageKey pageKey = currentNode.getPageRef();
            if (pageKey == null) {
                return false;
            } else {
                PageService pageService = portalApp.getApplicationComponent(PageService.class);
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

         event.getRequestContext().addUIComponentToUpdateByAjax(uiWorkingWS);
      }
     
      private boolean hasPageCreationPermission() throws Exception
      {
         UIPortal currentPortal = Util.getUIPortal();
         UserACL userACL = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
         PageNavigation selectedNavigation = currentPortal.getSelectedNavigation();
         if (PortalConfig.PORTAL_TYPE.equals(selectedNavigation.getOwnerType()))
         {
            return userACL.hasEditPermissionOnPortal(currentPortal.getOwnerType(), currentPortal.getOwner(), currentPortal.getEditPermission());
         }
        
         return userACL.hasEditPermission(selectedNavigation);
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

   {
      public void execute(Event<UIWorkingWorkspace> event) throws Exception
      {
         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
         UIPortalApplication portalApp = Util.getUIPortalApplication();
         UIPortal currentUIPortal = portalApp.<UIWorkingWorkspace>findComponentById(
            UIPortalApplication.UI_WORKING_WS_ID).findFirstComponentOfType(UIPortal.class);
         UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
         if(!userACL.hasEditPermissionOnPortal(currentUIPortal.getOwnerType(), currentUIPortal.getOwner(),
                                                currentUIPortal.getEditPermission()))
         {
            uiApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditLayout-Permission",
               new String[]{uiPortal.getName()}));
            return;
         }
        
         PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
         UIWorkingWorkspace uiWorkingWS = uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
         uiWorkingWS.setBackupUIPortal(uiPortal);
         uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);

         UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
         PortalDataMapper.toUIPortal(newPortal, userConfig);
         newPortal.setSelectedNode(uiPortal.getSelectedNode());
         newPortal.setSelectedNavigation(uiPortal.getSelectedNavigation());
         newPortal.setSelectedPath(uiPortal.getSelectedPath());
         newPortal.refreshUIPage();

         UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
         uiEditWS.setUIComponent(newPortal);
         UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
         siteBody.setUIComponent(null);
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

         // Need to relocalize as it was loaded from storage
         uiPortalApp.localizeNavigations();
        
         //Update UIPortal corredponding to edited navigation
         UIPortal targetedUIPortal = uiPortalApp.getCachedUIPortal(editedOwnerType, editedOwnerId);
         if(targetedUIPortal != null)
         {
            targetedUIPortal.setNavigation(navigation);
         }
        
         UIPopupWindow uiPopup = uiManagement.getParent();
         uiPopup.setShow(false);
         UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

      Set<Skin> skins = new HashSet<Skin>();

      // Determine portlets visible on the page
      List<UIPortlet> uiportlets = new ArrayList<UIPortlet>();
      UIWorkingWorkspace uiWorkingWS = getChildById(UI_WORKING_WS_ID);
      UIPortal uiPortal = uiWorkingWS.findFirstComponentOfType(UIPortal.class);
      uiPortal.findComponentOfType(uiportlets, UIPortlet.class);
      UIPortalToolPanel toolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
      if (toolPanel != null && toolPanel.isRendered())
      {
         toolPanel.findComponentOfType(uiportlets, UIPortlet.class);
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

         addChild(UIWorkingWorkspace.class, UIPortalApplication.UI_WORKING_WS_ID, null);
      UIComponentDecorator uiViewWS = uiWorkingWorkspace.addChild(UIComponentDecorator.class, null, UI_VIEWING_WS_ID);

      DataStorage dataStorage = getApplicationComponent(DataStorage.class);
      Container container = dataStorage.getSharedLayout();
      UIPortal uiPortal = createUIComponent(UIPortal.class, null, null);
      PortalDataMapper.toUIPortal(uiPortal, userPortalConfig_);
     
      this.putCachedUIPortal(uiPortal);
      this.showedUIPortal = uiPortal;
     
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

   static public class ChangePageNodeActionListener extends EventListener<UIPortal>
   {
      @Override
      public void execute(Event<UIPortal> event) throws Exception
      {
         UIPortal showedUIPortal = event.getSource();
         UIPortalApplication uiPortalApp = showedUIPortal.getAncestorOfType(UIPortalApplication.class);
        
         //This code snippet is to make sure that Javascript/Skin is fully loaded at the first request
         UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
         PortalRequestContext pcontext = Util.getPortalRequestContext();
         pcontext.setFullRender(true);
         pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
        
         PageNavigation currentNav = showedUIPortal.getSelectedNavigation();
         String currentUri = showedUIPortal.getSelectedNode().getUri();
         if(currentUri.startsWith("/"))
         {
            currentUri = currentUri.substring(1);
         }
        
         //This if branche is to make sure that the first time user logs in, showedUIPortal has selectedPaths
         //Otherwise, there will be NPE on BreadcumbsPortlet
         if(showedUIPortal.getSelectedPath() == null)
         {
            List<PageNode> currentSelectedPath = findPath(currentNav, currentUri.split("/"));
            showedUIPortal.setSelectedPath(currentSelectedPath);
         }
        
         String targetedUri = ((PageNodeEvent<UIPortal>)event).getTargetNodeUri();
         if(targetedUri.startsWith("/"))
         {
            targetedUri = targetedUri.substring(1);
         }
        
         PageNavigation targetedNav = getTargetedNav(uiPortalApp, targetedUri);
        
         if(targetedNav == null)
         {
            return;
         }
      
         String formerNavType = currentNav.getOwnerType();
         String formerNavId = currentNav.getOwnerId();
         String newNavType = targetedNav.getOwnerType();
         String newNavId = targetedNav.getOwnerId();
        
         String[] targetPath = targetedUri.split("/");
         PageNode targetPageNode = getTargetedNode(targetedNav, targetPath);
         List<PageNode> targetedPathNodes = findPath(targetedNav, targetPath);
        
         if(formerNavType.equals(newNavType) && formerNavId.equals(newNavId))
         {
            //Case 1: Both navigation type and id are not changed, but current page node is changed
            if(!currentUri.equals(targetedUri))
            {
               showedUIPortal.setSelectedNode(targetPageNode);
               showedUIPortal.setSelectedPath(targetedPathNodes);
            }
         }
         else
         {
            // Case 2: Either navigation type or id has been changed
            // First, we try to find a cached UIPortal
            uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
            uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
            showedUIPortal = uiPortalApp.getCachedUIPortal(newNavType, newNavId);
            if (showedUIPortal != null)
            {
               showedUIPortal.setSelectedNode(targetPageNode);
               showedUIPortal.setSelectedPath(targetedPathNodes);
               uiPortalApp.setShowedUIPortal(showedUIPortal);
              
               //Temporary solution to fix edit inline error while switching between navigations
               DataStorage storageService = uiPortalApp.getApplicationComponent(DataStorage.class);
               PortalConfig associatedPortalConfig = storageService.getPortalConfig(newNavType, newNavId);
               UserPortalConfig userPortalConfig = uiPortalApp.getUserPortalConfig();
              
               //Update layout-related data on UserPortalConfig
               userPortalConfig.setPortal(associatedPortalConfig);

               //Update selected navigation on UserPortalConfig, that is mandatory as at the moment the PortalConfig
               //does not hold any navigation data.
               userPortalConfig.updateSelectedNavigation(newNavType, newNavId);
            }
            else
            {
               showedUIPortal = buildUIPortal(targetedNav, uiPortalApp, uiPortalApp.getUserPortalConfig());
               if(showedUIPortal == null)
               {
                  return;
               }
               showedUIPortal.setSelectedNode(targetPageNode);
               showedUIPortal.setSelectedPath(targetedPathNodes);
               uiPortalApp.setShowedUIPortal(showedUIPortal);
               uiPortalApp.putCachedUIPortal(showedUIPortal);
            }
         }
         showedUIPortal.refreshUIPage();
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

         Container layout = portalConfig.getPortalLayout();
         if(layout != null)
         {
            userPortalConfig.setPortal(portalConfig);
         }
         UIPortal uiPortal = uiPortalApp.createUIComponent(UIPortal.class, null, null);
         //Reset selected navigation on userPortalConfig
         userPortalConfig.setSelectedNavigation(newPageNav);
         PortalDataMapper.toUIPortal(uiPortal, userPortalConfig);
         return uiPortal;
      }
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

      try
      {
       Map<String, String[]> paramMap = prcontext.getRequest().getParameterMap();
       if (paramMap.containsKey("removePP"))
       {
         UIPortal uiPortal = Util.getUIPortal();
         for (String publicParamName : paramMap.get("removePP"))
         {
           uiPortal.getPublicParameters().remove(publicParamName);
         }
       }
      
         RenderInvocation renderInvocation = uicomponent.create(RenderInvocation.class, prcontext);
View Full Code Here

Examples of org.exoplatform.portal.webui.portal.UIPortal

         //Minh Hoang TO: The cached UIPage objects corresponding to removed Page should be removed here.
         //As we have multiple UIPortal, which means multiple caches of UIPage. It 's unwise to garbage
         // all UIPage caches at once. Better solution is to clear UIPage on browsing to PageNode having Page
         //removed
        
         UIPortal uiPortal = Util.getUIPortal();
         if (uiPortal.getSelectedNode().getPageReference().equals(page.getPageId()))
         {
            PageNodeEvent<UIPortal> pnevent =
               new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uiPortal.getSelectedNode()
                  .getUri());
            uiPortal.broadcast(pnevent, Phase.PROCESS);
         }
         else
         {
            boolean dataAvailable = uiPageBrowser.feedDataWithQuery(uiPageBrowser.getLastQuery());
            if (!dataAvailable)
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.