TitleInitializablePlugin not initialized
Date10-Aug-2005 12:01:30 EEST
Version2.2.28
SubmitterErikAlm
Bug criticalityMediumBug
Browser versionFirefox 1.0.6
Bug statusClosedBug
PageProvider usedVersioningFileProvider
Servlet ContainerTomcat 5.5.9
Operating SystemLinux 2.6.8.1-12mdk
URL
Java version1.5.0_03

As stated before (by Janne) JSPWiki should now initialize plugins implementing the InitializablePlugin interface, however, I have not been able to verify this with a test plugin. (And yes, it is a plugin I access from a page.)

The following simple plugin returns "test = false" even after consecutive restarts of the app-server:

import com.ecyrd.jspwiki.WikiContext;
import com.ecyrd.jspwiki.plugin.InitializablePlugin;
import com.ecyrd.jspwiki.plugin.PluginException;
import com.ecyrd.jspwiki.plugin.WikiPlugin;
import java.util.Map;

public class TestInitPlugin implements WikiPlugin, InitializablePlugin {

    private static boolean test = false;
    
    public String execute(WikiContext wikiContext, Map map) 
            throws PluginException 
    {
        return "test = " + test;
    }

    public void initialize(WikiContext wikiContext, Map map) 
            throws PluginException 
    {
        test = true;
    }
    
}


According to the source of PluginManager, this should work.

....
            try
            {
                if( m_initStage )
                {
                    if( plugin instanceof InitializablePlugin )
                    {
                        ((InitializablePlugin)plugin).initialize( context, params );
                    }
                    return "";
                }
                
                return plugin.execute( context, params );
            }

.....

Anyway, it is reported a long time ago, closing the bug, if the problem still persists with 2.4.100, feel free to re-open the bug.

--HarryMetske, 03-Mar-2007

Yes, it's still open, and I haven't forgotten this. But I did finally figure out a good solution. Reopening.

-- JanneJalkanen


Fixed in 2.5.30.

-- JanneJalkanen

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-6) was last changed on 18-Mar-2007 18:06 by JanneJalkanen