Good idea got hairy

Here’s the setup: product/legal required us to update our terms of service on the site. They delivered the new terms of service in a Word file. Headache #1: manually compare that Word file to the text in our site’s JSP. Note to self: require product/legal to at least show us the diffs. Nothing worse than a Saturday morning spent diff’ing legal text. (No, converting from Word to HTML wasn’t helpful: have you seen the cruft it spits out?)

Headache #2: I realized that the terms of service are also in our store site. To the user, it’s all one site. However, physically, it’s a separate site, separate code repository, and the like. NO way I was diff’ing that legal document twice! (I did mention I was doing this on the weekend, right?) Brilliant Idea #1: refactor the terms page from the main site to use an included file (the text of the terms) that I could share across the two projects. Note that the two sites are built differently: both are done on top of Struts, but one uses JSPs and one uses Velocity. That meant that the syntax for the include would be different (<%@ include versus #include), but then their containing pages would be different, not the text of the terms themselves.

Headache #3: when I brought up the separate sites in my local environment, realized that the terms had URLs embedded in them. In the original site, we used html:rewrite Struts tags. That wasn’t going to work in our Velocity setup (at least, not in a way I recognized, anyway). Also, since the URLs referenced all lived in the one site, the webapp context didn’t have to be taken into account. From the store side, I had to deal with it. Solution: update hte URLs in the store side to use an application level variable for the path. It’s not the best solution, but it’s consistent with how URLs are built in the other areas of the application.

Now the include files are different (unfortunately), but at least the changes should be isolated to the URLs. Now if we need to update the terms again, we can convert back and forth readily for the two sites, at least.