Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-719

provide plugin compatibility with pre 2.9 releases

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9
    • Component/s: Plugins
    • Labels:
      None
    • Environment:

      NA

      Description

      JSPWiki 2.9 uses the new org.apache.wiki package names.

      If you have a bunch of wiki pages with plugin invocations that include the old (com.ecyrd.jspwiki) package name, this will now fail.
      So for example :

      Index Page 
      
      [{com.ecyrd.jspwiki.plugin.IndexPlugin}]
      
      

      The suggestion is to patch the PluginManager to handle this by replacing the old package name by the new one.
      See attached patch.

      What do you think ?

      1. JSPWiki-719.patch
        1 kB
        Harry Metske
      2. JSPWiki-719.patch
        0.9 kB
        Harry Metske

        Activity

        Hide
        florianh Florian Holeczek added a comment -

        Good idea, but I think this could cause heavy trouble for people using others than the core plugins in this package namespace. Of course this shouldn't be done, but if so, this patch would cause some confusion.

        Maybe we could activate this functionality optionally by providing a configuration property like "AutoConvertOldPluginNamespace" or something like that (which defaults to false)?

        Show
        florianh Florian Holeczek added a comment - Good idea, but I think this could cause heavy trouble for people using others than the core plugins in this package namespace. Of course this shouldn't be done, but if so, this patch would cause some confusion. Maybe we could activate this functionality optionally by providing a configuration property like "AutoConvertOldPluginNamespace" or something like that (which defaults to false)?
        Hide
        juanpablo Juan Pablo Santos Rodríguez added a comment -

        what about

        org.apache.wiki.plugin.PluginManager.java
            private Class findPluginClass( String classname ) throws ClassNotFoundException
            {
                return ClassUtil.findClass( Arrays.asList( m_searchPath, "org.apache.wiki" ), classname );
            }
        

        ?

        Shouldn't affect existing plugins, as their searchpath is used first; if not found (like in com.ecyrd.jspwiki.plugin.*) then we try on default plugin namespace.

        Show
        juanpablo Juan Pablo Santos Rodríguez added a comment - what about org.apache.wiki.plugin.PluginManager.java private Class findPluginClass( String classname ) throws ClassNotFoundException { return ClassUtil.findClass( Arrays.asList( m_searchPath, "org.apache.wiki" ), classname ); } ? Shouldn't affect existing plugins, as their searchpath is used first; if not found (like in com.ecyrd.jspwiki.plugin.*) then we try on default plugin namespace.
        Hide
        metskem Harry Metske added a comment -

        Much better, +1 from me.

        Show
        metskem Harry Metske added a comment - Much better, +1 from me.
        Hide
        metskem Harry Metske added a comment -

        Juan Pablo's suggestion does not work, the org.apache.wiki package is already searched, and also it will be prepended (org.apache.wiki.com.ecyrd.jspwiki.plugin.MyPlugin).

        Attached a new patch proposal which does the same as the first patch, but now as a last resort after everything else has failed.

        Show
        metskem Harry Metske added a comment - Juan Pablo's suggestion does not work, the org.apache.wiki package is already searched, and also it will be prepended (org.apache.wiki.com.ecyrd.jspwiki.plugin.MyPlugin). Attached a new patch proposal which does the same as the first patch, but now as a last resort after everything else has failed.
        Hide
        juanpablo Juan Pablo Santos Rodríguez added a comment -

        yep, it's prepended, not searched in. Didn't noticed when looking at the code :-s

        As for the latest patch, +1 here.

        Show
        juanpablo Juan Pablo Santos Rodríguez added a comment - yep, it's prepended, not searched in. Didn't noticed when looking at the code :-s As for the latest patch, +1 here.
        Hide
        metskem Harry Metske added a comment -

        fixed in 2.9.0-svn-3

        Show
        metskem Harry Metske added a comment - fixed in 2.9.0-svn-3
        Hide
        florianh Florian Holeczek added a comment -

        Closing this, since 2.9 has been released

        Show
        florianh Florian Holeczek added a comment - Closing this, since 2.9 has been released

          People

          • Assignee:
            metskem Harry Metske
            Reporter:
            metskem Harry Metske
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development