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 :)
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to