Package org.apache.wiki.providers

Examples of org.apache.wiki.providers.WikiPageProvider


        props.setProperty( "log4j.appender.outlog.layout", "org.apache.log4j.PatternLayout" );
        props.setProperty( "jspwiki.useLucene", "false" );
        props.setProperty( "log4j.rootCategory", "INFO,outlog" );
        WikiEngine engine = new WikiEngine( props );

        WikiPageProvider sourceProvider = engine.getPageManager().getProvider();
       
        File tmpDir = new File( SystemUtils.JAVA_IO_TMPDIR, "converter-tmp" );
       
        props.setProperty( AbstractFileProvider.PROP_PAGEDIR, tmpDir.getAbsolutePath() );
        WikiPageProvider destProvider = new VersioningFileProvider();
       
        destProvider.initialize( engine, props );
       
        Collection allPages = sourceProvider.getAllPages();
       
        int idx = 1;
       
        for( Iterator i = allPages.iterator(); i.hasNext(); )
        {
            WikiPage p = (WikiPage)i.next();
           
            System.out.println("Converting page: "+p.getName()+" ("+idx+"/"+allPages.size()+")");
            List pageHistory = engine.getVersionHistory( p.getName() );
           
           
            for( ListIterator v = pageHistory.listIterator(pageHistory.size()); v.hasPrevious(); )
            {
                WikiPage pv = (WikiPage)v.previous();
               
                String text = engine.getPureText( pv.getName(), pv.getVersion() );
               
                destProvider.putPageText( pv, text );
            }
           
            //
            //  Do manual setting now
            //
View Full Code Here


        props.setProperty( "log4j.appender.outlog.layout", "org.apache.log4j.PatternLayout" );
        props.setProperty( "jspwiki.useLucene", "false" );
        props.setProperty( "log4j.rootCategory", "INFO,outlog" );
        WikiEngine engine = new WikiEngine( props );

        WikiPageProvider sourceProvider = engine.getPageManager().getProvider();
       
        File tmpDir = new File( SystemUtils.JAVA_IO_TMPDIR, "converter-tmp" );
       
        props.setProperty( AbstractFileProvider.PROP_PAGEDIR, tmpDir.getAbsolutePath() );
        WikiPageProvider destProvider = new VersioningFileProvider();
       
        destProvider.initialize( engine, props );
       
        Collection allPages = sourceProvider.getAllPages();
       
        int idx = 1;
       
        for( Iterator i = allPages.iterator(); i.hasNext(); )
        {
            WikiPage p = (WikiPage)i.next();
           
            System.out.println("Converting page: "+p.getName()+" ("+idx+"/"+allPages.size()+")");
            List pageHistory = engine.getVersionHistory( p.getName() );
           
           
            for( ListIterator v = pageHistory.listIterator(pageHistory.size()); v.hasPrevious(); )
            {
                WikiPage pv = (WikiPage)v.previous();
               
                String text = engine.getPureText( pv.getName(), pv.getVersion() );
               
                destProvider.putPageText( pv, text );
            }
           
            //
            //  Do manual setting now
            //
View Full Code Here

TOP

Related Classes of org.apache.wiki.providers.WikiPageProvider

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.