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

[SPA++] Add support for supplying updated component parameters to Page Model API

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.3.0
    • None
    • None

    Description

      In order to support editing components from the Channel Manager when using the Page Model API, the API needs to support a way of supplying updated component parameters so that it renders the model of the component using those parameters instead of the parameters persisted in the repository.

      The HST does this normally by supplying the updated parameters via the POST body when doing a request to the component rendering URL. You can see an example of this pasted at the bottom. When editing a component, it does a POST request to the component rendering URL of the component, and supplies the modified parameters via the POST body. In this case the component is rendered using the parameters of the POST body instead of the parameters persisted in the configuration / repository.

      Please note that the component parameters in the API response will most likely still be the 'old' parameters that are persisted in the repository, when doing POST requests. Only the model / attributes are changed when doing POST requests, as it uses the supplied parameters of the POST body to render the model instead of the persisted parameters. This is how it currently works with the SPA Integration Add-on.

       

      Woonsan's comment:

      "Leveraging Component Rendering URL via POST to update component parameters --> I don't think it's proper to use Component Rendering URL. That's against its design."

      I don't agree with your statement. Doing POST requests to the component rendering URL is exactly what the HST does. I'm only trying to follow the design of the HST as closely as possible, so the amount of customization needed is minimized.

       

      Example of POST request (copied via Chrome network panel when editing a component in the CM when using the HST; I removed all the unnecessary headers and cookies; please note that this curl won't work because your JSESSIONID cookie will be different and your refNsIDs most likely as well):

      curl 'http://localhost:8080/site/_testsuiteExamplePrefix/?_hn:type=component-rendering&_hn:ref=r60_r1_r2_r3_r2' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Cookie: JSESSIONID=31F5AA8428D87F76C8D5054169D245B3;' --data 'bannerPath=&content=&date=&cssDisplay2=&bannerWidth=&borderColor=%23900080&yesNo=&cssDisplay='

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rkauffman Robbert Kauffman (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: