Search in sources :

Example 76 with IndicatorDefinition

use of org.talend.dataquality.indicators.definition.IndicatorDefinition in project tdq-studio-se by Talend.

the class ExportWizardPage method checkForErrors.

/**
 * this check that the folder entered in the target export location exist otherwhise set an erro message and disable
 * export.
 */
protected void checkForErrors() {
    List<String> errors = new ArrayList<String>();
    errors.addAll(writer.check());
    ItemRecord[] elements = getElements();
    for (ItemRecord record : elements) {
        errors.addAll(record.getErrors());
        for (File depFile : record.getDependencySet()) {
            // ignore it(means not export it).
            if (!DqFileUtils.isLocalProjectFile(depFile)) {
                continue;
            }
            // TDQ-12245~
            ItemRecord findRecord = ItemRecord.findRecord(depFile);
            if (findRecord == null || !repositoryTree.getChecked(findRecord)) {
                ModelElement element = ItemRecord.getElement(depFile);
                // Indicator, don't add it into errors even if it is not exist
                if (element instanceof IndicatorDefinition) {
                    String uuid = ResourceHelper.getUUID(element);
                    if (IndicatorDefinitionFileHelper.isTechnialIndicator(uuid)) {
                        continue;
                    }
                }
                // MOD qiongli 2012-12-13 TDQ-5356 use itself file name for jrxml
                boolean isJrxmlDepFile = depFile.getName().endsWith(FactoriesUtil.JRXML);
                // MOD msjian TDQ-5909: modify to displayName
                String dptLabel = element != null && !isJrxmlDepFile && PropertyHelper.getProperty(element) != null ? PropertyHelper.getProperty(element).getDisplayName() : depFile.getName();
                // TDQ-5909~
                // $NON-NLS-1$ //$NON-NLS-2$
                errors.add("\"" + record.getName() + "\" miss dependency : " + dptLabel);
            }
        }
    }
    if (!errors.isEmpty()) {
        setErrorMessage(errors.get(0));
    } else {
        setErrorMessage(null);
    }
    updatePageStatus();
}
Also used : ModelElement(orgomg.cwm.objectmodel.core.ModelElement) ArrayList(java.util.ArrayList) ItemRecord(org.talend.dataprofiler.core.ui.imex.model.ItemRecord) IFile(org.eclipse.core.resources.IFile) File(java.io.File) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition)

Example 77 with IndicatorDefinition

use of org.talend.dataquality.indicators.definition.IndicatorDefinition in project tdq-studio-se by Talend.

the class FileTreeContentProvider method hideSomeItems.

/**
 * hide Some Items.
 *
 * @param itemRecords
 * @return
 */
private ItemRecord[] hideSomeItems(ItemRecord[] itemRecords) {
    List<ItemRecord> result = new ArrayList<ItemRecord>();
    for (ItemRecord itemRecord : itemRecords) {
        if (itemRecord != null) {
            // hide the Technial indicators
            if (itemRecord.getElement() != null && itemRecord.getElement() instanceof IndicatorDefinition && !(itemRecord.getElement() instanceof UDIndicatorDefinition)) {
                IndicatorDefinition indDef = (IndicatorDefinition) itemRecord.getElement();
                String uuid = ResourceHelper.getUUID(indDef);
                if (IndicatorDefinitionFileHelper.isTechnialIndicator(uuid)) {
                    continue;
                }
            }
            // TDQ-10933: Hide the Exchange node TDQ-11036: always hidden
            if (EResourceConstant.EXCHANGE.getName().equals(itemRecord.getName())) {
                continue;
            }
            // TDQ-9495: Hide the Reports node when top
            if (PluginChecker.isOnlyTopLoaded()) {
                if (EResourceConstant.REPORTS.getName().equals(itemRecord.getName())) {
                    continue;
                }
            }
        }
        result.add(itemRecord);
    }
    return result.toArray(new ItemRecord[result.size()]);
}
Also used : UDIndicatorDefinition(org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition) ItemRecord(org.talend.dataprofiler.core.ui.imex.model.ItemRecord) ArrayList(java.util.ArrayList) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition) UDIndicatorDefinition(org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition)

Example 78 with IndicatorDefinition

use of org.talend.dataquality.indicators.definition.IndicatorDefinition in project tdq-studio-se by Talend.

the class WhereRuleStatisticsStateUtil method getUnitToolTip.

/**
 * DOC xqliu Comment method "getUnitToolTip". ADD xqliu 2010-03-10 feature 10834
 *
 * @param unit
 * @return
 */
public static String getUnitToolTip(TableIndicatorUnit unit) {
    if (unit != null) {
        if (unit.getIndicator() != null && unit.getIndicator().getIndicatorDefinition() != null) {
            IndicatorDefinition indicatorDefinition = unit.getIndicator().getIndicatorDefinition();
            TaggedValue taggedValue = TaggedValueHelper.getTaggedValue(TaggedValueHelper.DESCRIPTION, indicatorDefinition.getTaggedValue());
            if (taggedValue != null) {
                return taggedValue.getValue();
            }
        }
    }
    return null;
}
Also used : TaggedValue(orgomg.cwm.objectmodel.core.TaggedValue) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition)

Example 79 with IndicatorDefinition

use of org.talend.dataquality.indicators.definition.IndicatorDefinition in project tdq-studio-se by Talend.

the class IndicatorImpl method getName.

/*
     * (non-Javadoc)
     * 
     * @see orgomg.cwm.objectmodel.core.impl.ModelElementImpl#getName()
     * 
     * ADDED scorreia 2008-05-02 return a default name if none has been set.
     */
@Override
public String getName() {
    String n = super.getName();
    if (n != null) {
        return n;
    }
    // else
    IndicatorDefinition def = getIndicatorDefinition();
    if (def != null) {
        return def.getName();
    }
    // else
    return this.eClass().getName();
}
Also used : IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition)

Example 80 with IndicatorDefinition

use of org.talend.dataquality.indicators.definition.IndicatorDefinition in project tdq-studio-se by Talend.

the class IndicatorImpl method basicSetBuiltInIndicatorDefinition.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetBuiltInIndicatorDefinition(IndicatorDefinition newBuiltInIndicatorDefinition, NotificationChain msgs) {
    IndicatorDefinition oldBuiltInIndicatorDefinition = builtInIndicatorDefinition;
    builtInIndicatorDefinition = newBuiltInIndicatorDefinition;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, IndicatorsPackage.INDICATOR__BUILT_IN_INDICATOR_DEFINITION, oldBuiltInIndicatorDefinition, newBuiltInIndicatorDefinition);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition)

Aggregations

IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)141 UDIndicatorDefinition (org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition)37 Test (org.junit.Test)35 ArrayList (java.util.ArrayList)34 TdExpression (org.talend.cwm.relational.TdExpression)31 File (java.io.File)22 Analysis (org.talend.dataquality.analysis.Analysis)16 IFile (org.eclipse.core.resources.IFile)15 Property (org.talend.core.model.properties.Property)14 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)14 TDQIndicatorDefinitionItem (org.talend.dataquality.properties.TDQIndicatorDefinitionItem)14 PersistenceException (org.talend.commons.exception.PersistenceException)13 Indicator (org.talend.dataquality.indicators.Indicator)12 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)12 Path (org.eclipse.core.runtime.Path)10 IFolder (org.eclipse.core.resources.IFolder)9 BasicEList (org.eclipse.emf.common.util.BasicEList)9 TdColumn (org.talend.cwm.relational.TdColumn)9 UserDefIndicator (org.talend.dataquality.indicators.sql.UserDefIndicator)7 TDQAnalysisItem (org.talend.dataquality.properties.TDQAnalysisItem)7