How to add custom validation using xsl with in Oxygen Author SDK
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 27
- Joined: Fri Jul 29, 2022 9:55 am
How to add custom validation using xsl with in Oxygen Author SDK
Hello Team,
I am trying to explore the Oxygen SDK java samples to create/customize a plugin which can validate against the topics and map in Oxygen Author.
1. Is it possible to add the the custom schematron file location using the framewrok plugin?(I can configure this manually with in Oxygen, but I want to do this programmatically)
1. Is it possible to add an xsl file within framework and trigger the xsl file from the framework plugin or any other sample plugin which is coming along with the SDK.
Thanks in advance
Roopesh
I am trying to explore the Oxygen SDK java samples to create/customize a plugin which can validate against the topics and map in Oxygen Author.
1. Is it possible to add the the custom schematron file location using the framewrok plugin?(I can configure this manually with in Oxygen, but I want to do this programmatically)
1. Is it possible to add an xsl file within framework and trigger the xsl file from the framework plugin or any other sample plugin which is coming along with the SDK.
Thanks in advance
Roopesh
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to add custom validation using xsl with in Oxygen Author SDK
Hi Roopesh,
https://blog.oxygenxml.com/topics/shari ... rules.html
And a framework extension folder can be distributed with a plugin.
https://www.oxygenxml.com/doc/versions/ ... nsion.html
We also have the API to add a validation problems filter:
https://www.oxygenxml.com/InstData/Edit ... emsFilter-
which would allow you to participate when topics and maps are validated in Oxygen and use custom code to perform custom validation on the content and provide errors to Oxygen, errors which are later displayed by Oxygen to the end user.
Regards,
Radu
It is possible for example to create a framework extension (for the DITA framework for example) which provides an extra Schematron file which will be used for default validation of DITA topics:1. Is it possible to add the the custom schematron file location using the framewrok plugin?(I can configure this manually with in Oxygen, but I want to do this programmatically)
https://blog.oxygenxml.com/topics/shari ... rules.html
And a framework extension folder can be distributed with a plugin.
https://www.oxygenxml.com/doc/versions/ ... nsion.html
Trigger it at what moment? Is this question still about validation?1. Is it possible to add an xsl file within framework and trigger the xsl file from the framework plugin or any other sample plugin which is coming along with the SDK.
We also have the API to add a validation problems filter:
https://www.oxygenxml.com/InstData/Edit ... emsFilter-
which would allow you to participate when topics and maps are validated in Oxygen and use custom code to perform custom validation on the content and provide errors to Oxygen, errors which are later displayed by Oxygen to the end user.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 27
- Joined: Fri Jul 29, 2022 9:55 am
Re: How to add custom validation using xsl with in Oxygen Author SDK
Hi Radu,
1. I have tried the option 1 and created the framework. What my understanding is , Even though I shared the framework to my users, still user need to manually configure the framework within oxygen Author, is this correct? What I am looking is a plug- and-play framework which user do not need to make any configuration. Please let me know if this is possible.
2. In the second question what I am trying is to create an oxygen plugin that can be triggered from the a custom plugin menu and validate against the open document and also validate against all the topics in a bookmap.
Regards,
Roopesh
1. I have tried the option 1 and created the framework. What my understanding is , Even though I shared the framework to my users, still user need to manually configure the framework within oxygen Author, is this correct? What I am looking is a plug- and-play framework which user do not need to make any configuration. Please let me know if this is possible.
2. In the second question what I am trying is to create an oxygen plugin that can be triggered from the a custom plugin menu and validate against the open document and also validate against all the topics in a bookmap.
Regards,
Roopesh
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to add custom validation using xsl with in Oxygen Author SDK
Hi Roopesh,
So:
https://www.oxygenxml.com/doc/versions/ ... nsion.html
So once you install in Oxygen the plugin which contains inside a framework configuration folder, if you open XML files which are matched by Oxygen to that framework configuration, Oxygen should start validating those opened XML files with the validation scenarios specified in the framework configuration.
https://www.oxygenxml.com/doc/versions/ ... lugin.html
An opened document has the API "https://www.oxygenxml.com/InstData/Edit ... ditor.html"
This API allows you to create a reader based on its contents:
https://www.oxygenxml.com/InstData/Edit ... ntReader--
Once you have the contents, you can validate them in any way you want and then display the errors to the end user.
You can use our "ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().getResultsManager()" API to show errors in Oxygen's Results view.
About validating all topics in a bookmap, if the bookmap is opened in the DITA Maps Manager view you can gain access to its root element and then use its methods to navigate through all elements and gather all references:
Regards,
Radu
So:
An Oxygen plugin can specify in the plugin.xml that it also contains a frameworks folder:1. I have tried the option 1 and created the framework. What my understanding is , Even though I shared the framework to my users, still user need to manually configure the framework within oxygen Author, is this correct? What I am looking is a plug- and-play framework which user do not need to make any configuration. Please let me know if this is possible.
https://www.oxygenxml.com/doc/versions/ ... nsion.html
So once you install in Oxygen the plugin which contains inside a framework configuration folder, if you open XML files which are matched by Oxygen to that framework configuration, Oxygen should start validating those opened XML files with the validation scenarios specified in the framework configuration.
I assume you would want to create a plugin of type "Workspace Access Plugin Extension":2. In the second question what I am trying is to create an oxygen plugin that can be triggered from the a custom plugin menu and validate against the open document and also validate against all the topics in a bookmap.
https://www.oxygenxml.com/doc/versions/ ... lugin.html
An opened document has the API "https://www.oxygenxml.com/InstData/Edit ... ditor.html"
This API allows you to create a reader based on its contents:
https://www.oxygenxml.com/InstData/Edit ... ntReader--
Once you have the contents, you can validate them in any way you want and then display the errors to the end user.
You can use our "ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().getResultsManager()" API to show errors in Oxygen's Results view.
About validating all topics in a bookmap, if the bookmap is opened in the DITA Maps Manager view you can gain access to its root element and then use its methods to navigate through all elements and gather all references:
Code: Select all
WSEditor openedMap = ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().getCurrentEditorAccess(PluginWorkspace.DITA_MAPS_EDITING_AREA);
WSDITAMapEditorPage editorPage = (WSDITAMapEditorPage) openedMap.getCurrentPage();
AuthorElement mapRootElement = editorPage.getDocumentController().getAuthorDocumentNode().getRootElement();
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