Examples of WikiPage


Examples of org.apache.wiki.WikiPage

   
    public final int doWikiStartTag()
        throws IOException
    {
        WikiEngine engine = m_wikiContext.getEngine();
        WikiPage   page   = m_wikiContext.getPage();

        try
        {
            if( page != null )
            {
                long size = page.getSize();

                if( size == -1 && engine.pageExists(page) ) // should never happen with attachments
                {
                    size = engine.getPureText( page.getName(), page.getVersion() ).length();
                    page.setSize( size );
                }

                pageContext.getOut().write( Long.toString(size) );
            }
        }
View Full Code Here

Examples of org.apache.wiki.WikiPage

    {
        m_wikiContext = (WikiContext) pageContext.getAttribute( WikiTagBase.ATTR_CONTEXT,
                                                                PageContext.REQUEST_SCOPE );

        WikiEngine engine = m_wikiContext.getEngine();
        WikiPage   page;

        page = m_wikiContext.getPage();

        try
        {
            if( page != null && engine.pageExists(page) )
            {
                Collection versions = engine.getVersionHistory( page.getName() );

                if( versions == null )
                {
                    // There is no history
                    return SKIP_BODY;
View Full Code Here

Examples of org.apache.wiki.WikiPage

        WikiEngine engine = m_wikiContext.getEngine();
        String     pageName = m_pageName;

        if( m_pageName == null )
        {
            WikiPage p = m_wikiContext.getPage();

            if( p != null )
            {
                pageName = p.getName();
            }
            else
            {
                return SKIP_BODY;
            }
View Full Code Here

Examples of org.apache.wiki.WikiPage

    }

    public final int doWikiStartTag()
        throws IOException
    {
        WikiPage   page   = m_wikiContext.getPage();

        if( page != null )
        {
            if( m_type.equals("attachment") && page instanceof Attachment )
            {
                return EVAL_BODY_INCLUDE;
            }
           
            if( m_type.equals("page") && !(page instanceof Attachment) )
            {
                return EVAL_BODY_INCLUDE;
            }

            if( m_type.equals("weblogentry") && !(page instanceof Attachment) && page.getName().indexOf("_blogentry_") != -1 )
            {
                return EVAL_BODY_INCLUDE;
            }
        }
View Full Code Here

Examples of org.apache.wiki.WikiPage

        TestEngine.emptyWorkDir();
    }

    public void testShowCountsBasic() throws Exception
    {
        WikiPage page1 = testEngine.getPage( "TestPage01" );
        WikiContext context1 = new WikiContext( testEngine, page1 );
        WikiPage page2 = testEngine.getPage( "TestPage02" );
        WikiContext context2 = new WikiContext( testEngine, page2 );

        // generate counts:
        testEngine.getHTML( context1, page1 );
        testEngine.getHTML( context2, page2 );
        testEngine.getHTML( context2, page2 );

        // mind the double \n in the following string:
        String pageViewPageContent = "[{PageViewPlugin show='list''\n\n* {1} ({2} views)\n}]";
        testEngine.saveText( "PageViews", pageViewPageContent );

        WikiPage pageviews = testEngine.getPage( "PageViews" );
        WikiContext contextPV = new WikiContext( testEngine, pageviews );

        String result = testEngine.getHTML( contextPV, pageviews );
//        System.out.println( result );

View Full Code Here

Examples of org.apache.wiki.WikiPage

    public void testShowCountsExclude() throws Exception
    {
        testEngine.saveText( "TestPageExcluded", "this is test page that should be excluded [{PageViewPlugin}]" );

        WikiPage page1 = testEngine.getPage( "TestPage01" );
        WikiContext context1 = new WikiContext( testEngine, page1 );
        WikiPage page2 = testEngine.getPage( "TestPage02" );
        WikiContext context2 = new WikiContext( testEngine, page2 );

        // generate counts:
        testEngine.getHTML( context1, page1 );
        testEngine.getHTML( context2, page2 );
        testEngine.getHTML( context2, page2 );

        // mind the double \n in the following string:
        String pageViewPageContent = "[{PageViewPlugin show='list' exclude='TestPageExcl*' '\n\n* {1} ({2} views)\n}]";
        testEngine.saveText( "PageViews", pageViewPageContent );

        WikiPage pageviews = testEngine.getPage( "PageViews" );
        WikiContext contextPV = new WikiContext( testEngine, pageviews );

        String result = testEngine.getHTML( contextPV, pageviews );
//        System.out.println( result );

View Full Code Here

Examples of org.apache.wiki.WikiPage

        testEngine.deleteTestPage( "TestPageExcluded" );
    }

    public void testShowCountsSorted() throws Exception
    {
        WikiPage page1 = testEngine.getPage( "TestPage01" );
        WikiContext context1 = new WikiContext( testEngine, page1 );
        WikiPage page2 = testEngine.getPage( "TestPage02" );
        WikiContext context2 = new WikiContext( testEngine, page2 );

        // generate counts:
        testEngine.getHTML( context1, page1 );
        testEngine.getHTML( context2, page2 );
        testEngine.getHTML( context2, page2 );

        // mind the double \n in the following string:
        String pageViewPageContent = "[{PageViewPlugin show='list' sort=count '\n\n* {1} ({2} views)\n}]";
        testEngine.saveText( "PageViews", pageViewPageContent );

        WikiPage pageviews = testEngine.getPage( "PageViews" );
        WikiContext contextPV = new WikiContext( testEngine, pageviews );

        String result = testEngine.getHTML( contextPV, pageviews );
//        System.out.println( result );

View Full Code Here

Examples of org.apache.wiki.WikiPage

    {
        // create pages that should be counted
        testEngine.saveText( "TestPage03", "this is test page 03 [{PageViewPlugin}]" );
        testEngine.saveText( "TestPage04", "this is test page 04 [{PageViewPlugin}]" );

        WikiPage page1 = testEngine.getPage( "TestPage01" );
        WikiContext context1 = new WikiContext( testEngine, page1 );
        WikiPage page2 = testEngine.getPage( "TestPage02" );
        WikiContext context2 = new WikiContext( testEngine, page2 );
        WikiPage page3 = testEngine.getPage( "TestPage03" );
        WikiContext context3 = new WikiContext( testEngine, page3 );
        WikiPage page4 = testEngine.getPage( "TestPage04" );
        WikiContext context4 = new WikiContext( testEngine, page4 );

        // generate counts:
        testEngine.getHTML( context1, page1 );
        testEngine.getHTML( context2, page2 );
        testEngine.getHTML( context2, page2 );
        testEngine.getHTML( context3, page3 );
        testEngine.getHTML( context4, page4 );

        // mind the double \n in the following string:
        String pageViewPageContent = "[{PageViewPlugin show='list' entries=3'\n\n* {1} ({2} views)\n}]";
        testEngine.saveText( "PageViews", pageViewPageContent );

        WikiPage pageviews = testEngine.getPage( "PageViews" );
        WikiContext contextPV = new WikiContext( testEngine, pageviews );

        String result = testEngine.getHTML( contextPV, pageviews );
//        System.out.println( result );

View Full Code Here

Examples of org.apache.wiki.WikiPage

    public void setUp()
        throws Exception
    {
        engine = new TestEngine(props);
        context = new WikiContext( engine, new WikiPage(engine, "Testpage") );
        manager = new DefaultPluginManager( engine, props );
    }
View Full Code Here

Examples of org.apache.wiki.WikiPage

        testEngine = new TestEngine(props);

        testEngine.saveText( "TestPage", "Reference to [Foobar]." );
        testEngine.saveText( "Foobar", "Reference to [Foobar 2], [Foobars]" );

        context = new WikiContext( testEngine, new WikiPage(testEngine, "TestPage") );
        manager = new DefaultPluginManager( testEngine, props );
    }
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.