"Replace All References with Content" Question

GingerSnap
Posts: 4
Joined: Fri Dec 12, 2014 8:28 pm

"Replace All References with Content" Question

Post by GingerSnap » Wed Jan 02, 2019 3:01 am

I am looking to perform this action on a set of files - like an entire ditamap. Is that possible, or do I have to do it by opening each file?

The description here
https://www.oxygenxml.com/xml_editor/whatisnew20.1.html
says this...
>Resolve References
>A new action called "Replace All References with Content" is available when editing DITA documents. It replaces all referenced
>fragments (keyrefs, conrefs, or conkeyrefs) in the current document with the actual referenced content.

which makes it sound like it only works on the current document.

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

Re: "Replace All References with Content" Question

Post by Radu » Mon Jan 07, 2019 10:13 am

Hi,

The action works right now only on the current opened DITA topic.
Possibly a plugin for Oxygen could be implemented to achieve what you want (batch apply the action on a set of topics). If we manage to find the time to implement such a plugin we'll update this thread. Or if you are a Java developer I could try to give you more details about how to use our Oxygen SDK to implement such a plugin.
Can you tell me more about your use case?

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

GingerSnap
Posts: 4
Joined: Fri Dec 12, 2014 8:28 pm

Re: "Replace All References with Content" Question

Post by GingerSnap » Mon Jan 07, 2019 8:53 pm

Hi Radu,

I am not a Java developer but always willing to learn. My team have been able to make some plugins in the past.

The use case is for localization. The content is sent out for localization in the DITA source format.
Our authors use variables for product names and conref the product names into titles and phrases.

The localization folks have informed us that some of the titles and phrases are not exactly translated correctly because they translate the product names in the variables file separately from the surrounding text in the title or phrase. They have asked that the source content be sent to them with the conrefs already resolved, so that they can translate the entire phrase at once.

I have been able to write a python script that pulls in the variables and replaces them based on making a dictionary of the variables file and search and replace as needed, but that is a bit of a hack in the elegance of our tool workflow, so being able to do it in Oxygen would be preferable.

Also, it is easy-ish to do with the variables file. I haven't thought about what it would take to do with bigger conrefs.
Also, full disclosure, we will probably go to using keys in 2019, but in the big picture I think the issue is the same.

Thanks

Cosmin Duna
Posts: 4
Joined: Wed Dec 12, 2018 5:33 pm

Re: "Replace All References with Content" Question

Post by Cosmin Duna » Thu Jan 10, 2019 4:37 pm

Hi,

We created a sample javascript plugin that can help you:
https://github.com/oxygenxml/wsaccess-j ... tResources
For install this, you should copy the 'performAuthorActionOnProjectResources' folder in the 'plugins' directory from the Oxygen.

You have the information in the 'README.md' section for customize this.

Regards,
Cosmin

Post Reply