Page 1 of 1

Customize link action

Posted: Wed Mar 23, 2016 10:11 am
by Denis
Hi,
we are using Eclipse Oxygen Author 17.1.

We are using a CMS for storing the documents. If the user want to edit a file, the file will be downloaded and when it's done the oxygen editor opens. If that document contains a xref, we usually do not download it. In this case the oxygen underline the xref in red and in the result view occurs a file not found message.

Where I can remove the underline and the file not found message in the result view?

If I click on the link anchor of the xref a dialog pop up and give me the opportunity to create a new file. I would remove the dialog and download the referenced file.
What I have to do to achieve this requirements?

Best regards
Denis

Re: Customize link action

Posted: Wed Mar 23, 2016 2:44 pm
by Radu
Hi Denis,

To explain a little bit how this works, in one of the CSSs we use for DITA rendering there is a selector like:

Code: Select all

*[class~="topic/link"][href]:empty,
*[class~="topic/xref"][href]:empty,
*[class~="topic/link"][type][href]:empty,
*[class~="topic/xref"][type][href]:empty {
content: oxy_getSomeText(oxy_link-text(), 150, true);
}
The called oxy_getSomeText CSS extension function ends up calling a special DITA implementation called ro.sync.ecss.extensions.dita.link.DitaLinkTextResolver.

So you have the following options:

1) In the Oxygen plugin.xml there is an extension point called ditaLinkTextResolverCustomizer which allows you to setup a custom Java class which would take care of computing the link text.

2) Overwrite that CSS selector I mentioned to avoid calling the oxy_link-text() function.
3) Use the code from DitaLinkTextResolver to create your own link text resolver.

I would recommend (1).

Regards,
Radu