Interface GadgetDataSourceTextService
public interface GadgetDataSourceTextService
-
Method Summary
Modifier and TypeMethodDescriptionReads the current text from a data source: the value of the first output parameter of typestringfrom the first row sorted ascending by that parameter.Reads the current text from a data source executed with input parameters configured on a gadget.
-
Method Details
-
getText
Reads the current text from a data source: the value of the first output parameter of typestringfrom 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
Reads the current text from a data source executed with input parameters configured on a gadget. Works likegetText(String).- Parameters:
dataSourceId- data source identifier (read operation)parametersJson- input parameters as stored by a gadgetkeyValueListproperty: 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 ofuserNameuserName- 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-parametersJsonis not a valid parameter listRuntimeException-com.suncode.pwfl.userparameter.UserParameterMarkerExceptionwhen a user parameter markup cannot be replaced, e.g. the user has no value of the parameter
-