Vanity Foul
Dedicated to the wanderings of an egotistical mind.


20030120
Monday January 20, 2003

Velocity Rocks

It's the greatest thing since sliced cheese. Or sliced bread (mmmmm, toasted cheese sandwiches...). Okay, maybe that'll balance out my Velocity Sucks post. Jon's subtle prod to keep looking inspired me to checkout the Velocity-tools project, where I found the VelocityViewServlet, which gave me the hint to my solution: the WebappResourceLoader. Additionally this requires the "Velocity Servlet" to set the ServletContext during it's init() or initVelocity(). You can see the PageServlet to see an example of this and other fun manipulating the init parameters. ( Jan 20 2003, 06:25:27 PM ) Technology Permalink [Trackback] [Link]

For further reading on today's posts:



20030119
Sunday January 19, 2003

Bad JSP, Naughty JSP

So now Andy is knocking JSP:

In order to include content from a JSP you must use a dispatcher include. This turns control of the output stream over to the JSP for a turn. There appears to be no way to get the content of the result of a JSP request without actually connecting and submitting a request via HTTPClient or something like this.[Hacking Log 2.0]

I've developed JSP for over 4 years, and I've never run into this need to "go outside" to get the results of a JSP. So far as I've witnessed any dispatcher includes all happen within the servlet container (but I've never used Tomcat 3.x). Andy, can you clarify? (Btw, I can't wait for FreeRoller to get comments so I can just ask you in your own blogspace)
( Jan 19 2003, 02:34:16 PM ) Technology Permalink Comments [5] [Trackback]

On Email Integration

In planning features for Geekblog, Ted raises good issues on the difficulties of implementing "Post via Email". This feature has been requested for Roller as well, and I've put some thought into from time to time, coming to much the same points as Ted. One point I'm not sure he covers clearly is authentication; making sure that the email is genuinely from the owner of the blog. Since email headers are easy enough to fake, going off the From: address isn' enough. But putting a password in the email exposes it in many ways, and increases the complexity of the API: now the user has to put password=mypassword in the body somewhere, and specify the body of the post seperately (entry=blah blah blah). Starting down this slipperly slope leads to all sorts of things that could be specified: post-time(future/past), public/private, category.... For now I'm punting on the whole idea, sadly. ( Jan 19 2003, 09:55:49 AM ) Technology Permalink Comments [2] [Trackback] [Link]



20030118
Saturday January 18, 2003

Velocity sucks

I've been trying for days to get it working as advertised, see Velocity help sought. Of course it doesn't actually suck, but it has been quite frustrating, and I'm surprised at its shortcomings given the adoption it has received from people whose technical skills I've come to respect.

Velocity doesn't allow for overloading macros (more than one macro with the same name but different arguments), and it throws parse exceptions if a macro calls another macro that hasn't been declared yet at parse time. In the latter case it still works, but you'll see errors in the log. Finally, if I try to load a macro library using \#parse("lib.vm") the macros in that file are not visible to the calling template. I've been all through the documentation, many times, but haven't found a setting to fix this (in fact, found some text that implies this is forbidden). I think I understand the technical implications, but damn, this seems like an important bit of functionality.

My particular problem has been getting macros read in at servlet startup time. I've followed the directions, Googled, read the mailing lists, queried the mailing lists, and experimented extensively. No good. The macros themselves are fine, because if I \#parse("roller.vm") in a page Velocity finds and parses it just fine. So it isn't finding the file on startup, but it throws a NullPointerException rather than a ResourceNotFoundException, which is odd. There appears to be no way to get a stacktrace of the error so that I can be sure, and the ResourceManager.getResource() has the exact same exception message in two places so that I can't tell which one is throwing the error (without a stacktrace).

So I'm frustrated. I'm sure Velocity is a fine piece of engineering, but it won't work for me. Argh. It occurred to me in the middle of the night that perhaps bad-mouthing Velocity would get me more help than my (so far) polite requests for assistance.
( Jan 18 2003, 08:28:19 AM ) Technology Permalink Comments [11] [Trackback]

For further reading on today's posts:



20030117
Friday January 17, 2003

Featuritis

Matt likes the proposed feature list from Ted's Geekblog:

Looking at this list of features that GeekBlog plans to add - I can't help but smile. I especially like the following:

Allow posting entries via EMail from weblogauthor

The best part - it's open source, so we *should* be able to copy the feature into Roller.

Someone recently posted an "integration" between HEP and Roller, I believe it provided a mechanism to "post via email". I've got to try it out sometime.

It is a good list, and Roller is well on its way, with several implemented or in the works. Roller also shares some "planned features", comparing the list against our JIRA entries.

And I don't see any reason why Roller and Geekblog couldn't crib code from each other, providing our licenses are compatible. ( Jan 17 2003, 10:47:01 PM ) Roller Permalink [Trackback]



20030116
Thursday January 16, 2003

Velocity help sought

I'm still pretty new to Velocity, and I've run into a problem I cannot solve (yes, I've searched the Velocity archives, read the docs, did a Google search). I've converted all the behaviour from Roller's Macros object into a velocimacro library and made it the "default global" macro library, but Velocity is choking on it:

[info] Velocimacro : initialization starting.
[info] Velocimacro : adding VMs from VM library template : roller.vm
[error] ResourceManager.getResource() exception new: java.lang.NullPointerException
[info] Velocimacro : error using VM library template roller.vm : java.lang.NullPointerException

It looks like it is finding the file alright, but having trouble loading it. I've used the velocidoc and VeloEdit tools on roller.vm, and neither of them have complained... I don't know if the problem is really Velocity, or some "Velocity & Servlets" problem. If you'd like to help and take a look I'd appreciate it.
( Jan 16 2003, 08:40:33 AM ) Roller Permalink Comments [2] [Trackback]

Release Soon?

I think Dave, Matt, and I need to discuss releasing 0.9.7 soon. I've been working on making Roller use Velocity in a "true" manner, Dave has implemented Linkback functionality, and there have been a mess of other changes.

Both Dave and Matt have features they want to work on. I'm thinking we should get something out soon before adding more, but then releases are a lot of work in and of themselves. ( Jan 16 2003, 08:34:01 AM ) Roller Permalink Comments [1] [Trackback] [Link]



20030115
Wednesday January 15, 2003

Hollywood gets what it paid for

Sad, to be expected, but sad. Your entertainment dollars at work. ( Jan 15 2003, 08:34:12 PM ) News Permalink Comments [1] [Trackback]




archives
links