3. Disclaimer
All the code and the demos in this session will use the Java
Notes Objects which are part of the IBM/Lotus Notes
product.
For a modern way of Java coding with Notes Objects
please use the OpenNTF Domino API.
Please visit the session of Paul Withers and Martin Jinoch.
Or even better use OpenNTF essentials
17-3-2014 @EngageUG #engageug 3
4. Roadmap
• Notes objects in memory
• Use of JSON
• Managed beans
• Java tip for XPages
• Date checks
• Utility class
• Extending classes
• Use of finally
17-3-2014 @EngageUG #engageug 4
6. Bad practice
• Notes objects are not serializable
• Will not recycled the Java way, it will keep a pointer to the
C object
• Can cause out of memory
17-3-2014 @EngageUG #engageug 6
20. The requirements
• Needs to be Serializable
• At least one constructor without parameters
• Needs to be registrated in the Faces-config.xml
• Properties have Getters and Setters
17-3-2014 @EngageUG #engageug 20
21. Faces-config.xml syntax
• Name of the bean
• Full qualified class name
• Scope of the bean
• Optional, initialize properties
17-3-2014 @EngageUG #engageug 21
22. Use the managed beans
• Do the calculation in the class
• Use Expression Language to access properties
• Minimize use of SSJS
• Some examples
17-3-2014 @EngageUG #engageug 22
23. Java tips for XPages
17-3-2014 @EngageUG #engageug 23
24. Utility class
• All kind of methods
• Always available as static class
• I added some methods who were
translated from SSJS
17-3-2014 @EngageUG #engageug 24
25. Date checks
• Remember the TimeDifference horror
• Java provide nice Date checks
• Like… Date.before(Date) or Date.after(Date)
17-3-2014 @EngageUG #engageug 25
26. Extending a class
• Extend a base class
• Use the methods of the base class
17-3-2014 @EngageUG #engageug 26
27. Extending a class
• Using the class
• In a XPage
17-3-2014 @EngageUG #engageug 27
29. Credits
• DominoDocument, thanks Jesse Gallaghar for pointing me in the right direction.
• Utility Class, the base taken from the Help Application from OpenNTF
• Presentation, reveal.js
• Demo database runs on Domino 9.0.1
• Demo database needs the Extension Library from OpenNTF
• XPages Java doc, http://public.dhe.ibm.com/software/dw/lotus/Domino-
Designer/JavaDocs/XPagesExtAPI/8.5.2/index.html?overview-summary.html
17-3-2014 @EngageUG #engageug 29