Refactoring > Move Resource for Multiple Files

Post here questions and problems related to editing and publishing DITA content.
jmorales
Posts: 93
Joined: Tue Oct 30, 2018 9:47 pm

Refactoring > Move Resource for Multiple Files

Post by jmorales »

Hi, We're using Oxygen Author with Sourcetree. We have about 10,000 topics that are in incorrect folders, and we want to move them to different folders without breaking links. Is there any safe way to do this except by selecting each topic one by one in the Project pane and doing Refactoring > Move Resource?

Ideally, we would like to open a ditamap and do a find on all topics in that map that belong to a certain folder. Then, we would want to select all those files as a group and move them to a different folder, without breaking any links (even if the topics are also used by other ditamaps).

Thanks for any suggestions!
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Refactoring > Move Resource for Multiple Files

Post by sorin_carbunaru »

Hello Joseph,

If the number of topics had not been so big, you could have moved them by means of drag-and-drop in the Project view, with the Master Files support turned on. If you have entire folders that you want to move, you could use drag-and-drop on those folders.

You could also use "Find/Replace in Files" from the contextual menu of the resources in Project view... If we get more ideas, we'll get back to you :).

Best wishes,
Sorin Carbunaru
oXygen XML
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Refactoring > Move Resource for Multiple Files

Post by sorin_carbunaru »

By the way, I also added your vote to an issue stating that perhaps we should make "Move resource" work on multiple files in the Project view (EXM-38832).
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Refactoring > Move Resource for Multiple Files

Post by Radu »

Hi,

One possibility to do this would be to maybe follow these steps:

1) Apply an XSLT stylesheet on the DITA Map and obtain a sequence of comma separated file names for the files that you want to include, like:

Code: Select all

f1.dita,f2.dita,etc
2) In the Project view there is a Setting drop down menu in which you can use the "Filters" action to define filters for the project.
Set the "Matching files will be shown" to the value of that comma separated list of file names.

3) Now you can expand that folder and only those files will be shown, you can select all of them and drag and drop them to another folder. If the master files support is enabled and the main DITA Maps are added as master files, Oxygen should ask you if you want to update all links as well.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jmorales
Posts: 93
Joined: Tue Oct 30, 2018 9:47 pm

Re: Refactoring > Move Resource for Multiple Files

Post by jmorales »

Thanks Sorin and Radu, I'm going to try out your suggestions tomorrow. I'll post again when I've had a chance to experiment. Also, I appreciate your adding my vote to the new feature request for refactoring multiple files.
jmorales
Posts: 93
Joined: Tue Oct 30, 2018 9:47 pm

Re: Refactoring > Move Resource for Multiple Files

Post by jmorales »

We had success with Radu's suggestion. One of my colleagues created a plugin that uses XSLT to output files containing all the topics and images used in the DITA map hierarchy. Then we are able to cut and paste these into the filter in the Project pane and move the files easily. Thanks again for your help!
Post Reply