Changes for page RefactoringRESTXML
Last modified by Thomas Mortagne on 2022/08/08 11:05
From version 1.8
edited by Thomas Mortagne
on 2022/08/08 10:55
on 2022/08/08 10:55
Change comment:
There is no comment for this version
To version 1.9
edited by Thomas Mortagne
on 2022/08/08 10:59
on 2022/08/08 10:59
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -8,8 +8,11 @@ 8 8 var source = new SpaceReference("xwiki", "MyParentPage", "MyPage"); 9 9 var destination = new SpaceReference("xwiki", "MyPageNewLocaltion", "MyPageNewName"); 10 10 var moveRequest = services.component.getInstance(org.xwiki.refactoring.script.RequestFactory.class).createMoveRequest(source, destination) 11 -// By defaultthe request factoryenablechecking theright of thecurrent userand author atthe time ofscript executionbutwedon't carefora REST request11 +// cleanup the request from properties which make sense for a script but are pretty much useless in the case of a REST request 12 12 moveRequest.setCheckRights(false); 13 +moveRequest.removeProperty("checkrights") 14 +moveRequest.removeProperty("user.reference") 15 +moveRequest.removeProperty("caller.reference") 13 13 14 14 // Convert the standard move request into a REST job request 15 15 var restJobRequest = services.component.getInstance(org.xwiki.rest.internal.ModelFactory.class).toRestJobRequest(moveRequest);