Transform copy media issue

Post here questions and problems related to editing and publishing DITA content.
SD-Dave
Posts: 6
Joined: Wed Mar 22, 2017 10:46 pm

Transform copy media issue

Post by SD-Dave »

When I run the DITA-OT PDF or WebHelp Responsive transformations, the software copies lots of unrelated files into the output directory subfolders. What makes it do this and how do I stop it?

The files seem to be from random locations on my hard drive.

Dave
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transform copy media issue

Post by Radu »

Hi Dave,

Thanks for the additional details you sent via email.
What kind of extra files end up being copied to the output folder? Are they videos?
There is a custom Oxygen publishing plugin which tries to copy all the videos referenced in the DITA content to the output folder.
If you look in this ANT build file:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT2.x/plugins/com.oxygenxml.media/build_custom.xml

which does something like this:

Code: Select all

        <copy todir="${output.dir}/" failonerror="no">
<fileset dir="${destinationProperty}">
<include name="**/*.mp3"/>
<include name="**/*.mp4"/>
<include name="**/*.avi"/>
<exclude name="**/${output.dir.file.name}/**"/>
<exclude name="**/${temp.dir.file.name}/**"/>
</fileset>
</copy>
So you may want to remove this task from the build file.
Could you tell me more about your project? Do you refer to videos in the DITA topics? Do you refer to them as references or by trying to embed the videos in the HTML output?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SD-Dave
Posts: 6
Joined: Wed Mar 22, 2017 10:46 pm

Re: Transform copy media issue

Post by SD-Dave »

Hi, Radu,

There are no videos in my project. However, after experimentation I have somehow fixed the problem. It appears to be related to the project file structure and location of the master map file, as well as to the parameter settings for the DITA transformation.

When the problem appeared, I noticed folders in the "output" directory that should not be present. For example, there was one called Documents and another called "Out". If I drill down into those folders I see that very long paths were created, with temporary files, MP3 files, etc. at the end of the trail. here is one such path (one of many):

C:\Users\David\Documents\Personal\DITA-and-XML\Maps\out\webhelp-responsive\Documents\Personal\DITA-and-XML\QSR-Drum-Synth\out\webhelp\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5

I moved the project so that the map file is in a folder one level below the My Documents folder. I then set the "args.input.dir" and "output.dir" parameter values (they are blank by default), and used hard paths to the locations on my hard drive. Then I ran the transformation and the output files were correct. The transform did not attempt to copy unrelated files to the output directory tree. Seems like there are bugs in the transformations. Is that possible?

Thanks
Dave
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transform copy media issue

Post by Radu »

Hi Dave,

Usually as a best practice with a DITA project you should have a separate project folder containing both the main DITA Map and the topics (which can be located in subfolders in that separate folder structure). In this way you can quickly move or export your project folder.
That specific part of the publishing process which copies movies to the output folder looks in the folder where the published DITA Map is located so indeed if your DITA map was places in the "My Documents" folder it recursively went through and copied all movies found there to the transformation output folder. We have plans to improve on this behavior in a future version and I added a link to this thread post to the opened internal issue, we will update this thread when we make additional fixes for this behavior.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SD-Dave
Posts: 6
Joined: Wed Mar 22, 2017 10:46 pm

Re: Transform copy media issue

Post by SD-Dave »

Hi, Radu. Thanks for the advice on folder structures and best practices. I had seen this information previously, and do in fact adhere to this. The base project folder contains my dita map, and folders for Concepts, Tasks, Reuse, Images, Glossary and the Out folder. The transforms put the files in the Out folder. Everything works now that I have moved the folder to the My Documents location. When it was placed several levels below the My Documents location is when I had problems. But note that I also changed to hard paths instead of relative paths in the arguments of the transform parameters "args.input.dir" and "output.dir". I am not sure which change fixed the issue I was having, but there seems to be a bug unrelated to the video issue you are describing.
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transform copy media issue

Post by Radu »

Hi Dave,

The args.input.dir parameter should almost never be specified explicitly. By default it resolves to the folder where the published DITA Map is located.

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