Track Changes in applet

Oxygen general issues.
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Track Changes in applet

Post by neon096 »

I'm trying to always track changes whereby the user doesn't know we are tracking (so that when the document is in QA they editors can identify the areas they need to check and possibly modify). I've tried using the following code.

Code: Select all


if (!authorComponent.getAuthorAccess().getReviewController().isTrackingChanges()) {
authorComponent.getAuthorAccess().getReviewController().toggleTrackChanges();
}
authorComponent.getAuthorAccess().getReviewController().getAuthorCalloutsController().setShowDeletionsCallouts(true);
authorComponent.getAuthorAccess().getReviewController().getAuthorCalloutsController().setShowCommentsCallouts(true);
authorComponent.getAuthorAccess().getReviewController().getAuthorCalloutsController().setShowInsertionsCallouts(true);
However when I make a change the XML process instructions are not being put into the XML. Unlike when I use the out of the box actions for example.

Code: Select all


<?oxy_insert_start author="" timestamp="20121123T085253+0000"?>
<para>Entered text here</para>
<?oxy_insert_end?>
What am I missing?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Track Changes in applet

Post by Radu »

Hi Neil,

The change tracking state is stored individually for each edited XML resource.
So the API you are calling (and which is correct) needs to be called each time after you call:

Code: Select all

ro.sync.ecss.extensions.api.component.AuthorComponentProvider.load(URL, Reader)
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Re: Track Changes in applet

Post by neon096 »

Perfect. Thanks for the quick response.
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Re: Track Changes in applet

Post by neon096 »

Is there anyway to not track changes within certain AuthorNodes? I've got a field which is using auto-complete but if the track changes is turned on the auto-complete breaks and the field is left un-editable?

I've got a really nasty way to do it by using AuthorMouseAdapter.mousePressed() events to turn off tracking when the author clicks in this field but I'm unable to stop cursor key presses.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Track Changes in applet

Post by Radu »

Hi Neil,

I'm sorry but I do not understand the auto-complete problem.
Could you send me some sample XML + CSS + a more detailed description of what does not work?
Maybe it's a bug in Oxygen.

You could possibly set a ro.sync.ecss.extensions.api.AuthorDocumentFilter and each time modification events come in certain nodes, disable change tracking using our API, delegate to the default implementation and then enable it back if it was enabled.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Re: Track Changes in applet

Post by neon096 »

The auto complete is when the caret is in an element the auto-complete function is called which provides the user the allowed values.

The problem is that the value in there is deleted and the track changes is marking that up within the processing instructions.

Thanks I'll have a look at the ro.sync.ecss.extensions.api.AuthorDocumentFilter. I have used this before and I think I should be able to get something working with this.
Post Reply