Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-4700

Preview Decoration of HST Model objects have unexpected behavior

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.1.0
    • 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

          Activity

            People

              Unassigned Unassigned
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: