How to Lock a ParagraphUnitSegmentPair inside of a Batch task

I'm using the Batch Task API to create a Segment locker task. Essentially, depending on some context info, the task decides whether to lock a segment pair. So far, everything I've tried to do to lock a segment Pair doesn't show up when I open the file for editing. 

I add a new BilingualContentHandlerAdapter

Screenshot of code in an IDE with a comment suggesting to add a custom bilingual processor to the file converter.

While inside the ProcessParagraphUnit of the SegmentLockerPreProcessor I've tried several approaches:

Screenshot showing a method in an IDE that processes a paragraph unit and sets the IsLocked property to true for segment pairs.

And also with editorController, but in that case, the activeDocument is null

Screenshot of code with a comment indicating that the activeDocument is null when trying to update segment pair properties.

Can this be done inside ProcessParagraphUnit? And how?



Generated Image Alt-Text
[edited by: RWS Community AI at 8:01 AM (GMT 0) on 15 Nov 2024]