org.appng.core.model

## Interface TemplateProcessor

-     public interface TemplateProcessor

  Processes a request to the appNG GUI.
  This includes:
  - checking whether or not the user is logged in (and redirect to the login if this is not the case)
  - calling the right `Application` of the requested `Site`
  - building the `Platform`-object
  - applying the `Template` of the `Site` to that object
  Author:
    Matthias Müller

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Integer` | `getContentLength()` Returns the content-length of the response
    `String` | `getContentType()` Returns the content-type of the response
    `void` | `init(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, PathInfo pathInfo, String templateDir)` Initializes the `RequestProcessor`.
    `boolean` | `isRedirect()` Returns `true` if a redirect has been send while processing the request, `false` otherwise.
    `Platform` | `processPlatform(Site site)` Processes the request, but without applying the template.
    `String` | `processWithTemplate(Site site)` Processes the request, including the processing of the template.

- - ### Method Detail

    - #### processPlatform

          Platform processPlatform(Site site)
                            throws InvalidConfigurationException

      Processes the request, but without applying the template. Note that `init(HttpServletRequest, HttpServletResponse, PathInfo, String)` must have been called before.
      Parameters:
        `site` - the `Site` for which the process the request
      Returns:
        the `Platform` representing the result of calling the `Site`'s `Application`
      Throws:
        `InvalidConfigurationException` - if something goes wrong while processing the request
      See Also:
        `processWithTemplate(Site)`

    - #### processWithTemplate

          String processWithTemplate(Site site)
                              throws InvalidConfigurationException

      Processes the request, including the processing of the template. Note that `init(HttpServletRequest, HttpServletResponse, PathInfo, String)` must have been called before.
      Parameters:
        `site` - the `Site` for which the process the request
      Returns:
        the result of calling the `Application` and applying the `Template`. This should then be written to the `HttpServletResponse`
      Throws:
        `InvalidConfigurationException` - if something goes wrong while processing the request
      See Also:
        `processPlatform(Site)`

    - #### getContentType

          String getContentType()

      Returns the content-type of the response

    - #### getContentLength

          Integer getContentLength()

      Returns the content-length of the response

    - #### init

          void init(javax.servlet.http.HttpServletRequest servletRequest,
                    javax.servlet.http.HttpServletResponse servletResponse,
                    PathInfo pathInfo,
                    String templateDir)

      Initializes the `RequestProcessor`.
      Parameters:
        `servletRequest` - the current `HttpServletRequest`
        `servletResponse` - the current `HttpServletResponse`
        `pathInfo` - the current `PathInfo`
        `templateDir` - the absolute path to the directory where the active template of the `Site` resides

    - #### isRedirect

          boolean isRedirect()

      Returns `true` if a redirect has been send while processing the request, `false` otherwise.

Copyright © 2011–2023 aiticon GmbH. All rights reserved.