Adding Many Ditamaps to Find Unreferenced Resources

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

Adding Many Ditamaps to Find Unreferenced Resources

Post by jmorales »

Hi, I was just experimenting with the Find Unreferenced Resources feature in Oxygen XML Author 24.0. The difficulty is that I have more than 700 ditamaps and they are located in dozens of different folders. The Add window allows me to search for ditamaps across multiple folders, but I can only add multiple ditamaps at a time if they are all located in the same folder. This means that I have to go to the Add window many times, search again, selecting all the files from a given folder, and then restarting the process to find the next folder full of ditamaps. It would take all day to specify all the ditamaps that I want, and even then, there doesn't seem to be a way to save that list for reuse. Is there any way to select all the ditamaps in a given folder AND all its subfolders? Or can I somehow import the list of ditamaps from the Main Files list? If there isn't a direct/supported way to do this, is there some kind of indirect hack that I could use, perhaps by opening some Oxygen temporary file or configuration file and pasting in a list of ditamaps? I looked in the project file but I don't see anything promising there. Thanks for any suggestions!

P.S. Maybe our ditamaps shouldn't be in so many different folders, but it's too late to fix that now.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adding Many Ditamaps to Find Unreferenced Resources

Post by Radu »

Hi,

I added an internal issue with your use case. Maybe we could add an action in the Project view so that when you select only DITA Maps you could right click and have a "Find Unreferenced Resources" action directly in the contextual menu, action which would use by default the selected maps. I added an internal issue for this.
In the meantime maybe you can create a DITA Map which references all others, not used for publishing or as a main file, just for finding unreferenced resources. Maybe store this extra map in some subfolder so that people do not get confused in considering it a standalone dita map.

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

Re: Adding Many Ditamaps to Find Unreferenced Resources

Post by jmorales »

Thanks, Radu, both for tracking this as a potential new feature, and for suggesting a workaround. The method you suggest, of creating a single ditamap with references to all the others, will take some significant time to create (since we have 700+ ditamaps). However, once it's done, it will be reusable, so it may be worth the effort.

By the way, I didn't see your reply for several days because the Oxygen forum doesn't list this thread when I go to the "Your Posts" view. This is odd, since it gives a list of all the other posts that I have made. Maybe it'll show up in the "Your Posts" view after I add this reply.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adding Many Ditamaps to Find Unreferenced Resources

Post by Radu »

Hi,

I have no idea about the forum's lack of notifications to you about this thread. If the problem persists I can add an internal issue for our web admins.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Adding Many Ditamaps to Find Unreferenced Resources

Post by chrispitude »

I would also find this useful, and just like for jmorales, the tricky aspect of the context menu idea (which would still be useful!) would be when the .ditamap files are distributed throughout some large directory structure and thus are not easily selectable in the Project view.

On my Windows laptop, WSL gives me access to a linux environment, and so I can run something like

Code: Select all

find -name '*.ditamap' | sed 's#\(.*\)#<mapref href="\1"/>#'
to construct <mapref> elements from all the .ditamap files in any arbitrarily deep directory structure. But my writers would not have the environment or the ability to use this approach.

I think separating the Project view file selection aspect from the Find Unreferenced Resources feature would be useful. For example, if there were some dialog to multi-select files in the Project view in fancy ways (patterns, directory recursion, inclusion/exclusion), then that could be used to selectively apply multiple other features, such as finding unreferenced files, format and indent, refactoring, and so on.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adding Many Ditamaps to Find Unreferenced Resources

Post by Radu »

Hi,

Right now we have these two already registered internal issues:

EXM-52097 Find Unreferenced Resources - invoke on DITA OT Project files
EXM-49312 Find Unreferenced Resources - invoke on selected DITA Maps from Project view

but maybe in my opinion it would be easier just to add in the "Find Unreferenced Resources" dialog a checkbox to take the "Main Files" folder into account, folder which may contain DITA Maps or DITA OT project files.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Adding Many Ditamaps to Find Unreferenced Resources

Post by chrispitude »

Hi Radu,

I like your idea of running Find Unreferenced Files on Main Files!

As an alternative to the checkbox, perhaps it could also be invoked from the Project view, by selecting the Main Files folder then selecting Find Unreferenced Files from the context menu. This would make the requested behaviors as follows:

image.png
image.png (127.7 KiB) Viewed 686 times

(Although a checkbox for Main Files is fine too!)

The Main Files idea is quite useful for finding files unused by all our help collections, but it is not a replacement for specifying some arbitrary set of DITA-OT project files or .ditamap files:
  • Sometimes, deletion of completely unused files is not the goal. For example, it might be useful to find files in a common directory that are used by some maps or help collections but unused by others, so they can be moved/reorganized.
  • The input maps are not always in Main Files. For example, we have release notes and application notes maps that are not in Main Files because they are not published as part of any DITA-OT project file help collections. It would still be useful to invoke the feature on these maps from the Project view.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adding Many Ditamaps to Find Unreferenced Resources

Post by Radu »

Hi Chris,
Thanks, I will add your suggestions on the opened issue.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply