Package org.jbehave.core.io.rest.confluence.Confluence

Examples of org.jbehave.core.io.rest.confluence.Confluence.Page


        return createResourceMap(baseUrl, searchTerms[0], searchTerms[1], includePattern);
    }

    private Map<String, Resource> createResourceMap(String baseUrl, String spaceKey, String pageName, String pattern) {
        Map<String, Resource> result = new HashMap<String, Resource>();
        Page rootPage = confluence.loadRootPage(baseUrl, spaceKey, pageName);
        addPage(result, rootPage.getSelfReference(), pattern);
        return result;
    }
View Full Code Here


        addPage(result, rootPage.getSelfReference(), pattern);
        return result;
    }

    private void addPage(Map<String, Resource> result, String href, String pattern) {
        Page page = confluence.loadPage(href, true);
        Resource resource = new Resource(page.getSelfReference(), page.getTitle());
        resource.setContent(page.getBody());
        if (pattern == null ||
                (pattern != null && Pattern.matches(pattern, page.getTitle()))) {
            result.put(page.getTitle(), resource);
        }
        if (page.hasChildren()) {
            for (Page child : page.getChildren()) {
                addPage(result, child.getSelfReference(), pattern);
            }
        }
    }
View Full Code Here

    public LoadFromConfluence(RESTClient client) {
        this.confluence = new Confluence(client);
    }

    public String loadResourceAsText(String resourcePath) {
        Page page = confluence.loadPage(resourcePath, false);
        Document doc = Jsoup.parse(page.getBody());
        StringBuilder builder = new StringBuilder();
        addTitle(doc, builder);
        addPanels(doc, builder);
        addExamples(doc, builder);
        return builder.toString();
View Full Code Here

TOP

Related Classes of org.jbehave.core.io.rest.confluence.Confluence.Page

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.