Ant file that builds webhelp

Post here questions and problems related to editing and publishing DITA content.
november
Posts: 7
Joined: Mon May 23, 2011 9:14 pm

Ant file that builds webhelp

Post by november »

Hi,

How is webhelp actually built? Which ant file is invoked?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hello,

The WebHelp output is built from a DITA map using the build.xml file of DITA-OT just like all DITA output formats. This build.xml file is located in the ${frameworks}\dita\DITA-OT folder, where ${frameworks} is the frameworks folder inside the Oxygen install folder.

Do you get any errors when trying to generate WebHelp output from a DITA map? Do you want to customize the WebHelp output?


Regards,
Sorin
november
Posts: 7
Joined: Mon May 23, 2011 9:14 pm

Re: Ant file that builds webhelp

Post by november »

Yes, I am trying to customize the process. Can I retrofit it back into a clean install of DITA-OT? I might need to build the webhelp on a remote server.

Thanks
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hello,

As you can read in the license.txt file from the directory of the Webhelp plugin inside the DITA-OT embedded in Oxygen, using the Webhelp plugin outside Oxygen is forbidden. You are not allowed to migrate it to other DITA-OT install outside Oxygen.

We can discuss your particular case to run on a server machine, from a command line, the Webhelp transformation from the DITA-OT embedded in Oxygen, that is from the [Oxygen-install-dir]/frameworks/dita/DITA-OT directory, if you are willing to purchase as many Named User (standard) licenses or floating licenses as the number of users that will run the Webhelp transformation on the server.


Regards,
Sorin
undrgrnd
Posts: 4
Joined: Wed Dec 12, 2012 12:29 pm

Re: Ant file that builds webhelp

Post by undrgrnd »

Hello,

What do we need to execute oxygen dita webhelp transformation in a build server via command line? Thanks
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hi undrgrnd,

As I said above the license terms forbid running the DITA WebHelp transformation outside Oxygen. For automating the process of generating the WebHelp output, the Oxygen DITA WebHelp transformation may be called from a command line as an ANT process that runs the DITA-OT toolkit embedded in Oxygen (located in the [Oxygen-install-dir]/frameworks/dita/DITA-OT directory). The general process is described in the User Manual.

You can start by copying and pasting the command line that is displayed at the top of the DITA Transformation view when you run the WebHelp transformation manually in the Oxygen window. When you paste this command at a command line and run it you will see some info lines with the changes that you need to make in the command line, like the following:

Code: Select all

==================================================
You are running a DITA transformation outside Oxygen application.
Please make sure you have a registered Oxygen installation for the current user.
In case you need more details, you can contact the Oxygen support team
at support@oxygenxml.com

Running DITA-OT from outside Oxygen requires the Saxon 9 Basic processor.
You can download Saxon 9 Basic from:
http://sourceforge.net/projects/saxon/files/Saxon-B/

Please copy the saxon9.jar and saxon9-dom.jar files into the directory
S:\oxygen\frameworks/dita/DITA-OT/lib/saxon
and add these two files to the classpath of the ANT launcher.

Also you should remove from classpath the following Oxygen specific jar files:
oxygen.jar
oxygenAuthor.jar
oxygenDeveloper.jar
oxygenEclipse.jar
oxygenAuthorEclipse.jar
oxygenDeveloperEclipse.jar
saxon9ee.jar
==================================================
So the command needs some minor manual editing: adding some parameters for the Saxon 9 Basic jar files and removing the parameters that specify the following jar files, as specified in the info message above:

Code: Select all

-lib "C:\Program Files (x86)\Oxygen XML Editor 13\lib\saxon9ee.jar"

Code: Select all

-lib "C:\Program Files (x86)\Oxygen XML Editor 13\lib\oxygen.jar"
etc.

You need either a standard Oxygen license (that is a Named User license) for each user that will run the WebHelp transformation from command line or a floating license for the group of these users. Depending on your particular situation a floating license for a reduced number of concurrent users may be more cost effective than one standard license for each distinct user that runs the command line transformation.


Regards,
Sorin
undrgrnd
Posts: 4
Joined: Wed Dec 12, 2012 12:29 pm

Re: Ant file that builds webhelp

Post by undrgrnd »

Hi,

Thanks! Everything is running smoothly until I hit this error:

BUILD FAILED
C:\Program Files\Oxygen XML Author 14\frameworks\dita\DITA-OT\build.xml:56: The following error occurred while executing this line:
C:\Program Files\Oxygen XML Author 14\frameworks\dita\DITA-OT\build.xml:769: taskdef class com.nexwave.nquindexer.IndexerTask cannot be found
undrgrnd
Posts: 4
Joined: Wed Dec 12, 2012 12:29 pm

Re: Ant file that builds webhelp

Post by undrgrnd »

undrgrnd wrote:Hi,

Thanks! Everything is running smoothly until I hit this error:

BUILD FAILED
C:\Program Files\Oxygen XML Author 14\frameworks\dita\DITA-OT\build.xml:56: The following error occurred while executing this line:
C:\Program Files\Oxygen XML Author 14\frameworks\dita\DITA-OT\build.xml:769: taskdef class com.nexwave.nquindexer.IndexerTask cannot be found
Already fixed this problem. Directory of ".../plugins/webhelp" should be ".../plugins/com.oxygenxml.webhelp"
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hi,

Yes, the path of the WebHelp plugin is [Oxygen-install-dir]/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp (not plugins/webhelp) but I wonder where you found that filepath? If you copy and paste the command from the DITA Transformation view in the Oxygen window you will always have the correct filepath for all the jar files needed by the command line.


Regards,
Sorin
undrgrnd
Posts: 4
Joined: Wed Dec 12, 2012 12:29 pm

Re: Ant file that builds webhelp

Post by undrgrnd »

Hi you are right. The commands I used are from the documentation you provided. I should have used the command line provided by the oxygen author application.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hi,

That command line is only an example to give you a feel of the content and length of the command, but you get the actual command by copy and paste from the output view of the DITA transformation in the Oxygen window as you can read in step 3 of that procedure from the User Manual.

Please let us know if you run into other errors or difficulties.


Regards,
Sorin
smckenzie23
Posts: 7
Joined: Wed Nov 13, 2013 1:57 am

Re: Ant file that builds webhelp

Post by smckenzie23 »

I see this is an old thread.

A coworker interprets your WebHelp plugin usage such that "Outside Oxygen" includes the command line. While I noted that you've always been able to build using the command line when using the included toolkit (and it's WebHelp plugin), I also see the information on how to do that has been removed from the manual.

It doesn't have to be ant driven, but we do need to be able to automate builds at the command line.

This is not strictly disallowed by the license in Oxygen 15, is it?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hello,

That is correct, "Outside Oxygen" includes any use of the Webhelp transformation outside the Oxygen GUI. It does not matter if the Webhelp transformation is launched from the DITA Open Toolkit that comes with the Oxygen kit (located in [Oxygen-15-install-kit]/frameworks/dita/DITA-OT) or from other DITA OT installation. Starting with version 15 the EULA strictly disallows running the Oxygen Webhelp transformation outside the Oxygen GUI.

For running the Webhelp transformation outside the Oxygen GUI, for example as part of an automatic build system, we provide a separate Webhelp distribution (a zip archive of approx. 7 MB) that requires a separate Webhelp license. This Webhelp distribution comes with installation and DITA-OT integration instructions and sample shell scripts for Windows and Mac/Linux for starting the transformation automatically from a command line/as an automatic cron job.

If you tried to integrate yourself the Oxygen Webhelp transformation from a previous version (Oxygen version 14, or version 13, etc) in a DITA-OT installation called in a process external to Oxygen (for example an automatic build system) I think you have a taste of the difficulties and transformation errors (ANT errors and XSLT ones) that stemmed from transplanting the Webhelp transformation in an external DITA-OT, so you may appreciate our integration support that comes with the Webhelp license and that saves you from these difficulties.


Regards,
Sorin
runleonarun
Posts: 9
Joined: Wed May 08, 2013 11:20 pm

Re: Ant file that builds webhelp

Post by runleonarun »

Hello,
We have purchased the separate WebHelp License from Oxygen, and have successfully used the following command to build using the DITA_OT1.7.5 plus the WebHelp plugin outside of Oxygen per the instructions in .

"[JVM-install-dir]/bin/java" -Xmx512m -classpath "[DITA-OT-install-dir]/tools/ant/lib/ant-launcher.jar" "-Dant.home=[DITA-OT-install-dir]/tools/ant" org.apache.tools.ant.launch.Launcher -lib "[DITA-OT-install-dir]" -lib "[DITA-OT-install-dir]/lib" -lib "[Saxon-9.1.0.8-dir]/saxon9.jar" -lib "[Saxon-9.1.0.8-dir]/saxon9-dom.jar" -lib "[DITA-OT-install-dir]/plugins/com.oxygenxml.webhelp/lib/license.jar" -lib "[DITA-OT-install-dir]/plugins/com.oxygenxml.webhelp/lib/log4j.jar" -lib "[DITA-OT-install-dir]/plugins/com.oxygenxml.webhelp/lib/resolver.jar" -lib "[DITA-OT-install-dir]/plugins/com.oxygenxml.webhelp/lib/ant-contrib-1.0b3.jar" -lib "[DITA-OT-install-dir]/plugins/com.oxygenxml.webhelp/lib/lucene-analyzers-common-4.0.0.jar" -lib "[DITA-OT-install-dir]/plugins/com.oxygenxml.webhelp/lib/lucene-core-4.0.0.jar" -lib "[DITA-OT-install-dir]/plugins/com.oxygenxml.webhelp/lib/xhtml-indexer.jar" -f "[DITA-OT-install-dir]/build.xml" "-Dtranstype=[webhelp.transtype]" "-Dbasedir=[DITA-map-base-dir]" "-Doutput.dir=[DITA-map-base-dir]/out/[webhelp.transtype]" "-Ddita.temp.dir=[DITA-map-base-dir]/temp/[webhelp.transtype]" "-Dargs.filter=[DITAVAL-dir]/[file.ditaval]" "-Ddita.input.valfile=[DITAVAL-dir]/[file.ditaval]" "-Dargs.hide.parent.link=no" "-Ddita.dir=[DITA-OT-install-dir]" "-Dargs.xhtml.classattr=yes" "-Dargs.input=[DITA-map-base-dir]/[input-DITA-map-file.ditamap]" "-DbaseJVMArgLine=-Xmx384m"


My question is, do you have an OOTB build.xml that we can edit so we can easily automate our builds?

Thank you,
Leona
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hello Leona,

All the script files that we provide are included in the Webhelp zip. The Webhelp zip contains a script dita.bat with a command that can be used for the Webhelp transformations. You should use the command from the script for calling build.xml of DITA-OT.


Regards,
Sorin
runleonarun
Posts: 9
Joined: Wed May 08, 2013 11:20 pm

Re: Ant file that builds webhelp

Post by runleonarun »

Hi Soren,
So I need to take the dita.sh and edit it so it contains the environmental variables, and then run it along with the startcmd.sh before I run my build?


Also, I see in the com.oxygenxml.webhelp directory there are 3 build files: build.xml, build_common.xml, and build_dita.xml which one should I call from my build file? And am I also calling the build.xml in the dita install directory: DITA-OT1.7.5/build.xml ?

Thanks for you help!
Leona
runleonarun
Posts: 9
Joined: Wed May 08, 2013 11:20 pm

Re: Ant file that builds webhelp

Post by runleonarun »

Hi Sorin (sorry I spelled your name wrong in my previous post),
Here are some more questions:

I tried adding the following to my build script so I can execute the shell script:
<target name="webhelpscript">
<exec executable="${basedir}DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/dita.sh"/>
</target>
And I get this error message:
Buildfile: path_to_my_build/7_0/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

BUILD FAILED
Target "annotate-all-html-files" does not exist in the project "null". It is used from target "Oxygen-Webhelp.output".
Is this how I'm supposed to bring it into the build script? When I remove the depend for the target "annotate-all-html-files" I get the following error message:
path_to_basedir/shared/build.xml:28: Execute failed: java.io.IOException: Cannot run program "path_to_basedir/DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/dita.sh" (in directory "path_to_basedir"): error=2, No such file or directory
at java.lang.ProcessBuilder.processException(ProcessBuilder.java:478)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:457)
at java.lang.Runtime.exec(Runtime.java:593)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
Also, am I supposed to be importing all the build files like this?
<import file="${basedir}/DITA-OT1.7.5LBC/build.xml"/>
<import file="${basedir}/DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/build.xml"/>
<import file="${basedir}/DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/build_common.xml"/>
<import file="${basedir}/DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/build_dita.xml"/>
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hi,
runleonarun wrote:So I need to take the dita.sh and edit it so it contains the environmental variables, and then run it along with the startcmd.sh before I run my build?
Just edit dita.sh, set the environment variables to the paths that you have on your computer and after that just call dita.sh. What is startcmd.sh? I think it does not matter from where you call dita.sh, just make sure the environment variables are set to the correct paths when dita.sh is called.
runleonarun wrote:Also, I see in the com.oxygenxml.webhelp directory there are 3 build files: build.xml, build_common.xml, and build_dita.xml which one should I call from my build file? And am I also calling the build.xml in the dita install directory: DITA-OT1.7.5/build.xml ?
build_dita.xml is called by DITA-OT where you integrated the Webhelp plugin. You should not call these ANT files directly, they are called by DITA-OT/build.xml.


Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

runleonarun wrote:I tried adding the following to my build script so I can execute the shell script:
<target name="webhelpscript">
<exec executable="${basedir}DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/dita.sh"/>
</target>
. . .

Is this how I'm supposed to bring it into the build script?
If you want to call the transformation from a build script I think you can use something like:

Code: Select all

<target name="webhelpscript">
<ant antfile="${dita.dir}/build.xml" target="init">
<property name="transtype" value="webhelp"/>
<property name="output.dir" value="${path-to-DITA-map-file}/out/webhelp"/>
<property name="args.input" value="${path-to-DITA-map-file}/input-DITA-map.ditamap"/>
<property name="dita.temp.dir" value="${path-to-DITA-map-file}/temp/webhelp"/>
. . .
</ant>
</target>
You should set using <property> as in the above example all properties that are set with -D in the dita.bat file, for example:

Code: Select all

 "-Dtranstype=%TRANSTYPE%"^
"-Dbasedir=%DITA_MAP_BASE_DIR%"^
"-Doutput.dir=%DITA_MAP_BASE_DIR%\out\%TRANSTYPE%"^
Also you should pass all the jar files from dita.bat (log4j.jar, license.jar, resolver.jar, ant-contrib-1.0b3.jar, etc) to your ANT process that runs <target name="webhelpscript">. All these jar files are located in the lib subdirectory of the Webhelp distribution.


Regards,
Sorin
runleonarun
Posts: 9
Joined: Wed May 08, 2013 11:20 pm

Re: Ant file that builds webhelp

Post by runleonarun »

Hi Sorin,

So I tried to do this:
Also you should pass all the jar files from dita.bat (log4j.jar, license.jar, resolver.jar, ant-contrib-1.0b3.jar, etc) to your ANT process that runs <target name="webhelpscript">. All these jar files are located in the lib subdirectory of the Webhelp distribution.
by adjusting my target as follows:
<target name="webhelpscript">

<ant antfile="${dita.dir}/build.xml" target="init">
<property name="ant.home" location="${dita.dir}/tools/ant"/>
<property name="license.jar" location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/license.jar"/>
<property name="saxon9.jar" location="${dita.dir}/lib/saxonb9-1-0-8j/saxon9.jar"/>
<property name="saxon9-dom.jar" location="${dita.dir}/lib/saxonb9-1-0-8j/saxon9-dom.jar"/>
<property name="log4j.jar" location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/log4j.jar"/>
<property name="resolver.jar" location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/resolver.jar"/>
<property name="ant-contrib-1.0b3.jar"
location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/ant-contrib-1.0b3.jar"/>
<property name="lucene-analyzers-common-4.0.0.jar"
location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/lucene-analyzers-common-4.0.0.jar"/>
<property name="lucene-core-4.0.0.jar"
location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/lucene-core-4.0.0.jar"/>
<property name="xhtml-indexer.jar"
location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/xhtml-indexer.jar"/>
<property name="transtype" value="webhelp"/>
<property name="output.dir" value="${outdir}/webhelp"/>
<property name="dita.temp.dir" value="${tempdir}/webhelp"/>
<property name="dita.input.valfile" value="${args.filter}"/>
<property name="args.hide.parent.link" value="no"/>
<property name="args.xhtml.classattr" value="yes"/>
<property name="baseJVMArgLine" value="-Xmx384m"/>

</ant>
</target>
It's still failing with the following errors:
BUILD FAILED
path_to_basedir/shared/build.xml:32: The following error occurred while executing this line:
path_to_basedir/DITA-OT1.7.5LBC/build.xml:44: The following error occurred while executing this line:
path_to_basedir/DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/build_common.xml:146: The Webhelp plugin does not contain all jar files. Please contact support@oxygenxml.com for more details.
How should I be passing the jar files to the ant process (obviously I'm doing it wrong)?
Thanks for your help!
Leona
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

runleonarun wrote:So I tried to do this:

...

by adjusting my target as follows:
<target name="webhelpscript">

<ant antfile="${dita.dir}/build.xml" target="init">
<property name="ant.home" location="${dita.dir}/tools/ant"/>
<property name="license.jar" location="${dita.dir}/plugins/com.oxygenxml.webhelp/lib/license.jar"/>
<property name="saxon9.jar" location="${dita.dir}/lib/saxonb9-1-0-8j/saxon9.jar"/>
<property name="saxon9-dom.jar" location="${dita.dir}/lib/saxonb9-1-0-8j/saxon9-dom.jar"/>
In ANT a jar file is not added to the classpath of a Java command just by creating an ANT property. For example if you want to add license.jar, saxon9.jar, saxon9-dom.jar to a Java classpath you use the ANT constructs for setting a classpath, not define an ANT property.

The <ant> task does not allow adding jar files to the classpath. Please add the jar files needed by the Oxyge Webhelp transformation (license.jar, saxon9.jar, saxon9-dom.jar, etc.) in the command that starts the ANT process. I suggest starting the ANT process with a .bat script (on Windows) or a .sh script (on Mac/Linux/Unix) in which you pass the jar files to the ANT command just like in the dita.bat and dita.sh scripts that come in the Webhelp zip distribution.

If you want or have to start the ANT process using the default ANT script, called ant.bat on Windows and ant on Mac/Linux, you should add these jar files to the classpath by editing that script (ant.bat or ant). For example you can set the list of the jar files as the value of the environment variable called CLASSPATH which I see is used in the default ANT script.


Does the Webhelp transformation work for you with the dita.bat/dita.sh script called from a command line? Once you have this basic step working you can continue with adapting your current build process in order to integrate the Oxygen Webhelp transformation by following my above suggestions.


Regards,
Sorin
runleonarun
Posts: 9
Joined: Wed May 08, 2013 11:20 pm

Re: Ant file that builds webhelp

Post by runleonarun »

Hi Sorin,
Thank you! I finally got the Webhelp transformation working using the dita.sh! I wanted to use the dita.sh to set the environment variables, but I was having trouble with it. I kept getting the following error when I ran it:

Code: Select all

-sh: ./dita.sh: /bin/sh^M: bad interpreter: No such file or directory
I thought I was using it wrong, but I googled the error, and apparently there were some bad Windows characters or carriage returns in the script so I opened it in vi and ran:

Code: Select all

:set ff=unix<return>
This removed the bad characters and enabled me to finally use the script!

So now, I am trying to run the dita.sh and then use my own build file. To do this, I put the following into my shell script:

Code: Select all

realpath() {
case $1 in
/*) echo "$1" ;;
*) echo "$PWD/${1#./}" ;;
esac
}

if [ "${DITA_HOME:+1}" = "1" ] && [ -e "$DITA_HOME" ]; then
export DITA_DIR="$(realpath "$DITA_HOME")"
else #elif [ "${DITA_HOME:+1}" != "1" ]; then
export DITA_DIR="$(dirname "$(realpath "$0")")"
fi

if [ -f "$DITA_DIR"/tools/ant/bin/ant ] && [ ! -x "$DITA_DIR"/tools/ant/bin/ant ]; then
chmod +x "$DITA_DIR"/tools/ant/bin/ant
fi

export ANT_OPTS="-Xmx512m $ANT_OPTS"
export ANT_OPTS="$ANT_OPTS -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl"
export ANT_HOME="$DITA_DIR"/tools/ant
export PATH="$DITA_DIR"/tools/ant/bin:"$PATH"

NEW_CLASSPATH="$DITA_DIR/lib/dost.jar:$NEW_CLASSPATH""
NEW_CLASSPATH="$DITA_DIR:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/commons-codec-1.4.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/resolver.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/license.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/log4j.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/ant-contrib-1.0b3.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/lucene-analyzers-common-4.0.0.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/lucene-core-4.0.0.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/xhtml-indexer.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/icu4j.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/xercesImpl.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/xml-apis.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/saxonb9-1-0-8j/saxon9.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/saxonb9-1-0-8j/saxon9-dom.jar:$NEW_CLASSPATH"
if test -n "$CLASSPATH"; then
export CLASSPATH="$NEW_CLASSPATH":"$CLASSPATH"
else
export CLASSPATH="$NEW_CLASSPATH"
fi

cd "$DITA_DIR"
"$SHELL"
I edited the shell script that comes with the DITA OT to include the jars needed for the webhelp transform. The problem is that I must have missed something because I am still getting the following error:

Code: Select all

check-license:
[java]
[java] Oxygen Webhelp blah blah
[java]
[java] Oxygen Webhelp license valid, blah blah

dita.map.webhelp.init:

gen-list:
[gen-list] GenMapAndTopicListModule.execute(): Starting...
[gen-list] Using Xerces grammar pool for DTD and schema caching.
[gen-list] Processing path_to_base_dir/sbs/7_0/trunk/src/dita/JiveOnlineDocumentation.ditamap
[gen-list] GenMapAndTopicListModule.execute(): Execution time: 428 milliseconds

BUILD FAILED
path_to_base_dir/DITA-OT1.7.5LBC/plugins/org.dita.base/build_preprocess.xml:24: Failed to run pipeline: [DOTJ012F][FATAL] Failed to parse the input file 'path_to_base_dir/sbs/7_0/trunk/src/dita/JiveOnlineDocumentation.ditamap'. The XML parser reported the following error: : org.dita.dost.util.XMLGrammarPoolImplUtils cannot be cast to com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool

I run the shell script, change directories to the directory with my build script, and then type the following in the same terminal window:

Code: Select all

ant -Dargs.filter=path_to_base_dir/filters/on_prem_sys_admin_7_0.ditaval
Any ideas what that error means and what I've messed up now? Thank you again for your help!
runleonarun
Posts: 9
Joined: Wed May 08, 2013 11:20 pm

Re: Ant file that builds webhelp

Post by runleonarun »

Sorin,
I figured out something about the previous error message!

Code: Select all

...
The XML parser reported the following error: : org.dita.dost.util.XMLGrammarPoolImplUtils cannot be cast to com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool
According to http://dita-ot.sourceforge.net/1.5.3/qu ... rties.html, the args.grammar.cache can cause "a known problem with using this feature for documents that use XML Entities. " Now, I'm not sure what XML entities are, but when I set this property to "no" I get a Java memory error message instead:

Code: Select all

BUILD FAILED
path_to_basedir/shared/build.xml:32: The following error occurred while executing this line:
path_to_basedir/DITA-OT1.7.5LBC/build.xml:44: The following error occurred while executing this line:
path_to_basedir/DITA-OT1.7.5LBC/plugins/org.dita.base/build_preprocess.xml:47: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:215)
at org.apache.xerces.xni.XMLString.toString(Unknown Source)
...
I tried upping the value to:

Code: Select all

export ANT_OPTS="-Xmx2g $ANT_OPTS"
But I still get the memory error. Do you have any suggestions?
Thank you,
Leona
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hi,
runleonarun wrote:So now, I am trying to run the dita.sh and then use my own build file. To do this, I put the following into my shell script:

. . .

I run the shell script, change directories to the directory with my build script, and then type the following in the same terminal window:

Code: Select all

ant -Dargs.filter=path_to_base_dir/filters/on_prem_sys_admin_7_0.ditaval
How does your own Ant build file tie in with this last ant command? I suppose it is the Ant script that comes with DITA-OT, and this script calls the build script DITA-OT/build.xml. Do you import your own Ant build file in the DITA-OT/build.xml file?


Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

runleonarun wrote:According to http://dita-ot.sourceforge.net/1.5.3/qu ... rties.html, the args.grammar.cache can cause "a known problem with using this feature for documents that use XML Entities. " Now, I'm not sure what XML entities are, but when I set this property to "no" I get a Java memory error message instead:

. . .

I tried upping the value to:

Code: Select all

export ANT_OPTS="-Xmx2g $ANT_OPTS"
But I still get the memory error. Do you have any suggestions?
I think the OutOfMemoryError is caused by args.grammar.cache set to no. We will have to find out why you get the XML parser reported the following error about the org.dita.dost.util.XMLGrammarPoolImplUtils class. I am not sure yet what caused it.


Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Ant file that builds webhelp

Post by sorin_ristache »

Hello Leona,

Please do not add the parameter args.grammar.cache to the java command for the Webhelp transformation. For fixing the error about the org.dita.dost.util.XMLGrammarPoolImplUtils class please add this dost-patches.jar file (after you extract it from the zip archive) to your directory path_to_basedir/DITA-OT1.7.5LBC/plugins/com.oxygenxml.webhelp/lib and add the following line to your dita.sh file before the line containing dost.jar:

NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/dost-patches.jar:$NEW_CLASSPATH"

Now your dita.sh file must contain:

NEW_CLASSPATH="$DITA_DIR/plugins/com.oxygenxml.webhelp/lib/dost-patches.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR/lib/dost.jar:$NEW_CLASSPATH"
NEW_CLASSPATH="$DITA_DIR:$NEW_CLASSPATH"


This should fix the error in the Webhelp transformation.


Regards,
Sorin
Post Reply