Using an external DITA OT

susannecm
Posts: 55

Using an external DITA OT

Thu Dec 20, 2012 10:42 pm

I would like to update my oXygen 13.1 installation but if I do so my custom PDF output will stop working. My plan for the future is to use an external DITA OT and to create a custom PDF plugin (at the moment I use a customization folder and the integrated DITA OT).

So far I have installed an external DITA OT 1.6.3, copied the default PDF transformation in oXygen, switched the PDF formatter to XEP and modified the dita.dir parameter. But the transformation does not work (acutally it already fails when reading the build.xml file). I know that the libraries are a part of the problem. If I make some changes on the Advanced tab of the transformation, the transformation starts, but fails with other errors.

Is there a way to ensure that the oXygen transformation uses the very same libraries as the DITA OT when executed via start.cmd?

Thanks for your help

Susanne
sorin_ristache
Posts: 4144

Re: Using an external DITA OT

Fri Dec 21, 2012 12:18 pm

Hi Susanne,

If you run the DITA transformation in Oxygen it can never use exactly the same libraries as a DITA-OT transformation executed in a command line console, because Oxygen brings various enhancements to the stock DITA-OT transformation as executed from a command line:

  • the Xerces parser plus custom Oxygen patches will always be used as XML parser in the Oxygen transformation,
  • the Saxon 9 Enterprise Edition is the XSLT transformer in the Oxygen transformation,

etc.

If you want to run the DITA transformations in Oxygen with a different version of DITA-OT than the built-in one which comes with Oxygen (currently DITA-OT 1.6.1 in Oxygen 14.1), I see that you already figured it out:

  • duplicate one of the built-in transformations like DITA MAP PDF, DITA MAP WebHelp, etc,
  • in the duplicated transformation set the dita.dir parameter to the directory where the external DITA-OT is located,
  • set other parameters like the XEP processor instead of the default one (which is Apache FOP),
  • update the list of libraries on the Advanced tab, the Libraries button; sometimes the jar libraries which come with one DITA-OT version (i.e. DITA-OT 1.6.1 which comes with Oxygen) are not compatible with future versions of DITA-OT (i.e. version 1.6.3 which you want to use) so the libraries of the old version need to be replaced in the list on the Advanced tab with the equivalent ones that come with the newer DITA-OT version.


If after these changes there are still transformation errors in the Oxygen view with the DITA-OT transformation output log please post the errors here.


Regards,
Sorin
susannecm
Posts: 55

Re: Using an external DITA OT

Fri Dec 21, 2012 2:49 pm

Hi Sorin,

I'm still having problems with the libraries.

dita.dir points to an environment variable DITA_HOME.

The Advanced tab contains the entries below:

Code: Select all

${oxygenHome}/classes/
${oxygenHome}/lib/oxygen.jar
${oxygenHome}/lib/oxygenAuthor.jar
${oxygenHome}/lib/oxygenDeveloper.jar
${oxygenHome}/lib/oxygenEclipse.jar
${oxygenHome}/lib/oxygenAuthorEclipse.jar
${oxygenHome}/lib/oxygenDeveloperEclipse.jar
${oxygenHome}/lib/resolver.jar
${env(DITA_HOME)}
${oxygenHome}/lib/commons-io-1.3.1.jar
${oxygenHome}/lib/commons-logging-1.0.4.jar
${oxygenHome}/lib/log4j.jar
${env(DITA_HOME)}/lib/
${env(DITA_HOME)}/lib/dost.jar
${env(DITA_HOME)}/lib/commons-codec-1.4.jar
${env(DITA_HOME)}/lib/xercesImpl.jar
${oxygenHome}/lib/saxon9ee.jar
${oxygenHome}/lib/saxon.jar
${oxygenHome}/lib/xmlgraphics-commons-1.4.jar
${oxygenHome}/lib/fop.jar
${oxygenHome}/lib/batik-all-1.7.jar
${oxygenHome}/lib/xml-apis-xpath.jar
${oxygenHome}/lib/xml-apis-ext.jar
${oxygenHome}/lib/avalon-framework-4.2.0.jar
${oxygenHome}/lib/jcip-annotations.jar
${oxygenHome}/lib/jeuclid-core.jar
${oxygenHome}/lib/jeuclid-fop.jar
${oxygenHome}/lib/jh.jar
${frameworks}/dita/DITA-OT/lib/jsearch.jar
${frameworks}/dita/DITA-OT/plugins/webhelp/lib/lucene-analyzers-3.0.0.jar
${frameworks}/dita/DITA-OT/plugins/webhelp/lib/lucene-core-3.0.0.jar
${frameworks}/dita/DITA-OT/plugins/webhelp/lib/nw-cms.jar


The transformation fails with the following message:

Code: Select all

BUILD FAILED
C:\DITA-OT1.6.3\build.xml:47: The following error occurred while executing this line:
C:\DITA-OT1.6.3\plugins\org.dita.base\build_preprocess.xml:27: java.lang.ClassNotFoundException: org.dita.dost.module.GenMapAndTopicListModule
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at org.apache.tools.ant.IntrospectionHelper$6.set(IntrospectionHelper.java:1089)
   at org.apache.tools.ant.IntrospectionHelper$AttributeSetter.setObject(IntrospectionHelper.java:1502)
   at org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:405)
   at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:388)
   at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:344)
   at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:580)
   at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:349)
   at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:201)
   at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
   at org.apache.tools.ant.Task.perform(Task.java:347)
   at org.apache.tools.ant.Target.execute(Target.java:390)
   at org.apache.tools.ant.Target.performTasks(Target.java:411)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
   at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
   at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
   at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
   at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.Target.execute(Target.java:390)
   at org.apache.tools.ant.Target.performTasks(Target.java:411)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
   at org.apache.tools.ant.Main.runBuild(Main.java:809)
   at org.apache.tools.ant.Main.startAnt(Main.java:217)
   at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
   at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)


Does this mean that dost cannot be found?

Best regards

Susanne
sorin_ristache
Posts: 4144

Re: Using an external DITA OT

Fri Dec 21, 2012 5:43 pm

Hi,

The class which could not be loaded (org.dita.dost.module.GenMapAndTopicListModule) should be inside the dost.jar file. I don't have DITA-OT 1.6.3 installed, can you check please if [DITA-OT-1.6.3-install-dir]/lib/dost.jar includes this class?

Please replace in the list of libraries on the Advanced tab the file {env(DITA_HOME)}/lib/xercesImpl.jar with the file ${oxygenHome}/lib/xercesImpl.jar.

Please note that it is possible that newer versions of DITA-OT bring some changes that are incompatible with the Oxygen jar files in the classpath of the transformation. Usually setting the dita.dir parameter and adjusting the libraries list on the Advanced tab does the job, but some incompatible changes in newer DITA-OT versions may make it impossible.


Regards,
Sorin
susannecm
Posts: 55

Re: Using an external DITA OT

Fri Dec 21, 2012 6:22 pm

Hi Sorin,

yes, the class file is there. Very strange ...

The problem may not be just dost.
I switched on verbose logging. Even though I can't see where the problem is in the output, it contains a warning:

Code: Select all

[available] Unable to load class com.ibm.icu.text.Collator

I added icu4j.jar to the libraries, but that doesn't go away as well, even though this class exists too.

As for the xercesImpl.jar, I made this change too (actually I had tested this already).
Unfortunately it doesn't make a difference (same error message).



Best regards

Susanne
susannecm
Posts: 55

Re: Using an external DITA OT

Fri Dec 21, 2012 6:55 pm

Hmm - there seems to be a problem with the environment variable.
The transformation works if I use absolute path instead of an environment variable.

Code: Select all

file:/C:/DITA-OT1.6.3/
file:/C:/DITA-OT1.6.3/lib/
file:/C:/DITA-OT1.6.3/lib/commons-codec-1.4.jar
file:/C:/DITA-OT1.6.3/lib/dost.jar
file:/C:/DITA-OT1.6.3/lib/icu4j.jar
file:/C:/DITA-OT1.6.3/lib/resolver.jar
${oxygenHome}/classes/
${oxygenHome}/lib/oxygen.jar
${oxygenHome}/lib/oxygenAuthor.jar
${oxygenHome}/lib/oxygenDeveloper.jar
${oxygenHome}/lib/oxygenEclipse.jar
${oxygenHome}/lib/oxygenAuthorEclipse.jar
...
sorin_ristache
Posts: 4144

Re: Using an external DITA OT

Mon Dec 24, 2012 11:21 am

Hi,

Please use ${dita.dir.url} instead of {env(DITA_HOME)}. It seems the Windows environment variables are not fetched correctly when the DITA transformation parameters are expanded. We will fix the problem in a future version.


Regards,
Sorin

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests