I know this may sound weird to some people but it would be very handy for me for debugging during development. I would like to artificially "age" a document in steps of 1 year. It would allow me to do test code which responds to the age of a document. I have made a very simple client side thing to modify the dc:created field of the document. The field is changed but it seems the change never gets persisted to the database since it's goes back to its original value after a short while (some cache expires?).
The code I use to modify the creation date is the following:
public void debugAgeDocument1Year() throws ClientException {
DocumentModel doc;
GregorianCalendar created;
coreSession = navigationContext.getOrCreateDocumentManager();
doc = navigationContext.getCurrentDocument();
created = (GregorianCalendar) doc.getPropertyValue("dc:created");
created.add(GregorianCalendar.YEAR, -1);
doc.setPropertyValue("dc:created", created);
coreSession.saveDocument(doc);
coreSession.save();
}
But the change never gets persistent in the underlying PostgreSQL database. Alternate approches and pointers to relevant documentation would be appreciated.