I have a Java bean that represents all of the functionality behind my xpage. When I save the xpage a method is called and I pass in my xpage data source as a DominoDocument object. The problem I have is when it comes to setting the Author and reader fields. I can't get the Item object in order to use "item.setAuthors(true);" with the DominoDocument object so I have to get the Document object instead:
(dDoc = DominoDocument passed into the save method via SSJS call to it)
Document doc = dDoc.getDocument(true);
Vector<String> editors = new Vector<String>();
editors = getUniqueList(dDoc,editors,"AdditionalEditors") ;
Item item = doc.replaceItemValue("Authors", editors);
item.setAuthors(true) ;
doc.save();
The first save of a new document appears to work, however subsequent saves create a new duplicate copy of the current document; the back end change isn't being passed through to the front end document. Is there an alternative way to set an authors/readers field with the dominoDocument object or to wrap the DominoDocument with the changes after calling a save with the backend document. I did try dDoc.restoreWrappedDocument() but that didn't work ether.