diff --git a/modules/islandora_core_feature/config/install/system.action.version_node_in_fedora.yml b/modules/islandora_core_feature/config/install/system.action.version_node_in_fedora.yml new file mode 100644 index 00000000..cc424410 --- /dev/null +++ b/modules/islandora_core_feature/config/install/system.action.version_node_in_fedora.yml @@ -0,0 +1,15 @@ +langcode: en +status: true +dependencies: + enforced: + module: + - islandora_core_feature + module: + - islandora +id: version_node_in_fedora +label: 'Version Node in Fedora' +type: node +plugin: emit_node_event +configuration: + queue: islandora-indexing-fcrepo-content + event: Version diff --git a/src/EventGenerator/EmitEvent.php b/src/EventGenerator/EmitEvent.php index 2ee5bd55..22d36ff2 100644 --- a/src/EventGenerator/EmitEvent.php +++ b/src/EventGenerator/EmitEvent.php @@ -207,6 +207,7 @@ abstract class EmitEvent extends ConfigurableActionBase implements ContainerFact '#description' => t('Type of event to emit'), '#options' => [ 'Create' => t('Create'), + 'Version' => t('Version'), 'Update' => t('Update'), 'Delete' => t('Delete'), 'Generate Derivative' => t('Generate Derivative'), diff --git a/src/EventGenerator/EventGenerator.php b/src/EventGenerator/EventGenerator.php index a9e4ac66..eccb0d43 100644 --- a/src/EventGenerator/EventGenerator.php +++ b/src/EventGenerator/EventGenerator.php @@ -104,6 +104,11 @@ class EventGenerator implements EventGeneratorInterface { $event["type"] = ucfirst($data["event"]); $event["summary"] = ucfirst($data["event"]) . " a " . ucfirst($entity_type); } + if ($data["event"] == "Update"){ + $event["object"]["createVersion"] = TRUE; + } else { + $event["object"]["createVersion"] = FALSE; + } // Add REST links for non-file entities. if ($entity_type != 'file') { diff --git a/src/Plugin/ContextReaction/VersionReaction.php b/src/Plugin/ContextReaction/VersionReaction.php new file mode 100644 index 00000000..67590955 --- /dev/null +++ b/src/Plugin/ContextReaction/VersionReaction.php @@ -0,0 +1,15 @@ +