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 2019/12/04 12:12:45 UTC

[isis] 07/09: ISIS-2208: moves h2 console into new isis extension

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 032a49016e518c459e158563c8604e69ce21cf09
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Dec 4 10:59:05 2019 +0000

    ISIS-2208: moves h2 console into new isis extension
---
 .../isis-configurations-and-modules.pptx           | Bin 47861 -> 48551 bytes
 antora/playbooks/site-other.yml                    |   3 ++
 .../org/apache/isis/webapp/IsisBootWebApp.java     |   6 ---
 extensions/persistence/h2console/pom.xml           |  47 +++++++++++++++++++++
 .../persistence/h2console/src/main/doc/antora.yml  |   2 +
 .../src/main/doc/modules/spring/_attributes.adoc   |   6 +++
 .../main/doc/modules/spring/attachments/.gitkeep   |   0
 .../src/main/doc/modules/spring/examples/.gitkeep  |   0
 .../src/main/doc/modules/spring/images/.gitkeep    |   0
 .../h2console/src/main/doc/modules/spring/nav.adoc |   2 +
 .../main/doc/modules/spring/pages/_attributes.adoc |   4 ++
 .../src/main/doc/modules/spring/pages/about.adoc   |   6 +++
 .../doc/modules/spring/partials/_attributes.adoc   |   4 ++
 .../doc/modules/spring/partials/module-nav.adoc    |   3 ++
 .../h2console/IsisExtH2ConsoleModule.java          |  28 ++++--------
 .../h2console/services}/H2ManagerMenu.java         |  20 ++++-----
 .../h2console/webmodule}/WebModuleH2Console.java   |   2 +-
 extensions/pom.xml                                 |   6 +++
 site.yml                                           |   3 ++
 19 files changed, 104 insertions(+), 38 deletions(-)

diff --git a/antora/components/core/modules/archdesign/attachments/isis-configurations-and-modules.pptx b/antora/components/core/modules/archdesign/attachments/isis-configurations-and-modules.pptx
index b448bcd..b8086de 100644
Binary files a/antora/components/core/modules/archdesign/attachments/isis-configurations-and-modules.pptx and b/antora/components/core/modules/archdesign/attachments/isis-configurations-and-modules.pptx differ
diff --git a/antora/playbooks/site-other.yml b/antora/playbooks/site-other.yml
index 9e11933..65ab8c6 100644
--- a/antora/playbooks/site-other.yml
+++ b/antora/playbooks/site-other.yml
@@ -40,6 +40,9 @@ content:
     - url: .
       start_path: extensions/core/spring/src/main/doc # other
       branches: HEAD
+    - url: .
+      start_path: extensions/core/h2console/src/main/doc # other
+      branches: HEAD
 
 
 ui:
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/IsisBootWebApp.java b/core/runtime-web/src/main/java/org/apache/isis/webapp/IsisBootWebApp.java
index 9dc4a2a..d7be97d 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/IsisBootWebApp.java
+++ b/core/runtime-web/src/main/java/org/apache/isis/webapp/IsisBootWebApp.java
@@ -21,8 +21,6 @@ package org.apache.isis.webapp;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Import;
 
-import org.apache.isis.webapp.modules.h2console.H2ManagerMenu;
-import org.apache.isis.webapp.modules.h2console.WebModuleH2Console;
 import org.apache.isis.webapp.modules.logonlog.WebModuleLogOnExceptionLogger;
 import org.apache.isis.webapp.modules.templresources.WebModuleTemplateResources;
 
@@ -37,10 +35,6 @@ import org.apache.isis.webapp.modules.templresources.WebModuleTemplateResources;
     // static html template preprocessing
     WebModuleTemplateResources.class,
 
-    // h2 console
-    WebModuleH2Console.class,
-    H2ManagerMenu.class,
-
 })
 public class IsisBootWebApp {
 
diff --git a/extensions/persistence/h2console/pom.xml b/extensions/persistence/h2console/pom.xml
new file mode 100644
index 0000000..40fec45
--- /dev/null
+++ b/extensions/persistence/h2console/pom.xml
@@ -0,0 +1,47 @@
+<?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.extensions</groupId>
+		<artifactId>isis-extensions</artifactId>
+		<version>2.0.0-M3-SNAPSHOT</version>
+		<relativePath>../../pom.xml</relativePath>
+	</parent>
+
+	<artifactId>isis-extensions-h2console</artifactId>
+	<name>Apache Isis Ext - H2 Console</name>
+	<description>Menu and configuration to open up H2 Console</description>
+
+	<properties>
+		<jar-plugin.automaticModuleName>org.apache.isis.extensions.h2console</jar-plugin.automaticModuleName>
+		<git-plugin.propertiesDir>org/apache/isis/extensions/h2console</git-plugin.propertiesDir>
+	</properties>
+
+	<dependencies>
+
+		<dependency>
+			<groupId>org.apache.isis.core</groupId>
+			<artifactId>isis-runtime-web</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.h2database</groupId>
+			<artifactId>h2</artifactId>
+		</dependency>
+
+	</dependencies>
+
+</project>
diff --git a/extensions/persistence/h2console/src/main/doc/antora.yml b/extensions/persistence/h2console/src/main/doc/antora.yml
new file mode 100644
index 0000000..eeeeb1e
--- /dev/null
+++ b/extensions/persistence/h2console/src/main/doc/antora.yml
@@ -0,0 +1,2 @@
+name: extensions
+version: master
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/_attributes.adoc b/extensions/persistence/h2console/src/main/doc/modules/spring/_attributes.adoc
new file mode 100644
index 0000000..43cb529
--- /dev/null
+++ b/extensions/persistence/h2console/src/main/doc/modules/spring/_attributes.adoc
@@ -0,0 +1,6 @@
+ifndef::env-site,env-github[]
+:attachmentsdir: {moduledir}/attachments
+:examplesdir: {moduledir}/examples
+:imagesdir: {moduledir}/images
+:partialsdir: {moduledir}/partials
+endif::[]
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/attachments/.gitkeep b/extensions/persistence/h2console/src/main/doc/modules/spring/attachments/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/examples/.gitkeep b/extensions/persistence/h2console/src/main/doc/modules/spring/examples/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/images/.gitkeep b/extensions/persistence/h2console/src/main/doc/modules/spring/images/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/nav.adoc b/extensions/persistence/h2console/src/main/doc/modules/spring/nav.adoc
new file mode 100644
index 0000000..c6c7e34
--- /dev/null
+++ b/extensions/persistence/h2console/src/main/doc/modules/spring/nav.adoc
@@ -0,0 +1,2 @@
+include::extensions:h2console:partial$component-nav.adoc[]
+
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/pages/_attributes.adoc b/extensions/persistence/h2console/src/main/doc/modules/spring/pages/_attributes.adoc
new file mode 100644
index 0000000..e8ada7c
--- /dev/null
+++ b/extensions/persistence/h2console/src/main/doc/modules/spring/pages/_attributes.adoc
@@ -0,0 +1,4 @@
+ifndef::env-site,env-github[]
+:moduledir: ..
+include::{moduledir}/_attributes.adoc[]
+endif::[]
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/pages/about.adoc b/extensions/persistence/h2console/src/main/doc/modules/spring/pages/about.adoc
new file mode 100644
index 0000000..883c317
--- /dev/null
+++ b/extensions/persistence/h2console/src/main/doc/modules/spring/pages/about.adoc
@@ -0,0 +1,6 @@
+= H2 Console
+: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::_attributes.adoc[]
+
+TODO
+
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/partials/_attributes.adoc b/extensions/persistence/h2console/src/main/doc/modules/spring/partials/_attributes.adoc
new file mode 100644
index 0000000..e8ada7c
--- /dev/null
+++ b/extensions/persistence/h2console/src/main/doc/modules/spring/partials/_attributes.adoc
@@ -0,0 +1,4 @@
+ifndef::env-site,env-github[]
+:moduledir: ..
+include::{moduledir}/_attributes.adoc[]
+endif::[]
diff --git a/extensions/persistence/h2console/src/main/doc/modules/spring/partials/module-nav.adoc b/extensions/persistence/h2console/src/main/doc/modules/spring/partials/module-nav.adoc
new file mode 100644
index 0000000..35e1cca
--- /dev/null
+++ b/extensions/persistence/h2console/src/main/doc/modules/spring/partials/module-nav.adoc
@@ -0,0 +1,3 @@
+* xref:extensions:spring:about.adoc[Spring (extension)]
+
+
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/IsisBootWebApp.java b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/IsisExtH2ConsoleModule.java
similarity index 59%
copy from core/runtime-web/src/main/java/org/apache/isis/webapp/IsisBootWebApp.java
copy to extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/IsisExtH2ConsoleModule.java
index 9dc4a2a..f4b6e1b 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/IsisBootWebApp.java
+++ b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/IsisExtH2ConsoleModule.java
@@ -16,32 +16,20 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.webapp;
+package org.apache.isis.extensions.h2console;
 
+import org.apache.isis.extensions.h2console.services.H2ManagerMenu;
+import org.apache.isis.extensions.h2console.webmodule.WebModuleH2Console;
+import org.apache.isis.webapp.IsisBootWebApp;
+import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Import;
 
-import org.apache.isis.webapp.modules.h2console.H2ManagerMenu;
-import org.apache.isis.webapp.modules.h2console.WebModuleH2Console;
-import org.apache.isis.webapp.modules.logonlog.WebModuleLogOnExceptionLogger;
-import org.apache.isis.webapp.modules.templresources.WebModuleTemplateResources;
-
 @Configuration
 @Import({
-    IsisWebAppContextListener.class,
-    IsisWebAppContextInitializer.class,
-
-    // default modules
-    WebModuleLogOnExceptionLogger.class,
-    
-    // static html template preprocessing
-    WebModuleTemplateResources.class,
-
-    // h2 console
-    WebModuleH2Console.class,
-    H2ManagerMenu.class,
-
+        IsisBootWebApp.class
 })
-public class IsisBootWebApp {
+@ComponentScan
+public class IsisExtH2ConsoleModule {
 
 }
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/h2console/H2ManagerMenu.java b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/services/H2ManagerMenu.java
similarity index 83%
rename from core/runtime-web/src/main/java/org/apache/isis/webapp/modules/h2console/H2ManagerMenu.java
rename to extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/services/H2ManagerMenu.java
index 0b80143..8f9f716 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/h2console/H2ManagerMenu.java
+++ b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/services/H2ManagerMenu.java
@@ -16,9 +16,8 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.webapp.modules.h2console;
+package org.apache.isis.extensions.h2console.services;
 
-import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
 import org.apache.isis.applib.IsisApplibModule;
@@ -32,10 +31,11 @@ import org.apache.isis.applib.annotation.RestrictTo;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.registry.ServiceRegistry;
 import org.apache.isis.applib.value.LocalResourcePath;
+import org.apache.isis.extensions.h2console.webmodule.WebModuleH2Console;
 
 @DomainService(
         nature = NatureOfService.VIEW,
-        objectType = "isisApplib.H2ManagerMenu"
+        objectType = "isisExtH2Console.H2ManagerMenu"
         )
 @DomainServiceLayout(
         named = "Prototyping",
@@ -43,15 +43,13 @@ import org.apache.isis.applib.value.LocalResourcePath;
         )
 public class H2ManagerMenu {
 
-    @Inject private ServiceRegistry serviceRegistry;
+    private final ServiceRegistry serviceRegistry;
+    private final WebModuleH2Console webModule;
 
-    private WebModuleH2Console webModule;
-
-    @PostConstruct
-    public void init() {
-        webModule = serviceRegistry.select(WebModuleH2Console.class)
-                .getFirst()
-                .orElse(null);
+    @Inject
+    public H2ManagerMenu(final ServiceRegistry serviceRegistry, final WebModuleH2Console webModule) {
+        this.serviceRegistry = serviceRegistry;
+        this.webModule = webModule;
     }
 
 
diff --git a/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/h2console/WebModuleH2Console.java b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/webmodule/WebModuleH2Console.java
similarity index 98%
rename from core/runtime-web/src/main/java/org/apache/isis/webapp/modules/h2console/WebModuleH2Console.java
rename to extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/webmodule/WebModuleH2Console.java
index 8ab50cf..05521f7 100644
--- a/core/runtime-web/src/main/java/org/apache/isis/webapp/modules/h2console/WebModuleH2Console.java
+++ b/extensions/persistence/h2console/src/main/java/org/apache/isis/extensions/h2console/webmodule/WebModuleH2Console.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.webapp.modules.h2console;
+package org.apache.isis.extensions.h2console.webmodule;
 
 import javax.inject.Inject;
 import javax.servlet.ServletContext;
diff --git a/extensions/pom.xml b/extensions/pom.xml
index f01cc35..27978e6 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -133,6 +133,11 @@
 			</dependency>
 			<dependency>
 				<groupId>org.apache.isis.extensions</groupId>
+				<artifactId>isis-extensions-h2console</artifactId>
+				<version>2.0.0-M3-SNAPSHOT</version>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.isis.extensions</groupId>
 				<artifactId>isis-extensions-sse</artifactId>
 				<version>2.0.0-M3-SNAPSHOT</version>
 			</dependency>
@@ -186,6 +191,7 @@
 
 	<modules>
 		<module>core/spring</module>
+		<module>persistence/h2console</module>
 		<module>security/secman</module>
 		<module>testing/fixtures</module>
 		<module>testing/specsupport</module>
diff --git a/site.yml b/site.yml
index a20a5df..fe99e5e 100644
--- a/site.yml
+++ b/site.yml
@@ -134,6 +134,9 @@ content:
       start_path: extensions/core/spring/src/main/doc # other
       branches: HEAD
     - url: .
+      start_path: extensions/core/h2console/src/main/doc # other
+      branches: HEAD
+    - url: .
       start_path: extensions/security/secman/src/main/doc # security secman
       branches: HEAD
     - url: .