You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Christophe Dupriez <ch...@destin.be> on 2008/02/15 09:01:30 UTC

ReferringPagesPlugin+RecentPagesPlugin improvements + Improvements to Plugins deriving from AbstractReferralPlugin

Hi!

I understand I am better to propose contributions here rather than on 
the users list!

So I move my mods from 2.4 to 2.6.1. I would like to underline how easy 
and efficient "WinMerge", open source "compare" program, is for this 
kind of tasks.

New attribute for ReferringPagesPlugin:
   title='Title which appears ONLY if there are referring pages'

New attribute for RecentPagesPlugin:
   referring='Page Name of the page that modified pages must refer'
Very very useful addition to list modified pages signed by a given 
person using [PersonName] or categories like [TODO].

New possibilities for before='string inserted before the link' and 
after='string inserted after'
(those possibilities are available for all plugins derived from 
AbstractReferralPlugin):

1) %p returns the referring page name surrounded with quotes
2) %n is replaced by two end of line: \n\n
3) the resulting after/before string is __repetitively re-interpreted 
for Wiki Markup__.

So, if you want to list the second section of all referring pages, you 
can write:
[{ReferringPagesPlugin before='!!' after='%n[{InsertPage section=2 
page=%p}]%n----%n'}]

This will generate:
!![Referring Page Name 1]
... content of section 2 of the Referring page 1
!![Referring Page Name 2]
... content of section 2 of the Referring page 2
.....

Note: A "section" is a part of a page between horizontal lines (----).

This is very useful if you put (for instance) an abstract of each page 
always in the same section:
you can then list those abstracts near the links to each page...

Look at:
http://www.destin.be/CAFE/Wiki.jsp?page=Case%20111-En%20bien.%20On%20pense%20du%20bien%20du%20texte
(or to any "Cases", starting from
http://www.destin.be/CAFE )

This version also contains the support of patch 100 (in a different way):
1) max=0  to list NO pages (but interprets extra=...)
2) %d   within  extra="%d pages are not listed above"
3) %m   latest modification of the pages

Attached source code is for 2.6.1

I would like to emphazize two points:

1) The source code seems to be moving toward accepting sub-parameters 
within plugins parameters in the form {0}, {1}, etc. It seems to make 
problem with the parser which sees "}" as the end of the plugin call.  
Am I right?

2) %letter could be a nice way to indicate sub-parameter (if the 
community agree) BUT it would have to be normalized for all core plugins 
to ease learning by users.

Hope this helps!

Have a nice day!

Christophe

Re: ReferringPagesPlugin+RecentPagesPlugin improvements + Improvements to Plugins deriving from AbstractReferralPlugin

Posted by Florian Holeczek <fl...@holeczek.de>.
Hi Christophe!

> I understand I am better to propose contributions here rather than
> on the users list!

As far as I know, if you want your contributions to be integrated, the
best (and only?) way to go is creating a JIRA issue and attaching a
patch.

If you're using Eclipse you can easily create one via Team..Create
Patch. I guess there are similar ways in other IDEs, too.

This way, it's not just easier for the committer team to see what the
code does, but they also have your ok to use your contributions under
the Apache License (Check the corresponding box when uploading the
patch!).

Regards,
 Florian