{"comment":{"url":"https://api.github.com/repos/xwiki/xwiki-platform/comments/21931346","html_url":"https://github.com/xwiki/xwiki-platform/commit/20571214f853ae1f271bd9d428e468ab59ef71e0#commitcomment-21931346","id":21931346,"user":{"login":"Enygma2002","id":709298,"avatar_url":"https://avatars2.githubusercontent.com/u/709298?v=3","gravatar_id":"","url":"https://api.github.com/users/Enygma2002","html_url":"https://github.com/Enygma2002","followers_url":"https://api.github.com/users/Enygma2002/followers","following_url":"https://api.github.com/users/Enygma2002/following{/other_user}","gists_url":"https://api.github.com/users/Enygma2002/gists{/gist_id}","starred_url":"https://api.github.com/users/Enygma2002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enygma2002/subscriptions","organizations_url":"https://api.github.com/users/Enygma2002/orgs","repos_url":"https://api.github.com/users/Enygma2002/repos","events_url":"https://api.github.com/users/Enygma2002/events{/privacy}","received_events_url":"https://api.github.com/users/Enygma2002/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"20571214f853ae1f271bd9d428e468ab59ef71e0","created_at":"2017-04-27T11:52:52Z","updated_at":"2017-04-27T11:52:52Z","body":"> > I found it more practical. For example, if you'd want to do it from a velocity script, you can easily access the XWikiContext and set the batchId before calling deleteDocument for a number of references.\r\n>\r\n> That's only if you have programming right so I don't really see this as a feature.\r\n\r\nWDYM by that? The context is accessible from velocity with `$xcontext`, no PR needed. `$doc.delete()` as well, and it will read and use any `BATCH_ID` value set in the xcontext to set it to the recycle bin's deleted document.\r\n\r\n>> How easy is it for a script (velocity, maybe others?) to access and write to the ExecutionContext with the current API?\r\n>\r\n> I don't think there is any generic API for this but you could add a method dedicated to setting the batch id in the refactoring script service if you really need that.\r\n\r\nIndeed, for the `DeleteJob` the value could be read from a JobRequest parameter, but this would not work for documents deleted with the standard (non-refactoring) API (for which an example, again, could be a velocity script).\r\n\r\nThe PROS do sound good indeed. Maybe we should expose some $econtext binding to scripts? Or maybe better yet, why not start the transition with XWikiContext.get/set/remove actually delegating to the ExecutionContext directly?"}}
{"actor":{"display_login":"Enygma2002"}}