Class WebUiServlet

  • All Implemented Interfaces:
    DynamicServlet, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    @ConfigurationDescription(properties={@Property(name="AfBaseUrl",defaultValue="AristaFlowREST",description="Optional base URL for the AristaFlow core services."),,,})
    public class WebUiServlet
    extends de.aristaflow.adept2.base.servlet.SimpleServingServlet
    A simple servlet providing the web UI from a base URL. This appends the requested path to the base URL and returns the retrieved result (UTF-8-encoded character stream). Deep links will be adapted appropriately.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      WebUiServlet​(org.apache.commons.configuration2.Configuration conf, de.aristaflow.adept2.base.servlet.AbstractServingServletService asss, Registry registry)
      Creates a new servlet providing web UI from the designated base URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected String adaptPath​(String path, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      protected void doGet​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      protected boolean handle​(String path, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      • Methods inherited from class de.aristaflow.adept2.base.servlet.SimpleServingServlet

        getMimeType, getServletName, servletDeployed, servletUndeployed
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, init, log, log
      • Methods inherited from interface javax.servlet.Servlet

        destroy, getServletConfig, getServletInfo, init, service
    • Field Detail

      • CONF_VAR_SERVLET_PATH

        public static final String CONF_VAR_SERVLET_PATH
        The configuration key for the configuration variable providing the servlet path and the CONF_BASE_HREF.
        See Also:
        Constant Field Values
      • POM_PROPERTIES_FILE

        protected static final String POM_PROPERTIES_FILE
        The POM properties file within the bundle providing the version.
        See Also:
        Constant Field Values
      • CONF_AF_BASE_URL

        public static final String CONF_AF_BASE_URL
        Configuration key for the base URL for the AristaFlow core services.
        See Also:
        Constant Field Values
      • CONF_AF_REMOTE_HTML_BASE_URL

        public static final String CONF_AF_REMOTE_HTML_BASE_URL
        Configuration key for the for the AristaFlow Remote HTML Runtime Manager.
        See Also:
        Constant Field Values
      • CONF_AF_PIR_BASE_URL

        public static final String CONF_AF_PIR_BASE_URL
        Configuration key for for the AristaFlow Process Image Renderer.
        See Also:
        Constant Field Values
      • CONF_BASE_HREF

        public static final String CONF_BASE_HREF
        Configuration key for the base href to use.
        See Also:
        Constant Field Values
      • afBaseUrl

        protected final String afBaseUrl
        The base URL for the core services or an empty string
      • afRemoteHtmlBaseUrl

        protected final String afRemoteHtmlBaseUrl
        The base URL for the Remote HTML service or an empty string
      • afPirBaseUrl

        protected final String afPirBaseUrl
        The base URL for the PIR service or an empty string
      • baseHref

        protected final String baseHref
        The base href to set in the index.html
      • indexHtml

        protected final String indexHtml
        Cached and configured index.html content.
      • utf8TextMt

        protected final org.apache.tika.mime.MediaType utf8TextMt
        The media type of indexHtml.
    • Constructor Detail

      • WebUiServlet

        public WebUiServlet​(org.apache.commons.configuration2.Configuration conf,
                            de.aristaflow.adept2.base.servlet.AbstractServingServletService asss,
                            Registry registry)
                     throws IOException
        Creates a new servlet providing web UI from the designated base URL.
        Parameters:
        conf - Servlet-specific configuration. This is not used by this class.
        asss - The serving servlet service instantiating this servlet. This provdies the base URL of the content, that is the corresponding root directory (may be in a Jar-file), and the log service.
        registry - The registry providing the instance name which is also the servlet name.
        Throws:
        IOException - If there are problems reading the index.html from the library, an IOException will be thrown.
    • Method Detail

      • adaptPath

        protected String adaptPath​(String path,
                                   javax.servlet.http.HttpServletRequest req,
                                   javax.servlet.http.HttpServletResponse resp)
        Overrides:
        adaptPath in class de.aristaflow.adept2.base.servlet.SimpleServingServlet
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws IOException
        Overrides:
        doGet in class de.aristaflow.adept2.base.servlet.SimpleServingServlet
        Throws:
        IOException
      • handle

        protected boolean handle​(String path,
                                 javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse resp)
                          throws IOException
        Overrides:
        handle in class de.aristaflow.adept2.base.servlet.SimpleServingServlet
        Throws:
        IOException