3 Jun
2014
3 Jun
'14
2:11 p.m.
Hi Devs, I have a loop in which i add object to all documents under the space "Main", it crashes in the middle of the loop ... ##get all document in the Main space #set($docus = $xwiki.getSpaceDocsName("Main")) #foreach($docu in $docus) #set ($myDoc = $xwiki.getDocument("Main", $docu)) $myDoc.getFullName() ##Add object to the page #set($obj = $myDoc.newObject("Revision.RevisionClass")) $obj.set("approvedRev", $myDoc.getVersion()) ## Save the object in the page $myDoc.getDocument().setMetaDataDirty(false) $myDoc.getDocument().setContentDirty(false) $myDoc.save() #end Stack is attached Please any method to catch the exception and let it go in Velocity Thanks in advance :)