The Preview
module depends on some additional out-of-the-box configuration that is described below. You do not have to do this configuration manually; however, you should be aware of it to better understand how Preview
works.
NucleusPreviewLinkServlet
The Preview
module depends on the existence of the atg.endeca.servlet.NucleusPreviewLinkServlet
servlet in the application’s web.xml
file. This servlet defines the NavigationStateBuilder
and WorkbenchContentSource
components that Experience Manager preview uses to resolve the URLs for previewed pages. The NucleusPreviewLinkServlet
, shown below, already exists in the web.xml
file that is included in the module template located at CommerceAccelerator/module_templates/Application/src/main/web-app/WEB-INF
, so you do not have to add it manually as long as you have used the template to create your application module.
<servlet> <servlet-name>link</servlet-name> <servlet-class>atg.endeca.servlet.NucleusPreviewLinkServlet</servlet-class> <init-param> <description> The Nucleus component path of the NavigationStateBuilder. </description> <param-name>navigationStateBuilderComponent</param-name> <param-value> /atg/endeca/assembler/cartridge/manager/NavigationStateBuilder </param-value> </init-param> <init-param> <description> The Nucleus component path of the ContentSource. </description> <param-name>contentSourceComponent</param-name> <param-value> /atg/endeca/assembler/cartridge/manager/WorkbenchContentSource </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>link</servlet-name> <url-pattern>/link.json/*</url-pattern> </servlet-mapping>
Preview URLs in Experience Manager
The Preview
module depends on the Default Preview URL, Preview URL , Default Link Service URL, and Link Service URL defined for each EAC application in Experience Manager. The Preview URLs provide a fully qualified URL for the application to be previewed. The Link Service URLs provide the URL of the service with your application that constructs the links for preview.
These URLs are visible on the Preview Settings page in Workbench. They are populated using the preview host, port, and context root you provide when you create and initialize an EAC application, so you do not have to set the URLs manually in Experience Manager but you do have to provide the correct preview host, port, and context root values during EAC application creation. Because the recommendation is to use Staging EAC applications on the Staging server for Experience Manager preview, these URLs should reflect the Staging server’s host name and port.