If a cartridge needs to provide links to another navigation or record state, the handler for that cartridge store the necessary information to build those links in com.endeca.infront.cartridge.model.NavigationAction
objects that are returned as part of the response ContentItem
. The NavigationAction
objects have properties that define:
The site context for the link, in the form of a reference to the
SiteState
objectThe site root for the link, for example,
/pages
The content path for the link, for example,
/browse
The navigation state query parameters for the link, for example,
?N=4294967263
For example, this NavigationAction
object contains the information necessary to create a Remove All Breadcrumbs link on a page:
removeAllAction: {@class: "com.endeca.infront.cartridge.model.NavigationAction",navigationState: "?format=json",contentPath: "/browse",siteRootPath: "/pages",siteState: {@class: "com.endeca.infront.site.model.SiteState",contentPath: "/browse",siteId: "/storeSiteUS",properties: { },matchedUrlPattern: ""}},
The com.endeca.infront.cartridge.NavigationCartridgeHandler
class, and its subclasses, has a reference to the SiteState
object, allowing those classes to add a SiteState
reference to the NavigationAction
objects they create. For the other link-related properties, the NavigationCartridgeHandler
classes rely on two additional components, BasicUrlFormatter
and DefaultActionPathProvider
, described in the sections below.
It is the responsibility of the page code that renders the links to use the NavigationObject
properties to build appropriate link URLs.