SlideShare una empresa de Scribd logo
1 de 48
Boost your JAVA Code with the OpenNTF API
Oliver Busse
We4IT GmbH, Germany
March 17, 2016
Oliver Busse
• „Bleeding Yellow“ since R4.5
• Software Architect at We4IT
• Member of the development team of
Aveedo® Application Framework
• IBM Champion for ICS in 2015 + 2016
• OpenNTF Member Director
• XPages Advocate
• IBM Bluemix curious
@zeromancer1972
www.oliverbusse.com
Agenda
• What is the OpenNTF Domino API?
• Setup and Implementation
• Other Considerations
• Tons of examples
What is the OpenNTF Domino API?
What is the OpenNTF Domino API?
• It‘s an open source project on OpenNTF
• It‘s was started in April 2013
• It‘s maintained by generous developers you may know
• It fills the gaps and gives the power you always wanted in Java for
Domino
• It‘s often refered to as „ODA“
What is the OpenNTF Domino API? (cont‘d)
• The ODA consists of several packages
• core
• formula
• rest
• xsp
• …
• It‘s an OSGi plugin
• It‘s designed for running on the Domino server (9.0.x+)
• It‘s designed for XPages (Java, SSJS) and Plugins
• It can‘t be used in Java Agents 
Key developers of the ODA
• Nathan T. Freeman
• Paul S. Withers
• Jesse Gallagher
• Roland Praml
• Martin Jinoch
• René Winkelmeyer
• Tim Tripcony (never forgotten)
Setup and Implementation
Resources
• Grab it from OpenNTF (recommended)
• http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20
API
• Grab it from the Git-Repo
• https://github.com/OpenNTF/org.openntf.domino
• Grab it from the OpenNTF Stash
• https://stash.openntf.org/projects/ODA
System Logging
• Since the ODA is an OSGi plugin you can install it via the update site
mechanism
• It runs as an extension to the XSP runtime on the HTTP server JVM
• It comes with it‘s own logger
Setup: prepare the server
• Set the signer of the NSF as „Sign or run…“ in server
document‘s security section
Setup: prepare the updatesite
• Create an updatesite NSF
• Name it whatever you
want
• Make sure you set ACL to
let the server READ
documents
Setup: import ODA into update site
• Find the site.xml file to import it as a local update site
into your NSF
• After import goto „Actions, Sign all Content“
Setup: add the ODA to server startup
• Add a new line to your server‘s notes.ini file
• edit file manually or
• use a configuration setting (prefered)
• OSGI_HTTP_DYNAMIC_BUNDLES=updatesite.nsf
Setup: add the ODA to server startup
• This is what you should see when the server starts:
HTTP JVM: CLFAD0330I: NSF Based plugins are being installed
in the OSGi runtime. For more information please consult the
log
• Check the plugins with
– tell http osgi ss openntf
Setup: prepare Domino Designer
• Open DDE‘s preferences
• Goto „Domino Designer“ section
• Activate „Enable Eclipse plug-in install“
• Open the update site NSF you just created
• Goto „Actions, Show URLs“
• Copy one of the two URLs to clipboard
• Goto „File, Application, Install“
• Choose „Search for new features to install“
• On the next screen „Add (a) Remote Location“
• Enter a name for it and paste the URL in the clipboard
• On the next screen check the ODA entry and click next/yes if you are asked to
Other Considerations
Other Considerations
• ODA utilizes the OpenLog project
• XspOpenLogUtil.logEvent(…)
• XspOpenLogUtil.logError(…)
• Get familiar with the OpenLog project from OpenNTF
• Create a new OpenLog.nsf file in your server‘s root (if you haven‘t
already)
Examples
Examples
• Session handling
• View handling (loops)
• Document & Field handling
• DateTime enhancements
• Transactions
• Xots
• Graphs
Session handling
Session handling: different approaches
• Extension Library
• ExtlibUtil.getCurrentSession();
• ExtlibUtil.getCurrentSessionAsSigner();
• ExtlibUtil.getCurrentSessionAsSignerWithFullAccess();
• needs exception handling
• XSPUtil
• like ExtlibUtil
• needs exception handling
• Factory
• Factory.getSession();
• uses enums for different session types
• no exception handling needed!
View handling
View handling: what you are used to (1)
View handling: what you are used to (2)
What you now are able to do
Document handling
Safe lines of code by using new methods
• New creation methods
• Database.createDocument(String, Object, …)
• Database.createDocument(HashMap fields)
• Alternatives to replaceItemValue
• Document.put(String field, Object o)
• Document.putAll(HashMap fields)
• Alternatives to getItemValueXXX
• Document.get(Object o) // document acts like a Map<?>
• Document.getItemValue(String field, Class type)
getItemValue: what you are used to
• getItemValue returns a Vector
• Vectors are not type save
• editor / compiler complains non-type-safety
• they can contain „anything“
• you have to check what is inside
• if the item does not exist you are running into trouble…
getItemValue: what you can do now
• cast to a type of your choice
• ArrayList<?> values = doc.getItemValue(„foo", ArrayList.class);
• forget type safety
• define your own!
• a non existing item is returned as null, not as empty Vector
• can be handled
DateTime enhancements
DateTime enhancements
• Session.createDateTime(y,m,d,hh,mm,ss)
• uses int values
• conversion toJavaDate() not necessary
• DateTime.isBefore();
• DateTime.isAfter();
• useful comparisons
• DateTime.equalsIgnoreDate();
• DateTime.equalsIgnoreTime();
Transactions
Transactions
• ODA adds transactional capabilities to your Notes data
• You can modify documents without saving them
individually (e.g. in a loop)
• You can also rollback every modification if you need to
(e.g. when you run into an error)
Transactions (cont‘d)
• Create a new DatabaseTransaction object from the database
• DatabaseTransaction txn = db.startTransaction();
• Perform your modifications
• Decide whether to commit or rollback
• txn.commit();
• txn.rollback();
Xots
Xots
• Xots = XPages OSGi Tasklet Service
• It‘s the extended version of DOTS (Domino Tasklet Service)
• Use cases
• Can be coded inside the NSF, no plugin project needed
• Multi-threaded tasks like Runnable, but you can return values
• Bulk execution of time consuming code
• very new feature (alpha)
Xots (cont‘d)
• Advantages
• More granular time and event triggering than in Agents
• Can run with server-side permissions
• Runs in a shared container (JVM) unlikely of an Agent which runs in a dedicated
JVM
• you can exchange data between tasklets
• It‘s coded in a plain Java class and not in an Agent design element
• You can use SCM systems
Xots (cont‘d)
• Core elements of tasklet
• Interface Callable<?>
• Interface Future<?>
• get() method to get the return value(s)
• only if you are interested in a return value
• Class Xots from the ODA
• submit() method to create a tasklet
• schedule() methods to create a periodic tasklet
• use the PeriodicScheduler!
„Graphs“
http://whatis.techtarget.com/definition/graph-database
Graph DB
A graph database, also called a graph-oriented database, is a type of NoSQL database
that uses graph theory to store, map and query relationships.
A graph database is essentially a collection of nodes and edges. Each node represents
an entity (such as a person or business) and each edge represents a connection or
relationship between two nodes.
http://whatis.techtarget.com/definition/graph-database
Graphs – terminology
• Vertices (Nodes)
• Properties (Key-Value pairs)
• Edges
• Connections, Relations between Vertices
• ElementStores
• for us: NSF databases
• MetaverseIDs
• Replica + UNID (hashed)
• internal use only (don‘t care about them)
Graph DB – in Domino?
• Vertices and Edges are stored as Documents
• The data container is a NSF
• The ElementStore defines the filepath to the NSF
• An ElementStore can hold different types of Vertices
• Usually you create one ElementStore for each Vertice type
Let‘s see the demo &
some code
Resources
• The XPages demo application
• https://bitbucket.org/zeromancer1972/sutol-2015-oda-graph-demo
• A nice glossary
• http://www.intec.co.uk/from-xpages-to-web-app-glossary/
• OpenNTF Domino API
• http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API
• http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API%20Demo%20Database
• Xots
• http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-one/
• http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-two/
• http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-three/
• Graphs
• http://de.slideshare.net/ktree19/the-graph-revolution
Q & A
Thank you!
www.we4it.com

Más contenido relacionado

La actualidad más candente

Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
WO Community
 
GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...
GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...
GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...
Neo4j
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 

La actualidad más candente (19)

Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application Benchx: An XQuery benchmarking web application
Benchx: An XQuery benchmarking web application
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
 
JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch API
 
TYPO3 Transition Tool
TYPO3 Transition ToolTYPO3 Transition Tool
TYPO3 Transition Tool
 
Stream processing from single node to a cluster
Stream processing from single node to a clusterStream processing from single node to a cluster
Stream processing from single node to a cluster
 
Soap UI - Lesson3
Soap UI - Lesson3Soap UI - Lesson3
Soap UI - Lesson3
 
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
 
Logstash
LogstashLogstash
Logstash
 
GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...
GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...
GraphConnect Europe 2016 - Building Spring Data Neo4j 4.1 Applications Like A...
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2
 
User defined-functions-cassandra-summit-eu-2014
User defined-functions-cassandra-summit-eu-2014User defined-functions-cassandra-summit-eu-2014
User defined-functions-cassandra-summit-eu-2014
 
Soap UI - Lesson2
Soap UI - Lesson2Soap UI - Lesson2
Soap UI - Lesson2
 
U-SQL Reading & Writing Files (SQLBits 2016)
U-SQL Reading & Writing Files (SQLBits 2016)U-SQL Reading & Writing Files (SQLBits 2016)
U-SQL Reading & Writing Files (SQLBits 2016)
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
 
OrigoDB - take the red pill
OrigoDB - take the red pillOrigoDB - take the red pill
OrigoDB - take the red pill
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
 
Turbo charging v8 engine
Turbo charging v8 engineTurbo charging v8 engine
Turbo charging v8 engine
 
Spark real world use cases and optimizations
Spark real world use cases and optimizationsSpark real world use cases and optimizations
Spark real world use cases and optimizations
 

Destacado

OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungen web...
OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungenweb...OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungenweb...
OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungen web...
Oliver Busse
 
ULC - Connect 2014 Nachlese
ULC - Connect 2014 NachleseULC - Connect 2014 Nachlese
ULC - Connect 2014 Nachlese
Oliver Busse
 
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
Oliver Busse
 

Destacado (20)

OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungen web...
OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungenweb...OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungenweb...
OSA Anwendertreffen 2014 - "Clients ausgedünnt: Notes-/Domino-Anwendungen web...
 
DNUG 2014 Herbstkonferenz: Moderne Architektur - Hochskalierbare Anwendungsar...
DNUG 2014 Herbstkonferenz: Moderne Architektur - Hochskalierbare Anwendungsar...DNUG 2014 Herbstkonferenz: Moderne Architektur - Hochskalierbare Anwendungsar...
DNUG 2014 Herbstkonferenz: Moderne Architektur - Hochskalierbare Anwendungsar...
 
ISBG 2016 - XPages on IBM Bluemix
ISBG 2016 - XPages on IBM BluemixISBG 2016 - XPages on IBM Bluemix
ISBG 2016 - XPages on IBM Bluemix
 
ULC - Connect 2014 Nachlese
ULC - Connect 2014 NachleseULC - Connect 2014 Nachlese
ULC - Connect 2014 Nachlese
 
Transformations
TransformationsTransformations
Transformations
 
Transformations - a TLCC & Teamstudio Webinar
Transformations - a TLCC & Teamstudio WebinarTransformations - a TLCC & Teamstudio Webinar
Transformations - a TLCC & Teamstudio Webinar
 
GraphDb in XPages
GraphDb in XPagesGraphDb in XPages
GraphDb in XPages
 
Dnug 112014 modernization_openn_ntf_ersatzsession
Dnug 112014 modernization_openn_ntf_ersatzsessionDnug 112014 modernization_openn_ntf_ersatzsession
Dnug 112014 modernization_openn_ntf_ersatzsession
 
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
DNUG 38: "Einen Rahmen schaffen: Vorteile durch Frameworks in der Domino-Webe...
 
Fix & fertig: Best Practises für "XPages-Migranten"
Fix & fertig: Best Practises für "XPages-Migranten"Fix & fertig: Best Practises für "XPages-Migranten"
Fix & fertig: Best Practises für "XPages-Migranten"
 
Xpages - oder was man mit einer alten Notes-DB so alles anstellen kann
Xpages - oder was man mit einer alten Notes-DB so alles anstellen kannXpages - oder was man mit einer alten Notes-DB so alles anstellen kann
Xpages - oder was man mit einer alten Notes-DB so alles anstellen kann
 
Out of the Blue - the Workflow in Bluemix Development
Out of the Blue - the Workflow in Bluemix DevelopmentOut of the Blue - the Workflow in Bluemix Development
Out of the Blue - the Workflow in Bluemix Development
 
Find your data
Find your dataFind your data
Find your data
 
Java & Notes - Mit Eclipse neue Features für Notes entwickeln | C.Habermueller
Java & Notes - Mit Eclipse neue Features für Notes entwickeln | C.HabermuellerJava & Notes - Mit Eclipse neue Features für Notes entwickeln | C.Habermueller
Java & Notes - Mit Eclipse neue Features für Notes entwickeln | C.Habermueller
 
Out of the Blue: Getting started with IBM Bluemix development
Out of the Blue: Getting started with IBM Bluemix developmentOut of the Blue: Getting started with IBM Bluemix development
Out of the Blue: Getting started with IBM Bluemix development
 
MWLUG 2016 : AD117 : Xpages & jQuery DataTables
MWLUG 2016 : AD117 : Xpages & jQuery DataTablesMWLUG 2016 : AD117 : Xpages & jQuery DataTables
MWLUG 2016 : AD117 : Xpages & jQuery DataTables
 
XPages on Bluemix - the Do's and Dont's
XPages on Bluemix - the Do's and Dont'sXPages on Bluemix - the Do's and Dont's
XPages on Bluemix - the Do's and Dont's
 
A World Without Applications
A World Without ApplicationsA World Without Applications
A World Without Applications
 
Beyond XPages
Beyond XPagesBeyond XPages
Beyond XPages
 
Utilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino APIUtilizing the OpenNTF Domino API
Utilizing the OpenNTF Domino API
 

Similar a Utilizing the open ntf domino api

Similar a Utilizing the open ntf domino api (20)

Ruote: A Ruby workflow engine
Ruote:  A Ruby workflow engineRuote:  A Ruby workflow engine
Ruote: A Ruby workflow engine
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 
Windows 8 Apps and the Outside World
Windows 8 Apps and the Outside WorldWindows 8 Apps and the Outside World
Windows 8 Apps and the Outside World
 
12 Step Guide to Lotuscript
12 Step Guide to Lotuscript12 Step Guide to Lotuscript
12 Step Guide to Lotuscript
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
 
[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions
 
KYSUC - Keep Your Schema Under Control
KYSUC - Keep Your Schema Under ControlKYSUC - Keep Your Schema Under Control
KYSUC - Keep Your Schema Under Control
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
Ow
OwOw
Ow
 
7 steps to simplifying your AI workflows
7 steps to simplifying your AI workflows7 steps to simplifying your AI workflows
7 steps to simplifying your AI workflows
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
 
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor packageShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 

Más de Oliver Busse (6)

HCL Domino Volt - der NSF Killer?
HCL Domino Volt - der NSF Killer?HCL Domino Volt - der NSF Killer?
HCL Domino Volt - der NSF Killer?
 
Outlook becomes a Team Player - with a clever add-in
Outlook becomes a Team Player - with a clever add-inOutlook becomes a Team Player - with a clever add-in
Outlook becomes a Team Player - with a clever add-in
 
The NERD stuff - opening for Domino to the modern web developer
The NERD stuff - opening for Domino to the modern web developerThe NERD stuff - opening for Domino to the modern web developer
The NERD stuff - opening for Domino to the modern web developer
 
DNUG Development Day 2019
DNUG Development Day 2019DNUG Development Day 2019
DNUG Development Day 2019
 
DNUG44 Watson Workspace
DNUG44 Watson WorkspaceDNUG44 Watson Workspace
DNUG44 Watson Workspace
 
Paradiesisch - OpenNTF
Paradiesisch - OpenNTFParadiesisch - OpenNTF
Paradiesisch - OpenNTF
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Último (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Utilizing the open ntf domino api

  • 1. Boost your JAVA Code with the OpenNTF API Oliver Busse We4IT GmbH, Germany March 17, 2016
  • 2. Oliver Busse • „Bleeding Yellow“ since R4.5 • Software Architect at We4IT • Member of the development team of Aveedo® Application Framework • IBM Champion for ICS in 2015 + 2016 • OpenNTF Member Director • XPages Advocate • IBM Bluemix curious @zeromancer1972 www.oliverbusse.com
  • 3. Agenda • What is the OpenNTF Domino API? • Setup and Implementation • Other Considerations • Tons of examples
  • 4. What is the OpenNTF Domino API?
  • 5. What is the OpenNTF Domino API? • It‘s an open source project on OpenNTF • It‘s was started in April 2013 • It‘s maintained by generous developers you may know • It fills the gaps and gives the power you always wanted in Java for Domino • It‘s often refered to as „ODA“
  • 6. What is the OpenNTF Domino API? (cont‘d) • The ODA consists of several packages • core • formula • rest • xsp • … • It‘s an OSGi plugin • It‘s designed for running on the Domino server (9.0.x+) • It‘s designed for XPages (Java, SSJS) and Plugins • It can‘t be used in Java Agents 
  • 7. Key developers of the ODA • Nathan T. Freeman • Paul S. Withers • Jesse Gallagher • Roland Praml • Martin Jinoch • René Winkelmeyer • Tim Tripcony (never forgotten)
  • 9. Resources • Grab it from OpenNTF (recommended) • http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20 API • Grab it from the Git-Repo • https://github.com/OpenNTF/org.openntf.domino • Grab it from the OpenNTF Stash • https://stash.openntf.org/projects/ODA
  • 10. System Logging • Since the ODA is an OSGi plugin you can install it via the update site mechanism • It runs as an extension to the XSP runtime on the HTTP server JVM • It comes with it‘s own logger
  • 11. Setup: prepare the server • Set the signer of the NSF as „Sign or run…“ in server document‘s security section
  • 12. Setup: prepare the updatesite • Create an updatesite NSF • Name it whatever you want • Make sure you set ACL to let the server READ documents
  • 13. Setup: import ODA into update site • Find the site.xml file to import it as a local update site into your NSF • After import goto „Actions, Sign all Content“
  • 14. Setup: add the ODA to server startup • Add a new line to your server‘s notes.ini file • edit file manually or • use a configuration setting (prefered) • OSGI_HTTP_DYNAMIC_BUNDLES=updatesite.nsf
  • 15. Setup: add the ODA to server startup • This is what you should see when the server starts: HTTP JVM: CLFAD0330I: NSF Based plugins are being installed in the OSGi runtime. For more information please consult the log • Check the plugins with – tell http osgi ss openntf
  • 16. Setup: prepare Domino Designer • Open DDE‘s preferences • Goto „Domino Designer“ section • Activate „Enable Eclipse plug-in install“ • Open the update site NSF you just created • Goto „Actions, Show URLs“ • Copy one of the two URLs to clipboard • Goto „File, Application, Install“ • Choose „Search for new features to install“ • On the next screen „Add (a) Remote Location“ • Enter a name for it and paste the URL in the clipboard • On the next screen check the ODA entry and click next/yes if you are asked to
  • 18. Other Considerations • ODA utilizes the OpenLog project • XspOpenLogUtil.logEvent(…) • XspOpenLogUtil.logError(…) • Get familiar with the OpenLog project from OpenNTF • Create a new OpenLog.nsf file in your server‘s root (if you haven‘t already)
  • 20. Examples • Session handling • View handling (loops) • Document & Field handling • DateTime enhancements • Transactions • Xots • Graphs
  • 22. Session handling: different approaches • Extension Library • ExtlibUtil.getCurrentSession(); • ExtlibUtil.getCurrentSessionAsSigner(); • ExtlibUtil.getCurrentSessionAsSignerWithFullAccess(); • needs exception handling • XSPUtil • like ExtlibUtil • needs exception handling • Factory • Factory.getSession(); • uses enums for different session types • no exception handling needed!
  • 24. View handling: what you are used to (1)
  • 25. View handling: what you are used to (2)
  • 26. What you now are able to do
  • 28. Safe lines of code by using new methods • New creation methods • Database.createDocument(String, Object, …) • Database.createDocument(HashMap fields) • Alternatives to replaceItemValue • Document.put(String field, Object o) • Document.putAll(HashMap fields) • Alternatives to getItemValueXXX • Document.get(Object o) // document acts like a Map<?> • Document.getItemValue(String field, Class type)
  • 29. getItemValue: what you are used to • getItemValue returns a Vector • Vectors are not type save • editor / compiler complains non-type-safety • they can contain „anything“ • you have to check what is inside • if the item does not exist you are running into trouble…
  • 30. getItemValue: what you can do now • cast to a type of your choice • ArrayList<?> values = doc.getItemValue(„foo", ArrayList.class); • forget type safety • define your own! • a non existing item is returned as null, not as empty Vector • can be handled
  • 32. DateTime enhancements • Session.createDateTime(y,m,d,hh,mm,ss) • uses int values • conversion toJavaDate() not necessary • DateTime.isBefore(); • DateTime.isAfter(); • useful comparisons • DateTime.equalsIgnoreDate(); • DateTime.equalsIgnoreTime();
  • 34. Transactions • ODA adds transactional capabilities to your Notes data • You can modify documents without saving them individually (e.g. in a loop) • You can also rollback every modification if you need to (e.g. when you run into an error)
  • 35. Transactions (cont‘d) • Create a new DatabaseTransaction object from the database • DatabaseTransaction txn = db.startTransaction(); • Perform your modifications • Decide whether to commit or rollback • txn.commit(); • txn.rollback();
  • 36. Xots
  • 37. Xots • Xots = XPages OSGi Tasklet Service • It‘s the extended version of DOTS (Domino Tasklet Service) • Use cases • Can be coded inside the NSF, no plugin project needed • Multi-threaded tasks like Runnable, but you can return values • Bulk execution of time consuming code • very new feature (alpha)
  • 38. Xots (cont‘d) • Advantages • More granular time and event triggering than in Agents • Can run with server-side permissions • Runs in a shared container (JVM) unlikely of an Agent which runs in a dedicated JVM • you can exchange data between tasklets • It‘s coded in a plain Java class and not in an Agent design element • You can use SCM systems
  • 39. Xots (cont‘d) • Core elements of tasklet • Interface Callable<?> • Interface Future<?> • get() method to get the return value(s) • only if you are interested in a return value • Class Xots from the ODA • submit() method to create a tasklet • schedule() methods to create a periodic tasklet • use the PeriodicScheduler!
  • 41. Graph DB A graph database, also called a graph-oriented database, is a type of NoSQL database that uses graph theory to store, map and query relationships. A graph database is essentially a collection of nodes and edges. Each node represents an entity (such as a person or business) and each edge represents a connection or relationship between two nodes. http://whatis.techtarget.com/definition/graph-database
  • 42. Graphs – terminology • Vertices (Nodes) • Properties (Key-Value pairs) • Edges • Connections, Relations between Vertices • ElementStores • for us: NSF databases • MetaverseIDs • Replica + UNID (hashed) • internal use only (don‘t care about them)
  • 43. Graph DB – in Domino? • Vertices and Edges are stored as Documents • The data container is a NSF • The ElementStore defines the filepath to the NSF • An ElementStore can hold different types of Vertices • Usually you create one ElementStore for each Vertice type
  • 44. Let‘s see the demo & some code
  • 45. Resources • The XPages demo application • https://bitbucket.org/zeromancer1972/sutol-2015-oda-graph-demo • A nice glossary • http://www.intec.co.uk/from-xpages-to-web-app-glossary/ • OpenNTF Domino API • http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API • http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API%20Demo%20Database • Xots • http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-one/ • http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-two/ • http://www.intec.co.uk/xots-background-and-multithreaded-tasks-the-openntf-domino-api-way-part-three/ • Graphs • http://de.slideshare.net/ktree19/the-graph-revolution
  • 46. Q & A