Uploaded image for project: 'Hippo Site Toolkit 2'
  1. Hippo Site Toolkit 2
  2. HSTTWO-4357

Head Contributions from another valve

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5.0
    • Component/s: None
    • Labels:
      None
    • Similar issues:
    • Processed by team:
      R2D2

      Description

      Head contribution is at the moment possible only from HstComponent code.
      However, sometimes we want to contribute some extra head contributed elements from another valve. For example, Pixel data layer object writing in a page could be done by an additional valve which is executed before AggregationValve and HstComponent executions.

      A possible solution is:

      • Introduce HeadContributable interface and HstRequestContext#setHeadContributable(String name, HeadContributable hc) and HstRequestContext#getHeadContributable(String name): HeadContributable.
      • HeadContributable has #contributeHeadElements(HstResponse) operation only.
      • A custom valve invokes HstRequestContext#setHeadContributable(String name, HeadContributable hc) with its own HeadContributable instance, which contributes both analytics tracker library and JSON data-layer object (e.g, pixel vars).
      • AggregationValve iterates HeadContributable map from HstRequestContext and invoke #contributeHeadElements() on root component's HstResponse.

        Attachments

        1. hc01.png
          492 kB
          Woonsan Ko
        2. hc02.png
          72 kB
          Woonsan Ko

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                wko Woonsan Ko
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: