Vanity Foul
Dedicated to the wanderings of an egotistical mind.


20030303
Monday March 03, 2003

Oh no, there goes Tokyo, go go Greebo

Unless someone objects, I'm likely to Greebotize Roller this week. The only point of objection I see is that the build.xml will have to "bootstrap" the custom task (looks entirely possible, experimentation will tell).
( Mar 03 2003, 03:51:03 PM ) Roller Permalink Comments [4]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/oh_no_there_goes_tokyo

For further reading on today's posts:



20030228
Friday February 28, 2003

Simple JNDI

More Good StuffTM, this time from Henri Yandell, a.k.a. Bayard. Thanks Henri, I think I'll be using this soon!
( Feb 28 2003, 10:36:34 AM ) Technology Permalink
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/simple_jndi

HoneyPot reborn!

DiveIntoMark revived my interest in my own project with this article. Part of what killed my interest was my upgrade to Resin 2.1.5, which broke support for ResponseWrappers (sometime between 2.0.1 and 2.1.5).

For those still curious, HoneyPot is a ServletFilter that performs much the same duties as outlined in the DiveIntoMark article. It still needs considerable work, but Mark's article has inspired me to continue. This time I guess I'll need to write a "Resin-specific" version of the ResponseWrapper, but that is okay.

What particularly perked my interest was the idea of publishing a webservice of bad IP/Referer/UserAgents, for all installations to share. HoneyPot currently writes a list of bad IP's to a text file, but I think I'll make it use Prevayler for persistence (way cooler). And I'll probably use Greebo; I like to have a "real" project to try out new tech.

And HoneyPot could use a better name, because I don't think it is accurate (the original idea was to create some false trails to trap naughty User Agents). I'll take suggestions...
( Feb 28 2003, 10:18:32 AM ) Technology Permalink
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/honeypot_reborn

Maven lite?

Via a comment on Raible Designs, an Ant task for dependancy checking. This would be very nice, something I'll definately want to investigate! ( Feb 28 2003, 10:09:07 AM ) Technology Permalink
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/maven_lite



20030224
Monday February 24, 2003

Entry linking considered harmful

Now Rickard is complaining about being unable to create a entry link (I presume he means permalinks). I looked at his html and he doesn't have any anchor tags, so it's no wonder that it isn't working. I refer you to Andy having the same problem nearly a whole month ago. ( Feb 24 2003, 08:51:10 AM ) Roller Permalink Comments [5]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/entry_linking_considered_harmful



20030223
Sunday February 23, 2003

JXPath success!

I figured out the syntax by adding a UnitTest to BoomarkManager and using trial-and-error:
// folder2 is test data already added to the Prevayler datastore
JXPathContext context = JXPathContext.newContext(bookmarkMgr);
FolderData folder = (FolderData)context.getValue("folders/*[name='TestFolder2']");
assertEquals(folder, folder2);
This successfully looks in the HashMap of folders and finds the one with a name equal to "TestFolder2" and returns that one.
( Feb 23 2003, 01:59:42 PM ) Technology Permalink Comments [1]
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/jxpath_success

Re: Argh, I'm infected!

While I am infected, it hasn't progressed to the point of writing UnitTests first. That is how all the "terminally infected" say it should be done, but I'm one of those people who has to learn lessons the hard way, most times. Whether you're interested or not, I'll post my progress/descent into TDD (TestDrivenDevelopment) as it occurs.
( Feb 23 2003, 09:47:27 AM ) Technology Permalink
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/re_argh_i_m_infected

More on Prevayler

It's hard to describe a code/framework problem in prose, and my last post demonstrates that difficulty splendidly. I'll try for a more detailed description.

It's hard to describe, and once I get further I plan on checking the code into Roller's CVS, but by then it won't exhibit the problems. The issue I had was that each method of my "manager" class was creating its own Prevayler from itself: new Prevayler(this) as Manager is a subclass of AbstractPrevaylerSystem.

In my test classes each test case was calling a method in the Manager. I don't recall the exact error, but it took some puzzling to figure that Manager should just create an instance of Prevayler at instantiation and pass that one instance to each Command. The demo's and articles don't adequately demonstrate how Prevayler and PrevaylerSystem are to be used: the article at developerWorks doesn't even show us the System subclass...

The second problem I ran into will require naming problem code. A method in BookmarkManager named moveFolderContents transfers all bookmarks from Folder A to Folder B. Also in BookmarkManager is a method moveBookmark which just moves one bookmark from its current folder to another. In MoveFolderContentsCommand execute() it seemed obvious to me that I could iterate over the bookmarks in A, calling bookmarkMgr.moveBookmark(bookmark, folderB) which would "delegate" to MoveBookmarkCommand. Again, I don't recall the exact error message (something about the SystemClock I think) but Prevayler didn't like this. I copy-pasted the relevant code from MoveBookmarkCommand into MoveFolderContentsCommand and it worked fine.

One last note, it isn't clear from the Prayler site/articles/demo that "read" operations do/not have to go through a Command as well. I had some trouble early on and made all my read operations Commands. Later I realized this may not be necessary, refactored, and it wasn't necessary.

My next task is to explore using JXPath so that I can do the more complicated "queries" necessary to lookup weblogentries for past dates (and other such "non-id" queries). Stayed tuned for more frustrations and griping...
( Feb 23 2003, 09:42:37 AM ) Technology Permalink
Trackback: http://www.brainopolis.com/roller/trackback/lance/Weblog/more_on_prevayler

For further reading on today's posts:




archives
links