org.appng.core.model

## Class PlatformProcessor

- java.lang.Object
- - org.appng.core.model.AbstractRequestProcessor
  - - org.appng.core.model.PlatformProcessor

- All Implemented Interfaces:
    RequestProcessor

      public class PlatformProcessor
      extends AbstractRequestProcessor

  Default `RequestProcessor`-implementation, using an XSLT based template.
  Author:
    Matthias Herlitzius, Matthias Müller

- - ### Field Summary

    - ### Fields inherited from class org.appng.core.model.AbstractRequestProcessor

      `contentLength, contentType, env, INDEX_HTML, marshallService, navigationBuilder, outputFormat, outputType, pathInfo, PLATFORM_XML, redirect, servletRequest, servletResponse, STACKTRACE_TXT, templatePath`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PlatformProcessor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addTemplates(List<Template> templates)`
    `Platform` | `getPlatform(MarshallService marshallService, Path path)` Returns the `Platform`-object unmarshalled from the template's "conf/platform.xml"-file.
    `PlatformTransformer` | `getPlatformTransformer()`
    `void` | `init(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, PathInfo pathInfo, String templateDir)` Initializes the `RequestProcessor`.
    `String` | `processWithTemplate(Site applicationSite, File debugRootFolder)` Processes the request, including the processing of the template.
    `void` | `setPlatformTransformer(PlatformTransformer platformTransformer)`
    `protected void` | `writeTemplateToErrorPage(Properties platformProperties, File debugFolder, Exception templateException, Object executionContext, StringWriter errorPage)`

    - ### Methods inherited from class org.appng.core.model.AbstractRequestProcessor

      `determineActiveAuthentication, determineFormatAndType, getApplicationProvider, getContentLength, getContentType, getDebugFilePrefix, getMarshallService, getOutputFormat, getOutputType, getTemplatePath, initPlatform, isRedirect, processPlatform, setMarshallService, setRedirect, setTemplatePath, writeDebugFile, writeErrorPage`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PlatformProcessor

          public PlatformProcessor()

  - ### Method Detail

    - #### init

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

      Description copied from interface: `RequestProcessor`
      Initializes the `RequestProcessor`.
      Specified by:
        `init` in interface `RequestProcessor`
      Overrides:
        `init` in class `AbstractRequestProcessor`
      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

    - #### getPlatform

          public Platform getPlatform(MarshallService marshallService,
                                      Path path)
                               throws InvalidConfigurationException

      Description copied from class: `AbstractRequestProcessor`
      Returns the `Platform`-object unmarshalled from the template's "conf/platform.xml"-file. Also determines the `OutputType` and `OutputFormat` for the upcoming transformation.
      Overrides:
        `getPlatform` in class `AbstractRequestProcessor`
      Parameters:
        `marshallService` - the `MarshallService` to use for unmarshalling
        `path` - the current `Path`-object
      Returns:
        the `Platform`-object
      Throws:
        `InvalidConfigurationException` - if the "conf/platform.xml"-file could net be found or unmarshalled.
      See Also:
        `AbstractRequestProcessor.getOutputFormat()`, `AbstractRequestProcessor.getOutputType()`

    - #### processWithTemplate

          public String processWithTemplate(Site applicationSite,
                                            File debugRootFolder)
                                     throws InvalidConfigurationException

      Description copied from interface: `RequestProcessor`
      Processes the request, including the processing of the template. Note that `RequestProcessor.init(HttpServletRequest, HttpServletResponse, PathInfo, String)` must have been called before.
      Parameters:
        `applicationSite` - the `Site` for which the process the request
        `debugRootFolder` - the folder to write debug files to
      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:
        `RequestProcessor.processPlatform(Site)`

    - #### writeTemplateToErrorPage

          protected void writeTemplateToErrorPage(Properties platformProperties,
                                                  File debugFolder,
                                                  Exception templateException,
                                                  Object executionContext,
                                                  StringWriter errorPage)

    - #### getPlatformTransformer

          public PlatformTransformer getPlatformTransformer()

    - #### setPlatformTransformer

          public void setPlatformTransformer(PlatformTransformer platformTransformer)

    - #### addTemplates

          protected void addTemplates(List<Template> templates)

      Specified by:
        `addTemplates` in class `AbstractRequestProcessor`

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