GREYDiscussion points about rendering context. NEEDS REVIEW GREY
Rationale:

  • today renderers can't stream binaries (images, pdf, ..): MAGNOLIA-3014@jira
  • the links are not always rendered the same way
    • mails: use full links including the domain
    • integration into other sites: portlets, ajax, ...

Goal

  • uncouple the rendering and request processing
  • possibility to streaming binaries (jsp)

Implementation

  • interface
    • getLinkTransformer()
    • getWriter()
    • getOutputStream()

Outlook

  • parameters/attributes?
  • redirect()/redirect()
  • setExceptionHandler()

3 Comments

  1. Attributes would be one way to let components "talk" to each other; see for an example info.magnolia.module.templatingcomponents.components.SingletonParagraphBar#isInSingleton

    This would also need to hold current node+renderable(+model?); this pair (or trio) could maybe be kept in a stack of sorts.

  2. Wouldn't it be way better to use some kind of dependency injection instead of putting everything into a context and collecting dependencies whenever needed? Maybe a JSR-330 compatible version of autowireing would be possible?

  3. As of Magnolia 4.5 RenderingContext returns OutputProvider that gives you access to either Appendable or to OutputStream so serving binaries should be now possible.