Examples of UIContainer


Examples of org.exoplatform.webui.core.UIContainer

                    appRegService.save(category, newApp);
                }
            }
            selector.clearSelectedCategories();

            UIContainer appInfo = selector.getParent();
            appInfo.getChild(UICategorySelector.class).setRendered(false);
            UIApplicationRegistryPortlet uiPortlet = appInfo.getAncestorOfType(UIApplicationRegistryPortlet.class);
            UIApplicationOrganizer uiOrganizer = uiPortlet.getChild(UIApplicationOrganizer.class);
            UIGadgetManagement uiGadgetManagement = uiPortlet.getChild(UIGadgetManagement.class);

            uiOrganizer.reload();
            if (uiGadgetManagement != null) {
View Full Code Here

Examples of org.exoplatform.webui.core.UIContainer

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

Examples of org.exoplatform.webui.core.UIContainer

      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

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

Examples of org.gatein.mop.api.workspace.ui.UIContainer

      Attributes testPageAttrs = testPage.getAttributes();
      assertEquals("test_factory_id", testPageAttrs.getString("factory-id"));
      assertEquals(true, (boolean)testPageAttrs.getBoolean("show-max-window"));

      //
      UIContainer c = testPage.getRootComponent();
      assertNotNull(c);
      assertEquals(2, c.getComponents().size());
      Iterator<? extends UIComponent> it = c.getComponents().iterator();

      //
      UIContainer container1 = (UIContainer)it.next();
      assertTrue(container1.isAdapted(ProtectedResource.class));
      ProtectedResource container1PR = container1.adapt(ProtectedResource.class);
      assertEquals(Collections.singletonList("container_1_access_permissions"), container1PR.getAccessPermissions());
      Described container1Described = container1.adapt(Described.class);
      assertEquals("container_1_title", container1Described.getName());
      assertEquals("container_1_description", container1Described.getDescription());
      Attributes container1Attrs = container1.getAttributes();
      assertEquals("container_1", container1Attrs.getString("name"));
      assertEquals("container_1_icon", container1Attrs.getString("icon"));
      assertEquals("container_1_template", container1Attrs.getString("template"));
      assertEquals("container_1_factory_id", container1Attrs.getString("factory-id"));
      assertEquals("container_1_width", container1Attrs.getString("width"));
View Full Code Here

Examples of org.gatein.mop.api.workspace.ui.UIContainer

      Attributes attrs = src.getAttributes();

      //
      Templatized templarized = src.getRootNavigation().getTemplatized();
      org.gatein.mop.api.workspace.Page template = templarized.getTemplate();
      UIContainer srcLayout = template.getRootComponent();

      //
      Map<String, String> properties = new HashMap<String, String>();
      load(attrs, properties, portalPropertiesBlackList);
View Full Code Here

Examples of org.gatein.mop.api.workspace.ui.UIContainer

         template = templates.addChild("default");
      }

      //
      ContainerData srcContainer = src.getPortalLayout();
      UIContainer dstContainer = template.getRootComponent();

      // Workaround to have the real source container used as the model / UI layer lose this
      // ID which lead to bugs
      ContainerData realSrcContainer = new ContainerData(
         dstContainer.getObjectId(),
         srcContainer.getId(),
         srcContainer.getName(),
         srcContainer.getIcon(),
         srcContainer.getTemplate(),
         srcContainer.getFactoryId(),
View Full Code Here

Examples of org.gatein.mop.api.workspace.ui.UIContainer

         // Obtain a model object from the ui component
         ComponentData mo;
         if (component instanceof UIContainer)
         {
            UIContainer srcContainer = (UIContainer)component;
            Attributes attrs = srcContainer.getAttributes();
            String type = attrs.getValue(MappedAttributes.TYPE);
            if ("dashboard".equals(type))
            {
               Site owner = src.getPage().getSite();
               TransientApplicationState<Portlet> state = new TransientApplicationState<Portlet>(
                  "dashboard/DashboardPortlet",
                  null,
                  getOwnerType(owner.getObjectType()),
                  owner.getName(),
                  null
               );

               //
               boolean showInfoBar = attrs.getValue(MappedAttributes.SHOW_INFO_BAR, false);
               boolean showMode = attrs.getValue(MappedAttributes.SHOW_MODE, false);
               boolean showWindowState = attrs.getValue(MappedAttributes.SHOW_WINDOW_STATE, false);
               String theme = attrs.getValue(MappedAttributes.THEME, null);

               //
               List<String> a = Collections.singletonList(UserACL.EVERYONE);
               if (srcContainer.isAdapted(ProtectedResource.class)) {
                  ProtectedResource pr = srcContainer.adapt(ProtectedResource.class);
                  a = pr.getAccessPermissions();
               }

               //
               mo = new ApplicationData<Portlet>(
                  srcContainer.getObjectId(),
                  component.getName(),
                  ApplicationType.PORTLET,
                  state,
                  null,
                  null,
View Full Code Here

Examples of org.gatein.mop.api.workspace.ui.UIContainer

      Attributes attrs = dst.getAttributes();
      attrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
      attrs.setValue(MappedAttributes.SHOW_MAX_WINDOW, src.isShowMaxWindow());

      //
      UIContainer rootContainer = dst.getRootComponent();

      // We are creating a new Page with the root container id as this one is lost
      // in the model / ui layer. Not doing this cause a class cast exception later
      // so it's likely the best fix we can do at the moment
      PageData src2 = new PageData(
         rootContainer.getObjectId(),
         src.getId(),
         src.getName(),
         src.getIcon(),
         src.getTemplate(),
         src.getFactoryId(),
View Full Code Here

Examples of org.gatein.mop.api.workspace.ui.UIContainer

               if ("dashboard/DashboardPortlet".equals(contentId))
               {
                  DashboardData data;
                  if (app.getStorageId() != null)
                  {
                     UIContainer dstDashboard = session.findObjectById(ObjectType.CONTAINER, app.getStorageId());
                     data = loadDashboard(dstDashboard);

                     // Update those attributes as we have to do it now, they don't exist in a container
                     // but do exist in a dashboard container
                     Attributes attrs = dstDashboard.getAttributes();
                     attrs.setValue(MappedAttributes.SHOW_INFO_BAR, app.isShowInfoBar());
                     attrs.setValue(MappedAttributes.SHOW_MODE, app.isShowApplicationMode());
                     attrs.setValue(MappedAttributes.SHOW_WINDOW_STATE, app.isShowApplicationState());
                     attrs.setValue(MappedAttributes.THEME, app.getTheme());
                  }
                  else
                  {
                     data = DashboardData.INITIAL_DASHBOARD;
                  }

                  //
                  data = new DashboardData(
                     data.getStorageId(),
                     data.getId(),
                     data.getName(),
                     data.getIcon(),
                     data.getTemplate(),
                     data.getFactoryId(),
                     data.getTitle(),
                     data.getDescription(),
                     data.getWidth(),
                     data.getHeight(),
                     app.getAccessPermissions(),
                     data.getChildren()
                  );

                  //
                  srcChild = data;
               }
            }
         }

         //
         UIComponent dstChild;
         if (srcChildId != null)
         {
            dstChild = session.findObjectById(ObjectType.COMPONENT, srcChildId);
            if (dstChild == null)
            {
               throw new StaleModelException("Could not find supposed present child with id " + srcChildId);
            }

            // julien : this can fail due to a bug in chromattic not implementing equals method properly
            // and is replaced with the foreach below
            /*
                    if (!dst.contains(dstChild)) {
                      throw new IllegalArgumentException("Attempt for updating a ui component " + session.pathOf(dstChild) +
                        "that is not present in the target ui container " + session.pathOf(dst));
                    }
            */
            boolean found = false;
            for (UIComponent child : dst.getComponents())
            {
               if (child.getObjectId().equals(srcChildId))
               {
                  found = true;
                  break;
               }
            }

            //
            if (!found)
            {
               if (hierarchyRelationships.containsKey(srcChildId))
               {
                  String srcId = hierarchyRelationships.get(srcChildId);

                  // It's a move operation, so we move the node first
                  dst.getComponents().add(dstChild);

                  //
                  changes.add(new ModelChange.Move(srcId, dst.getObjectId(), srcChildId));
               }
               else
               {
                     throw new IllegalArgumentException("Attempt for updating a ui component " + session.pathOf(dstChild)
                     + " that is not present in the target ui container " + session.pathOf(dst));
               }
            }

            //
            changes.add(new ModelChange.Update(srcChild));
         }
         else
         {
            String name = srcChild.getStorageName();
            if (name == null)
            {
               // We manufacture one name
               name = UUID.randomUUID().toString();
            }
            if (srcChild instanceof ContainerData)
            {
               dstChild = dst.add(ObjectType.CONTAINER, name);
            }
            else if (srcChild instanceof ApplicationData)
            {
               dstChild = dst.add(ObjectType.WINDOW, name);
            }
            else if (srcChild instanceof BodyData)
            {
               dstChild = dst.add(ObjectType.BODY, name);
            }
            else
            {
               throw new StaleModelException("Was not expecting child " + srcChild);
            }
            changes.add(new ModelChange.Create(dst.getObjectId(), srcChild));
         }

         //
         save(srcChild, dstChild, changes, hierarchyRelationships);

         //
         String dstChildId = dstChild.getObjectId();
         modelObjectMap.put(dstChildId, srcChild);
         orders.add(dstChildId);
      }

      // Take care of move operation that could be seen as a remove otherwise
      for (UIComponent dstChild : dst.getComponents())
      {
         String dstChildId = dstChild.getObjectId();
         if (!modelObjectMap.containsKey(dstChildId))
         {
            String parentId = hierarchyRelationships.get(dstChildId);
            if (parentId != null)
            {
               // Get the new parent
               UIContainer parent = session.findObjectById(ObjectType.CONTAINER, parentId);

               // Perform the move
               parent.getComponents().add(dstChild);

               //
               changes.add(new ModelChange.Move(dst.getObjectId(), parentId, dstChildId));

               // julien : we do not need to create an update operation
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.