com.tle.web.scripting.advanced.objects
Interface NavigationScriptObject
Declaration: public interface NavigationScriptObject extends ScriptObject
All Superinterfaces: ScriptObject, java.io.Serializable

 

Referenced by the 'nav' variable in script. The item navigation tree is what is shown when viewing the item with the navigation viewer (like IMS packages). Tabs are what ultimately display attachments, attachments cannot be added directly to navigation nodes.

 

 

Fields Summary
static java.lang.String DEFAULT_VARIABLE
    

 

 

Methods Summary
abstract NavigationNodeScriptType addNode(java.lang.String description, NavigationNodeScriptType parentNode)
    
Add a navigation node to the item navigation tree.
abstract NavigationTabScriptType addTab(java.lang.String description, AttachmentScriptType attachment, NavigationNodeScriptType node)
    
Add a tab to a navigation node.
abstract void autocreate()
    
Create navigation nodes based on the current attachments.
abstract NavigationNodeScriptType getNodeByDescription(java.lang.String description)
    
Retrieves an existing node based on it's name/description Does an exact, case sensitive match
abstract boolean isAllowSplitOption()
    
abstract java.util.List<NavigationNodeScriptType> listChildNodes(NavigationNodeScriptType parentNode)
    
Returns a list of child nodes of the given parentNode.
abstract void removeAll()
    
Clears the entire navigation tree.
abstract int removeChildNodes(NavigationNodeScriptType parentNode)
    
Removes all child nodes of the given parentNode.
abstract void removeNode(NavigationNodeScriptType node)
    
Remove a node from the item navigation tree.
abstract void setAllowSplitOption(boolean allowSplit)
    

 

Methods inherited from interface: com.tle.common.scripting.ScriptObject
scriptEnter, scriptExit

 

 

 

 

DEFAULT_VARIABLE

 

public static final java.lang.String DEFAULT_VARIABLE

 

See also: Constants

 

 

 

 

getNodeByDescription

 

public abstract NavigationNodeScriptType getNodeByDescription( java.lang.String description)

 

Retrieves an existing node based on it's name/description Does an exact, case sensitive match

 

Parameters:
description-
The display name of the node to find
Returns:
The NavigationNodeScriptType with a matching description, or null if not found

 

 

 

addNode

 

public abstract NavigationNodeScriptType addNode( java.lang.String description,
NavigationNodeScriptType parentNode)

 

Add a navigation node to the item navigation tree.

 

Parameters:
description-
A display name for the node
parentNode-
Specify null for the root level
Returns:
The new node that was added

 

 

 

removeNode

 

public abstract void removeNode( NavigationNodeScriptType node)

 

Remove a node from the item navigation tree.

 

Parameters:
node-
The node to remove. If the node is not found in the tree the method will continue as normal.

 

 

 

addTab

 

public abstract NavigationTabScriptType addTab( java.lang.String description,
AttachmentScriptType attachment,
NavigationNodeScriptType node)

 

Add a tab to a navigation node. The tab will be added to the end of the list of current tabs (if any) If only one tab is added to a node, the tab bar is not displayed.

 

Parameters:
description-
A display name for the tab. Not shown if there is only one tab present.
attachment-
node-
The node to add the tab to.
Returns:
The new tab that was added

 

 

 

autocreate

 

public abstract void autocreate( )

 

Create navigation nodes based on the current attachments. Does the same as the 'initialise' button does on the navigation builder control.

 

 

 

setAllowSplitOption

 

public abstract void setAllowSplitOption( boolean allowSplit)

 

Parameters:
allowSplit-
'Split view' enabled in the tree viewer.

 

 

 

isAllowSplitOption

 

public abstract boolean isAllowSplitOption( )

 

Returns:
'Split view' enabled in the tree viewer.

 

 

 

removeAll

 

public abstract void removeAll( )

 

Clears the entire navigation tree. A slightly more efficient method of deleting all root nodes than calling removeChildNodes(null)

 

 

 

listChildNodes

 

public abstract java.util.List<NavigationNodeScriptType> listChildNodes( NavigationNodeScriptType parentNode)

 

Returns a list of child nodes of the given parentNode.

 

Parameters:
parentNode-
The node to get the children of. If null, all root-level nodes are returned.
Returns:
All children of parentNode

 

 

 

removeChildNodes

 

public abstract int removeChildNodes( NavigationNodeScriptType parentNode)

 

Removes all child nodes of the given parentNode.

 

Parameters:
parentNode-
The node to remove the children from. If null, all root-level nodes are removed.