[xwiki-devs] Some kind of DocumentChangedListener?
Hello, Is there any way to add some code without recompiling xwiki-core (plugin? component?) that could register a listener for any changes in documents (preferably by mask / type, as in "listen for added comments on Main.* and Blog.*") and optionally veto (and/or flag for review?) them? If not, please consider adding it - it would be a very nice way to make writing things like spam- and vandal- filters easier. It would also allow making such things more modular - if any plugin could register such a listener, then there could be (for example) two independent plugins running at once, one handling scenarios like "bad source" - "bad ip", "possible anonymous proxy", the other "bad content" - "bad words", "structure looks like spam" or "too many links". Greetings, Lilianne
Lilianne E. Blaze wrote:
Hello, Is there any way to add some code without recompiling xwiki-core (plugin? component?) that could register a listener for any changes in documents (preferably by mask / type, as in "listen for added comments on Main.* and Blog.*") and optionally veto (and/or flag for review?) them?
If not, please consider adding it - it would be a very nice way to make writing things like spam- and vandal- filters easier.
It would also allow making such things more modular - if any plugin could register such a listener, then there could be (for example) two independent plugins running at once, one handling scenarios like "bad source" - "bad ip", "possible anonymous proxy", the other "bad content" - "bad words", "structure looks like spam" or "too many links".
Yes, there is the old notification API in xwiki-core, and the new observation component that handle this scenario (see http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core-observation/apidocs... for the documentation, and http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-localization/sr... for usage example at the end of the file). And yes, this is one of the (three) best approaches to the anti vandalism project. The veto-ing part is not yet written, I remember proposing it initially, but Vincent opposed the idea, and we didn't need it until now. The strategy for developing components is to write the essential functionality first, and add features when the need occurs, so this veto mechanism might be added soon. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Sergiu Dumitriu wrote:
Lilianne E. Blaze wrote:
Hello, Is there any way to add some code without recompiling xwiki-core (plugin? component?) that could register a listener for any changes in documents (preferably by mask / type, as in "listen for added comments on Main.* and Blog.*") and optionally veto (and/or flag for review?) them?
If not, please consider adding it - it would be a very nice way to make writing things like spam- and vandal- filters easier.
It would also allow making such things more modular - if any plugin could register such a listener, then there could be (for example) two independent plugins running at once, one handling scenarios like "bad source" - "bad ip", "possible anonymous proxy", the other "bad content" - "bad words", "structure looks like spam" or "too many links".
Yes, there is the old notification API in xwiki-core, and the new observation component that handle this scenario (see http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core-observation/apidocs... for the documentation, and http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-localization/sr... for usage example at the end of the file). And yes, this is one of the (three) best approaches to the anti vandalism project. The veto-ing part
What are the other two?
is not yet written, I remember proposing it initially, but Vincent
I hope it will be? One way would be not to veto a comment (or change / whatever), but instead delete it immediately after adding, but that's unnecessary database access.
opposed the idea, and we didn't need it until now. The strategy for developing components is to write the essential functionality first, and add features when the need occurs, so this veto mechanism might be added soon.
Greetings, Lilianne
Lilianne E. Blaze wrote:
Sergiu Dumitriu wrote:
Lilianne E. Blaze wrote:
Hello, Is there any way to add some code without recompiling xwiki-core (plugin? component?) that could register a listener for any changes in documents (preferably by mask / type, as in "listen for added comments on Main.* and Blog.*") and optionally veto (and/or flag for review?) them?
If not, please consider adding it - it would be a very nice way to make writing things like spam- and vandal- filters easier.
It would also allow making such things more modular - if any plugin could register such a listener, then there could be (for example) two independent plugins running at once, one handling scenarios like "bad source" - "bad ip", "possible anonymous proxy", the other "bad content" - "bad words", "structure looks like spam" or "too many links". Yes, there is the old notification API in xwiki-core, and the new observation component that handle this scenario (see http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core-observation/apidocs... for the documentation, and http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-localization/sr... for usage example at the end of the file). And yes, this is one of the (three) best approaches to the anti vandalism project. The veto-ing part
What are the other two?
Since the GSoC selection is not yet over, I'll keep this for myself until tomorrow. -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Apr 3, 2009, at 2:40 AM, Sergiu Dumitriu wrote:
Lilianne E. Blaze wrote:
Hello, Is there any way to add some code without recompiling xwiki-core (plugin? component?) that could register a listener for any changes in documents (preferably by mask / type, as in "listen for added comments on Main.* and Blog.*") and optionally veto (and/or flag for review?) them?
If not, please consider adding it - it would be a very nice way to make writing things like spam- and vandal- filters easier.
It would also allow making such things more modular - if any plugin could register such a listener, then there could be (for example) two independent plugins running at once, one handling scenarios like "bad source" - "bad ip", "possible anonymous proxy", the other "bad content" - "bad words", "structure looks like spam" or "too many links".
Yes, there is the old notification API in xwiki-core, and the new observation component that handle this scenario (see http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core-observation/apidocs... for the documentation, and http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-localization/sr... for usage example at the end of the file). And yes, this is one of the (three) best approaches to the anti vandalism project. The veto-ing part is not yet written, I remember proposing it initially, but Vincent opposed the idea,
Sergiu, could you find the email thread again? I'd like to see why I "opposed" the idea. Thanks -Vincent
and we didn't need it until now. The strategy for developing components is to write the essential functionality first, and add features when the need occurs, so this veto mechanism might be added soon. -- Sergiu Dumitriu
Vincent Massol wrote:
On Apr 3, 2009, at 2:40 AM, Sergiu Dumitriu wrote:
Lilianne E. Blaze wrote:
Hello, Is there any way to add some code without recompiling xwiki-core (plugin? component?) that could register a listener for any changes in documents (preferably by mask / type, as in "listen for added comments on Main.* and Blog.*") and optionally veto (and/or flag for review?) them?
If not, please consider adding it - it would be a very nice way to make writing things like spam- and vandal- filters easier.
It would also allow making such things more modular - if any plugin could register such a listener, then there could be (for example) two independent plugins running at once, one handling scenarios like "bad source" - "bad ip", "possible anonymous proxy", the other "bad content" - "bad words", "structure looks like spam" or "too many links". Yes, there is the old notification API in xwiki-core, and the new observation component that handle this scenario (see http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core-observation/apidocs... for the documentation, and http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-localization/sr... for usage example at the end of the file). And yes, this is one of the (three) best approaches to the anti vandalism project. The veto-ing part is not yet written, I remember proposing it initially, but Vincent opposed the idea,
Sergiu, could you find the email thread again? I'd like to see why I "opposed" the idea.
http://markmail.org/message/fizvsadfge5yurik -- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi Lilianne, On Apr 3, 2009, at 1:34 AM, Lilianne E. Blaze wrote:
Hello, Is there any way to add some code without recompiling xwiki-core (plugin? component?) that could register a listener for any changes in documents (preferably by mask / type, as in "listen for added comments on Main.* and Blog.*") and optionally veto (and/or flag for review?) them?
In addition to Sergiu's links I also wrote a small tutorial here to show an example: http://platform.xwiki.org/xwiki/bin/view/DevGuide/Notifications Thanks -Vincent
If not, please consider adding it - it would be a very nice way to make writing things like spam- and vandal- filters easier.
It would also allow making such things more modular - if any plugin could register such a listener, then there could be (for example) two independent plugins running at once, one handling scenarios like "bad source" - "bad ip", "possible anonymous proxy", the other "bad content" - "bad words", "structure looks like spam" or "too many links".
Greetings, Lilianne
participants (3)
-
Lilianne E. Blaze -
Sergiu Dumitriu -
Vincent Massol