|Title|InstalledPlugins
|Date|09-Jul-2005 01:37:52 EEST
|JSPWiki version|2.2.x
|Submitter|SriramGopalan
|[Idea Category]|PluginIdea
|Reference|InstalledPlugins
|[Idea Status]|NewIdea

I thought it would be nice if users of a JSPWiki installation could visit a page like InstalledPlugins (or something like that) and see the list of all plugins that have been installed.

This will help my users know what they can do in a wiki page and what they cannot.

Thanks.

- Sriram Gopalan


----

I'd like to see this too. It would be very helpful

--Christopher Fitch, 17-Mar-2007

----

Janne or somebody on the team,

If anyone knows how to do this let me know as this doesn't sound like a lot of 
work and I can probably pop this one off pretty quickly if given a lead.

-- MurrayAltheim


----

Two ways: you can either find all classes the JVM knows and then check using reflection whether they implement WikiPlugin or not.

Or, you can go and list the plugins using PluginManager.modules().  Unfortunately, this only lists plugins that either have a corresponding entry in jspwiki_module.xml, or which have been instantiated at some point.  So the contents of this list may change over the lifetime.  However, it would be strongly preferred that in the future each plugin would have its own XML description in jspwiki_module.xml.

--JanneJalkanen, 19-Mar-2007

If the use case here is really for a semi-novice user to know which plugins are installed/available regardless of whether the admin has been a good boy or not seems the most viable, so of the two you mention wouldn't the first be the best approach? My worry about the first is that it sounds like it might be pretty expensive, since the entire list of classes would have to be processed each time the plugin is invoked, and given all of JSPWiki combined with all the associated jars, that would be a pretty substantial number of classes.

-- MurrayAltheim, 19-Mar-2007



----

Exactly, it would be pretty expensive.  However, you could replace the PluginManager.registerPlugins() with such a method, and after that just simply use the modules() call to list all the plugins.

--JanneJalkanen, 19-Mar-2007


Yeah, thanks. That sounds more reasonable. I'll look into this over the next week or so.

-- MurrayAltheim, 19-Mar-2007



----

Though, be aware that this will cause serious classloading activity, which may cause huge issues with memory.  In addition, if your servlet container supports hot-loading of JARs (which I believe most do these days), your cached list will not be accurate anyway.

So in any case you won't be able to achieve accuracy with this method.  The only way is to declare every plugin in jspwiki_module.xml, and still you need to reload often.

--JanneJalkanen, 19-Mar-2007

----

That's what I'd try to avoid. I don't think the use case here requires an absolute match with the list of plugins installed and available at any given moment, so causing any load on the system for such a relatively low-priority activity doesn't really make much sense. Put it this way: I'd not put much effort into making sure this is a tightly-coupled list.
So what I thought was simply adding a method to [PluginManager | http://www.ecyrd.com/~jalkanen/JSPWiki/javadoc/com/ecyrd/jspwiki/plugin/PluginManager.html]:
{{{
    /** 
     *  Returns a list of all registered plugin classes.
     */
    public Set getPluginClasses()
    {
        return m_pluginClassMap.keySet();
    }
}}}
then writing a simple plugin to sort the output and provide it as a list. How would that be?

-- MurrayAltheim, 20-Mar-2007


----

According to the [change log|http://www.ecyrd.com/~jalkanen/JSPWiki/2.6.3/ChangeLog] this is delivered in version 2.5.136 (though only for the administrator)

I would create a page called InstalledPlugins and make a list of them there, linking to a page with instructions per plugin. It's only administators that are allowed to install plugins, so they should be able to maintain the list themselves.

--AnonymousCoward, 01-Aug-2008