SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Use Notes objects in
memory and other useful
Java tips for XPages
development
Frank van der Linden
17-3-2014 @EngageUG #engageug 1
17-3-2014 @EngageUG #engageug 2
@flinden68
http://flinden68.wordpress.com
http://nl.linkedin.com/in/flinden68
fli@e-office.com
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
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
Notes objects in memory
17-3-2014 @EngageUG #engageug 5
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
What is Serialization
17-3-2014 @EngageUG #engageug 7
XPages Java doc to the rescue
17-3-2014 @EngageUG #engageug 8
Put Notes document in memory
• Get Notesdocument
• Wrap Notesdocument into a DominoDocument
17-3-2014 @EngageUG #engageug 9
Access fields
• First check if document isRecycled
• Access field
17-3-2014 @EngageUG #engageug 10
On a XPage and more
• In a computed field
• In an edit box
• Update the backend document
17-3-2014 @EngageUG #engageug 11
Demo
17-3-2014 @EngageUG #engageug 12
What about attachments
• Get easy access to your attachements
17-3-2014 @EngageUG #engageug 13
What about attachments
• No calculation of paths
• Works both in XPinc and Web
• Call the attachment URL
17-3-2014 @EngageUG #engageug 14
Demo
17-3-2014 @EngageUG #engageug 15
Use buildin JSON classes
17-3-2014 @EngageUG #engageug 16
JSON building classes
• Part of the Extensibility API, since 8.5.2
• Easy way to build JSON
17-3-2014 @EngageUG #engageug 17
JSON building classes
• No concatenation of Strings
• Faster
• Readable code
17-3-2014 @EngageUG #engageug 18
Managed beans
17-3-2014 @EngageUG #engageug 19
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
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
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
Java tips for XPages
17-3-2014 @EngageUG #engageug 23
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
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
Extending a class
• Extend a base class
• Use the methods of the base class
17-3-2014 @EngageUG #engageug 26
Extending a class
• Using the class
• In a XPage
17-3-2014 @EngageUG #engageug 27
Questions
17-3-2014 @EngageUG #engageug 28
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
17-3-2014 @EngageUG #engageug 30
@flinden68
http://flinden68.wordpress.com
http://nl.linkedin.com/in/flinden68
fli@e-office.com
Thank you
Bonus
17-3-2014 @EngageUG #engageug 31
Event Source
17-3-2014 @EngageUG #engageug 32
Customizable Toolbar
17-3-2014 @EngageUG #engageug 33

Weitere ähnliche Inhalte

Was ist angesagt?

Make sure your code works
Make sure your code worksMake sure your code works
Make sure your code works
Henrik Skupin
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
nohuhu
 

Was ist angesagt? (20)

Lo4
Lo4Lo4
Lo4
 
Next generation frontend tooling
Next generation frontend toolingNext generation frontend tooling
Next generation frontend tooling
 
Ruin your life using robot framework
Ruin your life using robot frameworkRuin your life using robot framework
Ruin your life using robot framework
 
2016 spice world_london_breakout
2016 spice world_london_breakout2016 spice world_london_breakout
2016 spice world_london_breakout
 
Make sure your code works
Make sure your code worksMake sure your code works
Make sure your code works
 
Thinking in Swift
Thinking in SwiftThinking in Swift
Thinking in Swift
 
A SOA approximation on symfony
A SOA approximation on symfonyA SOA approximation on symfony
A SOA approximation on symfony
 
RoboCon 2018: How did we get here? Where do we go next?
RoboCon 2018: How did we get here? Where do we go next?RoboCon 2018: How did we get here? Where do we go next?
RoboCon 2018: How did we get here? Where do we go next?
 
Reusability is the goal
Reusability is the goalReusability is the goal
Reusability is the goal
 
Tests immutable when refactoring - SegFault Unconference Cracow 2019
Tests immutable when refactoring - SegFault Unconference Cracow 2019Tests immutable when refactoring - SegFault Unconference Cracow 2019
Tests immutable when refactoring - SegFault Unconference Cracow 2019
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development
 
Robot framework and selenium2 library
Robot framework and selenium2 libraryRobot framework and selenium2 library
Robot framework and selenium2 library
 
Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012
 
Introduction to Robot Framework
Introduction to Robot FrameworkIntroduction to Robot Framework
Introduction to Robot Framework
 
Javascript best practices
Javascript best practicesJavascript best practices
Javascript best practices
 
A brief intro to nodejs
A brief intro to nodejsA brief intro to nodejs
A brief intro to nodejs
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
Java and the JVM
Java and the JVMJava and the JVM
Java and the JVM
 

Ähnlich wie Use notes objects in memory and other useful java tips for xpages development

MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
Valeri Karpov
 

Ähnlich wie Use notes objects in memory and other useful java tips for xpages development (20)

Plone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, BelgiumPlone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, Belgium
 
Hands on iOS developments with Jenkins
Hands on iOS developments with JenkinsHands on iOS developments with Jenkins
Hands on iOS developments with Jenkins
 
Pipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei MccollumPipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei Mccollum
 
Engage 2014 OpenNTF Domino API Slides
Engage 2014 OpenNTF Domino API SlidesEngage 2014 OpenNTF Domino API Slides
Engage 2014 OpenNTF Domino API Slides
 
Alexander Kutsan "Where Unicorns Live or How To Write Good C++ Code"
Alexander Kutsan "Where Unicorns Live or How To Write Good C++ Code"Alexander Kutsan "Where Unicorns Live or How To Write Good C++ Code"
Alexander Kutsan "Where Unicorns Live or How To Write Good C++ Code"
 
DanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino APIDanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino API
 
The Python in the Apple
The Python in the AppleThe Python in the Apple
The Python in the Apple
 
Java9to19Final.pptx
Java9to19Final.pptxJava9to19Final.pptx
Java9to19Final.pptx
 
SPS NYC Using the Office Dev PnP to Accelerate Your Productivity
SPS NYC  Using the Office Dev PnP to Accelerate Your ProductivitySPS NYC  Using the Office Dev PnP to Accelerate Your Productivity
SPS NYC Using the Office Dev PnP to Accelerate Your Productivity
 
Master class in modern Java
Master class in modern JavaMaster class in modern Java
Master class in modern Java
 
Building Awesome APIs with Lumen
Building Awesome APIs with LumenBuilding Awesome APIs with Lumen
Building Awesome APIs with Lumen
 
New Era of Plugin Development in WordPress
New Era of Plugin Development in WordPressNew Era of Plugin Development in WordPress
New Era of Plugin Development in WordPress
 
Don't Code, Bake. An introduction to CakePHP ~PHP Hampshire Oct 2014
Don't Code, Bake. An introduction to CakePHP ~PHP Hampshire Oct 2014Don't Code, Bake. An introduction to CakePHP ~PHP Hampshire Oct 2014
Don't Code, Bake. An introduction to CakePHP ~PHP Hampshire Oct 2014
 
Web frameworks in python
Web frameworks in pythonWeb frameworks in python
Web frameworks in python
 
JUnit 5 - New Opportunities for Testing on the JVM
JUnit 5 - New Opportunities for Testing on the JVMJUnit 5 - New Opportunities for Testing on the JVM
JUnit 5 - New Opportunities for Testing on the JVM
 
Introducing wsgi_lineprof / PyCon JP 2017 LT
Introducing wsgi_lineprof / PyCon JP 2017 LTIntroducing wsgi_lineprof / PyCon JP 2017 LT
Introducing wsgi_lineprof / PyCon JP 2017 LT
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
l2-es6-160830040119.pdf
l2-es6-160830040119.pdfl2-es6-160830040119.pdf
l2-es6-160830040119.pdf
 
Engage 2019 Software documentation is fun if you have the right tools: Introd...
Engage 2019 Software documentation is fun if you have the right tools: Introd...Engage 2019 Software documentation is fun if you have the right tools: Introd...
Engage 2019 Software documentation is fun if you have the right tools: Introd...
 
Lecture 2: ES6 / ES2015 Slide
Lecture 2: ES6 / ES2015 SlideLecture 2: ES6 / ES2015 Slide
Lecture 2: ES6 / ES2015 Slide
 

Mehr von Frank van der Linden

Mehr von Frank van der Linden (20)

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Engage 2020: Hello are you listening, There is stream for everything
Engage 2020: Hello are you listening, There is stream for everythingEngage 2020: Hello are you listening, There is stream for everything
Engage 2020: Hello are you listening, There is stream for everything
 
NCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streamsNCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streams
 
NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...
NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...
NCUG 2019: Spring forward: an introduction to Spring boot and Thymeleaf for (...
 
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...Engage 2019: The good, the bad and the ugly: a not so objective view on front...
Engage 2019: The good, the bad and the ugly: a not so objective view on front...
 
Social connections14: Super charge your API’s with Reactive streams
Social connections14: Super charge your API’s with Reactive streamsSocial connections14: Super charge your API’s with Reactive streams
Social connections14: Super charge your API’s with Reactive streams
 
Icon UK 2018 - Spring forward: an introduction to Spring boot and Thymeleaf f...
Icon UK 2018 - Spring forward: an introduction to Spring boot and Thymeleaf f...Icon UK 2018 - Spring forward: an introduction to Spring boot and Thymeleaf f...
Icon UK 2018 - Spring forward: an introduction to Spring boot and Thymeleaf f...
 
Spring forward: an introduction to Spring boot and Thymeleaf
Spring forward: an introduction to Spring boot and ThymeleafSpring forward: an introduction to Spring boot and Thymeleaf
Spring forward: an introduction to Spring boot and Thymeleaf
 
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
DEV03 - How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Real...
 
Wcs-1785 How Watson, Bluemix, Cloudant and XPages can work together in a real...
Wcs-1785 How Watson, Bluemix, Cloudant and XPages can work together in a real...Wcs-1785 How Watson, Bluemix, Cloudant and XPages can work together in a real...
Wcs-1785 How Watson, Bluemix, Cloudant and XPages can work together in a real...
 
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
 
A (XPages) developers guide to Cloudant - MeetIT
A (XPages) developers guide to Cloudant - MeetITA (XPages) developers guide to Cloudant - MeetIT
A (XPages) developers guide to Cloudant - MeetIT
 
A (XPages) developers guide to Cloudant
A (XPages) developers guide to CloudantA (XPages) developers guide to Cloudant
A (XPages) developers guide to Cloudant
 
Let's serve your data
Let's serve your dataLet's serve your data
Let's serve your data
 
Let's server your Data
Let's server your DataLet's server your Data
Let's server your Data
 
Don't worry with bower
Don't worry with bowerDon't worry with bower
Don't worry with bower
 
An XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on DominoAn XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on Domino
 
The power of dots
The power of dotsThe power of dots
The power of dots
 
Let me introduce you: DOTS
Let me introduce you: DOTSLet me introduce you: DOTS
Let me introduce you: DOTS
 
Integrate domino designer with cvs source control
Integrate domino designer with cvs source controlIntegrate domino designer with cvs source control
Integrate domino designer with cvs source control
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Use notes objects in memory and other useful java tips for xpages development