public final int doWikiStartTag()
throws IOException,
ProviderException
{
WikiEngine engine = m_wikiContext.getEngine();
WikiPage insertedPage;
//
// NB: The page might not really exist if the user is currently
// creating it (i.e. it is not yet in the cache or providers),
// AND we got the page from the wikiContext.
//
if( m_pageName == null )
{
insertedPage = m_wikiContext.getPage();
if( !engine.pageExists(insertedPage) ) return SKIP_BODY;
}
else
{
insertedPage = engine.getPage( m_pageName );
}
if( insertedPage != null )
{
// FIXME: Do version setting later.
// page.setVersion( WikiProvider.LATEST_VERSION );
log.debug("Inserting page "+insertedPage);
JspWriter out = pageContext.getOut();
WikiPage oldPage = m_wikiContext.setRealPage( insertedPage );
switch( m_mode )
{
case HTML:
out.print( engine.getHTML( m_wikiContext, insertedPage ) );
break;
case PLAIN:
out.print( engine.getText( m_wikiContext, insertedPage ) );
break;
}
m_wikiContext.setRealPage( oldPage );
}