Page 1 of 1

get key value from keyref

Posted: Thu Mar 19, 2015 5:52 pm
by xavier_declercq
Hello,

We are building our own DITA Map extensions bundle to customize oXygen.

I am struggling trying to retrieve the value of the keyword refered by a keyref when the user saves the document. The keyword is located in an external subject scheme
I am capturing the save action inside the WSEditorListener#editorAboutToBeSavedVeto method. This is apparently working.
I can even list the key URL with the DITAAccess.resolveKeyRef method but I don't know how to get the value it refers.

Can you please help ?

Thanks in advance.

Xavier

Re: get key value from keyref

Posted: Fri Mar 20, 2015 12:03 pm
by alex_jitianu
Hello Xavier,

I believe you can get what you want like this:

Code: Select all


LinkedHashMap<String, KeyInfo> keys = DITAAccess.getKeys(originatorURL);
MetaContentProvider metaContentProvider = keys.get("myKey").getMetaContentProvider();
if (metaContentProvider != null) {
String content = metaContentProvider.getContent(" topic/keyword ");
}
Best regards,
Alex

Re: get key value from keyref

Posted: Fri Mar 20, 2015 12:58 pm
by xavier_declercq
Hello Alex,

Thanks for the reply.

I tried your described solution but the problem is that the MetaContentProvider retrieved is null. And I don't understand why...

Re: get key value from keyref

Posted: Fri Mar 20, 2015 1:13 pm
by alex_jitianu
Hello Xavier,

Can you send me some small DITA samples on support@oxygenxml.com so I can test it myself and draw a conclusion?

Best regards,
Alex

Re: get key value from keyref

Posted: Thu Mar 26, 2015 5:35 pm
by Radu
Hi Xavier,

Thanks for the samples.
You seem to define keyword metadata directly on subjectdefs like:

Code: Select all

<subjectdef keys="Technicalengineer"><topicmeta><keywords><keyword>Technical engineer</keyword></keywords></topicmeta></subjectdef>
and right now Oxygen does not gather the metadata from subjectdef keys.
We will try to rectify this.

Could you tell me more about why you want to get the keyref value in the first place?

Regards,
Radu

Re: get key value from keyref

Posted: Mon May 18, 2015 3:30 pm
by Radu
Hi Xavier,

Just to update the thread, the issue should be fixed in Oxygen 17.0.

Regards,
Radu