Rendering improvements (MAGNOLIA-5895)

[MAGNOLIA-5837] Revise implementation of Direct Area Rendering Created: 18/Jul/14  Updated: 01/Jun/15  Resolved: 25/Aug/14

Status: Closed
Project: Magnolia
Component/s: rendering, templating
Affects Version/s: None
Fix Version/s: 5.4

Type: Sub-task Priority: Neutral
Reporter: Roman Kovařík Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
caused by MAGNOLIA-5002 Direct area rendering - port to master Closed
dependency
depends upon MAGNOLIA-5839 Revise implementation of Rendering Li... Closed
Template:
Release notes required:
Yes
Date of First Response:

 Description   

Current implementation of DAR has few limitations:

  • whole page is processed even if the target area was already rendered.
  • support only area which exist in JCR
  1. RenderingFilter.render()
    Check for "mgnlArea" should go into AreaFilteringListener.init()
  2. The rendering of areas/components outside of the target area should be skipped.
  3. We could support not only areas existing in JCR but also those defined in template definition.
  4. Add possibility to disable check for area existence to be able to render all areas.


 Comments   
Comment by Jan Haderka [ 18/Jul/14 ]

I might be wrong, but I seem to remember that decision to use Appendable was because it is template/model that controls whether OutputStream or PrintWriter from the response will be used and spec puts some limitations on using both in same response. Appendable provided means to abstract this.

an empty page when trying to render an unexisting area will be rendered as a sideeefect, but a warn from AreaFilteringListener should be enough

IMHO this is not correct either. Same as rendering non existent page results in 404, rendering nonexistent area should do the same. Primary reason for being able to do partial rendering such as direct area or component rendering is to allow tools that assemble complete page to suck content from Magnolia externally. In order for such integrations to work correctly it is necessary from Magnolia to correctly signal attempt to render non existent content (in difference from existing content that currently produces empty response because it has nothing to render).

Comment by Roman Kovařík [ 18/Jul/14 ]

I might be wrong, but I seem to remember that decision to use Appendable was because it is template/model that controls whether OutputStream or PrintWriter from the response will be used and spec puts some limitations on using both in same response. Appendable provided means to abstract this.

ResponseOutputProvider takes care of exclusions. I think FilteringResponseOutputProvider.java could do the same. It currently offers only Appedable and ignores OutputStream at all.

Same as rendering non existent page results in 404, rendering nonexistent area should do the same.

I see...I just don't like hardcoded logic for checking of "mgnlArea" pameter directly in RenderingFilter (check area existence -> use dedicated ResponseOutputProvider). I was thinking about capability of listeners to be able to signal something (404, skip rendering if a component if it's in cache...). The logic could go into the listener if it would be possible...

Comment by Roman Kovařík [ 10/Nov/14 ]

Squashed on the parent ticket.

Generated at Mon Feb 12 04:08:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.