Tool-tip Acronym Expansions
Are you missing a feature? Request its implementation here.
-
- Posts: 37
- Joined: Wed Jun 19, 2013 1:49 am
Tool-tip Acronym Expansions
I'm creating a document that contains many acronyms. As I'm reading through the document, I continually have to look up the acronym I'm currently readying (my memory isn't good enough to remember so many acronyms). It would be nice if I could simply hover my cursor over an acronym, and have the definition pop-up. I suspect this might not be too difficult to accomplish in HTML, but I'm wondering if oXygen XML Editor includes support for this. If it doesn't, then could you add support for it? Also, is there an oXygen SDK that I could use to program support for this?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tool-tip Acronym Expansions
Hi,
It would be great if you could give us more details:
What Oxygen version are you using?
What XML vocabulary are you using?
Are you editing in the Text mode or in the Author visual editing mode?
Regards,
Radu
It would be great if you could give us more details:
What Oxygen version are you using?
What XML vocabulary are you using?
Are you editing in the Text mode or in the Author visual editing mode?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tool-tip Acronym Expansions
Hi,
So, as an overview, you are using the DITA <abbreviated-form> element with a keyref to refer to glossentries.
And when you hover over the abbreviated form (which already renders the term) in the Author mode you are interested in having a tooltip which shows the larger description of the abbreviated form, right?
This would make an interesting future improvement in Oxygen so I will add an issue on my side, we will update this thread when we manage to implement this.
If you want to do this yourself, in Oxygen 18.0 (latest version on web site) we added support to control the tooltips via the API:
Our Maven-based SDK is located here, you need to register for free to access it:
https://www.oxygenxml.com/oxygen_sdk_maven.html
There is a type of Oxygen plugin extension called Workspace Access plugin. There is a sample in the SDK.
This type of plugin extension receives a callback when the application starts, then it can add a listener and when a new XML file is opened in the Author visual editing mode, add on it a tooltip customizer. The code would look something like:
Regards,
Radu
So, as an overview, you are using the DITA <abbreviated-form> element with a keyref to refer to glossentries.
And when you hover over the abbreviated form (which already renders the term) in the Author mode you are interested in having a tooltip which shows the larger description of the abbreviated form, right?
This would make an interesting future improvement in Oxygen so I will add an issue on my side, we will update this thread when we manage to implement this.
If you want to do this yourself, in Oxygen 18.0 (latest version on web site) we added support to control the tooltips via the API:
Our Maven-based SDK is located here, you need to register for free to access it:
https://www.oxygenxml.com/oxygen_sdk_maven.html
There is a type of Oxygen plugin extension called Workspace Access plugin. There is a sample in the SDK.
This type of plugin extension receives a callback when the application starts, then it can add a listener and when a new XML file is opened in the Author visual editing mode, add on it a tooltip customizer. The code would look something like:
Code: Select all
/**
* @see ro.sync.exml.workspace.api.listeners.WSEditorChangeListener#editorOpened(java.net.URL)
*/
@Override
public void editorOpened(final URL editorLocation) {
WSEditor openedEditor = pluginWorkspaceAccess.getEditorAccess(editorLocation, PluginWorkspace.MAIN_EDITING_AREA);
WSEditorPage currentEditingPage = openedEditor.getCurrentPage();
if(currentEditingPage instanceof WSAuthorEditorPage){
((WSAuthorEditorPage)currentEditingPage).addTooltipCustomizer(new AuthorTooltipCustomizer() {
@Override
public void customizeTooltip(AuthorAccess authorAccess, TooltipInformation tooltipInformation) {
if(tooltipInformation.getHoveredNode() instanceof AuthorElement){
AuthorElement hovered = ((AuthorElement)tooltipInformation.getHoveredNode());
if("abbreviated-form".equals(hovered.getLocalName())){
AttrValue keyrefAttr = hovered.getAttribute("keyref");
if(keyrefAttr != null){
String keyref = keyrefAttr.getValue();
KeyInfo keyInfo = DITAAccess.getKeys(editorLocation).get(keyref);
if(keyInfo != null){
URL locationOfGlossaryFile = keyInfo.getHrefLocation();
//TODO Now you can parse the glossary file, extract that information from it.
tooltipInformation.setDescription("NEW TOOLTIP MESSAGE COMPUTED BY YOUR CODE...");
}
}
}
}
}
});
}
}
}, PluginWorkspace.MAIN_EDITING_AREA);
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 37
- Joined: Wed Jun 19, 2013 1:49 am
Re: Tool-tip Acronym Expansions
I don't want the tooltip in the Author mode. I want it in the transformed result. E.g., In the resulting WebHelp version of the documentation. The tooltip is for my audience, not for me (the author). 

-
- Posts: 37
- Joined: Wed Jun 19, 2013 1:49 am
Re: Tool-tip Acronym Expansions
I think I've discovered the way to accomplish this. It is to use glossary entries http://oxygenxml.com/doc/m/dita1.2_spec ... entry.html.
In this topic, it says "One possible implementation of a glossary in online processing is to associate a hotspot for mentions of terms in <term> elements and display the definition on hover or click."
Can you please provide me with an example that shows exactly how to do this?
Thanks,
Chris.
In this topic, it says "One possible implementation of a glossary in online processing is to associate a hotspot for mentions of terms in <term> elements and display the definition on hover or click."
Can you please provide me with an example that shows exactly how to do this?
Thanks,
Chris.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tool-tip Acronym Expansions
Hi Chris,
The DITA specification has an example:
https://www.oxygenxml.com/dita/1.3/spec ... -form.html
which shows how the glossentry topic looks like, how it's referred in the DITA Map and how the abbreviated-form is used in a topic.
Regards,
Radu
The DITA specification has an example:
https://www.oxygenxml.com/dita/1.3/spec ... -form.html
which shows how the glossentry topic looks like, how it's referred in the DITA Map and how the abbreviated-form is used in a topic.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 37
- Joined: Wed Jun 19, 2013 1:49 am
Re: Tool-tip Acronym Expansions
I checked the example that you referred me to, but I'm afraid it doesn't do what I want.
When I hover my mouse over the abbreviation "ABS", I want a fly-out to appear that says "Anti-lock Brakes". How can I make that happen?
When I hover my mouse over the abbreviation "ABS", I want a fly-out to appear that says "Anti-lock Brakes". How can I make that happen?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tool-tip Acronym Expansions
Hi,
Are you publishing using an external DITA Open Toolkit engine? If so, what version is it?
Or are you publishing with your own HTML plugin customizations which might have interfered with the default functionality?
Regards,
Radu
I tested the ABS example, published to XHTML and to WebHelp using the DITA OT 2.x publishing engine bundled with Oxygen (Preferences->DITA page) and when hovering over the ABS link I get the small description.When I hover my mouse over the abbreviation "ABS", I want a fly-out to appear that says "Anti-lock Brakes". How can I make that happen?
Are you publishing using an external DITA Open Toolkit engine? If so, what version is it?
Or are you publishing with your own HTML plugin customizations which might have interfered with the default functionality?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Tool-tip Acronym Expansions
Hi,
I uploaded a small sample DITA project here:
files/abbreviated-form-sample.zip
If you publish the map to XHTML or to WebHelp, the sample_topic.html should have two references to the abbreviated-form, the first occurrence should be expanded and the second should be collapsed (only acronym). On both links, hovering should show the acronym definition.
Regards,
Radu
I uploaded a small sample DITA project here:
files/abbreviated-form-sample.zip
If you publish the map to XHTML or to WebHelp, the sample_topic.html should have two references to the abbreviated-form, the first occurrence should be expanded and the second should be collapsed (only acronym). On both links, hovering should show the acronym definition.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service