use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.
the class ModelElementIndicatorImpl method removeChildrenEnumMap.
private void removeChildrenEnumMap(IndicatorEnum indicatorEnum) {
if (indicatorEnum.hasChildren()) {
for (IndicatorEnum childEnum : indicatorEnum.getChildren()) {
this.flatIndicatorEnumList.remove(childEnum);
plainIndicatorUnitMap.remove(childEnum);
this.removeChildrenEnumMap(childEnum);
}
}
}
use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.
the class ColumnWizard method composePredefinedColumnIndicator.
protected ModelElementIndicator[] composePredefinedColumnIndicator(IndicatorEnum[] allowedEnum) {
List<IRepositoryNode> nodes;
// from the right menu
if (selectionPage == null) {
nodes = Arrays.asList(((AnalysisLabelParameter) parameter).getColumnNodes());
} else {
// TDQ-11240: get all the column nodes
nodes = Arrays.asList(RepositoryNodeHelper.getAllColumnNodes(selectionPage.nodes.toArray(new IRepositoryNode[selectionPage.nodes.size()])));
}
ModelElementIndicator[] predefinedColumnIndicator = new ModelElementIndicator[nodes.size()];
for (int i = 0; i < nodes.size(); i++) {
IRepositoryNode columnNode = nodes.get(i);
ModelElementIndicator columnIndicator = ModelElementIndicatorHelper.createModelElementIndicator(columnNode);
for (IndicatorEnum oneEnum : allowedEnum) {
columnIndicator.addTempIndicatorEnum(oneEnum);
if (oneEnum.getChildren() != null) {
for (IndicatorEnum childEnum : oneEnum.getChildren()) {
// MOD by zshen:need language to decide DatePatternFrequencyIndicator whether can be choose by
// user.
IRepositoryViewObject object = columnNode.getObject();
ModelElement element = null;
if (object instanceof MetadataColumnRepositoryObject) {
element = ((MetadataColumnRepositoryObject) object).getTdColumn();
} else if (object instanceof MetadataXmlElementTypeRepositoryObject) {
element = ((MetadataXmlElementTypeRepositoryObject) object).getModelElement();
}
if (element != null && ModelElementIndicatorRule.patternRule(childEnum, element, ExecutionLanguage.SQL)) {
columnIndicator.addTempIndicatorEnum(childEnum);
}
}
}
}
columnIndicator.storeTempIndicator();
predefinedColumnIndicator[i] = columnIndicator;
}
return predefinedColumnIndicator;
}
use of org.talend.dq.nodes.indicator.type.IndicatorEnum in project tdq-studio-se by Talend.
the class CreateDateAnalysisAction method getPredefinedColumnIndicator.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.action.AbstractPredefinedAnalysisAction#getPredefinedColumnIndicator()
*/
@Override
protected ModelElementIndicator[] getPredefinedColumnIndicator() {
int count = 5;
if (isTimeType()) {
count = 3;
}
IndicatorEnum[] allwedEnumes = new IndicatorEnum[count];
allwedEnumes[0] = IndicatorEnum.CountsIndicatorEnum;
allwedEnumes[1] = IndicatorEnum.MinValueIndicatorEnum;
allwedEnumes[2] = IndicatorEnum.MaxValueIndicatorEnum;
if (count == 5) {
allwedEnumes[3] = IndicatorEnum.LowFrequencyIndicatorEnum;
allwedEnumes[4] = IndicatorEnum.FrequencyIndicatorEnum;
}
ModelElementIndicator[] returnColumnIndicator = composePredefinedColumnIndicator(allwedEnumes);
if (parameters != null) {
for (ModelElementIndicator columnIndicator : returnColumnIndicator) {
for (Indicator indicator : columnIndicator.getIndicators()) {
if (indicator instanceof FrequencyIndicator) {
if (indicator.getParameters().getDateParameters() != null) {
// TODO If we will never use the
// "parameters" parameter, why we
// add TimeSliceOptionPage and have
// this loop
indicator.getParameters().getDateParameters().setDateAggregationType(parameters.getDateParameters().getDateAggregationType());
}
}
}
}
}
return returnColumnIndicator;
}
Aggregations