Examples of XWikiPage


Examples of org.xwiki.xmlrpc.model.XWikiPage

    public void testRenderPageContent() throws XmlRpcException
    {
        String pageContent = "**Text in Bold**{{velocity}}VelocityCode{{/velocity}}";

        XWikiPage page = new XWikiPage();
        page.setId(TestConstants.TEST_PAGE);
        page.setContent(pageContent);
        page.setSyntaxId("xwiki/2.0");

        TestUtils.banner("TEST: renderPageContent");
        System.out.format("\nCalling renderPageContent with context as page %s\n", TestConstants.TEST_PAGE);
        System.out.format("\nWiki content is:\n%s\n", pageContent);

        rpc.storePage(page);

        try {
            String renderedContent =
                    rpc.renderPageContent(page.getId(), page.getContent(), page.getSyntaxId(), "annotatedxhtml/1.0");

            System.out.format("\nObtained rendered content:\n%s\n\n", renderedContent);

            Assert.assertTrue(renderedContent.contains("Text in Bold"));
            Assert.assertTrue(renderedContent.contains("startmacro"));
        } finally {
            rpc.removePage(page.getId());
        }
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

    public void testXWikiXmlRpcServiceWithoutLoginNoRights() throws MalformedURLException
    {
        XWikiXmlRpcClient rpc = new XWikiXmlRpcClient(TestConstants.ENDPOINT);

        try {
            XWikiPage page = rpc.getPage("Scheduler.WebHome");
            Assert.fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

        super.setUp();

        try {
            rpc.getPage(TestConstants.TEST_PAGE_WITH_COMMENTS);
        } catch (Exception e) {
            XWikiPage page = new XWikiPage();
            page.setId(TestConstants.TEST_PAGE_WITH_COMMENTS);
            page.setTitle("Test page");
            page.setContent("Test page");
            rpc.storePage(page);
        }
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

        super.setUp();

        try {
            rpc.getPage(TestConstants.TEST_PAGE_WITH_ATTACHMENTS);
        } catch (Exception e) {
            XWikiPage page = new XWikiPage();
            page.setId(TestConstants.TEST_PAGE_WITH_ATTACHMENTS);
            page.setTitle("Test page");
            page.setContent("Test page");
            rpc.storePage(page);
        }
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

            rpc.removePage(TestConstants.TEST_PAGE_WITH_OBJECTS);
        } catch (Exception e) {
            // Page doesn't exist.
        }

        XWikiPage page = new XWikiPage();
        page.setId(TestConstants.TEST_PAGE_WITH_OBJECTS);
        rpc.storePage(page);

        // Make sure the test page has at least one object.
        addTagObject(Arrays.asList("test", "XML", "RPC"));
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

        super.setUp();

        try {
            this.rpc.getPage(TestConstants.TEST_PAGE);
        } catch (Exception e) {
            XWikiPage page = new XWikiPage();
            page.setId(TestConstants.TEST_PAGE);
            page.setTitle("Test page");
            String content =
                String.format("Modified by org.xwiki.xmlrpc @ %s (This will be version: %d)\n", new Date(),
                    page.getVersion() + 1);
            page.setContent(content);
            this.rpc.storePage(page);
        }

        try {
            this.rpc.getPage(TestConstants.TEST_PAGE_WITH_TRANSLATIONS);
        } catch (Exception e) {
            XWikiPage page = new XWikiPage();
            page.setId(TestConstants.TEST_PAGE_WITH_TRANSLATIONS);
            page.setTitle("Test page");
            String content =
                String.format("Modified by org.xwiki.xmlrpc @ %s (This will be version: %d)\n", new Date(),
                    page.getVersion() + 1);
            page.setContent(content);
            this.rpc.storePage(page);
        }

        this.rpc.logout();
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

    public void testGetRenderedContent() throws XmlRpcException
    {
        String pageContent = "**Text in Bold**{{velocity}}VelocityCode{{/velocity}}";

        XWikiPage page = new XWikiPage();
        page.setId(TestConstants.TEST_PAGE);
        page.setContent(pageContent);
        page.setSyntaxId("xwiki/2.0");

        TestUtils.banner("TEST: getRenderedContent()");
        System.out.format("\nCalling getRenderedContent for page %s\n", page.getId());
        System.out.format("\nWiki content is:\n%s\n", pageContent);

        rpc.storePage(page);

        try {
            String renderedContent = rpc.getRenderedContent(page.getId(), "annotatedxhtml/1.0");

            System.out.format("\nObtained rendered content:\n%s\n\n", renderedContent);

            Assert.assertTrue(renderedContent.contains("Text in Bold"));
            Assert.assertTrue(renderedContent.contains("startmacro"));
        } finally {
            rpc.removePage(page.getId());
        }
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

    public void testRenderPageContent() throws XmlRpcException
    {
        String pageContent = "**Text in Bold**{{velocity}}VelocityCode{{/velocity}}";

        XWikiPage page = new XWikiPage();
        page.setId(TestConstants.TEST_PAGE);
        page.setContent(pageContent);
        page.setSyntaxId("xwiki/2.0");

        TestUtils.banner("TEST: renderPageContent");
        System.out.format("\nCalling renderPageContent with context as page %s\n", TestConstants.TEST_PAGE);
        System.out.format("\nWiki content is:\n%s\n", pageContent);

        rpc.storePage(page);

        try {
            String renderedContent =
                    rpc.renderPageContent(page.getId(), page.getContent(), page.getSyntaxId(), "annotatedxhtml/1.0");

            System.out.format("\nObtained rendered content:\n%s\n\n", renderedContent);

            Assert.assertTrue(renderedContent.contains("Text in Bold"));
            Assert.assertTrue(renderedContent.contains("startmacro"));
        } finally {
            rpc.removePage(page.getId());
        }
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

            rpc.removePage(TestConstants.TEST_PAGE_WITH_COMMENTS);
        } catch (XmlRpcException e) {
            // Page doesn't exist.
        }

        XWikiPage page = new XWikiPage();
        page.setId(TestConstants.TEST_PAGE_WITH_COMMENTS);
        rpc.storePage(page);

        // Make sure the test page has at least one comment.
        addComment("This is the first comment.");
    }
View Full Code Here

Examples of org.xwiki.xmlrpc.model.XWikiPage

            rpc.removePage(TestConstants.TEST_PAGE_WITH_ATTACHMENTS);
        } catch (XmlRpcException e) {
            // Page doesn't exist.
        }

        XWikiPage page = new XWikiPage();
        page.setId(TestConstants.TEST_PAGE_WITH_ATTACHMENTS);
        rpc.storePage(page);

        // Make sure the test page has at least one attachment.
        addAttachment("first.txt", "Content of first attachment.");
    }
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.