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 2022/04/12 17:41:44 UTC

[isis] 06/12: ISIS-2999: removes subdomains/docx

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

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

commit 81f259e5806437def0034ed050a347c8fa8053c2
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Apr 11 19:18:50 2022 +0100

    ISIS-2999: removes subdomains/docx
---
 bom/pom.xml                                        |   3 -
 subdomains/docx/adoc/antora.yml                    |  19 -
 .../adoc/modules/docx/attachments/Template.docx    | Bin 28756 -> 0 bytes
 .../modules/docx/examples/input-exact-match.html   |  41 ---
 .../adoc/modules/docx/images/template-docx.png     | Bin 472174 -> 0 bytes
 .../docx/images/word-enable-developer-ribbon.png   | Bin 435844 -> 0 bytes
 subdomains/docx/adoc/modules/docx/nav.adoc         |   4 -
 subdomains/docx/adoc/modules/docx/pages/about.adoc | 125 -------
 .../adoc/modules/docx/partials/module-nav.adoc     |   6 -
 subdomains/docx/applib/pom.xml                     |  98 ------
 .../isis/subdomains/docx/applib/DocxService.java   | 166 ---------
 .../applib/IsisModuleSubdomainsDocxApplib.java     |  32 --
 .../applib/exceptions/DocxServiceException.java    |  31 --
 .../docx/applib/exceptions/LoadInputException.java |  26 --
 .../applib/exceptions/LoadTemplateException.java   |  26 --
 .../docx/applib/exceptions/MergeException.java     |  29 --
 .../docx/applib/service/DocxServiceDefault.java    | 385 ---------------------
 .../docx/applib/traverse/AllMatches.java           |  60 ----
 .../docx/applib/traverse/CallbackAbstract.java     |  50 ---
 .../docx/applib/traverse/FirstMatch.java           |  65 ----
 .../isis/subdomains/docx/applib/util/Docx.java     | 117 -------
 .../isis/subdomains/docx/applib/util/Dump.java     | 203 -----------
 .../isis/subdomains/docx/applib/util/Jdom2.java    |  96 -----
 .../isis/subdomains/docx/applib/util/Types.java    |  32 --
 .../applib/src/main/resources/docx4j.properties    |  48 ---
 .../docx/applib/DocxService_merge_Test.java        | 371 --------------------
 .../isis/subdomains/docx/applib/IoHelper.java      | 116 -------
 .../subdomains/docx/applib/Output-Expected.docx    | Bin 29005 -> 0 bytes
 .../subdomains/docx/applib/Output-Expected.pdf     | Bin 84424 -> 0 bytes
 .../isis/subdomains/docx/applib/Template.docx      | Bin 28756 -> 0 bytes
 .../subdomains/docx/applib/input-exact-match.html  |  67 ----
 .../subdomains/docx/applib/input-malformed.html    |  69 ----
 .../isis/subdomains/docx/applib/input-missing.html |  69 ----
 .../isis/subdomains/docx/applib/input-surplus.html |  70 ----
 subdomains/docx/pom.xml                            |  33 --
 subdomains/pom.xml                                 |   7 -
 36 files changed, 2464 deletions(-)

diff --git a/bom/pom.xml b/bom/pom.xml
index 98cf432397..a80aecd8d5 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -635,9 +635,6 @@ under the License.
 							<exclude>**/_nav.adoc</exclude>
 							<exclude>**/_overview/nav.adoc</exclude>
 
-							<exclude>**/src/test/resources/org/apache/isis/subdomains/docx/applib/*.html</exclude>
-							<exclude>**/adoc/modules/docx/examples/*.html</exclude>
-
 							<exclude>**/application.js</exclude>
 
 							<exclude>**/jquery.zclip.js</exclude>
diff --git a/subdomains/docx/adoc/antora.yml b/subdomains/docx/adoc/antora.yml
deleted file mode 100644
index 1044dbbd29..0000000000
--- a/subdomains/docx/adoc/antora.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-#  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 agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-name: subdomains
-version: latest
diff --git a/subdomains/docx/adoc/modules/docx/attachments/Template.docx b/subdomains/docx/adoc/modules/docx/attachments/Template.docx
deleted file mode 100644
index d6cef7c57f..0000000000
Binary files a/subdomains/docx/adoc/modules/docx/attachments/Template.docx and /dev/null differ
diff --git a/subdomains/docx/adoc/modules/docx/examples/input-exact-match.html b/subdomains/docx/adoc/modules/docx/examples/input-exact-match.html
deleted file mode 100644
index e28bfb4a20..0000000000
--- a/subdomains/docx/adoc/modules/docx/examples/input-exact-match.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>
-			<!-- ... -->
-    </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
deleted file mode 100644
index bd007c8a7e..0000000000
Binary files a/subdomains/docx/adoc/modules/docx/images/template-docx.png and /dev/null 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
deleted file mode 100644
index d5325d29d1..0000000000
Binary files a/subdomains/docx/adoc/modules/docx/images/word-enable-developer-ribbon.png and /dev/null differ
diff --git a/subdomains/docx/adoc/modules/docx/nav.adoc b/subdomains/docx/adoc/modules/docx/nav.adoc
deleted file mode 100644
index dbad73b19b..0000000000
--- a/subdomains/docx/adoc/modules/docx/nav.adoc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-: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::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
deleted file mode 100644
index be0bd40db3..0000000000
--- a/subdomains/docx/adoc/modules/docx/pages/about.adoc
+++ /dev/null
@@ -1,125 +0,0 @@
-= Docx Subdomain
-
-: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 [...]
-
-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`.
-(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.
-
-
-The service supports several data types:
-
-* plain text
-* rich text
-* date
-* bulleted list
-* tables
-
-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:
-
-[source,xml,subs="attributes+"]
-.pom.xml
-----
-<dependencyManagement>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.isis.subdomains</groupId>
-            <artifactId>isis-subdomains</artifactId>
-            <scope>import</scope>
-            <type>pom</type>
-            <version>{page-isisrel}</version>
-        </dependency>
-    </dependencies>
-</dependencyManagement>
-----
-
-[#dependencies]
-== Dependencies
-
-In the domain module(s) of your application, add the following dependency:
-
-[source,xml]
-.pom.xml
-----
-<dependencies>
-    <dependency>
-        <groupId>org.apache.isis.subdomains</groupId>
-        <artifactId>isis-subdomains-docx-applib</artifactId>
-    </dependency>
-</dependencies>
-----
-
-To output to PDF, the following dependency must also be added:
-
-[source,xml]
-.pom.xml
-----
-<dependency>
-    <groupId>org.docx4j</groupId>
-    <artifactId>docx4j-export-fo</artifactId>
-</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/adoc/modules/docx/partials/module-nav.adoc b/subdomains/docx/adoc/modules/docx/partials/module-nav.adoc
deleted file mode 100644
index f81daf2930..0000000000
--- a/subdomains/docx/adoc/modules/docx/partials/module-nav.adoc
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-* xref:subdomains:docx:about.adoc[Docx Library]
-
-
diff --git a/subdomains/docx/applib/pom.xml b/subdomains/docx/applib/pom.xml
deleted file mode 100644
index 7fc6efcfdf..0000000000
--- a/subdomains/docx/applib/pom.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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 agreed to in writing, software distributed under the
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
-	OF ANY KIND, either express or implied. See the License for the specific
-	language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>org.apache.isis.subdomains</groupId>
-		<artifactId>isis-subdomains-docx</artifactId>
-		<version>2.0.0-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>isis-subdomains-docx-applib</artifactId>
-	<name>Apache Isis Sub - Docx (applib)</name>
-
-	<properties>
-		<!--
-		there are dependency convergence conflicts within docx4j's own dependency graph;
-		have decided it's not worth the effort of trying to resolve them
-		-->
-		<enforcer.skip>true</enforcer.skip>
-
-		<jar-plugin.automaticModuleName>org.apache.isis.subdomains.docx.applib</jar-plugin.automaticModuleName>
-		<git-plugin.propertiesDir>org/apache/isis/subdomains/docx/applib</git-plugin.propertiesDir>
-	</properties>
-
-	<dependencies>
-	
-		<dependency>
-			<groupId>org.apache.isis.commons</groupId>
-			<artifactId>isis-commons</artifactId>
-		</dependency>
-	
-		<dependency>
-			<groupId>org.apache.isis.core</groupId>
-			<artifactId>isis-applib</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.docx4j</groupId>
-			<artifactId>docx4j-JAXB-ReferenceImpl</artifactId>
-			<exclusions>
-				<exclusion>
-					<groupId>com.google.errorprone</groupId>
-					<artifactId>error_prone_annotations</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.glassfish.jaxb</groupId>
-					<artifactId>jaxb-runtime</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>jcl-over-slf4j</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.isis.testing</groupId>
-			<artifactId>isis-testing-unittestsupport-applib</artifactId>
-			<exclusions>
-				<exclusion>
-                    <groupId>org.jmock</groupId>
-					<artifactId>jmock-junit4</artifactId>
-                </exclusion>
-			</exclusions>
-			<scope>test</scope>
-		</dependency>
-
-		<dependency>
-			<groupId>org.docx4j</groupId>
-			<artifactId>docx4j-export-fo</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>com.google.guava</groupId>
-			<artifactId>guava</artifactId>
-			<scope>test</scope>
-			<exclusions>
-				<exclusion>
-					<groupId>com.google.errorprone</groupId>
-					<artifactId>error_prone_annotations</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-	</dependencies>
-
-</project>
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
deleted file mode 100644
index 25c3cb6c1b..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/DocxService.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package org.apache.isis.subdomains.docx.applib;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-
-import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
-
-import org.apache.isis.subdomains.docx.applib.DocxService.MergeParams;
-import org.apache.isis.subdomains.docx.applib.exceptions.LoadInputException;
-import org.apache.isis.subdomains.docx.applib.exceptions.LoadTemplateException;
-import org.apache.isis.subdomains.docx.applib.exceptions.MergeException;
-
-import lombok.Builder;
-import lombok.Getter;
-
-/**
- * Merges input HTML against a provided <i>docx</i> template, generating a <i>Word docx</i>.
- * @apiNote Was migrated from platform.incode.org.
- *
- * @since 2.x {@index}
- * @see "http://platform.incode.org/modules/lib/docx/lib-docx.html"
- */
-public interface DocxService {
-
-    /**
-     * Load and return an in-memory representation of a docx.
-     *
-     * <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 MergeParams} (through the
-     * {@link MergeParams.Builder#docxTemplateAsWpMlPackage(WordprocessingMLPackage) builder method})
-     */
-    WordprocessingMLPackage loadPackage(InputStream docxTemplate) throws LoadTemplateException;
-
-    /**
-     * Merge the input arguments (as HTML) against the Docx template, writing out as a Word docx..
-     */
-    void merge(MergeParams mergeDefn) throws LoadInputException, LoadTemplateException, MergeException;
-
-    /**
-     * @since 2.x {@index}
-     */
-    @Getter
-    @Builder(builderClassName = "Builder")
-    static class MergeParams {
-
-        /**
-         * Defines the policy for matching input to placeholders.
-         *
-         * <p>
-         *     Does not need to be specified, will default to {@link MatchingPolicy#STRICT strict}
-         * </p>
-         */
-        @lombok.Builder.Default private MatchingPolicy matchingPolicy = MatchingPolicy.STRICT;
-
-        /**
-         * Defines whether to output as Word docx or PDF.
-         *
-         * <p>
-         *     Does not need to be specified, will default to {@link OutputType#DOCX docx}.
-         * </p>
-         */
-        @lombok.Builder.Default private OutputType outputType = OutputType.DOCX;
-
-        /**
-         * Holds the input arguments to be merged into the template.
-         *
-         * <p>
-         * Either this or {@link #getInputAsHtmlDoc()} must be specified.
-         * Preference is given to {@link #getInputAsHtmlDoc()}.
-         * </p>
-         *
-         * @see #getInputAsHtmlDoc()
-         */
-        private String inputAsHtml;
-
-        /**
-         * Holds the input arguments to be merged into the template.
-         *
-         * <p>
-         * Either this or {@link #getInputAsHtml()} must be specified, with
-         * preference given to this.
-         * </p>
-         *
-         * @see #getInputAsHtml()
-         */
-        private org.w3c.dom.Document inputAsHtmlDoc;
-
-        /**
-         * Refers to the template with place holders to be merged into.
-         *
-         * <p>
-         *     Either this or {@link #getDocxTemplateAsWpMlPackage()} myst be
-         *     specified, with preference given to {@link #getDocxTemplateAsWpMlPackage()}
-         * </p>
-         *
-         * @see #getDocxTemplateAsWpMlPackage()
-         */
-        private InputStream docxTemplate;
-
-        /**
-         * Refers to the template with place holders to be merged into.
-         *
-         * <p>
-         *     Either this or {@link #getDocxTemplate()} myst be
-         *     specified, with preference given to this.
-         * </p>
-         *
-         * @see #getDocxTemplate()
-         */
-        private WordprocessingMLPackage docxTemplateAsWpMlPackage;
-
-        /**
-         * The output stream to write to.
-         */
-        private OutputStream output;
-
-    }
-
-    /**
-     * Defines the strategy as to whether placeholders must exactly input data
-     * (or whether there can be unmatched placeholders, or conversely unused input data).
-     */
-    enum MatchingPolicy {
-        STRICT(false, false),
-        ALLOW_UNMATCHED_INPUT(true, false),
-        ALLOW_UNMATCHED_PLACEHOLDERS(false, true),
-        /**
-         * Combination of both {@link #ALLOW_UNMATCHED_INPUT} and {@link #ALLOW_UNMATCHED_PLACEHOLDERS}.
-         */
-        LAX(true, true);
-        private final boolean allowUnmatchedInput;
-        private final boolean allowUnmatchedPlaceholders;
-
-        private MatchingPolicy(final boolean allowUnmatchedInput, final boolean allowUnmatchedPlaceholders) {
-            this.allowUnmatchedInput = allowUnmatchedInput;
-            this.allowUnmatchedPlaceholders = allowUnmatchedPlaceholders;
-        }
-
-        public void unmatchedInputs(final List<String> unmatched) throws MergeException {
-            if (!allowUnmatchedInput && !unmatched.isEmpty()) {
-                throw new MergeException("Input elements " + unmatched + " were not matched to placeholders");
-            }
-        }
-
-        public void unmatchedPlaceholders(final List<String> unmatched) throws MergeException {
-            if (!allowUnmatchedPlaceholders && !unmatched.isEmpty()) {
-                throw new MergeException("Placeholders " + unmatched + " were not matched to input");
-            }
-        }
-    }
-
-    /**
-     * The type of the file to generate
-     */
-    enum OutputType {
-        DOCX,
-        /**
-         * Support for PDF should be considered experimental.
-         */
-        PDF
-    }
-
-}
\ No newline at end of file
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/IsisModuleSubdomainsDocxApplib.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/IsisModuleSubdomainsDocxApplib.java
deleted file mode 100644
index 48af6c4643..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/IsisModuleSubdomainsDocxApplib.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-
-import org.apache.isis.subdomains.docx.applib.service.DocxServiceDefault;
-
-@Configuration
-@Import({
-    DocxServiceDefault.class
-})
-public class IsisModuleSubdomainsDocxApplib {
-
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/DocxServiceException.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/DocxServiceException.java
deleted file mode 100644
index f73b53de9b..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/DocxServiceException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.exceptions;
-
-public class DocxServiceException extends Exception {
-    public DocxServiceException(String message) {
-        super(message);
-    }
-
-    public DocxServiceException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    private static final long serialVersionUID = 1L;
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/LoadInputException.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/LoadInputException.java
deleted file mode 100644
index 79a42c41ba..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/LoadInputException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.exceptions;
-
-public class LoadInputException extends DocxServiceException {
-    private static final long serialVersionUID = 1L;
-    public LoadInputException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/LoadTemplateException.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/LoadTemplateException.java
deleted file mode 100644
index 95156fb6a2..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/LoadTemplateException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.exceptions;
-
-public class LoadTemplateException extends DocxServiceException {
-    private static final long serialVersionUID = 1L;
-    public LoadTemplateException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/MergeException.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/MergeException.java
deleted file mode 100644
index dfec81273d..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/exceptions/MergeException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.exceptions;
-
-public class MergeException extends DocxServiceException {
-    private static final long serialVersionUID = 1L;
-    public MergeException(String message) {
-        super(message);
-    }
-    public MergeException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/service/DocxServiceDefault.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/service/DocxServiceDefault.java
deleted file mode 100644
index a232ff34f3..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/service/DocxServiceDefault.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.service;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.annotation.Priority;
-import javax.inject.Named;
-
-import org.apache.commons.compress.utils.Lists;
-import org.apache.commons.io.IOUtils;
-import org.docx4j.Docx4J;
-import org.docx4j.XmlUtils;
-import org.docx4j.com.google.common.base.Objects;
-import org.docx4j.convert.out.FOSettings;
-import org.docx4j.fonts.IdentityPlusMapper;
-import org.docx4j.fonts.Mapper;
-import org.docx4j.openpackaging.exceptions.Docx4JException;
-import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
-import org.docx4j.wml.Body;
-import org.docx4j.wml.P;
-import org.docx4j.wml.R;
-import org.docx4j.wml.SdtElement;
-import org.docx4j.wml.Tbl;
-import org.docx4j.wml.Tc;
-import org.docx4j.wml.Tr;
-import org.jdom2.Content;
-import org.jdom2.Element;
-import org.jdom2.input.DOMBuilder;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.stereotype.Service;
-import org.w3c.dom.Document;
-
-import org.apache.isis.applib.annotation.PriorityPrecedence;
-import org.apache.isis.subdomains.docx.applib.DocxService;
-import org.apache.isis.subdomains.docx.applib.exceptions.LoadInputException;
-import org.apache.isis.subdomains.docx.applib.exceptions.LoadTemplateException;
-import org.apache.isis.subdomains.docx.applib.exceptions.MergeException;
-import org.apache.isis.subdomains.docx.applib.traverse.AllMatches;
-import org.apache.isis.subdomains.docx.applib.traverse.FirstMatch;
-import org.apache.isis.subdomains.docx.applib.util.Docx;
-import org.apache.isis.subdomains.docx.applib.util.Jdom2;
-import org.apache.isis.subdomains.docx.applib.util.Types;
-
-import lombok.val;
-
-@Service
-@Named("isis.sub.docx.DocxServiceDefault")
-@Priority(PriorityPrecedence.MIDPOINT)
-@Qualifier("Default")
-public class DocxServiceDefault implements DocxService {
-
-    @Override
-    public WordprocessingMLPackage loadPackage(final InputStream docxTemplate) throws LoadTemplateException {
-        final WordprocessingMLPackage docxPkg;
-        try {
-            docxPkg = WordprocessingMLPackage.load(docxTemplate);
-        } catch (final Docx4JException ex) {
-            throw new LoadTemplateException("Unable to load docx template from input stream", ex);
-        }
-        return docxPkg;
-    }
-
-    @Override
-    public void merge(final MergeParams mergeDefn) throws LoadInputException, LoadTemplateException, MergeException {
-
-        final org.jdom2.Document htmlJdomDoc;
-        final Document inputAsHtmlDoc = mergeDefn.getInputAsHtmlDoc();
-        final String inputAsHtml = mergeDefn.getInputAsHtml();
-        if(inputAsHtmlDoc != null) {
-            htmlJdomDoc = new DOMBuilder().build(inputAsHtmlDoc);
-        } else if (inputAsHtml != null) {
-            htmlJdomDoc = Jdom2.loadInput(inputAsHtml);
-        } else {
-            throw new IllegalArgumentException("Input HTML must be provided");
-        }
-
-        final DefensiveCopy defensiveCopy;
-        final WordprocessingMLPackage docxPkg;
-        final WordprocessingMLPackage docxTemplateAsWpMlPackage = mergeDefn.getDocxTemplateAsWpMlPackage();
-        final InputStream docxTemplate = mergeDefn.getDocxTemplate();
-        if(docxTemplateAsWpMlPackage != null) {
-            docxPkg = docxTemplateAsWpMlPackage;
-            defensiveCopy = DefensiveCopy.REQUIRED;
-        } else if (docxTemplate != null) {
-            docxPkg = loadPackage(docxTemplate);
-            defensiveCopy = DefensiveCopy.NOT_REQUIRED;
-        } else {
-            throw new IllegalArgumentException("Docx template HTML must be provided");
-        }
-
-        val output = mergeDefn.getOutput();
-        if(output == null) {
-            throw new IllegalArgumentException("Output stream must be provided");
-        }
-        merge(htmlJdomDoc, docxPkg, output, mergeDefn.getMatchingPolicy(), defensiveCopy, mergeDefn.getOutputType());
-    }
-
-    // -- HELPER
-
-    private void merge(
-            final org.jdom2.Document htmlDoc,
-            final WordprocessingMLPackage docxTemplateInput,
-            final OutputStream docxTarget,
-            final MatchingPolicy matchingPolicy,
-            final DefensiveCopy defensiveCopy,
-            final OutputType outputType)
-            throws MergeException {
-
-        final WordprocessingMLPackage docxTemplate =
-                defensiveCopy == DefensiveCopy.REQUIRED
-                        ? Docx.clone(docxTemplateInput)
-                        : docxTemplateInput;
-
-        try {
-            final Element bodyEl = Jdom2.htmlBodyFor(htmlDoc);
-            final Body docXBody = Docx.docxBodyFor(docxTemplate);
-
-            merge(bodyEl, docXBody, matchingPolicy);
-
-            if (outputType == OutputType.PDF) {
-
-
-                final FOSettings foSettings = Docx4J.createFOSettings();
-                foSettings.setOpcPackage(docxTemplate);
-
-                try {
-                    final Mapper fontMapper = new IdentityPlusMapper();
-                    docxTemplate.setFontMapper(fontMapper, true);
-                } catch (final Exception e) {
-                    throw new MergeException("unable to set font mapper for PDF generation", e);
-                }
-
-                // according to the documentation/examples the XSL transformation
-                // is slower but more feature complete than Docx4J.FLAG_EXPORT_PREFER_NONXSL
-
-                final int flags = Docx4J.FLAG_EXPORT_PREFER_XSL;
-
-                Docx4J.toFO(foSettings, docxTarget, flags);
-
-            } else {
-                final File tempTargetFile = createTempFile();
-                FileInputStream tempTargetFis = null;
-                try {
-                    docxTemplate.save(tempTargetFile);
-                    tempTargetFis = new FileInputStream(tempTargetFile);
-                    IOUtils.copy(tempTargetFis, docxTarget);
-                } finally {
-                    IOUtils.closeQuietly(tempTargetFis);
-                    tempTargetFile.delete();
-                }
-            }
-        } catch (final Docx4JException e) {
-            throw new MergeException("unable to write to target file", e);
-        } catch (final FileNotFoundException e) {
-            throw new MergeException("unable to read back from target file", e);
-        } catch (final IOException e) {
-            throw new MergeException("unable to generate output stream from temporary file", e);
-        }
-    }
-
-    private enum DefensiveCopy {
-        REQUIRED,
-        NOT_REQUIRED
-    }
-
-    private enum MergeType {
-        PLAIN("p.plain"),
-        RICH("p.rich"),
-        DATE("p.date"),
-        UL("ul") {
-            @Override
-            boolean merge(final Element htmlUl, final SdtElement sdtElement) {
-                final List<Element> htmlLiList = htmlUl.getChildren("li"); // can be empty
-
-                final List<P> docxPOrigList = AllMatches.<P>matching(sdtElement, Types.withType(P.class));
-                if (docxPOrigList.isEmpty()) {
-                    return false;
-                }
-
-                final List<P> docxPNewList = new ArrayList<P>();
-                for (final Element htmlLi : htmlLiList) {
-                    final List<Element> htmlPList = htmlLi.getChildren("p");
-
-                    for (int htmlPNum = 0; htmlPNum < htmlPList.size(); htmlPNum++) {
-                        final int numDocxPNum = docxPOrigList.size();
-                        final int docxPNum = numDocxPNum == 1 || htmlPNum == 0 ? 0 : 1;
-                        final P docxP = XmlUtils.deepCopy(docxPOrigList.get(docxPNum));
-                        docxPNewList.add(docxP);
-                        final R docxR = FirstMatch.<R>matching(docxP, Types.withType(R.class));
-                        final Element htmlP = htmlPList.get(htmlPNum);
-                        Docx.setText(docxR, Jdom2.textValueOf(htmlP));
-                    }
-                }
-
-                // remove original and replace with new
-                final List<Object> content = sdtElement.getSdtContent().getContent();
-                for (final P docxP : docxPOrigList) {
-                    content.remove(docxP);
-                }
-                for (final P docxP : docxPNewList) {
-                    content.add(docxP);
-                }
-                return true;
-            }
-        },
-        TABLE("table") {
-            @Override
-            boolean merge(final Element htmlTable, final SdtElement sdtElement) {
-
-                final List<Element> htmlTrOrigList = htmlTable.getChildren("tr"); // can be empty
-
-                final List<Object> docxContents = sdtElement.getSdtContent().getContent();
-                final Tbl docxTbl = FirstMatch.matching(docxContents, Types.withType(Tbl.class));
-                if (docxTbl == null) {
-                    return false;
-                }
-                final List<Tr> docxTrList = AllMatches.matching(docxTbl, Types.withType(Tr.class));
-                if (docxTrList.size() < 2) {
-                    // require a header row and one other
-                    return false;
-                }
-
-                final List<Tr> docxTrNewList = Lists.newArrayList();
-                for (int htmlRowNum = 0; htmlRowNum < htmlTrOrigList.size(); htmlRowNum++) {
-                    final Element htmlTr = htmlTrOrigList.get(htmlRowNum);
-
-                    final int numDocxBodyTr = docxTrList.size() - 1;
-                    final int docxTrNum = (htmlRowNum % numDocxBodyTr) + 1;
-                    final Tr docxTr = XmlUtils.deepCopy(docxTrList.get(docxTrNum));
-                    docxTrNewList.add(docxTr);
-                    final List<Tc> docxTcList = AllMatches.matching(docxTr.getContent(), Types.withType(Tc.class));
-                    final List<Element> htmlTdList = htmlTr.getChildren("td");
-                    final List<String> htmlCellValues =
-                            htmlTdList.stream().map(x -> Jdom2.textValue().apply(x))
-                            .collect(Collectors.toList());
-                    for (int cellNum = 0; cellNum < docxTcList.size(); cellNum++) {
-                        final Tc docxTc = docxTcList.get(cellNum);
-                        final String value = cellNum < htmlCellValues.size() ? htmlCellValues.get(cellNum) : "";
-                        final P docxP = FirstMatch.matching(docxTc.getContent(), Types.withType(P.class));
-                        if (docxP == null) {
-                            return false;
-                        }
-                        final R docxR = FirstMatch.matching(docxP, Types.withType(R.class));
-                        if (docxR == null) {
-                            return false;
-                        }
-                        Docx.setText(docxR, value);
-                    }
-                }
-                docxReplaceRows(docxTbl, docxTrList, docxTrNewList);
-                return true;
-            }
-
-            private void docxReplaceRows(final Tbl docxTbl, final List<Tr> docxTrList, final List<Tr> docxTrToAdd) {
-                final List<Object> docxTblContent = docxTbl.getContent();
-                boolean first = true;
-                for (final Tr docxTr : docxTrList) {
-                    if (first) {
-                        // header, do NOT remove
-                        first = false;
-                    } else {
-                        docxTblContent.remove(docxTr);
-                    }
-                }
-                for (final Tr docxTr : docxTrToAdd) {
-                    docxTblContent.add(docxTr);
-                }
-            }
-        };
-
-        private final String type;
-
-
-        private MergeType(final String type) {
-            this.type = type;
-        }
-
-        public static MergeType lookup(final String name, final String clazz) {
-            final String type = name + (clazz != null ? "." + clazz : "");
-            for (final MergeType mt : values()) {
-                if (Objects.equal(mt.type, type)) {
-                    return mt;
-                }
-            }
-            return null;
-        }
-
-        boolean merge(final Element htmlElement, final SdtElement docxElement) {
-            final String htmlTextValue = Jdom2.textValueOf(htmlElement);
-            if (htmlTextValue == null) {
-                return false;
-            }
-
-            final R docxR = FirstMatch.matching(docxElement, Types.withType(R.class));
-            if (docxR == null) {
-                return false;
-            }
-            return Docx.setText(docxR, htmlTextValue);
-        }
-    }
-
-    private static void merge(final Element htmlBody, final Body docXBody, final MatchingPolicy matchingPolicy) throws MergeException {
-        final List<String> matchedInputIds = Lists.newArrayList();
-        final List<String> unmatchedInputIds = Lists.newArrayList();
-
-        final List<Content> htmlBodyContents = htmlBody.getContent();
-        for (final Content input : htmlBodyContents) {
-            if (!(input instanceof Element)) {
-                continue;
-            }
-            mergeInto((Element) input, docXBody, matchedInputIds, unmatchedInputIds);
-        }
-
-        final List<String> unmatchedPlaceHolders = unmatchedPlaceholders(docXBody, matchedInputIds);
-
-        matchingPolicy.unmatchedInputs(unmatchedInputIds);
-        matchingPolicy.unmatchedPlaceholders(unmatchedPlaceHolders);
-    }
-
-    private static void mergeInto(final Element input, final Body docXBody, final List<String> matchedInputs, final List<String> unmatchedInputs) throws MergeException {
-
-        final String id = Jdom2.attrOf(input, "id");
-        if (id == null) {
-            throw new MergeException("Missing 'id' attribute for element within body of input HTML");
-        }
-
-        final MergeType mergeType = MergeType.lookup(input.getName(), Jdom2.attrOf(input, "class"));
-        if (mergeType == null) {
-            unmatchedInputs.add(id);
-            return;
-        }
-
-        final SdtElement docxElement = FirstMatch.matching(docXBody, Docx.withTagVal(id));
-        if (docxElement == null) {
-            unmatchedInputs.add(id);
-            return;
-        }
-
-        if (mergeType.merge(input, docxElement)) {
-            matchedInputs.add(id);
-        } else {
-            unmatchedInputs.add(id);
-        }
-    }
-
-    private static List<String> unmatchedPlaceholders(final Body docXBody, final List<String> matchedIds) {
-        final List<SdtElement> taggedElements = AllMatches.matching(docXBody, Docx.withAnyTag());
-        final List<String> unmatchedPlaceHolders = taggedElements.stream().map(x -> Docx.tagToValue().apply(x)).collect(Collectors.toList());
-        unmatchedPlaceHolders.removeAll(matchedIds);
-        return unmatchedPlaceHolders;
-    }
-
-    private static File createTempFile() throws MergeException {
-        try {
-            return File.createTempFile("docx", null);
-        } catch (final IOException ex) {
-            throw new MergeException("Unable to create temporary working file", ex);
-        }
-    }
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/AllMatches.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/AllMatches.java
deleted file mode 100644
index 21883bea6c..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/AllMatches.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.traverse;
-
-import java.util.List;
-import java.util.function.Predicate;
-
-import org.apache.commons.compress.utils.Lists;
-import org.docx4j.TraversalUtil;
-import org.docx4j.XmlUtils;
-
-public class AllMatches<T> extends CallbackAbstract {
-
-    public static <T> List<T> matching(Object docxObject, Predicate<Object> predicate) {
-        return new AllMatches<T>(docxObject, predicate).getResult();
-    }
-
-    private final Object parent;
-    private final Predicate<Object> predicate;
-
-    private final List<T> result = Lists.newArrayList();
-
-    AllMatches(Object parent, Predicate<Object> predicate) {
-        this.parent = parent;
-        this.predicate = predicate;
-    }
-
-    @SuppressWarnings("unchecked")
-    public List<Object> apply(Object o) {
-        o = XmlUtils.unwrap(o);
-
-        if(predicate.test(o)) {
-            this.result.add((T) o);
-            return null;
-        }
-        return null;
-    }
-
-    public List<T> getResult() {
-        new TraversalUtil(parent, this);
-        return this.result;
-    }
-
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/CallbackAbstract.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/CallbackAbstract.java
deleted file mode 100644
index bac7578189..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/CallbackAbstract.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.traverse;
-
-import java.util.List;
-
-import org.docx4j.TraversalUtil;
-import org.docx4j.TraversalUtil.Callback;
-import org.docx4j.XmlUtils;
-
-public abstract class CallbackAbstract implements Callback {
-    public void walkJAXBElements(Object parent) {
-        List<Object> children = getChildren(parent);
-        if (children == null) {
-            return;
-        }
-        for (Object o : children) {
-            // if wrapped in javax.xml.bind.JAXBElement, get its value
-            o = XmlUtils.unwrap(o);
-            apply(o);
-            if (shouldTraverse(o)) {
-                walkJAXBElements(o);
-            }
-        }
-    }
-
-    public List<Object> getChildren(Object o) {
-        return TraversalUtil.getChildrenImpl(o);
-    }
-
-    public boolean shouldTraverse(Object o) {
-        return true;
-    }
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/FirstMatch.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/FirstMatch.java
deleted file mode 100644
index c56ab5e93c..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/traverse/FirstMatch.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.traverse;
-
-import java.util.List;
-import java.util.function.Predicate;
-
-import org.docx4j.TraversalUtil;
-import org.docx4j.XmlUtils;
-
-
-public class FirstMatch<T> extends CallbackAbstract {
-
-    public static <T> T matching(Object docxObject, Predicate<Object> predicate) {
-        return new FirstMatch<T>(docxObject, predicate).getResult();
-    }
-
-    private final Object parent;
-    private final Predicate<Object> predicate;
-
-    private T result;
-
-    FirstMatch(Object parent, Predicate<Object> predicate) {
-        this.parent = parent;
-        this.predicate = predicate;
-    }
-
-    @Override
-    public boolean shouldTraverse(Object o) {
-        return result == null;
-    }
-
-    @SuppressWarnings("unchecked")
-    public List<Object> apply(Object o) {
-        o = XmlUtils.unwrap(o);
-
-        if(predicate.test(o)) {
-            this.result = (T) o;
-            return null;
-        }
-        return null;
-    }
-
-    public T getResult() {
-        new TraversalUtil(parent, this);
-        return this.result;
-    }
-
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Docx.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Docx.java
deleted file mode 100644
index cd37671421..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Docx.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.List;
-import java.util.function.Function;
-import java.util.function.Predicate;
-
-import javax.xml.bind.JAXBException;
-
-import org.docx4j.com.google.common.base.Objects;
-import org.docx4j.convert.in.FlatOpcXmlImporter;
-import org.docx4j.convert.out.flatOpcXml.FlatOpcXmlCreator;
-import org.docx4j.openpackaging.exceptions.Docx4JException;
-import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
-import org.docx4j.wml.Body;
-import org.docx4j.wml.R;
-import org.docx4j.wml.SdtElement;
-import org.docx4j.wml.Tag;
-
-import org.apache.isis.subdomains.docx.applib.exceptions.MergeException;
-
-import lombok.val;
-import lombok.experimental.UtilityClass;
-
-@UtilityClass
-public class Docx {
-
-    public Function<SdtElement, String> tagToValue() {
-        return input -> input.getSdtPr().getTag().getVal();
-    }
-
-    public Predicate<Object> withAnyTag() {
-        return object -> {
-            if(!(object instanceof SdtElement)) {
-                return false;
-            }
-            SdtElement sdtBlock = (SdtElement) object;
-            Tag tag = sdtBlock.getSdtPr().getTag();
-            return tag != null;
-        };
-    }
-
-    public Predicate<Object> withTagVal(final String tagVal) {
-        return object -> {
-            if(!(object instanceof SdtElement)) {
-                return false;
-            }
-            val sdtBlock = (SdtElement) object;
-            val tag = sdtBlock.getSdtPr().getTag();
-            return tag != null && Objects.equal(tagVal, tag.getVal());
-        };
-    }
-
-    @SuppressWarnings({ "rawtypes" })
-    public boolean setText(final R run, final String value) {
-        List<Object> runContent = run.getContent();
-        if(runContent.isEmpty()) {
-            return false;
-        }
-        val jaxbElObj = runContent.get(0);
-
-        if(!(jaxbElObj instanceof javax.xml.bind.JAXBElement)) {
-            return false;
-        }
-        val jaxbElement = (javax.xml.bind.JAXBElement) jaxbElObj;
-        val textObj = jaxbElement.getValue();
-        if(!(textObj instanceof org.docx4j.wml.Text)) {
-            return false;
-        }
-        val text = (org.docx4j.wml.Text) textObj;
-        text.setValue(value);
-        return true;
-    }
-
-    public Body docxBodyFor(final WordprocessingMLPackage docxPkg) {
-        val docxMdp = docxPkg.getMainDocumentPart();
-        val docxDoc = docxMdp.getJaxbElement();
-        return docxDoc.getBody();
-    }
-
-    public WordprocessingMLPackage clone(WordprocessingMLPackage docxTemplate) throws MergeException {
-        val foxc = new FlatOpcXmlCreator(docxTemplate);
-        val baos = new ByteArrayOutputStream();
-        try {
-            foxc.marshal(baos);
-            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-            FlatOpcXmlImporter foxi = new FlatOpcXmlImporter(bais);
-            docxTemplate = (WordprocessingMLPackage) foxi.get();
-        } catch (Docx4JException e) {
-            throw new MergeException("unable to defensive copy (problem exporting)", e);
-        } catch (JAXBException e) {
-            throw new MergeException("unable to defensive copy (problem importing)", e);
-        }
-        return docxTemplate;
-    }
-
-
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Dump.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Dump.java
deleted file mode 100644
index 83636e2384..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Dump.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.util;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.docx4j.TraversalUtil;
-import org.docx4j.TraversalUtil.Callback;
-import org.docx4j.XmlUtils;
-import org.docx4j.openpackaging.exceptions.Docx4JException;
-import org.docx4j.openpackaging.packages.OpcPackage;
-import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
-import org.docx4j.openpackaging.parts.JaxbXmlPart;
-import org.docx4j.openpackaging.parts.Part;
-import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
-import org.docx4j.openpackaging.parts.relationships.RelationshipsPart;
-import org.docx4j.relationships.Relationship;
-import org.docx4j.wml.Body;
-
-public class Dump {
-
-    public static void main(final String[] args) throws Exception {
-
-        //String filename = "helloWorld.docx";
-        String filename = "TypicalDocument.docx";
-        File file = new File(System.getProperty("user.dir") + "/" +
-        		filename
-                );
-
-        System.out.println(file);
-
-        Dump dump = new Dump(file);
-        System.out.println("\nPARTS LIST");
-        dump.partsList(System.out);
-        System.out.println("\n\nDOCUMENT TRAVERSE");
-        dump.documentTraverse(System.out);
-    }
-
-    private final File file;
-
-    private Map<Part, Part> handled = new HashMap<Part, Part>();
-
-    public Dump(final File file) {
-        this.file = file;
-    }
-
-    public void partsList(final PrintStream out) throws Exception {
-
-        OpcPackage opcPackage = OpcPackage.load(file);
-
-        // printContentTypes(opcPackage);
-
-        RelationshipsPart rp = opcPackage.getRelationshipsPart();
-        StringBuilder sb = new StringBuilder();
-        appendInfo(rp, sb, "");
-        traverseRelationships(opcPackage, rp, sb, "  ");
-
-        out.println(sb.toString());
-
-        // SaveToZipFile saver = new SaveToZipFile(opcPackage);
-        // saver.save(System.getProperty("user.dir") + "/out.docx");
-    }
-
-    @SuppressWarnings({ "rawtypes" })
-    private void appendInfo(final Part p, final StringBuilder sb, final String indent) {
-
-        String relationshipType = "";
-        if (p.getSourceRelationships().size() > 0) {
-            relationshipType = p.getSourceRelationships().get(0).getType();
-        }
-
-        sb.append("\n" + indent + "Part " + p.getPartName() + " [" + p.getClass().getName() + "] " + relationshipType);
-
-        if (p instanceof JaxbXmlPart) {
-            Object o = ((JaxbXmlPart) p).getJaxbElement();
-            if (o instanceof javax.xml.bind.JAXBElement) {
-                sb.append(" containing JaxbElement:" + XmlUtils.JAXBElementDebug((javax.xml.bind.JAXBElement) o));
-            } else {
-                sb.append(" containing JaxbElement:" + o.getClass().getName());
-            }
-        }
-    }
-
-    private void traverseRelationships(final OpcPackage opcPackage, final RelationshipsPart rp, final StringBuilder sb, final String indent) {
-
-        // TODO: order by rel id
-
-        for (Relationship r : rp.getRelationships().getRelationship()) {
-
-            // log.info("\nFor Relationship Id=" + r.getId()
-            // + " Source is " + rp.getSourceP().getPartName()
-            // + ", Target is " + r.getTarget()
-            // + " type " + r.getType() + "\n");
-
-            if (r.getTargetMode() != null && r.getTargetMode().equals("External")) {
-
-                sb.append("\n" + indent + "external resource " + r.getTarget() + " of type " + r.getType());
-                continue;
-            }
-
-            Part part = rp.getPart(r);
-
-            appendInfo(part, sb, indent);
-            if (handled.get(part) != null) {
-                sb.append(" [additional reference] ");
-                continue;
-            }
-            handled.put(part, part);
-            if (part.getRelationshipsPart(false) == null) {
-                // sb.append(".. no rels" );
-            } else {
-                traverseRelationships(opcPackage, part.getRelationshipsPart(false), sb, indent + "    ");
-            }
-        }
-    }
-
-    public void documentTraverse(final PrintStream out) throws Docx4JException {
-        WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(file);
-        MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
-
-        org.docx4j.wml.Document wmlDocumentEl = documentPart.getJaxbElement();
-        Body body = wmlDocumentEl.getBody();
-
-        new TraversalUtil(body,
-
-            new Callback() {
-
-                String indent = "";
-
-                @Override
-                public List<Object> apply(final Object o) {
-
-                    String text = "";
-                    if (o instanceof org.docx4j.wml.Text)
-                        text = ((org.docx4j.wml.Text) o).getValue();
-
-                    System.out.println(indent + o.getClass().getName() + "  \"" + text + "\"");
-                    return null;
-                }
-
-                @Override
-                public boolean shouldTraverse(final Object o) {
-                    return true;
-                }
-
-                // Depth first
-                @Override
-                public void walkJAXBElements(final Object parent) {
-
-                    indent += "    ";
-
-                    List<Object> children = getChildren(parent);
-                    if (children != null) {
-
-                        for (Object o : children) {
-
-                            // if its wrapped in javax.xml.bind.JAXBElement, get its
-                            // value
-                            o = XmlUtils.unwrap(o);
-
-                            this.apply(o);
-
-                            if (this.shouldTraverse(o)) {
-                                walkJAXBElements(o);
-                            }
-
-                        }
-                    }
-
-                    indent = indent.substring(0, indent.length() - 4);
-                }
-
-                @Override
-                public List<Object> getChildren(final Object o) {
-                    return TraversalUtil.getChildrenImpl(o);
-                }
-            }
-
-        );
-
-    }
-
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Jdom2.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Jdom2.java
deleted file mode 100644
index 655b04fcae..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Jdom2.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.util;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.List;
-import java.util.function.Function;
-
-import org.jdom2.Attribute;
-import org.jdom2.Content;
-import org.jdom2.Document;
-import org.jdom2.Element;
-import org.jdom2.JDOMException;
-import org.jdom2.Text;
-
-import org.apache.isis.commons.internal.codec._DocumentFactories;
-import org.apache.isis.subdomains.docx.applib.exceptions.LoadInputException;
-import org.apache.isis.subdomains.docx.applib.exceptions.MergeException;
-
-import lombok.experimental.UtilityClass;
-
-@UtilityClass
-public final class Jdom2 {
-
-    public String textValueOf(final Element htmlElement) {
-        List<Content> htmlContent = htmlElement.getContent();
-        if(htmlContent.isEmpty()) {
-            return null;
-        }
-        Content content = htmlContent.get(0);
-        if(!(content instanceof Text)) {
-            return null;
-        }
-        Text htmlText = (Text) content;
-        return normalized(htmlText.getValue());
-    }
-
-
-    private String normalized(final String value) {
-        String replaceAll = value.replaceAll("\\s+", " ");
-        return replaceAll;
-    }
-
-    public Function<Element, String> textValue() {
-        return  new Function<Element, String>(){
-        @Override
-        public String apply(final Element input) {
-            return textValueOf(input);
-        }};
-    }
-
-    public String attrOf(final Element input, final String attname) {
-        Attribute attribute = input.getAttribute(attname);
-        if(attribute == null) {
-            return null;
-        }
-        return attribute.getValue();
-    }
-
-    public Document loadInput(final String html) throws LoadInputException {
-        try {
-            return _DocumentFactories.saxBuilder().build(new StringReader(html));
-        } catch (JDOMException e) {
-            throw new LoadInputException("Unable to parse input", e);
-        } catch (IOException e) {
-            throw new LoadInputException("Unable to parse input", e);
-        }
-    }
-
-    public Element htmlBodyFor(final Document htmlDoc) throws MergeException {
-        Element htmlEl = htmlDoc.getRootElement();
-        Element bodyEl = htmlEl.getChild("body");
-        if (bodyEl == null) {
-            throw new MergeException("cannot locate body element within the input HTML");
-        }
-        return bodyEl;
-    }
-
-}
diff --git a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Types.java b/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Types.java
deleted file mode 100644
index 91ad2bc4b5..0000000000
--- a/subdomains/docx/applib/src/main/java/org/apache/isis/subdomains/docx/applib/util/Types.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib.util;
-
-import java.util.function.Predicate;
-
-import lombok.experimental.UtilityClass;
-
-@UtilityClass
-public final class Types {
-
-    public Predicate<Object> withType(final Class<?> cls) {
-        return object -> cls.isAssignableFrom(object.getClass());
-    }
-
-}
diff --git a/subdomains/docx/applib/src/main/resources/docx4j.properties b/subdomains/docx/applib/src/main/resources/docx4j.properties
deleted file mode 100644
index d45ed64540..0000000000
--- a/subdomains/docx/applib/src/main/resources/docx4j.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-#  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 agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-# Page size: use a value from org.docx4j.model.structure.PageSizePaper enum
-# eg A4, LETTER
-docx4j.PageSize=A4
-
-# Page size: use a value from org.docx4j.model.structure.MarginsWellKnown enum
-docx4j.PageMargins=NORMAL
-docx4j.PageOrientationLandscape=false
-
-# Page size: use a value from org.pptx4j.model.SlideSizesWellKnown enum
-# eg A4, LETTER
-pptx4j.PageSize=A4
-pptx4j.PageOrientationLandscape=false
-
-# These will be injected into docProps/app.xml
-# if App.Write=true
-docx4j.App.write=true
-docx4j.Application=docx4j
-docx4j.AppVersion=2.7.1
-# of the form XX.YYYY where X and Y represent numerical values
-
-# These will be injected into docProps/core.xml
-docx4j.dc.write=true
-docx4j.dc.creator.value=docx4j
-docx4j.dc.lastModifiedBy.value=docx4j
-
-#
-#docx4j.McPreprocessor=true
-
-# If you haven't configured log4j yourself
-# docx4j will autoconfigure it.  Set this to true to disable that
-docx4j.Log4j.Configurator.disabled=true
\ No newline at end of file
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
deleted file mode 100644
index fbbb9e4c1a..0000000000
--- a/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/DocxService_merge_Test.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-
-import org.assertj.core.data.Percentage;
-import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Nested;
-import org.junit.jupiter.api.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assumptions.assumeThat;
-
-import org.apache.isis.subdomains.docx.applib.exceptions.LoadInputException;
-import org.apache.isis.subdomains.docx.applib.exceptions.MergeException;
-import org.apache.isis.subdomains.docx.applib.service.DocxServiceDefault;
-
-import lombok.val;
-
-class DocxService_merge_Test {
-
-    final IoHelper io = new IoHelper(this.getClass());
-
-    DocxService docxService;
-    WordprocessingMLPackage docxTemplate;
-
-    @BeforeEach
-    public void setUp() throws Exception {
-        docxService = new DocxServiceDefault();
-
-        // given
-        docxTemplate = docxService.loadPackage(io.openInputStream("Template.docx"));
-
-    }
-
-    @Nested
-    public class Strict {
-
-        private DocxServiceDefault.MatchingPolicy matchingPolicy = DocxService.MatchingPolicy.STRICT;
-
-        @Test
-        public void exactMatch() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            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();
-            docxService.merge(params);
-
-            // then
-            final byte[] docxActual = baos.toByteArray();
-
-            // ... for manual inspection
-            final File docxExpectedFile = io.asFile("Output-Expected.docx");
-
-            final File docxActualFile = io.asFileInSameDir(docxExpectedFile, "Output-Actual.docx");
-            io.write(docxActual, docxActualFile);
-
-            System.out.println("docx expected: " + docxExpectedFile.getAbsolutePath());
-            System.out.println("docx actual: " + docxActualFile.getAbsolutePath());
-
-
-            // ... and automated
-            // a simple binary comparison finds differences, even though a manual check using MS Word itself shows
-            // no differences; for now just do a heuristic check on file size
-            final byte[] docxExpected = io.asBytes(docxExpectedFile);
-            assertThat(docxActual.length).isCloseTo(docxExpected.length, Percentage.withPercentage(40));
-        }
-
-        @Test
-        public void whenSurplusInput() throws Exception {
-
-            // then
-            Assertions.assertThrows(MergeException.class, () -> {
-
-                // when
-                docxService.merge(DocxService.MergeParams.builder()
-                        .inputAsHtml(io.readFileAsString("input-surplus.html"))
-                        .docxTemplateAsWpMlPackage(docxTemplate)
-                        .output(new ByteArrayOutputStream())
-                        .build());
-
-            }, "Input elements [SURPLUS] were not matched to placeholders");
-
-        }
-
-        @Test
-        public void whenMissingInput() throws Exception {
-
-            // then
-            Assertions.assertThrows(MergeException.class, () -> {
-
-                // when
-                docxService.merge(DocxService.MergeParams.builder()
-                        .inputAsHtml(io.readFileAsString("input-missing.html"))
-                        .docxTemplateAsWpMlPackage(docxTemplate)
-                        .output(new ByteArrayOutputStream())
-                        .build());
-
-            }, "Placeholders [Decision2] were not matched to input");
-
-        }
-    }
-
-    @Nested
-    public class AllowUnmatchedInput {
-
-        private DocxServiceDefault.MatchingPolicy matchingPolicy = DocxService.MatchingPolicy.ALLOW_UNMATCHED_INPUT;
-
-        @Test
-        public void exactMatch() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .matchingPolicy(matchingPolicy)
-                    .output(baos)
-                    .build());
-
-            // then
-            final byte[] actual = baos.toByteArray();
-            assertThat(actual.length).isGreaterThan(0);
-        }
-
-        @Test
-        public void whenSurplusInput() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-surplus.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .matchingPolicy(matchingPolicy)
-                    .output(baos)
-                    .build());
-
-            // then no exceptions
-            final byte[] actual = baos.toByteArray();
-            assertThat(actual.length).isGreaterThan(0);
-        }
-
-        @Test
-        public void whenMissingInput() throws Exception {
-
-            // then
-            Assertions.assertThrows(MergeException.class, () -> {
-
-                // when
-                docxService.merge(DocxService.MergeParams.builder()
-                        .inputAsHtml(io.readFileAsString("input-missing.html"))
-                        .docxTemplateAsWpMlPackage(docxTemplate)
-                        .output(new ByteArrayOutputStream())
-                        .build());
-
-            }, "Placeholders [Decision2] were not matched to input");
-        }
-
-    }
-
-    @Nested
-    public class AllowUnmatchedPlaceholders {
-
-        private DocxServiceDefault.MatchingPolicy matchingPolicy = DocxService.MatchingPolicy.ALLOW_UNMATCHED_PLACEHOLDERS;
-
-        @Test
-        public void exactMatch() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .matchingPolicy(matchingPolicy)
-                    .output(baos)
-                    .build());
-
-            // then
-            final byte[] actual = baos.toByteArray();
-            assertThat(actual.length).isGreaterThan(0);
-        }
-
-        @Test
-        public void whenSurplusInput() throws Exception {
-
-            // then
-            Assertions.assertThrows(MergeException.class, () -> {
-
-                // when
-                docxService.merge(DocxService.MergeParams.builder()
-                        .inputAsHtml(io.readFileAsString("input-surplus.html"))
-                        .docxTemplateAsWpMlPackage(docxTemplate)
-                        .output(new ByteArrayOutputStream())
-                        .build());
-
-            }, "Input elements [SURPLUS] were not matched to placeholders");
-        }
-
-        @Test
-        public void whenMissingInput() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-missing.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .matchingPolicy(matchingPolicy)
-                    .output(baos)
-                    .build());
-
-            // then no exceptions
-            final byte[] actual = baos.toByteArray();
-            assertThat(actual.length).isGreaterThan(0);
-        }
-    }
-
-    @Nested
-    public class Lax {
-
-        private DocxServiceDefault.MatchingPolicy matchingPolicy = DocxService.MatchingPolicy.LAX;
-
-        @Test
-        public void exactMatch() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .matchingPolicy(matchingPolicy)
-                    .output(baos)
-                    .build());
-
-            // then
-            final byte[] actual = baos.toByteArray();
-            assertThat(actual.length).isGreaterThan(0);
-        }
-
-        @Test
-        public void whenSurplusInput() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-surplus.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .matchingPolicy(matchingPolicy)
-                    .output(baos)
-                    .build());
-
-            // then no exceptions
-            final byte[] actual = baos.toByteArray();
-            assertThat(actual.length).isGreaterThan(0);
-        }
-
-        @Test
-        public void whenMissingInput() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-missing.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .matchingPolicy(matchingPolicy)
-                    .output(baos)
-                    .build());
-
-            // then no exceptions
-            final byte[] actual = baos.toByteArray();
-            assertThat(actual.length).isGreaterThan(0);
-        }
-
-    }
-
-
-    @Nested
-    public class BadInput {
-
-        @Test
-        public void whenBadInput() throws Exception {
-
-            Assertions.assertThrows(LoadInputException.class, () -> {
-
-                docxService.merge(DocxService.MergeParams.builder()
-                        .inputAsHtml(io.readFileAsString("input-malformed.html"))
-                        .matchingPolicy(DocxService.MatchingPolicy.LAX)
-                        .docxTemplateAsWpMlPackage(docxTemplate)
-                        .output(new ByteArrayOutputStream())
-                        .build());
-
-            }, "Unable to parse input");
-
-            // when
-        }
-    }
-
-    @Nested
-    public class GeneratePdf {
-
-        private DocxServiceDefault.MatchingPolicy matchingPolicy = DocxService.MatchingPolicy.STRICT;
-
-        @BeforeEach
-        public void setUp() throws Exception {
-
-            // :-( font mapping issues when running in CI environments
-            assumeThat(System.getenv("TRAVIS")).isNull();
-            assumeThat(System.getenv("JENKINS_URL")).isNull();
-            assumeThat(System.getenv("GITLAB_CI")).isNull();
-        }
-
-        @Test
-        public void exactMatch() throws Exception {
-
-            // when
-            val baos = new ByteArrayOutputStream();
-
-            docxService.merge(DocxService.MergeParams.builder()
-                    .inputAsHtml(io.readFileAsString("input-exact-match.html"))
-                    .docxTemplateAsWpMlPackage(docxTemplate)
-                    .outputType(DocxService.OutputType.PDF)
-                    .output(baos)
-                    .build());
-
-            // then
-            final byte[] pdfActual = baos.toByteArray();
-
-            // ... for manual inspection
-            final File pdfExpectedFile = io.asFile("Output-Expected.pdf");
-
-            final File pdfActualFile = io.asFileInSameDir(pdfExpectedFile, "Output-Actual.pdf");
-            io.write(pdfActual, pdfActualFile);
-
-            System.out.println("pdf expected: " + pdfExpectedFile.getAbsolutePath());
-            System.out.println("pdf actual: " + pdfActualFile.getAbsolutePath());
-
-
-            // ... and automated
-            // a simple binary comparison finds differences, even though a manual check shows
-            // the size can vary substantially, so we just check that we have something.
-            assertThat(pdfActual.length).isGreaterThan(0);
-
-        }
-    }
-
-}
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
deleted file mode 100644
index 08439833e7..0000000000
--- a/subdomains/docx/applib/src/test/java/org/apache/isis/subdomains/docx/applib/IoHelper.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *  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 agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.subdomains.docx.applib;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import com.google.common.io.ByteStreams;
-import com.google.common.io.Resources;
-
-import lombok.RequiredArgsConstructor;
-
-@RequiredArgsConstructor
-class IoHelper {
-
-    private final Class<?> baseClass;
-
-    public byte[] asBytes(String fileName) throws IOException {
-        final ByteArrayOutputStream baos = asBaos(fileName);
-        return baos.toByteArray();
-    }
-
-    public byte[] asBytes(File file) throws IOException {
-        final FileInputStream fis = new FileInputStream(file);
-        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        ByteStreams.copy(fis, baos);
-        return baos.toByteArray();
-    }
-
-
-    public ByteArrayOutputStream asBaos(String fileName) throws IOException {
-        final ByteArrayInputStream bais = openInputStream(fileName);
-        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        ByteStreams.copy(bais, baos);
-        return baos;
-    }
-
-    public String readFileAsString(final String fileName) throws IOException {
-        final URL fileUrl = asUrl(fileName);
-        return Resources.toString(fileUrl, Charset.forName("UTF-8"));
-    }
-
-    public ByteArrayInputStream openInputStream(final String fileName) throws IOException {
-        final URL fileUrl = asUrl(fileName);
-        return new ByteArrayInputStream(Resources.toByteArray(fileUrl));
-    }
-
-    public URL asUrl(final String fileName) {
-        return Resources.getResource(baseClass, fileName);
-    }
-
-    public File asFile(String fileName) {
-        return toFile(asUrl(fileName));
-    }
-
-    public File asFileInSameDir(final String existingFileName, String newFile) {
-        final File existingFile = asFile(existingFileName);
-        return asFileInSameDir(existingFile, newFile);
-    }
-
-    public File asFileInSameDir(File existingFile, String newFile) {
-        final File dir = existingFile.getParentFile();
-        return new File(dir, newFile);
-    }
-
-
-    public void write(byte[] bytes, File file) throws IOException {
-        final FileOutputStream targetFos = new FileOutputStream(file);
-        ByteStreams.copy(new ByteArrayInputStream(bytes), targetFos);
-    }
-
-
-    static File toFile(URL url) {
-        File file;
-        String path;
-
-        try {
-            path = url.toURI().getSchemeSpecificPart();
-            if ((file = new File(path)).exists()) return file;
-        } catch (URISyntaxException e) {
-        }
-
-        try {
-            path = url.toExternalForm();
-            if (path.startsWith("file:")) path = path.substring("file:".length());
-            if ((file = new File(path)).exists()) return file;
-
-        } catch (Exception e) {
-        }
-
-        return null;
-    }
-}
diff --git a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Output-Expected.docx b/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Output-Expected.docx
deleted file mode 100644
index e2b23f5dfe..0000000000
Binary files a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Output-Expected.docx and /dev/null differ
diff --git a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Output-Expected.pdf b/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Output-Expected.pdf
deleted file mode 100644
index 78112eebb5..0000000000
Binary files a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Output-Expected.pdf and /dev/null differ
diff --git a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Template.docx b/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Template.docx
deleted file mode 100644
index d6cef7c57f..0000000000
Binary files a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/Template.docx and /dev/null differ
diff --git a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-exact-match.html b/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-exact-match.html
deleted file mode 100644
index 2a68d04e58..0000000000
--- a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-exact-match.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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
diff --git a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-malformed.html b/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-malformed.html
deleted file mode 100644
index 0f9fac8493..0000000000
--- a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-malformed.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<html>
-	<body>
-        <!-- missing closing tag -->
-		<p id="PPSN" class="plain">1234567A
-
-		<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
diff --git a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-missing.html b/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-missing.html
deleted file mode 100644
index 4e8791a19a..0000000000
--- a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-missing.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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>
-        <!-- MISSING
-		<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
diff --git a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-surplus.html b/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-surplus.html
deleted file mode 100644
index 635e3fc95b..0000000000
--- a/subdomains/docx/applib/src/test/resources/org/apache/isis/subdomains/docx/applib/input-surplus.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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>
-        <p id="SURPLUS" class="rich">
-            This doesn't appear in the template!!!!
-        </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
diff --git a/subdomains/docx/pom.xml b/subdomains/docx/pom.xml
deleted file mode 100644
index f36af1bcbf..0000000000
--- a/subdomains/docx/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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 agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>org.apache.isis.subdomains</groupId>
-		<artifactId>isis-subdomains</artifactId>
-		<version>2.0.0-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>isis-subdomains-docx</artifactId>
-	<name>Apache Isis Sub - Docx (parent)</name>
-	<description>Uses the Apache POI library for mail merge functions of .docx Word documents</description>
-
-	<packaging>pom</packaging>
-
-	<modules>
-		<module>applib</module>
-	</modules>
-
-</project>
diff --git a/subdomains/pom.xml b/subdomains/pom.xml
index 9ce116b2e0..4e02ce543a 100644
--- a/subdomains/pom.xml
+++ b/subdomains/pom.xml
@@ -68,12 +68,6 @@
 				<version>2.0.0-SNAPSHOT</version>
 			</dependency>
 
-			<dependency>
-				<groupId>org.apache.isis.subdomains</groupId>
-				<artifactId>isis-subdomains-docx-applib</artifactId>
-				<version>2.0.0-SNAPSHOT</version>
-			</dependency>
-
 			<dependency>
 				<groupId>org.apache.isis.subdomains</groupId>
 				<artifactId>isis-subdomains-excel-applib</artifactId>
@@ -161,7 +155,6 @@
 
 	<modules>
 		<module>base</module>
-		<module>docx</module>
 		<module>excel</module>
 		<module>spring</module>
 		<module>xdocreport</module>