|
| ServiceIndicator () |
|
double | getValue (IndicatorVariable variable, Object entity) |
|
void | initIndicator () |
|
void | prepareIndicator () |
|
void | generateSiblings () |
|
String | getRoot () |
|
List< IndicatorVariable > | getVariables () |
|
List< IndicatorVariable > | getAllVariables () |
|
IndicatorVariable | getVariable (String name) |
|
List< IndicatorVariable > | getAllRankingVariables (String root) |
|
List< IndicatorVariable > | getAllMatchingVariables (String root) |
|
double | getValue (IndicatorVariable variable, Object entity, String relatedPath) |
|
IndicatorResult | readIndicator (String storeClass, String indicator) |
|
void | preprocess (IndicatorVariable variable, IPreprocessor preprocessor, String entityRoot, String relatedRoot) |
|
void | postprocess (IndicatorVariable variable, IPreprocessor postprocessor, String entityRoot, String relatedRoot) |
|
Stream< String > | getEntityPaths (String root) |
|
Stream< GenericSiblings > | getSiblingPaths (String entityPath) |
|
Dao | getDao () |
|
boolean | itsMine (String root) |
|
boolean | itsMine (IndicatorVariable variable) |
|
|
void | initVariables () |
|
void | initExternalVariables () |
|
Dao | createDao () |
|
void | processRankingVariable (Dao dao, IPreprocessor preprocessor, IndicatorVariable variable, String entityRoot) |
|
void | processMatchingVariable (Dao dao, IPreprocessor preprocessor, IndicatorVariable variable, String entityRoot, String relatedRoot) |
|
void | addVariable (String name, VariableType type) |
|
void | addVariable (String name, VariableType type, boolean reversed) |
|
void | addVariable (String name, VariableType type, String avoid) |
|
void | addVariable (String name, boolean preprocess, VariableType type) |
|
void | addVariable (String name, boolean preprocess, VariableType type, boolean reversed) |
|
void | addVariable (String name, boolean preprocess, VariableType type, String avoid) |
|
void | addExternalVariable (String root, String name) |
|
String | getPath (Object entity) |
|
void | postprocessRankingVariable (Dao dao, IPreprocessor postprocessor, IndicatorVariable variable, String entityRoot) |
|
void | postprocessMatchingVariable (Dao dao, IPreprocessor postprocessor, IndicatorVariable variable, String entityRoot, String relatedRoot) |
|
◆ ServiceIndicator()
org.turro.indicator.ServiceIndicator.ServiceIndicator |
( |
| ) |
|
◆ createDao()
Dao org.turro.indicator.ServiceIndicator.createDao |
( |
| ) |
|
|
protected |
◆ getValue()
double org.turro.indicator.ServiceIndicator.getValue |
( |
IndicatorVariable |
variable, |
|
|
Object |
entity |
|
) |
| |
Reimplemented from org.turro.indicator.AbstractIndicator.
Definition at line 70 of file ServiceIndicator.java.
71 if((entity instanceof ContactService) &&
itsMine(variable)) {
72 ContactService service = (ContactService) entity;
73 switch(variable.getName()) {
75 return service.getCreation() !=
null ? Duration.between(service.getCreation().toInstant(), Instant.now()).toDays() : 9999.9;
77 return service.getStartDate()!=
null ? Duration.between(service.getStartDate().toInstant(), Instant.now()).toDays() : 9999.9;
79 return service.getEndDate()!=
null ? Duration.between(service.getEndDate().toInstant(), Instant.now()).toDays() : 9999.9;
81 return countWords(service);
boolean itsMine(String root)
◆ initExternalVariables()
void org.turro.indicator.ServiceIndicator.initExternalVariables |
( |
| ) |
|
|
protected |
◆ initVariables()
void org.turro.indicator.ServiceIndicator.initVariables |
( |
| ) |
|
|
protected |
◆ processMatchingVariable()
void org.turro.indicator.ServiceIndicator.processMatchingVariable |
( |
Dao |
dao, |
|
|
IPreprocessor |
preprocessor, |
|
|
IndicatorVariable |
variable, |
|
|
String |
entityRoot, |
|
|
String |
relatedRoot |
|
) |
| |
|
protected |
Reimplemented from org.turro.indicator.AbstractIndicator.
Definition at line 92 of file ServiceIndicator.java.
93 WhereClause wc =
null;
94 if(
"contact".equals(relatedRoot)) {
95 switch(variable.getName()) {
97 wc = PreprocessClause.load(
"ContactService")
98 .setRankingRoot(entityRoot)
99 .setMatchingRoot(relatedRoot)
100 .setRankingField(
"concat('/service/',id)")
101 .setMatchingField(
"responsible.id")
102 .setVariable(variable)
103 .setAggregate(
"count(id)")
109 try(Stream<GenericMatching> stream = dao.stream(GenericMatching.class, wc, 1000)) {
110 stream.forEach(r -> {
111 preprocessor.poolInstance(r.copyTo((IMatching) preprocessor.createInstance()));
113 preprocessor.finishPreprocessor();
◆ processRankingVariable()
The documentation for this class was generated from the following file: