Interface GadgetDataSourceTextService


public interface GadgetDataSourceTextService
  • Method Summary

    Modifier and Type
    Method
    Description
    getText(String dataSourceId)
    Reads the current text from a data source: the value of the first output parameter of type string from the first row sorted ascending by that parameter.
    getText(String dataSourceId, String parametersJson, String userName)
    Reads the current text from a data source executed with input parameters configured on a gadget.
  • Method Details

    • getText

      Optional<String> getText(String dataSourceId)
      Reads the current text from a data source: the value of the first output parameter of type string from the first row sorted ascending by that parameter. Only that one row is read from the data source. The text is not escaped - whoever displays it as HTML must escape it.
      Parameters:
      dataSourceId - data source identifier (read operation)
      Returns:
      the text, or Optional.empty() when the data source does not exist, is not allowed in dashboard gadgets (DataSourceScope.DASHBOARD_GADGET), may not be executed by the current user, returns no text or fails
    • getText

      Optional<String> getText(String dataSourceId, String parametersJson, String userName)
      Reads the current text from a data source executed with input parameters configured on a gadget. Works like getText(String).
      Parameters:
      dataSourceId - data source identifier (read operation)
      parametersJson - input parameters as stored by a gadget keyValueList property: a JSON array of {"id": ..., "value": ...} objects; blank means no parameters. Values are plain text; markups in them (e.g. <USERNAME>, <USER_PARAM:KEY>) are replaced with the data of userName
      userName - user whose data replaces the markups
      Returns:
      the text, or Optional.empty() when the data source does not exist, is not allowed in dashboard gadgets, may not be executed by the current user, returns no text or fails
      Throws:
      IllegalArgumentException - parametersJson is not a valid parameter list
      RuntimeException - com.suncode.pwfl.userparameter.UserParameterMarkerException when a user parameter markup cannot be replaced, e.g. the user has no value of the parameter