Page 1 of 1
"Replace All References with Content" Question
Posted: Wed Jan 02, 2019 3:01 am
by GingerSnap
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.
Re: "Replace All References with Content" Question
Posted: Mon Jan 07, 2019 10:13 am
by Radu
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
Re: "Replace All References with Content" Question
Posted: Mon Jan 07, 2019 8:53 pm
by GingerSnap
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
Re: "Replace All References with Content" Question
Posted: Thu Jan 10, 2019 4:37 pm
by Cosmin Duna
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