Package com.ecyrd.jspwiki

Examples of com.ecyrd.jspwiki.WikiPage


        att.setAuthor( "FirstPost" );

        m_manager.storeAttachment( att, makeAttachmentFile() );

        Attachment att2 = m_manager.getAttachmentInfo( new WikiContext(m_engine,
                                                                       new WikiPage(m_engine, NAME1)),
                                                       "test1.txt", 1 );

        assertNotNull( "attachment disappeared", att2 );
        assertEquals( "version", 1, att2.getVersion() );
        assertEquals( "name", att.getName(), att2.getName() );
View Full Code Here


        att.setAuthor( "FooBar" );
        m_manager.storeAttachment( att, makeAttachmentFile() );       

        Attachment att2 = m_manager.getAttachmentInfo( new WikiContext(m_engine,
                                                                       new WikiPage(m_engine, NAME1)),
                                                       "test1.txt" );

        assertNotNull( "attachment disappeared", att2 );
        assertEquals( "name", att.getName(), att2.getName() );
        assertEquals( "author", att.getAuthor(), att2.getAuthor() );
        assertEquals( "version", 2, att2.getVersion() );

        InputStream in = m_manager.getAttachmentStream( att2 );

        assertNotNull( "stream", in );

        StringWriter sout = new StringWriter();
        FileUtil.copyContents( new InputStreamReader(in), sout );

        in.close();
        sout.close();

        assertEquals( "contents", c_fileContents, sout.toString() );


        //
        // Check that first author did not disappear
        //

        Attachment att3 = m_manager.getAttachmentInfo( new WikiContext(m_engine,
                                                                       new WikiPage(m_engine, NAME1)),
                                                       "test1.txt",
                                                       1 );
        assertEquals( "version of v1", 1, att3.getVersion() );
        assertEquals( "name of v1", "FirstPost", att3.getAuthor() );
    }
View Full Code Here

        att.setAuthor( "FirstPost" );

        m_manager.storeAttachment( att, makeAttachmentFile() );

        Collection c = m_manager.listAttachments( new WikiPage(m_engine, NAME1) );

        assertEquals( "Length", 1, c.size() );

        Attachment att2 = (Attachment) c.toArray()[0];
View Full Code Here

        att.setAuthor( "FirstPost" );

        m_manager.storeAttachment( att, makeAttachmentFile() );

        Attachment att2 = m_manager.getAttachmentInfo( new WikiContext(m_engine,
                                                                       new WikiPage(m_engine, NAME1)),
                                                       "test1" );

        assertNotNull( "attachment disappeared", att2 );
        assertEquals( "name", att.getName(), att2.getName() );
        assertEquals( "author", "FirstPost", att2.getAuthor() );
View Full Code Here

        engine = new TestEngine(props);

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

        context = new WikiContext( engine, new WikiPage(engine, "TestPage") );
        manager = new PluginManager( engine, props );
    }
View Full Code Here

     *  be listed as non-existant.
     */
    public void testSimpleUndefined()
        throws Exception
    {
        WikiContext context2 = new WikiContext( engine, new WikiPage(engine, "Foobar") );

        String res = manager.execute( context2,
                                      "{INSERT com.ecyrd.jspwiki.plugin.UndefinedPagesPlugin");

        String exp = "[Foobar 2]\\\\";
View Full Code Here

        throws Exception
    {
        props.load( TestEngine.findTestProperties() );

        engine = new TestEngine(props);
        context = new WikiContext( engine, new WikiPage(engine, "Testpage") );
        manager = new PluginManager( engine, props );
    }
View Full Code Here

        PropertyConfigurator.configure(m_props);
       
        TestEngine testEngine = new TestEngine( m_props );
       
        m_context = new WikiContext( testEngine,
                                     new WikiPage( testEngine, PAGE_NAME ) );
    }
View Full Code Here

        {
            Collection allPages = m_engine.getPageManager().getAllPages();
       
            for( Iterator i = allPages.iterator(); i.hasNext(); )
            {
                WikiPage p = (WikiPage)i.next();
               
                if( p.getName().toLowerCase().startsWith(st) )
                {
                    DavPath np = new DavPath( path );
                    np.append( p.getName()+".txt" );
                   
                    DavItem di = new PageDavItem( this, np, p );
               
                    davItems.add( di );
                }
View Full Code Here

        {
            DavItem old = (DavItem)e.getCacheContent();
           
            if( old != null && old instanceof PageDavItem )
            {
                WikiPage cached = ((PageDavItem)old).getPage();
               
                if( cached != null )
                {
                    WikiPage current = m_engine.getPage( cached.getName() );
               
                    if( cached.getLastModified().equals( current.getLastModified() ) )
                    {
                        di = old;
                    }
                }
            }
View Full Code Here

TOP

Related Classes of com.ecyrd.jspwiki.WikiPage

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.