Examples of PageNavigation


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

            @Override
            protected void doCompleted(PageNavigation result) {
                if (getResults().isEmpty()) {
                    super.doCompleted(result);
                } else {
                    PageNavigation navigation = getResults().get(0);
                    merge(navigation, result);
                }
            }
        };
View Full Code Here

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

        DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(
                DescriptionService.class);
        NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);

        PageNavigation pageNavigation = NavigationUtils.loadPageNavigation(new NavigationKey(siteKey, navUri),
                navigationService, descriptionService);
        if (pageNavigation == null)
            throw new ResourceNotFoundException("Navigation node not found for navigation uri '" + navUri + "'");

        resultHandler.completed(pageNavigation);
View Full Code Here

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

        if (obj == null) {
            return;
        }

        //
        PageNavigation navigation = obj.getObject();

        //
        ImportMode importMode = getRightMode(config.getImportMode());

        //
View Full Code Here

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

    private <T> UnmarshalledObject<T> fromXML(String ownerType, String owner, String xml, Class<T> clazz) throws Exception {
        UnmarshalledObject<T> obj = ModelUnmarshaller.unmarshall(clazz, xml.getBytes("UTF-8"));
        T o = obj.getObject();
        if (o instanceof PageNavigation) {
            PageNavigation nav = (PageNavigation) o;
            nav.setOwnerType(ownerType);
            nav.setOwnerId(owner);
            if (nav.getPriority() < 1) {
                nav.setPriority(PageNavigation.UNDEFINED_PRIORITY);
            }
            fixOwnerName((PageNavigation) o);
        } else if (o instanceof PortalConfig) {
            PortalConfig portalConfig = (PortalConfig) o;
            portalConfig.setType(ownerType);
View Full Code Here

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

                    mopImport.pageTask = new PageImportTask(pages, siteKey, dataStorage, pageService, siteProvider);
                } else if (file.equals(NavigationExportTask.FILE)) {
                    // Unmarshal navigation data
                    Marshaller<PageNavigation> marshaller = operationContext.getBindingProvider().getMarshaller(
                            PageNavigation.class, ContentType.XML);
                    PageNavigation navigation = marshaller.unmarshal(zis);
                    navigation.setOwnerType(siteKey.getTypeName());
                    navigation.setOwnerId(siteKey.getName());

                    // Add import task to run later
                    mopImport.navigationTask = new NavigationImportTask(navigation, siteKey, navigationService,
                            descriptionService, dataStorage);
                }
View Full Code Here

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

            @Override
            protected void doCompleted(PageNavigation result) {
                if (getResults().isEmpty()) {
                    super.doCompleted(result);
                } else {
                    PageNavigation navigation = getResults().get(0);
                    merge(navigation, result);
                }
            }
        };
View Full Code Here

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

        DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(
                DescriptionService.class);
        NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);

        PageNavigation pageNavigation = NavigationUtils.loadPageNavigation(new NavigationKey(siteKey, navUri),
                navigationService, descriptionService);
        if (pageNavigation == null)
            throw new ResourceNotFoundException("Navigation node not found for navigation uri '" + navUri + "'");

        resultHandler.completed(pageNavigation);
View Full Code Here

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

        }
    }

    public static PageNavigation createPageNavigation(DescriptionService service, NavigationContext navigation,
            NodeContext<NodeContext<?>> node) {
        PageNavigation pageNavigation = new PageNavigation();
        pageNavigation.setPriority(navigation.getState().getPriority());
        pageNavigation.setOwnerType(navigation.getKey().getTypeName());
        pageNavigation.setOwnerId(navigation.getKey().getName());

        ArrayList<PageNode> children = new ArrayList<PageNode>(node.getNodeCount());
        for (NodeContext<?> child : node.getNodes()) {
            @SuppressWarnings("unchecked")
            NodeContext<NodeContext<?>> childNode = (NodeContext<NodeContext<?>>) child;
            children.add(createPageNode(service, childNode));
        }

        NavigationFragment fragment = new NavigationFragment();
        fragment.setNodes(children);
        pageNavigation.addFragment(fragment);

        return pageNavigation;
    }
View Full Code Here

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

        return pageNavigation;
    }

    private static PageNavigation createFragmentedPageNavigation(DescriptionService service, NavigationContext navigation,
            NodeContext<NodeContext<?>> node) {
        PageNavigation pageNavigation = new PageNavigation();
        pageNavigation.setPriority(navigation.getState().getPriority());
        pageNavigation.setOwnerType(navigation.getKey().getTypeName());
        pageNavigation.setOwnerId(navigation.getKey().getName());

        ArrayList<PageNode> children = new ArrayList<PageNode>(1);
        children.add(createPageNode(service, node));

        NavigationFragment fragment = new NavigationFragment();
        StringBuilder parentUri = new StringBuilder("");
        getPath(node.getParent(), parentUri);
        fragment.setParentURI(parentUri.toString());
        fragment.setNodes(children);

        pageNavigation.addFragment(fragment);

        return pageNavigation;
    }
View Full Code Here

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

        writer.writeEndElement(); // End of node
    }

    private PageNavigation unmarshalNavigation(StaxNavigator<Element> navigator) throws StaxNavException {
        PageNavigation navigation = new PageNavigation();

        if (navigator.getName() == Element.NODE_NAVIGATION) {
            Element next = navigator.child();
            if (next == Element.PRIORITY) {
                Integer priority = parseContent(navigator, ValueType.INTEGER, PageNavigation.UNDEFINED_PRIORITY);
                navigation.setPriority(priority < 1 ? PageNavigation.UNDEFINED_PRIORITY : priority);
            } else if (next == Element.PAGE_NODES) {
                unmarshalPageNode(navigation, navigator, next);
                return navigation;
            }
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.