You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2023/01/20 07:03:58 UTC

[isis] branch master updated: ISIS-3328: remove Documentation Service from applib

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

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


The following commit(s) were added to refs/heads/master by this push:
     new ac6f3a907e ISIS-3328: remove Documentation Service from applib
ac6f3a907e is described below

commit ac6f3a907e8a7e8189e649185859f50d412cfdc8
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jan 20 08:03:52 2023 +0100

    ISIS-3328: remove Documentation Service from applib
    
    - no need to bloat the programming model
---
 .../java/org/apache/causeway/applib/CausewayModuleApplib.java     | 2 --
 .../core/runtimeservices/CausewayModuleCoreRuntimeServices.java   | 2 ++
 .../causeway/core/runtimeservices/helpui/DefaultHelpVm.java       | 7 ++++---
 .../causeway/core/runtimeservices}/helpui/DocumentationMenu.java  | 7 +++----
 .../core/runtimeservices}/helpui/DocumentationService.java        | 8 +++-----
 .../core/runtimeservices/helpui/DocumentationServiceDefault.java  | 3 +--
 6 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/causeway/applib/CausewayModuleApplib.java b/api/applib/src/main/java/org/apache/causeway/applib/CausewayModuleApplib.java
index f4712d1177..028b920a9d 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/CausewayModuleApplib.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/CausewayModuleApplib.java
@@ -43,7 +43,6 @@ import org.apache.causeway.applib.services.commanddto.conmap.ContentMappingServi
 import org.apache.causeway.applib.services.commanddto.processor.spi.CommandDtoProcessorServiceIdentity;
 import org.apache.causeway.applib.services.confview.ConfigurationMenu;
 import org.apache.causeway.applib.services.confview.ConfigurationProperty;
-import org.apache.causeway.applib.services.helpui.DocumentationMenu;
 import org.apache.causeway.applib.services.layout.LayoutServiceMenu;
 import org.apache.causeway.applib.services.metamodel.MetaModelServiceMenu;
 import org.apache.causeway.applib.services.queryresultscache.QueryResultsCache;
@@ -91,7 +90,6 @@ import org.apache.causeway.schema.CausewayModuleSchema;
     QueryResultsCache.class,
     ApplicationFeatureMenu.class,
     UserMenu.class,
-    DocumentationMenu.class,
 
     // @Service(s)
     CommandDtoProcessorServiceIdentity.class,
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java
index 1e8eb77770..4db5185f96 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java
@@ -36,6 +36,7 @@ import org.apache.causeway.core.runtimeservices.email.EmailServiceDefault;
 import org.apache.causeway.core.runtimeservices.eventbus.EventBusServiceSpring;
 import org.apache.causeway.core.runtimeservices.executor.MemberExecutorServiceDefault;
 import org.apache.causeway.core.runtimeservices.factory.FactoryServiceDefault;
+import org.apache.causeway.core.runtimeservices.helpui.DocumentationMenu;
 import org.apache.causeway.core.runtimeservices.helpui.DocumentationServiceDefault;
 import org.apache.causeway.core.runtimeservices.homepage.HomePageResolverServiceDefault;
 import org.apache.causeway.core.runtimeservices.i18n.po.TranslationServicePo;
@@ -134,6 +135,7 @@ import org.apache.causeway.core.runtimeservices.xmlsnapshot.XmlSnapshotServiceDe
         RepositoryServiceDefault.class,
 
         // @DomainService's
+        DocumentationMenu.class,
         TranslationServicePoMenu.class,
 
         // Exception Recognizers
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DefaultHelpVm.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DefaultHelpVm.java
index 8d96f503be..648e5ae940 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DefaultHelpVm.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DefaultHelpVm.java
@@ -35,19 +35,20 @@ import org.apache.causeway.core.runtimeservices.CausewayModuleCoreRuntimeService
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 
+@Named(CausewayModuleCoreRuntimeServices.NAMESPACE + ".DefaultHelpVm")
 @DomainObject(nature = Nature.VIEW_MODEL)
 @DomainObjectLayout(
         named = "Application Help",
         cssClassFa = "fa-regular fa-circle-question")
-@Named(CausewayModuleCoreRuntimeServices.NAMESPACE + ".DefaultHelpVm")
 @RequiredArgsConstructor(onConstructor_ = {@Inject})
 public class DefaultHelpVm implements ViewModel {
 
     private final DocumentationServiceDefault documentationServiceDefault;
+    private final String title;
 
     @ObjectSupport
     public String title() {
-        return "Application Help";
+        return title;
     }
 
     @Property
@@ -57,6 +58,6 @@ public class DefaultHelpVm implements ViewModel {
 
     @Override
     public String viewModelMemento() {
-        return "DefaultHelpVm"; // arbitrary string (used only to create bookmarks)
+        return title;
     }
 }
diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/helpui/DocumentationMenu.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationMenu.java
similarity index 92%
rename from api/applib/src/main/java/org/apache/causeway/applib/services/helpui/DocumentationMenu.java
rename to core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationMenu.java
index 4efc888425..cfb27dae56 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/services/helpui/DocumentationMenu.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationMenu.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.causeway.applib.services.helpui;
+package org.apache.causeway.core.runtimeservices.helpui;
 
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -30,6 +30,7 @@ import org.apache.causeway.applib.annotation.MemberSupport;
 import org.apache.causeway.applib.annotation.NatureOfService;
 import org.apache.causeway.applib.annotation.PriorityPrecedence;
 import org.apache.causeway.applib.annotation.SemanticsOf;
+import org.apache.causeway.core.runtimeservices.CausewayModuleCoreRuntimeServices;
 
 import lombok.RequiredArgsConstructor;
 
@@ -41,7 +42,7 @@ import lombok.RequiredArgsConstructor;
  * @see DocumentationService
  * @since 2.x {@index}
  */
-@Named(DocumentationMenu.LOGICAL_TYPE_NAME)
+@Named(CausewayModuleCoreRuntimeServices.NAMESPACE + ".DocumentationMenu")
 @DomainService(nature = NatureOfService.VIEW)
 @DomainServiceLayout(
         menuBar = DomainServiceLayout.MenuBar.TERTIARY
@@ -50,8 +51,6 @@ import lombok.RequiredArgsConstructor;
 @RequiredArgsConstructor(onConstructor_ = {@Inject})
 public class DocumentationMenu {
 
-    public static final String LOGICAL_TYPE_NAME = CausewayModuleApplib.NAMESPACE + ".DocumentationMenu";
-
     public static abstract class ActionDomainEvent<T> extends CausewayModuleApplib.ActionDomainEvent<T> {}
 
     private final DocumentationService documentationService;
diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/helpui/DocumentationService.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationService.java
similarity index 83%
rename from api/applib/src/main/java/org/apache/causeway/applib/services/helpui/DocumentationService.java
rename to core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationService.java
index 787568aafb..e2eaf2438a 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/services/helpui/DocumentationService.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationService.java
@@ -16,9 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.causeway.applib.services.helpui;
-
-import org.apache.causeway.applib.ViewModel;
+package org.apache.causeway.core.runtimeservices.helpui;
 
 /**
  * Provides the content for the {@link DocumentationMenu} entries.
@@ -30,7 +28,7 @@ import org.apache.causeway.applib.ViewModel;
  */
 public interface DocumentationService {
 
-    /** Returns the view-model that represents the application's primary help page. */
-    ViewModel getHelp();
+    /** Returns a view-model or value that represents the application's primary help page. */
+    Object getHelp();
 
 }
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationServiceDefault.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationServiceDefault.java
index 2c3fe06623..122c59fba3 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationServiceDefault.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/helpui/DocumentationServiceDefault.java
@@ -40,7 +40,6 @@ import org.apache.causeway.applib.layout.component.ServiceActionLayoutData;
 import org.apache.causeway.applib.layout.grid.Grid;
 import org.apache.causeway.applib.layout.menubars.MenuBars;
 import org.apache.causeway.applib.layout.menubars.bootstrap.BSMenuBars;
-import org.apache.causeway.applib.services.helpui.DocumentationService;
 import org.apache.causeway.applib.services.homepage.HomePageResolverService;
 import org.apache.causeway.applib.services.i18n.TranslationContext;
 import org.apache.causeway.applib.services.i18n.TranslationService;
@@ -73,7 +72,7 @@ public class DocumentationServiceDefault implements DocumentationService {
     private final TranslationService translationService;
 
     @Getter(onMethod_={@Override}, lazy = true)
-    private final ViewModel help = new DefaultHelpVm(this);
+    private final ViewModel help = new DefaultHelpVm(this, "Application Help");
 
     // -- HELPER