You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/06/10 13:38:30 UTC

[isis] 04/04: ISIS-2442: updates docs for docx

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2442
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 0460f575254ff5b79f3153a385503b9628c5224d
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jun 10 14:37:56 2021 +0100

    ISIS-2442: updates docs for docx
---
 .../comguide/modules/ROOT/pages/starter-apps.adoc  |   4 +-
 .../pages/index/docx/applib/DocxService.adoc       |  40 ++++++++
 .../docx/applib/DocxService~MergeDefinition.adoc   |  11 ++-
 core/adoc/modules/_overview/pages/about.adoc       |  17 +++-
 .../adoc/modules/secman/pages/setting-up.adoc      |   1 -
 .../adoc/modules/ROOT/partials/component-nav.adoc  |   2 +-
 subdomains/base/adoc/modules/base/nav.adoc         |   3 +-
 .../docx/{examples => attachments}/Template.docx   | Bin
 .../modules/docx/examples/input-exact-match.html   | 104 ++++++++-------------
 .../adoc/modules/docx/images/template-docx.png     | Bin 0 -> 472174 bytes
 .../docx/images/word-enable-developer-ribbon.png   | Bin 0 -> 435844 bytes
 subdomains/docx/adoc/modules/docx/nav.adoc         |   3 +-
 subdomains/docx/adoc/modules/docx/pages/about.adoc |  61 ++++++++++--
 .../isis/subdomains/docx/applib/DocxService.java   |   8 +-
 .../docx/applib/DocxService_merge_Test.java        |  66 ++++++-------
 .../isis/subdomains/docx/applib/IoHelper.java      |   6 +-
 subdomains/excel/adoc/modules/excel/nav.adoc       |   3 +-
 .../freemarker/adoc/modules/freemarker/nav.adoc    |   3 +-
 subdomains/ognl/adoc/modules/ognl/nav.adoc         |   3 +-
 subdomains/pdfbox/adoc/modules/pdfbox/nav.adoc     |   3 +-
 subdomains/spring/adoc/modules/spring/nav.adoc     |   3 +-
 .../adoc/modules/spring/partials/module-nav.adoc   |   2 +-
 .../xdocreport/adoc/modules/xdocreport/nav.adoc    |   2 +-
 subdomains/zip/adoc/modules/zip/nav.adoc           |   3 +-
 24 files changed, 209 insertions(+), 139 deletions(-)

diff --git a/antora/components/comguide/modules/ROOT/pages/starter-apps.adoc b/antora/components/comguide/modules/ROOT/pages/starter-apps.adoc
index 3240cb7..0faa400 100644
--- a/antora/components/comguide/modules/ROOT/pages/starter-apps.adoc
+++ b/antora/components/comguide/modules/ROOT/pages/starter-apps.adoc
@@ -23,9 +23,9 @@ Doing it this way makes it easy to keep the branches in sync.
 . merge jdo-SNAPSHOT to jpa-SNAPSHOT, and fix any persistence differences
 
 [NOTE]
-----
+====
 If you do want to update the antora docs and have them updated on-line, then the procedure is to check out the released branch (M5) and make changes there.
 Then we build and copy over to the apache/isis-site repo to publish up to isis.apache.org.
-----
+====
 
 
diff --git a/antora/components/refguide-index/modules/subdomains/pages/index/docx/applib/DocxService.adoc b/antora/components/refguide-index/modules/subdomains/pages/index/docx/applib/DocxService.adoc
new file mode 100644
index 0000000..fd7bbbc
--- /dev/null
+++ b/antora/components/refguide-index/modules/subdomains/pages/index/docx/applib/DocxService.adoc
@@ -0,0 +1,40 @@
+= DocxService
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
+
+Provides a mail-merge capability.
+
+== API
+
+[source,java]
+.DocxService.java
+----
+class DocxService {
+  WordprocessingMLPackage loadPackage(final InputStream docxTemplate)     // <.>
+  void merge(final MergeDefinition mergeDefn)     // <.>
+}
+----
+
+<.> xref:#loadPackage__InputStream[loadPackage(InputStream)]
++
+--
+Load and return an in-memory representation of a docx.
+--
+<.> xref:#merge__MergeDefinition[merge(MergeDefinition)]
++
+--
+Merge the input arguments (as HTML) against the Docx template, writing out as a Word docx..
+--
+
+== Members
+
+[#loadPackage__InputStream]
+=== loadPackage(InputStream)
+
+Load and return an in-memory representation of a docx.
+
+This is public API because building the in-memory structure can be quite slow. Thus, clients can use this method to cache the in-memory structure, and pass it in the _MergeDefinition_ (through the _MergeDefinition.Builder#docxTemplateAsWpMlPackage(WordprocessingMLPackage) builder method_ )
+
+[#merge__MergeDefinition]
+=== merge(MergeDefinition)
+
+Merge the input arguments (as HTML) against the Docx template, writing out as a Word docx..
diff --git a/subdomains/freemarker/adoc/modules/freemarker/nav.adoc b/antora/components/refguide-index/modules/subdomains/pages/index/docx/applib/DocxService~MergeDefinition.adoc
similarity index 86%
copy from subdomains/freemarker/adoc/modules/freemarker/nav.adoc
copy to antora/components/refguide-index/modules/subdomains/pages/index/docx/applib/DocxService~MergeDefinition.adoc
index adfee28..2e98e0c 100644
--- a/subdomains/freemarker/adoc/modules/freemarker/nav.adoc
+++ b/antora/components/refguide-index/modules/subdomains/pages/index/docx/applib/DocxService~MergeDefinition.adoc
@@ -1,5 +1,12 @@
-
+= DocxService.MergeDefinition
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
+== API
+
+[source,java]
+.DocxService~MergeDefinition.java
+----
+class MergeDefinition {
+}
+----
 
diff --git a/core/adoc/modules/_overview/pages/about.adoc b/core/adoc/modules/_overview/pages/about.adoc
index 8786da7..1ddb743 100644
--- a/core/adoc/modules/_overview/pages/about.adoc
+++ b/core/adoc/modules/_overview/pages/about.adoc
@@ -5074,9 +5074,24 @@ Artifact: isis-subdomains-docx-applib
 Type: jar
 Directory: /subdomains/docx/applib
 ----
-|.Dependencies
+|.Components
+****
+o.a.i.subdomains.docx.applib.DocxService +
+****
+
+.Dependencies
 ****
+com.google.guava:guava:jar:<managed> +
 org.apache.isis.core:isis-applib:jar:<managed> +
+org.apache.isis.testing:isis-testing-unittestsupport-applib:jar:<managed> +
+org.docx4j:docx4j-JAXB-ReferenceImpl:jar:<managed> +
+org.docx4j:docx4j-export-fo:jar:<managed> +
+org.jdom:jdom2:jar:<managed> +
+****
+
+.Document Index Entries
+****
+xref:refguide:subdomains:index/docx/applib/DocxService.adoc[DocxService], xref:refguide:subdomains:index/docx/applib/DocxService~MergeDefinition.adoc[DocxService.MergeDefinition]
 ****
 
 |Apache Isis Sub - Freemarker (parent)
diff --git a/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc b/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc
index 6498f9b..ce9a0b5 100644
--- a/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc
+++ b/extensions/security/secman/adoc/modules/secman/pages/setting-up.adoc
@@ -427,7 +427,6 @@ public class UserToRole__joe_UserRw_but_NoDelete
 ----
 <.> application-specific roles
 <.> regular user access (always required)
-<.> specific access to framework features, see <<default-roles,above>>
 
 To seed in fixture scripts we could create a top-level `CustomRolesAndUsers` script (as mentioned in <<custom-seed-service,above>>).
 This would then look something like:
diff --git a/subdomains/adoc/modules/ROOT/partials/component-nav.adoc b/subdomains/adoc/modules/ROOT/partials/component-nav.adoc
index 5fd1e23..9f53811 100644
--- a/subdomains/adoc/modules/ROOT/partials/component-nav.adoc
+++ b/subdomains/adoc/modules/ROOT/partials/component-nav.adoc
@@ -3,7 +3,7 @@ include::subdomains:ROOT:partial$module-nav.adoc[]
 // commented out the libraries that have not yet been brought over from incode-platform
 
 include::subdomains:base:partial$module-nav.adoc[]
-//include::subdomains:docx:partial$module-nav.adoc[]
+include::subdomains:docx:partial$module-nav.adoc[]
 include::subdomains:excel:partial$module-nav.adoc[]
 //include::subdomains:freemarker:partial$module-nav.adoc[]
 //include::subdomains:ognl:partial$module-nav.adoc[]
diff --git a/subdomains/base/adoc/modules/base/nav.adoc b/subdomains/base/adoc/modules/base/nav.adoc
index adfee28..dbad73b 100644
--- a/subdomains/base/adoc/modules/base/nav.adoc
+++ b/subdomains/base/adoc/modules/base/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/docx/adoc/modules/docx/examples/Template.docx b/subdomains/docx/adoc/modules/docx/attachments/Template.docx
similarity index 100%
rename from subdomains/docx/adoc/modules/docx/examples/Template.docx
rename to subdomains/docx/adoc/modules/docx/attachments/Template.docx
diff --git a/subdomains/docx/adoc/modules/docx/examples/input-exact-match.html b/subdomains/docx/adoc/modules/docx/examples/input-exact-match.html
index 2a68d04..e28bfb4 100644
--- a/subdomains/docx/adoc/modules/docx/examples/input-exact-match.html
+++ b/subdomains/docx/adoc/modules/docx/examples/input-exact-match.html
@@ -1,67 +1,41 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <html>
-	<body>
-		<p id="PPSN" class="plain">1234567A</p>
-		<p id="CustomerName" class="plain">Mrs Fidelma O'Leary</p>
-		<p id="Date" class="date">31/1/2012</p>
-		<p id="Decision" class="rich">
-			I am writing to you about your claim for jobseeker's credits. I have
-			decided that you are not entitled to this benefit.
-		</p>
-		<p id="Decision2" class="rich">
-			What follows below is a table that has been merged in, adding 
-			additional rows dynamically as necessary based on the input data.
-		</p>
-		<ul id="Reasons2">
-			<li>
-				<p>This is some reason text (without a following
-					paragraph)</p>
-			</li>
-			<li>
-				<p>This would be some additional the reason text</p>
-				<p>This reason has one additional text paragraph, eg documenting
-					the grounds</p>
-			</li>
-			<li>
-				<p>This is a final reason text</p>
-				<p>It has two additional paragraphs below it, eg one for the
-O					grounds...</p>
-				<p>... and another one for the legislation.</p>
-			</li>
-		</ul>
-		<table id="Relatives">
-			<tr>
-				<td>Charlie O'Leary</td>
-				<td>Husband</td>
-				<td></td>
-			</tr>
-			<tr>
-				<td>Mary O'Leary</td>
-				<td>Daughter</td>
-				<td>14</td>
-				<!-- missing a td -->
-			</tr>
-			<tr>
-				<td>Billy O'Leary</td>
-				<td>Son</td>
-				<td>11</td>
-				<td>this td is ignored</td>
-			</tr>
-			<tr>
-				<td>Laura O'Leary</td>
-				<td>Daughter</td>
-				<!-- missing a td -->
-			</tr>
-			<tr>
-				<td>Betty O'Leary</td>
-				<td>Daughter</td>
-				<td>6</td>
-			</tr>
-			<tr>
-				<td>Maud Donoghue</td>
-				<td>Mother</td>
-				<td></td>
-			</tr>
-		</table>
-	</body>
-</html>
\ No newline at end of file
+  <body>
+    <p id="PPSN" class="plain">1234567A</p>
+    <p id="CustomerName" class="plain">Mrs Fidelma O'Leary</p>
+    <p id="Date" class="date">31/1/2012</p>
+    <p id="Decision" class="rich">
+      I am writing to you about your claim for jobseeker's credits. I have
+      decided that you are not entitled to this benefit.
+    </p>
+    <p id="Decision2" class="rich">
+      What follows below is a table that has been merged in, adding
+      additional rows dynamically as necessary based on the input data.
+    </p>
+    <ul id="Reasons2">
+      <li>
+        <p>This is some reason text (without a following
+          paragraph)</p>
+      </li>
+      <li>
+        <p>This would be some additional the reason text</p>
+        <p>This reason has one additional text paragraph, eg documenting
+          the grounds</p>
+      </li>
+			<!-- ... -->
+    </ul>
+    <table id="Relatives">
+      <tr>
+        <td>Charlie O'Leary</td>
+        <td>Husband</td>
+        <td></td>
+      </tr>
+      <tr>
+        <td>Mary O'Leary</td>
+        <td>Daughter</td>
+        <td>14</td>
+      </tr>
+			<!-- ... -->
+    </table>
+  </body>
+</html>
diff --git a/subdomains/docx/adoc/modules/docx/images/template-docx.png b/subdomains/docx/adoc/modules/docx/images/template-docx.png
new file mode 100644
index 0000000..bd007c8
Binary files /dev/null and b/subdomains/docx/adoc/modules/docx/images/template-docx.png differ
diff --git a/subdomains/docx/adoc/modules/docx/images/word-enable-developer-ribbon.png b/subdomains/docx/adoc/modules/docx/images/word-enable-developer-ribbon.png
new file mode 100644
index 0000000..d5325d2
Binary files /dev/null and b/subdomains/docx/adoc/modules/docx/images/word-enable-developer-ribbon.png differ
diff --git a/subdomains/docx/adoc/modules/docx/nav.adoc b/subdomains/docx/adoc/modules/docx/nav.adoc
index adfee28..dbad73b 100644
--- a/subdomains/docx/adoc/modules/docx/nav.adoc
+++ b/subdomains/docx/adoc/modules/docx/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/docx/adoc/modules/docx/pages/about.adoc b/subdomains/docx/adoc/modules/docx/pages/about.adoc
index 56058e5..be0bd40 100644
--- a/subdomains/docx/adoc/modules/docx/pages/about.adoc
+++ b/subdomains/docx/adoc/modules/docx/pages/about.adoc
@@ -4,12 +4,7 @@
 
 This module provides a mail-merge capability of input data into an MS Word `.docx` templates.
 The generated output document is either Word `.docx` or Acrobat `.pdf`.
-
-[IMPORTANT]
-====
-Exporting to PDF requires more memory, both heap and permgen.
-If the PDF generation hangs then increase the memory settings, eg `-Xmx1024m -XX:MaxPermSize=128m`
-====
+(Be aware that exporting to PDF requires more memory).
 
 The module consists of a single domain service, `DocxService`.
 This provides an API to merge a `.docx` template against its input data. The input data is represented as a simple HTML file.
@@ -23,10 +18,11 @@ The service supports several data types:
 * bulleted list
 * tables
 
-The implementation uses link:http://www.docx4java.org[docx4j], link:https://code.google.com/p/guava-libraries/[guava] and link:http://www.jdom.org[jdom2].
+The implementation uses link:http://www.docx4java.org[docx4j] and link:http://www.jdom.org[jdom2].
 Databinding to custom XML parts (the `.docx` file format's in-built support) is *not* used (as repeating datasets - required for lists and tables - was not supported prior to Word 2013).
 
 
+
 include::docs:mavendeps:partial$setup-and-configure-dependencyManagement.adoc[leveloffset=+1]
 
 In addition, add a section for the BOM of all subdomains:
@@ -71,12 +67,59 @@ To output to PDF, the following dependency must also be added:
 <dependency>
     <groupId>org.docx4j</groupId>
     <artifactId>docx4j-export-fo</artifactId>
-    <scope>test</scope>
 </dependency>
 ----
 
 
-
 == Usage
 
+The `.docx` templates use Word custom content controls as placeholders.
+The actions to work with these placeholders can be enabled by toggling on the "Developer" menu:
+
+image::word-enable-developer-ribbon.png[width=400px]
+
+You can then toggle on _Design Mode_ to create/edit/remove custom content controls.
+
+[[template-docx]]
+For example, see link:{attachmentsdir}/Template.docx[Template.docx].
+
+image::template-docx.png[width=600px]
+
+To programmatically mail-merge into the template, we create a HTML document that provides the input.
+For example:
+
+[[input-html]]
+[source,xhtml]
+.input HTML
+----
+include::example$input-exact-match.html[]
+----
+
+We also parse the template into an internal data structure.
+This is usually done during bootstrapping as it is almost certainly immutable, and the parsing can take a second or two:
+
+[source,java]
+----
+WordprocessingMLPackage docxTemplate =
+    docxService.loadPackage(io.openInputStream("Template.docx"));
+----
+
+We then merge in the input to the template as follows:
+
+[source,java]
+----
+val baos = new ByteArrayOutputStream();
+val params = DocxService.MergeParams.builder()
+        .docxTemplateAsWpMlPackage(docxTemplate)            // <.>
+        .inputAsHtml(inputHtml)                             // <.>
+        .matchingPolicy(DocxService.MatchingPolicy.STRICT)
+        .outputType(DocxService.OutputType.DOCX)
+        .output(baos)
+        .build();
+docxService.merge(params);
+
+final byte[] docxActual = baos.toByteArray();
+----
 
+<.> docx template, as shown <<template-docx,above>>
+<.> input HTML, as shown <<input-html,above>>
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/DocxService.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/DocxService.java
index 78c6aca..3b4b7a9 100644
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/DocxService.java
+++ b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/DocxService.java
@@ -59,7 +59,7 @@ public class DocxService {
      */
     @Getter
     @Builder(builderClassName = "Builder")
-    public static class MergeDefinition {
+    public static class MergeParams {
 
         /**
          * Defines the policy for matching input to placeholders.
@@ -140,8 +140,8 @@ public class DocxService {
      * <p>
      * This is public API because building the in-memory structure can be
      * quite slow.  Thus, clients can use this method to cache the in-memory
-     * structure, and pass it in the {@link MergeDefinition} (through the
-     * {@link MergeDefinition.Builder#docxTemplateAsWpMlPackage(WordprocessingMLPackage) builder method})
+     * structure, and pass it in the {@link MergeParams} (through the
+     * {@link MergeParams.Builder#docxTemplateAsWpMlPackage(WordprocessingMLPackage) builder method})
      */
     public WordprocessingMLPackage loadPackage(final InputStream docxTemplate) throws LoadTemplateException {
         final WordprocessingMLPackage docxPkg;
@@ -156,7 +156,7 @@ public class DocxService {
     /**
      * Merge the input arguments (as HTML) against the Docx template, writing out as a Word docx..
      */
-    public void merge(final MergeDefinition mergeDefn) throws LoadInputException, LoadTemplateException, MergeException {
+    public void merge(final MergeParams mergeDefn) throws LoadInputException, LoadTemplateException, MergeException {
 
         final org.jdom2.Document htmlJdomDoc;
         final Document inputAsHtmlDoc = mergeDefn.getInputAsHtmlDoc();
diff --git a/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/DocxService_merge_Test.java b/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/DocxService_merge_Test.java
index 61a963a..3569cda 100644
--- a/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/DocxService_merge_Test.java
+++ b/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/DocxService_merge_Test.java
@@ -1,6 +1,5 @@
 package org.apache.isis.subdomains.docx.applib;
 
-import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 
@@ -31,8 +30,7 @@ class DocxService_merge_Test {
         docxService = new DocxService();
 
         // given
-        final ByteArrayInputStream docxInputTemplate = io.asBais("Template.docx");
-        docxTemplate = docxService.loadPackage(docxInputTemplate);
+        docxTemplate = docxService.loadPackage(io.openInputStream("Template.docx"));
 
     }
 
@@ -46,12 +44,14 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-exact-match.html"))
+            val params = DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
+                    .matchingPolicy(DocxService.MatchingPolicy.STRICT)
+                    .outputType(DocxService.OutputType.DOCX)
                     .output(baos)
-                    .build());
+                    .build();
+            docxService.merge(params);
 
             // then
             final byte[] docxActual = baos.toByteArray();
@@ -80,8 +80,8 @@ class DocxService_merge_Test {
             Assertions.assertThrows(MergeException.class, () -> {
 
                 // when
-                docxService.merge(DocxService.MergeDefinition.builder()
-                        .inputAsHtml(io.asString("input-surplus.html"))
+                docxService.merge(DocxService.MergeParams.builder()
+                        .inputAsHtml(io.readFileAsString("input-surplus.html"))
                         .docxTemplateAsWpMlPackage(docxTemplate)
                         .output(new ByteArrayOutputStream())
                         .build());
@@ -97,8 +97,8 @@ class DocxService_merge_Test {
             Assertions.assertThrows(MergeException.class, () -> {
 
                 // when
-                docxService.merge(DocxService.MergeDefinition.builder()
-                        .inputAsHtml(io.asString("input-missing.html"))
+                docxService.merge(DocxService.MergeParams.builder()
+                        .inputAsHtml(io.readFileAsString("input-missing.html"))
                         .docxTemplateAsWpMlPackage(docxTemplate)
                         .output(new ByteArrayOutputStream())
                         .build());
@@ -118,8 +118,8 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-exact-match.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .matchingPolicy(matchingPolicy)
                     .output(baos)
@@ -135,8 +135,8 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-surplus.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-surplus.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .matchingPolicy(matchingPolicy)
                     .output(baos)
@@ -154,8 +154,8 @@ class DocxService_merge_Test {
             Assertions.assertThrows(MergeException.class, () -> {
 
                 // when
-                docxService.merge(DocxService.MergeDefinition.builder()
-                        .inputAsHtml(io.asString("input-missing.html"))
+                docxService.merge(DocxService.MergeParams.builder()
+                        .inputAsHtml(io.readFileAsString("input-missing.html"))
                         .docxTemplateAsWpMlPackage(docxTemplate)
                         .output(new ByteArrayOutputStream())
                         .build());
@@ -175,8 +175,8 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-exact-match.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .matchingPolicy(matchingPolicy)
                     .output(baos)
@@ -194,8 +194,8 @@ class DocxService_merge_Test {
             Assertions.assertThrows(MergeException.class, () -> {
 
                 // when
-                docxService.merge(DocxService.MergeDefinition.builder()
-                        .inputAsHtml(io.asString("input-surplus.html"))
+                docxService.merge(DocxService.MergeParams.builder()
+                        .inputAsHtml(io.readFileAsString("input-surplus.html"))
                         .docxTemplateAsWpMlPackage(docxTemplate)
                         .output(new ByteArrayOutputStream())
                         .build());
@@ -208,8 +208,8 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-missing.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-missing.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .matchingPolicy(matchingPolicy)
                     .output(baos)
@@ -231,8 +231,8 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-exact-match.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .matchingPolicy(matchingPolicy)
                     .output(baos)
@@ -248,8 +248,8 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-surplus.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-surplus.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .matchingPolicy(matchingPolicy)
                     .output(baos)
@@ -265,8 +265,8 @@ class DocxService_merge_Test {
 
             // when
             val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-missing.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-missing.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .matchingPolicy(matchingPolicy)
                     .output(baos)
@@ -288,8 +288,8 @@ class DocxService_merge_Test {
 
             Assertions.assertThrows(LoadInputException.class, () -> {
 
-                docxService.merge(DocxService.MergeDefinition.builder()
-                        .inputAsHtml(io.asString("input-malformed.html"))
+                docxService.merge(DocxService.MergeParams.builder()
+                        .inputAsHtml(io.readFileAsString("input-malformed.html"))
                         .matchingPolicy(DocxService.MatchingPolicy.LAX)
                         .docxTemplateAsWpMlPackage(docxTemplate)
                         .output(new ByteArrayOutputStream())
@@ -321,8 +321,8 @@ class DocxService_merge_Test {
             // when
             val baos = new ByteArrayOutputStream();
 
-            docxService.merge(DocxService.MergeDefinition.builder()
-                    .inputAsHtml(io.asString("input-exact-match.html"))
+            docxService.merge(DocxService.MergeParams.builder()
+                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
                     .docxTemplateAsWpMlPackage(docxTemplate)
                     .outputType(DocxService.OutputType.PDF)
                     .output(baos)
diff --git a/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/IoHelper.java b/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/IoHelper.java
index e6a3315..df6700e 100644
--- a/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/IoHelper.java
+++ b/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/IoHelper.java
@@ -34,18 +34,18 @@ class IoHelper {
 
 
     public ByteArrayOutputStream asBaos(String fileName) throws IOException {
-        final ByteArrayInputStream bais = asBais(fileName);
+        final ByteArrayInputStream bais = openInputStream(fileName);
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ByteStreams.copy(bais, baos);
         return baos;
     }
 
-    public String asString(final String fileName) throws IOException {
+    public String readFileAsString(final String fileName) throws IOException {
         final URL fileUrl = asUrl(fileName);
         return Resources.toString(fileUrl, Charset.forName("UTF-8"));
     }
 
-    public ByteArrayInputStream asBais(final String fileName) throws IOException {
+    public ByteArrayInputStream openInputStream(final String fileName) throws IOException {
         final URL fileUrl = asUrl(fileName);
         return new ByteArrayInputStream(Resources.toByteArray(fileUrl));
     }
diff --git a/subdomains/excel/adoc/modules/excel/nav.adoc b/subdomains/excel/adoc/modules/excel/nav.adoc
index adfee28..dbad73b 100644
--- a/subdomains/excel/adoc/modules/excel/nav.adoc
+++ b/subdomains/excel/adoc/modules/excel/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/freemarker/adoc/modules/freemarker/nav.adoc b/subdomains/freemarker/adoc/modules/freemarker/nav.adoc
index adfee28..dbad73b 100644
--- a/subdomains/freemarker/adoc/modules/freemarker/nav.adoc
+++ b/subdomains/freemarker/adoc/modules/freemarker/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/ognl/adoc/modules/ognl/nav.adoc b/subdomains/ognl/adoc/modules/ognl/nav.adoc
index adfee28..dbad73b 100644
--- a/subdomains/ognl/adoc/modules/ognl/nav.adoc
+++ b/subdomains/ognl/adoc/modules/ognl/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/pdfbox/adoc/modules/pdfbox/nav.adoc b/subdomains/pdfbox/adoc/modules/pdfbox/nav.adoc
index adfee28..dbad73b 100644
--- a/subdomains/pdfbox/adoc/modules/pdfbox/nav.adoc
+++ b/subdomains/pdfbox/adoc/modules/pdfbox/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/spring/adoc/modules/spring/nav.adoc b/subdomains/spring/adoc/modules/spring/nav.adoc
index afdc817..dbad73b 100644
--- a/subdomains/spring/adoc/modules/spring/nav.adoc
+++ b/subdomains/spring/adoc/modules/spring/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:spring:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/spring/adoc/modules/spring/partials/module-nav.adoc b/subdomains/spring/adoc/modules/spring/partials/module-nav.adoc
index 2d9bc19..5e19816 100644
--- a/subdomains/spring/adoc/modules/spring/partials/module-nav.adoc
+++ b/subdomains/spring/adoc/modules/spring/partials/module-nav.adoc
@@ -1,6 +1,6 @@
 
 
 
-* xref:subdomains:spring:about.adoc[Spring]
+* xref:subdomains:spring:about.adoc[Spring Library]
 
 
diff --git a/subdomains/xdocreport/adoc/modules/xdocreport/nav.adoc b/subdomains/xdocreport/adoc/modules/xdocreport/nav.adoc
index 173ce99..dbad73b 100644
--- a/subdomains/xdocreport/adoc/modules/xdocreport/nav.adoc
+++ b/subdomains/xdocreport/adoc/modules/xdocreport/nav.adoc
@@ -1,4 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-include::extensions:ROOT:partial$component-nav.adoc[]
 
+include::subdomains:ROOT:partial$component-nav.adoc[]
diff --git a/subdomains/zip/adoc/modules/zip/nav.adoc b/subdomains/zip/adoc/modules/zip/nav.adoc
index adfee28..dbad73b 100644
--- a/subdomains/zip/adoc/modules/zip/nav.adoc
+++ b/subdomains/zip/adoc/modules/zip/nav.adoc
@@ -1,5 +1,4 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-include::extensions:ROOT:partial$component-nav.adoc[]
-
+include::subdomains:ROOT:partial$component-nav.adoc[]