Page 1 of 1

Track Changes in applet

Posted: Fri Nov 23, 2012 11:57 am
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?

Re: Track Changes in applet

Posted: Fri Nov 23, 2012 12:02 pm
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

Re: Track Changes in applet

Posted: Fri Nov 23, 2012 12:12 pm
by neon096
Perfect. Thanks for the quick response.

Re: Track Changes in applet

Posted: Fri Nov 23, 2012 3:58 pm
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.

Re: Track Changes in applet

Posted: Fri Nov 23, 2012 4:05 pm
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

Re: Track Changes in applet

Posted: Fri Nov 23, 2012 4:11 pm
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.