Ref Validation of Image href
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 51
- Joined: Mon Oct 01, 2012 3:05 pm
Ref Validation of Image href
Hi,
In our CMS we have an alternate location of images while editing content. So we implemented an StylesFilter to alter the reference either to the alternate location or to the document location.
Now the problem in DITA is that there is a validation on the href of the image tag causing this warning:
Is there a possibility to remove this single validation?
Best Regards
Stefan
In our CMS we have an alternate location of images while editing content. So we implemented an StylesFilter to alter the reference either to the alternate location or to the document location.
Now the problem in DITA is that there is a validation on the href of the image tag causing this warning:
after saving the document.File not found: "C:$ALTERNATE_LOCATION$\Oxygen_Internal\X000003\1200px-lego_logo000169ml.svg2.png".
Is there a possibility to remove this single validation?
Best Regards
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
Senior Solution Architect
KGU-Consulting GmbH
-
- Posts: 9448
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Ref Validation of Image href
Hi Stefan,
If you look in our plugin's plugin.xml, it has an extension point named "com.oxygenxml.editor.workspaceAccessPlugin" which is called when the plugin is started. You can use it to add a listener which will be notified when an XML document is opened, and on the XML document to add a validation problems filter:
https://www.oxygenxml.com/InstData/Edit ... emsFilter-
We have a sample Javascript-based plugin for the Oxygen standalone which does validation errors filtering here, and the Java code for the Eclipse plugin should be similar:
https://github.com/oxygenxml/wsaccess-j ... sAccess.js
Regards,
Radu
If you look in our plugin's plugin.xml, it has an extension point named "com.oxygenxml.editor.workspaceAccessPlugin" which is called when the plugin is started. You can use it to add a listener which will be notified when an XML document is opened, and on the XML document to add a validation problems filter:
https://www.oxygenxml.com/InstData/Edit ... emsFilter-
We have a sample Javascript-based plugin for the Oxygen standalone which does validation errors filtering here, and the Java code for the Eclipse plugin should be similar:
https://github.com/oxygenxml/wsaccess-j ... sAccess.js
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 51
- Joined: Mon Oct 01, 2012 3:05 pm
Re: Ref Validation of Image href
Hi Radu,
is there an Interface I must implement for this extension? And is there a possibility to get all ValidationFilters?
Regards,
Stefan
is there an Interface I must implement for this extension? And is there a possibility to get all ValidationFilters?
Regards,
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
Senior Solution Architect
KGU-Consulting GmbH
-
- Posts: 9448
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Ref Validation of Image href
Hi Stefan,
Your Java code would need to look something like this:
Your Java code would need to look something like this:
Code: Select all
import java.net.URL;
import java.util.List;
import com.oxygenxml.workspace.api.eclipse.EclipsePluginWorkspace;
import com.oxygenxml.workspace.api.eclipse.EclipseWorkspaceAccessPluginExtension;
import ro.sync.document.DocumentPositionedInfo;
import ro.sync.exml.workspace.api.PluginWorkspace;
import ro.sync.exml.workspace.api.editor.WSEditor;
import ro.sync.exml.workspace.api.editor.validation.ValidationProblems;
import ro.sync.exml.workspace.api.editor.validation.ValidationProblemsFilter;
import ro.sync.exml.workspace.api.listeners.WSEditorChangeListener;
/**
* @author raducoravu
*
*/
public class EclipseWSPlugin implements EclipseWorkspaceAccessPluginExtension {
/**
* @see com.oxygenxml.workspace.api.eclipse.EclipseWorkspaceAccessPluginExtension#pluginStarted(com.oxygenxml.workspace.api.eclipse.EclipsePluginWorkspace)
*/
@Override
public void pluginStarted(EclipsePluginWorkspace pluginWorkspaceAccess) {
pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener() {
/**
* @see ro.sync.exml.workspace.api.listeners.WSEditorChangeListener#editorOpened(java.net.URL)
*/
@Override
public void editorOpened(URL editorLocation) {
//An XML document was opened.
WSEditor openedEditor = pluginWorkspaceAccess.getEditorAccess(editorLocation, PluginWorkspace.MAIN_EDITING_AREA);
openedEditor.addValidationProblemsFilter(new ValidationProblemsFilter() {
@Override
public void filterValidationProblems(ValidationProblems validationProblems) {
List<DocumentPositionedInfo> problemsList = validationProblems.getProblemsList();
if(problemsList != null && ! problemsList.isEmpty()) {
//Maybe iterate the problems, add them in another list, skip the problems that you do not want to report and then
// validationProblems.setProblemsList(newProblems);
}
}
});
}
}, PluginWorkspace.MAIN_EDITING_AREA);
}
/**
* @see com.oxygenxml.workspace.api.eclipse.EclipseWorkspaceAccessPluginExtension#pluginStopping()
*/
@Override
public void pluginStopping() {
//
}
}{code}
and you would add it as an extension of the "com.oxygenxml.editor.workspaceAccessPlugin" extension point provided by our plugin.
So on each opened XML document you can add an individual problems filter.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 51
- Joined: Mon Oct 01, 2012 3:05 pm
Re: Ref Validation of Image href
Hi Radu,
thanks for the example code ... My problem here is that I can not distinguish between problems comming from different references.
I would like only to filter reference problems comming from the href in image tags not comming from other reference tags. How would I do that?
Is there no possibility to configure the validation in the framework? (DITA)
Regards
Stefan
thanks for the example code ... My problem here is that I can not distinguish between problems comming from different references.
I would like only to filter reference problems comming from the href in image tags not comming from other reference tags. How would I do that?
Is there no possibility to configure the validation in the framework? (DITA)
Regards
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH
Senior Solution Architect
KGU-Consulting GmbH
-
- Posts: 9448
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Ref Validation of Image href
Hi Stefan,
Also maybe as an alternative, the message of each error should contain the path to the invalid reference. And if the path to the invalid reference has an image extension, you could suppose the error comes from a reference to an image.
Regards,
Radu
Each "ro.sync.document.DocumentPositionedInfo" object you receive in the validation problems filter has start and end line and column information. And you can also obtain a reader over the editor content "ro.sync.exml.workspace.api.editor.WSEditorBase.createContentReader()".I would like only to filter reference problems comming from the href in image tags not comming from other reference tags. How would I do that?
Also maybe as an alternative, the message of each error should contain the path to the invalid reference. And if the path to the invalid reference has an image extension, you could suppose the error comes from a reference to an image.
If you edit your DITA framework extension, in the "Validation" tab you have a default validation scenario named "DITA". If you edit it, it has about 5 stages, one of those stages is named "DITA Validation". It is not configurable, if you remove it completely you will remove this specific validation error but along with other validation errors which might be useful (for example reports for invalid key references, errors for broken table structure). So this "DITA Validation" stage does not yet have the possibility to set up precisely what it should and what it should not do, if in the future we add some checkboxes to control what exact problems it should report I will try to update this forum post.Is there no possibility to configure the validation in the framework? (DITA)
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Site Admin
- Posts: 125
- Joined: Wed Dec 12, 2018 5:33 pm
Re: Ref Validation of Image href
Post by Cosmin Duna »
Hello,
I just wanted to let you know that Oxygen 24.0 is out now and it contains a new validation engine named "DITA Map Validation and Completeness Check" that can be configured:
https://www.oxygenxml.com/doc/versions/ ... __d572e145
Best regards,
Cosmin
I just wanted to let you know that Oxygen 24.0 is out now and it contains a new validation engine named "DITA Map Validation and Completeness Check" that can be configured:
https://www.oxygenxml.com/doc/versions/ ... __d572e145
Best regards,
Cosmin
Cosmin Duna
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
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