How to force filterValidationProblems
Post here questions and problems related to oXygen frameworks/document types.
How to force filterValidationProblems
Hi,
In my AuthorComponent (version 17), I've created a class which extends ValidationProblemsFilter. In this class, I've overrided the filterValidationProblems method which enables me to get customized error messages in my editor.
I've noticed that this method is called when there is a change in the editor or when the current file is saved. I would like to call this "validation" when I click on a button. Is it and how is it possible ? On debug mode, we cannot see what triggers this method (class ro.sync.exml.editor.validate.o is hidden).
Thanks for your help,
Johann
In my AuthorComponent (version 17), I've created a class which extends ValidationProblemsFilter. In this class, I've overrided the filterValidationProblems method which enables me to get customized error messages in my editor.
I've noticed that this method is called when there is a change in the editor or when the current file is saved. I would like to call this "validation" when I click on a button. Is it and how is it possible ? On debug mode, we cannot see what triggers this method (class ro.sync.exml.editor.validate.o is hidden).
Thanks for your help,
Johann
-
- Posts: 1008
- Joined: Wed Nov 16, 2005 11:11 am
Re: How to force filterValidationProblems
Post by alex_jitianu »
Hello Johann,
What you've noticed is the automatic validation that is triggered when the user edits the document. There is also a Validate action on the toolbar that triggers a validation.
Best regards,
Alex
What you've noticed is the automatic validation that is triggered when the user edits the document. There is also a Validate action on the toolbar that triggers a validation.
Best regards,
Alex
Re: How to force filterValidationProblems
Hello Alex,
thanks for your response. I know the Validate action on the Oxygen toolbar but in my application, I'm using an AuthorComponent and I would like to "recreate" this Validate button. I didn't find the Validate Action in the map returned by the method getAuthorCommonActions() of the AuthorActionsProvider class. How can I add the "Validate" button in my application ?
Thanks,
Johann
thanks for your response. I know the Validate action on the Oxygen toolbar but in my application, I'm using an AuthorComponent and I would like to "recreate" this Validate button. I didn't find the Validate Action in the map returned by the method getAuthorCommonActions() of the AuthorActionsProvider class. How can I add the "Validate" button in my application ?
Thanks,
Johann
-
- Posts: 1008
- Joined: Wed Nov 16, 2005 11:11 am
Re: How to force filterValidationProblems
Post by alex_jitianu »
Hello Johann,
Can I ask why would you need this button? Isn't the automatic validation enough to signal to the user the problem? Currently, in the Author Component you don't have access to this validate button so I guess we would have to add some additional API.
Best regards,
Alex
Can I ask why would you need this button? Isn't the automatic validation enough to signal to the user the problem? Currently, in the Author Component you don't have access to this validate button so I guess we would have to add some additional API.
Best regards,
Alex
Re: How to force filterValidationProblems
Hello Alex,
In fact, I need this button to add customized validation errors in the standard errors. These customized validation errors have to be added only on user request so by clicking on a button. Have you planned to add the possibility to access the validate button in next releases ?
Best regards,
Johann
In fact, I need this button to add customized validation errors in the standard errors. These customized validation errors have to be added only on user request so by clicking on a button. Have you planned to add the possibility to access the validate button in next releases ?
Best regards,
Johann
-
- Posts: 1008
- Joined: Wed Nov 16, 2005 11:11 am
Re: How to force filterValidationProblems
Post by alex_jitianu »
Hello Johann,
How about if you add a button and when this button is clicked you run your custom validation and :
- you present the errors in a custom view
- you add a highlight in the document for each error:
The will be missing is that these errors wont appear on the errors stripe, on the right of the editor.
I will add an issue for a validate() method in the API.
Best regards,
Alex
How about if you add a button and when this button is clicked you run your custom validation and :
- you present the errors in a custom view
- you add a highlight in the document for each error:
Code: Select all
WSAuthorEditorPage edPage = (WSAuthorEditorPage) editorComponent.getWSEditorAccess().getCurrentPage();
// Add a highlight.
edPage.getHighlighter().addHighlight(
startOffset,
endOffset,
new ColorHighlightPainter(),
additionalData);
// TODO Add an entry in a custom view.
I will add an issue for a validate() method in the API.
Best regards,
Alex
Re: How to force filterValidationProblems
Hello Alex,
I wanted to use your solution but I thought that's a shame not to use the existing errors report (by clicking on the status bar). So, I found a workaround. When I click on my validation button, if the current document is already saved, I save it again and if it is modified, I perform an undo/redo to force an edition on the document and so a validation. It's not pretty but it works in waiting for a "true" validation button
Best regards,
Johann
I wanted to use your solution but I thought that's a shame not to use the existing errors report (by clicking on the status bar). So, I found a workaround. When I click on my validation button, if the current document is already saved, I save it again and if it is modified, I perform an undo/redo to force an edition on the document and so a validation. It's not pretty but it works in waiting for a "true" validation button
Best regards,
Johann
Re: How to force filterValidationProblems
Hi,
Just to update this thread, the Oxygen 17.1 API should have a new method for this:
ro.sync.exml.workspace.api.editor.WSEditor.checkValid()
Regards,
Radu
Just to update this thread, the Oxygen 17.1 API should have a new method for this:
ro.sync.exml.workspace.api.editor.WSEditor.checkValid()
Regards,
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