Weblog by month (April 2006)
Little and often
The new mantra for DominoWiki! I’ve put in a fair bit of work, and received a number of excellent contributions from the community: I think it’s nigh time a release was made, rather than hanging out for a whole load of tweaks, fixes and features that, frankly, are going to take me a while at the current rate. So, what say you? This is what I am proposing:
Version 1.1 will comprise a few bug fixes. It will include fixed MIME types for all resource documents (CSS, Javascript, XML, and so on). The basic versioning functionality is fixed (no lost content!), but page diffs and a user interface for promoting / demoting versions is coming in a future version. Thanks to Matt White some of this code is already in place.
What else for now though? Well, duplicate categories and disappearing checkboxes are sorted (I think). You really can’t create pages with no title. You can do some basic wiki mark-up to produce tables in your content (thanks to Ralf Lutter!). Attachment names are properly URL-encoded throughout the application. The current version is displayed on the front page. You can easily view uncategorised pages
Another new thing is internationalisation: DominoWiki does the multi-lingual web interface thing in the same way as domBulletin—or at least it will do. You can see now how the implementation is going to pan out, but the work isn’t complete in 1.1, so no need for translators yet!
Patterns and Domino
For his inaugural SnTT post, IBM-er Per Henrik Lausten has posted a splendid round-up of a number of resources out there for systems architects and developers. Architectural patterns and Domino looks at how one can apply patterns for e-business to Domino, with plenty of links for combining the best of Domino and Websphere, redbooks, and so on and so forth. Well worth a look.
Show ’n’ tell VIII: string lengths & Java
Whilst clearing out my “to post” folder, I found this snippet, and figured it to be an ideal candidate for SnTT. Hopefully some follicles will be saved as a result of this posting.
As the actress said to the bishop, it’s all about length. String lengths to be precise. If you’re extracting text from a field, there’s a cut-off in Notes, both in Lotusscript and in Java. You may find that some limits are documented in Domino Designer Help (indeed, for all I know, this specific tip could be in the help too, but a cursory check just now drew a blank). Put bluntly, there’s a right way and a wrong way to extract the complete content of a field full of text in excess of 32KB - 64KB. Here’s how you do it:
// Won't work; cuts off String thisBreaks = doc.getItemValueString(SOME_FIELD_NAME); // Complete String, even if > 64KB Item itm = doc.getFirstItem(SOME_FIELD_NAME); String thisWorks = itm.getValueString();
Useful? I should cocoa!
Note: for tips on strings in Lotusscript, search Designer help for a document entitled Limits on string data representation in LotusScript.
Subversion screencast
Ooh, I haven’t mentioned Subversion for ages! So now I will. Mike Zornek has produced a very slick, very instructive overview of Subversion on OSX, covering installation right through to use, introducing key concepts of version control along the way. Non-Mac users will find this interesting too (and who knows, maybe they’ll see the light to boot!)
Via The Unofficial Apple Weblog.
Passed
Last week I took some of those new-fangled ND6.x certification exams, seeing as how I was so slack as to let my PCLP in releases 4 and 5 lapse. Well, I took the third and final exam this morning, by way of light relief from the day job. This was exam 612, which focuses on web development with Domino.
I must confess, my revision was limited to ten minutes going through file protection documents, setting up SSL on Domino boxes... stuff like that But hey, I should know this stuff, I’ve been doing it long enough! Anyway, as the subject line suggests, I managed to get through it, so my CLP status is definitely back. What I still don’t know is how my having already passed exam 273 jives with the ND6 certifications. I guess I’m a PCLP too... who knows?
Either way, I was pleasantly surprised to receive an email from IBM this afternoon containing the certificate for passing last week’s exams—quick work!
Show ’n’ tell VII: automated printing
I am going to move on from the self-pitying posts now. Dark days behind me, dark days ahead. So, I shall seek solace in code on t’website
For today the “t” in “SnTT” will be for Tuesday rather than Thursday. Do not fret! I am in the red when it comes to my SnTT posts, so another will be forthcoming on the proper day. Today’s post is a simple one, but something that needs some attention. Every now and again, I receive an email or a post about the Holy Grail in Notes client programming: the manipulation of print settings. Back in the r4.x days, I used to use the technique I outline in my old article, Automate printer settings (Landscape or Portrait sir?). However, with Win2000 / WinXP, and the more recent releases of Notes, this is a non-starter. The code uses an old Win32 API call which doesn’t fly nowadays.
So, how to address the thorny issue of dialog box manipulation in modern times? Notes still has a number of omissions when it comes to this sort of thing—especially when it comes to printing—so it’s down to hackers like you and I. Here’s the solution I use nowadays, but beware: I don’t actually like writing code like this. It’s pretty brittle, and there’s a lot of overhead in testing. Where you know your client base, i.e. the operating system and Notes client version, the risk is manageable. Where you’re releasing code for a wider audience, well, just take care.
We go back to our old friend, SendKeys, only this time, rather than using the old library highlighted in the afore-linked article, we use the Windows Shell Extension (WSE). By way of an example, here is some code that invokes a print dialog in Notes, and then manipulates it to print the current document in landscape, rather than portrait, mode:
Dim WshShell As Variant
Dim i As Integer
Set WshShell = CreateObject("WScript.Shell")
' // Print (CTRL-P)
WshShell.SendKeys "^p"
' // Tab round 13 times to the "Page Setup" tab (!)
For i = 0 To 12
WshShell.SendKeys "{TAB}"
Next i
' // Select the "Page Setup" tab (RIGHT ARROW KEY)
WshShell.SendKeys "{RIGHT}"
' // Select "Landscape" (ALT-A) & then OK to print
WshShell.SendKeys "%a"
WshShell.SendKeys "{ENTER}"
As you can see, we are issuing specific keystrokes, and it’s for that reason I regard the code as being somewhat less than robust—you just don’t know how the dialog is going to change from workstation to workstation—the code above works flawlessly on my WinXP machine running Notes 6.5.2, but your mileage may well vary. The technique is still useful, and using WSE is certainly far less verbose than the SendKeys libraries of yore!
For more on the WSShell object, google around: there are stacks of posts out there. If you do a lot of Lotusscript calls to Win32 APIs you should check it out. For example, registry tweaks are far simpler via the WSE.
Apologies
Dealing with a number of recent comment spam attacks whilst in a considerably frazzled state of mind (no thanks to bloody work!) has finally bit me on the bum: I deleted my last weblog post! For the first time in four years! Doh!
Sorry about that. For what it’s worth, it was nothing special anyway. I just cannot be bothered to reconstruct it, so if I’ve broken a cardinal rule of permanent URLs / weblogging / whatever, please forgive me!
Returning to the site—specifically dealing with these dumb-arse attacks—I started a re-design a long time back. But I also have the next version of DominoWiki on the stove too. And stacks of tedious work. And stacks of tedious documentation. And a presentation to write. Oh Lordy... Back to it!
Yet another non-SnTT post
Nathan Freeman, the man who put the NTF in OpenNTF, has finally started getting some new posts out there ;o) His current offering, Fear and Loathing in Lotus Hannover is a doozy, you should go and read it. The man speaks a lot of sense. Simplifying and glorifying the Lotus Notes interface so it’s a genuinely useful and usable thing in Hannover will be the biggest design challenge Lotus have ever faced.
I’m sure they’ll do just fine. Hell, they have to.
Glutton for punishment
Apologies for the recent radio silence, lots going on. With regards this post’s subject line, I truly am a glutton for punishment. On Monday afternoon I flew back home from a week’s holiday with the family. I started back at work yesterday, have a number of appraisal meetings today (yes, it’s that horrible time of the year) and for some reason opted to take two Lotus application development exams this morning. No idea why. My PCLP has lapsed, as it’s R5, and in typical Poole style I neglected to take the ND6 upgrade exam before it expired at the beginning of the year. So, guess who has to sit the whole bally lot again?
So, before embarking on my hols, I scheduled the requisite three exams: 610 (fundamentals), 611 (intermediate) and 612 (web). I took the first two this morning, and the third takes place next week. It’s been almost five years since I last took a prometric exam, so I was somewhat apprehensive, particularly as I didn’t do any preparation beyond reading the exam guide. Tsk! Bad fellow. Still, I passed, and now just the one to go.
Volker recently posted about his ND7 exam, and how his PCLP status was maintained due to “grandfathering”... I wonder if this also happens for ND6? My PCLP status for R5 came about through passing the Advanced Lotusscript exam (273). This exam still appears on the advanced track for ND7 certification, so I assume it still stands for six... anyone know?
Once the appraisals are done, and the rest of this week’s meetings are complete, maybe I’ll actually take the time to study for 612 eh!
Showing & telling about Exceptions
OK, let’s make this a “kinda” Show-n-tell Thursday post. I think this is timely given the current talk around using Java in Domino. Today, a new article popped up in my newsreader from the java.net site. It’s a good ’un:
Exception-Handling Antipatterns.
It took a while for me to get my head around exceptions. In fact, it didn’t really all click until last summer, when I found myself putting together a reasonably complex application (nothing to do with Domino) in Websphere. I ended up cutting some package-specific Exception classes, and they worked really well once I’d figured out how many I needed and when to throw them. Once you “get” exceptions, you will be amazed at how much cleaner your code is—don’t shy away from coding your own Exception classes if that’s what it takes! There isn’t that much to ’em, honest, and by golly, it’s great using exceptions after having to type out things like On Error Goto ErrHandler...
Going Bedouin
Ah, another old phenomenon is being dressed up as something innovative—nothing new under the sun! However, the article makes some interesting points about modern work ethics, telecommuting, so-called “face-time” etc. Although focused on the software business, the principles espoused can apply to many types of business. Have a read:
Another challenge with implementing a neo-Bedouin approach is in getting people to overcome behavioral inertia. Many people get very used to and comfortable with traditional approaches—to large support staffs, to phones on their desks, to control over all infrastructure details, to large central facilities, etc. Things often get done a certain way because “this is how we always did it” or “this is how everybody else does it”. Some people simply can’t make the transition to a more minimalist approach, and for those who can change, leadership is required.
You don’t have to read very far down the comments to see some chumps getting references to “Web 2.0” in there. Of course, this has nothing to do with Web 2.0, and everything to do with attitudes to work and corporate agility. How does your workplace stack up on this front? Interestingly, whilst my employer is generally very risk-averse, in my area of work we actually have quite a lot of scope re “going Bedouin”. This also seems to be something that IBM has a stake in, judging by what Ed has to say about his work life.
Show ’n’ tell VI: a lesson learned
This week’s tip will be short and sweet.
Don’t start playing with Oracle. That way lies madness.
OK, I’m kidding.
Kind of.
I have to say, for the first time since I started writing this weblog, I’m done in... The last time I felt like this, it was my 27th birthday (there: already you know we’re talking a long time ago). I’d been asked to “code a button” by a partner in my firm. Well, that button ended up being a complete compliance suite built in Lotus Notes. Three databases, fairly sophisticated mailflow and reporting. All built over a solid sixty hour period by yours truly for circulation around 1,100 partners and staff, extending to 7,000 partners and staff over the next few days. All so that we didn’t fall foul of some new SEC rules.
Well, yay me. It worked. If I ever hear “proper” developers diss “corporate developers” again, I’ll kick their arse. I defy anyone to deliver on something like that in the way I did with Notes. Yes, of course I worked my pathetic bottom off, but if it hadn’t been for Notes, I couldn’t have delivered.
There’s your tip for this week, right there.
So, anyway, back to the project. I missed my birthday dinner with my wife, I didn’t see my (then, only) son for two days. It was awful, it took me right back to my years as an auditor, the life I tried to escape. Lesson learned.
Back to the here and now. Well, I have ideas, lots of ideas for stuff to write. They’re all bubbling away. But damn, I’m just too tired to wrap some coherence around these ideas (always a good idea I think). Forgive me. I know I promised more this week.
Another one!
Right on the heels of all the recent announcements about new jobs etc., it looks like we have another contender:
Michael Sampson: A New Mountain to Climb
Who will I be working for? All will become clear ... soon.
Congratulations Michael! I’m starting to feel very left out... ;o)
Boot Camp
You want Domino Designer on the Mac you say?
You got it. And you can do it for free without buggering up your Mac. Apple have released Boot Camp, a public beta of some new technology they will be offering in the next major version of OS X, code-named “Leopard”.
Executive summary: Boot Camp allows an Intel Mac to boot into Windows XP or OS X, without the need to invalidate your warranty!
As Volker says:
I see some Domino developers in the Apple Online Store. :-)
Geeks should read the small print, there’s some clever stuff going on in this. For example, it all works by effectively tricking WinXP into thinking that the Mac is a BIOS-based PC (to get around the EFI issue). Boot Camp facilitates simple partitioning to support the effort, and also provides driver support for stuff like the optical drive eject key, Airport, audio, graphics, etc. Nice work.
Via Volker Weber.
Congratulations to Steve
See, I said there would be others. Heh heh. Congratulations to Steve, a splendid result for all parties. Here’s hoping for yet more interesting weblog entries “from the inside”.
Steve Castledine: New Beginnings....
