use of org.talend.dataquality.indicators.definition.IndicatorCategory in project tdq-studio-se by Talend.
the class SysIndicatorFolderRepNode method createChildrenNode.
/**
* DOC msjian Comment method "createChildrenNode".
*
* @param withDeleted
* @param project
* @throws PersistenceException
*/
private void createChildrenNode(boolean withDeleted, Project project) throws PersistenceException {
RootContainer<String, IRepositoryViewObject> tdqViewObjects = super.getTdqViewObjects(project, this);
// sub folders
for (Container<String, IRepositoryViewObject> container : tdqViewObjects.getSubContainer()) {
Folder folder = new Folder((Property) container.getProperty(), RepositoryNodeHelper.getSystemIndicatorFolderRepositoryType(container.getLabel()));
if (isIgnoreFolder(withDeleted, project, folder)) {
continue;
}
SysIndicatorFolderRepNode childNodeFolder = new SysIndicatorFolderRepNode(folder, this, ENodeType.SYSTEM_FOLDER, project);
childNodeFolder.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.TDQ_SYSTEM_INDICATORS);
childNodeFolder.setProperties(EProperties.LABEL, ERepositoryObjectType.TDQ_SYSTEM_INDICATORS);
super.getChildren().add(childNodeFolder);
}
// rule files
for (IRepositoryViewObject viewObject : tdqViewObjects.getMembers()) {
if (!withDeleted && viewObject.isDeleted()) {
continue;
}
// TDQ-11110: hidden some system indicators.
String viewObjectlabel = viewObject.getLabel();
if (// $NON-NLS-1$
viewObjectlabel.equals("Multiple Column Correlation") || // $NON-NLS-1$
viewObjectlabel.equals("Multiple Column Frequency Table") || // $NON-NLS-1$
viewObjectlabel.equals("All Match") || viewObjectlabel.equals("Multiple Column Simple Statistics")) {
// $NON-NLS-1$
continue;
}
if (!viewObjectlabel.equals("Sum")) {
// $NON-NLS-1$
SysIndicatorDefinitionRepNode repNode = new SysIndicatorDefinitionRepNode(viewObject, this, ENodeType.REPOSITORY_ELEMENT, project);
repNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.TDQ_SYSTEM_INDICATORS);
repNode.setProperties(EProperties.LABEL, ERepositoryObjectType.TDQ_SYSTEM_INDICATORS);
viewObject.setRepositoryNode(repNode);
repNode.setSystemIndicator(true);
// MOD gdbu 2011-7-27 bug : 23161
List<TdExpression> indiExpression = repNode.getIndicatorDefinition().getSqlGenericExpression();
// MOD qiongli 2011-7-27,feature 22362
boolean isPhoneNumberStatics = false;
IndicatorCategory category = IndicatorCategoryHelper.getCategory(repNode.getIndicatorDefinition());
if (category != null && IndicatorCategoryHelper.isPhoneNumberCategory(category)) {
isPhoneNumberStatics = true;
}
if (!isPhoneNumberStatics && !isEastAsiaPatternFequencyStatics(repNode.getIndicatorDefinition()) && (indiExpression == null || indiExpression.size() == 0)) {
continue;
}
// ~23161
super.getChildren().add(repNode);
}
}
}
use of org.talend.dataquality.indicators.definition.IndicatorCategory in project tdq-studio-se by Talend.
the class NewParserRulesWizard method createAndSaveCWMFile.
public TypedReturnCode<Object> createAndSaveCWMFile(ModelElement cwmElement) {
ParserRule parserRule = (ParserRule) cwmElement;
TaggedValueHelper.setValidStatus(true, parserRule);
if (isComeFromTestEditor()) {
// MOD klliu bug TDQ-4772 2012-03-20
// copy the informations of old Expressions for the new parser rule,and it's used when an new rule is
// created in testing rule editor.
List<TdExpression> ruleExpressions = parameter.getParserRule().getExpression();
for (TdExpression expression : ruleExpressions) {
parserRule.addExpression(expression.getName(), expression.getLanguage(), expression.getBody());
}
// ~
} else {
parserRule.addExpression(parameter.getParserRuleName(), parameter.getParserRuleType(), parameter.getParserRuleValue());
IndicatorCategory ruleIndicatorCategory = DefinitionHandler.getInstance().getDQRuleIndicatorCategory();
if (ruleIndicatorCategory != null && !parserRule.getCategories().contains(ruleIndicatorCategory)) {
parserRule.getCategories().add(ruleIndicatorCategory);
}
}
IFolder folder = parameter.getFolderProvider().getFolderResource();
return ElementWriterFactory.getInstance().createdRuleWriter().create(parserRule, folder);
}
Aggregations