Package com.iizigo.comm
Class ExternalBrowserPagesImpl
java.lang.Object
com.iizigo.comm.ExternalBrowserPagesImpl
- All Implemented Interfaces:
IExternalBrowserPages
Class to handle external web pages with embedded Jetty.
- Author:
- Christopher Mindus
Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionboolean
doAuthenticate
(PortConfig portConfig, String target) Checks if a request URL is a WebSocket request or an Application URI that should not use authentication.getCustomizedAppHTML
(File file, String appID, String lang) Gets a customized "iiziApp.html" file for a specific application ID and optional language.getFileOrResource
(String location, String target) Gets a File or Resource redirection from a web server target request, used for e.g.void
Called when initialized.boolean
isTargetValid
(PortConfig portConfig, String target) Checks for valid target to handle.void
print
(PortConfig portConfig, PrintWriter pw, String root, String target, HttpServletRequest request, HttpServletResponse response) Print the page output.static String
setTooltipPreview
(String html) Sets the current tooltip preview.
Constructor Details
ExternalBrowserPagesImpl
Constructor.
Method Details
setTooltipPreview
Sets the current tooltip preview.- Parameters:
html
- The HTML string to set as preview.- Returns:
- The resource to use in a browser.
initialize
Called when initialized.doAuthenticate
Checks if a request URL is a WebSocket request or an Application URI that should not use authentication.- Specified by:
doAuthenticate
in interfaceIExternalBrowserPages
- Parameters:
portConfig
- The port configuration.target
- The target URI.- Returns:
- true if authentication should be performed, false otherwise.
getFileOrResource
Gets a File or Resource redirection from a web server target request, used for e.g. Asset resource files when used on the server and the file is inside a Jar.- Specified by:
getFileOrResource
in interfaceIExternalBrowserPages
- Parameters:
location
- The location string between '/$' and '$/'target
- The target string from the Web Server after last '$/' (i.e. after location), does NOT begin with '/'.- Returns:
- The
File
for the resource, null for none.
isTargetValid
Checks for valid target to handle.- Specified by:
isTargetValid
in interfaceIExternalBrowserPages
- Parameters:
portConfig
- The port configuration.target
- The target URI.- Returns:
- true if target is processed as an external page, false otherwise.
print
public void print(PortConfig portConfig, PrintWriter pw, String root, String target, HttpServletRequest request, HttpServletResponse response) throws IOException Print the page output.- Specified by:
print
in interfaceIExternalBrowserPages
- Parameters:
portConfig
- The port configuration.pw
- The print writer.root
- The web server root.target
- Target page.request
- The request.response
- The response.- Throws:
IOException
- For I/O errors.
getCustomizedAppHTML
Gets a customized "iiziApp.html" file for a specific application ID and optional language.- Specified by:
getCustomizedAppHTML
in interfaceIExternalBrowserPages
- Parameters:
file
- The compressed iiziApp.html file without customization.appID
- The application ID.lang
- The language requested, ornull
for default.- Returns:
- The customized (and probably cached) file to send instead of the un-customized one, or
null
for none, i.e. in case an application ID is not found.