Package org.exoplatform.portal.config.model

Examples of org.exoplatform.portal.config.model.Container


            mgr.clearCache();

            PortalConfig cfg = storage_.getPortalConfig(PortalConfig.USER_TYPE, "overwritelayout");
            assertNotNull(cfg);

            Container container = cfg.getPortalLayout();
            assertNotNull(container);
            assertEquals(2, container.getChildren().size());
            assertTrue(container.getChildren().get(0) instanceof PageBody);
            assertTrue(((Application)container.getChildren().get(1)).getType() == ApplicationType.PORTLET);
            Application<Portlet> pa = (Application<Portlet>)container.getChildren().get(1);
            ApplicationState<Portlet> state = pa.getState();
            assertEquals("overwrite_application_ref/overwrite_portlet_ref", storage_.getId(state));
         }
      }.execute(null);
   }
View Full Code Here


            userHandler.createUser(user, true);

            //
            PortalConfig cfg = storage_.getPortalConfig(PortalConfig.USER_TYPE, "julien");
            assertNotNull(cfg);
            Container container = cfg.getPortalLayout();
            assertNotNull(container);
            assertEquals(2, container.getChildren().size());
            assertTrue(container.getChildren().get(0) instanceof PageBody);
            assertTrue(((Application)container.getChildren().get(1)).getType() == ApplicationType.PORTLET);
            Application<Portlet> pa = (Application<Portlet>)container.getChildren().get(1);
            ApplicationState state = pa.getState();
            assertEquals("foo/bar", storage_.getId(pa.getState()));
         }
      }.execute(null);
   }
View Full Code Here

            groupHandler.addChild(null, group, true);

            //
            PortalConfig cfg = storage_.getPortalConfig(PortalConfig.GROUP_TYPE, "/" + groupName);
            assertNotNull(cfg);
            Container container = cfg.getPortalLayout();
            assertNotNull(container);
            assertEquals(4, container.getChildren().size());
            assertTrue(container.getChildren().get(2) instanceof PageBody);
            assertTrue(((Application)container.getChildren().get(1)).getType() == ApplicationType.PORTLET);
           
            groupHandler.removeGroup(group, true);
         }
      }.execute(null);
   }
View Full Code Here

      //
      List<ModelObject> children = page.getChildren();
      assertEquals(2, children.size());

      //
      Container container1 = (Container)children.get(0);
      assertEquals("container_1", container1.getName());
      assertEquals("container_1_title", container1.getTitle());
      assertEquals("container_1_icon", container1.getIcon());
      assertEquals("container_1_template", container1.getTemplate());
      assertTrue(Arrays.equals(new String[]{"container_1_access_permissions"}, container1.getAccessPermissions()));
      assertEquals("container_1_factory_id", container1.getFactoryId());
      assertEquals("container_1_description", container1.getDescription());
      assertEquals("container_1_width", container1.getWidth());
      assertEquals("container_1_height", container1.getHeight());

      //
      Application application1 = (Application)children.get(1);
      assertEquals("application_1_theme", application1.getTheme());
      assertEquals("application_1_title", application1.getTitle());
View Full Code Here

            DataStorage storage = uiPortalApp.getApplicationComponent(DataStorage.class);
            if (storage == null) {
                return null;
            }
            PortalConfig portalConfig = storage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
            Container layout = portalConfig.getPortalLayout();
            if (layout != null) {
                userPortalConfig.setPortalConfig(portalConfig);
            }
            UIPortal uiPortal = uiPortalApp.createUIComponent(UIPortal.class, null, null);
View Full Code Here

        model.setModifiable(uiPortlet.isModifiable());
        return model;
    }

    private static Container toContainer(UIContainer uiContainer) {
        Container model = new Container(uiContainer.getStorageId());
        toContainer(model, uiContainer);
        return model;
    }
View Full Code Here

        model.setSkin(uiPortal.getSkin());
        model.setModifiable(uiPortal.isModifiable());
        model.setProperties(uiPortal.getProperties());
        model.setPortalRedirects(uiPortal.getPortalRedirects());

        model.setPortalLayout(new Container());

        List<UIComponent> children = uiPortal.getChildren();
        if (children == null)
            return model;
        ArrayList<ModelObject> newChildren = new ArrayList<ModelObject>();
View Full Code Here

                }
                toUIPortlet(uiPortlet, application);
                uiComponent = uiPortlet;
            }
        } else if (model instanceof Container) {
            Container container = (Container) model;
            UIContainer uiTempContainer;
            if (UITabContainer.TAB_CONTAINER.equals(container.getFactoryId())) {
                uiTempContainer = uiContainer.createUIComponent(context, UITabContainer.class, null, null);
            } else if (UIColumnContainer.COLUMN_CONTAINER.equals(container.getFactoryId())) {
                uiTempContainer = uiContainer.createUIComponent(context, UIColumnContainer.class, null, null);
            } else {
                uiTempContainer = uiContainer.createUIComponent(context, UIContainer.class, null, null);
            }
View Full Code Here

        String out = IOUtil.getStreamContentAsString(confManager_.getInputStream(path));
        ByteArrayInputStream is = new ByteArrayInputStream(out.getBytes("UTF-8"));
        IBindingFactory bfact = BindingDirectory.getFactory(Container.class);
        UnmarshallingContext uctx = (UnmarshallingContext) bfact.createUnmarshallingContext();
        uctx.setDocument(is, null, "UTF-8", false);
        Container container = (Container) uctx.unmarshalElement();
        generateStorageName(container);
        return container;
    }
View Full Code Here

        writer.writeEndElement(); // End of container element
    }

    protected Container unmarshalContainer(StaxNavigator<Element> navigator) throws XMLStreamException {
        Container container = new Container();
        container.setId(navigator.getAttribute(Attribute.ID.getLocalName()));
        container.setTemplate(navigator.getAttribute(Attribute.TEMPLATE.getLocalName()));
        container.setWidth(navigator.getAttribute(Attribute.WIDTH.getLocalName()));
        container.setHeight(navigator.getAttribute(Attribute.HEIGHT.getLocalName()));

        Element current = navigator.child();
        while (current != null) {
            switch (current) {
                case NAME:
                    container.setName(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case TITLE:
                    container.setTitle(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case ICON:
                    container.setIcon(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case DESCRIPTION:
                    container.setDescription(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case ACCESS_PERMISSIONS:
                    container.setAccessPermissions(unmarshalAccessPermissions(navigator, false));
                    current = navigator.sibling();
                    break;
                case FACTORY_ID:
                    container.setFactoryId(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case CONTAINER:
                    if (container.getChildren() == null) {
                        container.setChildren(new ArrayList<ModelObject>());
                    }
                    container.getChildren().add(unmarshalContainer(navigator.fork()));
                    current = navigator.sibling();
                    break;
                case PORTLET_APPLICATION:
                    if (container.getChildren() == null) {
                        container.setChildren(new ArrayList<ModelObject>());
                    }
                    container.getChildren().add(unmarshalPortletApplication(navigator.fork()));
                    current = navigator.sibling();
                    break;
                case GADGET_APPLICATION:
                    if (container.getChildren() == null) {
                        container.setChildren(new ArrayList<ModelObject>());
                    }
                    container.getChildren().add(unmarshalGadgetApplication(navigator.fork()));
                    current = navigator.sibling();
                    break;
                case UNKNOWN:
                    throw unknownElement(navigator);
                default:
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.model.Container

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.