A single dynamically registered menu entry, built by MenuMappingBuilder and evaluated by RepositoryApp when it lays out the admin or website menu for a user. It names the parent menu item to attach under, whether it applies to the admin menu or the website menu, and either the name of a controller method or a direct function reference to invoke to build the actual menu items. An optional set of roles restricts which users see it: a user needs at least one of the roles, or the Administrator role, for the mapping to be evaluated.
Implements: IMenuMapping
Properties
| Property | Returns | Description |
|---|---|---|
| function | VarArgFunction | The JS function reference to invoke to build the menu items for this mapping, when the mapping was built with a direct function pointer rather than a named controller method. Null if getFunctionName was used instead. |
| functionName | String | The name of the controller method to invoke to build the menu items for this mapping, when the mapping was built with a named method rather than a direct function reference. Null if a function pointer was supplied instead via getFunction. |
| parentId | String | The id of the parent menu item this entry attaches beneath, matched against the section being built. A blank or null value means it applies under any parent, which is the behaviour that predates named menu sections. |
| roles | Set<String> | The roles a user must hold at least one of for this menu mapping to be evaluated for them. A user who also holds the Administrator role always sees it regardless of this set. May be null or empty, meaning the mapping is evaluated for every user. |
| type | String | Which menu this mapping applies to: "website" for a website's own menu, or "admin" (or null, which is treated the same as "admin") for the organisation admin menu. |
Methods
getParentId()
Returns: String
The id of the parent menu item this entry attaches beneath, matched against the section being built. A blank or null value means it applies under any parent, which is the behaviour that predates named menu sections.
getType()
Returns: String
Which menu this mapping applies to: "website" for a website's own menu, or "admin" (or null, which is treated the same as "admin") for the organisation admin menu.
getFunctionName()
Returns: String
The name of the controller method to invoke to build the menu items for this mapping, when the mapping was built with a named method rather than a direct function reference. Null if a function pointer was supplied instead via getFunction.
getRoles()
Returns: Set<String>
The roles a user must hold at least one of for this menu mapping to be evaluated for them. A user who also holds the Administrator role always sees it regardless of this set. May be null or empty, meaning the mapping is evaluated for every user.
getFunction()
Returns: VarArgFunction
The JS function reference to invoke to build the menu items for this mapping, when the mapping was built with a direct function pointer rather than a named controller method. Null if getFunctionName was used instead.