Package de.aristaflow.adept2.ui.web
Class WebUiServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- de.aristaflow.adept2.base.servlet.SimpleServingServlet
-
- de.aristaflow.adept2.ui.web.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
-
-
Field Summary
Fields Modifier and Type Field Description protected String
afBaseUrl
The base URL for the core services or an empty stringprotected String
afPirBaseUrl
The base URL for the PIR service or an empty stringprotected String
afRemoteHtmlBaseUrl
The base URL for the Remote HTML service or an empty stringprotected String
baseHref
The base href to set in the index.htmlstatic String
CONF_AF_BASE_URL
Configuration key for the base URL for the AristaFlow core services.static String
CONF_AF_PIR_BASE_URL
Configuration key for for the AristaFlow Process Image Renderer.static String
CONF_AF_REMOTE_HTML_BASE_URL
Configuration key for the for the AristaFlow Remote HTML Runtime Manager.static String
CONF_BASE_HREF
Configuration key for the base href to use.static String
CONF_VAR_SERVLET_PATH
The configuration key for the configuration variable providing the servlet path and theCONF_BASE_HREF
.protected String
indexHtml
Cached and configured index.html content.protected static String
POM_PROPERTIES_FILE
The POM properties file within the bundle providing the version.protected org.apache.tika.mime.MediaType
utf8TextMt
The media type ofindexHtml
.
-
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.base.servletcontainer.DynamicServlet
servletDeployed
-
-
-
-
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 theCONF_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 ofindexHtml
.
-
-
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 theindex.html
from the library, anIOException
will be thrown.
-
-
Method Detail
-
adaptPath
protected String adaptPath(String path, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
- Overrides:
adaptPath
in classde.aristaflow.adept2.base.servlet.SimpleServingServlet
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException
- Overrides:
doGet
in classde.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 classde.aristaflow.adept2.base.servlet.SimpleServingServlet
- Throws:
IOException
-
-