Packaging Velocity
I've made a number of changes to struts-menu this week, and it now supports the ability to render menus via Velocity templates. This allows for easy customization and basically allows for you to create any type of navigation system you want (i.e. drop-downs, tabs, plain ol' links) etc. One of the issues I'm wrestling with is how should I package Velocity with the distribution. Usually, to integrate struts-menu into a Struts-based application, you only need to include struts-menu.jar. Now, if you want to use Velocity for your menus, you must include velocity.jar and velocity-tools.jar in your application's WEB-INF/lib. I think most users will accept this.
However, in the example app, there's a velocity.properties file and a couple example templates. This seems like an opportunity for many users to forget to include these - so I'm wondering what's the best way to package these. Should I put velocity.properties in the source tree, and initialize my VelocityMenuDisplayer using that? Should I do a check to see if the user has their own velocity.properites in WEB-INF/classes for an optional override?
Another question is should I put the sample templates (simple.html and coolmenus.html so far) in the source tree, and then use Velocity to load them from the struts-menu.jar file? Or should I package them in a menu-templates.jar file?
Basically, it all boils down to this question: If you have a project (.jar) that depends on Velocity and plugs into web applications - what is the best way to distribute your Velocity settings?
BTW, I hope to make an effort to decouple this library from Struts someday - shouldn't be too hard.
Posted by Marc Adams on October 03, 2003 at 02:21 AM MDT #
My first piece of advice? Get NetNewsWire for reading blogs (lots of cool options under the View menu). Also, check out these OS X customization tips.
Posted by Matt Raible on October 03, 2003 at 02:47 AM MDT #
Posted by Marc Adams on October 03, 2003 at 03:53 PM MDT #