Package su.onno.ui

Class WidgetPluginScanner

java.lang.Object
su.onno.ui.WidgetPluginScanner

public class WidgetPluginScanner extends Object
Discovers consumer widget-plugin modules on the classpath at startup. The su.onno.widgets Gradle plugin compiles each src/main/widgets/*.tsx into onno-plugins/<name>.js, which ships in the app's jar; this scanner globs that location once and holds the sorted script file names.

The names feed two things: ThemeController advertises them (base-path-prefixed) as pluginScripts from GET /api/config, and a resource handler serves the files under {onno.ui.path}/plugins/**. Scanning once at boot is fine — the classpath is fixed for the life of the process.

  • Constructor Details

    • WidgetPluginScanner

      public WidgetPluginScanner(String location)
  • Method Details

    • scriptNames

      public List<String> scriptNames()
      The discovered plugin module file names (e.g. EventLog.js), sorted, deduplicated.
    • styleNames

      public List<String> styleNames()
      The discovered plugin stylesheet file names (e.g. com-acme-app-widgets.css), sorted, deduplicated.
    • serveLocation

      public String serveLocation()
      The single-classpath location the resource handler serves the modules from (trailing slash).