use of org.talend.dataquality.reports.AnalysisMap in project tdq-studio-se by Talend.
the class TdReportImpl method removeAnalysis.
/**
* <!-- begin-user-doc --> Remove the analysis. Return true if the analysis is removed from the report and from its
* internal map, false otherwise. <!-- end-user-doc -->
*
* @generated NOT removeAnalysis(Analysis analysis)
*/
@Override
public boolean removeAnalysis(Analysis analysis) {
EList<AnalysisMap> anMaps = this.getAnalysisMap();
boolean removedFromMap = false;
for (AnalysisMap anMap : anMaps) {
if (ResourceHelper.areSame(analysis, anMap.getAnalysis())) {
anMaps.remove(anMap);
removedFromMap = true;
break;
}
}
// MOD yyin 20120530 TDQ-5050
return removedFromMap;
}
use of org.talend.dataquality.reports.AnalysisMap in project tdq-studio-se by Talend.
the class EObjectHelper method getDependedReportOfJrxml.
/**
* Go throught all reports in the project and return all which used the current jrxml.
*
* @param node the Jrxml node
* @return list of reports who used this jrxml as user defined template
*/
public static List<ModelElement> getDependedReportOfJrxml(IRepositoryNode node) {
List<ModelElement> dependedReport = new ArrayList<ModelElement>();
if (node.getObject().getProperty() == null) {
return dependedReport;
}
IPath path = PropertyHelper.getItemPath(node.getObject().getProperty());
// check if it has depended Report
// get all reports
List<ReportRepNode> repNodes = RepositoryNodeHelper.getReportRepNodes(RepositoryNodeHelper.getDataProfilingFolderNode(EResourceConstant.REPORTS), true, true);
// go through every report to find if any one used current jrxml
for (ReportRepNode report : repNodes) {
EList<AnalysisMap> analysisMap = ((TdReport) report.getReport()).getAnalysisMap();
for (AnalysisMap anaMap : analysisMap) {
if (isUsedByDeletedJrxml(path, anaMap)) {
dependedReport.add(report.getReport());
break;
}
}
}
return dependedReport;
}
use of org.talend.dataquality.reports.AnalysisMap in project tdq-studio-se by Talend.
the class TdReportImpl method setMustRefresh.
/**
* <!-- begin-user-doc --> Returns true is the boolean has been set correctly, false otherwise. False could mean
* that the given analysis does not appear in this report. <!-- end-user-doc -->
*
* @generated NOT boolean setMustRefresh(Analysis analysis, boolean mustRefresh)
*/
@Override
public boolean setMustRefresh(Analysis analysis, boolean mustRefresh) {
boolean ok = false;
EList<AnalysisMap> anMaps = this.getAnalysisMap();
// checkbox.
for (AnalysisMap anMap : anMaps) {
if (ResourceHelper.areSame(analysis, anMap.getAnalysis())) {
ok = true;
anMap.setMustRefresh(mustRefresh);
break;
}
}
if (!ok) {
// MOD yyin 20120530 TDQ-5050
AnalysisMap createAnalysisMap = ReportsFactory.eINSTANCE.createAnalysisMap();
createAnalysisMap.setAnalysis(analysis);
createAnalysisMap.setMustRefresh(mustRefresh);
createAnalysisMap.setReportType(ReportType.getReportType(analysis, ReportHelper.BASIC).getLabel());
this.getAnalysisMap().add(createAnalysisMap);
ok = true;
}
return ok;
}
use of org.talend.dataquality.reports.AnalysisMap in project tdq-studio-se by Talend.
the class TdReportImpl method mustRefresh.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT mustRefresh(Analysis analysis)
*/
@Override
public boolean mustRefresh(Analysis analysis) {
boolean yes = true;
EList<AnalysisMap> anMaps = this.getAnalysisMap();
for (AnalysisMap anMap : anMaps) {
if (ResourceHelper.areSame(analysis, anMap.getAnalysis())) {
yes = anMap.isMustRefresh();
break;
}
}
return yes;
}
use of org.talend.dataquality.reports.AnalysisMap in project tdq-studio-se by Talend.
the class DQRepositoryViewLabelProvider method addWarnIconIfNeeded.
/**
* if it is needed,add a over warning icon..eg., it is empty analysis or report; imported a MDM analysis or report.
*
* @param image
* @param node
* @param originalImageName
* @return
*/
private Image addWarnIconIfNeeded(IRepositoryNode node, String originalImageName) {
ModelElement modEle = RepositoryNodeHelper.getResourceModelElement(node);
ERepositoryObjectType objectType = node.getObjectType();
if (modEle != null) {
if (ERepositoryObjectType.TDQ_ANALYSIS_ELEMENT == objectType) {
Analysis analysis = (Analysis) modEle;
AnalysisContext context = analysis.getContext();
if (context == null) {
return ImageLib.createInvalidIcon(originalImageName);
}
EList<ModelElement> analysedElements = context.getAnalysedElements();
DataManager connection = context.getConnection();
if (analysedElements.isEmpty() || connection instanceof MDMConnection) {
return ImageLib.createInvalidIcon(originalImageName);
}
} else if (ERepositoryObjectType.TDQ_REPORT_ELEMENT == objectType) {
TdReport report = (TdReport) modEle;
EList<AnalysisMap> analysisMap = report.getAnalysisMap();
if (analysisMap.isEmpty()) {
return ImageLib.createInvalidIcon(originalImageName);
}
for (AnalysisMap anaMap : report.getAnalysisMap()) {
Analysis analysis = anaMap.getAnalysis();
if (analysis == null || analysis.getContext() == null) {
continue;
}
DataManager connection = analysis.getContext().getConnection();
if (connection instanceof MDMConnection) {
return ImageLib.createInvalidIcon(originalImageName);
}
}
}
}
return ImageLib.getImage(originalImageName);
}
Aggregations