Package org.exoplatform.portal.config.model

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


     * @param ownerType the new owner type
     * @param ownerId the new owner id
     */
    private void updateOwnership(ModelObject object, String ownerType, String ownerId) {
        if (object instanceof Container) {
            Container container = (Container) object;
            if (container instanceof Page) {
                Page page = (Page) container;
                page.setOwnerType(ownerType);
                page.setOwnerId(ownerId);
            }
            for (ModelObject child : container.getChildren()) {
                updateOwnership(child, ownerType, ownerId);
            }
        } else if (object instanceof Application) {
            Application application = (Application) object;
            TransientApplicationState applicationState = (TransientApplicationState) application.getState();
View Full Code Here


            }
        }
    }

    public static Container copy(Container existing) {
        Container container = new Container();
        copyFields(existing, container);

        return container;
    }
View Full Code Here

                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);
                    // GTNPORTAL-3118: IBM JDK creates negative hashCodes and drag and drop webui logic expects abs values.
                    container.setId(String.valueOf(Math.abs(container.hashCode())));
                    uiContainer.setStorageId(container.getStorageId());
                    PortalDataMapper.toUIContainer(uiContainer, container);
                    String[] accessPers = uiContainer.getAccessPermissions();
                    for (String accessPer : accessPers) {
                        if (accessPer.equals(""))
                            accessPer = null;
View Full Code Here

    private void initWorkspaces() throws Exception {
        UIWorkingWorkspace uiWorkingWorkspace = 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();

        uiWorkingWorkspace.addChild(UIEditInlineWorkspace.class, null, UI_EDITTING_WS_ID).setRendered(false);
        if (container != null) {
            org.exoplatform.portal.webui.container.UIContainer uiContainer = createUIComponent(
                    org.exoplatform.portal.webui.container.UIContainer.class, null, null);
            uiContainer.setStorageId(container.getStorageId());
            PortalDataMapper.toUIContainer(uiContainer, container);
            uiContainer.setRendered(true);
            uiViewWS.setUIComponent(uiContainer);
        }
        addChild(UIMaskWorkspace.class, UIPortalApplication.UI_MASK_WS_ID, null);
View Full Code Here

        // Need to insert the corresponding user site if needed
        PortalConfig cfg = storage_.getPortalConfig(PortalConfig.USER_TYPE, userName);
        if (cfg == null) {
            cfg = new PortalConfig(PortalConfig.USER_TYPE);
            cfg.setPortalLayout(new Container());
            cfg.setName(userName);
            storage_.create(cfg);
        }

        // Create a blank navigation if needed
View Full Code Here

        // Need to insert the corresponding group site
        PortalConfig cfg = storage_.getPortalConfig(PortalConfig.GROUP_TYPE, groupId);
        if (cfg == null) {
            cfg = new PortalConfig(PortalConfig.GROUP_TYPE);
            cfg.setPortalLayout(new Container());
            cfg.setName(groupId);
            storage_.create(cfg);
        }
    }
View Full Code Here

     * @param ownerType the new owner type
     * @param ownerId the new owner id
     */
    private void updateOwnership(ModelObject object, String ownerType, String ownerId) {
        if (object instanceof Container) {
            Container container = (Container) object;
            if (container instanceof Page) {
                Page page = (Page) container;
                page.setOwnerType(ownerType);
                page.setOwnerId(ownerId);
            }
            for (ModelObject child : container.getChildren()) {
                updateOwnership(child, ownerType, ownerId);
            }
        } else if (object instanceof Application) {
            Application application = (Application) object;
            TransientApplicationState applicationState = (TransientApplicationState) application.getState();
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

        }

        // portal redirects
        redirectXmlHandler.write(writer, portalConfig.getPortalRedirects());

        Container container = portalConfig.getPortalLayout();
        if (container != null) {
            writer.writeStartElement(Element.PORTAL_LAYOUT);

            marshalPermissions(writer, Element.MOVE_APPLICATIONS_PERMISSIONS, container.getMoveAppsPermissions());
            marshalPermissions(writer, Element.MOVE_CONTAINERS_PERMISSIONS, container.getMoveContainersPermissions());

            List<ModelObject> children = container.getChildren();
            if (children != null && !children.isEmpty()) {
                for (ModelObject child : children) {
                    marshalModelObject(writer, child);
                }
            }
View Full Code Here

    }

    private PortalConfig unmarshalPortalConfig(StaxNavigator<Element> navigator) throws XMLStreamException {
        PortalConfig portalConfig = new PortalConfig();

        Container portalLayout = null;
        Element current = navigator.child();
        while (current != null) {
            switch (current) {
                case PORTAL_NAME:
                    portalConfig.setName(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case LOCALE:
                    portalConfig.setLocale(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case LABEL:
                    portalConfig.setLabel(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case DESCRIPTION:
                    portalConfig.setDescription(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case SKIN:
                    portalConfig.setSkin(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case PROPERTIES:
                    Properties properties = new Properties();
                    if (navigator.navigate(Axis.CHILD, Element.PROPERTIES_ENTRY)) {
                        for (StaxNavigator<Element> fork : navigator.fork(Element.PROPERTIES_ENTRY)) {
                            String key = getRequiredAttribute(fork, Attribute.PROPERTIES_KEY.getLocalName());
                            String value = getRequiredContent(fork, false);
                            properties.put(key, value);
                        }
                    } else {
                        throw expectedElement(navigator, Element.PROPERTIES_ENTRY);
                    }
                    portalConfig.setProperties(properties);
                    current = navigator.next();
                    break;
                case ACCESS_PERMISSIONS:
                    portalConfig.setAccessPermissions(unmarshalAccessPermissions(navigator, false));
                    current = navigator.sibling();
                    break;
                case EDIT_PERMISSION:
                    portalConfig.setEditPermission(unmarshalEditPermission(navigator));
                    current = navigator.sibling();
                    break;
                case PORTAL_REDIRECTS:
                    portalConfig.setPortalRedirects((ArrayList<PortalRedirect>) redirectXmlHandler.read(navigator.fork()));
                    current = navigator.sibling();
                    break;
                case PORTAL_LAYOUT:
                    portalLayout = new Container();
                    current = navigator.child();
                    break;
                case MOVE_APPLICATIONS_PERMISSIONS:
                    if (portalLayout == null) {
                        throw expectedElement(navigator, Element.PORTAL_LAYOUT);
                    }
                    portalLayout.setMoveAppsPermissions(unmarshalPermissions(navigator, false));
                    current = navigator.sibling();
                    break;
                case MOVE_CONTAINERS_PERMISSIONS:
                    if (portalLayout == null) {
                        throw expectedElement(navigator, Element.PORTAL_LAYOUT);
                    }
                    portalLayout.setMoveContainersPermissions(unmarshalPermissions(navigator, false));
                    current = navigator.sibling();
                    break;
                case PAGE_BODY:
                    if (portalLayout == null) {
                        throw expectedElement(navigator, Element.PORTAL_LAYOUT);
                    }
                    portalLayout.getChildren().add(new PageBody());
                    current = navigator.sibling();
                    break;
                case PORTLET_APPLICATION:
                    if (portalLayout == null) {
                        throw expectedElement(navigator, Element.PORTAL_LAYOUT);
                    }
                    portalLayout.getChildren().add(unmarshalPortletApplication(navigator.fork()));
                    current = navigator.sibling();
                    break;
                case GADGET_APPLICATION:
                    if (portalLayout == null) {
                        throw expectedElement(navigator, Element.PORTAL_LAYOUT);
                    }
                    portalLayout.getChildren().add(unmarshalGadgetApplication(navigator.fork()));
                    current = navigator.sibling();
                    break;
                case CONTAINER:
                    if (portalLayout == null) {
                        throw expectedElement(navigator, Element.PORTAL_LAYOUT);
                    }
                    portalLayout.getChildren().add(unmarshalContainer(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.