You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/03/16 16:05:43 UTC

[causeway] branch master updated (d9d6cd81eb -> bc586311cb)

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

danhaywood pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git


    from d9d6cd81eb CAUSEWAY-3382: extends rename script
     new 38e2439c58 CAUSEWAY-3382: a further iteration
     new 4c4e17005c CAUSEWAY-3381 : spikes changing @Scope for @DomainObject
     new bc586311cb CAUSEWAY-3381 : updates javadoc, is all

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../causeway/applib/annotation/DomainObject.java   |  5 +++--
 scripts/ci/rename-all-published-sources.jsh        | 26 +++++++++++++---------
 .../applib/fixturescripts/FixtureScripts.java      | 11 ++++++++-
 3 files changed, 29 insertions(+), 13 deletions(-)


[causeway] 03/03: CAUSEWAY-3381 : updates javadoc, is all

Posted by da...@apache.org.
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/causeway.git

commit bc586311cbe7f31d81774e3bf96cbf3962ed243b
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Mar 16 16:05:27 2023 +0000

    CAUSEWAY-3381 : updates javadoc, is all
---
 .../org/apache/causeway/applib/annotation/DomainObject.java   |  3 ++-
 .../fixtures/applib/fixturescripts/FixtureScripts.java        | 11 ++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java b/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java
index 03372d3d31..6cfcd9847e 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java
@@ -51,7 +51,8 @@ import org.apache.causeway.applib.services.bookmark.Bookmark;
  * </p>
  *
  * @apiNote Meta annotation {@link Component} allows for the Spring framework to pick up (discover) the
- * annotated type.
+ * annotated type.  However, the custom {@link Scope} of &quot;causeway-domain-object&quot; is a clue that these
+ * objects (either entities or view models) <i>cannot</i> be obtained from the Spring application context.
  * For more details see <code>org.apache.causeway.core.config.beans.CausewayBeanFactoryPostProcessorForSpring</code>
  *
  * @see Action
diff --git a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java
index 8e1ad0763f..716602e686 100644
--- a/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java
+++ b/testing/fixtures/applib/src/main/java/org/apache/causeway/testing/fixtures/applib/fixturescripts/FixtureScripts.java
@@ -296,7 +296,16 @@ public class FixtureScripts {
      *     Also allows arbitrary parameters to be specified for said fixture script.
      * </p>
      *
-     * @param fixtureScriptName
+     * <p>
+     *     <b>NOTE</b>: this method can only be used for {@link FixtureScript} implementations that are discoverable
+     *     by Spring (eg annotated with {@link org.springframework.stereotype.Service} or
+     *     {@link org.springframework.stereotype.Component}.  <i>Moreover</i>, the {@link FixtureScript} must <i>not</i>
+     *     be a view model, ie must not be annotated with {@link org.apache.causeway.applib.annotation.DomainObject}.
+     *     (This is because the lifecycle of view models is unknown to by Spring).
+     *     Instead, use {@link #runFixtureScript(FixtureScript, String)}, passing in the {@link FixtureScript} instance.
+     * </p>
+     *
+     * @param fixtureScriptName - the {@link FixtureScript#getFriendlyName() (friendly) name} of the {@link FixtureScript}.
      * @param parameters
      */
     @Action(


[causeway] 02/03: CAUSEWAY-3381 : spikes changing @Scope for @DomainObject

Posted by da...@apache.org.
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/causeway.git

commit 4c4e17005cc5247ffb297aff58769d32d2ebd72b
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Mar 16 15:56:39 2023 +0000

    CAUSEWAY-3381 : spikes changing @Scope for @DomainObject
---
 .../main/java/org/apache/causeway/applib/annotation/DomainObject.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java b/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java
index 567cfe5bcc..03372d3d31 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/annotation/DomainObject.java
@@ -68,7 +68,7 @@ import org.apache.causeway.applib.services.bookmark.Bookmark;
         ElementType.ANNOTATION_TYPE
 })
 @Retention(RetentionPolicy.RUNTIME)
-@Component @Scope("prototype")
+@Component @Scope("causeway-domain-object")
 public @interface DomainObject {
 
     /**


[causeway] 01/03: CAUSEWAY-3382: a further iteration

Posted by da...@apache.org.
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/causeway.git

commit 38e2439c580c3c699f7762599744f866b7d3150c
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Mar 16 14:35:24 2023 +0000

    CAUSEWAY-3382: a further iteration
---
 scripts/ci/rename-all-published-sources.jsh | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/scripts/ci/rename-all-published-sources.jsh b/scripts/ci/rename-all-published-sources.jsh
index fd0942807f..4a0dc4c9e7 100644
--- a/scripts/ci/rename-all-published-sources.jsh
+++ b/scripts/ci/rename-all-published-sources.jsh
@@ -115,7 +115,11 @@ class RenameProject {
     static final List<String> UNCONDITIONAL_INCLUSIONS = List.of(
             "/META-INF/services/");
 
-    public RenameProject(final File root, final String oldName, final String newName) {
+    public static RenameProject renameBackToLegacy(final File root) {
+        return new RenameProject(root, "causeway", "isis");
+    }
+
+    private RenameProject(final File root, final String oldName, final String newName) {
         this.root = root;
         this.fromLower = oldName.toLowerCase();
         this.toLower = newName.toLowerCase();
@@ -215,31 +219,33 @@ class RenameProject {
 
                         // update schema declarations in .layout.xml files.
                         // terrible hack - we are assuming the target is 'isis'
+                        // (also, the first arg has to handle the case that we've already converted replaced 'causeway' -> 'isis' throughout...)
                         .replace(
-                                "https://causeway.apache.org/applib/layout/menubars/bootstrap3 https://causeway.apache.org/applib/layout/menubars/bootstrap3/menubars.xsd",
+                                "https://isis.apache.org/applib/layout/menubars/bootstrap3 https://isis.apache.org/applib/layout/menubars/bootstrap3/menubars.xsd",
                                 "http://isis.apache.org/applib/layout/menubars/bootstrap3 https://causeway.apache.org/applib/layout-v1/menubars/bootstrap3/menubars.xsd")
                         .replace(
-                                "https://causeway.apache.org/applib/layout/component https://causeway.apache.org/applib/layout/component/component.xsd",
+                                "https://isis.apache.org/applib/layout/component https://isis.apache.org/applib/layout/component/component.xsd",
                                 "http://isis.apache.org/applib/layout/component https://causeway.apache.org/applib/layout-v1/component/component.xsd")
                         .replace(
-                                "https://causeway.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd",
+                                "https://isis.apache.org/applib/layout/grid/bootstrap3 https://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd",
                                 "http://isis.apache.org/applib/layout/grid/bootstrap3 https://causeway.apache.org/applib/layout-v1/grid/bootstrap3/bootstrap3.xsd")
                         .replace(
-                                "https://causeway.apache.org/applib/layout/links https://causeway.apache.org/applib/layout/links/links.xsd",
+                                "https://isis.apache.org/applib/layout/links https://isis.apache.org/applib/layout/links/links.xsd",
                                 "http://isis.apache.org/applib/layout/links https://causeway.apache.org/applib/layout-v1/links/links.xsd")
 
                         // update namespace declarations in all files (.layout.xml and also constants in .java classes)
+                        // (again, the first arg has to handle the case that we've already converted replaced 'causeway' -> 'isis' throughout...)
                         .replace(
-                                "\"https://causeway.apache.org/applib/layout/menubars/bootstrap3\"",
+                                "\"https://isis.apache.org/applib/layout/menubars/bootstrap3\"",
                                 "\"http://isis.apache.org/applib/layout/menubars/bootstrap3\"")
                         .replace(
-                                "\"https://causeway.apache.org/applib/layout/component\"",
+                                "\"https://isis.apache.org/applib/layout/component\"",
                                 "\"http://isis.apache.org/applib/layout/component\"")
                         .replace(
-                                "\"https://causeway.apache.org/applib/layout/grid/bootstrap3\"",
+                                "\"https://isis.apache.org/applib/layout/grid/bootstrap3\"",
                                 "\"http://isis.apache.org/applib/layout/grid/bootstrap3\"")
                         .replace(
-                                "\"https://causeway.apache.org/applib/layout/links",
+                                "\"https://isis.apache.org/applib/layout/links",
                                 "\"http://isis.apache.org/applib/layout/links")
 
                         ;
@@ -354,7 +360,7 @@ if(rootPath.isBlank()
 
 var root = new File(rootPath);
 
-var renamer = new RenameProject(root, "causeway", "isis");
+var renamer = RenameProject.renameBackToLegacy(root);
 System.out.printf("processing root %s%n", root.getAbsolutePath());
 
 renamer.renameAllFiles();