Maps a URL path pattern to a logical controller registered by an app, with the list of methods that can be invoked against it based on the HTTP method and any required parameter. Instances are produced by ControllerMappingBuilder.build and consumed when routing a request to the matching ControllerResource. Serialised as a controller element when an app's routing is written out.

Group: App Definitions

Implements: Serializable


Properties

PropertyReturnsDescription
breadCrumbsObjectThe breadcrumbs configured for this controller, either a prebuilt map or the name of a JS function that computes them at request time. May be null.
childMappingsList<ControllerMapping>The child controller mappings nested under this one. Never null, may be empty.
collectionbooleanWhether this controller behaves as a collection, either because it has child mappings or mounts a content repository.
contentRepoNameStringThe name of the content repository mounted at this controller's path, when it was registered with mountRepository. May be null.
defaultViewViewThe view used to render this controller's response when a matched method does not specify its own view. May be null.
enabledbooleanWhether this controller mapping is active. A disabled mapping is not matched to incoming requests.
methodsList<ControllerMethod>The controller methods registered against this mapping's path, each associated with an HTTP method and an optional required parameter. Never null.
modifiedDateObjectThe modified date configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.
namedGroupsList<String>Scans this mapping's path for named regular expression groups, for example a group named id, and returns their names in the order they appear.
pathStringThe path or regular expression this controller is mapped to, for example /services/uploads/* or a matching pattern for an incoming email address.
pathRegexPatternThe compiled regular expression for this mapping's path, compiling and caching it on first use. An empty pattern is used when the path is null.
pathResolversMap<String,Object>Resolvers used to compute path segment values, keyed by the named regular expression group they resolve. Never null, may be empty.
publicbooleanWhether this controller can be accessed without authentication.
regexPatternThe compiled regular expression for this mapping's path, if getPathRegex has already been called. May be null if the path has not yet been compiled.
requiredPostPriviledgePriviledgeThe privilege a user must hold to POST to this controller. May be null if no privilege is required.
rolePrivsMap<String,List<Priviledge>>The privileges required to access this controller, keyed by role name. May be null if no role-based privileges were configured.
segmentbooleanWhether this mapping represents a single dynamic path segment, resolved via a path resolver, rather than a fixed or regular expression path.
seoContentObjectThe SEO content configured for this controller, typically the name of a JS function invoked to populate it at request time. May be null.
titleObjectThe title configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.
typesSet<String>The resource type tags applied to this controller, for example html, used to match roles and other type-based rules against it.
uniqueIdObjectThe unique id configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.

Methods

getRolePrivs() · isEnabled() · isPublic() · getMethods() · getPath() · getTitle() · getBreadCrumbs() · getUniqueId() · getModifiedDate() · getSeoContent() · getPathResolvers() · getChildMappings() · getRegex() · getPathRegex() · getDefaultView() · getNamedGroups() · getControllerMethod(Request req) · getRequiredPostPriviledge() · getTypes() · isCollection() · getContentRepoName() · isSegment()

getRolePrivs()

Returns: Map<String,List<Priviledge>>

The privileges required to access this controller, keyed by role name. May be null if no role-based privileges were configured.

isEnabled()

Returns: boolean

Whether this controller mapping is active. A disabled mapping is not matched to incoming requests.

isPublic()

Returns: boolean

Whether this controller can be accessed without authentication.

getMethods()

Returns: List<ControllerMethod>

The controller methods registered against this mapping's path, each associated with an HTTP method and an optional required parameter. Never null.

getPath()

Returns: String

The path or regular expression this controller is mapped to, for example /services/uploads/* or a matching pattern for an incoming email address.

getTitle()

Returns: Object

The title configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.

getBreadCrumbs()

Returns: Object

The breadcrumbs configured for this controller, either a prebuilt map or the name of a JS function that computes them at request time. May be null.

getUniqueId()

Returns: Object

The unique id configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.

getModifiedDate()

Returns: Object

The modified date configured for this controller, either a literal value or the name of a JS function that computes it at request time. May be null.

getSeoContent()

Returns: Object

The SEO content configured for this controller, typically the name of a JS function invoked to populate it at request time. May be null.

getPathResolvers()

Returns: Map<String,Object>

Resolvers used to compute path segment values, keyed by the named regular expression group they resolve. Never null, may be empty.

getChildMappings()

Returns: List<ControllerMapping>

The child controller mappings nested under this one. Never null, may be empty.

getRegex()

Returns: Pattern

The compiled regular expression for this mapping's path, if getPathRegex has already been called. May be null if the path has not yet been compiled.

getPathRegex()

Returns: Pattern

The compiled regular expression for this mapping's path, compiling and caching it on first use. An empty pattern is used when the path is null.

getDefaultView()

Returns: View

The view used to render this controller's response when a matched method does not specify its own view. May be null.

getNamedGroups()

Returns: List<String>

Scans this mapping's path for named regular expression groups, for example a group named id, and returns their names in the order they appear.

getControllerMethod(Request req)

Returns: ControllerMethod

Finds the first controller method whose HTTP method and required parameter match the given request.

ParameterDescription
reqthe request to match against this mapping's methods

getRequiredPostPriviledge()

Returns: Priviledge

The privilege a user must hold to POST to this controller. May be null if no privilege is required.

getTypes()

Returns: Set<String>

The resource type tags applied to this controller, for example html, used to match roles and other type-based rules against it.

isCollection()

Returns: boolean

Whether this controller behaves as a collection, either because it has child mappings or mounts a content repository.

getContentRepoName()

Returns: String

The name of the content repository mounted at this controller's path, when it was registered with mountRepository. May be null.

isSegment()

Returns: boolean

Whether this mapping represents a single dynamic path segment, resolved via a path resolver, rather than a fixed or regular expression path.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.