@Override
public Outcome execute() throws WikiException
{
// Retrieve attributes
WikiEngine engine = m_context.getEngine();
Workflow workflow = getWorkflow();
// Get the wiki page
WikiPage page = m_context.getPage();
// Figure out who the author was. Prefer the author
// set programmatically; otherwise get from the
// current logged in user
if ( page.getAuthor() == null )
{
Principal wup = m_context.getCurrentUser();
if ( wup != null )
page.setAuthor( wup.getName() );
}
// Run the pre-save filters. If any exceptions, add error to list, abort, and redirect
String saveText;
try
{
saveText = engine.getFilterManager().doPreSaveFiltering( m_context, m_proposedText );
}
catch ( FilterException e )
{
throw e;
}
// Stash the wiki context, old and new text as workflow attributes
workflow.setAttribute( PRESAVE_WIKI_CONTEXT, m_context );
workflow.setAttribute( FACT_PROPOSED_TEXT, saveText );
return Outcome.STEP_COMPLETE;
}