Class AiLinkBuilder

java.lang.Object
com.kingsrook.qqq.backend.core.actions.ai.output.AiLinkBuilder

public class AiLinkBuilder extends Object
Builds the in-app (same-origin) links the AI tool kernel returns, in the route grammar of the QQQ Next UI - which addresses every table, process, report and app by name directly under /app (not under the path of the app that contains it): table /app/{table} filtered table /app/{table}?filter={base64 of the filter JSON} record /app/{table}/{id} process /app/{process} report / app /app/{report} , /app/{app} (the same grammar as the Next UI's recordSearchResultPath and ProcessSummaryLines links, and its deserializeFilter accepts the base64 filter parameter.) Every path segment is URL-encoded.
  • Field Details

  • Constructor Details

    • AiLinkBuilder

      public AiLinkBuilder()
  • Method Details

    • objectHref

      public static String objectHref(String name)
      The link to a table's list screen (or to a process, report or app).
    • recordHref

      public static String recordHref(String tableName, Serializable id)
      The link to a record's view screen.
    • filteredTableHref

      public static String filteredTableHref(String tableName, QQueryFilter filter)
      The link to a table's list screen, with a filter applied.
    • isSafeAppPath

      public static boolean isSafeAppPath(String path)
      Whether a path is a safe, same-origin in-app path: it starts with /app/, and contains only URL-safe (or percent-encoded) characters - so no scheme, no protocol-relative "//" host, no backslashes, no whitespace, no "..".
    • encode

      public static String encode(String segment)
      URL-encode a path segment (with spaces as %20, not +).