Package org.apache.wiki.parser

Examples of org.apache.wiki.parser.WikiDocument


                RenderingManager mgr = engine.getRenderingManager();
               
                MarkupParser p = mgr.getParser( m_wikiContext, "["+author+"|"+author+"]" );

                WikiDocument d = p.parse();
               
                author = mgr.getHTML( m_wikiContext, d );
            }

            pageContext.getOut().print( author );
View Full Code Here


        WikiContext context = new WikiContext( testEngine,
                                               new WikiPage(testEngine, "TestPage") );
       
        MarkupParser p = new JSPWikiMarkupParser( context, new StringReader(src) );
       
        WikiDocument dom = p.parse();
       
        WikiRenderer r = new XHTMLRenderer( context, dom );
       
        return r.getString();
    }
View Full Code Here

    protected WikiDocument getRenderedDocument(WikiContext context, String pagedata) throws IOException {
        String pageid = context.getRealPage().getName() + VERSION_DELIMITER + context.getRealPage().getVersion();

            Element element = m_documentCache.get(pageid);
            if (element != null) {
                WikiDocument doc = (WikiDocument) element.getObjectValue();

                //
                //  This check is needed in case the different filters have actually changed the page data.
                //  FIXME: Figure out a faster method
                if (pagedata.equals(doc.getPageData())) {
                    if (log.isDebugEnabled()) log.debug("Using cached HTML for page " + pageid);
                    return doc;
                }
            } else {
                if (log.isDebugEnabled()) log.debug("Re-rendering and storing " + pageid);
            }

        //
        //  Refresh the data content
        //
        try
        {
            MarkupParser parser = getParser( context, pagedata );
            WikiDocument doc = parser.parse();
            doc.setPageData( pagedata );
            m_documentCache.put( new Element(pageid, doc ));
            return doc;
        }
        catch( IOException ex )
        {
View Full Code Here

     */
    public String getHTML( WikiContext context, String pagedata )
    {
        try
        {
            WikiDocument doc = getRenderedDocument( context, pagedata );

            return getHTML( context, doc );
        }
        catch( IOException e )
        {
View Full Code Here

            MarkupParser parser = mgr.getParser(context, wikitext);

            parser.addLinkTransmutator( new CutMutator(m_maxwidth) );
            parser.enableImageInlining( false );

            WikiDocument doc = parser.parse();

            result = mgr.getHTML( context, doc );
        }
        catch( IOException e )
        {
View Full Code Here

            mp.addExternalLinkHook( extLinkHook );
            mp.addAttachmentLinkHook( attLinkHook );

            if( !parseAccessRules ) mp.disableAccessRules();

            WikiDocument doc = mp.parse();

            //
            //  In some cases it's better just to parse, not to render
            //
            if( !justParse )
View Full Code Here

        WikiContext ctx = new WikiContext(m_testEngine,dummyPage);
       
        StringReader in = new StringReader(s);
       
        JSPWikiMarkupParser p = new JSPWikiMarkupParser( ctx, in );
        WikiDocument d = p.parse();
       
        CreoleRenderer cr = new CreoleRenderer( ctx, d );
       
        return cr.getString();
    }
View Full Code Here

        WikiContext ctx = new WikiContext(testEngine,dummyPage);

        StringReader in = new StringReader(s);

        JSPWikiMarkupParser p = new JSPWikiMarkupParser( ctx, in );
        WikiDocument d = p.parse();

        WysiwygEditingRenderer wer = new WysiwygEditingRenderer( ctx, d );

        return wer.getString();
    }
View Full Code Here

           
            WikiContext context = new WikiContext( m_engine, page );
           
            MarkupParser p = m_manager.getParser( context, pagedata );
           
            WikiDocument d = p.parse();
           
            String html = m_manager.getHTML( context, d );
            assertNotNull( "noncached got null response",html);
        }
       
View Full Code Here

        WikiContext context = new WikiContext( testEngine,
                                               new WikiPage(testEngine, "TestPage") );
       
        MarkupParser p = new JSPWikiMarkupParser( context, new StringReader(src) );
       
        WikiDocument dom = p.parse();
       
        WikiRenderer r = new XHTMLRenderer( context, dom );
       
        return r.getString();
    }
View Full Code Here

TOP

Related Classes of org.apache.wiki.parser.WikiDocument

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.