Interface IExternalBrowserPages

All Known Implementing Classes:
ExternalBrowserPagesImpl, ExternalBrowserPagesImpl

public interface IExternalBrowserPages
Page interface for external browsers.
Author:
Christopher Mindus
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    doAuthenticate(PortConfig portConfig, String target)
    Checks if a request URL is a WebSocket request or an Application URI that should not use authentication.
    Gets the Web Analytics settings of an application (CC-ANALYTICS-CONSENT): the GA4 Measurement ID and the consent choice from its App page, for the one line the servlet injects into iiziApp.html per response.
    Gets the Web Analytics settings of an application for a language (CC-FIX-GA4-V5, GA-6): as getAppAnalytics(String), with the application's name in that language for the consent prompt, the way the PWA manifest names the application.
    Gets the virtual directory /app/<appID>/ of an application (CC-PWA-V5A-APPDIR-ROUTE, design CC-DESIGN-APP-URL-V2 section 2): the generated application page per language and the stamp of the directory, which AppDirectoryHandler serves at the head of the handler chain.
    Gets what iiziAppSorry.html shows for an application, the page served instead of iiziApp.html to a Browser that cannot run IIZI (CC-BROWSER-GATE): its name, description and store links.
    default String
    Gets the appearance modes an application allows a client to show (CC-THEME-DARK-V5): the uiModes choice of its App page, written into the first-paint lines of iiziApp.html per response in place of UISchemes.MODES_MARKER, so that a page of an application whose own styling is light paints light whatever the device's choice.
    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.
    default boolean
    isAppRefusedOn(String appID, PortConfig portConfig)
    Tells whether an application is REFUSED on the port configuration a request arrived on (CC-FIX-APP-DEFINITIONS, PR-3/PR-4): the server answers from ServerAppConfig.isServedOn - an application's ports list names the port configurations it is served on, empty for all of them, a request without a configuration is refused by an application with a list (D-19) - and the handlers then answer exactly as for an unknown application ID: 404 for the page, its generated files and its resources, 404 at the WebSocket upgrade, no redirect for the legacy page.
    default boolean
    isOriginAllowed(String origin, String requestHost)
    Tells whether a cross-origin page may read this server's responses (CC-FIX-SB-CORS, IIZI-JETTY-CORS-CREDENTIALS-ANY-ORIGIN): the origin policy of CORSFilter, asked for an http(s) origin that is neither an iiziRun WebView origin nor the host the request came to, which the filter grants by itself.
    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.
  • Method Details

    • isTargetValid

      boolean isTargetValid(PortConfig portConfig, String target)
      Checks for valid target to handle.
      Parameters:
      portConfig - The port configuration.
      target - The target URI.
      Returns:
      true if target is processed as an external page, false otherwise.
    • doAuthenticate

      boolean doAuthenticate(PortConfig portConfig, String target)
      Checks if a request URL is a WebSocket request or an Application URI that should not use authentication.

      IIZI-NO-BASIC-DIGEST-AUTH: this method has NO CALLER. Its only two call sites are inside the commented-out Basic and Digest authentication block in RunConfigurationWebServer (see the marker there), so it exists only to serve a feature IIZI does not support. It is deliberately NOT commented out, because both implementors carry @Override and are in other projects (com.iizigo and com.iizix.server) - removing the declaration would break their compilation, which is a decision for CM and not part of the 2026-08-28 authentication decision. Retained as it was; the two call sites pass one argument to this two-argument method, so it is not even the signature they were written against.

      Parameters:
      portConfig - The port configuration.
      target - The target URI.
      Returns:
      true if authentication should be performed, false otherwise.
    • print

      void print(PortConfig portConfig, PrintWriter pw, String root, String target, HttpServletRequest request, HttpServletResponse response) throws IOException
      Print the page output.
      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.
    • getFileOrResource

      Object getFileOrResource(String location, String target)
      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.
      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 or instance of URL for the resource, null for none.
    • getCustomizedAppHTML

      File getCustomizedAppHTML(File file, String appID, String lang)
      Gets a customized "iiziApp.html" file for a specific application ID and optional language.
      Parameters:
      file - The compressed iiziApp.html file without customization.
      appID - The application ID.
      lang - The language requested, or null 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.
    • getAppSorryInfo

      default BrowserGate.AppInfo getAppSorryInfo(String appID)
      Gets what iiziAppSorry.html shows for an application, the page served instead of iiziApp.html to a Browser that cannot run IIZI (CC-BROWSER-GATE): its name, description and store links. The server answers from ServerShell through AppFactory.getAppDistributionProps(); the Designer answers from the Module projects loaded in its workspace, matched by registered appID or by project name, with the store URLs of each project's .iiziApp (ruling Q2 of CC-BROWSER-GATE). This default, kept for any other implementation, knows no application, so the page shows no name and no store link.
      Parameters:
      appID - The application ID, never null nor empty.
      Returns:
      The information, or null for an unknown application: the page is then served with its defaults and without a store link.
    • getAppAnalytics

      default AppAnalytics.Settings getAppAnalytics(String appID)
      Gets the Web Analytics settings of an application (CC-ANALYTICS-CONSENT): the GA4 Measurement ID and the consent choice from its App page, for the one line the servlet injects into iiziApp.html per response. The server answers from ServerShell through the Module app settings, and answers only a valid ID; the Designer has no such chain and keeps this default, so its preview never loads Analytics.
      Parameters:
      appID - The application ID, never null nor empty.
      Returns:
      The settings, or null for an unknown application or one without a valid Measurement ID: no line is injected and no Analytics runs.
    • getAppAnalytics

      default AppAnalytics.Settings getAppAnalytics(String appID, String lang)
      Gets the Web Analytics settings of an application for a language (CC-FIX-GA4-V5, GA-6): as getAppAnalytics(String), with the application's name in that language for the consent prompt, the way the PWA manifest names the application. The server answers the name from the App page's localized name; this default knows no language and answers getAppAnalytics(String).
      Parameters:
      appID - The application ID, never null nor empty.
      lang - The language code of the request, null or empty for the default language.
      Returns:
      The settings, or null for an unknown application or one without a valid Measurement ID: no line is injected and no Analytics runs.
    • getAppUIModes

      default String getAppUIModes(String appID)
      Gets the appearance modes an application allows a client to show (CC-THEME-DARK-V5): the uiModes choice of its App page, written into the first-paint lines of iiziApp.html per response in place of UISchemes.MODES_MARKER, so that a page of an application whose own styling is light paints light whatever the device's choice. The server answers from ServerShell through the Module app settings; this default, kept for any other implementation, allows both.
      Parameters:
      appID - The application ID, never null nor empty.
      Returns:
      The modes as UISchemes.modesValue(int) reads them: "light", "dark", or the empty string for both; null reads as both.
    • getAppDirectory

      default IAppDirectory getAppDirectory(String appID)
      Gets the virtual directory /app/<appID>/ of an application (CC-PWA-V5A-APPDIR-ROUTE, design CC-DESIGN-APP-URL-V2 section 2): the generated application page per language and the stamp of the directory, which AppDirectoryHandler serves at the head of the handler chain. The server answers from ServerShell through AppFactory.getAppDirectory, after IServer.validateAppID has accepted the segment, so a segment that is not a valid application ID is refused before any lookup (design F-6); an alias is answered with the directory of the application it names, whose IAppDirectory.getAppID() is the canonical ID, and the handler redirects to it. The Designer keeps this default: its server has no such directory, and /app/ answers 404 there.
      Parameters:
      appID - The path segment after /app/, decoded, never null nor empty: an application ID, an alias, or anything else a Browser sent.
      Returns:
      The directory, or null for an invalid or unknown ID: the handler answers 404.
    • isAppRefusedOn

      default boolean isAppRefusedOn(String appID, PortConfig portConfig)
      Tells whether an application is REFUSED on the port configuration a request arrived on (CC-FIX-APP-DEFINITIONS, PR-3/PR-4): the server answers from ServerAppConfig.isServedOn - an application's ports list names the port configurations it is served on, empty for all of them, a request without a configuration is refused by an application with a list (D-19) - and the handlers then answer exactly as for an unknown application ID: 404 for the page, its generated files and its resources, 404 at the WebSocket upgrade, no redirect for the legacy page. This default refuses nothing: the Designer's internal web server serves no application, and a test double that knows no port configurations keeps serving.
      Parameters:
      appID - The application ID: the canonical ID of a directory, or the ID or alias of a request.
      portConfig - The port configuration of the request's connector, null for none.
      Returns:
      true when refused, false when served.
    • isOriginAllowed

      default boolean isOriginAllowed(String origin, String requestHost)
      Tells whether a cross-origin page may read this server's responses (CC-FIX-SB-CORS, IIZI-JETTY-CORS-CREDENTIALS-ANY-ORIGIN): the origin policy of CORSFilter, asked for an http(s) origin that is neither an iiziRun WebView origin nor the host the request came to, which the filter grants by itself. The server answers from its WebSocket Origin allow-list (ServerShell.isOriginAllowedForCORS: the environments' allowed domains, the external server URL, the hub's members and origins, the $allowedOrigins setting, and on a development server the loopback origins). This default, kept for any other implementation, grants nothing; the Designer's internal web server adds the loopback origins by itself (CORSFilter.designerPolicy).
      Parameters:
      origin - The request's Origin header field, an http(s) origin.
      requestHost - The host the request came to (Host without the port), may be null.
      Returns:
      true to grant the origin, false to refuse it: the Browser then refuses the preflight or the read of the response.