Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
When accessing the preview Page Model API, it is similar to accessing the preview of a website in the channel manager. It works through 'lazy decoration' of Hst Model objects, like Mount, ResolvedMount, VirtualHost, PortMount, etc. The objects get all decorated to their preview variant, through the PreviewDecoratorImpl, for example a Mount gets decorated into PreviewDecoratedMount. This way for preview requests, when you access for example
requestContext.getResolvedMount().getMount()
you get a PreviewDecoratedMount instance wrapping the backing Mount instance.
The decoration is lazy, in a sense that it only decorates what is needed, so if you get a PreviewDecoratedMount, the backing VirtualHost or Parent Mount are not yet decorated but this is done on request. And this is where the problem occurs: When invoking
myPreviewDecoratedMount.getParent() == myPreviewDecoratedMount.getParent()
it returns false since the decorated parent gets recreated. Therefore, we need to improve the decoration such that the above is true.
Other invocations like:
myPreviewDecoratedMount.getParent().getChild(myPreviewDecoratedMount.getName())
myPreviewDecoratedRootMount.getVirtualHost()
myPreviewDecoratedRootMount.getVirtualHost.getPortMount(0).getRootMount()
myPreviewDecoratedRootMount.getVirtualHost().getChildHost("foo")
all result in new decorated objects for every invocation, which obviously should not be the case!
Attachments
Issue Links
- causes
-
HSTTWO-4692 Internal links become external in preview in Page Model API
- Closed
- is awaited by
-
HSTTWO-4693 Absolute link generated with getHstLinkCreator changes behavior after creating CM session
- Closed