jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Burch <Br...@PingToo.com>
Subject Re: Photo Collection plugin
Date Sat, 07 Aug 2010 16:07:52 GMT
On 03/08/10 06:00, Fritz Schneider wrote:
> I'm trying to set up a wiki for my Church at http://www.peacham.com/ccla in
> order to organize the collections of pictures that people have. I am running
> JSP Wiki 2.8.3 under Tomcat under Windows/XP. Since we are trying to
> organize photographs and scanned documents, I found the Photo Collection
> Plugin to be extremely valuable.
>
> I had some problems with installation, but, being a newbie, I wanted to run
> my solutions past the list before I update the wiki pages.
>
> 1.       The wiki documentation for thumbs refers to
> "jspwiki.default.thumbspath" and "jspwiki.default.thumbspfx", but the first
> qualifier should be "photoCollection".

Oops! It is just as you said, so the plugin documentation was wrong. I 
have now updated it on the jspwiki site. Thanks!

> 2.       When editing Header.jsp  you need to also define the taglib. I
> ended up extracting photocollection.tld  from photocollection.jar and
> putting it in \Tomcat\webapps\ccla\WEB-INF so I could reference it:
>   <%@ taglib uri="/WEB-INF/photocollection.tld" prefix="photo" %>

No, I think this is not necessary. The handling of taglibs is quite 
idiosyncratic and I spent a long time reading specifications and doing 
experiments before I got it working properly. Then I forgot everything 
and so had to research it all again to answer you with any degree of 
confidence!

The photocollection.jar contains a META-INF directory. The 
META-INF/MANIFEST.MF file contains several extra attributes that define 
my taglib class. In particular...

Name: com/pingtoo/jspwiki/tags/PhotoPageNameTag.class

.. causes my class (using the correct java package within the jar) to be 
searched for tags.

The only detail I'm hazy about is this - my instructions to make your 
own Header.jsp say to update with this line:

   <div class="pagename"><photo:PhotoPageName /></div>

... so how does the servlet container know it should call 
PhotoPageNameTag.doWikiStartTag() ???

I currently have a debugger break point stopped at my code, so I know 
the method really is invoked (after all, the page name is definitely 
prettified on my own wiki). I suspect there is a simple naming 
convention at work, i.e. code photo:PhotoPageName to invoke 
PhotoPageNameTag.

Of course, this doesn't matter to you. I still think you did not need to 
update the taglib uri in Header.jsp to make the tag work - the class 
should be loaded from within the jar. In other words, your unpacked 
/WEB-INF/photocollection.tld is not being used.

However, while looking at the code I saw some embarrassing TODO 
comments. In particular, it hard-codes the photo collection base as 
"FilesPictures" and replaces it with the alias "Photos" in the visible 
page title. I need to sort that out soon, because it probably isn't 
working for you!

> I notice that my thumbs directory shows up as a link on my photo collection
> page. Is there some way to suppress this?

Yes, I can see what you mean on your page:

http://www.peacham.com/ccla/Wiki.jsp?page=FilesPicturesInstallation1-Preparation

I've checked the following:

a) the first picture on the page really is a thumbnail, so your thumbs 
path navigation properties appear to be correct.
b) when I click on the thumbnail image, I get a higher resolution 
version of the image, so the image path navigation seems OK too.
c) the current page source is trivial - just the plugin invocation 
automatically generated by my code, i.e.
[{INSERT PhotoCollectionPlugin photodir='/installation/1-Preparation'}]

I looked at my own photo wiki and noticed that it is generating the 
equivalent of:
[{INSERT PhotoCollectionPlugin photodir='installation/1-Preparation'}]
... so why don't you try manually editing that individual existing page 
to remove your leading forward_slash and see what happens? If it works, 
you need to review the values you coded in your properties.

If not, we need to review all your properties... could you tell me 
exactly what you have coded, and also the absolute paths to both the 
image and the corresponding thumbnail.

Your symptoms imply that the plugin is finding a subdirectory containing 
images whose name does not EXACTLY correspond to the name of the 
indicated thumbnail directory. Perhaps you have multiple thumbnail 
subdirectories? If not, perhaps there is confusion because tomcat, java, 
jspwiki and my plugin all expect case-sensitive urls and paths, but 
windows paths are case-insensitive?

Regards,

Brian



Mime
View raw message