javagatein

How to create link to external domain in Gatein navigation?


I am trying to add an item to my navigation that would point to a external link like http://www.google.com, but I cannot find any documentation on how to do it.

Here is a sample of how I manage my navigation, I use navigation.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_4 http://www.gatein.org/xml/ns/gatein_objects_1_4"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_4">
<priority>1</priority>
<page-nodes>
    <node>
        <name>WebFileHome</name>
        <label>WebFile User Resources</label>
        <page-reference>111::222::aaa</page-reference>
    </node>
    <!-- My WebFile Tools - Law Firm -->
    <node>
        <name>MyWebFileTools</name>
        <label>My WebFile Tools</label>
        <page-reference>111::222::bbb</page-reference>
        <node>
            <name>UserAdmin</name>
            <label>User Administration</label>
            <page-reference>111::222::ccc</page-reference>
        </node>
        <node>
            <name>Claim</name>
            <label>Claim Summary</label>
            <visibility>HIDDEN</visibility>
            <page-reference>111::222::ddd</page-reference>
        </node>
    </node>
  </page-nodes>
</node-navigation>

Solution

  • Depending on your version of Gatein, this really isn't possible...I've run into the same situation myself. It used to be possible with the "uri" element (https://docs.jboss.org/gatein/portal/3.1.0-FINAL/reference-guide/en-US/html_single/#sect-Reference_Guide-Tips-Direct_External_Links), but I think they dropped this feature back in an earlier version (3.2.x I think).

    I think another way to handle the use case was re-introduced in a later version (3.8.x), but we haven't upgraded to that version (we are on 3.7.1). In order to run on 3.8.x I think you need to be using Wildfly which isn't based on Tomcat anymore so a lot of our code wouldn't work so I cannot verify.

    To note, the MOP layer (persistence) has this functionality (org.gatein.mop.core.api.workspace.URLLink vs org.gatein.mop.core.api.workspace.PageLink) but it was not extended to the eXo object layer