Java 2 for XPages Development (9.0)
Units: 16
Duration: 4 classroom equivalent days
Discussion Access: 12 months

Summary Description
Java is an important skill to have when developing advanced XPages. The XPages architecture is built on Java and using Java allows your applications to run faster as well as take advantage of the many third party Java libraries to create PDF files and export Domino data to spreadsheets. This advanced Java course builds on what you learned in Java 1 to do advanced XPages techniques such as:
  • Learn how to debug Java in XPages
  • Use the Expression Language (EL)
  • Create and Use Managed Beans
  • Use the Dynamic View Panel Customizer Bean to customize the views in the Dynamic View Panel
  • Create Navigators with Java using the Bean Picker
  • Use third party Java libraries like Apache POI and FOP to export Domino data to spreadsheet and PDF formats
As with all TLCC courses, this course is a complete and comprehensive self-paced course and not just a collection of sample exercises. After each lesson you will apply what you learned in an activity to get you hands-on experience writing Java code.

Audience and Prerequisites
Experienced Notes and Domino application developers with JavaScript and XPages development experience. Click here to view the complete skills path for XPages development.
The following TLCC courses (or their equivalent) are prerequisite for this course:
  • XPages Development 1 for Notes and Domino 9
  • Java 1 for XPages Development (9.0)

System Requirements
The system requirements for this course are:
Course Modules
Module 1 - Debugging Java and XPages
One of the advantages of Domino Designer being based on the Eclipse platform is the availability of the Java debugger tool for debugging Java code. This module will cover how to first configure Domino Designer for debugging Java, and then how to configure and use the included Java debugger tool to debug Java code that is called from an XPage.
  • Add the required NOTES.INI configuration file settings to enable and configure Java debugging for applications running either locally or on a Domino server
  • Create a Java Debug Configuration
  • Set breakpoints in the code to enable debugging
  • Execute the code to be debugged and step through the code in the Debug perspective

Module 2 - Expression Language
Expression Language (EL) was devised to allow developers who are NOT Java programmers (like HTML web developers) to implement Java Code libraries easily by using a scripting syntax instead of the more rigid Java coding syntax. The Expression Language syntax rules and evaluation options are first covered in this module and then the different areas of XPages development that EL can be used is explored. Finally, the different GUI editors available in Designer for coding EL are explored including the Expression Language (EL) editor, Scoped Variable editor, Custom editor and the Server-side JavaScript editor.
  • Discover the various EL syntax rules that must be followed
  • Use both the bracket notation and dot notation syntax to access a property
  • Understand the differences between immediate evaluation and deferred evaluation when coding EL expressions
  • Become familiar with the various reserved words and other EL operators
  • Use EL to set a simple Data Binding to fields in a Domino Document data source
  • Use EL to get and set values in scoped variables
  • Use EL to get and set values in JavaBeans and Managed Beans
  • Code EL expressions using the different editors in Domino Designer

Module 3 - Creating and Using Managed Beans
This module covers how to create a JavaBean and how to register and implement a Managed Bean. Implementing managed beans with different execution scopes and managed properties is also covered. Finally, this module shows how to implement an Application Configuration Bean to set and retrieve the static configuration values for an application.
  • Create a JavaBean
  • Set and get JavaBean properties using both SSJS and EL syntax
  • Understand the differences between a JavaBean and a Managed Bean
  • Register a Managed Bean in the faces-config.xml file of an application
  • Register and return a managed-property value, list of values, or a map entry
  • Implement an Application Configuration Bean

Module 4 - Using Beans in XPages Development
This module covers how Java beans can be used in an XPages application. This module begins by showing how a Managed Bean can be used to retrieve the selection items once from the data source and then efficiently provide these selection item choices over and over to several selection controls in the application. How to create and implement a Customizer Bean to customize the display for different views in a Dynamic View Panel is covered in this module. Finally, this module covers how to code and implement a Java bean to provide the selection values or nodes for different navigator and selection type controls.
  • Return select items from a managed bean
  • Create and implement a Customizer Bean for a Dynamic View Panel control
  • Use a JavaBean to set the values of a Dojo Link Select control
  • Use a JavaBean to set the values of a Name Picker control
  • Use a JavaBean to set the selection nodes for a Navigator control

Module 5 - Using Third Party Java Libraries
This module covers the different options for including 3rd party Java libraries in an XPages application. The use of methods and functionality from the Apache Commons, Apache POI and the Apache FOP projects and libraries will be covered in this module. Several use cases for exporting Domino data into an Excel spreadsheet using the Java Libraries from the Apache POI project are examined and demonstrated. Finally, this module demonstrates how the Apache FOP project can be used to provide an open source solution for creating PDF output from Domino data to enable formatted printing from an XPage.
  • Understand the main steps to add and implement a 3rd party Java library in an XPages application
  • Become familiar with the Apache Software Foundation and its Apache Commons, Apache POI, and Apache FOP projects
  • Use methods of the org.apache.commons.lang3.StringUtils class
  • Use methods of the org.apache.commons.lang3.text.WordUtils class
  • Use the classes and methods in the Apache POI project to create an Excel spreadsheet from Domino data
  • Use the classes and methods in the Apache FOP project to create a PDF file from Domino data

Module 6 - Creating an Order Entry Application
In this module several of the advanced techniques for using Java in XPages are combined to deliver an Order Entry application. First, the overall application design and workflow are examined and then all the required details for coding the order entry system are covered including how to generate a receipt for the order.
  • Understand the overall workflow and design of the order entry system
  • Code the two managed beans to return details for the selected customer and part items for the order
  • Design the XPages and custom control used to deliver the interface and functionality of the ordering system
  • Examine the Java class code to generate the XML source for the conversion from the field item values for the current (on screen) order document
  • Examine the design of the XSLT stylesheet used for the conversion
  • Code the Java class to convert the XML source for the current (on screen) order document to a PDF output file