19 package org.turro.indicator;
21 import java.time.Duration;
22 import java.time.Instant;
23 import java.util.stream.Stream;
24 import org.turro.string.Strings;
25 import org.turro.annotation.ElephantIndicator;
26 import org.turro.contacts.ContactService;
27 import org.turro.contacts.db.ContactsPU;
28 import org.turro.elephant.db.WhereClause;
29 import org.turro.jpa.Dao;
30 import org.turro.matching.GenericMatching;
31 import org.turro.matching.IMatching;
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);
94 if(
"contact".equals(relatedRoot)) {
109 try(Stream<GenericMatching> stream = dao.stream(
GenericMatching.class, wc, 1000)) {
110 stream.forEach(r -> {
void addVariable(String name, VariableType type)
boolean itsMine(String root)
void addExternalVariable(String root, String name)
PreprocessClause setMatchingField(String pathField)
PreprocessClause setVariable(IndicatorVariable variable)
PreprocessClause setMatchingRoot(String entityRoot)
PreprocessClause setAggregate(String aggregate)
PreprocessClause setRankingRoot(String entityRoot)
static PreprocessClause load(String table)
PreprocessClause setRankingField(String pathField)
void processMatchingVariable(Dao dao, IPreprocessor preprocessor, IndicatorVariable variable, String entityRoot, String relatedRoot)
double getValue(IndicatorVariable variable, Object entity)
void processRankingVariable(Dao dao, IPreprocessor preprocessor, IndicatorVariable variable, String entityRoot)
void initExternalVariables()
void poolInstance(Object value)
void finishPreprocessor()