Package org.exoplatform.webui.core

Examples of org.exoplatform.webui.core.UIContainer


         String permission = event.getRequestContext().getRequestParameter(OBJECTID);
         UIListPermissionSelector uiPermissions = event.getSource();
         UIPageIterator pageIterator = uiPermissions.getChild(UIFormGrid.class).getUIPageIterator();
         int currentPage = pageIterator.getCurrentPage();
         uiPermissions.removePermission(permission);
         UIContainer uiParent = uiPermissions.getParent();
         uiParent.setRenderedChild(UIListPermissionSelector.class);
         UIForm uiForm = uiPermissions.getAncestorOfType(UIForm.class);
         uiForm.broadcast(event, event.getExecutionPhase());
         while (currentPage > pageIterator.getAvailablePage())
         {
            currentPage--;
View Full Code Here


    * Remove an UIComponent from server side and
    * adding removing behaviors in javascript to clients if necessary
    */
   private static void removeUIComponent(UIComponent uiComponent, PortalRequestContext pcontext, boolean isUpdate)
   {
      UIContainer uiParent = uiComponent.getParent();
      uiParent.getChildren().remove(uiComponent);
     
      JavascriptManager jsManager = pcontext.getJavascriptManager();
      if(isUpdate) {
         pcontext.addUIComponentToUpdateByAjax(uiParent);
      } else {
View Full Code Here

  
   static public class ViewChildActionListener extends EventListener<UIContainer>
   {
      public void execute(Event<UIContainer> event) throws Exception
      {
         UIContainer uiContainer = event.getSource();
         String id = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
         uiContainer.setRenderedChild(id);
      }
View Full Code Here

             * Indeed, a TabContainer is nested into a normal container so
             * we should remove the its parent instead of itself when we delete the last tab
             */
            if (uiParent.getChildren().size() == 1)
            {
               UIContainer uiTabParent = uiParent.getParent();
               if(uiTabParent.getChildren().size() > 1)
               {
                  uiComponentTobeRemoved = uiParent;
               }
               else
               {
View Full Code Here

         uiNodeSelector.selectPageNodeByUri(uri);

         UINavigationManagement nodeManager = uiNodeSelector.getParent();
         event.getRequestContext().addUIComponentToUpdateByAjax(nodeManager);

         UIContainer uiParent = uiNodeSelector.getParent();
         Class<?>[] childrenToRender = {UINavigationNodeSelector.class};
         uiParent.setRenderedChildrenOfTypes(childrenToRender);
      }
View Full Code Here

         }

         String sourceId = pcontext.getRequestParameter("srcID");
         UIComponent uiSource = uiWorking.findComponentById(sourceId);

         UIContainer uiTarget = uiWorking.findComponentById(pcontext.getRequestParameter("targetID"));
         if (position < 0 && uiTarget.getChildren().size() > 0)
         {
            position = uiTarget.getChildren().size();
         }
         else if (position < 0)
         {
            position = 0;
         }

         if (uiSource == null)
         {
            UITabPane subTabPane = portalComposer.getChild(UITabPane.class);
            UIContainerList uiContainerConfig = subTabPane.getChild(UIContainerList.class);
            if (uiContainerConfig != null && subTabPane.getSelectedTabId().equals(uiContainerConfig.getId()))
            {
               org.exoplatform.portal.webui.container.UIContainer uiContainer =
                  uiTarget.createUIComponent(org.exoplatform.portal.webui.container.UIContainer.class, null, null);
               Container container = uiContainerConfig.getContainer(sourceId);
               container.setId(String.valueOf(container.hashCode()));
               uiContainer.setStorageId(container.getStorageId());
               PortalDataMapper.toUIContainer(uiContainer, container);
               String[] accessPers = uiContainer.getAccessPermissions();
               for (String accessPer : accessPers)
               {
                  if (accessPer.equals(""))
                     accessPer = null;
               }
               if (accessPers == null || accessPers.length == 0)
                  accessPers = new String[]{UserACL.EVERYONE};
               uiContainer.setAccessPermissions(accessPers);
               uiSource = uiContainer;
            }
            else
            {
               Application app = null;
               UIApplicationList appList = uiApp.findFirstComponentOfType(UIApplicationList.class);
               app = appList.getApplication(sourceId);
               ApplicationType applicationType = app.getType();

               //
               UIPortlet uiPortlet = uiTarget.createUIComponent(UIPortlet.class, null, null);
               if (app.getDisplayName() != null)
               {
                  uiPortlet.setTitle(app.getDisplayName());
               }
               else if (app.getApplicationName() != null)
               {
                  uiPortlet.setTitle(app.getApplicationName());
               }
               uiPortlet.setDescription(app.getDescription());
               List<String> accessPersList = app.getAccessPermissions();
               String[] accessPers = accessPersList.toArray(new String[accessPersList.size()]);
               for (String accessPer : accessPers)
               {
                  if (accessPer.equals(""))
                     accessPers = null;
               }
               if (accessPers == null || accessPers.length == 0)
                  accessPers = new String[]{UserACL.EVERYONE};
               uiPortlet.setAccessPermissions(accessPers);
               UIPage uiPage = uiTarget.getAncestorOfType(UIPage.class);

               // Hardcode on state to fix error while drag/drop Dashboard
               if ("dashboard/DashboardPortlet".equals(app.getContentId()))
               {
                  TransientApplicationState state = new TransientApplicationState<Object>(app.getContentId());
                  uiPortlet.setState(new PortletState(state, applicationType));
               }
               else
               {
                  ApplicationState state;
                  // if we have a new portlet added to the page we need for it to have its own state.
                  // otherwise all new portlets added to a page will have the same state.
                  if (newComponent)
                  {
                     state = new TransientApplicationState<Object>(app.getContentId());
                  }
                  // if the portlet is not new, then we should clone it from the original portlet
                  else
                  {
                     state = new CloneApplicationState<Object>(app.getStorageId());
                  }
                  uiPortlet.setState(new PortletState(state, applicationType));
               }
               uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
               uiPortlet.setShowEditControl(true);
               uiSource = uiPortlet;
            }
            List<UIComponent> children = uiTarget.getChildren();
            uiSource.setParent(uiTarget);
            children.add(position, uiSource);
            return;
         }

         org.exoplatform.portal.webui.container.UIContainer uiParent = uiSource.getParent();
         if (uiParent == uiTarget)
         {
            int currentIdx = uiTarget.getChildren().indexOf(uiSource);
            if (position <= currentIdx)
            {
               uiTarget.getChildren().add(position, uiSource);
               currentIdx++;
               uiTarget.getChildren().remove(currentIdx);
               return;
            }
            uiTarget.getChildren().remove(currentIdx);
            if (position >= uiTarget.getChildren().size())
            {
               position = uiTarget.getChildren().size();
            }
            uiTarget.getChildren().add(position, uiSource);
            return;
         }
        
         uiTarget.getChildren().add(position, uiSource);
         uiSource.setParent(uiTarget);

         if (UITabContainer.TAB_CONTAINER.equals(uiParent.getFactoryId()))
         {
            if (uiParent.getChildren().size() == 1)
            {
               UIContainer uiTabParent = uiParent.getParent();
               if (uiTabParent.getChildren().size() > 1)
               {
                  removeUIComponent(uiParent, pcontext, false);
               }
               else
               {
View Full Code Here

         uiToolPanel.setShowMaskLayer(true);
         UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
         pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
         pcontext.setFullRender(true);

         UIContainer uiParent = uiPageNodeSelector.getParent();
         PageNode node = null;
         if (uiPageNodeSelector.getSelectedNode() == null)
         {
            node = Util.getUIPortal().getSelectedNode();
         }
         else
         {
            node = uiPageNodeSelector.getSelectedNode().getNode();
         }
         if (node == null)
         {
            uiPageNodeSelector.selectNavigation(uiPageNodeSelector.getSelectedNavigation());
            uiToolPanel.setUIComponent(null);
            return;
         }

         UserPortalConfigService configService = uiParent.getApplicationComponent(UserPortalConfigService.class);
         Page page = null;
         if (node.getPageReference() != null)
         {
            page = configService.getPage(node.getPageReference(), event.getRequestContext().getRemoteUser());
         }
View Full Code Here

   static public class CancelActionListener extends EventListener<UICategorySelector>
   {
      public void execute(Event<UICategorySelector> event) throws Exception
      {
         UICategorySelector selector = event.getSource();
         UIContainer appInfo = selector.getParent();
         appInfo.getChild(UICategorySelector.class).setRendered(false);
         event.getRequestContext().addUIComponentToUpdateByAjax(appInfo);
      }
View Full Code Here

               Application newApp = cloneApplication(selector.getApplication());
               UIApplicationRegistryPortlet.setPermissionToEveryone(newApp);
               appRegService.save(category, newApp);
            }
         }
         UIContainer appInfo = selector.getParent();
         appInfo.getChild(UICategorySelector.class).setRendered(false);
         UIApplicationRegistryPortlet uiPortlet = appInfo.getAncestorOfType(UIApplicationRegistryPortlet.class);
         UIApplicationOrganizer uiOrganizer = uiPortlet.getChild(UIApplicationOrganizer.class);
         uiOrganizer.reload();
         event.getRequestContext().addUIComponentToUpdateByAjax(appInfo);
      }
View Full Code Here

        if (updateComponents == null)
            return null;
        List<UIPortlet> uiportlets = new ArrayList<UIPortlet>();
        for (UIComponent uicomponent : updateComponents) {
            if (uicomponent instanceof UIContainer) {
                UIContainer uiContainer = (UIContainer) uicomponent;
                uiContainer.findComponentOfType(uiportlets, UIPortlet.class);
            }
            if (uicomponent instanceof UIComponentDecorator) {
                UIComponentDecorator uiDecorator = (UIComponentDecorator) uicomponent;
                if (uiDecorator.getUIComponent() instanceof UIContainer) {
                    UIContainer uiContainer = (UIContainer) uiDecorator.getUIComponent();
                    uiContainer.findComponentOfType(uiportlets, UIPortlet.class);
                }
            }
        }
        List<SkinConfig> skins = new ArrayList<SkinConfig>();
        SkinService skinService = getApplicationComponent(SkinService.class);
View Full Code Here

TOP

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

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.