unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
-
- Posts: 6
- Joined: Thu Jan 03, 2019 4:22 pm
unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by Balaji_Raj02 »
I am new to Oxygen,
From Oxygen XML Editor, when trying to open a bookmap containing maps & topics, am getting the following error on clicking topic or map reference.
"Unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map"
Following block is executed during oxygen editor initialization, to load the map file metadata in to keydefinition info object.
ro.sync.exml.workspace.api.editor.page.ditamap.keys.KeyDefinitionInfo.setProperty(KeyDefinitionInfo.DEFINITION_LOCATION, "D:/Oxygen/sample.ditamap");
ro.sync.exml.workspace.api.editor.page.ditamap.keys.KeyDefinitionInfo.setProperty(KeyDefinitionInfo.HREF, "myMapFileName.dita"); (My Map file name refers to the Map which i am clicking from oxygen xml editor. My Map file & bookmap file is located in D:/Oxygen)
Oxygen JAR Version : 19.0.0.0
Kindly share your thoughts to resolve this issue.
Regards,
Balaji
-
- Posts: 402
- Joined: Mon May 09, 2016 9:37 am
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by sorin_carbunaru »
You must also set the name of the key:
Code: Select all
keyDefInfo.setProperty(KeyDefinitionInfo.NAME, "map");
Sorin Carbunaru
oXygen XML
-
- Posts: 6
- Joined: Thu Jan 03, 2019 4:22 pm
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by Balaji_Raj02 »
As you said name property is set. Following are the properties used,
Code: Select all
String mapName = "Map Name"
keyDefinitionInfo.setProperty(KeyDefinitionInfo.NAME, mapName );
KeyDefinitionInfo.setProperty(KeyDefinitionInfo.DEFINITION_LOCATION, "D:/Oxygen/sample.ditamap");
KeyDefinitionInfo.setProperty(KeyDefinitionInfo.HREF, "myMapFileName.dita");
keyDefinitionInfo.setProperty(KeyDefinitionInfo.IS_SUBJECT_DEF, false);
keyDefinitionInfo.setProperty(KeyDefinitionInfo.META_CONTENT_PROVIDER, new MetaContentProvider() {
@Override
public String getContent(String s) {
return mapName ;
}
});
keyDefinitionInfo.setProperty(KeyDefinitionInfo.SUBJECT_DEF_CHILDREN, null);
-
- Posts: 402
- Joined: Mon May 09, 2016 9:37 am
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by sorin_carbunaru »
If changing the name from "Map Name" to "map" is not the solution, I will need more information about what exactly you are trying to do and some more snippets of code, such as entire methods, especially the one that defines all the keys.
-
- Posts: 6
- Joined: Thu Jan 03, 2019 4:22 pm
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by Balaji_Raj02 »
Code: Select all
<mapref keyref="map_00001" id="mapref-5278318c-8431-479a-b646-d22e64e08ab6"/>
Code: Select all
String mapName = "map_00001" // File Name
keyDefinitionInfo.setProperty(KeyDefinitionInfo.NAME, mapName );
KeyDefinitionInfo.setProperty(KeyDefinitionInfo.DEFINITION_LOCATION, "D:/Oxygen/sample.ditamap");
KeyDefinitionInfo.setProperty(KeyDefinitionInfo.HREF, "map_00001.dita");
keyDefinitionInfo.setProperty(KeyDefinitionInfo.IS_SUBJECT_DEF, false);
keyDefinitionInfo.setProperty(KeyDefinitionInfo.META_CONTENT_PROVIDER, new MetaContentProvider() {
@Override
public String getContent(String s) {
return mapName ;
}
});
keyDefinitionInfo.setProperty(KeyDefinitionInfo.SUBJECT_DEF_CHILDREN, null);
-
- Posts: 402
- Joined: Mon May 09, 2016 9:37 am
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by sorin_carbunaru »
-
- Posts: 6
- Joined: Thu Jan 03, 2019 4:22 pm
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by Balaji_Raj02 »
"Clicked on a map link in a book map and get an unresolved key reference message: Could not find definition for key "…" kays are provided b: Root Map"
-
- Posts: 402
- Joined: Mon May 09, 2016 9:37 am
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by sorin_carbunaru »
Please check the value selected for the "Root map" in the DITA Maps Manager (DMM). See: https://www.oxygenxml.com/doc/versions/ ... __root-map. It should be "External Imposed".
I tried with the following...
First, the code for setting the custom DITA key definition manager:
Code: Select all
// Key definition
final KeyDefinitionInfo keyDefinitionInfo = new KeyDefinitionInfo();
keyDefinitionInfo.setProperty(KeyDefinitionInfo.NAME, "map_00001");
keyDefinitionInfo.setProperty(KeyDefinitionInfo.DEFINITION_LOCATION, "D:/sample.ditamap");
keyDefinitionInfo.setProperty(KeyDefinitionInfo.HREF, "http://www.oxygenxml.com");
keyDefinitionInfo.setProperty(KeyDefinitionInfo.IS_SUBJECT_DEF, false);
keyDefinitionInfo.setProperty(KeyDefinitionInfo.META_CONTENT_PROVIDER, new MetaContentProvider() {
@Override
public String getContent(String s) {
return "META-CONTENT" ;
}
});
keyDefinitionInfo.setProperty(KeyDefinitionInfo.SUBJECT_DEF_CHILDREN, null);
// Set the custom DITA key definition manager
KeyDefinitionManager keyDefinitionManager = new KeyDefinitionManager() {
@Override
public List<KeyDefinitionInfo> getContextKeyDefinitions() {
ArrayList<KeyDefinitionInfo> list = new ArrayList<>();
list.add(keyDefinitionInfo);
return list;
}
};
pluginWorkspaceAccess.setDITAKeyDefinitionManager(keyDefinitionManager);
Code: Select all
<ph keyref="map_00001"/>
So, the key to solving your problems seems to be choosing the right value for the root map combo box: "External Imposed".
-
- Posts: 6
- Joined: Thu Jan 03, 2019 4:22 pm
-
- Posts: 402
- Joined: Mon May 09, 2016 9:37 am
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by sorin_carbunaru »
-
- Posts: 6
- Joined: Thu Jan 03, 2019 4:22 pm
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by Balaji_Raj02 »
I also found that
1)if both map and topic is in different folders, it wont work. so I kept in same folder
2) keys attribute is needed
3)keyscope is defined as "local"
4)keyref is mentioned as ""local.keyref"
It works .
EG:
<topicref keyref="local.topic_sfssfsf.dita" keys="topic_sfssfsf.dita" keyscope="local" navtitle="tyu"
id="topicref-sfsfs-434354fdf-4fdsfdsf-ddf"
href="topic_sfssfsf.dita"/>
-
- Posts: 402
- Joined: Mon May 09, 2016 9:37 am
Re: unresolved key reference message: Could not find definition for key "map" keys are provided by: ABC Root Map
Post by sorin_carbunaru »
By the way, can you tell us why you needed to implement a custom KeysDefinitionManager instead of using the default one from the DITA Maps Manager? I mean you could define the keys manually in the DITA map (i.e. write the XML "keydef" elements) and let oXygen gather the keys for you...
I recommend you to read though our userguide to get a bit more familiar with oXygen. You could try reading the following, for example:
1. About the DITA Maps Manager: https://www.oxygenxml.com/doc/versions/ ... ments.html and the sub-topics (at least some of them, the ones that seem most interesting to you).
2. About using keys: https://www.oxygenxml.com/doc/versions/ ... -keys.html. Also see the related information at the bottom.
Return to “DITA (Editing and Publishing DITA Content)”
- 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