You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Alexander Coles <al...@gmail.com> on 2008/06/27 12:15:49 UTC

A few questions for plugin development

Hi,

I recently announced on the users mailing list that I had begun work  
on both a plugin allowing Markdown syntax (in weblog entries in  
v0.0.1, and in comments too on the master branch) and support for the  
Defensio comment validator service.

I'd be grateful for any feedback you'd have! In the meantime, I also  
have a couple of questions:

Markdown Plugin
---------------
1. The static assets that the Editor UI plugin needs need to be copied  
into
$ROLLER_INSTALL_DIR/plugins-ui/authoring/editors

I thought plugins-ui would be the best place for these assets (since  
this is an "unofficial", experimental plugin), but is there another  
convention I should be following.

2. It currently uses a JSP page to provide an AJAX preview of Markdown  
formatting. I don't know if its considered bad practice, to be using  
JSPs outside of an MV-Controller? Would it be better to create a  
plugin implementing the RequestMapper interface instead?
(already implementing WeblogEntryEditor, WeblogEntryPlugin,  
WeblogEntryCommentPlugin -- one more can't hurt!)

Defensio Plugin
---------------

This isn't ready for prime-time just yet. As posted on the users  
mailing list, I need to find a way report back to Defensio when  
comments are manually marked as spam. According to Carl from Defensio:

"In order to make Defensio useful, you'll need to implement report- 
false-positives and report-false-negatives. Otherwise, accuracy will  
go down the drain very quickly.  Announce-article is also very useful  
to improve accuracy."

Does anyone have any suggestions for the best (read, "cleanest") way  
to hook around when a comment is manually marked as spam? See here for  
the lines in question:
http://pastie.org/private/klxq1gtar6dpczcjqgat4q

I need to think about this more? Something AOP - advice for  
wmgr.saveComment?
Its too bad there isn't any easy way to do this with the existing  
plugin API! I don't really want to patch Roller code to accomplish this.


Also, a plugins directory on the new Confluence Wiki would be great: http://cwiki.apache.org/confluence/display/ROLLER

Cheers,
Alex


Re: A few questions for plugin development

Posted by Dave <sn...@gmail.com>.
On Fri, Jun 27, 2008 at 6:15 AM, Alexander Coles <al...@gmail.com> wrote:
> I recently announced on the users mailing list that I had begun work on both
> a plugin allowing Markdown syntax (in weblog entries in v0.0.1, and in
> comments too on the master branch) and support for the Defensio comment
> validator service.
>
> I'd be grateful for any feedback you'd have! In the meantime, I also have a
> couple of questions:

Sure. Sorry about the delay...


> 2. It currently uses a JSP page to provide an AJAX preview of Markdown
> formatting. I don't know if its considered bad practice, to be using JSPs
> outside of an MV-Controller? Would it be better to create a plugin
> implementing the RequestMapper interface instead?
> (already implementing WeblogEntryEditor, WeblogEntryPlugin,
> WeblogEntryCommentPlugin -- one more can't hurt!)

RequestMapper gives us a way to drop in new Servlet-like classes
without editing web.xml.

Using JSPs is another way to do that.

However, you do risk colliding with a weblog URL. Make sure you add
the root path of your files (e.g. 'plugin-ui') to the list of those
that "can NEVER be considered a weblog URL." Override and add your URL
to this property in your roller-custom.properties file.

   rendering.weblogMapper.rollerProtectedUrls=\
   roller-ui,images,theme,themes,CommentAuthenticatorServlet,\
   index.jsp,favicon.ico,robots.txt,\
   page,flavor,rss,atom,language,search,comments,rsd,resource,xmlrpc,planetrss



> This isn't ready for prime-time just yet. As posted on the users mailing
> list, I need to find a way report back to Defensio when comments are
> manually marked as spam. According to Carl from Defensio:
>
> "In order to make Defensio useful, you'll need to implement
> report-false-positives and report-false-negatives. Otherwise, accuracy will
> go down the drain very quickly.  Announce-article is also very useful to
> improve accuracy."
>
> Does anyone have any suggestions for the best (read, "cleanest") way to hook
> around when a comment is manually marked as spam? See here for the lines in
> question:
> http://pastie.org/private/klxq1gtar6dpczcjqgat4q
>
> I need to think about this more? Something AOP - advice for
> wmgr.saveComment?
> Its too bad there isn't any easy way to do this with the existing plugin
> API! I don't really want to patch Roller code to accomplish this.

Yes, we really need an WeblogEntryListener (with optional voting) type
plugin interface.

You might be able to do this now by plugging in your own
WeblogEntryManager. Extend the existing one, override the methods you
need and plugin yours via Guice.


> Also, a plugins directory on the new Confluence Wiki would be great:
> http://cwiki.apache.org/confluence/display/ROLLER

Yes, I'd like to see that too.

- Dave