The quick solution would probably be for you to extend PageNameTag to provide your own prettification routine, if the page name appears to be a part of your photo collection. Then you can use your own tag in the template, or you can replace the regular PageNameTag by editing jspwiki.tld.

And hey, that's why this list is for - no large software project can be grasped easily, so it's good to have a place where you can ask stuff ;-)

/Janne

On 8 Apr 2009, at 19:25, Brian Burch wrote:

I am still working on my new PhotoCollection plugin. Thanks to Janne's previous help, I have an ugly version working and am trying to improve its appearance before making it generally available.

Because my design accesses an external directory tree (and might access more than one in a future version), I need to generate wiki page names that are very likely to be unique, which means they tend to be a bit long-winded because they carry a lot of the file system path,

e.g. FilesPictures2008_04-franceDSCF1234.JPG

One of the most valuable features of my plugin is that users can add text information to each directory and image, but even if they add nothing the page titles will automatically provide valuable search criteria, e.g. what photos did I take in my several visits to France?

My plugin already has the logic to generate these "probably unique" wiki page names, but it also creates "human friendly" titles for the pages, which are not intended to be unique at all,

e.g. Photos 2008 04-france DSCF1234.JPG

I've been trying hard to follow the jspWiki execution sequence starting from Edit.jsp and referring to JSPWikiForDummies. I can see how it achieves something similar to what I want to do....

<meta name="wikiEditUrl" content='/Edit.jsp?page=JSPWikiForDummies' />

and

<div class="pagename">JSP Wiki For Dummies</div>

This is controlled by the jspwiki.properties value for jspwiki.breakTitleWithSpaces, but I want to use my own logic rather than this "standard" mapping.

I have a (more-or-less) camelcase wiki page name and I want to assign a different (human-friendly, non-unique) page title when creating the new page.

My plugin running under the "parent page" generates the appropriate wiki text of the "child" page plugin and inserts it into the url via the _editedtext (undocumented) servlet parameter.

When the new "child" wiki page is saved, my plugin generates its own friendly title.

1. I could store the friendly title as a page variable, e.g. called friendlyPageName.

2. I could clone Header.jsp to create my own localheader.jsp, but substitute the line:

 <div class="pagename"><wiki:PageName /></div>

with something like this:

<div class="pagename"><wiki:Variable var="friendlyPageName" default="pagename" /></div>

The intention is to allow the normal breakTitleWithSpaces behaviour to occur with any page that does not embed this particular plugin. Would this solution work, or have I overlooked something important?

Can anyone save me some time with an opinion? I'll get there in the end, but jspWiki is so complex that it takes me ages to grasp how even quite simple things happen (sorry!).

Brian

Reply via email to