Page 1 of 1

WebHelp customization error

Posted: Tue Mar 16, 2021 10:08 am
by tmakita
Hi,

I'm developing WebHelp Responsive custom ant processing. But I encountered when DITA-OT process comes into my target.

[Error message]
whr-copy-resources:

html5.css:

html5.copy-css-user:

ah-whr-index:

ah-whr-index-topic:
[mkdir] Created dir: D:\My_Documents\XML2021\XXXXXX\WebHelpSample\temp\webhelp-responsive\search-index
XML utils not found from Ant project reference
Store not found from Ant project reference

BUILD FAILED
D:\DITA-OT\oxygen-publishing-engine-3.x\plugins\org.dita.base\build.xml:29: The following error occurred while executing this line:
D:\DITA-OT\oxygen-publishing-engine-3.x\plugins\com.antennahouse.wh.index\add-build.xml:6: The following error occurred while executing this line:
D:\DITA-OT\oxygen-publishing-engine-3.x\plugins\com.antennahouse.wh.index\add-build.xml:15: java.lang.NullPointerException: Cannot read field "tempDir" because "job" is null
at org.dita.dost.ant.ExtensibleAntInvoker.getJob(ExtensibleAntInvoker.java:328)
at org.dita.dost.ant.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:173)

[com.antennahouse.wh.index/plugin.xml]

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<plugin id="com.antennahouse.wh.index">
    <require plugin="com.oxygenxml.webhelp.responsive" />
    <feature extension="com.oxygenxml.responsive.internal.target.dependencies.topics.html" value="ah-whr-index, dita.topics.html.common" type="text" />
    <feature extension="ant.import" file="add-build.xml"/>
</plugin>
[The customized ant script: add-build.xml]

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:dita="http://dita-ot.sourceforge.net" xmlns:if="ant:if" xmlns:unless="ant:unless" name="ah-whr-index">

    <!-- Generate XML file for search index -->
    <target name="ah-whr-index">
        <antcall target="ah-whr-index-topic"/>
        <antcall target="ah-whr-index-json"/>
    </target>
    
    <!-- topic to XML -->
    <target name="ah-whr-index-topic" xmlns:if="ant:if">
        <property name="topic.index.xsl" value="${dita.plugin.com.antennahouse.wh.index.dir}/xsl/dita2html5_topic_index_shell.xsl"/>
        <property name="temp.topic.index.dir" value="search-index"/>
        <mkdir dir="${dita.temp.dir}${file.separator}${temp.topic.index.dir}"/>
        <pipeline message="Generating search index from DITA topic" taskname="xslt">
            <xslt basedir="${dita.temp.dir}" 
                destdir="${dita.temp.dir}${file.separator}${temp.topic.index.dir}"  
                reloadstylesheet="${webhelp.reload.stylesheet}"
                style="${topic.index.xsl}"
                extension="xml"
                filenameparameter="PRM_PROCESSING_FILE_NAME"
                filedirparameter="PRM_PROCESSING_FILE_DIR"
                classpathref="wh_classpath">
                <ditafileset format="dita" processingRole="normal"/>
                <xmlcatalog>
                    <catalogpath path="${dita.plugin.org.dita.base.dir}/catalog-dita.xml"/>
                </xmlcatalog>
                <param name="PRM_LANG" expression="${webhelp.language}" if:set="webhelp.language"/>
            </xslt>
        </pipeline>
    </target>
    
    <!-- XML files to document level single JSON
         Prepare bulk operation 
     -->
    <target name="ah-whr-index-json" xmlns:if="ant:if">
        <property name="index.json.xsl" value="${dita.plugin.com.antennahouse.wh.index.dir}/xsl/dita2html5_index_json_shell.xsl"/>
        <property name="index.xml.list" value="${dita.temp.dir}${file.separator}${temp.topic.index.dir}"/>
        <fileset id="index.xml.files" dir="${dita.temp.dir}${file.separator}${temp.topic.index.dir}" includes="**/*"/>
        <pathconvert pathsep="&#x20;" refid="index.xml.files" property="index.xml.files"/>
        <makeurl file="${dita.temp.dir}" property="dita.temp.dir.url"/>
        <!-- ここでindex.xmlには変換済みのXMLファイルが空白区切りで入っている ${temp.topic.index.dir}/~.xml
             入力ファイルの${dita.temp.dir}${file.separator}${user.input.file}はダミー
         -->
        <xslt basedir="${dita.temp.dir}"
            in="${dita.temp.dir}${file.separator}${user.input.file}"
            out="${output.dir}/index.json"
            style="${index.json.xsl}"
            force="true"
            classpathref="wh_classpath">
            <factory name="net.sf.saxon.TransformerFactoryImpl">
                <!-- Output timing information -->
                <attribute name="http://saxon.sf.net/feature/timing" value="${output.saxon.timing}"/>
                <!-- Suppress namespace warning -->
                <attribute name="http://saxon.sf.net/feature/suppressXsltNamespaceCheck" value="true"/>
                <!--Assert-->
                <attribute name="http://saxon.sf.net/feature/enableAssertions" value="true"/>
                <!-- Trace -->
                <!--attribute name="http://saxon.sf.net/feature/traceListenerClass" value="net.sf.saxon.trace.XSLTTraceListener"/-->
            </factory>
            <param name="PRM_INDEX_XML_FILES" expression="${index.xml.files}" if:set="index.xml.files"/>
            <param name="PRM_GENERATE_JSON_FOR_CURL" expression="${gen.json.for.curl}" if:set="gen.json.for.curl"/>
            <xmlcatalog>
                <catalogpath path="${dita.plugin.org.dita.base.dir}/catalog-dita.xml"/>
            </xmlcatalog>
        </xslt>
        
    </target>

</project>
As I'm new to WebHelp customization, any help is appreciated!

Regards,

Re: WebHelp customization error

Posted: Tue Mar 16, 2021 10:17 am
by Radu
Hi Toshihiko,

I had similar problems when I updated the WebHelp plugins to work with DITA OT 3.6, Jarno adviced me to set on every "antcall" element the "inheritRefs="true"" attribute:

https://github.com/dita-ot/dita-ot/issu ... -750875121

Regards,
Radu

Re: WebHelp customization error

Posted: Tue Mar 16, 2021 11:25 am
by tmakita
Hi Radu,

Thank you for your quick reply.

Your advice worked like a charm!!

Regards,