diff --git a/.composer.json b/.composer.json
index fc12c2ff3a7..02ffb5fff2f 100644
--- a/.composer.json
+++ b/.composer.json
@@ -35,7 +35,8 @@
"../../bin/behat -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
"../../bin/behat -f progress -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
- "../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml"
+ "../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml",
+ "../../bin/behat -f progress -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist"
],
"test:behavioral:stop-on-failure": [
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
diff --git a/Neos.CliSetup/Classes/Command/SetupCommandController.php b/Neos.CliSetup/Classes/Command/SetupCommandController.php
deleted file mode 100644
index e29e5eb2ddf..00000000000
--- a/Neos.CliSetup/Classes/Command/SetupCommandController.php
+++ /dev/null
@@ -1,193 +0,0 @@
-databaseConnectionService->getAvailableDrivers();
- if (count($availableDrivers) == 0) {
- $this->outputLine('No supported database driver found');
- $this->quit(1);
- }
-
- if (is_null($driver)) {
- $driver = $this->output->select(
- sprintf('DB Driver (%s): ', $this->persistenceConfiguration['driver'] ?? '---'),
- $availableDrivers,
- $this->persistenceConfiguration['driver']
- );
- }
-
- if (is_null($host)) {
- $host = $this->output->ask(
- sprintf('Host (%s): ', $this->persistenceConfiguration['host'] ?? '127.0.0.1'),
- $this->persistenceConfiguration['host'] ?? '127.0.0.1'
- );
- }
-
- if (is_null($dbname)) {
- $dbname = $this->output->ask(
- sprintf('Database (%s): ', $this->persistenceConfiguration['dbname'] ?? '---'),
- $this->persistenceConfiguration['dbname']
- );
- }
-
- if (is_null($user)) {
- $user = $this->output->ask(
- sprintf('Username (%s): ', $this->persistenceConfiguration['user'] ?? '---'),
- $this->persistenceConfiguration['user']
- );
- }
-
- if (is_null($password)) {
- $password = $this->output->ask(
- sprintf('Password (%s): ', $this->persistenceConfiguration['password'] ?? '---'),
- $this->persistenceConfiguration['password']
- );
- }
-
- $persistenceConfiguration = [
- 'driver' => $driver,
- 'host' => $host,
- 'dbname' => $dbname,
- 'user' => $user,
- 'password' => $password
- ];
-
- // postgres does not know utf8mb4
- if ($driver == 'pdo_pgsql') {
- $persistenceConfiguration['charset'] = 'utf8';
- $persistenceConfiguration['defaultTableOptions']['charset'] = 'utf8';
- }
-
- $this->outputLine();
-
- try {
- $this->databaseConnectionService->verifyDatabaseConnectionWorks($persistenceConfiguration);
- $this->outputLine(sprintf('Database %s was connected sucessfully.', $persistenceConfiguration['dbname']));
- } catch (SetupException $exception) {
- try {
- $this->databaseConnectionService->createDatabaseAndVerifyDatabaseConnectionWorks($persistenceConfiguration);
- $this->outputLine(sprintf('Database %s was sucessfully created.', $persistenceConfiguration['dbname']));
- } catch (SetupException $exception) {
- $this->outputLine(sprintf(
- 'Database %s could not be created. Please check the permissions for user %s. Exception: %s',
- $persistenceConfiguration['dbname'],
- $persistenceConfiguration['user'],
- $exception->getMessage()
- ));
- $this->quit(1);
- }
- }
-
- $filename = 'Configuration/Settings.Database.yaml';
-
- $this->outputLine();
- $this->output(sprintf('%s',$this->writeSettings($filename, 'Neos.Flow.persistence.backendOptions',$persistenceConfiguration)));
- $this->outputLine();
- $this->outputLine(sprintf('The new database settings were written to %s', $filename));
- }
-
- /**
- * @param string|null $driver
- */
- public function imageHandlerCommand(string $driver = null): void
- {
- $availableImageHandlers = $this->imageHandlerService->getAvailableImageHandlers();
-
- if (count($availableImageHandlers) == 0) {
- $this->outputLine('No supported image handler found.');
- $this->quit(1);
- }
-
- if (is_null($driver)) {
- $driver = $this->output->select(
- sprintf('Select Image Handler (%s): ', array_key_last($availableImageHandlers)),
- $availableImageHandlers,
- array_key_last($availableImageHandlers)
- );
- }
-
- $filename = 'Configuration/Settings.Imagehandling.yaml';
- $this->outputLine();
- $this->output(sprintf('%s', $this->writeSettings($filename, 'Neos.Imagine.driver', $driver)));
- $this->outputLine();
- $this->outputLine(sprintf('The new image handler setting were written to %s', $filename));
- }
-
- /**
- * Write the settings to the given path, existing configuration files are created or modified
- *
- * @param string $filename The filename the settings are stored in
- * @param string $path The configuration path
- * @param mixed $settings The actual settings to write
- * @return string The added yaml code
- */
- protected function writeSettings(string $filename, string $path, $settings): string
- {
- if (file_exists($filename)) {
- $previousSettings = Yaml::parseFile($filename);
- } else {
- $previousSettings = [];
- }
- $newSettings = Arrays::setValueByPath($previousSettings,$path, $settings);
- file_put_contents($filename, YAML::dump($newSettings, 10, 2));
- return YAML::dump(Arrays::setValueByPath([],$path, $settings), 10, 2);
- }
-}
diff --git a/Neos.CliSetup/Classes/Command/WelcomeCommandController.php b/Neos.CliSetup/Classes/Command/WelcomeCommandController.php
deleted file mode 100644
index 66ca510e539..00000000000
--- a/Neos.CliSetup/Classes/Command/WelcomeCommandController.php
+++ /dev/null
@@ -1,70 +0,0 @@
-output(
- <<
- ....###### .######
- .....####### ...######
- .......####### ....######
- .........####### ....######
- ....#......#######...######
- ....##.......#######.######
- ....#####......############
- ....##### ......##########
- ....##### ......########
- ....##### ......######
- .####### ........
-
- Welcome to Neos.
-
-
- The following steps will help you to configure Neos:
-
- 1. Configure the database connection:
- ./flow setup:database
- 2. Create the required database tables:
- ./flow doctrine:migrate
- 3. Set up and check the required dependencies for a Content Repository instance:
- ./flow cr:setup
- 4. Migrate the existing data from the Legacy Content Repository:
- ./flow cr:migrateLegacyData --config '{"dbal": {"dbname": "YOUR-DATABASE-NAME"}, "resourcesPath": "/path/to/neos-8.0/Data/Persistent/Resources"}'
- 5. Configure the image handler:
- ./flow setup:imagehandler
- 6. Create an admin user:
- ./flow user:create --roles Administrator username password firstname lastname
- 7. Create your own site package or require an existing one (choose one option):
- - ./flow kickstart:site Vendor.Site
- - composer require neos/demo && ./flow flow:package:rescan
- 8. Import a site or create an empty one (choose one option):
- - ./flow site:import Neos.Demo
- - ./flow site:import Vendor.Site
- - ./flow site:create sitename Vendor.Site Vendor.Site:Document.HomePage
-
- EOT
- );
- }
-
-}
diff --git a/Neos.CliSetup/Classes/Exception.php b/Neos.CliSetup/Classes/Exception.php
deleted file mode 100644
index e792dc7c6cd..00000000000
--- a/Neos.CliSetup/Classes/Exception.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
- */
- protected $supportedDatabaseDrivers;
-
- /**
- * Return an array with the available database drivers
- *
- * @return array
- */
- public function getAvailableDrivers(): array
- {
- $availableDrivers = [];
- foreach ($this->supportedDatabaseDrivers as $driver => $description) {
- if (extension_loaded($driver)) {
- $availableDrivers[$driver] = $description;
- }
- }
- return $availableDrivers;
- }
-
- /**
- * Verify the database connection settings
- *
- * @param array $connectionSettings
- * @throws SetupException
- */
- public function verifyDatabaseConnectionWorks(array $connectionSettings)
- {
- try {
- $this->connectToDatabase($connectionSettings);
- } catch (DBALException | \PDOException $exception) {
- throw new SetupException(sprintf('Could not connect to database "%s". Please check the permissions for user "%s". DBAL Exception: "%s"', $connectionSettings['dbname'], $connectionSettings['user'], $exception->getMessage()), 1351000864);
- }
- }
-
- /**
- * Create a database with the connection settings and verify the connection
- *
- * @param array $connectionSettings
- * @throws SetupException
- */
- public function createDatabaseAndVerifyDatabaseConnectionWorks(array $connectionSettings)
- {
- try {
- $this->createDatabase($connectionSettings, $connectionSettings['dbname']);
- } catch (DBALException | \PDOException $exception) {
- throw new SetupException(sprintf('Database "%s" could not be created. Please check the permissions for user "%s". DBAL Exception: "%s"', $connectionSettings['dbname'], $connectionSettings['user'], $exception->getMessage()), 1351000841, $exception);
- }
- try {
- $this->connectToDatabase($connectionSettings);
- } catch (DBALException | \PDOException $exception) {
- throw new SetupException(sprintf('Could not connect to database "%s". Please check the permissions for user "%s". DBAL Exception: "%s"', $connectionSettings['dbname'], $connectionSettings['user'], $exception->getMessage()), 1351000864);
- }
- }
-
- /**
- * Tries to connect to the database using the specified $connectionSettings
- *
- * @param array $connectionSettings array in the format array('user' => 'dbuser', 'password' => 'dbpassword', 'host' => 'dbhost', 'dbname' => 'dbname')
- * @return void
- * @throws \Doctrine\DBAL\Exception | \PDOException if the connection fails
- */
- protected function connectToDatabase(array $connectionSettings)
- {
- $connection = DriverManager::getConnection($connectionSettings);
- $connection->connect();
- }
-
- /**
- * Connects to the database using the specified $connectionSettings
- * and tries to create a database named $databaseName.
- *
- * @param array $connectionSettings array in the format array('user' => 'dbuser', 'password' => 'dbpassword', 'host' => 'dbhost', 'dbname' => 'dbname')
- * @param string $databaseName name of the database to create
- * @throws \Neos\Setup\Exception
- * @return void
- */
- protected function createDatabase(array $connectionSettings, $databaseName)
- {
- unset($connectionSettings['dbname']);
- $connection = DriverManager::getConnection($connectionSettings);
- $databasePlatform = $connection->getSchemaManager()->getDatabasePlatform();
- $databaseName = $databasePlatform->quoteIdentifier($databaseName);
- // we are not using $databasePlatform->getCreateDatabaseSQL() below since we want to specify charset and collation
- if ($databasePlatform instanceof MySqlPlatform) {
- $connection->executeUpdate(sprintf('CREATE DATABASE %s CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci', $databaseName));
- } elseif ($databasePlatform instanceof PostgreSqlPlatform) {
- $connection->executeUpdate(sprintf('CREATE DATABASE %s WITH ENCODING = %s', $databaseName, "'UTF8'"));
- } else {
- throw new SetupException(sprintf('The given database platform "%s" is not supported.', $databasePlatform->getName()), 1386454885);
- }
- $connection->close();
- }
-}
diff --git a/Neos.CliSetup/Classes/Infrastructure/ImageHandler/ImageHandlerService.php b/Neos.CliSetup/Classes/Infrastructure/ImageHandler/ImageHandlerService.php
deleted file mode 100644
index cc4cb6ec69f..00000000000
--- a/Neos.CliSetup/Classes/Infrastructure/ImageHandler/ImageHandlerService.php
+++ /dev/null
@@ -1,78 +0,0 @@
-
- */
- public function getAvailableImageHandlers(): array
- {
- $availableImageHandlers = [];
- foreach ($this->supportedImageHandlers as $driverName => $description) {
- if (\extension_loaded(strtolower($driverName))) {
- $unsupportedFormats = $this->findUnsupportedImageFormats($driverName);
- if (\count($unsupportedFormats) === 0) {
- $availableImageHandlers[$driverName] = $description;
- }
- }
- }
- return $availableImageHandlers;
- }
-
- /**
- * @param string $driver
- * @return array Not supported image formats
- */
- protected function findUnsupportedImageFormats(string $driver): array
- {
- $this->imagineFactory->injectSettings(['driver' => ucfirst($driver)]);
- $imagine = $this->imagineFactory->create();
- $unsupportedFormats = [];
-
- foreach ($this->requiredImageFormats as $imageFormat => $testFile) {
- try {
- $imagine->load(file_get_contents($testFile));
- } /** @noinspection BadExceptionsProcessingInspection */ catch (\Exception $exception) {
- $unsupportedFormats[] = $imageFormat;
- }
- }
- return $unsupportedFormats;
- }
-}
diff --git a/Neos.CliSetup/Configuration/Settings.yaml b/Neos.CliSetup/Configuration/Settings.yaml
deleted file mode 100644
index a98508ce232..00000000000
--- a/Neos.CliSetup/Configuration/Settings.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-Neos:
- CliSetup:
- #
- # Imagine drivers that are supported
- #
- supportedImageHandlers:
- 'Gd': 'GD Library - generally slow, not recommended in production'
- 'Gmagick': 'Gmagick php module'
- 'Imagick': 'ImageMagick php module'
- 'Vips': 'Vips php module - fast and memory efficient, needs rokka/imagine-vips'
- #
- # Images to verify that the format can be handled
- #
- requiredImageFormats:
- 'jpg': 'resource://Neos.Neos/Private/Installer/TestImages/Test.jpg'
- 'gif': 'resource://Neos.Neos/Private/Installer/TestImages/Test.gif'
- 'png': 'resource://Neos.Neos/Private/Installer/TestImages/Test.png'
- #
- # The database drivers that are supported by migrations
- #
- supportedDatabaseDrivers:
- 'pdo_mysql': 'MySQL/MariaDB via PDO'
- 'mysqli': 'MySQL/MariaDB via mysqli'
- 'pdo_pgsql': 'PostgreSQL via PDO'
diff --git a/Neos.CliSetup/LICENSE b/Neos.CliSetup/LICENSE
deleted file mode 100644
index 10926e87f11..00000000000
--- a/Neos.CliSetup/LICENSE
+++ /dev/null
@@ -1,675 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
-
diff --git a/Neos.CliSetup/Readme.rst b/Neos.CliSetup/Readme.rst
deleted file mode 100644
index 3f58184c434..00000000000
--- a/Neos.CliSetup/Readme.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-----------------
-The Neos package
-----------------
-
-.. note:: This repository is a **read-only subsplit** of a package that is part of the
- Neos project (learn more on `www.neos.io `_).
-
-Neos is an open source Content Application Platform based on Flow. A set of
-core Content Management features is resting within a larger context that allows
-you to build a perfectly customized experience for your users.
-
-If you want to use Neos, please have a look at the `Neos documentation
-`_
-
-Contribute
-----------
-
-If you want to contribute to Neos, please have a look at
-https://github.com/neos/neos-development-collection - it is the repository
-used for development and all pull requests should go into it.
diff --git a/Neos.CliSetup/composer.json b/Neos.CliSetup/composer.json
deleted file mode 100644
index c2a4d3f756a..00000000000
--- a/Neos.CliSetup/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "neos/cli-setup",
- "type": "neos-package",
- "license": [
- "GPL-3.0-or-later"
- ],
- "description": "ClI setup for Neos CMS",
- "require": {
- "php": "^8.2",
- "neos/neos": "self.version"
- },
- "autoload": {
- "psr-4": {
- "Neos\\CliSetup\\": "Classes"
- }
- }
-}
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php
index 2f918be284f..d7d3239cd7b 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/FeatureContext.php
@@ -11,12 +11,11 @@
* source code.
*/
-require_once(__DIR__ . '/../../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php');
require_once(__DIR__ . '/ProjectionIntegrityViolationDetectionTrait.php');
use Behat\Behat\Context\Context as BehatContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
-use Neos\Behat\Tests\Behat\FlowContextTrait;
+use Neos\Behat\FlowBootstrapTrait;
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory;
@@ -33,7 +32,7 @@
*/
class FeatureContext implements BehatContext
{
- use FlowContextTrait;
+ use FlowBootstrapTrait;
use ProjectionIntegrityViolationDetectionTrait;
use CRTestSuiteTrait;
use CRBehavioralTestsSubjectProvider;
@@ -42,11 +41,8 @@ class FeatureContext implements BehatContext
public function __construct()
{
- if (self::$bootstrap === null) {
- self::$bootstrap = $this->initializeFlow();
- }
- $this->objectManager = self::$bootstrap->getObjectManager();
- $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class);
+ self::bootstrapFlow();
+ $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class);
$this->setupCRTestSuiteTrait();
$this->setupDbalGraphAdapterIntegrityViolationTrait();
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php
index 82a090cecb4..a318b4ea750 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php
@@ -32,6 +32,8 @@
/**
* Custom context trait for projection integrity violation detection specific to the Doctrine DBAL content graph adapter
+ *
+ * @todo move this class somewhere where its autoloaded
*/
trait ProjectionIntegrityViolationDetectionTrait
{
@@ -41,6 +43,14 @@ trait ProjectionIntegrityViolationDetectionTrait
protected Result $lastIntegrityViolationDetectionResult;
+ /**
+ * @template T of object
+ * @param class-string $className
+ *
+ * @return T
+ */
+ abstract private function getObject(string $className): object;
+
protected function getTableNamePrefix(): string
{
return DoctrineDbalContentGraphProjectionFactory::graphProjectionTableNamePrefix(
@@ -50,7 +60,7 @@ protected function getTableNamePrefix(): string
public function setupDbalGraphAdapterIntegrityViolationTrait()
{
- $this->dbalClient = $this->getObjectManager()->get(DbalClient::class);
+ $this->dbalClient = $this->getObject(DbalClient::class);
}
/**
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
index be851203b64..88477f51f32 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
@@ -23,6 +23,7 @@
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\EventStore\EventInterface;
+use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked;
use Neos\ContentRepository\Core\Feature\ContentStreamRemoval\Event\ContentStreamWasRemoved;
use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionShineThroughWasAdded;
@@ -46,7 +47,6 @@
use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
-use Neos\ContentRepository\Core\Projection\CatchUpHookFactoryInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\Timestamps;
use Neos\ContentRepository\Core\Projection\ProjectionInterface;
use Neos\ContentRepository\Core\Projection\WithMarkStaleInterface;
@@ -86,6 +86,7 @@ final class DoctrineDbalContentGraphProjection implements ProjectionInterface, W
public function __construct(
private readonly DbalClientInterface $dbalClient,
private readonly NodeFactory $nodeFactory,
+ private readonly ContentRepositoryId $contentRepositoryId,
private readonly NodeTypeManager $nodeTypeManager,
private readonly ProjectionContentGraph $projectionContentGraph,
private readonly string $tableNamePrefix,
@@ -212,6 +213,7 @@ public function getState(): ContentGraph
$this->contentGraph = new ContentGraph(
$this->dbalClient,
$this->nodeFactory,
+ $this->contentRepositoryId,
$this->nodeTypeManager,
$this->tableNamePrefix
);
@@ -233,7 +235,7 @@ public function markStale(): void
private function whenRootNodeAggregateWithNodeWasCreated(RootNodeAggregateWithNodeWasCreated $event, EventEnvelope $eventEnvelope): void
{
$nodeRelationAnchorPoint = NodeRelationAnchorPoint::create();
- $originDimensionSpacePoint = OriginDimensionSpacePoint::fromArray([]);
+ $originDimensionSpacePoint = OriginDimensionSpacePoint::createWithoutDimensions();
$node = new NodeRecord(
$nodeRelationAnchorPoint,
$event->nodeAggregateId,
@@ -272,7 +274,7 @@ private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDim
->getAnchorPointForNodeAndOriginDimensionSpacePointAndContentStream(
$event->nodeAggregateId,
/** the origin DSP of the root node is always the empty dimension ({@see whenRootNodeAggregateWithNodeWasCreated}) */
- OriginDimensionSpacePoint::fromArray([]),
+ OriginDimensionSpacePoint::createWithoutDimensions(),
$event->contentStreamId
);
if ($rootNodeAnchorPoint === null) {
@@ -517,12 +519,6 @@ private function connectHierarchy(
}
/**
- * @param NodeRelationAnchorPoint|null $parentAnchorPoint
- * @param NodeRelationAnchorPoint|null $childAnchorPoint
- * @param NodeRelationAnchorPoint|null $succeedingSiblingAnchorPoint
- * @param ContentStreamId $contentStreamId
- * @param DimensionSpacePoint $dimensionSpacePoint
- * @return int
* @throws \Doctrine\DBAL\DBALException
*/
private function getRelationPosition(
@@ -590,6 +586,12 @@ private function getRelationPositionAfterRecalculation(
$dimensionSpacePoint
);
+ usort(
+ $hierarchyRelations,
+ fn (HierarchyRelation $relationA, HierarchyRelation $relationB): int
+ => $relationA->position <=> $relationB->position
+ );
+
foreach ($hierarchyRelations as $relation) {
$offset += self::RELATION_DEFAULT_OFFSET;
if (
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php
index 51373f5d428..d3022e2c290 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjectionFactory.php
@@ -41,7 +41,6 @@ public function build(
);
return new ContentGraphProjection(
- // @phpstan-ignore-next-line
new DoctrineDbalContentGraphProjection(
$this->dbalClient,
new NodeFactory(
@@ -49,6 +48,7 @@ public function build(
$projectionFactoryDependencies->nodeTypeManager,
$projectionFactoryDependencies->propertyConverter
),
+ $projectionFactoryDependencies->contentRepositoryId,
$projectionFactoryDependencies->nodeTypeManager,
new ProjectionContentGraph(
$this->dbalClient,
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php
index f2e032259f7..e32b01fb641 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeMove.php
@@ -44,7 +44,6 @@ private function whenNodeAggregateWasMoved(NodeAggregateWasMoved $event): void
$this->transactional(function () use ($event) {
foreach ($event->nodeMoveMappings as $moveNodeMapping) {
// for each materialized node in the DB which we want to adjust, we have one MoveNodeMapping.
- /* @var \Neos\ContentRepository\Core\Feature\NodeMove\Dto\OriginNodeMoveMapping $moveNodeMapping */
$nodeToBeMoved = $this->getProjectionContentGraph()->findNodeByIds(
$event->contentStreamId,
$event->nodeAggregateId,
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
index 126200f98a3..3e39613f33b 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
@@ -19,6 +19,7 @@
use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\NodeRelationAnchorPoint;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
+use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphWithRuntimeCaches\ContentSubgraphWithRuntimeCaches;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindRootNodeAggregatesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregates;
@@ -56,6 +57,7 @@ final class ContentGraph implements ContentGraphInterface
public function __construct(
private readonly DbalClientInterface $client,
private readonly NodeFactory $nodeFactory,
+ private readonly ContentRepositoryId $contentRepositoryId,
private readonly NodeTypeManager $nodeTypeManager,
private readonly string $tableNamePrefix
) {
@@ -70,6 +72,7 @@ final public function getSubgraph(
if (!isset($this->subgraphs[$index])) {
$this->subgraphs[$index] = new ContentSubgraphWithRuntimeCaches(
new ContentSubgraph(
+ $this->contentRepositoryId,
$contentStreamId,
$dimensionSpacePoint,
$visibilityConstraints,
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php
index f6dce5f028e..4100d614945 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php
@@ -21,10 +21,12 @@
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Query\QueryBuilder;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
+use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath;
+use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity;
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountAncestorNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountBackReferencesFilter;
@@ -102,6 +104,7 @@ final class ContentSubgraph implements ContentSubgraphInterface
private int $dynamicParameterCount = 0;
public function __construct(
+ private readonly ContentRepositoryId $contentRepositoryId,
private readonly ContentStreamId $contentStreamId,
private readonly DimensionSpacePoint $dimensionSpacePoint,
private readonly VisibilityConstraints $visibilityConstraints,
@@ -112,6 +115,16 @@ public function __construct(
) {
}
+ public function getIdentity(): ContentSubgraphIdentity
+ {
+ return ContentSubgraphIdentity::create(
+ $this->contentRepositoryId,
+ $this->contentStreamId,
+ $this->dimensionSpacePoint,
+ $this->visibilityConstraints
+ );
+ }
+
public function findChildNodes(NodeAggregateId $parentNodeAggregateId, FindChildNodesFilter $filter): Nodes
{
$queryBuilder = $this->buildChildNodesQuery($parentNodeAggregateId, $filter);
diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php
index 0ac6f2e1aad..c93abc75f93 100644
--- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php
+++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php
@@ -67,7 +67,7 @@ public function mapNodeRowToNode(
? $this->nodeTypeManager->getNodeType($nodeRow['nodetypename'])
: null;
- return new Node(
+ return Node::create(
ContentSubgraphIdentity::create(
$this->contentRepositoryId,
ContentStreamId::fromString($nodeRow['contentstreamid']),
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php
index 56bd658091f..767eb7c064b 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeCreation.php
@@ -44,7 +44,7 @@ trait NodeCreation
private function whenRootNodeAggregateWithNodeWasCreated(RootNodeAggregateWithNodeWasCreated $event): void
{
$nodeRelationAnchorPoint = NodeRelationAnchorPoint::create();
- $originDimensionSpacePoint = OriginDimensionSpacePoint::fromArray([]);
+ $originDimensionSpacePoint = OriginDimensionSpacePoint::createWithoutDimensions();
$node = new NodeRecord(
$nodeRelationAnchorPoint,
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php
index f9037c9453a..bf8d017432b 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php
@@ -31,6 +31,7 @@
use Neos\ContentGraph\PostgreSQLAdapter\Domain\Repository\NodeFactory;
use Neos\ContentGraph\PostgreSQLAdapter\Infrastructure\PostgresDbalClientInterface;
use Neos\ContentRepository\Core\EventStore\EventInterface;
+use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked;
use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated;
use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled;
@@ -81,6 +82,7 @@ final class HypergraphProjection implements ProjectionInterface
public function __construct(
private readonly PostgresDbalClientInterface $databaseClient,
private readonly NodeFactory $nodeFactory,
+ private readonly ContentRepositoryId $contentRepositoryId,
private readonly NodeTypeManager $nodeTypeManager,
private readonly string $tableNamePrefix,
) {
@@ -221,6 +223,7 @@ public function getState(): ContentHypergraph
$this->contentHypergraph = new ContentHypergraph(
$this->databaseClient,
$this->nodeFactory,
+ $this->contentRepositoryId,
$this->nodeTypeManager,
$this->tableNamePrefix
);
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php
index 124f10c7933..1d876921576 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php
@@ -71,7 +71,6 @@ public function findNodeRecordByCoverage(
$query = ProjectionHypergraphQuery::create($contentStreamId, $this->tableNamePrefix);
$query = $query->withDimensionSpacePoint($dimensionSpacePoint)
->withNodeAggregateId($nodeAggregateId);
- /** @phpstan-ignore-next-line @todo check actual return type */
$result = $query->execute($this->getDatabaseConnection())->fetchAssociative();
return $result ? NodeRecord::fromDatabaseRow($result) : null;
@@ -89,7 +88,6 @@ public function findNodeRecordByOrigin(
$query = $query->withOriginDimensionSpacePoint($originDimensionSpacePoint);
$query = $query->withNodeAggregateId($nodeAggregateId);
- /** @phpstan-ignore-next-line @todo check actual return type */
$result = $query->execute($this->getDatabaseConnection())->fetchAssociative();
return $result ? NodeRecord::fromDatabaseRow($result) : null;
@@ -191,7 +189,6 @@ public function findNodeRecordsForNodeAggregate(
$query = ProjectionHypergraphQuery::create($contentStreamId, $this->tableNamePrefix);
$query = $query->withNodeAggregateId($nodeAggregateId);
- /** @phpstan-ignore-next-line @todo check actual return type */
$result = $query->execute($this->getDatabaseConnection())->fetchAllAssociative();
return array_map(function ($row) {
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php
index 53c1efacd45..ad41c6b19d3 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php
@@ -15,7 +15,7 @@
namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Query;
use Doctrine\DBAL\Connection;
-use Doctrine\DBAL\Driver\ResultStatement;
+use Doctrine\DBAL\Driver\Result;
use Doctrine\DBAL\Types\Types;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
@@ -113,10 +113,7 @@ public function withNodeAggregateId(NodeAggregateId $nodeAggregateId): self
return new self($query, $parameters, $this->types);
}
- /**
- * @return ResultStatement
- */
- public function execute(Connection $databaseConnection): ResultStatement
+ public function execute(Connection $databaseConnection): Result
{
return $databaseConnection->executeQuery($this->query, $this->parameters, $this->types);
}
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php
index ff2ee1066e4..602bf71191d 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQueryInterface.php
@@ -15,7 +15,7 @@
namespace Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Query;
use Doctrine\DBAL\Connection;
-use Doctrine\DBAL\Driver\ResultStatement;
+use Doctrine\DBAL\Driver\Result;
/**
* The interface to be implemented by projection hypergraph queries
@@ -24,8 +24,5 @@
*/
interface ProjectionHypergraphQueryInterface
{
- /**
- * @return ResultStatement
- */
- public function execute(Connection $databaseConnection): ResultStatement;
+ public function execute(Connection $databaseConnection): Result;
}
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php
index 58244d9823b..f45b29b8e34 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php
@@ -23,6 +23,7 @@
use Neos\ContentGraph\PostgreSQLAdapter\Infrastructure\PostgresDbalClientInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
+use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindRootNodeAggregatesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregates;
@@ -59,6 +60,7 @@ final class ContentHypergraph implements ContentGraphInterface
public function __construct(
PostgresDbalClientInterface $databaseClient,
NodeFactory $nodeFactory,
+ private readonly ContentRepositoryId $contentRepositoryId,
private readonly NodeTypeManager $nodeTypeManager,
private readonly string $tableNamePrefix
) {
@@ -74,6 +76,7 @@ public function getSubgraph(
$index = $contentStreamId->value . '-' . $dimensionSpacePoint->hash . '-' . $visibilityConstraints->getHash();
if (!isset($this->subhypergraphs[$index])) {
$this->subhypergraphs[$index] = new ContentSubhypergraph(
+ $this->contentRepositoryId,
$contentStreamId,
$dimensionSpacePoint,
$visibilityConstraints,
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php
index 172afffed67..32705839a97 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php
@@ -24,9 +24,11 @@
use Neos\ContentGraph\PostgreSQLAdapter\Domain\Repository\Query\QueryUtility;
use Neos\ContentGraph\PostgreSQLAdapter\Infrastructure\PostgresDbalClientInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
+use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath;
+use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity;
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindBackReferencesFilter;
@@ -69,19 +71,30 @@
*
* @internal but the public {@see ContentSubgraphInterface} is API
*/
-final class ContentSubhypergraph implements ContentSubgraphInterface
+final readonly class ContentSubhypergraph implements ContentSubgraphInterface
{
public function __construct(
- private readonly ContentStreamId $contentStreamId,
- private readonly DimensionSpacePoint $dimensionSpacePoint,
- private readonly VisibilityConstraints $visibilityConstraints,
- private readonly PostgresDbalClientInterface $databaseClient,
- private readonly NodeFactory $nodeFactory,
- private readonly NodeTypeManager $nodeTypeManager,
- private readonly string $tableNamePrefix
+ private ContentRepositoryId $contentRepositoryId,
+ private ContentStreamId $contentStreamId,
+ private DimensionSpacePoint $dimensionSpacePoint,
+ private VisibilityConstraints $visibilityConstraints,
+ private PostgresDbalClientInterface $databaseClient,
+ private NodeFactory $nodeFactory,
+ private NodeTypeManager $nodeTypeManager,
+ private string $tableNamePrefix
) {
}
+ public function getIdentity(): ContentSubgraphIdentity
+ {
+ return ContentSubgraphIdentity::create(
+ $this->contentRepositoryId,
+ $this->contentStreamId,
+ $this->dimensionSpacePoint,
+ $this->visibilityConstraints
+ );
+ }
+
public function findNodeById(NodeAggregateId $nodeAggregateId): ?Node
{
$query = HypergraphQuery::create($this->contentStreamId, $this->tableNamePrefix);
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php
index 797c0001b0e..894b86cc3b2 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/NodeFactory.php
@@ -75,7 +75,7 @@ public function mapNodeRowToNode(
? $this->nodeTypeManager->getNodeType($nodeRow['nodetypename'])
: null;
- return new Node(
+ return Node::create(
ContentSubgraphIdentity::create(
$this->contentRepositoryId,
$contentStreamId ?: ContentStreamId::fromString($nodeRow['contentstreamid']),
diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php b/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php
index ca4a76375ee..4c3def6eea8 100644
--- a/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php
+++ b/Neos.ContentGraph.PostgreSQLAdapter/src/HypergraphProjectionFactory.php
@@ -43,6 +43,7 @@ public function build(
$projectionFactoryDependencies->nodeTypeManager,
$projectionFactoryDependencies->propertyConverter
),
+ $projectionFactoryDependencies->contentRepositoryId,
$projectionFactoryDependencies->nodeTypeManager,
$tableNamePrefix
);
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php
index 31d9bc21b50..f6e7e6d0786 100644
--- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Bootstrap/FeatureContext.php
@@ -11,13 +11,13 @@
* source code.
*/
-require_once(__DIR__ . '/../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php');
+// @todo remove this require statement
require_once(__DIR__ . '/../../../../Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php');
use Behat\Behat\Context\Context as BehatContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use GuzzleHttp\Psr7\Uri;
-use Neos\Behat\Tests\Behat\FlowContextTrait;
+use Neos\Behat\FlowBootstrapTrait;
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait;
use Neos\ContentRepository\BehavioralTests\ProjectionRaceConditionTester\Dto\TraceEntryType;
use Neos\ContentRepository\BehavioralTests\ProjectionRaceConditionTester\RedisInterleavingLogger;
@@ -38,14 +38,13 @@
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\StructureAdjustmentsTrait;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Configuration\ConfigurationManager;
-use Neos\Flow\ObjectManagement\ObjectManagerInterface;
/**
* Features context
*/
class FeatureContext implements BehatContext
{
- use FlowContextTrait;
+ use FlowBootstrapTrait;
use CRTestSuiteTrait;
use CRBehavioralTestsSubjectProvider;
use ProjectionIntegrityViolationDetectionTrait;
@@ -58,22 +57,19 @@ class FeatureContext implements BehatContext
public function __construct()
{
- if (self::$bootstrap === null) {
- self::$bootstrap = $this->initializeFlow();
- }
- $this->objectManager = self::$bootstrap->getObjectManager();
+ self::bootstrapFlow();
- $this->dbalClient = $this->getObjectManager()->get(DbalClientInterface::class);
+ $this->dbalClient = $this->getObject(DbalClientInterface::class);
$this->setupCRTestSuiteTrait();
$this->setUpInterleavingLogger();
- $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class);
+ $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class);
}
private function setUpInterleavingLogger(): void
{
// prepare race tracking for debugging into the race log
if (class_exists(RedisInterleavingLogger::class)) { // the class must exist (the package loaded)
- $raceConditionTrackerConfig = $this->getObjectManager()->get(ConfigurationManager::class)
+ $raceConditionTrackerConfig = $this->getObject(ConfigurationManager::class)
->getConfiguration(
ConfigurationManager::CONFIGURATION_TYPE_SETTINGS,
'Neos.ContentRepository.BehavioralTests.raceConditionTracker'
@@ -115,11 +111,6 @@ public function resetContentRepositoryComponents(BeforeScenarioScope $scope): vo
GherkinPyStringNodeBasedNodeTypeManagerFactory::reset();
}
- protected function getObjectManager(): ObjectManagerInterface
- {
- return $this->objectManager;
- }
-
protected function getContentRepositoryService(
ContentRepositoryServiceFactoryInterface $factory
): ContentRepositoryServiceInterface {
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithoutDimensions.feature
new file mode 100644
index 00000000000..7678cbc51e4
--- /dev/null
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithoutDimensions.feature
@@ -0,0 +1,164 @@
+@contentrepository @adapters=DoctrineDBAL
+Feature: Create a root node aggregate with tethered children
+
+ As a user of the CR I want to create a new root node aggregate with an initial node and tethered children.
+
+ These are the test cases without dimensions involved
+
+ Background:
+ Given using no content dimensions
+ And using the following node types:
+ """yaml
+ 'Neos.ContentRepository.Testing:SubSubNode':
+ properties:
+ text:
+ defaultValue: 'my sub sub default'
+ type: string
+ 'Neos.ContentRepository.Testing:SubNode':
+ childNodes:
+ grandchild-node:
+ type: 'Neos.ContentRepository.Testing:SubSubNode'
+ properties:
+ text:
+ defaultValue: 'my sub default'
+ type: string
+ 'Neos.ContentRepository.Testing:RootWithTetheredChildNodes':
+ superTypes:
+ 'Neos.ContentRepository:Root': true
+ childNodes:
+ child-node:
+ type: 'Neos.ContentRepository.Testing:SubNode'
+ """
+ And using identifier "default", I define a content repository
+ And I am in content repository "default"
+ And the command CreateRootWorkspace is executed with payload:
+ | Key | Value |
+ | workspaceName | "live" |
+ | workspaceTitle | "Live" |
+ | workspaceDescription | "The live workspace" |
+ | newContentStreamId | "cs-identifier" |
+ And the graph projection is fully up to date
+ And I am in content stream "cs-identifier"
+ And I am in dimension space point {}
+ And I am user identified by "initiating-user-identifier"
+
+ Scenario: Create root node with tethered children
+ When the command CreateRootNodeAggregateWithNode is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" |
+ | tetheredDescendantNodeAggregateIds | {"child-node": "nody-mc-nodeface", "child-node/grandchild-node": "nodimus-prime"} |
+ And the graph projection is fully up to date
+
+ Then I expect exactly 4 events to be published on stream "ContentStream:cs-identifier"
+ And event at index 1 is of type "RootNodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" |
+ | coveredDimensionSpacePoints | [[]] |
+ | nodeAggregateClassification | "root" |
+ And event at index 2 is of type "NodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nody-mc-nodeface" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:SubNode" |
+ | originDimensionSpacePoint | [] |
+ | coveredDimensionSpacePoints | [[]] |
+ | parentNodeAggregateId | "lady-eleonode-rootford" |
+ | nodeName | "child-node" |
+ | initialPropertyValues | {"text": {"value": "my sub default", "type": "string"}} |
+ | nodeAggregateClassification | "tethered" |
+ And event at index 3 is of type "NodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nodimus-prime" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:SubSubNode" |
+ | originDimensionSpacePoint | [] |
+ | coveredDimensionSpacePoints | [[]] |
+ | parentNodeAggregateId | "nody-mc-nodeface" |
+ | nodeName | "grandchild-node" |
+ | initialPropertyValues | {"text": {"value": "my sub sub default", "type": "string"}} |
+ | nodeAggregateClassification | "tethered" |
+
+ And I expect the node aggregate "lady-eleonode-rootford" to exist
+ And I expect this node aggregate to be classified as "root"
+ And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes"
+ And I expect this node aggregate to be unnamed
+ And I expect this node aggregate to occupy dimension space points [[]]
+ And I expect this node aggregate to cover dimension space points [[]]
+ And I expect this node aggregate to disable dimension space points []
+ And I expect this node aggregate to have no parent node aggregates
+ And I expect this node aggregate to have the child node aggregates ["nody-mc-nodeface"]
+
+ And I expect the node aggregate "nody-mc-nodeface" to exist
+ And I expect this node aggregate to be classified as "tethered"
+ And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubNode"
+ And I expect this node aggregate to be named "child-node"
+ And I expect this node aggregate to occupy dimension space points [[]]
+ And I expect this node aggregate to cover dimension space points [[]]
+ And I expect this node aggregate to disable dimension space points []
+ And I expect this node aggregate to have the parent node aggregates ["lady-eleonode-rootford"]
+ And I expect this node aggregate to have the child node aggregates ["nodimus-prime"]
+
+ And I expect the node aggregate "nodimus-prime" to exist
+ And I expect this node aggregate to be classified as "tethered"
+ And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubSubNode"
+ And I expect this node aggregate to be named "grandchild-node"
+ And I expect this node aggregate to occupy dimension space points [[]]
+ And I expect this node aggregate to cover dimension space points [[]]
+ And I expect this node aggregate to disable dimension space points []
+ And I expect this node aggregate to have the parent node aggregates ["nody-mc-nodeface"]
+ And I expect this node aggregate to have no child node aggregates
+
+ And I expect the graph projection to consist of exactly 3 nodes
+ And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph
+ And I expect this node to be classified as "root"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes"
+ And I expect this node to be unnamed
+ And I expect this node to have no properties
+
+ And I expect a node identified by cs-identifier;nody-mc-nodeface;{} to exist in the content graph
+ And I expect this node to be classified as "tethered"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:SubNode"
+ And I expect this node to be named "child-node"
+ And I expect this node to have the following properties:
+ | Key | Value |
+ | text | "my sub default" |
+
+ And I expect a node identified by cs-identifier;nodimus-prime;{} to exist in the content graph
+ And I expect this node to be classified as "tethered"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:SubSubNode"
+ And I expect this node to be named "grandchild-node"
+ And I expect this node to have the following properties:
+ | Key | Value |
+ | text | "my sub sub default" |
+
+ When I am in content stream "cs-identifier" and dimension space point []
+ And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have no parent node
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | child-node | cs-identifier;nody-mc-nodeface;{} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{}
+ And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | grandchild-node | cs-identifier;nodimus-prime;{} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{}
+ And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{}
+ And I expect this node to have no child nodes
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/04-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/04-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithDimensions.feature
new file mode 100644
index 00000000000..cf15c9682e6
--- /dev/null
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/04-CreateRootNodeAggregateWithNodeAndTetheredChildren_WithDimensions.feature
@@ -0,0 +1,293 @@
+@contentrepository @adapters=DoctrineDBAL
+Feature: Create a root node aggregate with tethered children
+
+ As a user of the CR I want to create a new root node aggregate with an initial node and tethered children.
+
+ These are the test cases with dimensions involved
+
+ Background:
+ Given using the following content dimensions:
+ | Identifier | Values | Generalizations |
+ | language | de, en, gsw, en_US | en_US->en, gsw->de |
+ And using the following node types:
+ """yaml
+ 'Neos.ContentRepository.Testing:SubSubNode':
+ properties:
+ text:
+ defaultValue: 'my sub sub default'
+ type: string
+ 'Neos.ContentRepository.Testing:SubNode':
+ childNodes:
+ grandchild-node:
+ type: 'Neos.ContentRepository.Testing:SubSubNode'
+ properties:
+ text:
+ defaultValue: 'my sub default'
+ type: string
+ 'Neos.ContentRepository.Testing:RootWithTetheredChildNodes':
+ superTypes:
+ 'Neos.ContentRepository:Root': true
+ childNodes:
+ child-node:
+ type: 'Neos.ContentRepository.Testing:SubNode'
+ """
+ And using identifier "default", I define a content repository
+ And I am in content repository "default"
+ And the command CreateRootWorkspace is executed with payload:
+ | Key | Value |
+ | workspaceName | "live" |
+ | workspaceTitle | "Live" |
+ | workspaceDescription | "The live workspace" |
+ | newContentStreamId | "cs-identifier" |
+ And the graph projection is fully up to date
+ And I am in content stream "cs-identifier"
+ And I am user identified by "initiating-user-identifier"
+
+ Scenario: Create root node with tethered children
+ When the command CreateRootNodeAggregateWithNode is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" |
+ | tetheredDescendantNodeAggregateIds | {"child-node": "nody-mc-nodeface", "child-node/grandchild-node": "nodimus-prime"} |
+ And the graph projection is fully up to date
+
+ Then I expect exactly 6 events to be published on stream "ContentStream:cs-identifier"
+ And event at index 1 is of type "RootNodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:RootWithTetheredChildNodes" |
+ | coveredDimensionSpacePoints | [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}] |
+ | nodeAggregateClassification | "root" |
+ And event at index 2 is of type "NodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nody-mc-nodeface" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:SubNode" |
+ | originDimensionSpacePoint | {"language": "de"} |
+ | coveredDimensionSpacePoints | [{"language": "de"},{"language": "gsw"}] |
+ | parentNodeAggregateId | "lady-eleonode-rootford" |
+ | nodeName | "child-node" |
+ | initialPropertyValues | {"text": {"value": "my sub default", "type": "string"}} |
+ | nodeAggregateClassification | "tethered" |
+ And event at index 3 is of type "NodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nodimus-prime" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:SubSubNode" |
+ | originDimensionSpacePoint | {"language": "de"} |
+ | coveredDimensionSpacePoints | [{"language": "de"},{"language": "gsw"}] |
+ | parentNodeAggregateId | "nody-mc-nodeface" |
+ | nodeName | "grandchild-node" |
+ | initialPropertyValues | {"text": {"value": "my sub sub default", "type": "string"}} |
+ | nodeAggregateClassification | "tethered" |
+ And event at index 4 is of type "NodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nody-mc-nodeface" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:SubNode" |
+ | originDimensionSpacePoint | {"language": "en"} |
+ | coveredDimensionSpacePoints | [{"language": "en"},{"language": "en_US"}] |
+ | parentNodeAggregateId | "lady-eleonode-rootford" |
+ | nodeName | "child-node" |
+ | initialPropertyValues | {"text": {"value": "my sub default", "type": "string"}} |
+ | nodeAggregateClassification | "tethered" |
+ And event at index 5 is of type "NodeAggregateWithNodeWasCreated" with payload:
+ | Key | Expected |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nodimus-prime" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:SubSubNode" |
+ | originDimensionSpacePoint | {"language": "en"} |
+ | coveredDimensionSpacePoints | [{"language": "en"},{"language": "en_US"}] |
+ | parentNodeAggregateId | "nody-mc-nodeface" |
+ | nodeName | "grandchild-node" |
+ | initialPropertyValues | {"text": {"value": "my sub sub default", "type": "string"}} |
+ | nodeAggregateClassification | "tethered" |
+
+ And I expect the node aggregate "lady-eleonode-rootford" to exist
+ And I expect this node aggregate to be classified as "root"
+ And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes"
+ And I expect this node aggregate to be unnamed
+ And I expect this node aggregate to occupy dimension space points [{}]
+ And I expect this node aggregate to cover dimension space points [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}]
+ And I expect this node aggregate to disable dimension space points []
+ And I expect this node aggregate to have no parent node aggregates
+ And I expect this node aggregate to have the child node aggregates ["nody-mc-nodeface"]
+
+ And I expect the node aggregate "nody-mc-nodeface" to exist
+ And I expect this node aggregate to be classified as "tethered"
+ And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubNode"
+ And I expect this node aggregate to be named "child-node"
+ And I expect this node aggregate to occupy dimension space points [{"language": "de"}, {"language": "en"}]
+ And I expect this node aggregate to cover dimension space points [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}]
+ And I expect this node aggregate to disable dimension space points []
+ And I expect this node aggregate to have the parent node aggregates ["lady-eleonode-rootford"]
+ And I expect this node aggregate to have the child node aggregates ["nodimus-prime"]
+
+ And I expect the node aggregate "nodimus-prime" to exist
+ And I expect this node aggregate to be classified as "tethered"
+ And I expect this node aggregate to be of type "Neos.ContentRepository.Testing:SubSubNode"
+ And I expect this node aggregate to be named "grandchild-node"
+ And I expect this node aggregate to occupy dimension space points [{"language": "de"}, {"language": "en"}]
+ And I expect this node aggregate to cover dimension space points [{"language": "de"}, {"language": "en"}, {"language": "gsw"}, {"language": "en_US"}]
+ And I expect this node aggregate to disable dimension space points []
+ And I expect this node aggregate to have the parent node aggregates ["nody-mc-nodeface"]
+ And I expect this node aggregate to have no child node aggregates
+
+ And I expect the graph projection to consist of exactly 5 nodes
+ And I expect a node identified by cs-identifier;lady-eleonode-rootford;{} to exist in the content graph
+ And I expect this node to be classified as "root"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:RootWithTetheredChildNodes"
+ And I expect this node to be unnamed
+ And I expect this node to have no properties
+
+ And I expect a node identified by cs-identifier;nody-mc-nodeface;{"language": "de"} to exist in the content graph
+ And I expect this node to be classified as "tethered"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:SubNode"
+ And I expect this node to be named "child-node"
+ And I expect this node to have the following properties:
+ | Key | Value |
+ | text | "my sub default" |
+
+ And I expect a node identified by cs-identifier;nody-mc-nodeface;{"language": "en"} to exist in the content graph
+ And I expect this node to be classified as "tethered"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:SubNode"
+ And I expect this node to be named "child-node"
+ And I expect this node to have the following properties:
+ | Key | Value |
+ | text | "my sub default" |
+
+ And I expect a node identified by cs-identifier;nodimus-prime;{"language": "de"} to exist in the content graph
+ And I expect this node to be classified as "tethered"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:SubSubNode"
+ And I expect this node to be named "grandchild-node"
+ And I expect this node to have the following properties:
+ | Key | Value |
+ | text | "my sub sub default" |
+
+ And I expect a node identified by cs-identifier;nodimus-prime;{"language": "en"} to exist in the content graph
+ And I expect this node to be classified as "tethered"
+ And I expect this node to be of type "Neos.ContentRepository.Testing:SubSubNode"
+ And I expect this node to be named "grandchild-node"
+ And I expect this node to have the following properties:
+ | Key | Value |
+ | text | "my sub sub default" |
+
+ When I am in content stream "cs-identifier" and dimension space point {"language": "de"}
+ And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have no parent node
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | child-node | cs-identifier;nody-mc-nodeface;{"language": "de"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "de"}
+ And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | grandchild-node | cs-identifier;nodimus-prime;{"language": "de"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "de"}
+ And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "de"}
+ And I expect this node to have no child nodes
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ When I am in content stream "cs-identifier" and dimension space point {"language": "gsw"}
+ And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have no parent node
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | child-node | cs-identifier;nody-mc-nodeface;{"language": "de"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "de"}
+ And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | grandchild-node | cs-identifier;nodimus-prime;{"language": "de"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "de"}
+ And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "de"}
+ And I expect this node to have no child nodes
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+
+ When I am in content stream "cs-identifier" and dimension space point {"language": "en"}
+ And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have no parent node
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | child-node | cs-identifier;nody-mc-nodeface;{"language": "en"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "en"}
+ And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | grandchild-node | cs-identifier;nodimus-prime;{"language": "en"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "en"}
+ And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "en"}
+ And I expect this node to have no child nodes
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+
+ When I am in content stream "cs-identifier" and dimension space point {"language": "en_US"}
+ And I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have no parent node
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | child-node | cs-identifier;nody-mc-nodeface;{"language": "en"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nody-mc-nodeface" and node path "child-node" to lead to node cs-identifier;nody-mc-nodeface;{"language": "en"}
+ And I expect this node to be a child of node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | grandchild-node | cs-identifier;nodimus-prime;{"language": "en"} |
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
+ And I expect node aggregate identifier "nodimus-prime" and node path "child-node/grandchild-node" to lead to node cs-identifier;nodimus-prime;{"language": "en"}
+ And I expect this node to be a child of node cs-identifier;nody-mc-nodeface;{"language": "en"}
+ And I expect this node to have no child nodes
+ And I expect this node to have no preceding siblings
+ And I expect this node to have no succeeding siblings
+ And I expect this node to have no references
+ And I expect this node to not be referenced
+
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNode_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/05-CreateRootNodeAggregateWithNode_WithDimensions.feature
similarity index 100%
rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/03-CreateRootNodeAggregateWithNode_WithDimensions.feature
rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/01-RootNodeCreation/05-CreateRootNodeAggregateWithNode_WithDimensions.feature
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature
index 970c803e274..53561be51c4 100644
--- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/01-RemoveNodeAggregate_ConstraintChecks.feature
@@ -21,27 +21,27 @@ Feature: Remove NodeAggregate
And I am in content repository "default"
And I am user identified by "initiating-user-identifier"
And the command CreateRootWorkspace is executed with payload:
- | Key | Value |
- | workspaceName | "live" |
- | workspaceTitle | "Live" |
- | workspaceDescription | "The live workspace" |
- | newContentStreamId | "cs-identifier" |
+ | Key | Value |
+ | workspaceName | "live" |
+ | workspaceTitle | "Live" |
+ | workspaceDescription | "The live workspace" |
+ | newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in content stream "cs-identifier" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
- | Key | Value |
+ | Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
- | nodeTypeName | "Neos.ContentRepository:Root" |
+ | nodeTypeName | "Neos.ContentRepository:Root" |
And the graph projection is fully up to date
And the following CreateNodeAggregateWithNode commands are executed:
- | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | tetheredDescendantNodeAggregateIds |
- | sir-david-nodenborough | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | document | {"tethered":"nodewyn-tetherton"} |
+ | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | tetheredDescendantNodeAggregateIds |
+ | sir-david-nodenborough | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | document | {"tethered":"nodewyn-tetherton"} |
Scenario: Try to remove a node aggregate in a non-existing content stream
When the command RemoveNodeAggregate is executed with payload and exceptions are caught:
| Key | Value |
- | contentStreamId | "i-do-not-exist" |
- | nodeAggregateId | "sir-david-nodenborough" |
+ | contentStreamId | "i-do-not-exist" |
+ | nodeAggregateId | "sir-david-nodenborough" |
| coveredDimensionSpacePoint | {"language":"de"} |
| nodeVariantSelectionStrategy | "allVariants" |
Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet"
@@ -49,7 +49,7 @@ Feature: Remove NodeAggregate
Scenario: Try to remove a non-existing node aggregate
When the command RemoveNodeAggregate is executed with payload and exceptions are caught:
| Key | Value |
- | nodeAggregateId | "i-do-not-exist" |
+ | nodeAggregateId | "i-do-not-exist" |
| coveredDimensionSpacePoint | {"language":"de"} |
| nodeVariantSelectionStrategy | "allVariants" |
Then the last command should have thrown an exception of type "NodeAggregateCurrentlyDoesNotExist"
@@ -57,7 +57,7 @@ Feature: Remove NodeAggregate
Scenario: Try to remove a tethered node aggregate
When the command RemoveNodeAggregate is executed with payload and exceptions are caught:
| Key | Value |
- | nodeAggregateId | "nodewyn-tetherton" |
+ | nodeAggregateId | "nodewyn-tetherton" |
| nodeVariantSelectionStrategy | "allVariants" |
| coveredDimensionSpacePoint | {"language":"de"} |
Then the last command should have thrown an exception of type "TetheredNodeAggregateCannotBeRemoved"
@@ -65,23 +65,23 @@ Feature: Remove NodeAggregate
Scenario: Try to remove a node aggregate in a non-existing dimension space point
When the command RemoveNodeAggregate is executed with payload and exceptions are caught:
| Key | Value |
- | nodeAggregateId | "sir-david-nodenborough" |
+ | nodeAggregateId | "sir-david-nodenborough" |
| coveredDimensionSpacePoint | {"undeclared": "undefined"} |
| nodeVariantSelectionStrategy | "allVariants" |
Then the last command should have thrown an exception of type "DimensionSpacePointNotFound"
Scenario: Try to remove a node aggregate in a dimension space point the node aggregate does not cover
When the command RemoveNodeAggregate is executed with payload and exceptions are caught:
- | Key | Value |
- | nodeAggregateId | "sir-david-nodenborough" |
- | coveredDimensionSpacePoint | {"language": "en"} |
- | nodeVariantSelectionStrategy | "allVariants" |
+ | Key | Value |
+ | nodeAggregateId | "sir-david-nodenborough" |
+ | coveredDimensionSpacePoint | {"language": "en"} |
+ | nodeVariantSelectionStrategy | "allVariants" |
Then the last command should have thrown an exception of type "NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint"
Scenario: Try to remove a node aggregate using a non-existent removalAttachmentPoint
When the command RemoveNodeAggregate is executed with payload and exceptions are caught:
| Key | Value |
- | nodeAggregateId | "sir-david-nodenborough" |
+ | nodeAggregateId | "sir-david-nodenborough" |
| nodeVariantSelectionStrategy | "allVariants" |
| coveredDimensionSpacePoint | {"language":"de"} |
| removalAttachmentPoint | "i-do-not-exist" |
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate.feature
similarity index 100%
rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate.feature
rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate.feature
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature
similarity index 100%
rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature
rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateWithoutDimensions.feature
similarity index 100%
rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateWithoutDimensions.feature
rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregateWithoutDimensions.feature
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature
similarity index 100%
rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature
rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NewParent_Dimensions.feature
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature
similarity index 64%
rename from Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature
rename to Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature
index c90dc25ff35..95e2549cd30 100644
--- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/MoveNodeAggregate_NoNewParent_Dimensions.feature
@@ -19,85 +19,85 @@ Feature: Move a node with content dimensions
And using identifier "default", I define a content repository
And I am in content repository "default"
And the command CreateRootWorkspace is executed with payload:
- | Key | Value |
- | workspaceName | "live" |
- | workspaceTitle | "Live" |
- | workspaceDescription | "The live workspace" |
- | newContentStreamId | "cs-identifier" |
+ | Key | Value |
+ | workspaceName | "live" |
+ | workspaceTitle | "Live" |
+ | workspaceDescription | "The live workspace" |
+ | newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And the command CreateRootNodeAggregateWithNode is executed with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "lady-eleonode-rootford" |
- | nodeTypeName | "Neos.ContentRepository:Root" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository:Root" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "sir-david-nodenborough" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
- | originDimensionSpacePoint | {"language": "mul"} |
- | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
- | parentNodeAggregateId | "lady-eleonode-rootford" |
- | nodeName | "document" |
- | nodeAggregateClassification | "regular" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "sir-david-nodenborough" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
+ | originDimensionSpacePoint | {"language": "mul"} |
+ | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
+ | parentNodeAggregateId | "lady-eleonode-rootford" |
+ | nodeName | "document" |
+ | nodeAggregateClassification | "regular" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "anthony-destinode" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
- | originDimensionSpacePoint | {"language": "mul"} |
- | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
- | parentNodeAggregateId | "sir-david-nodenborough" |
- | nodeName | "child-document-a" |
- | nodeAggregateClassification | "regular" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "anthony-destinode" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
+ | originDimensionSpacePoint | {"language": "mul"} |
+ | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
+ | parentNodeAggregateId | "sir-david-nodenborough" |
+ | nodeName | "child-document-a" |
+ | nodeAggregateClassification | "regular" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "berta-destinode" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
- | originDimensionSpacePoint | {"language": "mul"} |
- | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
- | parentNodeAggregateId | "sir-david-nodenborough" |
- | nodeName | "child-document-b" |
- | nodeAggregateClassification | "regular" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "berta-destinode" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
+ | originDimensionSpacePoint | {"language": "mul"} |
+ | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
+ | parentNodeAggregateId | "sir-david-nodenborough" |
+ | nodeName | "child-document-b" |
+ | nodeAggregateClassification | "regular" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "nody-mc-nodeface" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
- | originDimensionSpacePoint | {"language": "mul"} |
- | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
- | parentNodeAggregateId | "sir-david-nodenborough" |
- | nodeName | "child-document-n" |
- | nodeAggregateClassification | "regular" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nody-mc-nodeface" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
+ | originDimensionSpacePoint | {"language": "mul"} |
+ | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
+ | parentNodeAggregateId | "sir-david-nodenborough" |
+ | nodeName | "child-document-n" |
+ | nodeAggregateClassification | "regular" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "carl-destinode" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
- | originDimensionSpacePoint | {"language": "mul"} |
- | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
- | parentNodeAggregateId | "sir-david-nodenborough" |
- | nodeName | "child-document-c" |
- | nodeAggregateClassification | "regular" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "carl-destinode" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
+ | originDimensionSpacePoint | {"language": "mul"} |
+ | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
+ | parentNodeAggregateId | "sir-david-nodenborough" |
+ | nodeName | "child-document-c" |
+ | nodeAggregateClassification | "regular" |
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "sir-nodeward-nodington-iii" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
- | originDimensionSpacePoint | {"language": "mul"} |
- | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
- | parentNodeAggregateId | "lady-eleonode-rootford" |
- | nodeName | "esquire" |
- | nodeAggregateClassification | "regular" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "sir-nodeward-nodington-iii" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
+ | originDimensionSpacePoint | {"language": "mul"} |
+ | coveredDimensionSpacePoints | [{"language": "mul"}, {"language": "de"}, {"language": "en"}, {"language": "gsw"}] |
+ | parentNodeAggregateId | "lady-eleonode-rootford" |
+ | nodeName | "esquire" |
+ | nodeAggregateClassification | "regular" |
And the graph projection is fully up to date
Scenario: Move a complete node aggregate before the first of its siblings
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newParentNodeAggregateId | null |
| newSucceedingSiblingNodeAggregateId | "anthony-destinode" |
And the graph projection is fully up to date
@@ -115,20 +115,20 @@ Feature: Move a node with content dimensions
Scenario: Move a complete node aggregate before the first of its siblings - which does not exist in all variants
Given the event NodeAggregateWasRemoved was published with payload:
| Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "anthony-destinode" |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "anthony-destinode" |
| affectedOccupiedDimensionSpacePoints | [] |
| affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] |
And the graph projection is fully up to date
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newParentNodeAggregateId | null |
| newSucceedingSiblingNodeAggregateId | "anthony-destinode" |
- | relationDistributionStrategy | "gatherAll" |
+ | relationDistributionStrategy | "gatherAll" |
And the graph projection is fully up to date
When I am in content stream "cs-identifier" and dimension space point {"language": "mul"}
@@ -152,10 +152,10 @@ Feature: Move a node with content dimensions
Scenario: Move a complete node aggregate before another of its siblings
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newParentNodeAggregateId | null |
| newSucceedingSiblingNodeAggregateId | "berta-destinode" |
And the graph projection is fully up to date
@@ -174,17 +174,17 @@ Feature: Move a node with content dimensions
Scenario: Move a complete node aggregate before another of its siblings - which does not exist in all variants
Given the event NodeAggregateWasRemoved was published with payload:
| Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "berta-destinode" |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "berta-destinode" |
| affectedOccupiedDimensionSpacePoints | [] |
| affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] |
And the graph projection is fully up to date
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newParentNodeAggregateId | null |
| newSucceedingSiblingNodeAggregateId | "berta-destinode" |
And the graph projection is fully up to date
@@ -213,17 +213,17 @@ Feature: Move a node with content dimensions
Scenario: Move a complete node aggregate after another of its siblings - which does not exist in all variants
Given the event NodeAggregateWasRemoved was published with payload:
| Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "carl-destinode" |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "carl-destinode" |
| affectedOccupiedDimensionSpacePoints | [] |
| affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] |
And the graph projection is fully up to date
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newParentNodeAggregateId | null |
| newPrecedingSiblingNodeAggregateId | "berta-destinode" |
And the graph projection is fully up to date
@@ -251,17 +251,17 @@ Feature: Move a node with content dimensions
Scenario: Move a complete node aggregate after the last of its siblings - with a predecessor which does not exist in all variants
Given the event NodeAggregateWasRemoved was published with payload:
| Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "carl-destinode" |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "carl-destinode" |
| affectedOccupiedDimensionSpacePoints | [] |
| affectedCoveredDimensionSpacePoints | [{"language": "gsw"}] |
And the graph projection is fully up to date
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newParentNodeAggregateId | null |
| newSucceedingSiblingNodeAggregateId | null |
And the graph projection is fully up to date
@@ -287,12 +287,12 @@ Feature: Move a node with content dimensions
Scenario: Move a single node before the first of its siblings
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newSucceedingSiblingNodeAggregateId | "anthony-destinode" |
- | relationDistributionStrategy | "scatter" |
+ | relationDistributionStrategy | "scatter" |
And the graph projection is fully up to date
When I am in content stream "cs-identifier" and dimension space point {"language": "mul"}
@@ -318,12 +318,12 @@ Feature: Move a node with content dimensions
Scenario: Move a single node between two of its siblings
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "mul"} |
+ | dimensionSpacePoint | {"language": "mul"} |
| newSucceedingSiblingNodeAggregateId | "berta-destinode" |
- | relationDistributionStrategy | "scatter" |
+ | relationDistributionStrategy | "scatter" |
And the graph projection is fully up to date
When I am in content stream "cs-identifier" and dimension space point {"language": "mul"}
@@ -351,8 +351,8 @@ Feature: Move a node with content dimensions
Scenario: Move a single node to the end of its siblings
When the command MoveNodeAggregate is executed with payload:
| Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "nody-mc-nodeface" |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nody-mc-nodeface" |
| dimensionSpacePoint | {"language": "mul"} |
| relationDistributionStrategy | "scatter" |
And the graph projection is fully up to date
@@ -380,12 +380,12 @@ Feature: Move a node with content dimensions
Scenario: Move a node and its specializations before the first of its siblings
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "de"} |
+ | dimensionSpacePoint | {"language": "de"} |
| newSucceedingSiblingNodeAggregateId | "anthony-destinode" |
- | relationDistributionStrategy | "gatherSpecializations" |
+ | relationDistributionStrategy | "gatherSpecializations" |
And the graph projection is fully up to date
When I am in content stream "cs-identifier" and dimension space point {"language": "mul"}
@@ -421,12 +421,12 @@ Feature: Move a node with content dimensions
Scenario: Move a node and its specializations between two of its siblings
When the command MoveNodeAggregate is executed with payload:
- | Key | Value |
+ | Key | Value |
| contentStreamId | "cs-identifier" |
| nodeAggregateId | "nody-mc-nodeface" |
- | dimensionSpacePoint | {"language": "de"} |
+ | dimensionSpacePoint | {"language": "de"} |
| newSucceedingSiblingNodeAggregateId | "berta-destinode" |
- | relationDistributionStrategy | "gatherSpecializations" |
+ | relationDistributionStrategy | "gatherSpecializations" |
And the graph projection is fully up to date
When I am in content stream "cs-identifier" and dimension space point {"language": "mul"}
@@ -465,8 +465,8 @@ Feature: Move a node with content dimensions
Scenario: Move a node and its specializations to the end of its siblings
When the command MoveNodeAggregate is executed with payload:
| Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "nody-mc-nodeface" |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nody-mc-nodeface" |
| dimensionSpacePoint | {"language": "de"} |
| relationDistributionStrategy | "gatherSpecializations" |
And the graph projection is fully up to date
@@ -501,3 +501,85 @@ Feature: Move a node with content dimensions
| cs-identifier;berta-destinode;{"language": "mul"} |
| cs-identifier;anthony-destinode;{"language": "mul"} |
And I expect this node to have no succeeding siblings
+
+ Scenario: Trigger position update in DBAL graph
+ Given I am in content stream "cs-identifier" and dimension space point {"language": "mul"}
+ # distance i to x: 128
+ Given the following CreateNodeAggregateWithNode commands are executed:
+ | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName |
+ | lady-nodette-nodington-i | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-i |
+ | lady-nodette-nodington-x | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-x |
+ | lady-nodette-nodington-ix | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-ix |
+ | lady-nodette-nodington-viii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-viii |
+ | lady-nodette-nodington-vii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-vii |
+ | lady-nodette-nodington-vi | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-vi |
+ | lady-nodette-nodington-v | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-v |
+ | lady-nodette-nodington-iv | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-iv |
+ | lady-nodette-nodington-iii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-iii |
+ | lady-nodette-nodington-ii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-ii |
+ # distance ii to x: 64
+ When the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-ii" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+ # distance iii to x: 32
+ And the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-iii" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+ # distance iv to x: 16
+ And the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-iv" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+ # distance v to x: 8
+ And the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-v" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+ # distance vi to x: 4
+ And the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-vi" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+ # distance vii to x: 2
+ And the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-vii" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+ # distance viii to x: 1 -> reorder -> 128
+ And the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-viii" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+ # distance ix to x: 64 after reorder
+ And the command MoveNodeAggregate is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-nodette-nodington-ix" |
+ | newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
+ And the graph projection is fully up to date
+
+ Then I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
+ And I expect this node to have the following child nodes:
+ | Name | NodeDiscriminator |
+ | document | cs-identifier;sir-david-nodenborough;{"language": "mul"} |
+ | esquire | cs-identifier;sir-nodeward-nodington-iii;{"language": "mul"} |
+ | nodington-i | cs-identifier;lady-nodette-nodington-i;{"language": "mul"} |
+ | nodington-ii | cs-identifier;lady-nodette-nodington-ii;{"language": "mul"} |
+ | nodington-iii | cs-identifier;lady-nodette-nodington-iii;{"language": "mul"} |
+ | nodington-iv | cs-identifier;lady-nodette-nodington-iv;{"language": "mul"} |
+ | nodington-v | cs-identifier;lady-nodette-nodington-v;{"language": "mul"} |
+ | nodington-vi | cs-identifier;lady-nodette-nodington-vi;{"language": "mul"} |
+ | nodington-vii | cs-identifier;lady-nodette-nodington-vii;{"language": "mul"} |
+ | nodington-viii | cs-identifier;lady-nodette-nodington-viii;{"language": "mul"} |
+ | nodington-ix | cs-identifier;lady-nodette-nodington-ix;{"language": "mul"} |
+ | nodington-x | cs-identifier;lady-nodette-nodington-x;{"language": "mul"} |
+
+
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRenaming/01_ChangeNodeAggregateName_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRenaming/01_ChangeNodeAggregateName_ConstraintChecks.feature
new file mode 100644
index 00000000000..613c3bb4213
--- /dev/null
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRenaming/01_ChangeNodeAggregateName_ConstraintChecks.feature
@@ -0,0 +1,73 @@
+@contentrepository @adapters=DoctrineDBAL
+Feature: Change node name
+
+ As a user of the CR I want to change the name of a hierarchical relation between two nodes (e.g. in taxonomies)
+
+ These are the base test cases for the NodeAggregateCommandHandler to block invalid commands.
+
+ Background:
+ Given using no content dimensions
+ And using the following node types:
+ """yaml
+ 'Neos.ContentRepository.Testing:Content': []
+ 'Neos.ContentRepository.Testing:Document':
+ childNodes:
+ tethered:
+ type: 'Neos.ContentRepository.Testing:Content'
+ """
+ And using identifier "default", I define a content repository
+ And I am in content repository "default"
+ And the command CreateRootWorkspace is executed with payload:
+ | Key | Value |
+ | workspaceName | "live" |
+ | workspaceTitle | "Live" |
+ | workspaceDescription | "The live workspace" |
+ | newContentStreamId | "cs-identifier" |
+ And the graph projection is fully up to date
+ And I am in content stream "cs-identifier" and dimension space point {}
+
+ And the command CreateRootNodeAggregateWithNode is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository:Root" |
+ And the graph projection is fully up to date
+ And the following CreateNodeAggregateWithNode commands are executed:
+ | nodeAggregateId | nodeName | nodeTypeName | parentNodeAggregateId | initialPropertyValues | tetheredDescendantNodeAggregateIds |
+ | sir-david-nodenborough | null | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | {} | {"tethered": "nodewyn-tetherton"} |
+ | nody-mc-nodeface | occupied | Neos.ContentRepository.Testing:Document | sir-david-nodenborough | {} | {} |
+
+ Scenario: Try to rename a node aggregate in a non-existing content stream
+ When the command ChangeNodeAggregateName is executed with payload and exceptions are caught:
+ | Key | Value |
+ | contentStreamId | "i-do-not-exist" |
+ | nodeAggregateId | "sir-david-nodenborough" |
+ | newNodeName | "new-name" |
+ Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet"
+
+ Scenario: Try to rename a non-existing node aggregate
+ When the command ChangeNodeAggregateName is executed with payload and exceptions are caught:
+ | Key | Value |
+ | nodeAggregateId | "i-do-not-exist" |
+ | newNodeName | "new-name" |
+ Then the last command should have thrown an exception of type "NodeAggregateCurrentlyDoesNotExist"
+
+ Scenario: Try to rename a root node aggregate
+ When the command ChangeNodeAggregateName is executed with payload and exceptions are caught:
+ | Key | Value |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | newNodeName | "new-name" |
+ Then the last command should have thrown an exception of type "NodeAggregateIsRoot"
+
+ Scenario: Try to rename a tethered node aggregate
+ When the command ChangeNodeAggregateName is executed with payload and exceptions are caught:
+ | Key | Value |
+ | nodeAggregateId | "nodewyn-tetherton" |
+ | newNodeName | "new-name" |
+ Then the last command should have thrown an exception of type "NodeAggregateIsTethered"
+
+ Scenario: Try to rename a node aggregate using an already occupied name
+ When the command ChangeNodeAggregateName is executed with payload and exceptions are caught:
+ | Key | Value |
+ | nodeAggregateId | "nody-mc-nodeface" |
+ | newNodeName | "tethered" |
+ Then the last command should have thrown an exception of type "NodeNameIsAlreadyOccupied"
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNodesAndTetheredNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNodesAndTetheredNodes.feature
new file mode 100644
index 00000000000..9dc7063bf5d
--- /dev/null
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNodesAndTetheredNodes.feature
@@ -0,0 +1,49 @@
+@contentrepository @adapters=DoctrineDBAL
+Feature: Remove disallowed Child Nodes and grandchild nodes
+
+ As a user of the CR I want to be able to keep tethered child nodes although their type is not allowed below their parent
+
+ Scenario: Direct constraints
+ Given using no content dimensions
+ And using the following node types:
+ """yaml
+ 'Neos.ContentRepository:Root':
+ constraints:
+ nodeTypes:
+ '*': false
+ 'Neos.ContentRepository.Testing:Document': true
+ 'Neos.ContentRepository.Testing:Document':
+ constraints:
+ nodeTypes:
+ '*': false
+ childNodes:
+ tethered:
+ type: 'Neos.ContentRepository.Testing:AnotherDocument'
+
+ 'Neos.ContentRepository.Testing:AnotherDocument': []
+ """
+ And using identifier "default", I define a content repository
+ And I am in content repository "default"
+ And the command CreateRootWorkspace is executed with payload:
+ | Key | Value |
+ | workspaceName | "live" |
+ | workspaceTitle | "Live" |
+ | workspaceDescription | "The live workspace" |
+ | newContentStreamId | "cs-identifier" |
+ And the graph projection is fully up to date
+ And I am in content stream "cs-identifier" and dimension space point {}
+ And the command CreateRootNodeAggregateWithNode is executed with payload:
+ | Key | Value |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository:Root" |
+ And the graph projection is fully up to date
+ And the following CreateNodeAggregateWithNode commands are executed:
+ | nodeAggregateId | parentNodeAggregateId | nodeTypeName |
+ | nody-mc-nodeface | lady-eleonode-rootford | Neos.ContentRepository.Testing:Document |
+
+ ########################
+ # Actual Test
+ ########################
+ Then I expect no needed structure adjustments for type "Neos.ContentRepository:Root"
+ Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document"
+ Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:AnotherDocument"
diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature
index 8f74410ec2b..6b8aa2ea3cd 100644
--- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature
+++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature
@@ -10,6 +10,10 @@ Feature: Tethered Nodes integrity violations
| language | en, de, gsw | gsw->de->en |
And using the following node types:
"""yaml
+ 'Neos.ContentRepository:Root':
+ childNodes:
+ 'originally-tethered-node':
+ type: 'Neos.ContentRepository.Testing:Tethered'
'Neos.ContentRepository.Testing:Document':
childNodes:
'tethered-node':
@@ -27,59 +31,66 @@ Feature: Tethered Nodes integrity violations
And using identifier "default", I define a content repository
And I am in content repository "default"
And the command CreateRootWorkspace is executed with payload:
- | Key | Value |
- | workspaceName | "live" |
- | workspaceTitle | "Live" |
- | workspaceDescription | "The live workspace" |
- | newContentStreamId | "cs-identifier" |
+ | Key | Value |
+ | workspaceName | "live" |
+ | workspaceTitle | "Live" |
+ | workspaceDescription | "The live workspace" |
+ | newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And the command CreateRootNodeAggregateWithNode is executed with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "lady-eleonode-rootford" |
- | nodeTypeName | "Neos.ContentRepository:Root" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "lady-eleonode-rootford" |
+ | nodeTypeName | "Neos.ContentRepository:Root" |
+ | tetheredDescendantNodeAggregateIds | {"originally-tethered-node": "originode-tetherton"} |
# We have to add another node since root nodes have no dimension space points and thus cannot be varied
# Node /document
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "sir-david-nodenborough" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
- | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} |
- | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] |
- | parentNodeAggregateId | "lady-eleonode-rootford" |
- | nodeName | "document" |
- | nodeAggregateClassification | "regular" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "sir-david-nodenborough" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Document" |
+ | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} |
+ | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] |
+ | parentNodeAggregateId | "lady-eleonode-rootford" |
+ | nodeName | "document" |
+ | nodeAggregateClassification | "regular" |
# We add a tethered child node to provide for test cases for node aggregates of that classification
# Node /document/tethered-node
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "nodewyn-tetherton" |
- | nodeTypeName | "Neos.ContentRepository.Testing:Tethered" |
- | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} |
- | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] |
- | parentNodeAggregateId | "sir-david-nodenborough" |
- | nodeName | "tethered-node" |
- | nodeAggregateClassification | "tethered" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nodewyn-tetherton" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:Tethered" |
+ | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} |
+ | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] |
+ | parentNodeAggregateId | "sir-david-nodenborough" |
+ | nodeName | "tethered-node" |
+ | nodeAggregateClassification | "tethered" |
# We add a tethered grandchild node to provide for test cases that this works recursively
# Node /document/tethered-node/tethered-leaf
And the event NodeAggregateWithNodeWasCreated was published with payload:
- | Key | Value |
- | contentStreamId | "cs-identifier" |
- | nodeAggregateId | "nodimer-tetherton" |
- | nodeTypeName | "Neos.ContentRepository.Testing:TetheredLeaf" |
- | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} |
- | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] |
- | parentNodeAggregateId | "nodewyn-tetherton" |
- | nodeName | "tethered-leaf" |
- | nodeAggregateClassification | "tethered" |
+ | Key | Value |
+ | contentStreamId | "cs-identifier" |
+ | nodeAggregateId | "nodimer-tetherton" |
+ | nodeTypeName | "Neos.ContentRepository.Testing:TetheredLeaf" |
+ | originDimensionSpacePoint | {"market":"CH", "language":"gsw"} |
+ | coveredDimensionSpacePoints | [{"market":"CH", "language":"gsw"}] |
+ | parentNodeAggregateId | "nodewyn-tetherton" |
+ | nodeName | "tethered-leaf" |
+ | nodeAggregateClassification | "tethered" |
And the graph projection is fully up to date
Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document"
Scenario: Adjusting the schema adding a new tethered node leads to a MissingTetheredNode integrity violation
Given I change the node types in content repository "default" to:
"""yaml
+ 'Neos.ContentRepository:Root':
+ childNodes:
+ 'originally-tethered-node':
+ type: 'Neos.ContentRepository.Testing:Tethered'
+ 'tethered-node':
+ type: 'Neos.ContentRepository.Testing:Tethered'
'Neos.ContentRepository.Testing:Document':
childNodes:
'tethered-node':
@@ -97,13 +108,21 @@ Feature: Tethered Nodes integrity violations
'Neos.ContentRepository.Testing:TetheredLeaf': []
"""
Then I expect the following structure adjustments for type "Neos.ContentRepository.Testing:Document":
- | Type | nodeAggregateId |
- | TETHERED_NODE_MISSING | sir-david-nodenborough |
-
+ | Type | nodeAggregateId |
+ | TETHERED_NODE_MISSING | sir-david-nodenborough |
+ And I expect the following structure adjustments for type "Neos.ContentRepository:Root":
+ | Type | nodeAggregateId |
+ | TETHERED_NODE_MISSING | lady-eleonode-rootford |
Scenario: Adding missing tethered nodes resolves the corresponding integrity violations
Given I change the node types in content repository "default" to:
"""yaml
+ 'Neos.ContentRepository:Root':
+ childNodes:
+ 'originally-tethered-node':
+ type: 'Neos.ContentRepository.Testing:Tethered'
+ 'tethered-node':
+ type: 'Neos.ContentRepository.Testing:Tethered'
'Neos.ContentRepository.Testing:Document':
childNodes:
'tethered-node':
@@ -122,12 +141,18 @@ Feature: Tethered Nodes integrity violations
"""
When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document"
Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document"
+ When I adjust the node structure for node type "Neos.ContentRepository:Root"
+ Then I expect no needed structure adjustments for type "Neos.ContentRepository:Root"
When I am in the active content stream of workspace "live" and dimension space point {"market":"CH", "language":"gsw"}
And I get the node at path "document/some-new-child"
And I expect this node to have the following properties:
| Key | Value |
| foo | "my default applied" |
+ And I get the node at path "tethered-node"
+ And I expect this node to have the following properties:
+ | Key | Value |
+ | foo | "my default applied" |
Scenario: Adding the same
Given I change the node types in content repository "default" to:
@@ -149,13 +174,14 @@ Feature: Tethered Nodes integrity violations
'Neos.ContentRepository.Testing:TetheredLeaf': []
"""
When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document"
- Then I expect exactly 6 events to be published on stream "ContentStream:cs-identifier"
+ Then I expect exactly 8 events to be published on stream "ContentStream:cs-identifier"
When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document"
- Then I expect exactly 6 events to be published on stream "ContentStream:cs-identifier"
+ Then I expect exactly 8 events to be published on stream "ContentStream:cs-identifier"
Scenario: Adjusting the schema removing a tethered node leads to a DisallowedTetheredNode integrity violation (which can be fixed)
Given I change the node types in content repository "default" to:
"""yaml
+ 'Neos.ContentRepository:Root': []
'Neos.ContentRepository.Testing:Document': []
'Neos.ContentRepository.Testing:Tethered':
properties:
@@ -168,13 +194,19 @@ Feature: Tethered Nodes integrity violations
'Neos.ContentRepository.Testing:TetheredLeaf': []
"""
Then I expect the following structure adjustments for type "Neos.ContentRepository.Testing:Document":
- | Type | nodeAggregateId |
- | DISALLOWED_TETHERED_NODE | nodewyn-tetherton |
+ | Type | nodeAggregateId |
+ | DISALLOWED_TETHERED_NODE | nodewyn-tetherton |
+ Then I expect the following structure adjustments for type "Neos.ContentRepository:Root":
+ | Type | nodeAggregateId |
+ | DISALLOWED_TETHERED_NODE | originode-tetherton |
When I adjust the node structure for node type "Neos.ContentRepository.Testing:Document"
Then I expect no needed structure adjustments for type "Neos.ContentRepository.Testing:Document"
+ When I adjust the node structure for node type "Neos.ContentRepository:Root"
+ Then I expect no needed structure adjustments for type "Neos.ContentRepository:Root"
When I am in content stream "cs-identifier" and dimension space point {"market":"CH", "language":"gsw"}
Then I expect node aggregate identifier "nodewyn-tetherton" to lead to no node
Then I expect node aggregate identifier "nodimer-tetherton" to lead to no node
+ And I expect path "tethered-node" to lead to no node
Scenario: Adjusting the schema changing the type of a tethered node leads to a InvalidTetheredNodeType integrity violation
Given I change the node types in content repository "default" to:
@@ -194,6 +226,6 @@ Feature: Tethered Nodes integrity violations
'Neos.ContentRepository.Testing:TetheredLeaf': []
"""
Then I expect the following structure adjustments for type "Neos.ContentRepository.Testing:Document":
- | Type | nodeAggregateId |
- | TETHERED_NODE_TYPE_WRONG | nodewyn-tetherton |
+ | Type | nodeAggregateId |
+ | TETHERED_NODE_TYPE_WRONG | nodewyn-tetherton |
diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php
index 8d03f3624d0..9f457b03576 100644
--- a/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php
+++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php
@@ -124,6 +124,7 @@ final public function equals(self $other): bool
/**
* @return array>
+ * @deprecated should be only used for conversion from Neos <= 8.x to 9.x upwards. never use this in "modern" code.
*/
final public function toLegacyDimensionArray(): array
{
diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php
index aecb51fe6f1..9a31aef29ad 100644
--- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php
+++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php
@@ -61,10 +61,21 @@ public static function fromJsonString(string $jsonString): self
return self::instance(json_decode($jsonString, true));
}
+ /**
+ * Creates a dimension space point for a zero-dimensional content repository.
+ *
+ * This applies to content repositories without any dimensions configured.
+ */
+ public static function createWithoutDimensions(): self
+ {
+ return self::fromArray([]);
+ }
+
/**
* Creates a dimension space point from a legacy dimension array in format
* ['language' => ['es'], 'country' => ['ar']]
*
+ * @deprecated should be only used for conversion from Neos <= 8.x to 9.x upwards. never use this in "modern" code.
* @param array> $legacyDimensionValues
*/
final public static function fromLegacyDimensionArray(array $legacyDimensionValues): self
diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php
index 03ca96bb152..56179626e7d 100644
--- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php
+++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePointSet.php
@@ -14,9 +14,14 @@
namespace Neos\ContentRepository\Core\DimensionSpace;
+use Neos\ContentRepository\Core\EventStore\EventInterface;
+
/**
* A set of points in the dimension space.
*
+ * In case this set is a member of an {@see EventInterface} as $coveredDimensionSpacePoints, you can be sure that it is not empty.
+ * There is always at least one dimension space point covered, even in a zero-dimensional content repository. {@see DimensionSpacePoint::createWithoutDimensions()}.
+ *
* E.g.: {[language => es, country => ar], [language => es, country => es]}
* @implements \IteratorAggregate
* @implements \ArrayAccess
@@ -89,14 +94,14 @@ public function offsetGet(mixed $offset): ?DimensionSpacePoint
return $this->points[$offset] ?? null;
}
- public function offsetSet(mixed $offset, mixed $value): void
+ public function offsetSet(mixed $offset, mixed $value): never
{
- // not going to happen
+ throw new \BadMethodCallException('Cannot modify immutable DimensionSpacePointSet', 1697802335);
}
- public function offsetUnset(mixed $offset): void
+ public function offsetUnset(mixed $offset): never
{
- // not going to happen
+ throw new \BadMethodCallException('Cannot modify immutable DimensionSpacePointSet', 1697802337);
}
public function getUnion(DimensionSpacePointSet $other): DimensionSpacePointSet
diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php
index 7cc294a242a..52725f6ec9e 100644
--- a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php
+++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php
@@ -17,62 +17,62 @@
use Neos\ContentRepository\Core\Dimension;
/**
- * The inter dimensional variation graph domain model
+ * The interdimensional variation graph domain model
* Represents the specialization and generalization mechanism between dimension space points
* @api
*/
-class InterDimensionalVariationGraph
+final class InterDimensionalVariationGraph
{
/**
* Weighed dimension space points, indexed by identity (DSP) hash
*
- * @var array|null
+ * @var array
*/
- protected ?array $weightedDimensionSpacePoints = null;
+ private array $weightedDimensionSpacePoints;
/**
* Generalization dimension space point sets, indexed by specialization hash
*
- * @var array|null
+ * @var array
*/
- protected ?array $indexedGeneralizations = null;
+ private array $indexedGeneralizations;
/**
* Specialization dimension space point sets, indexed by generalization hash
*
- * @var array|null
+ * @var array
*/
- protected ?array $indexedSpecializations = null;
+ private array $indexedSpecializations;
/**
* Weighed generalizations, indexed by specialization hash and relative weight
*
- * @var array>|null
+ * @var array>
*/
- protected ?array $weightedGeneralizations = null;
+ private array $weightedGeneralizations;
/**
* Weighed specializations, indexed by generalization hash, relative weight and specialization hash
- * @var array>>|null
+ * @var array>>
*/
- protected ?array $weightedSpecializations = null;
+ private array $weightedSpecializations;
/**
* Primary generalization dimension space points, indexed by specialization hash
*
* @var array
*/
- protected ?array $primaryGeneralizations = null;
+ private array $primaryGeneralizations;
- protected ?int $weightNormalizationBase = null;
+ private int $weightNormalizationBase;
public function __construct(
- private Dimension\ContentDimensionSourceInterface $contentDimensionSource,
- private ContentDimensionZookeeper $contentDimensionZookeeper
+ private readonly Dimension\ContentDimensionSourceInterface $contentDimensionSource,
+ private readonly ContentDimensionZookeeper $contentDimensionZookeeper
) {
}
- protected function initializeWeightedDimensionSpacePoints(): void
+ private function initializeWeightedDimensionSpacePoints(): void
{
$this->weightedDimensionSpacePoints = [];
foreach ($this->contentDimensionZookeeper->getAllowedCombinations() as $dimensionValues) {
@@ -93,13 +93,10 @@ public function getDimensionSpacePoints(): DimensionSpacePointSet
*/
public function getWeightedDimensionSpacePoints(): array
{
- if (is_null($this->weightedDimensionSpacePoints)) {
+ if (!isset($this->weightedDimensionSpacePoints)) {
$this->initializeWeightedDimensionSpacePoints();
}
- /** @var array $weighedDimensionSpacePoints */
- $weighedDimensionSpacePoints = $this->weightedDimensionSpacePoints;
-
- return $weighedDimensionSpacePoints;
+ return $this->weightedDimensionSpacePoints;
}
public function getWeightedDimensionSpacePointByDimensionSpacePoint(
@@ -110,7 +107,7 @@ public function getWeightedDimensionSpacePointByDimensionSpacePoint(
public function getWeightedDimensionSpacePointByHash(string $hash): ?WeightedDimensionSpacePoint
{
- if (is_null($this->weightedDimensionSpacePoints)) {
+ if (!isset($this->weightedDimensionSpacePoints)) {
$this->initializeWeightedDimensionSpacePoints();
}
@@ -134,9 +131,9 @@ public function getRootGeneralizations(): array
return $rootGeneralizations;
}
- protected function determineWeightNormalizationBase(): int
+ private function determineWeightNormalizationBase(): int
{
- if (is_null($this->weightNormalizationBase)) {
+ if (!isset($this->weightNormalizationBase)) {
$base = 0;
foreach ($this->contentDimensionSource->getContentDimensionsOrderedByPriority() as $contentDimension) {
$base = max($base, $contentDimension->getMaximumDepth()->value + 1);
@@ -148,13 +145,15 @@ protected function determineWeightNormalizationBase(): int
return $this->weightNormalizationBase;
}
- protected function initializeVariations(): void
+ private function initializeVariations(): void
{
$normalizedVariationWeights = [];
$lowestVariationWeights = [];
$this->weightedGeneralizations = [];
+ /** @var array> $indexedGeneralizations */
$indexedGeneralizations = [];
+ /** @var array> $indexedSpecializations */
$indexedSpecializations = [];
foreach ($this->getWeightedDimensionSpacePoints() as $generalizationHash => $generalization) {
@@ -165,8 +164,8 @@ protected function initializeVariations(): void
foreach ($generalization->dimensionValues as $rawDimensionId => $contentDimensionValue) {
$dimensionId = new Dimension\ContentDimensionId($rawDimensionId);
- /** @var Dimension\ContentDimension $dimension */
$dimension = $this->contentDimensionSource->getDimension($dimensionId);
+ assert($dimension !== null);
foreach ($dimension->getSpecializations($contentDimensionValue) as $specializedValue) {
$specializedDimensionSpacePoint = $generalization->dimensionSpacePoint
->vary($dimensionId, $specializedValue->value);
@@ -206,16 +205,13 @@ protected function initializeVariations(): void
}
}
- /** @var array> $indexedGeneralizations */
foreach ($indexedGeneralizations as $specializationHash => $generalizations) {
$this->indexedGeneralizations[$specializationHash] = new DimensionSpacePointSet($generalizations);
}
- /** @var array> $indexedSpecializations */
foreach ($indexedSpecializations as $generalizationHash => $specializations) {
$this->indexedSpecializations[$generalizationHash] = new DimensionSpacePointSet($specializations);
}
- /** @phpstan-ignore-next-line */
foreach ($this->weightedGeneralizations as $specializationHash => &$generalizationsByWeight) {
ksort($generalizationsByWeight);
}
@@ -225,8 +221,10 @@ protected function initializeVariations(): void
* @param array $normalizedVariationWeights
* @param array>& $indexedGeneralizations
* @param array>& $indexedSpecializations
+ * @param-out array> $indexedGeneralizations
+ * @param-out array> $indexedSpecializations
*/
- protected function initializeVariationsForDimensionSpacePointPair(
+ private function initializeVariationsForDimensionSpacePointPair(
WeightedDimensionSpacePoint $specialization,
WeightedDimensionSpacePoint $generalization,
array $normalizedVariationWeights,
@@ -237,9 +235,9 @@ protected function initializeVariationsForDimensionSpacePointPair(
if (isset($indexedGeneralizations[$generalization->getIdentityHash()])) {
$generalizations = $indexedGeneralizations[$generalization->getIdentityHash()];
foreach ($generalizations as $parentGeneralizationHash => $parentGeneralization) {
- /** @var WeightedDimensionSpacePoint $weighedParent */
- $weighedParent = $this->getWeightedDimensionSpacePointByHash($parentGeneralizationHash);
- $generalizationsToProcess[$parentGeneralizationHash] = $weighedParent;
+ $weightedParent = $this->getWeightedDimensionSpacePointByHash($parentGeneralizationHash);
+ assert($weightedParent !== null);
+ $generalizationsToProcess[$parentGeneralizationHash] = $weightedParent;
}
}
@@ -265,7 +263,7 @@ protected function initializeVariationsForDimensionSpacePointPair(
*/
public function getIndexedSpecializations(DimensionSpacePoint $generalization): DimensionSpacePointSet
{
- if (is_null($this->indexedSpecializations)) {
+ if (!isset($this->indexedSpecializations)) {
$this->initializeVariations();
}
@@ -277,7 +275,7 @@ public function getIndexedSpecializations(DimensionSpacePoint $generalization):
*/
public function getIndexedGeneralizations(DimensionSpacePoint $specialization): DimensionSpacePointSet
{
- if (is_null($this->indexedGeneralizations)) {
+ if (!isset($this->indexedGeneralizations)) {
$this->initializeVariations();
}
@@ -291,7 +289,7 @@ public function getIndexedGeneralizations(DimensionSpacePoint $specialization):
*/
public function getWeightedSpecializations(DimensionSpacePoint $generalization): array
{
- if (is_null($this->weightedSpecializations)) {
+ if (!isset($this->weightedSpecializations)) {
$this->initializeVariations();
}
@@ -305,7 +303,7 @@ public function getWeightedSpecializations(DimensionSpacePoint $generalization):
*/
public function getWeightedGeneralizations(DimensionSpacePoint $specialization): array
{
- if (is_null($this->weightedGeneralizations)) {
+ if (!isset($this->weightedGeneralizations)) {
$this->initializeVariations();
}
@@ -344,7 +342,7 @@ public function getSpecializationSet(
*/
public function getPrimaryGeneralization(DimensionSpacePoint $specialization): ?DimensionSpacePoint
{
- if (is_null($this->primaryGeneralizations)) {
+ if (!isset($this->primaryGeneralizations)) {
$this->initializeVariations();
}
@@ -360,7 +358,7 @@ public function getVariantType(DimensionSpacePoint $subject, DimensionSpacePoint
return VariantType::TYPE_SAME;
}
- if (is_null($this->indexedGeneralizations)) {
+ if (!isset($this->indexedGeneralizations)) {
$this->initializeVariations();
}
diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php
index 270547793a3..8a689481c0c 100644
--- a/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php
+++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/OriginDimensionSpacePoint.php
@@ -14,9 +14,6 @@
namespace Neos\ContentRepository\Core\DimensionSpace;
-use Neos\ContentRepository\Core\DimensionSpace\AbstractDimensionSpacePoint;
-use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
-
/**
* A node's origin dimension space point. Defines in which point in the dimension space the node originates
* (= is "at home"). Every node has exactly ONE OriginDimensionSpacePoint, but one or more {@see DimensionSpacePoint}s
@@ -57,6 +54,16 @@ public static function fromArray(array $data): self
return self::instance($data);
}
+ /**
+ * Creates a dimension space point for a zero-dimensional content repository.
+ *
+ * This applies to content repositories without any dimensions configured.
+ */
+ public static function createWithoutDimensions(): self
+ {
+ return self::fromArray([]);
+ }
+
/**
* @param string $jsonString A JSON string representation, see jsonSerialize
*/
diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php
index abe98671da9..0980ba6be62 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php
@@ -18,6 +18,7 @@
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
use Neos\ContentRepository\Core\DimensionSpace\Exception\DimensionSpacePointNotFound;
+use Neos\ContentRepository\Core\NodeType\ConstraintCheck;
use Neos\ContentRepository\Core\SharedModel\Exception\RootNodeAggregateDoesNotExist;
use Neos\ContentRepository\Core\SharedModel\Exception\ContentStreamDoesNotExistYet;
use Neos\ContentRepository\Core\SharedModel\Exception\DimensionSpacePointIsNotYetOccupied;
@@ -51,7 +52,7 @@
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite;
use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName;
use Neos\ContentRepository\Core\NodeType\NodeType;
-use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\ExpandedNodeTypeCriteria;
+use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraintsWithSubNodeTypes;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
@@ -216,18 +217,15 @@ protected function requireNodeTypeToAllowNodesOfTypeInReference(
if (is_null($propertyDeclaration)) {
throw ReferenceCannotBeSet::becauseTheNodeTypeDoesNotDeclareIt($referenceName, $nodeTypeName);
}
- if (isset($propertyDeclaration['constraints']['nodeTypes'])) {
- $nodeTypeConstraints = ExpandedNodeTypeCriteria::createFromNodeTypeDeclaration(
- $propertyDeclaration['constraints']['nodeTypes'],
- $this->getNodeTypeManager()
+
+ $constraints = $propertyDeclaration['constraints']['nodeTypes'] ?? [];
+
+ if (!ConstraintCheck::create($constraints)->isNodeTypeAllowed($nodeType)) {
+ throw ReferenceCannotBeSet::becauseTheConstraintsAreNotMatched(
+ $referenceName,
+ $nodeTypeName,
+ $nodeTypeNameInQuestion
);
- if (!$nodeTypeConstraints->matches($nodeTypeNameInQuestion)) {
- throw ReferenceCannotBeSet::becauseTheConstraintsAreNotMatched(
- $referenceName,
- $nodeTypeName,
- $nodeTypeNameInQuestion
- );
- }
}
}
diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php
index f52aac87f55..ba8ff204f27 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php
@@ -18,6 +18,7 @@
use Neos\ContentRepository\Core\EventStore\Events;
use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues;
+use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification;
@@ -26,7 +27,6 @@
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\NodeType\NodeType;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
-use Neos\ContentRepository\Core\SharedModel\User\UserId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
/**
@@ -54,15 +54,15 @@ abstract protected function createEventsForVariations(
*/
protected function createEventsForMissingTetheredNode(
NodeAggregate $parentNodeAggregate,
- Node $parentNode,
+ OriginDimensionSpacePoint $originDimensionSpacePoint,
NodeName $tetheredNodeName,
?NodeAggregateId $tetheredNodeAggregateId,
NodeType $expectedTetheredNodeType,
ContentRepository $contentRepository
): Events {
$childNodeAggregates = $contentRepository->getContentGraph()->findChildNodeAggregatesByName(
- $parentNode->subgraphIdentity->contentStreamId,
- $parentNode->nodeAggregateId,
+ $parentNodeAggregate->contentStreamId,
+ $parentNodeAggregate->nodeAggregateId,
$tetheredNodeName
);
@@ -75,19 +75,53 @@ protected function createEventsForMissingTetheredNode(
if (count($childNodeAggregates) === 0) {
// there is no tethered child node aggregate already; let's create it!
- return Events::with(
- new NodeAggregateWithNodeWasCreated(
- $parentNode->subgraphIdentity->contentStreamId,
- $tetheredNodeAggregateId ?: NodeAggregateId::create(),
- $expectedTetheredNodeType->name,
- $parentNode->originDimensionSpacePoint,
- $parentNodeAggregate->getCoverageByOccupant($parentNode->originDimensionSpacePoint),
- $parentNode->nodeAggregateId,
- $tetheredNodeName,
- SerializedPropertyValues::defaultFromNodeType($expectedTetheredNodeType),
- NodeAggregateClassification::CLASSIFICATION_TETHERED,
- )
- );
+ $nodeType = $this->nodeTypeManager->getNodeType($parentNodeAggregate->nodeTypeName);
+ if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) {
+ $events = [];
+ $tetheredNodeAggregateId = $tetheredNodeAggregateId ?: NodeAggregateId::create();
+ // we create in one origin DSP and vary in the others
+ $creationOriginDimensionSpacePoint = null;
+ foreach ($this->getInterDimensionalVariationGraph()->getRootGeneralizations() as $rootGeneralization) {
+ $rootGeneralizationOrigin = OriginDimensionSpacePoint::fromDimensionSpacePoint($rootGeneralization);
+ if ($creationOriginDimensionSpacePoint) {
+ $events[] = new NodePeerVariantWasCreated(
+ $parentNodeAggregate->contentStreamId,
+ $tetheredNodeAggregateId,
+ $creationOriginDimensionSpacePoint,
+ $rootGeneralizationOrigin,
+ $this->getInterDimensionalVariationGraph()->getSpecializationSet($rootGeneralization)
+ );
+ } else {
+ $events[] = new NodeAggregateWithNodeWasCreated(
+ $parentNodeAggregate->contentStreamId,
+ $tetheredNodeAggregateId,
+ $expectedTetheredNodeType->name,
+ $rootGeneralizationOrigin,
+ $this->getInterDimensionalVariationGraph()->getSpecializationSet($rootGeneralization),
+ $parentNodeAggregate->nodeAggregateId,
+ $tetheredNodeName,
+ SerializedPropertyValues::defaultFromNodeType($expectedTetheredNodeType),
+ NodeAggregateClassification::CLASSIFICATION_TETHERED,
+ );
+ $creationOriginDimensionSpacePoint = $rootGeneralizationOrigin;
+ }
+ }
+ return Events::fromArray($events);
+ } else {
+ return Events::with(
+ new NodeAggregateWithNodeWasCreated(
+ $parentNodeAggregate->contentStreamId,
+ $tetheredNodeAggregateId ?: NodeAggregateId::create(),
+ $expectedTetheredNodeType->name,
+ $originDimensionSpacePoint,
+ $parentNodeAggregate->getCoverageByOccupant($originDimensionSpacePoint),
+ $parentNodeAggregate->nodeAggregateId,
+ $tetheredNodeName,
+ SerializedPropertyValues::defaultFromNodeType($expectedTetheredNodeType),
+ NodeAggregateClassification::CLASSIFICATION_TETHERED,
+ )
+ );
+ }
} elseif (count($childNodeAggregates) === 1) {
/** @var NodeAggregate $childNodeAggregate */
$childNodeAggregate = current($childNodeAggregates);
@@ -106,9 +140,9 @@ protected function createEventsForMissingTetheredNode(
}
/** @var Node $childNodeSource Node aggregates are never empty */
return $this->createEventsForVariations(
- $parentNode->subgraphIdentity->contentStreamId,
+ $parentNodeAggregate->contentStreamId,
$childNodeSource->originDimensionSpacePoint,
- $parentNode->originDimensionSpacePoint,
+ $originDimensionSpacePoint,
$parentNodeAggregate,
$contentRepository
);
diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php
index 739a7b38a5c..07c0518e54b 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php
@@ -222,7 +222,6 @@ private function handleCreateNodeAggregateWithNodeAndSerializedProperties(
);
}
-
$defaultPropertyValues = SerializedPropertyValues::defaultFromNodeType($nodeType);
$initialPropertyValues = $defaultPropertyValues->merge($command->initialPropertyValues);
diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php
index d0ea7f49e90..ce969843ef1 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php
@@ -25,7 +25,7 @@ final class SetNodeReferences implements CommandInterface
* @param ReferenceName $referenceName Name of the reference to set
* @param NodeReferencesToWrite $references Unserialized reference(s) to set
*/
- public function __construct(
+ private function __construct(
public readonly ContentStreamId $contentStreamId,
public readonly NodeAggregateId $sourceNodeAggregateId,
public readonly OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint,
diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php
index 060135a4f4e..6c3836dc81c 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php
@@ -33,31 +33,27 @@ final class RemoveNodeAggregate implements
MatchableWithNodeIdToPublishOrDiscardInterface
{
/**
- * @param ContentStreamId $contentStreamId
+ * @param ContentStreamId $contentStreamId The content stream in which the remove operation is to be performed
+ * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove
+ * @param DimensionSpacePoint $coveredDimensionSpacePoint One of the dimension space points covered by the node aggregate in which the user intends to remove it
+ * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be removed
+ * @param NodeAggregateId|null $removalAttachmentPoint Internal. It stores the document node id of the removed node, as that is what the UI needs later on for the change display. {@see self::withRemovalAttachmentPoint()}
*/
- public function __construct(
+ private function __construct(
public readonly ContentStreamId $contentStreamId,
public readonly NodeAggregateId $nodeAggregateId,
- /** One of the dimension space points covered by the node aggregate in which the user intends to remove it */
public readonly DimensionSpacePoint $coveredDimensionSpacePoint,
public readonly NodeVariantSelectionStrategy $nodeVariantSelectionStrategy,
- /**
- * This is usually the NodeAggregateId of the parent node of the deleted node. It is needed for instance
- * in the Neos UI for the following scenario:
- * - when removing a node, you still need to be able to publish the removal.
- * - For this to work, the Neos UI needs to know the id of the removed Node, **on the page
- * where the removal happened** (so that the user can decide to publish a single page INCLUDING the removal
- * on the page)
- * - Because this command will *remove* the edge,
- * we cannot know the position in the tree after doing the removal anymore.
- *
- * That's why we need this field: For the Neos UI, it stores the document node of the removed node
- * (see Remove.php), as that is what the UI needs lateron for the change display.
- */
public readonly ?NodeAggregateId $removalAttachmentPoint
) {
}
+ /**
+ * @param ContentStreamId $contentStreamId The content stream in which the remove operation is to be performed
+ * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove
+ * @param DimensionSpacePoint $coveredDimensionSpacePoint One of the dimension space points covered by the node aggregate in which the user intends to remove it
+ * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be removed
+ */
public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self
{
return new self($contentStreamId, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy, null);
@@ -80,6 +76,14 @@ public static function fromArray(array $array): self
}
/**
+ * This adds usually the NodeAggregateId of the parent document node of the deleted node.
+ * It is needed for instance in the Neos UI for the following scenario:
+ * - when removing a node, you still need to be able to publish the removal.
+ * - For this to work, the Neos UI needs to know the id of the removed Node, **on the page where the removal happened**
+ * (so that the user can decide to publish a single page INCLUDING the removal on the page)
+ * - Because this command will *remove* the edge,
+ * we cannot know the position in the tree after doing the removal anymore.
+ *
* @param NodeAggregateId $removalAttachmentPoint
* @internal
*/
diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php
index b4e3e85049c..f38e032ce57 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php
@@ -33,7 +33,6 @@ trait NodeRenaming
private function handleChangeNodeAggregateName(ChangeNodeAggregateName $command, ContentRepository $contentRepository): EventsToPublish
{
-
$this->requireContentStreamToExist($command->contentStreamId, $contentRepository);
$nodeAggregate = $this->requireProjectedNodeAggregate(
$command->contentStreamId,
@@ -41,6 +40,19 @@ private function handleChangeNodeAggregateName(ChangeNodeAggregateName $command,
$contentRepository
);
$this->requireNodeAggregateToNotBeRoot($nodeAggregate, 'and Root Node Aggregates cannot be renamed');
+ $this->requireNodeAggregateToBeUntethered($nodeAggregate);
+ foreach ($contentRepository->getContentGraph()->findParentNodeAggregates($command->contentStreamId, $command->nodeAggregateId) as $parentNodeAggregate) {
+ foreach ($parentNodeAggregate->occupiedDimensionSpacePoints as $occupiedParentDimensionSpacePoint) {
+ $this->requireNodeNameToBeUnoccupied(
+ $command->contentStreamId,
+ $command->newNodeName,
+ $parentNodeAggregate->nodeAggregateId,
+ $occupiedParentDimensionSpacePoint,
+ $parentNodeAggregate->coveredDimensionSpacePoints,
+ $contentRepository
+ );
+ }
+ }
$events = Events::with(
new NodeAggregateNameWasChanged(
diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php
index 16306a537e8..0f68cba7042 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php
@@ -16,6 +16,7 @@
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
+use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet;
use Neos\ContentRepository\Core\EventStore\Events;
use Neos\ContentRepository\Core\EventStore\EventsToPublish;
@@ -90,7 +91,7 @@ abstract protected function areNodeTypeConstraintsImposedByGrandparentValid(
abstract protected function createEventsForMissingTetheredNode(
NodeAggregate $parentNodeAggregate,
- Node $parentNode,
+ OriginDimensionSpacePoint $originDimensionSpacePoint,
NodeName $tetheredNodeName,
NodeAggregateId $tetheredNodeAggregateId,
NodeType $expectedTetheredNodeType,
@@ -206,7 +207,7 @@ private function handleChangeNodeAggregateType(
?: NodeAggregateId::create();
array_push($events, ...iterator_to_array($this->createEventsForMissingTetheredNode(
$nodeAggregate,
- $node,
+ $node->originDimensionSpacePoint,
$tetheredNodeName,
$tetheredNodeAggregateId,
$expectedTetheredNodeType,
diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php
index ec57b71854f..0e2ceab99de 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php
@@ -16,6 +16,7 @@
use Neos\ContentRepository\Core\CommandHandler\CommandInterface;
use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface;
+use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
@@ -28,7 +29,7 @@
*
* @api commands are the write-API of the ContentRepository
*/
-final class CreateRootNodeAggregateWithNode implements
+final readonly class CreateRootNodeAggregateWithNode implements
CommandInterface,
\JsonSerializable,
RebasableToOtherContentStreamsInterface
@@ -37,11 +38,13 @@ final class CreateRootNodeAggregateWithNode implements
* @param ContentStreamId $contentStreamId The content stream in which the root node should be created in
* @param NodeAggregateId $nodeAggregateId The id of the root node aggregate to create
* @param NodeTypeName $nodeTypeName Name of type of the new node to create
+ * @param NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds Predefined aggregate ids of tethered child nodes per path. For any tethered node that has no matching entry in this set, the node aggregate id is generated randomly. Since tethered nodes may have tethered child nodes themselves, this works for multiple levels ({@see self::withTetheredDescendantNodeAggregateIds()})
*/
private function __construct(
- public readonly ContentStreamId $contentStreamId,
- public readonly NodeAggregateId $nodeAggregateId,
- public readonly NodeTypeName $nodeTypeName,
+ public ContentStreamId $contentStreamId,
+ public NodeAggregateId $nodeAggregateId,
+ public NodeTypeName $nodeTypeName,
+ public NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds,
) {
}
@@ -52,12 +55,54 @@ private function __construct(
*/
public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName): self
{
- return new self($contentStreamId, $nodeAggregateId, $nodeTypeName);
+ return new self(
+ $contentStreamId,
+ $nodeAggregateId,
+ $nodeTypeName,
+ NodeAggregateIdsByNodePaths::createEmpty()
+ );
}
+ /**
+ * Specify explicitly the node aggregate ids for the tethered children {@see tetheredDescendantNodeAggregateIds}.
+ *
+ * In case you want to create a batch of commands where one creates the root node and a succeeding command needs
+ * a tethered node aggregate id, you need to generate the child node aggregate ids in advance.
+ *
+ * _Alternatively you would need to fetch the created tethered node first from the subgraph.
+ * {@see ContentSubgraphInterface::findChildNodeConnectedThroughEdgeName()}_
+ *
+ * The helper method {@see NodeAggregateIdsByNodePaths::createForNodeType()} will generate recursively
+ * node aggregate ids for every tethered child node:
+ *
+ * ```php
+ * $tetheredDescendantNodeAggregateIds = NodeAggregateIdsByNodePaths::createForNodeType(
+ * $command->nodeTypeName,
+ * $nodeTypeManager
+ * );
+ * $command = $command->withTetheredDescendantNodeAggregateIds($tetheredDescendantNodeAggregateIds):
+ * ```
+ *
+ * The generated node aggregate id for the tethered node "main" is this way known before the command is issued:
+ *
+ * ```php
+ * $mainNodeAggregateId = $command->tetheredDescendantNodeAggregateIds->getNodeAggregateId(NodePath::fromString('main'));
+ * ```
+ *
+ * Generating the node aggregate ids from user land is totally optional.
+ */
+ public function withTetheredDescendantNodeAggregateIds(NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds): self
+ {
+ return new self(
+ $this->contentStreamId,
+ $this->nodeAggregateId,
+ $this->nodeTypeName,
+ $tetheredDescendantNodeAggregateIds,
+ );
+ }
/**
- * @param array $array
+ * @param array $array
*/
public static function fromArray(array $array): self
{
@@ -65,6 +110,9 @@ public static function fromArray(array $array): self
ContentStreamId::fromString($array['contentStreamId']),
NodeAggregateId::fromString($array['nodeAggregateId']),
NodeTypeName::fromString($array['nodeTypeName']),
+ isset($array['tetheredDescendantNodeAggregateIds'])
+ ? NodeAggregateIdsByNodePaths::fromArray($array['tetheredDescendantNodeAggregateIds'])
+ : NodeAggregateIdsByNodePaths::createEmpty()
);
}
@@ -82,6 +130,7 @@ public function createCopyForContentStream(ContentStreamId $target): self
$target,
$this->nodeAggregateId,
$this->nodeTypeName,
+ $this->tetheredDescendantNodeAggregateIds
);
}
}
diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php
index 844f63f7c24..20de19bc5c6 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php
@@ -16,13 +16,18 @@
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet;
+use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\EventStore\Events;
use Neos\ContentRepository\Core\EventStore\EventsToPublish;
use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName;
+use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths;
+use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated;
+use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateDimensionsWereUpdated;
use Neos\ContentRepository\Core\NodeType\NodeType;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
+use Neos\ContentRepository\Core\Projection\ContentGraph\NodePath;
use Neos\ContentRepository\Core\SharedModel\Exception\ContentStreamDoesNotExistYet;
use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregateIsNotRoot;
use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregatesTypeIsAmbiguous;
@@ -31,8 +36,11 @@
use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFound;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode;
use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated;
+use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFoundException;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification;
use Neos\ContentRepository\Core\Feature\Common\NodeAggregateEventPublisher;
+use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
+use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\EventStore\Model\EventStream\ExpectedVersion;
/**
@@ -76,12 +84,33 @@ private function handleCreateRootNodeAggregateWithNode(
$contentRepository
);
- $events = Events::with(
+ $descendantNodeAggregateIds = $command->tetheredDescendantNodeAggregateIds->completeForNodeOfType(
+ $command->nodeTypeName,
+ $this->nodeTypeManager
+ );
+ // Write the auto-created descendant node aggregate ids back to the command;
+ // so that when rebasing the command, it stays fully deterministic.
+ $command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds);
+
+ $events = [
$this->createRootWithNode(
$command,
$this->getAllowedDimensionSubspace()
)
- );
+ ];
+
+ foreach ($this->getInterDimensionalVariationGraph()->getRootGeneralizations() as $rootGeneralization) {
+ array_push($events, ...iterator_to_array($this->handleTetheredRootChildNodes(
+ $command,
+ $nodeType,
+ OriginDimensionSpacePoint::fromDimensionSpacePoint($rootGeneralization),
+ $this->getInterDimensionalVariationGraph()->getSpecializationSet($rootGeneralization, true),
+ $command->nodeAggregateId,
+ $command->tetheredDescendantNodeAggregateIds,
+ null,
+ $contentRepository
+ )));
+ }
$contentStreamEventStream = ContentStreamEventStreamName::fromContentStreamId(
$command->contentStreamId
@@ -90,7 +119,7 @@ private function handleCreateRootNodeAggregateWithNode(
$contentStreamEventStream->getEventStreamName(),
NodeAggregateEventPublisher::enrichWithCommand(
$command,
- $events
+ Events::fromArray($events)
),
ExpectedVersion::ANY()
);
@@ -147,4 +176,81 @@ private function handleUpdateRootNodeAggregateDimensions(
ExpectedVersion::ANY()
);
}
+
+ /**
+ * @throws ContentStreamDoesNotExistYet
+ * @throws NodeTypeNotFoundException
+ */
+ private function handleTetheredRootChildNodes(
+ CreateRootNodeAggregateWithNode $command,
+ NodeType $nodeType,
+ OriginDimensionSpacePoint $originDimensionSpacePoint,
+ DimensionSpacePointSet $coveredDimensionSpacePoints,
+ NodeAggregateId $parentNodeAggregateId,
+ NodeAggregateIdsByNodePaths $nodeAggregateIdsByNodePath,
+ ?NodePath $nodePath,
+ ContentRepository $contentRepository,
+ ): Events {
+ $events = [];
+ foreach ($this->getNodeTypeManager()->getTetheredNodesConfigurationForNodeType($nodeType) as $rawNodeName => $childNodeType) {
+ assert($childNodeType instanceof NodeType);
+ $nodeName = NodeName::fromString($rawNodeName);
+ $childNodePath = $nodePath
+ ? $nodePath->appendPathSegment($nodeName)
+ : NodePath::fromString($nodeName->value);
+ $childNodeAggregateId = $nodeAggregateIdsByNodePath->getNodeAggregateId($childNodePath)
+ ?? NodeAggregateId::create();
+ $initialPropertyValues = SerializedPropertyValues::defaultFromNodeType($childNodeType);
+
+ $this->requireContentStreamToExist($command->contentStreamId, $contentRepository);
+ $events[] = $this->createTetheredWithNodeForRoot(
+ $command,
+ $childNodeAggregateId,
+ $childNodeType->name,
+ $originDimensionSpacePoint,
+ $coveredDimensionSpacePoints,
+ $parentNodeAggregateId,
+ $nodeName,
+ $initialPropertyValues
+ );
+
+ array_push($events, ...iterator_to_array($this->handleTetheredRootChildNodes(
+ $command,
+ $childNodeType,
+ $originDimensionSpacePoint,
+ $coveredDimensionSpacePoints,
+ $childNodeAggregateId,
+ $nodeAggregateIdsByNodePath,
+ $childNodePath,
+ $contentRepository
+ )));
+ }
+
+ return Events::fromArray($events);
+ }
+
+ private function createTetheredWithNodeForRoot(
+ CreateRootNodeAggregateWithNode $command,
+ NodeAggregateId $nodeAggregateId,
+ NodeTypeName $nodeTypeName,
+ OriginDimensionSpacePoint $originDimensionSpacePoint,
+ DimensionSpacePointSet $coveredDimensionSpacePoints,
+ NodeAggregateId $parentNodeAggregateId,
+ NodeName $nodeName,
+ SerializedPropertyValues $initialPropertyValues,
+ NodeAggregateId $precedingNodeAggregateId = null
+ ): NodeAggregateWithNodeWasCreated {
+ return new NodeAggregateWithNodeWasCreated(
+ $command->contentStreamId,
+ $nodeAggregateId,
+ $nodeTypeName,
+ $originDimensionSpacePoint,
+ $coveredDimensionSpacePoints,
+ $parentNodeAggregateId,
+ $nodeName,
+ $initialPropertyValues,
+ NodeAggregateClassification::CLASSIFICATION_TETHERED,
+ $precedingNodeAggregateId
+ );
+ }
}
diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php
index d3bd1557328..7fc7d47f176 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php
@@ -476,6 +476,10 @@ private function extractCommandsFromContentStreamMetadata(
$commandToRebaseClass
), 1547815341);
}
+ /**
+ * The "fromArray" might be declared via {@see RebasableToOtherContentStreamsInterface::fromArray()}
+ * or any other command can just implement it.
+ */
$commands[] = $commandToRebaseClass::fromArray($commandToRebasePayload);
}
}
diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php
index 873d00e5925..5f4100b6e2f 100644
--- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php
+++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php
@@ -29,29 +29,13 @@ final class PublishIndividualNodesFromWorkspace implements CommandInterface
/**
* @param WorkspaceName $workspaceName Name of the affected workspace
* @param NodeIdsToPublishOrDiscard $nodesToPublish Ids of the nodes to publish or discard
- * @param ContentStreamId $contentStreamIdForMatchingPart The id of the new content stream that will contain all events to be published
- * @param ContentStreamId $contentStreamIdForRemainingPart The id of the new content stream that will contain all remaining events
+ * @param ContentStreamId $contentStreamIdForMatchingPart The id of the new content stream that will contain all events to be published {@see self::withContentStreamIdForMatchingPart()}
+ * @param ContentStreamId $contentStreamIdForRemainingPart The id of the new content stream that will contain all remaining events {@see self::withContentStreamIdForRemainingPart()}
*/
private function __construct(
public readonly WorkspaceName $workspaceName,
public readonly NodeIdsToPublishOrDiscard $nodesToPublish,
- /**
- * during the publish process, we sort the events so that the events we want to publish
- * come first. In this process, two new content streams are generated:
- * - the first one contains all events which we want to publish
- * - the second one is based on the first one, and contains all the remaining events (which we want to keep
- * in the user workspace).
- *
- * This property contains the ID of the first content stream, so that this command
- * can run fully deterministic - we need this for the test cases.
- */
public readonly ContentStreamId $contentStreamIdForMatchingPart,
- /**
- * See the description of {@see $contentStreamIdForMatchingPart}.
- *
- * This property contains the ID of the second content stream, so that this command
- * can run fully deterministic - we need this for the test cases.
- */
public readonly ContentStreamId $contentStreamIdForRemainingPart
) {
}
@@ -70,11 +54,27 @@ public static function create(WorkspaceName $workspaceName, NodeIdsToPublishOrDi
);
}
+ /**
+ * During the publish process, we sort the events so that the events we want to publish
+ * come first. In this process, two new content streams are generated:
+ * - the first one contains all events which we want to publish
+ * - the second one is based on the first one, and contains all the remaining events (which we want to keep
+ * in the user workspace).
+ *
+ * This method adds the ID of the first content stream, so that the command
+ * can run fully deterministic - we need this for the test cases.
+ */
public function withContentStreamIdForMatchingPart(ContentStreamId $contentStreamIdForMatchingPart): self
{
return new self($this->workspaceName, $this->nodesToPublish, $contentStreamIdForMatchingPart, $this->contentStreamIdForRemainingPart);
}
+ /**
+ * See the description of {@see self::withContentStreamIdForMatchingPart()}.
+ *
+ * This property adds the ID of the second content stream, so that the command
+ * can run fully deterministic - we need this for the test cases.
+ */
public function withContentStreamIdForRemainingPart(ContentStreamId $contentStreamIdForRemainingPart): self
{
return new self($this->workspaceName, $this->nodesToPublish, $this->contentStreamIdForMatchingPart, $contentStreamIdForRemainingPart);
diff --git a/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php b/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php
index 91058e9b8b8..3771b1234d7 100644
--- a/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php
+++ b/Neos.ContentRepository.Core/Classes/NodeType/ConstraintCheck.php
@@ -6,16 +6,24 @@
* Performs node type constraint checks against a given set of constraints
* @internal
*/
-class ConstraintCheck
+final readonly class ConstraintCheck
{
/**
- * @param array $constraints
+ * @param array $constraints
*/
- public function __construct(
- private readonly array $constraints
+ private function __construct(
+ private array $constraints
) {
}
+ /**
+ * @param array $constraints
+ */
+ public static function create(array $constraints): self
+ {
+ return new self($constraints);
+ }
+
public function isNodeTypeAllowed(NodeType $nodeType): bool
{
$directConstraintsResult = $this->isNodeTypeAllowedByDirectConstraints($nodeType);
diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php
index 1eaae89553c..f1e861f3beb 100644
--- a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php
+++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php
@@ -400,13 +400,31 @@ public function getProperties(): array
}
/**
- * Returns the configured type of the specified property
+ * Check if the property is configured in the schema.
+ */
+ public function hasProperty(string $propertyName): bool
+ {
+ $this->initialize();
+
+ return isset($this->fullConfiguration['properties'][$propertyName]);
+ }
+
+ /**
+ * Returns the configured type of the specified property, and falls back to 'string'.
*
- * @param string $propertyName Name of the property
+ * @throws \InvalidArgumentException if the property is not configured
*/
public function getPropertyType(string $propertyName): string
{
$this->initialize();
+
+ if (!$this->hasProperty($propertyName)) {
+ throw new \InvalidArgumentException(
+ sprintf('NodeType schema has no property "%s" configured. Cannot read its type.', $propertyName),
+ 1695062252040
+ );
+ }
+
return $this->fullConfiguration['properties'][$propertyName]['type'] ?? 'string';
}
@@ -479,7 +497,7 @@ public function getNodeTypeNameOfTetheredNode(NodeName $nodeName): NodeTypeName
public function allowsChildNodeType(NodeType $nodeType): bool
{
$constraints = $this->getConfiguration('constraints.nodeTypes') ?: [];
- return (new ConstraintCheck($constraints))->isNodeTypeAllowed($nodeType);
+ return ConstraintCheck::create($constraints)->isNodeTypeAllowed($nodeType);
}
/**
diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php
index ba6ec1cfd8e..69352cb5da3 100644
--- a/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php
+++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php
@@ -260,7 +260,7 @@ public function isNodeTypeAllowedAsChildToTetheredNode(NodeType $parentNodeType,
$constraints = Arrays::arrayMergeRecursiveOverrule($constraints, $childNodeConstraintConfiguration);
- return (new ConstraintCheck($constraints))->isNodeTypeAllowed($nodeType);
+ return ConstraintCheck::create($constraints)->isNodeTypeAllowed($nodeType);
}
/**
diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php
index ddfa8f4a6e8..7660d7c154d 100644
--- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php
+++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php
@@ -16,6 +16,7 @@
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath;
+use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphIdentity;
use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\CountBackReferencesFilter;
@@ -52,6 +53,11 @@ public function __construct(
$this->inMemoryCache = new InMemoryCache();
}
+ public function getIdentity(): ContentSubgraphIdentity
+ {
+ return $this->wrappedContentSubgraph->getIdentity();
+ }
+
public function findChildNodes(NodeAggregateId $parentNodeAggregateId, FindChildNodesFilter $filter): Nodes
{
if (!self::isFilterEmpty($filter)) {
diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php
index 55a5572edf8..5f65fb6a0f1 100644
--- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php
+++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php
@@ -48,6 +48,15 @@
*/
interface ContentSubgraphInterface extends \JsonSerializable
{
+ /**
+ * Returns the subgraph's identity, i.e. the current perspective we look at content from, composed of
+ * * the content repository the subgraph belongs to
+ * * the ID of the content stream we are currently working in
+ * * the dimension space point we are currently looking at
+ * * the applied visibility constraints
+ */
+ public function getIdentity(): ContentSubgraphIdentity;
+
/**
* Find a single node by its aggregate id
*
diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/ExpandedNodeTypeCriteria.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/ExpandedNodeTypeCriteria.php
index 5c85fa3c57b..99e4ac9689f 100644
--- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/ExpandedNodeTypeCriteria.php
+++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/ExpandedNodeTypeCriteria.php
@@ -18,7 +18,6 @@
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\NodeType\NodeTypeNames;
-use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria;
/**
* Implementation detail of {@see NodeTypeCriteria}, to be used inside implementations of ContentSubgraphInterface.
@@ -34,50 +33,6 @@ private function __construct(
) {
}
- /**
- * @param array $nodeTypeDeclaration
- */
- public static function createFromNodeTypeDeclaration(
- array $nodeTypeDeclaration,
- NodeTypeManager $nodeTypeManager
- ): self {
- $wildCardAllowed = false;
- $explicitlyAllowedNodeTypeNames = [];
- $explicitlyDisallowedNodeTypeNames = [];
- foreach ($nodeTypeDeclaration as $constraintName => $allowed) {
- if ($constraintName === '*') {
- $wildCardAllowed = $allowed;
- } else {
- if ($allowed) {
- $explicitlyAllowedNodeTypeNames[] = $constraintName;
- } else {
- $explicitlyDisallowedNodeTypeNames[] = $constraintName;
- }
- }
- }
-
- return new self(
- $wildCardAllowed,
- self::expandByIncludingSubNodeTypes(
- NodeTypeNames::fromStringArray($explicitlyAllowedNodeTypeNames),
- $nodeTypeManager
- ),
- self::expandByIncludingSubNodeTypes(
- NodeTypeNames::fromStringArray($explicitlyDisallowedNodeTypeNames),
- $nodeTypeManager
- )
- );
- }
-
- public static function allowAll(): self
- {
- return new self(
- true,
- NodeTypeNames::createEmpty(),
- NodeTypeNames::createEmpty(),
- );
- }
-
public static function create(NodeTypeCriteria $nodeTypeCriteria, NodeTypeManager $nodeTypeManager): self
{
// in case there are no filters, we fall back to allowing every node type.
@@ -138,22 +93,4 @@ public function matches(NodeTypeName $nodeTypeName): bool
// otherwise, we return $wildcardAllowed.
return $this->isWildCardAllowed;
}
-
- public function toFilterString(): string
- {
- $parts = [];
- if ($this->isWildCardAllowed) {
- $parts[] = '*';
- }
-
- foreach ($this->explicitlyDisallowedNodeTypeNames as $nodeTypeName) {
- $parts[] = '!' . $nodeTypeName->value;
- }
-
- foreach ($this->explicitlyAllowedNodeTypeNames as $nodeTypeName) {
- $parts[] = $nodeTypeName->value;
- }
-
- return implode(',', $parts);
- }
}
diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/NodeTypeCriteria.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/NodeTypeCriteria.php
index ea8eebe9be8..8028db3d468 100644
--- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/NodeTypeCriteria.php
+++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Filter/NodeType/NodeTypeCriteria.php
@@ -56,11 +56,25 @@ private function __construct(
) {
}
+ /**
+ * We recommended to call this method with named arguments to better
+ * understand the distinction between allowed and disallowed NodeTypeNames
+ */
public static function create(
- NodeTypeNames $explicitlyAllowedNodeTypeNames,
- NodeTypeNames $explicitlyDisallowedNodeTypeNames
+ NodeTypeNames $allowed,
+ NodeTypeNames $disallowed
): self {
- return new self($explicitlyAllowedNodeTypeNames, $explicitlyDisallowedNodeTypeNames);
+ return new self($allowed, $disallowed);
+ }
+
+ public static function createWithAllowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self
+ {
+ return new self($nodeTypeNames, NodeTypeNames::createEmpty());
+ }
+
+ public static function createWithDisallowedNodeTypeNames(NodeTypeNames $nodeTypeNames): self
+ {
+ return new self(NodeTypeNames::createEmpty(), $nodeTypeNames);
}
public static function fromFilterString(string $serializedFilters): self
diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php
index 6d2e63d2037..d29f4191ec9 100644
--- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php
+++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php
@@ -37,50 +37,37 @@
final readonly class Node
{
/**
- * @internal
+ * @param ContentSubgraphIdentity $subgraphIdentity This is part of the node's "Read Model" identity which is defined by: {@see self::subgraphIdentity} and {@see self::nodeAggregateId}
+ * @param NodeAggregateId $nodeAggregateId NodeAggregateId (identifier) of this node. This is part of the node's "Read Model" identity which is defined by: {@see self::subgraphIdentity} and {@see self::nodeAggregateId}
+ * @param OriginDimensionSpacePoint $originDimensionSpacePoint The DimensionSpacePoint the node originates in. Usually needed to address a Node in a NodeAggregate in order to update it.
+ * @param NodeAggregateClassification $classification The classification (regular, root, tethered) of this node
+ * @param NodeTypeName $nodeTypeName The node's node type name; always set, even if unknown to the NodeTypeManager
+ * @param NodeType|null $nodeType The node's node type, null if unknown to the NodeTypeManager - @deprecated Don't rely on this too much, as the capabilities of the NodeType here will probably change a lot; Ask the {@see NodeTypeManager} instead
+ * @param PropertyCollection $properties All properties of this node. References are NOT part of this API; To access references, {@see ContentSubgraphInterface::findReferences()} can be used; To read the serialized properties, call properties->serialized().
+ * @param NodeName|null $nodeName The optional name of this node {@see ContentSubgraphInterface::findChildNodeConnectedThroughEdgeName()}
+ * @param Timestamps $timestamps Creation and modification timestamps of this node
*/
- public function __construct(
+ private function __construct(
public ContentSubgraphIdentity $subgraphIdentity,
- /**
- * NodeAggregateId (identifier) of this node
- * This is part of the node's "Read Model" identity, whis is defined by:
- * - {@see getSubgraphIdentitity}
- * - {@see getNodeAggregateId} (this method)
- *
- * With the above information, you can fetch a Subgraph using {@see ContentGraphInterface::getSubgraph()}.
- * or {@see \Neos\ContentRepositoryRegistry\ContentRepositoryRegistry::subgraphForNode()}
- */
public NodeAggregateId $nodeAggregateId,
- /**
- * returns the DimensionSpacePoint the node is at home in. Usually needed to address a Node in a NodeAggregate
- * in order to update it.
- */
public OriginDimensionSpacePoint $originDimensionSpacePoint,
public NodeAggregateClassification $classification,
- /**
- * The node's node type name; always set, even if unknown to the NodeTypeManager
- */
public NodeTypeName $nodeTypeName,
- /**
- * The node's node type, null if unknown to the NodeTypeManager
- * @deprecated Don't rely on this too much, as the capabilities of the NodeType here will probably change a lot;
- * Ask the {@see NodeTypeManager} instead
- */
public ?NodeType $nodeType,
- /**
- * Returns all properties of this node. References are NOT part of this API;
- * there you need to check getReference() and getReferences().
- *
- * To read the serialized properties, call properties->serialized().
- *
- * @param PropertyCollection $properties Property values, indexed by their name
- */
public PropertyCollection $properties,
public ?NodeName $nodeName,
public Timestamps $timestamps,
) {
}
+ /**
+ * @internal The signature of this method can change in the future!
+ */
+ public static function create(ContentSubgraphIdentity $subgraphIdentity, NodeAggregateId $nodeAggregateId, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, ?NodeType $nodeType, PropertyCollection $properties, ?NodeName $nodeName, Timestamps $timestamps): self
+ {
+ return new self($subgraphIdentity, $nodeAggregateId, $originDimensionSpacePoint, $classification, $nodeTypeName, $nodeType, $properties, $nodeName, $timestamps);
+ }
+
/**
* Returns the specified property.
*
diff --git a/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php
index 61f96e5fee3..249683514cf 100644
--- a/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php
+++ b/Neos.ContentRepository.Core/Classes/Projection/ProjectionInterface.php
@@ -4,14 +4,10 @@
namespace Neos\ContentRepository\Core\Projection;
-use Neos\ContentRepository\Core\CommandHandler\PendingProjections;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\EventStore\CatchUp\CheckpointStorageInterface;
use Neos\EventStore\Model\EventEnvelope;
-use Neos\EventStore\Model\EventStream\EventStreamInterface;
-use Neos\EventStore\Model\Event\SequenceNumber;
-use Neos\EventStore\Model\Event;
/**
* Common interface for a Content Repository projection. This API is NOT exposed to the outside world, but is
@@ -20,7 +16,7 @@
* If the Projection needs to be notified that a catchup is about to happen, you can additionally
* implement {@see WithMarkStaleInterface}. This is useful f.e. to disable runtime caches in the ProjectionState.
*
- * @template TState of ProjectionStateInterface
+ * @template-covariant TState of ProjectionStateInterface
* @api you can write custom projections
*/
interface ProjectionInterface
diff --git a/Neos.ContentRepository.Core/Classes/Projection/Projections.php b/Neos.ContentRepository.Core/Classes/Projection/Projections.php
index 4b25f31dc4d..1d5d2d6f431 100644
--- a/Neos.ContentRepository.Core/Classes/Projection/Projections.php
+++ b/Neos.ContentRepository.Core/Classes/Projection/Projections.php
@@ -13,16 +13,16 @@
final class Projections implements \IteratorAggregate
{
/**
- * @var array>
+ * @var array>, ProjectionInterface>
*/
private array $projections;
/**
- * @param array $projections
- * @phpstan-ignore-next-line
+ * @param ProjectionInterface ...$projections
*/
private function __construct(ProjectionInterface ...$projections)
{
+ // @phpstan-ignore-next-line
$this->projections = $projections;
}
@@ -60,7 +60,8 @@ public static function fromArray(array $projections): self
*/
public function get(string $projectionClassName): ProjectionInterface
{
- if (!$this->has($projectionClassName)) {
+ $projection = $this->projections[$projectionClassName] ?? null;
+ if (!$projection instanceof $projectionClassName) {
throw new \InvalidArgumentException(
sprintf(
'a projection of type "%s" is not registered in this content repository instance.',
@@ -69,8 +70,7 @@ public function get(string $projectionClassName): ProjectionInterface
1650120813
);
}
- // @phpstan-ignore-next-line
- return $this->projections[$projectionClassName];
+ return $projection;
}
public function has(string $projectionClassName): bool
@@ -79,8 +79,7 @@ public function has(string $projectionClassName): bool
}
/**
- * @return \Traversable
- * @phpstan-ignore-next-line
+ * @return \Traversable>
*/
public function getIterator(): \Traversable
{
diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php b/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php
index ed42e885124..01f89fa2401 100644
--- a/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php
+++ b/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php
@@ -15,6 +15,7 @@
namespace Neos\ContentRepository\Core\SharedModel\Node;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
+use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes;
/**
* An immutable collection of NodeAggregateIds, indexed by their value
@@ -67,13 +68,10 @@ public static function fromJsonString(string $jsonString): self
return self::fromArray(\json_decode($jsonString, true));
}
- /**
- * @param Node[] $nodes
- */
- public static function fromNodes(array $nodes): self
+ public static function fromNodes(Nodes $nodes): self
{
return self::fromArray(
- array_map(fn(Node $node) => $node->nodeAggregateId, $nodes)
+ array_map(fn(Node $node) => $node->nodeAggregateId, iterator_to_array($nodes))
);
}
@@ -85,6 +83,11 @@ public function merge(self $other): self
));
}
+ public function contain(NodeAggregateId $nodeAggregateId): bool
+ {
+ return array_key_exists($nodeAggregateId->value, $this->nodeAggregateIds);
+ }
+
/**
* @return array
*/
diff --git a/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php b/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php
index 916e39d2043..12b5a86b7fa 100644
--- a/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php
+++ b/Neos.ContentRepository.Export/src/Asset/ValueObject/SerializedImageVariant.php
@@ -71,11 +71,6 @@ public static function fromArray(array $array): self
public function matches(ImageVariant $imageVariant): bool
{
- if (self::fromImageVariant($imageVariant)->toJson() !== $this->toJson()) {
- \Neos\Flow\var_dump(self::fromImageVariant($imageVariant)->toJson());
- \Neos\Flow\var_dump($this->toJson());
- exit;
- }
return self::fromImageVariant($imageVariant)->toJson() === $this->toJson();
}
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php
index fabefad1565..b3b7e1a11d6 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php
+++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Command/CrCommandController.php
@@ -40,13 +40,6 @@
class CrCommandController extends CommandController
{
-
- /**
- * @var array
- */
- #[Flow\InjectConfiguration(package: 'Neos.Flow')]
- protected array $flowSettings;
-
public function __construct(
private readonly Connection $connection,
private readonly Environment $environment,
@@ -96,6 +89,7 @@ public function migrateLegacyDataCommand(bool $verbose = false, string $config =
$siteRows = $connection->fetchAllAssociativeIndexed('SELECT nodename, name, siteresourcespackagekey FROM neos_neos_domain_model_site');
$siteNodeName = $this->output->select('Which site to migrate?', array_map(static fn (array $siteRow) => $siteRow['name'] . ' (' . $siteRow['siteresourcespackagekey'] . ')', $siteRows));
+ assert(is_string($siteNodeName));
$siteRow = $siteRows[$siteNodeName];
$site = $this->siteRepository->findOneByNodeName($siteNodeName);
@@ -208,6 +202,7 @@ private function determineResourcesPath(): string
private static function defaultResourcesPath(): string
{
+ // @phpstan-ignore-next-line
return FLOW_PATH_DATA . 'Persistent/Resources';
}
}
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php
index f7479da4c39..89ce5152c53 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php
+++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/AssetExtractor.php
@@ -12,6 +12,9 @@
final class AssetExtractor
{
+ /**
+ * @var array
+ */
private array $processedAssetIds = [];
public function __construct(
@@ -19,7 +22,8 @@ public function __construct(
) {}
/**
- * @param iterable $nodeDataRows
+ * @param iterable> $nodeDataRows
+ * @return iterable
*/
public function run(iterable $nodeDataRows): iterable
{
@@ -48,11 +52,14 @@ public function run(iterable $nodeDataRows): iterable
/** ----------------------------- */
+ /**
+ * @return iterable
+ */
private function extractAssets(mixed $propertyValue): iterable
{
if ($propertyValue instanceof Asset) {
+ /** @var string|null $assetId */
$assetId = $propertyValue->getIdentifier();
- \Neos\Flow\var_dump($assetId, '$assetId');
if ($assetId === null) {
// TODO exception/error
return;
@@ -75,7 +82,6 @@ private function extractAssets(mixed $propertyValue): iterable
foreach ($matches as $match) {
$assetId = $match['assetId'];
$asset = ($this->findAssetByIdentifier)($assetId);
- \Neos\Flow\var_dump($asset, '$asset ' . $assetId);
if ($asset === null) {
// TODO exception/error
continue;
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php
index 52d54cdbf20..904f5700184 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php
+++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/Helpers/NodeDataLoader.php
@@ -4,16 +4,21 @@
namespace Neos\ContentRepository\LegacyNodeMigration\Helpers;
use Doctrine\DBAL\Connection;
-use Traversable;
+/**
+ * @implements \IteratorAggregate>
+ */
final class NodeDataLoader implements \IteratorAggregate
{
-
public function __construct(
private readonly Connection $connection,
- ) {}
+ ) {
+ }
- public function getIterator(): Traversable
+ /**
+ * @return \Traversable>
+ */
+ public function getIterator(): \Traversable
{
$query = $this->connection->executeQuery('
SELECT
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php
index 2bcebc44a0e..15d1be1d8c4 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php
+++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/LegacyMigrationService.php
@@ -87,7 +87,7 @@ public function runAllProcessors(\Closure $outputLineFn, bool $verbose = false):
});
$result = $processor->run();
if ($result->severity === Severity::ERROR) {
- throw new \RuntimeException($label . ': ' . $result->message ?? '');
+ throw new \RuntimeException($label . ': ' . $result->message);
}
$outputLineFn(' ' . $result->message);
$outputLineFn();
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php
index a1495d6174e..f96db3b58cc 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php
+++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToAssetsProcessor.php
@@ -17,9 +17,18 @@
final class NodeDataToAssetsProcessor implements ProcessorInterface
{
+ /**
+ * @var array
+ */
private array $processedAssetIds = [];
+ /**
+ * @var array<\Closure>
+ */
private array $callbacks = [];
+ /**
+ * @param iterable> $nodeDataRows
+ */
public function __construct(
private readonly NodeTypeManager $nodeTypeManager,
private readonly AssetExporter $assetExporter,
@@ -35,16 +44,16 @@ public function run(): ProcessorResult
{
$numberOfErrors = 0;
foreach ($this->nodeDataRows as $nodeDataRow) {
+ if ($nodeDataRow['path'] === '/sites') {
+ // the sites node has no properties and is unstructured
+ continue;
+ }
$nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']);
- try {
- $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName);
- } catch (NodeTypeNotFoundException $exception) {
- $numberOfErrors ++;
- $this->dispatch(Severity::ERROR, '%s. Node: "%s"', $exception->getMessage(), $nodeDataRow['identifier']);
+ if (!$this->nodeTypeManager->hasNodeType($nodeTypeName)) {
+ $this->dispatch(Severity::ERROR, 'The node type "%s" is not available. Node: "%s"', $nodeTypeName->value, $nodeDataRow['identifier']);
continue;
}
- // HACK the following line is required in order to fully initialize the node type
- $nodeType->getFullConfiguration();
+ $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName);
try {
$properties = json_decode($nodeDataRow['properties'], true, 512, JSON_THROW_ON_ERROR);
} catch (\JsonException $exception) {
@@ -84,12 +93,10 @@ public function run(): ProcessorResult
private function extractAssetIdentifiers(string $type, mixed $value): array
{
if (($type === 'string' || is_subclass_of($type, \Stringable::class, true)) && is_string($value)) {
- // @phpstan-ignore-next-line
preg_match_all('/asset:\/\/(?[\w-]*)/i', (string)$value, $matches, PREG_SET_ORDER);
return array_map(static fn(array $match) => $match['assetId'], $matches);
}
if (is_subclass_of($type, ResourceBasedInterface::class, true)) {
- // @phpstan-ignore-next-line
return isset($value['__identifier']) ? [$value['__identifier']] : [];
}
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php
index 9b4ed5e4189..cc3ad13609b 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php
+++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php
@@ -58,7 +58,9 @@
final class NodeDataToEventsProcessor implements ProcessorInterface
{
-
+ /**
+ * @var array<\Closure>
+ */
private array $callbacks = [];
private NodeTypeName $sitesNodeTypeName;
private ContentStreamId $contentStreamId;
@@ -78,6 +80,9 @@ final class NodeDataToEventsProcessor implements ProcessorInterface
*/
private $eventFileResource;
+ /**
+ * @param iterable> $nodeDataRows
+ */
public function __construct(
private readonly NodeTypeManager $nodeTypeManager,
private readonly PropertyMapper $propertyMapper,
@@ -156,7 +161,7 @@ private function resetRuntimeState(): void
$this->nodeReferencesWereSetEvents = [];
$this->numberOfExportedEvents = 0;
$this->metaDataExported = false;
- $this->eventFileResource = fopen('php://temp/maxmemory:5242880', 'rb+');
+ $this->eventFileResource = fopen('php://temp/maxmemory:5242880', 'rb+') ?: null;
Assert::resource($this->eventFileResource, null, 'Failed to create temporary event file resource');
}
@@ -168,10 +173,14 @@ private function exportEvent(EventInterface $event): void
json_decode($this->eventNormalizer->getEventData($event)->value, true),
[]
);
+ assert($this->eventFileResource !== null);
fwrite($this->eventFileResource, $exportedEvent->toJson() . chr(10));
$this->numberOfExportedEvents ++;
}
+ /**
+ * @param array $nodeDataRow
+ */
private function exportMetaData(array $nodeDataRow): void
{
if ($this->files->fileExists('meta.json')) {
@@ -187,7 +196,7 @@ private function exportMetaData(array $nodeDataRow): void
}
/**
- * @param array $nodeDataRow
+ * @param array $nodeDataRow
*/
private function processNodeData(array $nodeDataRow): void
{
@@ -229,10 +238,9 @@ private function processNodeData(array $nodeDataRow): void
/**
- * @param NodePath $nodePath
* @param OriginDimensionSpacePoint $originDimensionSpacePoint
* @param NodeAggregateId $nodeAggregateId
- * @param array $nodeDataRow
+ * @param array $nodeDataRow
* @return NodeName[]|void
* @throws \JsonException
*/
@@ -246,17 +254,26 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $
}
$pathParts = $nodePath->getParts();
$nodeName = end($pathParts);
+ assert($nodeName !== false);
$nodeTypeName = NodeTypeName::fromString($nodeDataRow['nodetype']);
- $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName);
- $serializedPropertyValuesAndReferences = $this->extractPropertyValuesAndReferences($nodeDataRow, $nodeType);
+
+ $nodeType = $this->nodeTypeManager->hasNodeType($nodeTypeName) ? $this->nodeTypeManager->getNodeType($nodeTypeName) : null;
$isSiteNode = $nodeDataRow['parentpath'] === '/sites';
- if ($isSiteNode && !$nodeType->isOfType(NodeTypeNameFactory::NAME_SITE)) {
+ if ($isSiteNode && !$nodeType?->isOfType(NodeTypeNameFactory::NAME_SITE)) {
throw new MigrationException(sprintf(
'The site node "%s" (type: "%s") must be of type "%s"', $nodeDataRow['identifier'], $nodeTypeName->value, NodeTypeNameFactory::NAME_SITE
), 1695801620);
}
+ if (!$nodeType) {
+ $this->dispatch(Severity::ERROR, 'The node type "%s" is not available. Node: "%s"', $nodeTypeName->value, $nodeDataRow['identifier']);
+ return;
+ }
+
+ $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName);
+ $serializedPropertyValuesAndReferences = $this->extractPropertyValuesAndReferences($nodeDataRow, $nodeType);
+
if ($this->isAutoCreatedChildNode($parentNodeAggregate->nodeTypeName, $nodeName) && !$this->visitedNodes->containsNodeAggregate($nodeAggregateId)) {
// Create tethered node if the node was not found before.
// If the node was already visited, we want to create a node variant (and keep the tethering status)
@@ -280,6 +297,9 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $
$this->visitedNodes->add($nodeAggregateId, new DimensionSpacePointSet([$originDimensionSpacePoint->toDimensionSpacePoint()]), $nodeTypeName, $nodePath, $parentNodeAggregate->nodeAggregateId);
}
+ /**
+ * @param array $nodeDataRow
+ */
public function extractPropertyValuesAndReferences(array $nodeDataRow, NodeType $nodeType): SerializedPropertyValuesAndReferences
{
$properties = [];
@@ -375,7 +395,10 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen
// When we specialize/generalize, we create a node variant at exactly the same tree location as the source node
// If the parent node aggregate id differs, we need to move the just created variant to the new location
$nodeAggregate = $this->visitedNodes->getByNodeAggregateId($nodeAggregateId);
- if (!$parentNodeAggregate->nodeAggregateId->equals($nodeAggregate->getVariant($variantSourceOriginDimensionSpacePoint)->parentNodeAggregateId)) {
+ if (
+ $variantSourceOriginDimensionSpacePoint &&
+ !$parentNodeAggregate->nodeAggregateId->equals($nodeAggregate->getVariant($variantSourceOriginDimensionSpacePoint)->parentNodeAggregateId)
+ ) {
$this->exportEvent(new NodeAggregateWasMoved(
$this->contentStreamId,
$nodeAggregateId,
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php
index 53b87836684..0054ab25685 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php
+++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php
@@ -1,15 +1,13 @@
initializeFlow();
- }
- $this->objectManager = self::$bootstrap->getObjectManager();
- $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class);
+ self::bootstrapFlow();
+ $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class);
$this->mockFilesystemAdapter = new InMemoryFilesystemAdapter();
$this->mockFilesystem = new Filesystem($this->mockFilesystemAdapter);
@@ -120,7 +115,7 @@ public function iHaveTheFollowingNodeDataRows(TableNode $nodeDataRows): void
public function iRunTheEventMigration(string $contentStream = null): void
{
$nodeTypeManager = $this->currentContentRepository->getNodeTypeManager();
- $propertyMapper = $this->getObjectManager()->get(PropertyMapper::class);
+ $propertyMapper = $this->getObject(PropertyMapper::class);
$contentGraph = $this->currentContentRepository->getContentGraph();
$nodeFactory = (new \ReflectionClass($contentGraph))
->getProperty('nodeFactory')
@@ -130,7 +125,7 @@ public function iRunTheEventMigration(string $contentStream = null): void
->getValue($nodeFactory);
$interDimensionalVariationGraph = $this->currentContentRepository->getVariationGraph();
- $eventNormalizer = $this->getObjectManager()->get(EventNormalizer::class);
+ $eventNormalizer = $this->getObject(EventNormalizer::class);
$migration = new NodeDataToEventsProcessor(
$nodeTypeManager,
$propertyMapper,
@@ -193,7 +188,7 @@ public function iExpectTheFollowingEventsToBeExported(TableNode $table): void
*/
public function iExpectTheFollwingErrorsToBeLogged(TableNode $table): void
{
- Assert::assertSame($this->loggedErrors, $table->getColumn(0), 'Expected logged errors do not match');
+ Assert::assertSame($table->getColumn(0), $this->loggedErrors, 'Expected logged errors do not match');
$this->loggedErrors = [];
}
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature
index bc5cf9671ea..f4ca3e07455 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature
+++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Assets.feature
@@ -7,7 +7,6 @@ Feature: Export of used Assets, Image Variants and Persistent Resources
| language | en | en, de, ch | ch->de |
And using the following node types:
"""yaml
- 'unstructured': {}
'Neos.Neos:Site': {}
'Some.Package:Homepage':
superTypes:
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature
index 3623e2fe61a..a1dea4af085 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature
+++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Basic.feature
@@ -5,7 +5,6 @@ Feature: Simple migrations without content dimensions
Given using no content dimensions
And using the following node types:
"""yaml
- 'unstructured': {}
'Neos.Neos:Site': {}
'Some.Package:Homepage':
superTypes:
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature
index 4cf57e96a4c..5058e8674d6 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature
+++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Errors.feature
@@ -5,7 +5,6 @@ Feature: Exceptional cases during migrations
Given using no content dimensions
And using the following node types:
"""yaml
- 'unstructured': {}
'Neos.Neos:Site': {}
'Some.Package:Homepage':
superTypes:
@@ -101,11 +100,11 @@ Feature: Exceptional cases during migrations
When I have the following node data rows:
| Identifier | Path | Properties | Node Type |
| sites | /sites | | |
- | a | /sites/a | not json | Some.Package:SomeNodeType |
+ | a | /sites/a | not json | Some.Package:Homepage |
And I run the event migration
Then I expect a MigrationError with the message
"""
- Failed to decode properties "not json" of node "a" (type: "Some.Package:SomeNodeType"): Could not convert database value "not json" to Doctrine Type flow_json_array
+ Failed to decode properties "not json" of node "a" (type: "Some.Package:Homepage"): Could not convert database value "not json" to Doctrine Type flow_json_array
"""
Scenario: Node variants with the same dimension
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature
index 7c67812eb50..52e659f6017 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature
+++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/References.feature
@@ -5,7 +5,6 @@ Feature: Migrations that contain nodes with "reference" or "references propertie
Given using no content dimensions
And using the following node types:
"""yaml
- 'unstructured': {}
'Neos.Neos:Site': {}
'Some.Package:Homepage':
superTypes:
diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature
index e6285a44323..40ff8fca40a 100644
--- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature
+++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Features/Variants.feature
@@ -7,11 +7,11 @@ Feature: Migrating nodes with content dimensions
| language | en | en, de, ch | ch->de |
And using the following node types:
"""yaml
- 'unstructured': {}
'Neos.Neos:Site': {}
'Some.Package:Homepage':
superTypes:
'Neos.Neos:Site': true
+ 'Some.Package:Thing': {}
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
@@ -67,10 +67,10 @@ Feature: Migrating nodes with content dimensions
| Identifier | Path | Node Type | Dimension Values |
| sites | /sites | unstructured | |
| site | /sites/site | Some.Package:Homepage | {"language": ["de"]} |
- | a | /sites/site/a | unstructured | {"language": ["de"]} |
- | a1 | /sites/site/a/a1 | unstructured | {"language": ["de"]} |
- | b | /sites/site/b | unstructured | {"language": ["de"]} |
- | a1 | /sites/site/b/a1 | unstructured | {"language": ["ch"]} |
+ | a | /sites/site/a | Some.Package:Thing | {"language": ["de"]} |
+ | a1 | /sites/site/a/a1 | Some.Package:Thing | {"language": ["de"]} |
+ | b | /sites/site/b | Some.Package:Thing | {"language": ["de"]} |
+ | a1 | /sites/site/b/a1 | Some.Package:Thing | {"language": ["ch"]} |
And I run the event migration
Then I expect the following events to be exported
| Type | Payload |
@@ -88,11 +88,11 @@ Feature: Migrating nodes with content dimensions
| Identifier | Path | Node Type | Dimension Values |
| sites | /sites | unstructured | |
| site | /sites/site | Some.Package:Homepage | {"language": ["de"]} |
- | a | /sites/site/a | unstructured | {"language": ["de"]} |
- | a1 | /sites/site/a/a1 | unstructured | {"language": ["de"]} |
- | b | /sites/site/b | unstructured | {"language": ["de"]} |
- | a | /sites/site/b/a | unstructured | {"language": ["ch"]} |
- | a1 | /sites/site/b/a/a1 | unstructured | {"language": ["ch"]} |
+ | a | /sites/site/a | Some.Package:Thing | {"language": ["de"]} |
+ | a1 | /sites/site/a/a1 | Some.Package:Thing | {"language": ["de"]} |
+ | b | /sites/site/b | Some.Package:Thing | {"language": ["de"]} |
+ | a | /sites/site/b/a | Some.Package:Thing | {"language": ["ch"]} |
+ | a1 | /sites/site/b/a/a1 | Some.Package:Thing | {"language": ["ch"]} |
And I run the event migration
Then I expect the following events to be exported
| Type | Payload |
diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php
index 2310ee2d59f..d0677eb075c 100644
--- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php
+++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsOperation.php
@@ -11,6 +11,10 @@
* source code.
*/
+use Neos\ContentRepository\Core\NodeType\NodeTypeNames;
+use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter;
+use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes;
+use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Annotations as Flow;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
@@ -65,26 +69,25 @@ public function canEvaluate($context)
*/
public function evaluate(FlowQuery $flowQuery, array $arguments)
{
- $parents = [];
+ $parents = Nodes::createEmpty();
+ $findAncestorNodesFilter = FindAncestorNodesFilter::create(
+ NodeTypeConstraints::createWithDisallowedNodeTypeNames(
+ NodeTypeNames::fromStringArray(['Neos.ContentRepository:Root'])
+ )
+ );
+
/* @var Node $contextNode */
foreach ($flowQuery->getContext() as $contextNode) {
- $node = $contextNode;
- do {
- $node = $this->contentRepositoryRegistry->subgraphForNode($node)
- ->findParentNode($node->nodeAggregateId);
- if ($node === null) {
- // no parent found
- break;
- }
- // stop at sites
- if ($node->nodeTypeName === NodeTypeName::fromString('Neos.Neos:Sites')) {
- break;
- }
- $parents[] = $node;
- } while (true);
+ $ancestorNodes = $this->contentRepositoryRegistry
+ ->subgraphForNode($contextNode)
+ ->findAncestorNodes(
+ $contextNode->nodeAggregateId,
+ $findAncestorNodesFilter
+ );
+ $parents = $parents->merge($ancestorNodes);
}
- $flowQuery->setContext($parents);
+ $flowQuery->setContext(iterator_to_array($parents));
if (isset($arguments[0]) && !empty($arguments[0])) {
$flowQuery->pushOperation('filter', $arguments);
diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php
index 127a0244727..dc3701cdda4 100644
--- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php
+++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php
@@ -110,7 +110,11 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): mixed
return ObjectAccess::getPropertyPath($element, substr($propertyName, 1));
}
- if ($element->nodeType->getPropertyType($propertyName) === 'reference') {
+ $propertyType = $element->nodeType->hasProperty($propertyName)
+ ? $element->nodeType->getPropertyType($propertyName)
+ : null;
+
+ if ($propertyType === 'reference') {
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($element);
return (
$subgraph->findReferences(
@@ -120,7 +124,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): mixed
)?->node;
}
- if ($element->nodeType->getPropertyType($propertyName) === 'references') {
+ if ($propertyType === 'references') {
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($element);
return $subgraph->findReferences(
$element->nodeAggregateId,
diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php
index 08af46c972a..2219f0b5210 100644
--- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php
+++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DimensionAdjustment.php
@@ -6,26 +6,32 @@
use Neos\ContentRepository\Core\DimensionSpace\InterDimensionalVariationGraph;
use Neos\ContentRepository\Core\DimensionSpace\VariantType;
+use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
+use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFoundException;
class DimensionAdjustment
{
- protected ProjectedNodeIterator $projectedNodeIterator;
- protected InterDimensionalVariationGraph $interDimensionalVariationGraph;
-
public function __construct(
- ProjectedNodeIterator $projectedNodeIterator,
- InterDimensionalVariationGraph $interDimensionalVariationGraph
+ protected ProjectedNodeIterator $projectedNodeIterator,
+ protected InterDimensionalVariationGraph $interDimensionalVariationGraph,
+ protected NodeTypeManager $nodeTypeManager,
) {
- $this->projectedNodeIterator = $projectedNodeIterator;
- $this->interDimensionalVariationGraph = $interDimensionalVariationGraph;
}
/**
- * @return \Generator
+ * @return iterable
*/
- public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generator
+ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): iterable
{
+ try {
+ $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName);
+ } catch (NodeTypeNotFoundException) {
+ return [];
+ }
+ if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) {
+ return [];
+ }
foreach ($this->projectedNodeIterator->nodeAggregatesOfType($nodeTypeName) as $nodeAggregate) {
foreach ($nodeAggregate->getNodes() as $node) {
foreach (
diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php
index d19b762ace8..1111146fc21 100644
--- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php
+++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php
@@ -67,7 +67,8 @@ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generat
if ($parentNode !== null) {
if ($this->nodeTypeManager->hasNodeType($parentNode->nodeTypeName)) {
$parentNodeType = $this->nodeTypeManager->getNodeType($parentNode->nodeTypeName);
- $allowedByParent = $parentNodeType->allowsChildNodeType($nodeType);
+ $allowedByParent = $parentNodeType->allowsChildNodeType($nodeType)
+ || $nodeAggregate->nodeName && $parentNodeType->hasTetheredNode($nodeAggregate->nodeName);
}
}
diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php
index d532e0232fc..b2ba0668007 100644
--- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php
+++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/StructureAdjustment.php
@@ -4,8 +4,11 @@
namespace Neos\ContentRepository\StructureAdjustment\Adjustment;
+use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate;
+use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
+use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\Error\Messages\Message;
final class StructureAdjustment extends Message
@@ -41,8 +44,10 @@ private function __construct(
$this->type = $type;
}
- public static function createForNode(
- Node $node,
+ public static function createForNodeIdentity(
+ ContentStreamId $contentStreamId,
+ OriginDimensionSpacePoint $originDimensionSpacePoint,
+ NodeAggregateId $nodeAggregateId,
string $type,
string $errorMessage,
?\Closure $remediation = null
@@ -52,9 +57,9 @@ public static function createForNode(
. ($remediation ? '' : '!!!NOT AUTO-FIXABLE YET!!! ') . $errorMessage,
null,
[
- 'contentStream' => $node->subgraphIdentity->contentStreamId->value,
- 'dimensionSpacePoint' => $node->originDimensionSpacePoint->toJson(),
- 'nodeAggregateId' => $node->nodeAggregateId->value,
+ 'contentStream' => $contentStreamId->value,
+ 'dimensionSpacePoint' => $originDimensionSpacePoint->toJson(),
+ 'nodeAggregateId' => $nodeAggregateId->value,
'isAutoFixable' => ($remediation !== null)
],
$type,
@@ -62,6 +67,22 @@ public static function createForNode(
);
}
+ public static function createForNode(
+ Node $node,
+ string $type,
+ string $errorMessage,
+ ?\Closure $remediation = null
+ ): self {
+ return self::createForNodeIdentity(
+ $node->subgraphIdentity->contentStreamId,
+ $node->originDimensionSpacePoint,
+ $node->nodeAggregateId,
+ $type,
+ $errorMessage,
+ $remediation
+ );
+ }
+
public static function createForNodeAggregate(
NodeAggregate $nodeAggregate,
string $type,
diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php
index 994672b390e..45ad49d7129 100644
--- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php
+++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php
@@ -11,6 +11,7 @@
use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMappings;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate;
+use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved;
use Neos\ContentRepository\Core\Feature\Common\TetheredNodeInternals;
@@ -51,46 +52,52 @@ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generat
// In case we cannot find the expected tethered nodes, this fix cannot do anything.
return;
}
- $expectedTetheredNodes = $this->nodeTypeManager->getTetheredNodesConfigurationForNodeType($this->nodeTypeManager->getNodeType($nodeTypeName));
+ $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName);
+ $expectedTetheredNodes = $this->nodeTypeManager->getTetheredNodesConfigurationForNodeType($nodeType);
foreach ($this->projectedNodeIterator->nodeAggregatesOfType($nodeTypeName) as $nodeAggregate) {
// find missing tethered nodes
$foundMissingOrDisallowedTetheredNodes = false;
- foreach ($nodeAggregate->getNodes() as $node) {
- assert($node instanceof Node);
+ $originDimensionSpacePoints = $nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)
+ ? DimensionSpace\OriginDimensionSpacePointSet::fromDimensionSpacePointSet(
+ DimensionSpace\DimensionSpacePointSet::fromArray($this->getInterDimensionalVariationGraph()->getRootGeneralizations())
+ )
+ : $nodeAggregate->occupiedDimensionSpacePoints;
+
+ foreach ($originDimensionSpacePoints as $originDimensionSpacePoint) {
foreach ($expectedTetheredNodes as $tetheredNodeName => $expectedTetheredNodeType) {
$tetheredNodeName = NodeName::fromString($tetheredNodeName);
$subgraph = $this->contentRepository->getContentGraph()->getSubgraph(
- $node->subgraphIdentity->contentStreamId,
- $node->originDimensionSpacePoint->toDimensionSpacePoint(),
+ $nodeAggregate->contentStreamId,
+ $originDimensionSpacePoint->toDimensionSpacePoint(),
VisibilityConstraints::withoutRestrictions()
);
$tetheredNode = $subgraph->findChildNodeConnectedThroughEdgeName(
- $node->nodeAggregateId,
+ $nodeAggregate->nodeAggregateId,
$tetheredNodeName
);
if ($tetheredNode === null) {
$foundMissingOrDisallowedTetheredNodes = true;
// $nestedNode not found
// - so a tethered node is missing in the OriginDimensionSpacePoint of the $node
- yield StructureAdjustment::createForNode(
- $node,
+ yield StructureAdjustment::createForNodeIdentity(
+ $nodeAggregate->contentStreamId,
+ $originDimensionSpacePoint,
+ $nodeAggregate->nodeAggregateId,
StructureAdjustment::TETHERED_NODE_MISSING,
'The tethered child node "' . $tetheredNodeName->value . '" is missing.',
- function () use ($nodeAggregate, $node, $tetheredNodeName, $expectedTetheredNodeType) {
+ function () use ($nodeAggregate, $originDimensionSpacePoint, $tetheredNodeName, $expectedTetheredNodeType) {
$events = $this->createEventsForMissingTetheredNode(
$nodeAggregate,
- $node,
+ $originDimensionSpacePoint,
$tetheredNodeName,
null,
$expectedTetheredNodeType,
$this->contentRepository
);
- $streamName = ContentStreamEventStreamName::fromContentStreamId(
- $node->subgraphIdentity->contentStreamId
- );
+ $streamName = ContentStreamEventStreamName::fromContentStreamId($nodeAggregate->contentStreamId);
return new EventsToPublish(
$streamName->getEventStreamName(),
$events,
@@ -128,14 +135,13 @@ function () use ($tetheredNodeAggregate) {
// find wrongly ordered tethered nodes
if ($foundMissingOrDisallowedTetheredNodes === false) {
- foreach ($nodeAggregate->getNodes() as $node) {
- assert($node instanceof Node);
+ foreach ($originDimensionSpacePoints as $originDimensionSpacePoint) {
$subgraph = $this->contentRepository->getContentGraph()->getSubgraph(
- $node->subgraphIdentity->contentStreamId,
- $node->originDimensionSpacePoint->toDimensionSpacePoint(),
+ $nodeAggregate->contentStreamId,
+ $originDimensionSpacePoint->toDimensionSpacePoint(),
VisibilityConstraints::withoutRestrictions()
);
- $childNodes = $subgraph->findChildNodes($node->nodeAggregateId, FindChildNodesFilter::create());
+ $childNodes = $subgraph->findChildNodes($nodeAggregate->nodeAggregateId, FindChildNodesFilter::create());
/** is indexed by node name, and the value is the tethered node itself */
$actualTetheredChildNodes = [];
@@ -147,21 +153,22 @@ function () use ($tetheredNodeAggregate) {
if (array_keys($actualTetheredChildNodes) !== array_keys($expectedTetheredNodes)) {
// we need to re-order: We go from the last to the first
- yield StructureAdjustment::createForNode(
- $node,
+ yield StructureAdjustment::createForNodeIdentity(
+ $nodeAggregate->contentStreamId,
+ $originDimensionSpacePoint,
+ $nodeAggregate->nodeAggregateId,
StructureAdjustment::TETHERED_NODE_WRONGLY_ORDERED,
'Tethered nodes wrongly ordered, expected: '
. implode(', ', array_keys($expectedTetheredNodes))
. ' - actual: '
. implode(', ', array_keys($actualTetheredChildNodes)),
- function () use ($node, $actualTetheredChildNodes, $expectedTetheredNodes) {
- return $this->reorderNodes(
- $node->subgraphIdentity->contentStreamId,
- $node,
- $actualTetheredChildNodes,
- array_keys($expectedTetheredNodes)
- );
- }
+ fn () => $this->reorderNodes(
+ $nodeAggregate->contentStreamId,
+ $nodeAggregate->nodeAggregateId,
+ $originDimensionSpacePoint,
+ $actualTetheredChildNodes,
+ array_keys($expectedTetheredNodes)
+ )
);
}
}
@@ -210,7 +217,8 @@ protected function getInterDimensionalVariationGraph(): DimensionSpace\InterDime
*/
private function reorderNodes(
ContentStreamId $contentStreamId,
- Node $parentNode,
+ NodeAggregateId $parentNodeAggregateId,
+ DimensionSpace\OriginDimensionSpacePoint $originDimensionSpacePoint,
array $actualTetheredChildNodes,
array $expectedNodeOrdering
): EventsToPublish {
@@ -240,8 +248,8 @@ private function reorderNodes(
$succeedingNode->nodeAggregateId,
$succeedingNode->originDimensionSpacePoint,
// we only change the order, not the parent -> so we can simply use the parent here.
- $parentNode->nodeAggregateId,
- $parentNode->originDimensionSpacePoint
+ $parentNodeAggregateId,
+ $originDimensionSpacePoint
)
)
)
diff --git a/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php b/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php
index a6fe7ec2018..f816d330232 100644
--- a/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php
+++ b/Neos.ContentRepository.StructureAdjustment/src/StructureAdjustmentService.php
@@ -60,7 +60,8 @@ public function __construct(
);
$this->dimensionAdjustment = new DimensionAdjustment(
$projectedNodeIterator,
- $interDimensionalVariationGraph
+ $interDimensionalVariationGraph,
+ $nodeTypeManager
);
}
diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php
index 9d7eb8ee253..41f04d7afff 100644
--- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php
+++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php
@@ -64,6 +64,9 @@ public function theCommandCreateRootNodeAggregateWithNodeIsExecutedWithPayload(T
$nodeAggregateId,
NodeTypeName::fromString($commandArguments['nodeTypeName']),
);
+ if (isset($commandArguments['tetheredDescendantNodeAggregateIds'])) {
+ $command = $command->withTetheredDescendantNodeAggregateIds(NodeAggregateIdsByNodePaths::fromArray($commandArguments['tetheredDescendantNodeAggregateIds']));
+ }
$this->lastCommandOrEventResult = $this->currentContentRepository->handle($command);
$this->currentRootNodeAggregateId = $nodeAggregateId;
diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php
index 3f9deb68f63..d43d4b26628 100644
--- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php
+++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php
@@ -66,7 +66,7 @@ public function theCommandSetNodeReferencesIsExecutedWithPayload(TableNode $payl
)
);
- $command = new SetNodeReferences(
+ $command = SetNodeReferences::create(
$contentStreamId,
NodeAggregateId::fromString($commandArguments['sourceNodeAggregateId']),
$sourceOriginDimensionSpacePoint,
diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php
index 9de587eb916..bae8d6d1163 100644
--- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php
+++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php
@@ -15,10 +15,11 @@
namespace Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features;
use Behat\Gherkin\Node\TableNode;
-use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface;
+use Neos\ContentRepository\Core\Feature\NodeRenaming\Command\ChangeNodeAggregateName;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
+use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
+use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteRuntimeVariables;
-use Neos\EventStore\Model\Event\StreamName;
use PHPUnit\Framework\Assert;
/**
@@ -28,6 +29,41 @@ trait NodeRenaming
{
use CRTestSuiteRuntimeVariables;
+ /**
+ * @Given /^the command ChangeNodeAggregateName is executed with payload:$/
+ * @param TableNode $payloadTable
+ * @throws \Exception
+ */
+ public function theCommandChangeNodeAggregateNameIsExecutedWithPayload(TableNode $payloadTable)
+ {
+ $commandArguments = $this->readPayloadTable($payloadTable);
+ $contentStreamId = isset($commandArguments['contentStreamId'])
+ ? ContentStreamId::fromString($commandArguments['contentStreamId'])
+ : $this->currentContentStreamId;
+
+ $command = ChangeNodeAggregateName::create(
+ $contentStreamId,
+ NodeAggregateId::fromString($commandArguments['nodeAggregateId']),
+ NodeName::fromString($commandArguments['newNodeName']),
+ );
+
+ $this->lastCommandOrEventResult = $this->currentContentRepository->handle($command);
+ }
+
+ /**
+ * @Given /^the command ChangeNodeAggregateName is executed with payload and exceptions are caught:$/
+ * @param TableNode $payloadTable
+ * @throws \Exception
+ */
+ public function theCommandChangeNodeAggregateNameIsExecutedWithPayloadAndExceptionsAreCaught(TableNode $payloadTable)
+ {
+ try {
+ $this->theCommandChangeNodeAggregateNameIsExecutedWithPayload($payloadTable);
+ } catch (\Exception $exception) {
+ $this->lastCommandException = $exception;
+ }
+ }
+
/**
* @Then /^I expect the node "([^"]*)" to have the name "([^"]*)"$/
* @param string $nodeAggregateId
diff --git a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php
index ecf9d8f3160..170db769f12 100644
--- a/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php
+++ b/Neos.ContentRepository.TestSuite/Classes/Unit/NodeSubjectProvider.php
@@ -90,15 +90,15 @@ public function createMinimalNodeOfType(
);
}
$serializedDefaultPropertyValues = SerializedPropertyValues::fromArray($defaultPropertyValues);
- return new Node(
+ return Node::create(
ContentSubgraphIdentity::create(
ContentRepositoryId::fromString('default'),
ContentStreamId::fromString('cs-id'),
- DimensionSpacePoint::fromArray([]),
+ DimensionSpacePoint::createWithoutDimensions(),
VisibilityConstraints::withoutRestrictions()
),
NodeAggregateId::create(),
- OriginDimensionSpacePoint::fromArray([]),
+ OriginDimensionSpacePoint::createWithoutDimensions(),
NodeAggregateClassification::CLASSIFICATION_REGULAR,
$nodeType->name,
$nodeType,
diff --git a/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php b/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php
index b65af14b832..fd1779fdc61 100644
--- a/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php
+++ b/Neos.ContentRepositoryRegistry/Classes/TestSuite/Behavior/CRRegistrySubjectProvider.php
@@ -15,7 +15,6 @@
namespace Neos\ContentRepositoryRegistry\TestSuite\Behavior;
use Doctrine\DBAL\Connection;
-use Neos\Behat\Tests\Behat\FlowContextTrait;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\Factory\ContentRepositoryId;
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceFactoryInterface;
@@ -24,15 +23,11 @@
use Neos\ContentRepositoryRegistry\Exception\ContentRepositoryNotFoundException;
use Neos\EventStore\EventStoreInterface;
-require_once(__DIR__ . '/../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php');
-
/**
* The node creation trait for behavioral tests
*/
trait CRRegistrySubjectProvider
{
- use FlowContextTrait;
-
protected ContentRepositoryRegistry $contentRepositoryRegistry;
protected ?ContentRepository $currentContentRepository = null;
@@ -42,13 +37,17 @@ trait CRRegistrySubjectProvider
*/
protected array $alreadySetUpContentRepositories = [];
+ /**
+ * @template T of object
+ * @param class-string $className
+ *
+ * @return T
+ */
+ abstract protected function getObject(string $className): object;
+
protected function setUpCRRegistry(): void
{
- if (self::$bootstrap === null) {
- self::$bootstrap = $this->initializeFlow();
- }
- $this->objectManager = self::$bootstrap->getObjectManager();
- $this->contentRepositoryRegistry = $this->objectManager->get(ContentRepositoryRegistry::class);
+ $this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class);
}
/**
diff --git a/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php b/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php
index 5bb60261058..8a02bf5962b 100644
--- a/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php
+++ b/Neos.Fusion/Classes/FusionObjects/ComponentImplementation.php
@@ -92,8 +92,10 @@ protected function getPrivateProps(array $context): \ArrayAccess
protected function render(array $context)
{
$this->runtime->pushContextArray($context);
- $result = $this->runtime->render($this->path . '/renderer');
- $this->runtime->popContext();
- return $result;
+ try {
+ return $this->runtime->render($this->path . '/renderer');
+ } finally {
+ $this->runtime->popContext();
+ }
}
}
diff --git a/Neos.Fusion/Classes/Service/RenderAttributesTrait.php b/Neos.Fusion/Classes/Service/RenderAttributesTrait.php
index 9063bb17ed5..ca6af143c16 100644
--- a/Neos.Fusion/Classes/Service/RenderAttributesTrait.php
+++ b/Neos.Fusion/Classes/Service/RenderAttributesTrait.php
@@ -42,6 +42,8 @@ protected function renderAttributes(iterable $attributes, bool $allowEmpty = tru
foreach ($attributeValue as $attributeValuePart) {
if ($attributeValuePart instanceof \Stringable) {
$attributeValuePart = $attributeValuePart->__toString();
+ } elseif ($attributeValuePart instanceof \BackedEnum) {
+ $attributeValuePart = $attributeValuePart->value;
}
$joinedAttributeValue .= match (gettype($attributeValuePart)) {
'boolean', 'NULL' => '',
@@ -50,6 +52,10 @@ protected function renderAttributes(iterable $attributes, bool $allowEmpty = tru
};
}
$attributeValue = trim($joinedAttributeValue);
+ } elseif ($attributeValue instanceof \Stringable) {
+ $attributeValue = $attributeValue->__toString();
+ } elseif ($attributeValue instanceof \BackedEnum) {
+ $attributeValue = $attributeValue->value;
}
$encodedAttributeName = htmlspecialchars((string)$attributeName, ENT_COMPAT, 'UTF-8', false);
if ($attributeValue === true || $attributeValue === '') {
diff --git a/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php b/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php
index 511868cc4af..29133108fb5 100644
--- a/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php
+++ b/Neos.Fusion/Classes/ViewHelpers/FusionContextTrait.php
@@ -33,18 +33,19 @@ trait FusionContextTrait
*/
protected function getContextVariable($variableName)
{
- $value = null;
-
$view = $this->viewHelperVariableContainer->getView();
if ($view instanceof FusionAwareViewInterface) {
$fusionObject = $view->getFusionObject();
$currentContext = $fusionObject->getRuntime()->getCurrentContext();
if (isset($currentContext[$variableName])) {
- $value = $currentContext[$variableName];
+ return $currentContext[$variableName];
+ }
+ $fusionGlobals = $fusionObject->getRuntime()->fusionGlobals;
+ if ($fusionGlobals->has($variableName)) {
+ return $fusionGlobals->get($variableName);
}
}
-
- return $value;
+ return null;
}
/**
diff --git a/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php b/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php
index 820b2d7afe5..c2befa76c02 100644
--- a/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php
+++ b/Neos.Fusion/Tests/Unit/Service/HtmlAugmenterTest.php
@@ -47,9 +47,14 @@ public function __toString() {
return "casted value";
}
}
+ enum BackedStringEnum: string {
+ case Example = "enum value";
+ }
');
+
/** @noinspection PhpUndefinedClassInspection */
$mockObject = new \ClassWithToStringMethod();
+ $mockEnum = \BackedStringEnum::Example;
return [
// object values with __toString method
@@ -61,7 +66,15 @@ public function __toString() {
'allowEmpty' => true,
'expectedResult' => ''
],
-
+ // object values with BackendEnum value
+ [
+ 'html' => '',
+ 'attributes' => ['enum' => $mockEnum],
+ 'fallbackTagName' => null,
+ 'exclusiveAttributes' => null,
+ 'allowEmpty' => true,
+ 'expectedResult' => ''
+ ],
// empty source
[
'html' => '',
@@ -344,6 +357,23 @@ public function __toString() {
'allowEmpty' => false,
'expectedResult' => '