What controls copy of non-DITA files to output folder

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

What controls copy of non-DITA files to output folder

Post by ann.jensen »

Hi,
I have recently added an Object element to render an mp4 video within a topic. This video file lives in my project file structure but is not being copied over to output folder at transformation time and therefore I am getting an error in my transformed WebHelp.
I know I have done this before with Excel files which are xrefed from topics but cannot remember what controls the copying of non-DITA files to output folder.
Any advice appreciated,
Regards,
Ann
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: What controls copy of non-DITA files to output folder

Post by ann.jensen »

I have since discovered the transformation parameter

Code: Select all

webhelp.custom.resources
Regards,
Ann
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: What controls copy of non-DITA files to output folder

Post by Radu »

Hi Ann,

The WebHelp output generated from the DITA OT bundled with Oxygen 18.1 should also have some special media support, including the ability to automatically copy the videos to the output folder:

https://www.oxygenxml.com/doc/versions/ ... hing2.html

Are you using our way of specifying the reference to the media files or do you have your own customization?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: What controls copy of non-DITA files to output folder

Post by ann.jensen »

Hi Radu,
Yes I have used the insert a reference to a media resource link to add the video to my topic. The DITA generated for this is as follows:

Code: Select all

<object data="../resource_files/videos/Market_Place.mp4" outputclass="video" type="video/mp4" height="150"/>
.
After transforming to WebHelp, the following HTML is generated:

Code: Select all

<video height="150" controls="controls"><source src="../resource_files/videos/Market_Place.mp4" type="video/mp4"></video>
but the folder and file

Code: Select all

/videos/Market_Place.mp4
are not copied to the output folder and so I get an Invalid Source error on my HTML page when viewing it.
Regards,
Ann
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: What controls copy of non-DITA files to output folder

Post by Radu »

Hi Ann,

That should have worked to automatically copy the movie, I can make some tests on my side...Is the folder resource_files in a place outside of the folder where the main published DITA Map is located?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: What controls copy of non-DITA files to output folder

Post by ann.jensen »

Thanks Radu,
The video file is located in

Code: Select all

C:\DevBranches\DocService_devel\AGS_Documentation\system_documentation\dita_files\resource_files\videos

The root map is located in

Code: Select all

C:\DevBranches\DocService_devel\AGS_Documentation
The containing topic is located in

Code: Select all

C:\DevBranches\DocService_devel\AGS_Documentation\system_documentation\dita_files\market\c_our_market.dita
Regards,
Ann
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: What controls copy of non-DITA files to output folder

Post by Radu »

Hi Ann,

So if you search in the output folder for "*.mp4", there is no file there, in any folder, right?
I cannot reproduce the problem on our side.
You can go to the Preferences->DITA page and choose to always show the console output.
If after publishing you look in the DITA OT console output and search for copyMediaAudioAndVideo, can you find that anywhere, that is the step which should copy the images.
The DITA OT 2.x bundled with Oxygen 18.1 has a plugin OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.media which has a build_custom.xml which copies all videos from the input folder to the output folder.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: What controls copy of non-DITA files to output folder

Post by ann.jensen »

Hi Radu,
The relevant output from my transform is as follows:

Code: Select all

copyMediaAudioAndVideo:

copy-image:
[copy] Copying 1351 files to C:\DevBranches\DocService_devel\AGS_Documentation\out\webhelp-responsiveAGS

copy-html:
File file:/C:/Users/ajensen/AppData/Local/Temp/OxygenXMLTemp/ditaTemporaryOutputDir-1481884736060/t1/t2/t3/t4/t5/system_documentation/dita_files/resource_files/msp/Johnny%20file%2015_1015.xlsx not found
File file:/C:/Users/ajensen/AppData/Local/Temp/OxygenXMLTemp/ditaTemporaryOutputDir-1481884736060/t1/t2/t3/t4/t5/system_documentation/dita_files/resource_files/videos/Market_Place.mp4 not found
File file:/C:/Users/ajensen/AppData/Local/Temp/OxygenXMLTemp/ditaTemporaryOutputDir-1481884736060/t1/t2/t3/t4/t5/videos/ICMP%20Video%20One.mp4 not found
[copy] Copying 152 files to C:\DevBranches\DocService_devel\AGS_Documentation\out\webhelp-responsiveAGS
I don't understand why it is looking in that folder when the folder configured for the Temporary files directory in the Output tab for the transformation scenario is

Code: Select all

${cfd}/temp/webhelp-responsiveAGS
Any advice appreciated,
Regards,
Ann
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: What controls copy of non-DITA files to output folder

Post by Radu »

Hi Ann,

Somehow looking at your log output I noticed you are have the custom "fix.external.references" parameter set. And indeed setting this parameter on my side I can reproduce the problem. I will add an issue on our side. You can probably modify the build file and specify a hardcoded path to the input folder instead of using the ${user.input.dir} param which in this case does not properly work.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: What controls copy of non-DITA files to output folder

Post by Radu »

Hi,

I tried a possible fix in the build_custom.xml and it would look like this:

Code: Select all

<project basedir="." name="Custom media processing">
<target name="copyMediaAudioAndVideo">
<basename property="output.dir.file.name" file="${output.dir}/"/>
<basename property="temp.dir.file.name" file="${dita.temp.dir}/"/>
<property name="destinationProperty" value="${user.input.dir}"/>
<script language="javascript">
<![CDATA[
var originalBase = project.getProperty('env.com.oxygenxml.original.map.base.location');
if(originalBase != null && originalBase.startsWith('file:/')){
originalBase = originalBase.substring(6);
originalBase = originalBase.replace('%20', ' ');
originalBase = originalBase.substring(0, originalBase.lastIndexOf("/") + 1);
project.setProperty('destinationProperty', originalBase);
}
]]>
</script>
<copy todir="${output.dir}/" failonerror="no">
<fileset dir="${destinationProperty}">
<include name="**/*.mp3"/>
<include name="**/*.mp4"/>
<include name="**/*.avi"/>
<!-- EXM-37863 Avoid copying resources from output and temp folders when
they are in the DITA Map folder...-->
<exclude name="**/${output.dir.file.name}/**"/>
<exclude name="**/${temp.dir.file.name}/**"/>
</fileset>
</copy>
</target>
</project>
Thing is that when the external references fixup is done, Oxygen uses a custom temporary folder as the place where the original map will be copied so the information about the folder of the original DITA Map is only kept in an environmental variable which can be used.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: What controls copy of non-DITA files to output folder

Post by Radu »

Hi,

Just to update this thread, Oxygen 19.0 should have this problem fixed.

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