OK, the stupid problem with my command syntax was that I didn't include ".bat" with the batch file name. After that, the commands ran.
Thanks again for your help, Derek!
If anyone reading this is also trying to hook up the DITA Toolkit, here's some advice:
Don't try and do a 2-step conversion as shown above. It's probably impossible to do so without a lot of work. I was using the two antcalls found in topic2pdf (conductor.xml) as my two distinct explicit transforms: dita.topic.fo for xml->fo and dita.fo2pdf for fo->pdf. However, that second antcall relies on finding the original xml file to generate its output. In Alfresco, the source and target filenames are incremented during each step in the transform, so you don't know what your original xml filename was when you call the second step.
However, you can't just call dita2pdf either, because that spits out a pdf file with the same nameroot as the xml source–while Alfresco is expecting a target file with a different nameroot than the source. So…. do something like this:
1) Create a copy of dita2pdf and its two sub-targets, topic2pdf and map2pdf, (all found in conductor.xml) and give them unique names.
2) Modify the two dita.fo2pdf antcalls to pass Alfresco's target filename as the "output" parameter.
3) Create a master target that will call your personalized dita2pdf.
4) Add a dirname property that derives the path from Alfresco's target file.
5) Have the master target call your custom dita2pdf, passing Alfresco's source file as "args.input" and the new dirname property as "output.dir".
Here's my Ant code:
<!– This is the target that the Alfresco transform points to –>
<target name="Alfresco.DITA-XML2PDF">
<!– Get the path of Alfresco's target file –>
<dirname property="Alfresco.target.path" file="${Alfresco.target.filename}"/>
<!– Call your custom dita2pdf target –>
<antcall target="my.dita2pdf">
<param name="args.input" value="${Alfresco.source.filename}"></param>
<param name="output.dir" value="${Alfresco.target.path}"></param>
</antcall>
</target>
<!– This is just a renamed copy of dita2pdf. Remember to rename the pointers to map2pdf and topic2pdf too. –>
<target name="my.dita2pdf" depends="dita-preprocess, my.map2pdf, my.topic2pdf"></target>
<!– A renamed copy of topic2pdf, with just one change to dita.fo2pdf… –>
<target name="my.topic2pdf" if="noMap" depends="dita-preprocess">
<antcall target="dita.topic.fo">
<param name="input" value="${dita.temp.dir}${file.separator}${user.input.file}"></param>
<param name="output" value="${dita.map.output.dir}${file.separator}${dita.topic.filename.root}.fo"></param>
</antcall>
<antcall target="dita.fo2pdf">
<param name="input" value="${dita.map.output.dir}${file.separator}${dita.topic.filename.root}.fo"></param>
<!– Change the original param value to Alfresco's target filename –>
<param name="output" value="${Alfresco.target.filename}"></param>
</antcall>
</target>
<!– Same changes as above –>
<target name="my.map2pdf" unless="noMap" depends="dita-preprocess">
<antcall target="dita.map.fo">
<param name="input" value="${dita.temp.dir}${file.separator}${user.input.file}"></param>
<param name="output" value="${dita.map.output.dir}${file.separator}${dita.map.filename.root}.fo"></param>
</antcall>
<antcall target="dita.fo2pdf">
<param name="input" value="${dita.map.output.dir}${file.separator}${dita.map.filename.root}.fo"></param>
<param name="output" value="${Alfresco.target.filename}"></param>
</antcall>
</target>
And here's my Alfresco transform bean:
<bean id="transformer.DITA-XML.PDF"
class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer"
parent="baseContentTransformer">
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandMap">
<map>
<entry key="Windows.*">
<value>ant.bat -f my_build.xml -DAlfresco.source.filename="${source}" -DAlfresco.target.filename="${target}" Alfresco.DITA-XML2PDF</value>
</entry>
</map>
</property>
<property name="errorCodes">
<value>2</value>
</property>
</bean>
</property>
<property name="explicitTransformations">
<list>
<bean class="org.alfresco.repo.content.transform.ContentTransformerRegistry$TransformationKey" >
<constructor-arg><value>text/xml</value></constructor-arg>
<constructor-arg><value>application/pdf</value></constructor-arg>
</bean>
</list>
</property>
</bean>