- XPages: The UI Toolkit and the App Framework
- The RuntimeEnvironment Idiom
- NSF ODP Tooling 3.1.0: Dynamically Including Web Resources
I just released version 3.1.0 of the NSF ODP Tooling project and, while I entirely forgot to make a blog post about 3.0 the other week, I think that one the additions in this one deserves some special mention.
In one of my client projects, we're replacing an old XPages-based UI with an Angular UI backed by our set of JAX-RS resources. This is part of the same sprawling client app I've mentioned a few times so far, but this is a new module within it and doesn't face the same "convert from XPages mid-flight" remit. Since the UI itself is just going to be a bunch of static resource files, that freed up our options for presenting it to the user. In order to keep the benefits of using Domino ACLs, I figured that wrapping it up in an NSF would be the way to go.
The way to do this is to bring your (potentially-transpiled) HTML/JS/CSS files into the
WebContent folder in the NSF's Package Explorer representation, either manually or by coaxing Designer to sync it in for you.
My purpose in life is to eliminate Designer from existence, though, so I certainly couldn't be content with that. Instead, I adapted a Maven-based technique for building WAR-packaged JS apps to emit an NSF.
The Project Structure
From that "Targeting Domino for Webapps Incidentally" post, the pertinent part is the use of
- Repository Root
My goal is to be able to kick off a Maven build, have it run the NPM build of the JS project in its separate directory, and then pull in the results for the final NSF, all automatically.
The Maven Configuration
frontend-maven-plugin and the NSF ODP Tooling, that's exactly what I get. Here's the
<build> section of the ODP project's pom:
Now, the final result will be an NSF with whatever other design elements are needed, ready to be deployed with a design replace/refresh. In my client's case, that ends up also getting bundled up into the distribution ZIP, but in a basic case the NSF would be enough.