Action links are returned in responses such as result records,
refinements, and breadcrumbs. If you add a site to a Spring-built application
that has implemented the
ActionPathProvider
, you might need to update the action
links in the
ActionPathProvider
of the
assembler-context.xml
file to make the action links
site-specific.
The
ActionPathProvider
determines navigation and record
detail action paths. The content paths that prefix navigation and record states
are configured as sets of key-value pair mappings. The key-value pairs shown in
the Discover reference application support multiple sites -- provided that the
sites use the same path for the browse and detail pages. In a multiple site
application, the
ActionPathProvider
can also provide different mappings
for pages on different sites.
If your sites define the navigation and record detail pages in the same location you do not have to define a path for each site, and you can skip the following steps. However, if the sites have different paths for the browse and detail pages you can define those mappings for each site by following these steps.
Navigate to the Assembler context file for your application,
WEB-INF/assembler-context.xml
.Open
assembler-context.xml
in an editor, and find theActionPathProvider
section of the file.Edit the
navigationActionUriMap
mapping section for the site that you are adding to your application in theActionPathProvider
mappings.In the follow example, there is a new mapping for the DiscoverCameras site that has been added to
navigationActionUriMap
.<!-- navigationActionUriMap --> <constructor-arg index="2"> <map> <entry key="^/pages/DiscoverCameras/.*$" value="/pages/DiscoverCameras/camerasbrowse" /> <entry key="^/pages/[^/]*/mobile/detail$" value="/mobile/browse" /> <entry key="^/pages/[^/]*/services/recorddetails/.*$" value="/services/guidedsearch" /> <entry key="^/pages/[^/]*/detail$" value="/browse" /> <entry key="^/services/.*$" value="/services/guidedsearch" /> </map> </constructor-arg>
Edit the
recordActionUriMap
mapping section for the site that you are adding to your application in theActionPathProvider
mappings.In the follow example, there is a new mapping for the DiscoverCameras site that has been added to
recordActionUriMap
:<!-- recordActionUriMap --> <constructor-arg index="3"> <map> <entry key="^/pages/DiscoverCameras/.*$" value="/pages/DiscoverCameras/camerasdetail" /> <entry key="^/pages/[^/]*/mobile/.*$" value="/mobile/detail" /> <entry key="^/pages/[^/]*/services/.*$" value="/services/recorddetails" /> <entry key="^/pages/[^/]*/.*$" value="/detail" /> <entry key="^/services/.*$" value="/recorddetails" /> </map> </constructor-arg>
In the examples in the
previous steps, the
camerasdetail
page is used as the record detail page
for any page on the DiscoverCameras site. Other sites in the application would
use the
/mobile/detail page
for
/mobile/*
pages and the
/detail
page for all other pages.