[MGNLWORKFLOW-293] Support multiple selection items for publishDeletion action Created: 10/Apr/15  Updated: 07/Jul/15  Resolved: 01/Jul/15

Status: Closed
Project: Magnolia Workflow Module
Component/s: None
Affects Version/s: 5.4.5
Fix Version/s: 5.4.7, 5.5

Type: Improvement Priority: Neutral
Reporter: Trang Truong Assignee: Trang Truong
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: 0d
Time Spent: 3d
Original Estimate: 0.25d

Issue Links:
causality
caused by MGNLUI-3307 Inconsistent behavior for selecting d... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

Regarding to issue MGNLUI-3307, when publish deletion action is enabled workflow, we provide ability to publish multiple selected items.



 Comments   
Comment by Trang Truong [ 12/Apr/15 ]

Regards to inconsistent behavior of publishDeletion action, in case of using workflow so that it provides ability to support multiple selection by adding new constructor mapping with addition of List<? extends item> for some actions: OpenPublicationDialogAction, WorkflowFormDialogPresenter, WorkflowPublicationAction.

Comment by Espen Jervidalo [ 30/Apr/15 ]

OpenPublicationDialogAction

  • In OpenPublicationDialogAction(..., Item item, ...)
    You should be able to call the OpenPublicationDialogAction(... , List items, ..) constructor directly with this(.. Arrays.asList(item))
    So you don't have to repeat yourself with assignments.
  • Also the @Inject should go, when you have two constructors declared in the file.

WorkflowFormDialogPresenter
try to reuse the start()-implementation by calling start(..., Arrays.asList(item), ...) - DRY

WorkflowPublicationAction
same same

You should only update the dependencies, when needed. I think you should set UI to SNAPSHOT here and not magnolia_main.
<magnoliaVersion>5.3.8-SNAPSHOT</magnoliaVersion>
<magnoliaUiVersion>5.3.9</magnoliaUiVersion>

Comment by Federico Grilli [ 05/Jun/15 ]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project magnolia-module-workflow: Compilation failure
[ERROR] /Users/fgrilli/devel/workspace/magnolia/ee-modules/workflow/magnolia-module-workflow/src/main/java/info/magnolia/module/workflow/action/WorkflowPublicationAction.java:[53,9] constructor ActivationAction in class info.magnolia.ui.framework.action.ActivationAction<D> cannot be applied to given types;
[ERROR] required: info.magnolia.module.workflow.action.WorkflowPublicationActionDefinition,info.magnolia.ui.vaadin.integration.jcr.JcrItemAdapter,info.magnolia.commands.CommandsManager,info.magnolia.event.EventBus,info.magnolia.ui.api.app.SubAppContext,info.magnolia.i18nsystem.SimpleTranslator
[ERROR] found: info.magnolia.module.workflow.action.WorkflowPublicationActionDefinition,java.util.List<info.magnolia.ui.vaadin.integration.jcr.JcrItemAdapter>,info.magnolia.commands.CommandsManager,info.magnolia.event.EventBus,info.magnolia.ui.api.app.SubAppContext,info.magnolia.i18nsystem.SimpleTranslator
[ERROR] reason: actual argument java.util.List<info.magnolia.ui.vaadin.integration.jcr.JcrItemAdapter> cannot be converted to info.magnolia.ui.vaadin.integration.jcr.JcrItemAdapter by method invocation conversion

I think calling the super class constructor does't work here as ActivationAction hides its parent ctor (AbstractCommandAction) taking a List<JcrItemAdapter>

Comment by Trang Truong [ 08/Jun/15 ]

The error caused by missing interaction with linked issue MGNLUI-3307 which to open
ActivationAction's parent ctor to taking a List<JcrItemAdapter>

Comment by Philip Mundt [ 22/Jun/15 ]

UI test also has to be adjusted to NOT delete existing pages but rather add them in the test.

Comment by Trang Truong [ 22/Jun/15 ]

Fixed on branch origin/MGNLWORKFLOW-293-addToDelete

Comment by Espen Jervidalo [ 25/Jun/15 ]

This does not work. As far as I can tell the UI test should always fail, when it goes back to the browser and checks for the two deleted pages not being there. So far I only debugged it locally.

This is actually a very tricky and big ticket. The implemented part of it is probably right, but as soon as the workflow is launched, only one of the paths of the nodes to-be-deleted is passed. The paths should be passed as a List into the workflow and also be displayed like that into the messageView. There are a lot of problems to be solved to get this working.
info.magnolia.module.workflow.commands.PublicationWorkflowCommand#setPath
info.magnolia.module.workflow.commands.PublicationWorkflowCommand#getWorkflow

I guess the ActivationCommand would have to support multiple paths, similar to how it handles recursive activations.
Apart from that I don't get why we would implement this for deleting pages, but not for activating the pages.

EDIT: This was accidentally integrated by myself :X But it actually works. It just creates x tasks in the pulse for the x pages you want to publish the deletion. I will leave it integrated and close this ticket. I will create a follow-up ticket tho with a broader scope on multi-publication as explained above.

Generated at Mon Feb 12 10:08:39 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.