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 2021/11/30 10:10:38 UTC
[isis] branch master updated: ISIS-2903: [Demo] fixes abstract JaxbRefEntity to properly render with collections
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 c0282e2 ISIS-2903: [Demo] fixes abstract JaxbRefEntity to properly render with collections
c0282e2 is described below
commit c0282e2581557a7d1ee8445bb47fe8b8487e5d60
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Nov 30 11:09:51 2021 +0100
ISIS-2903: [Demo] fixes abstract JaxbRefEntity to properly render with
collections
---
.../method/PropertyChoicesFacetViaMethod.java | 10 ------
.../isis/core/metamodel/spec/ManagedObjects.java | 2 --
.../viewmodels/jaxbrefentity/JaxbRefEntity.java | 10 +++++-
.../viewmodels/jaxbrefentity/jdo/JaxbRefJdo.java | 2 --
.../viewmodels/jaxbrefentity/jpa/JaxbRefJpa.java | 2 --
.../strings/samples/JavaLangStringSamples.java | 40 ----------------------
6 files changed, 9 insertions(+), 57 deletions(-)
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/choices/method/PropertyChoicesFacetViaMethod.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/choices/method/PropertyChoicesFacetViaMethod.java
index 8ae5b37..c92ad5e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/choices/method/PropertyChoicesFacetViaMethod.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/choices/method/PropertyChoicesFacetViaMethod.java
@@ -64,18 +64,8 @@ implements ImperativeFacet {
val method = methods.getFirstOrFail();
val elementSpec = specForTypeElseFail(((FacetedMethod) getFacetHolder()).getType());
val optionPojos = ManagedObjects.InvokeUtil.invoke(method, owningAdapter);
-
-//XXX[ISIS-2383] debugging
-// if(elementSpec.isEntity()) {
-// _NullSafe.streamAutodetect(optionPojos)
-// .map(pojo->ManagedObject.of(elementSpec, pojo))
-// .filter(adapter->!ManagedObjects.EntityUtil.isAttached(adapter))
-// .forEach(detached->_Probe.errOut("non attached entity from choices method %s detected", method));
-// }
-
val visibleChoices = ManagedObjects
.adaptMultipleOfTypeThenAttachThenFilterByVisibility(elementSpec, optionPojos, interactionInitiatedBy);
-
return visibleChoices;
}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObjects.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObjects.java
index 0e1346c..d328b65 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObjects.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ManagedObjects.java
@@ -342,8 +342,6 @@ public final class ManagedObjects {
.collect(Can.toCan());
}
-
-
/**
* eg. in order to prevent wrapping an object that is already wrapped
*/
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/JaxbRefEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/JaxbRefEntity.java
index f9dc660..a968316 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/JaxbRefEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/JaxbRefEntity.java
@@ -19,6 +19,8 @@
package demoapp.dom.domain.objects.DomainObject.nature.viewmodels.jaxbrefentity;
import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.ObjectSupport;
+import org.apache.isis.applib.annotation.Property;
import demoapp.dom._infra.values.ValueHolder;
@@ -34,7 +36,13 @@ implements
return getName();
}
- protected abstract String getName();
+ @ObjectSupport
+ public String title() {
+ return getName();
+ }
+
+ @Property
+ public abstract String getName();
protected abstract void setName(String value);
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jdo/JaxbRefJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jdo/JaxbRefJdo.java
index 0c1c991..bb06068 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jdo/JaxbRefJdo.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jdo/JaxbRefJdo.java
@@ -28,7 +28,6 @@ import org.springframework.context.annotation.Profile;
import org.apache.isis.applib.annotation.Bounding;
import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.Title;
import org.apache.isis.applib.jaxb.PersistentEntityAdapter;
import lombok.Getter;
@@ -51,7 +50,6 @@ public class JaxbRefJdo
this.name = name;
}
- @Title
@Getter @Setter
private String name;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jpa/JaxbRefJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jpa/JaxbRefJpa.java
index a5124b7..f8de1b4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jpa/JaxbRefJpa.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObject/nature/viewmodels/jaxbrefentity/jpa/JaxbRefJpa.java
@@ -29,7 +29,6 @@ import org.springframework.context.annotation.Profile;
import org.apache.isis.applib.annotation.Bounding;
import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.Title;
import org.apache.isis.applib.jaxb.PersistentEntityAdapter;
import org.apache.isis.persistence.jpa.applib.integration.IsisEntityListener;
@@ -63,7 +62,6 @@ public class JaxbRefJpa
@GeneratedValue
private Long id;
- @Title
@Getter @Setter
private String name;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/javalang/strings/samples/JavaLangStringSamples.java b/examples/demo/domain/src/main/java/demoapp/dom/types/javalang/strings/samples/JavaLangStringSamples.java
deleted file mode 100644
index 211fa54..0000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/javalang/strings/samples/JavaLangStringSamples.java
+++ /dev/null
@@ -1,40 +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 demoapp.dom.types.javalang.strings.samples;
-
-import java.util.stream.Stream;
-
-import javax.annotation.Priority;
-
-import org.springframework.stereotype.Service;
-
-import org.apache.isis.applib.annotation.PriorityPrecedence;
-
-import demoapp.dom.types.Samples;
-
-@Service
-@Priority(PriorityPrecedence.EARLY)
-public class JavaLangStringSamples implements Samples<String> {
-
- @Override
- public Stream<String> stream() {
- return Stream.of("Hello", "world");
- }
-
-}