Package org.apache.wiki.api.engine

Examples of org.apache.wiki.api.engine.FilterManager


    }

    public void testSaveWikiPageWithException() throws WikiException
    {
        // Add a PageFilter that rejects all save attempts
        FilterManager fm = m_engine.getFilterManager();
        fm.addPageFilter( new AbortFilter(), 0 );

        // Create a sample test page and try to save it
        String pageName = "SaveWikiPageWorkflow-Test" + System.currentTimeMillis();
        String text = "This is a test!";
        try
View Full Code Here


                    page.setAuthor( wup.getName() );
            }

            // Run the pre-save filters. If any exceptions, add error to list, abort, and redirect
            String saveText;
            FilterManager fm = engine.getFilterManager();
            saveText = fm.doPreSaveFiltering( m_context, m_proposedText );

            // 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;
View Full Code Here

            engine.getPageManager().putPageText( page, proposedText );

            // Refresh the context for post save filtering.
            engine.getPage( page.getName() );
            engine.textToHTML( context, proposedText );
            FilterManager fm = engine.getFilterManager();
            fm.doPostSaveFiltering( context, proposedText );

            return Outcome.STEP_COMPLETE;
        }
View Full Code Here

            return m_context.getRequestContext();
        }

        public String getPagefilters()
        {
            FilterManager fm = m_context.getEngine().getFilterManager();
            List<PageFilter> filters = fm.getFilterList();
            StringBuffer sb = new StringBuffer();

            for (PageFilter pf : filters )
            {
                String f = pf.getClass().getName();
View Full Code Here

           
            try
            {
                if( runFilters )
                {
                    FilterManager fm = engine.getFilterManager();
                    wikiText = fm.doPreTranslateFiltering( context, wikiText );
                }
            }
            catch(Exception e)
            {
                log.error("Could not construct table of contents: Filter Error", e);
View Full Code Here

                   || type == WikiPageEvent.PRE_SAVE_BEGIN
                   || type == WikiPageEvent.PRE_SAVE_END
                   || type == WikiPageEvent.POST_SAVE_BEGIN
                   || type == WikiPageEvent.POST_SAVE_END ) // attach to FilterManager
            {
                FilterManager fm = ((WikiEngine)client).getFilterManager();
                WikiEventManager.addWikiEventListener( fm, listener );
            }
            else //if (  type == WikiPageEvent.PRE_TRANSLATE
                 // || type == WikiPageEvent.POST_TRANSLATE
                 // || type == WikiPageEvent.PRE_SAVE
View Full Code Here

        ResourceBundle rb = Preferences.getBundle( context, InternationalizationManager.CORE_BUNDLE );

        //
        //  Query the SpamFilter first
        //
        FilterManager fm = m_engine.getFilterManager();
        List<PageFilter> ls = fm.getFilterList();
        for( PageFilter pf : ls )
        {
            if( pf instanceof SpamFilter )
            {
                if( ((SpamFilter)pf).isValidUserProfile( context, profile ) == false )
View Full Code Here

TOP

Related Classes of org.apache.wiki.api.engine.FilterManager

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.