NSF ODP TOOLING
BRING NSFS INTO THE CI/CD WORLD
JESSE
GALLAGHER
CTO - I KNOW SOME GUYS
IP MANAGER - OPENNTF
HTTP://FROSTILLIC.US
@GIDGERBY
What is it?
A set of Maven and Eclipse plugins for working with On-Disk Projects
Four main components
ODP → NSF compiler
NSF → ODP exporter
Deployment
Eclipse UI extensions
What is it?
No requirement for Designer
Works with a local Notes/Domino runtime or a remote server
Local runtime: macOS, Windows, or Linux on x86
Remote runtime: Anything that runs Java
Designed to allow clean, consistent builds without UI interaction
Provides some support for working with ODP projects in IDEs
Brief Aside: Maven
It’s not (inherently) scary!
Just look how cute that owl is
Maven is a tool used for build automation
It’s primarily used for Java projects, but is
adaptable to many things via plugins
A “pom.xml” file is a clear giveaway of
Maven’s use
We use it here because it allows for cleanly-
reproducible builds across systems, without
environment-specific details
Second Brief Aside: Complexity
Will this require lots of command-line knowledge?
Not really!
Will this require lots of complicated XML configuration?
Only kind of!
Will this complicate my day-to-day development experience?
Only if you want it to!
ODP COMPILER
ODP Compiler
Takes an ODP and creates an NSF
Allows use of Maven and OSGi dependencies (i.e. XPages libraries)
Allows dynamically enabling “production” XPages settings like
resource aggregation
Allows applying a template name and version + build timestamp
ODP Compiler
Example Configuration
<plugin>
<groupId>org.openntf.maven</groupId>
<artifactId>nsfodp-maven-plugin</artifactId>
<configuration>
<updateSites>
<updateSite>${project.baseDir}/../../../releng/org.openntf.nsfodp.exampl
e.updatesite/target/site</updateSite>
</updateSites>
<templateName>ExampleProject</templateName>
</configuration>
</plugin>
ODP Compiler
Can be standalone or part of a larger
project tree
Pairs beautifully with Tycho for OSGi
compilation and the Assembly Plugin
for distribution
ODP Compiler
Basic configuration is simple: put your ODP in an “odp” directory and add a pom.xml
file above it
Allows configuration during compilation:
Update Site references for OSGi plugins
Classpath JARs and Maven dependencies like jvm/lib/ext
Override the ODP’s ACL in the pom.xml
Add a template name and version on the fly
Set the ODS level to target
ODP EXPORTER
ODP Exporter
Takes an NSF and creates an ODP
Replicates the behavior of Designer’s source control support
Except it’s not incremental (at least not yet)
Can be used to export a local NSF file or a remote database
Automatically applies Swiper cleanup to exported DXL
ODP Exporter
ODP Exporter
Can be used in lieu of Designer’s export sync
It’s less convenient, but it’s also less fault-prone
Very useful when someone on your team doesn’t use source control
Useful to convert NSFs to processable text form
I use it for exactly this when doing IP checks for OpenNTF
NSF DEPLOYMENT
NSF Deployment
Deploys a compiled NSF to a server, optionally replacing an existing
NSF’s design
Allows you to sign the database as the server
Provides for Continuous Deployment to a staging server
Warning: this component is effectively “beta”
NSF Deployment
ECLIPSE UI EXTENSIONS
Eclipse Extensions
Configures the Java classpath
Includes OSGi dependencies
Adds categories for design elements
with nice little pictures
Adds DXL autocomplete via the
schema files
(To whoever at HCL maintains those:
thank you)
Eclipse Extensions
ODP Java classes can directly
reference plugins in the workspace
Allows for refactoring across both the
ODP and plugins, avoiding out-of-step
bugs
Code Autocomplete
WORKFLOWS
Generally Applicable
The ODP is the “source of truth”
NSFs only exist as development areas or deployable builds
The build process versions and timestamps NTFs
The build process is consistent every time
Clean NSF output
No unintended residue
No “Copy Application” mis-clicks
Single Developer, Simple NSF
Keeps focus on good source-control habits
Maven configuration is very small
Good way to dip into Jenkins
Encourages versioning and discourages shoot-from-the-hip
development
Works with classic design elements, XPages or no
Multi-Person Team, XPages
Libraries
Maven makes the OSGi bundle build process more consistent
Any team member can make a full build
Eclipse support allows Java refactoring across OSGi bundles and in-
NSF Java classes
Eclipse XSP editing allows some tasks to be done fully outside
Designer
Team With Uncooperative Members
If not everyone is on board, use the Exporter to make ODP snapshots
The ODP becomes the source of truth
In my case, I have a script I run periodically that exports a bunch of
NSFs to ODPs
It’s not the best workflow, but it’s better than the old ways
NPM-based App Container
Kick off the NPM install/build with frontend-maven-plugin
Include the built resources inside the NSF in WebContent
Avoid worries of having to coax Designer into doing it
https://frostillic.us/blog/posts/2020/7/17/nsf-odp-tooling-3-1-0-
dynamically-including-web-resources
Maven Assembly Plugin
The Assembly plugin allows you to create a final
distribution ZIP
In my case, I gather several dozen built NSFs, a
couple update sites, support libraries, and
instructions
This happens at the end of every build, with a ZIP
ready to hand off to admins
I also use this in almost every one of my OpenNTF
projects
(Great way to get those LICENSE and NOTICE
files in there!)
(Saves your friendly IP manager some hassle!)
Automated Builds - Jenkins, etc.
With some setup, Jenkins can build
your apps with every commit
Pairs very well with Assembly projects
https://frostillic.us/blog/posts/2020/8/27/
nsf-odp-tooling-setting-up-jenkins-
builds
THE FUTURE
Potential Future Additions
Improvements to deployment
If anybody could get me the true “Replace Design” API call, I’d
appreciate it
Docker-based build runtime
Work against a live NSF (“Designer-style”)
Ability to edit agents in Eclipse
Unit tests for in-NSF code
QUESTIONS

CollabSphere 2020 - NSF ODP Tooling

  • 1.
    NSF ODP TOOLING BRINGNSFS INTO THE CI/CD WORLD
  • 2.
    JESSE GALLAGHER CTO - IKNOW SOME GUYS IP MANAGER - OPENNTF HTTP://FROSTILLIC.US @GIDGERBY
  • 4.
    What is it? Aset of Maven and Eclipse plugins for working with On-Disk Projects Four main components ODP → NSF compiler NSF → ODP exporter Deployment Eclipse UI extensions
  • 5.
    What is it? Norequirement for Designer Works with a local Notes/Domino runtime or a remote server Local runtime: macOS, Windows, or Linux on x86 Remote runtime: Anything that runs Java Designed to allow clean, consistent builds without UI interaction Provides some support for working with ODP projects in IDEs
  • 6.
    Brief Aside: Maven It’snot (inherently) scary! Just look how cute that owl is Maven is a tool used for build automation It’s primarily used for Java projects, but is adaptable to many things via plugins A “pom.xml” file is a clear giveaway of Maven’s use We use it here because it allows for cleanly- reproducible builds across systems, without environment-specific details
  • 7.
    Second Brief Aside:Complexity Will this require lots of command-line knowledge? Not really! Will this require lots of complicated XML configuration? Only kind of! Will this complicate my day-to-day development experience? Only if you want it to!
  • 8.
  • 9.
    ODP Compiler Takes anODP and creates an NSF Allows use of Maven and OSGi dependencies (i.e. XPages libraries) Allows dynamically enabling “production” XPages settings like resource aggregation Allows applying a template name and version + build timestamp
  • 10.
  • 11.
  • 12.
    ODP Compiler Can bestandalone or part of a larger project tree Pairs beautifully with Tycho for OSGi compilation and the Assembly Plugin for distribution
  • 13.
    ODP Compiler Basic configurationis simple: put your ODP in an “odp” directory and add a pom.xml file above it Allows configuration during compilation: Update Site references for OSGi plugins Classpath JARs and Maven dependencies like jvm/lib/ext Override the ODP’s ACL in the pom.xml Add a template name and version on the fly Set the ODS level to target
  • 14.
  • 15.
    ODP Exporter Takes anNSF and creates an ODP Replicates the behavior of Designer’s source control support Except it’s not incremental (at least not yet) Can be used to export a local NSF file or a remote database Automatically applies Swiper cleanup to exported DXL
  • 16.
  • 17.
    ODP Exporter Can beused in lieu of Designer’s export sync It’s less convenient, but it’s also less fault-prone Very useful when someone on your team doesn’t use source control Useful to convert NSFs to processable text form I use it for exactly this when doing IP checks for OpenNTF
  • 18.
  • 19.
    NSF Deployment Deploys acompiled NSF to a server, optionally replacing an existing NSF’s design Allows you to sign the database as the server Provides for Continuous Deployment to a staging server Warning: this component is effectively “beta”
  • 20.
  • 21.
  • 22.
    Eclipse Extensions Configures theJava classpath Includes OSGi dependencies Adds categories for design elements with nice little pictures Adds DXL autocomplete via the schema files (To whoever at HCL maintains those: thank you)
  • 23.
    Eclipse Extensions ODP Javaclasses can directly reference plugins in the workspace Allows for refactoring across both the ODP and plugins, avoiding out-of-step bugs
  • 24.
  • 25.
  • 26.
    Generally Applicable The ODPis the “source of truth” NSFs only exist as development areas or deployable builds The build process versions and timestamps NTFs The build process is consistent every time Clean NSF output No unintended residue No “Copy Application” mis-clicks
  • 27.
    Single Developer, SimpleNSF Keeps focus on good source-control habits Maven configuration is very small Good way to dip into Jenkins Encourages versioning and discourages shoot-from-the-hip development Works with classic design elements, XPages or no
  • 28.
    Multi-Person Team, XPages Libraries Mavenmakes the OSGi bundle build process more consistent Any team member can make a full build Eclipse support allows Java refactoring across OSGi bundles and in- NSF Java classes Eclipse XSP editing allows some tasks to be done fully outside Designer
  • 29.
    Team With UncooperativeMembers If not everyone is on board, use the Exporter to make ODP snapshots The ODP becomes the source of truth In my case, I have a script I run periodically that exports a bunch of NSFs to ODPs It’s not the best workflow, but it’s better than the old ways
  • 30.
    NPM-based App Container Kickoff the NPM install/build with frontend-maven-plugin Include the built resources inside the NSF in WebContent Avoid worries of having to coax Designer into doing it https://frostillic.us/blog/posts/2020/7/17/nsf-odp-tooling-3-1-0- dynamically-including-web-resources
  • 31.
    Maven Assembly Plugin TheAssembly plugin allows you to create a final distribution ZIP In my case, I gather several dozen built NSFs, a couple update sites, support libraries, and instructions This happens at the end of every build, with a ZIP ready to hand off to admins I also use this in almost every one of my OpenNTF projects (Great way to get those LICENSE and NOTICE files in there!) (Saves your friendly IP manager some hassle!)
  • 32.
    Automated Builds -Jenkins, etc. With some setup, Jenkins can build your apps with every commit Pairs very well with Assembly projects https://frostillic.us/blog/posts/2020/8/27/ nsf-odp-tooling-setting-up-jenkins- builds
  • 33.
  • 34.
    Potential Future Additions Improvementsto deployment If anybody could get me the true “Replace Design” API call, I’d appreciate it Docker-based build runtime Work against a live NSF (“Designer-style”) Ability to edit agents in Eclipse Unit tests for in-NSF code
  • 35.