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 946836ccba ISIS-3164: fixes Inspect Metamodel view
946836ccba is described below

commit 946836ccba18fa227d19d1f0edbabde6a8d4ad15
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Mon Sep 5 20:19:11 2022 +0200

    ISIS-3164: fixes Inspect Metamodel view
---
 .../isis/core/metamodel/objectmanager/ObjectManager.java   |  6 ++++--
 .../wicket/ui/components/tree/IsisToWicketTreeAdapter.java | 14 +++++++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/objectmanager/ObjectManager.java
 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/objectmanager/ObjectManager.java
index 2e6e9b5f35..e5de490f5a 100644
--- 
a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/objectmanager/ObjectManager.java
+++ 
b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/objectmanager/ObjectManager.java
@@ -111,8 +111,10 @@ public interface ObjectManager extends HasMetaModelContext 
{
         val adapter = loadObject(bookmark)
                 .orElseThrow(()->
                     _Exceptions.unrecoverable("failed to restore object from 
bookmark %s", bookmark));
-        _Assert.assertEquals(bookmark, adapter.getBookmark().orElse(null),
-                ()->"object loaded from bookmark must itself return an equal 
bookmark");
+        if(adapter.getSpecialization().isEntity()) {
+            _Assert.assertEquals(bookmark, adapter.getBookmark().orElse(null),
+                    ()->"object loaded from bookmark must itself return an 
equal bookmark");
+        }
         return adapter;
     }
 
diff --git 
a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
 
b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
index df6ec0f41f..0734178e4e 100644
--- 
a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
+++ 
b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/tree/IsisToWicketTreeAdapter.java
@@ -40,6 +40,7 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.LoadableDetachableModel;
 import org.apache.wicket.model.Model;
 
+import org.apache.isis.applib.ViewModel;
 import org.apache.isis.applib.graph.tree.TreeAdapter;
 import org.apache.isis.applib.graph.tree.TreeNode;
 import org.apache.isis.applib.graph.tree.TreePath;
@@ -57,6 +58,7 @@ import org.apache.isis.viewer.wicket.model.util.WktContext;
 import 
org.apache.isis.viewer.wicket.ui.components.entity.icontitle.EntityIconAndTitlePanel;
 
 import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
 import lombok.val;
 
 class IsisToWicketTreeAdapter {
@@ -199,6 +201,16 @@ class IsisToWicketTreeAdapter {
 
     // -- ISIS' TREE-MODEL
 
+    /** this is just to make the ObjectManager happy */
+    @RequiredArgsConstructor
+    public static class PseudoViewmodel implements ViewModel {
+        final String memento;
+        @Override
+        public String viewModelMemento() {
+            return "tree";
+        }
+    }
+
     /**
      * Extending the EntityModel to also provide a TreePath.
      */
@@ -209,7 +221,7 @@ class IsisToWicketTreeAdapter {
         private final boolean isTreePathModelOnly;
 
         public TreeModel(final MetaModelContext commonContext, final TreePath 
treePath) {
-            super(commonContext, commonContext.getObjectManager().adapt(new 
Object()));
+            super(commonContext, commonContext.getObjectManager().adapt(new 
PseudoViewmodel(null)));
             this.treePath = treePath;
             this.isTreePathModelOnly = true;
         }

Reply via email to