Unable to import DITA-OT plugin

<oXygen/> general issues.
AlastairDent
Posts: 21

Unable to import DITA-OT plugin

Wed May 18, 2016 6:57 pm

I've written a bespoke pdf plugin for the DITA-OT and want to import it into Oxygen (I'm using editor 17.1). I found instructions here: https://www.oxygenxml.com/doc/versions/ ... lugin.html

However, there is no 'Run DITA OT Integrator ' option available and it is unclear from that help page what file I should have selected when I run the transformation.
Radu
Posts: 5221

Re: Unable to import DITA-OT plugin

Thu May 19, 2016 9:34 am

Hi Alastair,

First of all in the Oxygen Preferences->DITA page you can see the default DITA OT installation used by Oxygen. Running the integrator transformation scenario in Oxygen will run it in that particular configured DITA OT.
In the "Transformation Scenarios" view there is a cog-like drop-down button which you can use to select Show All Scenarios, then search for the "Run DITA OT Integrator" transformation scenario. Running the scenario can be done even without any opened maps or topics because the scenario only needs to know where the DITA OT is located.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
AlastairDent
Posts: 21

Re: Unable to import DITA-OT plugin

Thu May 19, 2016 10:44 am

Thanks for your response - the scenario was in the DITA Map section, I simply couldn't see it.

However my problems aren't over!

Oxygen won't import my plugin, it says that the target extension doesn't exist in this project.

My build.xml file imports a build template file that contains the line:

<antcall target="dita2pdf2"/>

Oxygen objects to this, saying:

E [ANT Validator] The referred 'dita2pdf2' target/extension-point does not exist in this project.

Now I build with this plugin in DITA-OT. Nothing wrong with it as far as the DITA-OT goes. Why is Oxygen objecting? I'd be very disappointed if I had to have one plugin for Oxygen and one for DITA-OT, as part of company will be doing automated builds from the DITA-OT and some will be using Oxygen.
Radu
Posts: 5221

Re: Unable to import DITA-OT plugin

Thu May 19, 2016 11:03 am

Hi Alastair,

Even if Oxygen reports problem with your build file, the publishing might still work.
What happens is that your custom build.xml is just a small module, when you run the integrator, the main DITA-OT/build.xml is updated to add an import to your custom module. So the main DITA-OT/build.xml is valid in itself but when you open a small module, the module might call targets from the parent build file and they are not located within the module.
One possibility to show the module as valid is for you to create a validation scenario for your module build file and that scenario to validate the main build.xml instead:

https://www.oxygenxml.com/doc/versions/18.0/ug-editor/topics/associate-ant-validation-scenario.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
AlastairDent
Posts: 21

Re: Unable to import DITA-OT plugin

Thu May 19, 2016 4:51 pm

I'm developing this plugin for multiple authors to use so adding multiple scenarios on top seems highly undesirable.

It may be that I've broken some strict rules that Oxygen is trying to apply and the message is spurious. I will try to debug this and get to the bottom of it. First I need to migrate my plugin to the current latest DITA-OT then try importing to that version of the toolkit in Oxygen.
AlastairDent
Posts: 21

Re: Unable to import DITA-OT plugin

Fri May 20, 2016 9:52 am

I've checked where that line in my build.xml came from.

I added that line following the instructions from the 'DITA for Print' book; it ensures that the plugin cascades so that the custom plugin is used and that default DITA-OT dita2pdf2 pdf plugin is used for any definitions not in the custom plugin. It is essential that the dita2pdf2 plugin is referenced.

It seems extremely strange that Oxygen does not recognise this.
Radu
Posts: 5221

Re: Unable to import DITA-OT plugin

Fri May 20, 2016 10:14 am

Hi Alastair,

There's nothing wrong with your build file, it's just Oxygen does not have enough data to determine if the build file is valid or not.

So it's like this:

- You open in Oxygen a build.xml and Oxygen starts to validate it.
- Oxygen finds a reference to a target called "dita2pdf2" and then looks around to see if the target is defined or not. The target is not defined in the current file and it is also not defined in any build file imported or included by the current file. So Oxygen reports that the referenced target does not exist.

The problem is that Oxygen does not know that there is a larger build file which incorporates it at some point. So you need to tell this to Oxygen, either by defining a validation scenario or by using our master files support:

https://www.oxygenxml.com/doc/versions/18.0/ug-editor/topics/ant-build-file-contextual-editing.html

Basically in the Oxygen Project view you can right click and choose "Enable Master Files Support". Then in the Master Files virtual folder which appears add the main "DITA-OT/build.xml". Oxygen will then understand the dependencies between the master build file and the edited build file and should no longer issue errors when editing your build file.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
AlastairDent
Posts: 21

Re: Unable to import DITA-OT plugin

Fri May 20, 2016 10:43 am

Thank you for your assistance, that seems to have worked.

It is still reporting a fatal error but no details or a log and is completing with Build Successful so I presume that's a spurious message.
Radu
Posts: 5221

Re: Unable to import DITA-OT plugin

Fri May 20, 2016 11:55 am

Hi Alastair,

Probably that error is reported in another build file imported or included in the main DITA OT build file.
The DITA OT build files are very complex, sometimes they call tasks defined in Java JAR libraries which Oxygen does not know where to locate when validating the entire hierarchy of build files. I will add an issue on our side, see if we can better validate DITA OT build files without the need for you to take extra steps.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 0 guests