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 2019/10/11 12:49:41 UTC

[isis] branch v2 updated: ISIS-2158: wicket-viewer: fixes collections rendering

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

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


The following commit(s) were added to refs/heads/v2 by this push:
     new db01cd7  ISIS-2158: wicket-viewer: fixes collections rendering
db01cd7 is described below

commit db01cd7b2359862b51700b0758524dc292ad2d94
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Oct 11 14:49:32 2019 +0200

    ISIS-2158: wicket-viewer: fixes collections rendering
---
 .../services/confview/ConfigurationMenu.java       |  1 -
 .../isis/config/registry/IsisBeanTypeRegistry.java | 38 +++++++++-------------
 .../persistence/PersistenceSessionFactory5.java    |  3 --
 .../ObjectAdapterMemento_LastKnownGood.java        |  6 +---
 .../wicket/model/models/EntityCollectionModel.java |  5 +--
 5 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationMenu.java b/core/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationMenu.java
index a3a6ae7..6fefb67 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationMenu.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/confview/ConfigurationMenu.java
@@ -56,7 +56,6 @@ public class ConfigurationMenu {
             )
     @MemberOrder(sequence = "500.900.1")
     public Set<ConfigurationProperty> configuration(){
-        System.out.println("############## CALL");
         return configurationService.allProperties();
     }
 
diff --git a/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java b/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java
index 93eb665..fef6507 100644
--- a/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java
+++ b/core/config/src/main/java/org/apache/isis/config/registry/IsisBeanTypeRegistry.java
@@ -225,29 +225,6 @@ public final class IsisBeanTypeRegistry implements IsisComponentScanInterceptor,
             return BeanSort.ENTITY;
         }
 
-        val aDomainObject = findNearestAnnotation(type, DomainObject.class).orElse(null);
-        if(aDomainObject!=null) {
-            switch (aDomainObject.nature()) {
-            case EXTERNAL_ENTITY:
-            case INMEMORY_ENTITY:
-            case JDO_ENTITY:
-                return BeanSort.VIEW_MODEL; //because object is not associated with a persistence context unless discovered above
-            case MIXIN:
-                return BeanSort.MIXIN;
-            case VIEW_MODEL:
-                return BeanSort.VIEW_MODEL;
-
-            case NOT_SPECIFIED:
-                if(findNearestAnnotation(type, ViewModel.class).isPresent()) {
-                    return BeanSort.VIEW_MODEL;
-                }
-                if(org.apache.isis.applib.ViewModel.class.isAssignableFrom(type)) {
-                    return BeanSort.VIEW_MODEL;
-                }
-                break; // fall through
-            } 
-        }
-
         if(findNearestAnnotation(type, Mixin.class).isPresent()) {
             return BeanSort.MIXIN;
         }
@@ -271,6 +248,21 @@ public final class IsisBeanTypeRegistry implements IsisComponentScanInterceptor,
         if(TransactionScopedComponent.class.isAssignableFrom(type)) {
             return BeanSort.MANAGED_BEAN;
         }
+        
+        val aDomainObject = findNearestAnnotation(type, DomainObject.class).orElse(null);
+        if(aDomainObject!=null) {
+            switch (aDomainObject.nature()) {
+            case MIXIN:
+                return BeanSort.MIXIN;
+            case JDO_ENTITY:
+                return BeanSort.ENTITY;
+            case EXTERNAL_ENTITY:
+            case INMEMORY_ENTITY:
+            case VIEW_MODEL:
+            case NOT_SPECIFIED:
+                return BeanSort.VIEW_MODEL; //because object is not associated with a persistence context unless discovered above
+            } 
+        }
 
 //XXX RequestScoped is just a qualifier, don't decide on that
 //        
diff --git a/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/PersistenceSessionFactory5.java b/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/PersistenceSessionFactory5.java
index b1d066f..e25d6eb 100644
--- a/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/PersistenceSessionFactory5.java
+++ b/core/plugins/jdo/datanucleus-5/src/main/java/org/apache/isis/jdo/persistence/PersistenceSessionFactory5.java
@@ -91,10 +91,7 @@ implements PersistenceSessionFactory, ApplicationScopedComponent, FixturesInstal
         this.configuration = IsisContext.getConfiguration();
         
         val dnSettings = IsisContext.getServiceRegistry().lookupServiceElseFail(DataNucleusSettings.class);
-        
-        //val dataNucleusConfig = configuration.subsetWithNamesStripped(DATANUCLEUS_CONFIG_PREFIX);
         val datanucleusProps = dnSettings.getAsMap(); 
-                //dataNucleusConfig.copyToMap();
         
         System.out.println("############## " + datanucleusProps);
 
diff --git a/core/runtime/src/main/java/org/apache/isis/runtime/memento/ObjectAdapterMemento_LastKnownGood.java b/core/runtime/src/main/java/org/apache/isis/runtime/memento/ObjectAdapterMemento_LastKnownGood.java
index 87d68f7..c44212c 100644
--- a/core/runtime/src/main/java/org/apache/isis/runtime/memento/ObjectAdapterMemento_LastKnownGood.java
+++ b/core/runtime/src/main/java/org/apache/isis/runtime/memento/ObjectAdapterMemento_LastKnownGood.java
@@ -535,11 +535,7 @@ public class ObjectAdapterMemento_LastKnownGood implements Serializable {
         
         // intercept when trivial
         if(spec.getBeanSort().isManagedBean()) {
-
-            
-            System.out.println("############## LOOKUP " + objectSpecId);
-            
-            //return MetaModelContext.current().lookupServiceAdapterById(objectSpecId.asString());
+            return MetaModelContext.current().lookupServiceAdapterById(objectSpecId.asString());
         }
         
         return cardinality.asAdapter(this, persistenceSession, specificationLoader);
diff --git a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
index 9a63aab..0f039b1 100644
--- a/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
+++ b/core/viewer-wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/models/EntityCollectionModel.java
@@ -122,10 +122,7 @@ implements LinksProvider, UiHintContainer {
             private Stream<ObjectAdapter> loadElementsOneByOne(final EntityCollectionModel model) {
 
                 return stream(model.mementoList)
-                        //.map(ObjectAdapterMemento::getObjectAdapter)
-                        .map(mem->{
-                            return mem.getObjectAdapter();
-                        })
+                        .map(ObjectAdapterMemento::getObjectAdapter)
                         .filter(_NullSafe::isPresent);
             }