Interface SharedContext


public interface SharedContext
Instance can be obtained from ReadOnlyTransaction.context()
Since:
3.9.0
  • Method Details

    • baselineRevision

      @Nullable String baselineRevision()
      Returns baseline revision or null when not running in baseline context. Never return empty string or string containing only white space characters.
    • currentUserId

      @Nullable String currentUserId()
      May return null when the code is running on the server without any client, but sometimes the system user 'polarion' is used in these cases.
    • createScope

      @NotNull ScopeFactory createScope()
    • createPortalLink

      @NotNull PortalLinkBuilder createPortalLink()
      Returns builder for portal links respecting this UI context, for example the baselineRevision. Never returns null.
    • createHtmlLink

      @Nullable HtmlLink createHtmlLink(@Nullable String url)
      Returns relative link for the given parameter. To be used for links related to current Polarion server.
      Example: /polarion/help
      The url parameter must be encoded. Use escaping tools to encode the parts of your url from Velocity: $esc.url(part)
      Returns null if the given url is null or empty.
      Since:
      3.10.1
    • createHtmlFragmentBuilderFor

      @NotNull HtmlBuilderTargetSelector<HtmlFragmentBuilder> createHtmlFragmentBuilderFor()
      Returns selector for creating HtmlFragmentBuilder for selected target, never returns null.
    • createChartBuilderFor

      @NotNull ChartBuilderFactory createChartBuilderFor()
    • localization

      @NotNull SharedLocalization localization()
    • browserType

      @NotNull BrowserType browserType()
      This method works also on server when processing request from client. BrowserType.Other is returned when the code is running on server without any browser client.