Groovy Documentation

org.grails.plugin.platform.navigation
[Groovy] Class NavigationImpl

java.lang.Object
  org.grails.plugin.platform.navigation.NavigationImpl
All Implemented Interfaces:
Navigation

class NavigationImpl

Bean that encapsulates the navigation structure of the entire application

todo:
Auto-set parent title if same action is declared in a child and title specified / vice versa
todo:
Support CRUD multi-actions correctly out of the box with xxx(controller:y, scaffold:true) and auto-sense scaffold where possible. default item is list, sub item Create, actions list, show, edit, update map activate list, create and saave activate Create


Property Summary
static java.lang.Object LINK_TAG_ATTRIBUTES

java.lang.Object grailsApplication

java.lang.Object grailsConventions

java.lang.Object log

java.util.Map nodesByControllerAction

java.util.Map nodesById

java.util.Map rootScopes

 
Constructor Summary
NavigationImpl()

 
Method Summary
NavigationItem addItem(NavigationScope parent, NavigationItem item)

NavigationItem addItemFromArgs(java.lang.String name, java.util.Map arguments, NavigationScope parent, java.lang.String definingPlugin)

void clearCaches()

void clearScopes()

NavigationItem declareControllerNode(java.util.Map args)

NavigationScope getActiveNode(java.lang.Object request)

java.lang.String getActivePath(java.lang.Object request)

java.lang.String getActivePathWasAuto(java.lang.Object request)

java.lang.String getDefaultControllerAction(java.lang.String controllerName)

java.lang.String getDefaultScope(java.lang.Object request, java.lang.Object defaultValue = 'app')

NavigationScope getFirstActiveNode(java.lang.Object request)

NavigationScope getFirstAncestor(java.lang.String path)

NavigationScope getFirstNodeOfPath(java.lang.String path)

NavigationScope getOrCreateScope(java.lang.String name)

NavigationScope getPrimaryScopeFor(java.lang.Object path)

java.util.List getScopes()

boolean hasNonControllerLinkArgs(java.util.Map args)

void loadControllers()

Load the available controller actions and if no declaration exists already, auto-register them in the navigation system.

void loadDSL(java.lang.Class dslClass)

void loadDSL()

java.lang.String makePath(java.util.List elements, java.lang.String definingPluginName = null)

NavigationScope nodeForControllerAction(java.lang.String controller, java.lang.String action)

NavigationScope nodeForId(java.lang.String path)

java.util.List nodesForPath(java.lang.String path)

protected void parseDSL(java.util.List commands, NavigationScope parent, java.lang.String definingPlugin)

Receives a graph of DSL commend objects and creates the necessary scopes and items

void realizeLinkArguments(java.lang.String itemName, java.util.Map linkArgs, NavigationScope parent)

NavigationItem registerControllerActions(java.lang.String controllerName, java.lang.Class controllerClass, java.lang.String scope)

Auto-register controller actions, returning the parent (default/primary) item

void registerNavigation(groovy.lang.Closure dsl)

void reload(java.lang.Class navigationClass)

void reloadAll()

NavigationScope scopeByName(java.lang.String name)

void setActivePath(java.lang.Object request, java.lang.String path)

void setActivePathFromRequest(java.lang.Object request, java.lang.Object controllerName, java.lang.Object action)

Attempt to location the current request's controller and action in the nav graph, looking in "app" scope first, then other scopes If found, the id of that node becomes our active path

void setActivePathWasAuto(java.lang.Object request, boolean value)

void setDefaultScope(java.lang.Object request, java.lang.String scope)

java.lang.Object splitPath(java.lang.String path)

void updateCaches()

void updateCachesForItem(NavigationItem node)

void updateSortOrder()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

LINK_TAG_ATTRIBUTES

static java.lang.Object LINK_TAG_ATTRIBUTES


grailsApplication

java.lang.Object grailsApplication


grailsConventions

java.lang.Object grailsConventions


log

final java.lang.Object log


nodesByControllerAction

java.util.Map nodesByControllerAction


nodesById

java.util.Map nodesById


rootScopes

java.util.Map rootScopes


 
Constructor Detail

NavigationImpl

NavigationImpl()


 
Method Detail

addItem

NavigationItem addItem(NavigationScope parent, NavigationItem item)


addItemFromArgs

NavigationItem addItemFromArgs(java.lang.String name, java.util.Map arguments, NavigationScope parent, java.lang.String definingPlugin)


clearCaches

void clearCaches()


clearScopes

void clearScopes()


declareControllerNode

NavigationItem declareControllerNode(java.util.Map args)


getActiveNode

NavigationScope getActiveNode(java.lang.Object request)


getActivePath

java.lang.String getActivePath(java.lang.Object request)


getActivePathWasAuto

java.lang.String getActivePathWasAuto(java.lang.Object request)


getDefaultControllerAction

java.lang.String getDefaultControllerAction(java.lang.String controllerName)


getDefaultScope

java.lang.String getDefaultScope(java.lang.Object request, java.lang.Object defaultValue = 'app')


getFirstActiveNode

NavigationScope getFirstActiveNode(java.lang.Object request)


getFirstAncestor

NavigationScope getFirstAncestor(java.lang.String path)


getFirstNodeOfPath

NavigationScope getFirstNodeOfPath(java.lang.String path)


getOrCreateScope

NavigationScope getOrCreateScope(java.lang.String name)


getPrimaryScopeFor

NavigationScope getPrimaryScopeFor(java.lang.Object path)


getScopes

java.util.List getScopes()


hasNonControllerLinkArgs

boolean hasNonControllerLinkArgs(java.util.Map args)


loadControllers

void loadControllers()
Load the available controller actions and if no declaration exists already, auto-register them in the navigation system. Supports "navigationScope" static property convention which can contain the scope name to put the controller into Note however that this will be namespaced to plugin./ if the artefact comes from a plugin. Controllers are added with the default action as a new scope, with all actions as sub items
todo:
Does not detect actions under Grails 1.3.x yet.


loadDSL

void loadDSL(java.lang.Class dslClass)


loadDSL

void loadDSL()


makePath

java.lang.String makePath(java.util.List elements, java.lang.String definingPluginName = null)


nodeForControllerAction

NavigationScope nodeForControllerAction(java.lang.String controller, java.lang.String action)


nodeForId

NavigationScope nodeForId(java.lang.String path)


nodesForPath

java.util.List nodesForPath(java.lang.String path)


parseDSL

protected void parseDSL(java.util.List commands, NavigationScope parent, java.lang.String definingPlugin)
Receives a graph of DSL commend objects and creates the necessary scopes and items Handles the "magic" inheritance of values and conventions etc.


realizeLinkArguments

void realizeLinkArguments(java.lang.String itemName, java.util.Map linkArgs, NavigationScope parent)


registerControllerActions

NavigationItem registerControllerActions(java.lang.String controllerName, java.lang.Class controllerClass, java.lang.String scope)
Auto-register controller actions, returning the parent (default/primary) item


registerNavigation

void registerNavigation(groovy.lang.Closure dsl)


reload

void reload(java.lang.Class navigationClass)


reloadAll

void reloadAll()


scopeByName

NavigationScope scopeByName(java.lang.String name)


setActivePath

void setActivePath(java.lang.Object request, java.lang.String path)


setActivePathFromRequest

void setActivePathFromRequest(java.lang.Object request, java.lang.Object controllerName, java.lang.Object action)
Attempt to location the current request's controller and action in the nav graph, looking in "app" scope first, then other scopes If found, the id of that node becomes our active path


setActivePathWasAuto

void setActivePathWasAuto(java.lang.Object request, boolean value)


setDefaultScope

void setDefaultScope(java.lang.Object request, java.lang.String scope)


splitPath

java.lang.Object splitPath(java.lang.String path)


updateCaches

void updateCaches()


updateCachesForItem

void updateCachesForItem(NavigationItem node)


updateSortOrder

void updateSortOrder()


 

Groovy Documentation