Preview support
With version 1.2.0 of ACE Web comes support for performing web previews of content, which includes previewing content not yet published.
Web preview support require at least version 1.1.0 of the following related ACE components:
- ACE Core
- ACE Java Client
- ACE UI
- ACE Content Developer
There is currently no support for previewing more than one non-public content at a time.
Workflow
Preview requests are initiated from the ACE Content Developer application. When editing a content considered previewable, the Content Developer will present a new toolbar option labelled 'Web preview'. Pressing the preview button will open a new browser window / tab with a web preview containing the working version of the content.
Setup
Making content types previewable
In order for a content type to be previewable, it has to be present in the configured web preview variant. The output of content in that variant should be on the following format:
{
"aspects": {
"webPreview": {
"contentPath":"contentid:ODM4NTRiMDAtNGY0Yi00/contentid:MTkyOTI2NGMtNWY2Yi00"
}
}
}
The format of the path returned is of your own choosing, but it should be compatible with how your site implementation is structured.
Content Developer configuration
The Content Developer application also has to be configured with the name of the web preview variant as well as any base URL you wish to use:
{
"service": {
...
"PreviewService": {
"previewVariant": "webPreview",
"previewBaseUrl": "http://localhost:9090/ace.preview"
}
...
}
}
The preview interceptor
In order for your Spring site implementation to be preview-enabled, you have to map the support preview interceptor component, a Spring interceptor. It is added to your Spring project as follows:
@Autowired
private PreviewInterceptor previewInterceptor;
@Override
public void addInterceptors(final InterceptorRegistry registry)
{
registry.addInterceptor(previewInterceptor).addPathPatterns("/ace.preview/**");
}
Example
Please see the ACE Starter Kit for a complete example of how preview can be incorporated into a Spring site implementation with ACE Web.