Custom extension to DITA Map validation?
Post here questions and problems related to oXygen frameworks/document types.
Custom extension to DITA Map validation?
Hi,
I have custom elements in my DITA framework referencing additional XML files. I'd like to have these validated as well since their content is being integrated into the publication (by a customized coderef). Is there any way for me to extend the validation process through Java?
Thanks and regards,
Patrik
I have custom elements in my DITA framework referencing additional XML files. I'd like to have these validated as well since their content is being integrated into the publication (by a customized coderef). Is there any way for me to extend the validation process through Java?
Thanks and regards,
Patrik
Re: Custom extension to DITA Map validation?
Hi Patrik,
Once a WSEditor is opened in Oxygen you can add a "ValidationProblemsFilter" to it:
https://www.oxygenxml.com/InstData/Edit ... ditor.html
The filter can be used to either add more problems to the problems list or to filter problems that you do not want to present to the end user.
A problem is an instance of https://www.oxygenxml.com/InstData/Edit ... dInfo.html, it has a message, severity and it also needs some kind of line-column location that you will need to figure out on your own.
This filter is called each time automatic validation is done (about 1-2 seconds after each modification is made to the document) so your extra code should not induce too much delay.
A sample Javascript-based plugin implementing a ValidationProblemsFilter can be found here:
https://github.com/oxygenxml/wsaccess-j ... lemsFilter
Regards,
Radu
Once a WSEditor is opened in Oxygen you can add a "ValidationProblemsFilter" to it:
https://www.oxygenxml.com/InstData/Edit ... ditor.html
The filter can be used to either add more problems to the problems list or to filter problems that you do not want to present to the end user.
A problem is an instance of https://www.oxygenxml.com/InstData/Edit ... dInfo.html, it has a message, severity and it also needs some kind of line-column location that you will need to figure out on your own.
This filter is called each time automatic validation is done (about 1-2 seconds after each modification is made to the document) so your extra code should not induce too much delay.
A sample Javascript-based plugin implementing a ValidationProblemsFilter can be found here:
https://github.com/oxygenxml/wsaccess-j ... lemsFilter
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Custom extension to DITA Map validation?
Thanks for the explanation. But I did not mean the automatic validation (although I might add it there as well) but the "Validate and Check for Completeness" in the DITA Maps Manager.
Regards,
Patrik
Regards,
Patrik
Re: Custom extension to DITA Map validation?
Hi Patrik,
The code would look like this:
Regards,
Radu
The code would look like this:
Code: Select all
PluginWorkspaceProvider.getPluginWorkspace().addEditorChangeListener(new WSEditorChangeListener(){
/**
* @see ro.sync.exml.workspace.api.listeners.WSEditorChangeListener#editorOpened(java.net.URL)
*/
@Override
public void editorOpened(URL editorLocation) {
WSEditor ditaMapEditorAccess = PluginWorkspaceProvider.getPluginWorkspace().getEditorAccess(editorLocation, PluginWorkspace.DITA_MAPS_EDITING_AREA);
ditaMapEditorAccess.addValidationProblemsFilter(new ValidationProblemsFilter(){
public void filterValidationProblems(ValidationProblems validationProblems) {
if(validationProblems.getValidationType() == ValidationProblems.VALIDATION_DITA_MAP_CHECK_FOR_COMPLETENESS){
//Enjoy....
}
}
});
}
}, PluginWorkspace.DITA_MAPS_EDITING_AREA);
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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