Page 1 of 1

Refactoring > Move Resource for Multiple Files

Posted: Thu Mar 12, 2020 2:47 am
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!

Re: Refactoring > Move Resource for Multiple Files

Posted: Thu Mar 12, 2020 2:41 pm
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

Re: Refactoring > Move Resource for Multiple Files

Posted: Thu Mar 12, 2020 2:46 pm
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).

Re: Refactoring > Move Resource for Multiple Files

Posted: Thu Mar 12, 2020 5:10 pm
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

Re: Refactoring > Move Resource for Multiple Files

Posted: Fri Mar 13, 2020 8:13 am
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.

Re: Refactoring > Move Resource for Multiple Files

Posted: Tue Mar 17, 2020 4:10 am
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!