You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by "Janne Jalkanen (JIRA)" <ji...@apache.org> on 2008/11/09 16:06:44 UTC
[jira] Created: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Plugins should use annotations instead of jspwiki_module.xml
------------------------------------------------------------
Key: JSPWIKI-423
URL: https://issues.apache.org/jira/browse/JSPWIKI-423
Project: JSPWiki
Issue Type: Improvement
Components: Plugins
Reporter: Janne Jalkanen
Assignee: Janne Jalkanen
Fix For: 3.0
Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (JSPWIKI-423) Plugins should use annotations instead of jspwiki_module.xml
Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> Discussion out side of JIRA is okay right?
Okay, but not persistent. Which can be a problem sometimes.
> I'm frankly quite surprised at the seeming jump on the annotation
> bandwagon. I *like* annotations and all, but I fail to see exactly
> how
> they improve things over simply adding a few abstract methods to
> WikiPlugin such as:
Annotations can be processed externally.
Also, using abstract methods is a problem because *if* you add
anything in the future, all your plugin classes break horribly. So
you need to provide an abstract baseclass, which in turn makes it
impossible to choose your own parent class. So you couldn't make any
arbitrary component implement WikiPlugin.
> I mean, if a plugin class has dependencies that cause class-loading to
> fail, then annotations don't help you either right? That reason is
> actually the *only* reason that I thought jspwiki_module.xml was maybe
> okay, you could inspect it without loading the class (which might fail
> because of dependencies).
Classloading might fail even if you *are* compatible due to missing
libraries. So it does not really help you out :-/
/Janne
RE: [jira] Commented: (JSPWIKI-423) Plugins should use annotations instead of jspwiki_module.xml
Posted by "Volkar, John M." <JV...@medrad.com>.
Discussion out side of JIRA is okay right?
----
I'm frankly quite surprised at the seeming jump on the annotation
bandwagon. I *like* annotations and all, but I fail to see exactly how
they improve things over simply adding a few abstract methods to
WikiPlugin such as:
getMinVersion()
getMaxVersion()
Or
getWhateverIsNeeded()
Since the basic rule for a plugin is that all significant construction
work should be done in the init method, and a no arg constructor is
required to be available, I fail to see why simply new'ing it and
calling a few getters is not sufficient.
And frankly I don't like getters for the version stuff, why not just let
the PluginManager ask a plugin if its compatible...
WikiPlugin candidate = new SomeRandomPlugin() <<or however you get a
newInstance from a class string.
If (candidate.isCompatibleWith(jspwiki_version)) register(canidate);
I mean, if a plugin class has dependencies that cause class-loading to
fail, then annotations don't help you either right? That reason is
actually the *only* reason that I thought jspwiki_module.xml was maybe
okay, you could inspect it without loading the class (which might fail
because of dependencies).
<sigh/> Maybe I should crawl back under my rock; I seem to have missed
much discussion.
Regards,
John Volkar
-----Original Message-----
From: Andrew Jaquith (JIRA) [mailto:jira@apache.org]
Sent: Monday, November 10, 2008 10:12 PM
To: jspwiki-dev@incubator.apache.org
Subject: [jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
[
https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jir
a.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1264645
3#action_12646453 ]
Andrew Jaquith commented on JSPWIKI-423:
----------------------------------------
A few quick thoughts:
* It's true, Stripes 1.5 does not scan the entire classpath anymore...
and this is definitely a feature because it speeds up startup
* The Stripes approach for locating optional classes is to specify what
packages contain Stripes "extensions". This is done by having
ResolveUtil search a comma-separated list of packages in a servlet
init-param, e.g., "com.ecyrd.jspwiki.action,net.sf.stripes".
* JSPWiki could do the same thing (but configure the packages to search
via jspwiki.proprties, I'd expect)
Also, could we think a little more creatively about the annotation name?
"ModuleData" just leaves me cold. I'd suggest something a little more
suggestive of the classes it annotates. For example, "WikiExtension" or
"WikiModule" is a lot better.
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Janne Jalkanen
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date.
Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Janne Jalkanen resolved JSPWIKI-423.
------------------------------------
Resolution: Fixed
Fixed in 3.0.0-svn-5. Please see PluginManager javadoc for caveats.
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Janne Jalkanen
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646107#action_12646107 ]
Janne Jalkanen commented on JSPWIKI-423:
----------------------------------------
Since plugins have to go through a binary break anyway, I see no reason to carry the jspwiki_module.xml to JSPWiki 3.0. Except maybe for JSP files (like plain.jsp).
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Janne Jalkanen
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646099#action_12646099 ]
Harry Metske commented on JSPWIKI-423:
--------------------------------------
Shouldn't the PluginManager (and FilterManager) be changed first before we can use these annotations ?
They should both use the old API (jspwiki_module.xml) and the reflection API to interrogate the plugins and filters right ?
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Janne Jalkanen
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646488#action_12646488 ]
Janne Jalkanen commented on JSPWIKI-423:
----------------------------------------
Yes, we have something similar now:
* First, scan the default packages of "com.ecyrd.jspwiki" and "org.apache.jspwiki"
* Then, use the contents of "jspwiki.plugin.searchPath" just like in 2.x, except now we also search subpackages.
* Last, use jspwiki_module.xml to locate the rest. There's a new attribute now, so you can say
<code>
<modules package="com.mycompany.jspwiki"/>
</code>
To add "com.mycompany.jspwiki" to the search path.
I agree that ModuleData is not very descriptive. However, we've already got "WikiModule" as a superclass to WikiPlugin ;-). So I don't think those particular alternatives are better. Open to suggestions though...
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Janne Jalkanen
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Posted by "Harry Metske (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646114#action_12646114 ]
Harry Metske commented on JSPWIKI-423:
--------------------------------------
I agree, what I meant with my first comment is that just adding the annotations is not enough, we first have to change the PluginManager and FilterManager to use annotations instead of the jspwiki_module.xml.
Let me try to get some things working here.
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Harry Metske
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Posted by "Andrew Jaquith (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646453#action_12646453 ]
Andrew Jaquith commented on JSPWIKI-423:
----------------------------------------
A few quick thoughts:
* It's true, Stripes 1.5 does not scan the entire classpath anymore... and this is definitely a feature because it speeds up startup
* The Stripes approach for locating optional classes is to specify what packages contain Stripes "extensions". This is done by having ResolveUtil search a comma-separated list of packages in a servlet init-param, e.g., "com.ecyrd.jspwiki.action,net.sf.stripes".
* JSPWiki could do the same thing (but configure the packages to search via jspwiki.proprties, I'd expect)
Also, could we think a little more creatively about the annotation name? "ModuleData" just leaves me cold. I'd suggest something a little more suggestive of the classes it annotates. For example, "WikiExtension" or "WikiModule" is a lot better.
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Janne Jalkanen
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml
Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646116#action_12646116 ]
Janne Jalkanen commented on JSPWIKI-423:
----------------------------------------
Yeah, I nearly had something to check in already... But I have a bit of a problem. Looks like Stripes changed from 1.4 to 1.5 in such a way that it can no longer scan the libraries from WEB-INF automatically. Which is a bit of a bummer.
We can use the ResolveUtil to locate all files from "com", "org", and so on, but I think it's a bit heavy-handed to add ALL TLDs in the search list. I don't know if there's a way to search for every single class.
So maybe jspwiki_module.xml is actually mandatory.
> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
> Key: JSPWIKI-423
> URL: https://issues.apache.org/jira/browse/JSPWIKI-423
> Project: JSPWiki
> Issue Type: Improvement
> Components: Plugins
> Reporter: Janne Jalkanen
> Assignee: Janne Jalkanen
> Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date. Please see org.apache.jspwiki.api.ModuleData annotation.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.