Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-216

Customize content format and perform business logic on server

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • Yes
    • Yes

      User story:

      As a SPA developer, I want to get content in the correct format, so that I can use the content write away in my components without changing the component or massaging the data.

      As a Magnolia developer, I want to run model code and return results of this code to the frontend components, so that I can solve more complex customer requirements such as serverside calculations.

      Notes:

      See: SPA - How to match content to API of JS components

       

      Acceptance criteria:

      • Control the 'format' of the content that is passed to a frontend component, such as property names,  arrays vs maps, heirarchies.
      • Run models and deliver content from them.

      Notes:

      If we added GraphQL support - it would be likely be a little file living next to each component to specify the props to get and their shape. Therefore, without GraphQL an alternative would be to support a "JSON transformer file", or a component model, which would specify or remap the default content, and supply it as a new JSON format. Possibly this could also be supplied as an FTL file to provide "templating the JSON response".

        Acceptance criteria

          1. EventDetails.java
            0.2 kB
          2. EventDetailsResolver.java
            3 kB
          3. EventDetailsResolverDefinition.java
            0.4 kB
          4. EventDetailsWriter.java
            2 kB
          5. pages_v1.yaml
            0.7 kB

              Unassigned Unassigned
              czimmermann Christopher Zimmermann
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:

                  Task DoD