I'm executing some code on Save which attaches a PNG file to a document
that was edited/saved.
When I call docObj.saveAttachmentContent(attP, context); the attachment
is save OK but any changes made to my document (ie. text changes) are
not saved.
If I comment out this line the text changes are saved, but off course
not the attachment.
Is this normal behaviour, what do the developers think?
def imgAsBites =
xwiki.getURLContentAsBytes("http://www.websequencediagrams.com/index.p…
"+umlImage, context);
def attP = docObj.getAttachment(filenameToSavaAs);
if(!attP)
{
attP = new
com.xpn.xwiki.doc.XWikiAttachment(docObj,filenameToSavaAs);
docObj.getAttachmentList().add(attP);
println "NO Attach";
}
attP.setContent(imgAsBites);
docObj.saveAttachmentContent(attP, context);
Regards
Ajdin
--------------------------------------------------------
NOTICE
This message and any files transmitted with it is intended for the addressee only and may
contain information that is confidential or privileged. Unauthorised use is strictly
prohibited. If you are not the addressee, you should not read, copy, disclose or otherwise
use this message, except for the purpose of delivery to the addressee.
Any views or opinions expressed within this e-mail are those of the author and do not
necessarily represent those of Coventry University.