Track Changes exist in the document
Oxygen general issues.
-
- Posts: 27
- Joined: Tue Nov 17, 2009 10:16 pm
Track Changes exist in the document
Post by guna@ebscohost.com »
Hi,
Is there a way through api call to check, whether the existing xml document contains any tracking changes?
i checked AuthorChangeTrackingController.isTrackingChanges() method, it return true only when i check track changes is enabled in the editor.
Is there a way through api call to check, whether the existing xml document contains any tracking changes?
i checked AuthorChangeTrackingController.isTrackingChanges() method, it return true only when i check track changes is enabled in the editor.
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Track Changes exist in the document
Hi,
The AuthorChangeTrackingController for the moment only contains API to toggle change tracking On and Off (the same action which is available on the toolbar).
There is a workaround which you can use:
Can you give us more details? Are there any more interactions which you want to make with the change tracking system?
Maybe we can improve the API to accommodate them.
Regards,
Radu
The AuthorChangeTrackingController for the moment only contains API to toggle change tracking On and Off (the same action which is available on the toolbar).
There is a workaround which you can use:
Code: Select all
AuthorElement rootElement = authorAccess.getDocumentController().getAuthorDocumentNode().getRootElement();
boolean isTrackChanges = authorAccess.getChangeTrackingController().isTrackingChanges();
if(isTrackChanges){
//Toggle change tracking off so that the created document fragment contains all changes
authorAccess.getChangeTrackingController().toggleTrackChanges();
}
//The document fragment contains all track changes if change tracking is OFF.
AuthorDocumentFragment frag = authorAccess.getDocumentController().createDocumentFragment(rootElement, true);
boolean hasChanges = frag.getChangeMarks() != null && frag.getChangeMarks().size() > 0;
if(isTrackChanges){
//Toggle change tracking on again if this is the case
authorAccess.getChangeTrackingController().toggleTrackChanges();
}
Maybe we can improve the API to accommodate them.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 27
- Joined: Tue Nov 17, 2009 10:16 pm
Re: Track Changes exist in the document
Post by guna@ebscohost.com »
Hi Radu,
the above code dose on work in below mentioned scenario, can you help us to detect track changes in this scenario.
Thanks
Guna
the above code dose on work in below mentioned scenario, can you help us to detect track changes in this scenario.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//EBSCO Publishing//DTD epNLM Editing v1.0//EN" "epnlm-edit.dtd">
<?oxy_insert_start author="CCC" timestamp="20100819T165450-0400"?>
<!--Test -->
<?oxy_insert_end?>
<article article-type="DynaDiseaseSummary" dtd-version="2.3" xml:lang="en">
<front>
</front>
<body>
</body>
</article>
Guna
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Track Changes exist in the document
Hi Guna,
The code I gave you works only for change tracking highlights located inside the root element (the document fragment is created over the root element). As in your case the highlight is outside the root element, the code does not work.
To make the code work also outside the root element you can create the document fragment like:
Regards,
Radu
The code I gave you works only for change tracking highlights located inside the root element (the document fragment is created over the root element). As in your case the highlight is outside the root element, the code does not work.
To make the code work also outside the root element you can create the document fragment like:
Code: Select all
boolean isTrackChanges = authorAccess.getChangeTrackingController().isTrackingChanges();
if(isTrackChanges){
//Toggle change tracking off so that the created document fragment contains all changes
authorAccess.getChangeTrackingController().toggleTrackChanges();
}
//The document fragment contains all track changes if change tracking is OFF.
AuthorDocument doc = authorAccess.getDocumentController().getAuthorDocumentNode();
AuthorDocumentFragment frag = authorAccess.getDocumentController().createDocumentFragment(doc.getStartOffset() + 1, doc.getEndOffset() - 1);
boolean hasChanges = frag.getChangeMarks() != null && frag.getChangeMarks().size() > 0;
if(isTrackChanges){
//Toggle change tracking on again if this is the case
authorAccess.getChangeTrackingController().toggleTrackChanges();
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service