Description
The following script can modify the internal of documents without a save. This is not normal as public API should work of cloned data that should be recloned on every page view so no shared data should happen:
{{velocity}}
#set($date1 = $doc.getValue("date1"))
Date: $doc.getValue("date1")
#set($newdate = $date1.getDate() + 1)
Setting new day: $newdate
#set($ok = $date1.setDate($newdate))
New Date after reading $\doc (it should show the same date as before): $doc.getValue("date1")
New Date after re-reading the document using getDocument (it should also show the same): $xwiki.getDocument($doc.fullName).getValue("date1")
The previous data has been displayed using the following script:
{{/velocity}}
I've attached the xar for a demo since this script needs a class and an object