Developer Tips March 2008 (html)
Developer Tips Template


March/2008

 In This Issue

Newsletter archive available here.


 
 INTRODUCTION
by Jess Stratton 

The snow is (sort of) on the ground, I'm still (sort of) sick, and the days are (not quite as) short. Yup, it's March all right! That weird month when the weather (sort of) stabilizes and it's (almost) time for warmer weather.

In this episode of the Developer Tips newsletter (I think I have podcast envy here. If they get to call it an 'episode', so do I!), my cohort Tom and I have gone back to basics, and we put the Tip back in the Developer Tips!

Tom writes about some hidden formula language gems that he found out about at a Lotusphere session. I can't BELIEVE I didn't know about some of these. I need to play Help File Roulette again. (Open up the Designer Help file, and put it on the Index view, where every entry is listed, and ready for your Quicksearch. Take a superball. Bounce it on your keyboard. The first entry that pops up from the superball quicksearch is the one you read and learn about. Hopefully it's a new one, but hey, that's why I call it roulette!)

He then reviews Head First Javascript, which, refreshingly, is a tutorial book, not a reference manual. Apparently it's a rather entertaining read, too!

As for myself, I cover "From the mailbag", in which I answer a reader question about auto-indenting LotusScript, and then "From the LUG blog" in which I answer a reader question about categorized views, and those pesky non-categorized fields.

That's a lot of "from the's". I have no idea how that happened. Next month, Help File Roulette!

Alternatively, you can save yourself and just send us your most pressing question. I (Jess) can be reached at jess.42@gmail.com, and Tom "Duffbert" Duff can be reached at duffbert@gmail.com.

Return to Top
 
SPONSORED BY SHERPA SOFTWARE
  


Easily Search Content in .NSF Files, IM Logs and Common Files with Discovery Attender!

Discovery Attender is an e-discovery tool that automates investigative tasks in .NSF files, IM logs and common file storage areas (.doc, .xls, .pdf, etc.). Discovery Attender enables IT and Legal teams to immediately access content and efficiently search, locate and review data for document discovery requests.

Download now!

Return to Top
 
  FROM LOTUSUSERGROUP.ORG
  

CHRIS MILLER ARTICLE ON MONITORING AND REPORTING

Leading speaker, author, and Lotus Administration expert, Chris Miller of Connectria, is providing LotusUserGroup.org with a 3-part article on server monitoring and reporting. In Part 1, Chris discusses what needs to be monitored and detailed with step-by-step instructions on setting alerts (including a sample instant alert that monitors the Domino Directory for any ACL changes and notifies all the domain administrators). Each part of this 3-part article is an article within itself. Check out part one.

LIVE FROM BOSTON

ADMIN2008 and Lotus Developer 2008 are two of the most critical events of the year for the Lotus IT professional community and LotusUserGroup.org is bringing these events to our members along with some activities, contests, and fun. Whether you're going to Boston for these events or only wishing you were, LotusUserGroup.org has special features for you to participate in. Check it all out.

Look for features like podcast interviews recorded live from the conferences (2 Minutes With the Gurus, 2 Minutes With Lotus, 2 Minutes With our Members), Blogging From Boston, contests, and more.

Going to Boston for the conferences? Sign up to be interviewed as part of our "2 Minutes With our Members" podcast interviews. To sign up, just email us.

Not going? Check out "Live from Boston" to see new features we'll be adding, reports of what's going on, contests for non-attendees, and more.

MISSED OUR LAST VIRTUAL USER GROUP MEETING? DOWNLOAD THE PRESENTATION TODAY

What's a Virtual User Group Meeting? Think about all the things that a live user group meeting contains — a presentation, some time for networking and questions, and perhaps a snack. Well, we can't vouch for the snack, but we are providing the presentation and the networking. LotusUserGroup.org's Virtual User Group meetings include a Webcast presentation and a moderated topic forum/chat.

Our latest online meeting was held on February 11th and included a presentation from Rob Axelrod on archiving best practices. Rob discussed how to reconcile the user's business needs for expanded mail file sizes with your disk management needs and most importantly with your corporate document management needs. Rob detailed tools and methods for analysis of your systems and methodologies for managing the massive amounts of email data that reside in our environments. Check out the recorded version of the presentation and uncover proven best practices for where to put data (local vs. server), setting up and managing archiving rules, and controlling the end-user environment. You'll also get tips for managing and troubleshooting policies and learn how archiving affects server performance, the impact of local archiving, and more.

The presentation is free, just visit the LotusUserGroup.org web site!

The Virtual User Group Meeting and the recorded presentation are made possible by Sherpa Software, leading providers of world-class products that address archiving, compliance, email management & e-discovery requirements. Please show support for our sponsor by visiting their web site.

EXPERT MODERATED TOPIC FORUM

Don't miss our weeklong, expert moderated topic forum, "Managing Certificates, IDs, and Keys," moderated by Rob Axelrod of Technotics, Inc. Each week we present a different topic, moderated by a world-class expert on the subject matter. The forums let you get assistance, share your own expertise, collaborate with your peers, and provide feedback to the community.

During the week of March 10 — 14, join Rob Axelrod in this expert moderated topic forum on how to optimize the administration of IDs, certificates, and keys. Need to know how to properly weigh the risks and advantages of PKI? Not certain if it is crucial to use the certificate authority and set up password/ID recovery? Discovered some certifiers that have been compromised over time and want to know how to deal with it? Here's a tip: ask Rob to tell you how the inner workings of certificate and ID architecture are crucial to ensure that your Domino environment is able to stand up to Sarbanes-Oxley and other audit requirements. Join in, share your thoughts, and ask your questions.

The forum is made possible this week by PistolStar, Inc. — Strengthening Authentication to Adapt to Changing Circumstances

FOUR NEW CASE STUDIES POSTED

This month, Lotus sends new case studies on four companies that have implemented an array of IBM solutions. You can use these case studies, and the past case studies IBM has provided us, to get ideas for your own environment and applications or to support your company's use of Lotus software products.

The four latest case studies include Duke Medicine, a world-class academic and health care system; Tri-Search, providers of online services to legal practitioners; Healthways, Inc, one of the nation's fastest growing healthcare companies; and Zobrist Consulting Group, a small firm that specializes in building Internet applications for entrepreneurs running business-to-consumer (B2C) and business-to-business (B2B) Web sites in industries as diverse as retail, insurance, distribution and manufacturing.

Check out the full case studies for these four companies and for all our past case studies at our Case Studies Page.

FREE DOWNLOAD: THE VIEW TECHNICAL SOLUTIONS SUPPLEMENT 2008

THE VIEW Technical Solutions Supplement is a widely read compilation of articles from leading Lotus solutions and service providers. It serves as a communication platform that allows you to hear directly from the source about offerings that can enhance the Lotus environment, and about the successful deployments of these offerings at customer sites. This year the publication includes 3 bonus articles from The Sphere technical journal. The 2008 issue saw its debut at Lotusphere 2008 and mails to THE VIEW Subscribers in March but LotusUserGroup.org members can download it now.

Return to Top
 
 SPONSORED BY Admin2008 and Lotus Developer2008
  
together with

April 30 — May 2, Boston, MA

Make Plans Now and Save Up to $300.

Reserve your seat and be a part of the expert-led training event focused on Notes/Domino administration and development. No marketing, no fluff. Just in-depth technical training that you can put to use on the job right away! One registration gets you into THE VIEW's ninth annual Admin2008 and Lotus Developer2008. Plus, you have the option to attend the Lotus Notes and Domino 8 Upgrade and Development Seminars featured as dedicated tracks — all included with your registration!

Learn more and register by March 28th, 2008 to save $300 at Admin2008 or LotusDeveloper2008

Return to Top
 
 FINDING HIDDEN GEMS THAT WERE ALREADY THERE
by Thomas "Duffbert" Duff 

One of the sessions at Lotusphere that impacted me was delivered by Rocky Oliver (specifically, Formula Follies and LotusScript Lunacy: Coding Feats that Will Amaze!!) In there, he talked about how quite often the long term Lotus Developers get into habits about what they use in the way of commands, methods, and properties. Then when something new comes out, it either escapes their notice or they don't incorporate it into their regular workflow.

I hate it when he uses me as an example...

So, after a few moments of embarrassed self-reflection, I set out to scan the help file and see what things I might be missing that would make my life significantly easier as a coder. And yes, I found one or two... dozen.

Here are the items that I've now started using on a regular basis...

  • @ConfigFile — How often have I gone through some convoluted technique to try and find out exactly where the Notes.ini file is located, knowing full well that it wouldn't take much to break my code? I've now switched to @ConfigFile. Full path, one command, no brainer. And people following behind me are probably grateful for that.


  • @DocFields — At first, I thought this sounded nice, but I wasn't sure why or when I'd want to use it. That is, until I looked at the example:
    This example, when used in the postopen event of a form, enables the user to choose a field to alter from a list of the fields on the form then provide a value to put into the chosen field.
    Field fieldtochange := @Prompt([OkCancelEditCombo]; "Edit Fields"; "Please select the field you want to edit."; ""; @DocFields); @SetField(fieldtochange;(@Prompt([OkCancelEdit]; "New Value"; "Please enter a new value.";"") )

Whoa! A completely portable routine to allow an administrator to fix a field in a document! I like it...

  • UniversalID — This is a property of the NotesDocument class. I know it's used to store the Document ID, but I was under the impression it was a "read-only" property. Learning that it was read/write allowed me to pull off a great hack this week when someone needed a function that would allow them to reset the document ID of a document when they pasted it from test to production. I won't go into the details as to why, but having this makes them feel like they've found the Holy Grail.


  • @ToTime — This is one Rock specifically pointed out in code, and I felt like a real dip when he showed it. No more @TextToTime(@Text(somefield)) to get something into a real date/time format. This @command is probably my new best friend.


  • @Trim(@ThisValue) — This is sort of a combination command that was brought out in a session done by Julian Robichaux and Andre Guirard. You can drop this into any Field Translation event and avoid those pesky problems with users putting line feeds after their dates or text fields. This has now become standard operating procedure for my applications moving forward...

This just barely scratches the surface of things I probably should know but haven't gotten into the habit of using. I keep telling myself I should read through the help file once a month just to keep all the commands refresh. I may not remember them right off, but there's always that small voice in the back of your mind that says "didn't I see something like that somewhere?"

So what are *your* favorite "commands I never remember to use?" Drop me an email and we'll compare notes...

Return to Top
 
 FROM THE MAILBAG — AUTO INDENTING CODE
by Jess Stratton 

As I mentioned last month, I was honored to be asked to participate in Speedgeeking at Lotusphere. (You can download my presentation here.)

The five-minute presentation (delivered 12 times in a row) was, "Developer Tips You (May) Already Know About, But It's Good to be Reminded of Every Once in a While".

This was mostly a compendium of tips I've already done in previous Developer Tips articles, so if you want a "best of", definitely download the PDF file. Hey, you know it will only take five minutes!

One of the tips was a feature to deselect "Auto-Indent LotusScript" in the Programmer's Pane options (right-click anywhere in the programming window to bring up this dialog). Deselecting this option means your Designer client will no longer indent code, such as If...then...else loops. However, you gain the ability to mass-indent entire blocks of code by selecting all the code and hitting the tab key.

Without that field deselected, I'm sure we've all been there to see what happens. You highlight all your code, hit the tab key expecting it to mass-indent, and it disappears because all you've done is replaced your code with a tab! OH the tabmanity!! Quick, Quick, Control-Z! Control-Z! Undo! Undo!

A reader asked the following great question:

"I am wondering why you would want to turn it off in the first place. I have never tried to mass indent my code. What's the benefit?"

I find the decision to turn that off comes down to two things. Coding style and analability. (believe it or not, that word shows up in THREE whole Google results. Well, four once this is published.)

Let's start with coding style. I do not code without afterthoughts that occur from time to time. I wish I thought of them while I was writing something, but it just doesn't happen that way. Or, debugging, I'll find a problem I didn't notice before (hence, the afterthought). "I can't execute any of this code until I first test this field value." I then need to wrap my entire block of code with an IF test.

This brings me to my analability factor. I have this new IF wrapper around my code, and nothing else is indented deeper in between it, making it hard to quickly see the IF statement, because now it is not nested.

I could tab each line individually, and that's what I'll have to do if auto-indent is not deselected. However, now, I can highlight everything in between the IF, and hit the tab key to mass-indent the entire code block.

To sum up, it's really all about coding style. I don't write code in a linear fashion, I'd much rather keep things straight in my head by manually indenting my own code as I nest it.

What's your coding style? Do you indent your own code? Have you ever lost code by hitting the tab key and watching it disappear? Have you ever tried turning off auto-indent, used it for awhile, and then turned it back on, saying, "Pfef, if I wanted to do manual finger labor I'd rake my yard with my pinkie"...?

Let me know!

Return to Top
 
 REVIEWING THE BOOKSHELF — HEAD FIRST JAVASCRIPT
by Thomas "Duffbert" Duff 

Head First JavaScript
Michael Morrison
615 pages
O'Reilly
ISBN: 978-0-596-52774-7

It used to be that when you were a Notes developer, you could pretty much ignore web stuff if you wanted to. Not anymore. At the very least, you need to have a solid basic understanding of HTML and JavaScript. To help out with the JavaScript end of things, I'd like to recommend Head First JavaScript, by Michael Morrison. If you've ever read a Head First title, you'll know what I mean when I say this is one of the most entertaining and easy ways to acquire a new skill set.

Table of Contents:

Intro

  1. The Interactive Web: Reacting to the Virtual World
  2. Storing Data: Everything Has Its Place
  3. Exploring The Client: Browser Spelunking
  4. Decision Making: If There's a Fork in the Road, Take It
  5. Looping: At the Risk of Repeating Myself
  6. Functions: Reduce, Reuse, Recycle
  7. Forms and Validation: Getting the User to Tell All
  8. Wrangling the Page: Slicing and Dicing HTML with the DOM
  9. Creating Custom Objects: Objects as Frankendata
  10. Kill Bugs Dead: Good Scripts Gone Wrong
  11. Dynamic Data: Touchy-Feely Web Applications

Index

For starters, you should think of this as a tutorial book, not a long-term reference volume. While you're going to be reviewing certain sections repeatedly as you gain experience with the code and techniques, you won't find an exhaustive list of parameters for each type of JavaScript object. There are plenty of other VERY large books that will give you all that information. But as a tutorial guide that gives people of all skill levels a chance at success, this book is excellent.

Chapters 1 through 6 give you a solid foundation as to the syntax and usage of the basic language features and constructs. You'll cover looping, operators, variables, and all the other core information you need to know to write a JavaScript program. But unlike other guides and tutorials that can be rather dry, the Head First method has you involving all your senses as you work with the material... puzzles, questions, off-beat diagrams, you name it. You could almost read it as a non-fiction book for entertainment, and learn the material in spite of yourself.

For me, chapters 7 through the end were the most valuable. I have the core JavaScript syntax down, but I often don't intuitively sense what I can do or how I can manipulate a document with it. Chapter 7 shows you how you can validate a form using JavaScript. Think of this as your JavaScript replacement for QuerySave LotusScript or Field Validation @command logic. Chapter 8 is probably where you'll finally figure out how to make those web pages do things that shouldn't be possible. You'll learn how to parse the Document Object Model (DOM - not to be confused with the Domino Object Model) and make decisions on what should or shouldn't be changed on a page based on what's actually on the screen. Add to that a chapter that shows some good techniques for debugging, and you have a book that should be useful to the vast majority of Domino developers who came from the client world and still have to work at the web stuff.

It's true that you'll have to "adapt" some of this information to the Domino Designer client. For instance, you'll be able to put functions in numerous places (pass-thru HTML on the page, the JavaScript events, etc.), and it might take you awhile to figure out the best place to locate your code. But ultimately, it's still all JavaScript code, and the key is being able to know what it can do for you and how to write it.

So, if you're chomping at the bit to start working with Ajax in your Domino applications but the JavaScript part is slowing you down, grab this book. Or even if you're just looking to build a web-only Domino application that doesn't rely on using Notes constructs for logic, this book will give you the knowledge you need to make that happen. Either way, getting a copy of Head First JavaScript will open up your programming world to a number of new possibilities...

Return to Top
 
 FROM THE LUG GROUP BLOG — TRAINING AND CATEGORIZED VIEWS
by Jess Stratton 

I'm not training the views to categorize themselves. That would put me out of a job, silly. Two questions have come up recently on the LotusUsergroup.org group blog.

For the first question, I'm going to paraphrase. A view has a categorized field. Sounds OK, right? However, here's the inevitable plot twist; the field is not required, and what's visible in the view is that ugly "NOT CATEGORIZED" flag that stands out like a sore thumb in the eyes of us perfectionists. Why not just put an "Eat at Joe's" blinking neon sign while you're at it?

The question was, how could he exclude these documents from the view?

The first answer by Don McNally, was the one he used:

"Include field!="" in your selection formula where field is the name of the categorized field."

I added an afterthought (there's those darn afterthoughts again) in case you DO want those docs to show up in the view, just not with that ugly phrase 'NOT CATEGORIZED.' Just use a simple column formula. Don't forget, you're not actually changing or setting a field value, you are simply placing the view column on 'manual override' telling it what to display.

Set your view column formula to say something like:
@If(fieldname!="";fieldname;"To Be Announced")

If the fieldname is populated, it will categorize as normal. But you can include a "catchall" category for all the ones that the field is left blank.

Sound off with your suggestions/additions/questions here.

Paul Calhoun needs your feedback! First he wants to know why there's more admin training attendance versus developer training. I've sounded off as to why *I* think this is the case, let's hear it from you!

Read more here.

Finally, Paul once again is asking for some opinions from developers. If you DID attend specific training, what would you be looking for? Help him out here.

Don't forget - this is YOUR blog! Post your questions, suggestions, cool tips, and more! Or, send questions or good jokes to jess.42@gmail.com!


Return to Top
 
MEMBERSHIP AND SITE INFORMATION
 

This newsletter is a benefit of membership in LotusUserGroup.org. This newsletter mails monthly. If you wish to subscribe and you are not a member, go here for your free membership and to subscribe. If you are already a member and wish to subscribe, log in at Manage My Account and update your profile to include the newsletter.

Let us know what we can do to help you achieve your goals. Send us email or Contact us from the home page at: http://www.lotususergroup.org.

Want to sponsor the Developer Tips Newsletter?
Contact our Partner Relations Department or call 1-781-751-8734.





Site hosted by


Copyright © Wellesley Information Services and LotusUserGroup. All rights reserved. Email: usergroupinfo@lotususergroup.org
LotusUserGroup, 20 Carematrix Drive, Dedham, MA 02026, USA.
Sales and Customer Service: 1.781.751.8755