Similar content

Loading

Powered by Canoo FindIT.

Request handling

Incoming requests to display a page are handled by the filter chain which is the place to start if you want to add your own business logic to Magnolia CMs.

A typical use case is to integrate a new framework with Magnolia. Integration of a new framework is generally accomplished by implementing the following steps:

  • Read the request and decide if the framework should handle it. Implement a filter to do this task and place the filter in the proper order in the filter chain. You can save the resulting model to be rendered as an attribute of the request's MgnlContext object as follows:
MgnlContext.setAttribute("xyModel", model)
  • Access the the model in your rendering system using JSTL like:
${xyModel.title}

The following diagram shows a typical request processing in Magnolia. The RenderingFilter determines which template to use to render the page. Each template is associated with a template type.

Request handling

Extension points

These points are where Magnolia request handling can be extended with additional custom business logic:
Area Object Interface / Parent Class Definition Remarks
Filter chain Filter AbstractMgnlFilter config repository at /server/filters The filters in the filter chain are executed in the configured order in the repository. Objects you store as attributes of the request's MgnlContext object can be used as JSTL variables later.
Template TemplateRenderer TemplateRenderer Define a template renderer with a new type in a module's template-renderers section. Use this new type in the template's type attribute
Paragraph Paragraph Renderer ParagraphRenderer Define a paragraph renderer with a new type in a module's paragraphs-renderers section. Use this new type in the paragraph's type attribute