Plugins by Scott Hurlbert

[Note: I wrote this plugin with a lot of youth and innocence (well, ok, I did it on a lark) and now I'm harrowed with fear and wonder. I like the approach mentioned in TodoListsWithoutPlugin better because it's less structured and more wiki friendly so be sure to check it out (although, I'm forced to point out that it does use a plugin! Ha!). In the meantime, please enjoy this plugin if you find it useful, -- Scott Hurlbert]#

TodoEntryPlugin and TodoListPlugin work together to provide a crude way to manage a todo list on the wiki. These plugins are modeled (plagiarized) from Janne's weblog plugin.

These plugins are very much a work in progress. They are very crude. Since the list items are stored as pages, there is no way to delete an item - hey, you get a history for free ;-)

TodoListPlugin syntax:#

[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=UNDONE}]


show (optional)
Default: UNDONE
This determines which tasks are displayed in the task list. Valid values are: UNDONE, DONE, or ALL
undoneicon (optional)
Default: '<img src="attach?page=pic/cb_off.png" />'
"UnDoneIcon" This is the html necessary to display whatever icon you would like in the first column of the list for tasks which are uncompleted. The default attempts to display a small unchecked checkbox icon (an unfilled square) that has been attached to the page 'pic' - as it is on the jspwiki.
This does not work 100% because you use pic as default, but the page is in fact named Pic and JSPWiki seems to be case sensitive. --BorisFolgmann

Thanks Boris, I will fix this right away. I'm (ahem) on a Windows system and didn't catch the case problem. Thanks -- Scott

in version 2.3.92 the syntax is

undoneicon='<img src="/JSPWiki/attach/Pic/cb_off.png" />' 
-- AndrewBroughton
doneicon (optional)
Default: '<img src="attach?page=pic/cb_on.png" />'
"DoneIcon" This is the html necessary to display whatever icon you would like in the first column of the list for tasks which have been completed. The default attempts to display a small checkbox icon (an unfilled square) with a checkmark in the center. It looks for this icon as an attachment to the page 'pic' - as it is on the jspwiki.
This does not work 100% because you use pic as default, but the page is in fact named Pic and JSPWiki seems to be case sensitive. --BorisFolgmann
donetext (optional)
Default: done
This is the text used to determine whether the task has been completed or not. The default is the word, "done" - if a task begins with "done," such as "done: Buy Dog Food," then it will be considered as completed. If the task just says "Buy Dog Food" it will be considered as uncompleted.

When the list is displayed, the icon will point to the edit page link and the text of the task will point to the view page link of the task. This allows you to see the task by clicking the text or quickly edit the task by clicking the icon so you can mark the task as done (or update the description).

Using TodoListPlugin#

Display uncompleted tasks

[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=UNDONE}]

Display completed tasks

[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=DONE}]

Display uncompleted tasks preceded by smiley faces (path removed for brevity)

[{INSERT TodoListPlugin undoneicon='<img src=\"attach?page=pic/smile.png\" />'}]

The attached screenshot, 'TodoSample.jpg,' was created with this content:

[{INSERT com.hurlbert.jspwiki.plugin.TodoEntryPlugin}]

[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=UNDONE}]
!Completed Items
[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=DONE}]


  1. By using the TodoListPlugin again on a task page, you can build something like sub projects in a recursive manner.
  2. To make some todo entries to stand out (e.g. high priority), just begin the page with the todo item with a Wiki headline.

Some possible enhancements (feel free to add others)#

  • Sorting
  • Date display
  • Filtering - for example, show tasks completed in the last two weeks
  • Properties file for icon locations, done text etc? KieronWilkinson
    • Yes, good suggestion. It's difficult to add a new property file because I run several wikis from a single jar. In this configuration, each wiki instance gets passed the location of it's at startup. Adding a second properties file would require sending another parameter or some method for the wiki to locate it's specific .properties file. When operating from a common jar request.getRealPath() does not work. It returns null, so the app has no idea where it's running. This makes getting to a properties file inside the WEB-INF file difficult. (If anyone knows a way around this, please share. I saw some solutions that use resourcebundles, but they looked 'hackish.') However, I will look into adding some properties to the file. Thanks for the idea. Scott
  • Add a listpagename parameter/property so that the todo list could be displayed anywhere, not just on a the parent page. I see this as handy for the completed items. You may not want those hanging out on the same page as your undone tasks. Adding this parameter would allow the plugin to live on any page, but generate it's content based on the 'parent' list page.
  • It would be nice when it would be possible to add the done marker at the end of the task.
  • Perhaps, it could manage more task states (DONE, TODO, IN STUDY, PERCENT_DONE...)

(Hmmm, seems that I'm getting enough ideas here that I'm going to have to get Janne to install the TodoListPlugin on the jspwiki so I can create a todo list to keep track of them. Ha!)

Enjoy - Scott Hurlbert

Oy! Cool stuff, thanks, Scott! --JanneJalkanen
Very cool idea! Thanks! --KieronWilkinson
Thanks alot. Please let me know if you think of any enhancements. - Scott Hurlbert

Seems to me that using the plugin inside a task, as hinted above for recursive entries, doesn't work. I keep getting Exceptions and Server Errors. Maybe it's me though
Here's what I do:

In the main Todo list

[{INSERT TodoEntryPlugin}]

[{INSERT TodoListPlugin show=UNDONE }]
!Completed Items
[{INSERT TodoListPlugin show=DONE}]

In a task entry (ToDo_task_1):

[{INSERT TodoEntryPlugin}]

[{INSERT TodoListPlugin show=UNDONE }]
!Completed Items
[{INSERT TodoListPlugin show=DONE}]

The inner ToDo List works well, and I can create new entries which look like ToDo_task_1_task_1, but a server exception get thrown when I go back to the outer most ToDo List.
I've had two different types of exceptions: ArrayIndexOutOfBoundException and StackOverflowError


Caryl, very interesting. I must admit, I did not fully test the recursive tasks. I setup one and it seemed to work. I'll try it again on my system. It may also be setup sensitive. I'll let you know if I find anything. -- Scott

Q:How to install I put the class files in jspwiki.jar with the directory as com/hurlbert/jspwiki/plugin/
but it didn't work when I using in my todolist page,and I put the class file to WEB-INF/classes,it didn't work too:-(
Could you make a jar file for us?Thank you:)
--Luke Han

Yes, I'll try to clean it up when I build it next time. Can you describe the manner in which it wouldn't work? -- Scott

I reslove it,maybe a wrong package name:) Thanks --Luke Han

  • Copy the file todolist.jar to /WEB-INF/lib.
  • In in, add com.hurlbert.jspwiki.plugin to the searchPath:
    jspwiki.plugin.searchPath = com.hurlbert.jspwiki.plugin
  • Restart your Webserver.

Usage without search path

[{INSERT TodoEntryPlugin}]
[{INSERT TodoListPlugin show=UNDONE }]
!Completed Items
[{INSERT TodoListPlugin show=DONE}]

-- ReinhardEngel
Question: Just how do you mark a task as DONE?
You simply put "done" in front of the task e.g "done Make the coffee" - Chris Harris.
Question: Where are the icons? (They are not in the download and nor in the .jar.)
The icons are attachments to the Pic page of JSPWiki. If you want to use them locally, create a page namend 'Pic' in your wiki, then download the files cd_off.png and cb_on.png to your local machine and attach them to your local Pic page. -- ReinhardEngel


Hope it's not improper etiquette to modify someone else's plugin, but I added a quick hack for sorting to the TodoListPlugin. It's attached to this page as Oops misspelled the filename.

It uses an extra parameter, sort=alpha, which causes the plugin to sort each task by its first line of text in alphabetic order. Also changed default icons attach page to Pic instead of pic.

If I want to move a task to the top of the list I prefix the the first line text with a number, the lower the number, the higher up in the list that task is placed.

Example of using the extra sort parameter:

[{INSERT com.hurlbert.jspwiki.plugin.TodoEntryPlugin}]
[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=UNDONE sort=alpha}]
!Completed Items
[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=DONE sort=alpha}]

- JamesChochlinski

Hey James, I think it's great etiquette and I really appreciate your good work. Thanks! Scott
Hi, well I have been using this plugin for about a year now and have made a couple of tweaks which I thought I would share with you. If you don't feel that they are useful, feel free to ignore them

The first tweak I did was to allow to do lists to be referenced from another page. I did this because we were using it for a Bug tracking list and the number of bugs were causing the loading of the page to slow down. So using this tweak enables us to put all the closed bugs on another page. Basically I added another parameter called pagename . So if you want to see a list of Done to do items on another page simply do the following

[{INSERT com.hurlbert.jspwiki.plugin.TodoListPlugin show=DONE pagename=ToDo }]

The second tweak was to add the last time a page was modified to the end of the To Do name. This enables you to see when you completed that To Do item. In this version it is hard coded but I guess it could be made parameterisable if necessary. I got the idea (and code) for this from the DateModifiedPlugin by Vovan.

They are in this java file you will of course have to compile them yourself ;-)

Hope someone else finds these useful.


The path to attached items seems to have changed slightly. At least in v2.2.33 a path that reads as given below should fix it.
[{INSERT TodoListPlugin undoneicon='<img src=\"attach/Pic/cb_off.png\" />' doneicon='<img src=\"attach/Pic/cb_on.png\" />'}]
-- LeonUrbas

Hi Scott

Like this plugin... will you be continuing with it so that it works when 2.3.x is final?



-- Hi, thanks for the kind comment. I haven't touched this plugin since I wrote it because I found the CalendarListPlugin so useful. However, it sounds like a good idea and I could probably put in a better effort now. Thanks, ScottHurlbert

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
7-146-24.png 1.0 kB 1 11-Jan-2006 12:29
zip 74.0 kB 1 22-Dec-2004 05:44
zip 73.1 kB 1 24-Jan-2004 04:44
zip 2.4 kB 1 04-Feb-2005 00:15 AndrewBroughton
TodoSample.jpg 75.9 kB 1 24-Jan-2004 04:44
todolist.jar 7.5 kB 1 25-Jul-2004 05:18
« This page (revision-69) was last changed on 10-Oct-2010 16:40 by Dirk Frederickx