[DOCU-2701] Update commands docs Created: 19/Apr/23  Updated: 19/Apr/23  Resolved: 19/Apr/23

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Jonathan Ayala Assignee: Adrian Brooks
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Documentation page URL: https://docs.magnolia-cms.com/product-docs/6.2/Developing/Commands.html#_executing_a_command_in_the_groovy_console

 Description   

In commands docs, the section about executing a command in the groovy console contains 2 examples. Option B is not working anymore since the inclusion of webhook in Magnolia 6.2.22. Therefore, docs should indicate accurately that the script from 6.2.22 onwards should be different.

old
cm = info.magnolia.commands.CommandsManager.getInstance()
command = cm.getCommand('activate')
command.setRepository('website')
command.setPath('/travel/about/careers')
command.setRecursive(true)
command.execute(new info.magnolia.context.SimpleContext())
current
cm = info.magnolia.commands.CommandsManager.getInstance()
commandChain = cm.getCommand('activate'); 
command= commandChain.getCommands().get(0); 
command.setRepository('website')
command.setPath('/travel/about/careers')
command.setRecursive(true)
command.execute(new info.magnolia.context.SimpleContext())

Generated at Mon Feb 12 01:29:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.