<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><div>Hi Radu,<br /><br />The problem is solved for batch "Replace All" operations (Find/Replace in Files...) by overriding the function "getOutputStream".<br /><br />But, when using "Find/Replace..." on a single file, the file is not checked out, and when clicking the button "Replace All", a message "One match replaced" is shown, while nothing changes in the document itself.<br />The read-only flag is set on the file, and the whole content is disabled. When trying to change the document by entering some text, a notification "Read-only content" is shown.<br /><br />How can we check out the document before it is changed by the "Replace All" operation?<br />Or, if it is not possible, can the notification/message "Read-only content" be shown instead of "One match replaced", when the content is read-only?<br /><br />Kind regards,<br /><br />Jeroen<br /><br /><div style="mso-line-height-rule:exactly;-webkit-text-size-adjust:100%;"><table cellpadding="0" cellspacing="0" border="0" style="width:100%;font-size:0;"><tr><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;"><tr><td align="left" style="padding:0 0 15px;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="font-size:0;line-height:normal;"><tr><td align="left" style="vertical-align:top;"><img src="https://www.sdl.com/static/corporate/SDL25y_emailLogo.png" border="0" alt="" style="font-size:0;" /></td></tr><tr><td align="left" style="vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="white-space:nowrap;color:#000001;font-size:14.67px;font-family:Arial;font-weight:400;font-style:normal;text-align:justify;"><tr><td style="font-family:Calibri;"><a href="http://www.sdl.com/" target="_blank" id="LPlnk689713" style="text-decoration:none;color:#000001;"><strong style="font-weight:400;">www.sdl.com</strong></a></td></tr></table></td></tr></table></td></tr><tr><td align="left" style="padding:0;vertical-align:top;"><table cellpadding="0" cellspacing="0" border="0" style="white-space:normal;color:#A1A1A1;font-size:10.67px;font-family:Arial;font-weight:400;font-style:normal;text-align:justify;width:100%;"><tr><td style="font-family:Calibri;">SDL PLC confidential, all rights reserved. If you are not the intended recipient of this mail SDL requests and requires that you delete it without acting upon or copying any of its contents, and we further request that you advise us.<br />SDL PLC is a public limited company registered in England and Wales. Registered number: 02675207. <br />Registered address: <span style="background-color:transparent;">SDL PLC, </span>New Globe House, Vanwall Business Park, Vanwall Road, Maidenhead, SL6 4UB, U.K.<br /></td></tr></table></td></tr></table></td></tr></table></div><span style="font-family:remialcxesans;"> </span>-----Original Message-----<br />From: oXygen-sdk [mailto:oxygen-sdk-bounces@oxygenxml.com] On Behalf Of oxygen-sdk-request@oxygenxml.com<br />Sent: maandag 12 februari 2018 19:00<br />To: oxygen-sdk@oxygenxml.com<br />Subject: oXygen-sdk Digest, Vol 51, Issue 5<br /><br />Send oXygen-sdk mailing list submissions to<br /> oxygen-sdk@oxygenxml.com<br /><br />To subscribe or unsubscribe via the World Wide Web, visit<br /> https://www.oxygenxml.com/mailman/listinfo/oxygen-sdk<br />or, via email, send a message with subject or body 'help' to<br /> oxygen-sdk-request@oxygenxml.com<br /><br />You can reach the person managing the list at<br /> oxygen-sdk-owner@oxygenxml.com<br /><br />When replying, please edit your Subject line so it is more specific than "Re: Contents of oXygen-sdk digest..."<br /><br /><br />Today's Topics:<br /><br /> 1. Re: Check out a resource during Replace All<br /> (Oxygen XML Editor Support (Radu Coravu) )<br /><br /><br />----------------------------------------------------------------------<br /><br />Message: 1<br />Date: Mon, 12 Feb 2018 09:53:58 +0200<br />From: "Oxygen XML Editor Support (Radu Coravu) "<br /> <support@oxygenxml.com><br />To: oxygen-sdk@oxygenxml.com<br />Subject: Re: [oXygen-sdk] Check out a resource during Replace All<br />Message-ID: <b845966d-0486-27bd-f754-d2e24e21ba1d@oxygenxml.com><br />Content-Type: text/plain; charset=utf-8; format=flowed<br /><br />Hi Jeroen,<br /><br />I agree with your findings, indeed somehow I wanted to give this callback before Oxygen actually starts to read the URL's contents, but before Oxygen starts reading the URL's contents it does not know if it will make changes to the contents so right now although the callback is named "aboutToModifyResource(BatchOperationInfo, URL)" we give it for each resource.<br />So this is definitely not OK. I will add an issue on our side.<br />Maybe for now you could detect when Oxygen calls your URL handler's "getOutputStream()" method. This means Oxygen is about to write to the file. If before "getOutputStream()" is called you also had a call of "aboutToModifyResource(BatchOperationInfo, URL)" for the same URL, this means that you need to check out the file (on the "getOutputStream()" <br />method).<br />So you should move the file checkout from "aboutToModifyResource" to "getOutputStream()".<br /><br />Regards,<br />Radu<br /><br />Radu Coravu<br /><oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com<br /><br />On 2/9/2018 4:04 PM, Jeroen Laridon wrote:<br />> Hi,<br />><br />><br />><br />> We use "aboutToModifyResource" in "TrisoftBatchOperationsListener" to <br />> check out a topic in a map before it is modified.<br />><br />> But "aboutToModifyResource" is triggered on all topics in the map, not <br />> only topics that will be modified.<br />><br />> That way all topics and the map are checked out, while only a few are <br />> changed.<br />><br />> Expected is that only resources that will change are checked out.<br />><br />><br />><br />> Is there a way to find out up front if a resource will be changed or not?<br />><br />><br />><br />> Kind regards,<br />><br />><br />><br />> Jeroen<br />><br />> *www.sdl.com* <http://www.sdl.com/><br />><br />> SDL PLC confidential, all rights reserved. If you are not the intended <br />> recipient of this mail SDL requests and requires that you delete it <br />> without acting upon or copying any of its contents, and we further <br />> request that you advise us.<br />> SDL PLC is a public limited company registered in England and Wales.<br />> Registered number: 02675207.<br />> Registered address: SDL PLC, New Globe House, Vanwall Business Park, <br />> Vanwall Road, Maidenhead, SL6 4UB, U.K.<br />><br />><br />><br />><br />> _______________________________________________<br />> oXygen-sdk mailing list<br />> oXygen-sdk@oxygenxml.com<br />> https://www.oxygenxml.com/mailman/listinfo/oxygen-sdk<br />><br /><br /><br />------------------------------<br /><br />Subject: Digest Footer<br /><br />_______________________________________________<br />oXygen-sdk mailing list<br />oXygen-sdk@oxygenxml.com<br />https://www.oxygenxml.com/mailman/listinfo/oxygen-sdk<br /><br /><br />------------------------------<br /><br />End of oXygen-sdk Digest, Vol 51, Issue 5<br />*****************************************<br /></div></body></html>