Err... What? A WikiPage is simply a page on a Wiki. It has nothing to do with user authentication. --JanneJalkanen
Yes, need to be careful with terminology here. This belongs to something like WikiPageAuthenticator. This is an offshoot of the JSPWiki Authentication discussion, were I mentioned the possibility of having an Authenticator object that reads a custom WikiPage for user info. (I'm not totally convinced yet that it's a good idea, actually.) In any case, I'd suggest that the table structure is unnecessary. KISS. --ebu
This is an example of how a user page can look like:
Name | Before @ | After @ |
---|---|---|
Morten Andersen | mortena | mip.sdu.dk |
The information can then be picked up by a method, that takes the table headings and uses them as the keys to a mapping:
/**Reads in table number=tableNumber on page=wikiPage.*/ public Collection readInTable(String wikiPage, int tableNumber){
- Read in the names of the headings: ("Name", "Before @", "After @")
- For each row in the table make a map with a key for each of the heading names.
- Add the value of the coloumn in the row to the map.
- Add the map to a collection.
- return the collection of Maps.
}
One map would look like this:
Key: | Name | Before @ | After @ |
---|---|---|---|
Value: | Morten Andersen | mortena | mip.sdu.dk |
The method could be used for all types of applications (EmailGenerator etc.), and it would be independend of how the coloumns were arranged.