Package org.xwiki.livedata.script
Class LiveDataScriptService
- java.lang.Object
-
- org.xwiki.livedata.script.LiveDataScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("liveData") @Singleton public class LiveDataScriptService extends Object implements org.xwiki.script.service.ScriptService
Scripting APIs for the Live Data component.- Since:
- 12.10
- Version:
- $Id: 31d57f9baee88f4fcb0ae2939f703301e78c0714 $
-
-
Constructor Summary
Constructors Constructor Description LiveDataScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
effectiveConfig(String liveDataConfigJSON)
Computes the effective live data configuration by normalizing the given configuration (i.e.Map<String,Object>
effectiveConfig(Map<String,Object> liveDataConfig)
Computes the effective live data configuration by normalizing the given configuration (i.e.<S extends org.xwiki.script.service.ScriptService>
Sget(String serviceName)
LiveData
query(String queryConfigJSON)
Executes a live data query.LiveData
query(Map<String,Object> queryConfig)
Executes a live data query.
-
-
-
Field Detail
-
ROLEHINT
public static final String ROLEHINT
The role hint of this component.- See Also:
- Constant Field Values
-
-
Method Detail
-
query
public LiveData query(Map<String,Object> queryConfig)
Executes a live data query.- Parameters:
queryConfig
- the live data query configuration- Returns:
- the live data entries that match the given query
-
query
public LiveData query(String queryConfigJSON)
Executes a live data query.- Parameters:
queryConfigJSON
- the live data query configuration- Returns:
- the live data entries that match the given query
-
effectiveConfig
public Map<String,Object> effectiveConfig(Map<String,Object> liveDataConfig)
Computes the effective live data configuration by normalizing the given configuration (i.e. transforming it to match the format expected by the live data widget) and adding the (missing) default values.- Parameters:
liveDataConfig
- the live data configuration to start with- Returns:
- the effective live data configuration, using the standard format and containing the default values
-
effectiveConfig
public String effectiveConfig(String liveDataConfigJSON)
Computes the effective live data configuration by normalizing the given configuration (i.e. transforming it to match the format expected by the live data widget) and adding the (missing) default values.- Parameters:
liveDataConfigJSON
- the live data configuration to start with- Returns:
- the effective live data configuration, using the standard format and containing the default values
-
get
public <S extends org.xwiki.script.service.ScriptService> S get(String serviceName)
- Type Parameters:
S
- the type of theScriptService
- Parameters:
serviceName
- the name of the subScriptService
- Returns:
- the
ScriptService
or null of none could be found
-
-