Package org.silverpeas.looks.aurora.matomo

## Class MatomoInjectionFilter

- java.lang.Object
- - org.silverpeas.looks.aurora.matomo.MatomoInjectionFilter

- All Implemented Interfaces:
    `javax.servlet.Filter`

      public class MatomoInjectionFilter
      extends Object
      implements javax.servlet.Filter

  Servlet `Filter` responsible for injecting the Matomo tracking script into generated JSP pages.

  The script is dynamically built using a Silverpeas template and enriched with contextual information such as the current user, space and component identifiers.

  The injection is performed just before the closing `</body>` tag of the HTML response.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `END_TAG_SCRIPT` |
    `static String` | `START_TAG_SCRIPT` |
    `static String` | `TITLE` |
    `static String` | `VIRTUAL_PAGE` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MatomoInjectionFilter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `doFilter​(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)` |
    `String` | `getCurrentUserId​(javax.servlet.http.HttpServletRequest request)` |
    `void` | `init​(javax.servlet.FilterConfig filterConfig)` |

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

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

    - ### Methods inherited from interface javax.servlet.Filter

      `destroy`

- - ### Field Detail

    - #### START_TAG_SCRIPT

          public static final String START_TAG_SCRIPT

      See Also:
        Constant Field Values

    - #### END_TAG_SCRIPT

          public static final String END_TAG_SCRIPT

      See Also:
        Constant Field Values

    - #### VIRTUAL_PAGE

          public static final String VIRTUAL_PAGE

      See Also:
        Constant Field Values

    - #### TITLE

          public static final String TITLE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MatomoInjectionFilter

          public MatomoInjectionFilter()

  - ### Method Detail

    - #### init

          public void init​(javax.servlet.FilterConfig filterConfig)
                    throws javax.servlet.ServletException

      Specified by:
        `init` in interface `javax.servlet.Filter`
      Throws:
        `javax.servlet.ServletException`

    - #### doFilter

          public void doFilter​(javax.servlet.ServletRequest request,
                               javax.servlet.ServletResponse response,
                               javax.servlet.FilterChain chain)
                        throws IOException,
                               javax.servlet.ServletException

      Specified by:
        `doFilter` in interface `javax.servlet.Filter`
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### getCurrentUserId

          public String getCurrentUserId​(javax.servlet.http.HttpServletRequest request)