Merge of Nodes provided by an External Navigation Connector
I have implemented an (External) Navigation Connector following the advices given [here|http://help.sap.com/saphelp_nw70/helpdata/EN/45/004eb029a60484e10000000a155369/frameset.htm]. This Connector works well when being used inside the Role Connector by setting the attribute com.sap.portal.navigation.externalConnectorKey ([com.sapportals.portal.navigation.INavigationConstants#EXTERNAL_CONNECTOR_KEY|http://help.sap.com/javadocs/NW04s/current/ep/com/sapportals/portal/navigation/INavigationConstants.html#EXTERNAL_CONNECTOR_KEY]). However, I encountered problems when trying to merge nodes delivered by this connector within "normal" nodes (based on the RoleFolder PCD context). When I try to load the children of the merged node dynamically, the Detailed Navigation Tree "freezes" with the Loading... message. First of all I wanted to document the problem and show my solution, so that other users running into the same problem can catch up on this. Iu2019m not quite sure yet if its a bug or simply not (yet) supported, I used NW AS 7.0 SPS15.
I have the following nodes configured inside my sample role, FKRole:
FKRole |- extNode |- test1.1 |- test1.1.1 |- test1.1.2 |- test220.127.116.11 |- test18.104.22.168
Then I implemented a Connector simulating nodes, registered it with the prefix MOCK and configured it at extNode with the key MOCK://testKey. After this configuration, the tree (fully expanded) looks as following:
FKRole |- extNode |- node1 |- node1.1 |- node1.2 |- node2 |- node2.1 |- node2.2 |- test1.1 |- test1.1.1 |- test1.1.2 |- test22.214.171.124 |- test126.96.36.199
First of all, I merged node extNode and test1.1, setting the com.sap.portal.navigation.MergeId ([com.sap.portal.pcm.attributes.IAttrPcmNavigation#ATTRIBUTE_MERGEID|http://help.sap.com/javadocs/NW04s/current/ep/com/sap/portal/pcm/attributes/IAttrPcmNavigation.html#ATTRIBUTE_MERGEID]) on both nodes to mergeRoot. I set com.sap.portal.navigation.MergePriority ([com.sap.portal.pcm.attributes.IAttrPcmNavigation#ATTRIBUTE_MERGE_PRIORITY|http://help.sap.com/javadocs/NW04s/current/ep/com/sap/portal/pcm/attributes/IAttrPcmNavigation.html#ATTRIBUTE_MERGE_PRIORITY]) attribute of test1.1 to 49D since the default value of the nodes provided by the MOCK connector is 50D.
The result looks like this:
FKRole |- test1.1 |- node1 |- node1.1 |- node1.2 |- node2 |- node2.1 |- node2.2 |- test1.1.1 |- test1.1.2 |- test188.8.131.52 |- test184.108.40.206
This behavior is correct, since the [com.sapportals.portal.navigation.InavigationConnectorNode#getPriority()|http://help.sap.com/javadocs/NW04S/current/ep/com/sapportals/portal/navigation/INavigationConnectorNode.html#getPriority()] defaults to 50D as mentioned above. To proof this, I set the com.sap.portal.navigation.Priority ([com.sap.portal.pcm.attributes.IAttrPcmNavigation# ATTRIBUTE_SORT_PRIORITY|http://help.sap.com/javadocs/NW04s/current/ep/com/sap/portal/pcm/attributes/IAttrPcmNavigation.html#ATTRIBUTE_SORT_PRIORITY]) attribute of test1.1.2 to 49D, the result looks like this:
FKRole |- test1.1 |- test1.1.2 |- test220.127.116.11 |- test18.104.22.168 |- node1 |- node1.1 |- node1.2 |- node2 |- node2.1 |- node2.2 |- test1.1.1
So far so good, now to the root crux. I merge test1.1.2 with node2 (which is provided by the MOCK connector). Therefore I return a merge id related to the nodeu2019s id (which is also its title) at [com.sapportals.portal.navigation.InavigationConnectorNode#getMergeID()|http://help.sap.com/javadocs/NW04S/current/ep/com/sapportals/portal/navigation/INavigationConnectorNode.html#getMergeID()]. My notation for this is merge_<id>, e.g. merge_node2. Then is set this value to com.sap.portal.navigation.MergeId attribute of test1.1.2. Since I also wanted test1.1.2 to be the u201Cdominantu201D I set the value of com.sap.portal.navigation.MergePriority attribute to 49D, since the connector nodes also default to 50D when being requested with that key over [com.sapportals.portal.navigation.INavigationConnectorNode#getAttributeValue(String, Locale|http://help.sap.com/javadocs/NW04S/current/ep/com/sapportals/portal/navigation/INavigationConnectorNode.html#getAttributeValue(java.lang.String,%20java.util.Locale)]. The result looks like this (collapsed):
FKRole |- test1.1 |- test1.1.2 (+) |- node1 (+) |- test1.1.1