[oXygen-sdk] Check out a resource during Replace All

Oxygen XML Editor Support (Radu Coravu) support at oxygenxml.com
Mon Feb 12 01:53:58 CST 2018


Hi Jeroen,

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.
So this is definitely not OK. I will add an issue on our side.
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()" 
method).
So you should move the file checkout from "aboutToModifyResource" to 
"getOutputStream()".

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 2/9/2018 4:04 PM, Jeroen Laridon wrote:
> Hi,
>
>
>
> We use  "aboutToModifyResource" in "TrisoftBatchOperationsListener" to
> check out a topic in a map before it is modified.
>
> But "aboutToModifyResource" is triggered on all topics in the map, not
> only topics that will be modified.
>
> That way all topics and the map are checked out, while only a few are
> changed.
>
> Expected is that only resources that will change are checked out.
>
>
>
> Is there a way to find out up front if a resource will be changed or not?
>
>
>
> Kind regards,
>
>
>
> Jeroen
>
> *www.sdl.com* <http://www.sdl.com/>
>
> 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.
> ​SDL PLC is a public limited company registered in England and Wales.
> Registered number: 02675207.
> Registered address: SDL PLC, New Globe House, Vanwall Business
> Park, Vanwall Road, Maidenhead, SL6 4UB, U.K.
>
>
>
>
> _______________________________________________
> oXygen-sdk mailing list
> oXygen-sdk at oxygenxml.com
> https://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
>



More information about the oXygen-sdk mailing list