Preface
Boss: I need some web pages up as soon as you can.
Developer: No problem. I'll get you something before lunch.
Creating web pages was fairly straight-forward in the early 1990's. Today, there are many, often competing technologies available for creating a web experience. Remarkably, all these differing technologies and strategies interoperate in a relatively seamless way to serve the billions of people who use the World Wide Web and the Internet.
IBM's Lotus Notes and Domino product set the subject of this book is a feature-rich, application development technology that has been used to create web-enabled applications since the late 1990's. Since then, it has evolved substantially through several major software versions, and it will continue to advance into the foreseeable future, adapting to the changing web landscape and incorporating new technologies and methods as appropriate.
One of the delightful aspects of Domino is its backwards compatibility. With few or no changes, applications written with previous versions of the software, untouched for a decade or more, will run as expected on the newest Domino server.
It is also important to understand that useful applications can be crafted and deployed on a wide range of platforms with relatively little work. A simple application can be cobbled together and rolled out in less than an hour. It would not be a complex application, of course, but it might suffice for basic data collection or an informational website. After that first version rolls to production, providing immediate benefit to users, features and improvements could be added incrementally with little or no downtime.
Quickly-crafted applications are probably not polished applications in terms of look-and-feel or function. This author has worked with a number of these earlier, rapidly-developed applications; they are still functional, but by contemporary web standards, they are not pretty.
Improving an existing, web-enabled application comes with a number of challenges. How can the design be upgraded without impacting users or disturbing the data?
It was in facing the challenge of working with some of these older applications that I first began making notes which led to this publication.
Getting started
If you are a developer new to Lotus Notes and Domino, you face a substantial learning curve. If you are already a Domino developer, but are new to working with Domino applications on the Web, then the learning curve is not so steep.
As a Domino developer, you must master the Notes and Designer clients, and you must achieve some level of coding competence with Formula Language, LotusScript, HTML, CSS, JavaScript, and possibly Java. In addition, you must embrace the Domino way of doing things. You must understand its security features, design templates, replication, workflow, and so on. In a web application, all of these elements work together to achieve some desirable business purpose.
What this book covers
Topics in these chapters offer tips, suggestions, and code snippets to help you understand and resolve specific problems you may encounter when working with Domino applications for the Web. You will likely encounter problems not covered within these pages, but the tips provided here should save you some puzzlement, aggravation, and research time.
Many techniques covered in these pages are now referred to by the Domino community as "classic" or "traditional" web development techniques. Not covered here are XPages and other development strategies that were introduced in Domino 8.5 and later. If you need such information, you must seek it elsewhere.
My overarching intent was to bring together in one place some useful tips and techniques that are otherwise scattered across the Web. Ideas offered here derive from experience, mine and others. Code samples are for illustration only and should not be interpreted as a guarantee of performance or suitability for a specific situation. Everything covered should be useful for versions of Domino 6.5 and later. Domino Designer 8.0 was used to develop and verify all the sample code.
Keep in mind that there are often several ways to create a feature or to solve a problem. While classic techniques work with current and older versions of Domino, the preferred way to create new applications is to use the latest techniques such as XPages. However, even in an up-to-date Domino environment, it may not be practical to redesign an existing application to take advantage of them. If you cannot take advantage of those newer techniques for whatever reason, then certainly use techniques catalogued in this volume. Use what makes sense to you and what works for you. Test thoroughly.
Chapter 1, Preparation and Habits, provides suggestions for developers seeking to improve their knowledge, skill, and productivity. Issues related to executing development projects are discussed.
Chapter 2, Design and Development Strategies, provides recommendations for planning development projects and for developing applications.
Chapter 3, Form and Pages, illustrates selected design choices related to forms and pages, including properties, composing and saving documents, improving layout, using view templates, incorporating HTML tags, and using hidden fields and computed text.
Chapter 4, Navigation, illustrates selected navigational strategies, including application launch options, custom login forms, menus, default error pages, and providing direction and help.
Chapter 5, Cascading Style Sheets, illustrates how CSS rules can be incorporated into applications to style forms and pages for the Web.
Chapter 6, JavaScript, illustrates how client-side JavaScript can be incorporated into applications for such purposes as validating fields, changing element style, enabling a date picker, providing a warning before leaving a form if changed data has not been saved, and retrieving data with Ajax.
Chapter 7, Views, illustrates design choices for displaying views on the Web.
Chapter 8, Agents, illustrates how to incorporate agents in web applications, including setting properties and security, adding error traps, accessing documents, processing selected documents in a view, sending e-mail notifications, and extracting data to a spreadsheet.
Chapter 9, Security and Performance, discusses security planning, implementing security features, tracking document changes, and designing for good performance.
Chapter 10, Testing and Debugging, discusses testing strategies, test plans, tracking issues, and selected debugging techniques.
What you need for this book
To explore the techniques discussed and illustrated in this book, readers should have access to Lotus Notes, Domino Designer, and a web browser. Ideally, readers are able to save sandbox applications to a Domino server for experimentation and testing.
Who this book is for
This book is for novice to moderately experienced Domino developers who are new to the task of web-enabling traditional Domino applications. Readers should be familiar with using Domino Designer to develop applications for the Lotus Notes client. It is also assumed that readers have, or can acquire, at least rudimentary knowledge of HTML, CSS, and JavaScript.
Conventions
In this book, you will find a number of styles of text that distinguish different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code within text is shown as follows: "The styleActionBar
JavaScript function in the ActionBar.js
JavaScript library contains just a few lines."
A block of code is set as follows:
function styleActionBar() { var form = document.forms[0] ; var tables = form.getElementsByTagName("TABLE") ; var actionbar = tables[0] ; actionbar.className += " actionbar" ; return true ; }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
Dim session As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "On the Basic Notes Client Configuration tab, in the Additional options list, check the Use Web palette option."
Note
Warnings or important notes appear in a box like this.
Note
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to< feedback@packtpub.com>
, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail< suggest@packtpub.com>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books maybe a mistake in the text or the code we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at< copyright@packtpub.com>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at< questions@packtpub.com>
if you are having a problem with any aspect of the book, and we will do our best to address it.