use of org.talend.dq.nodes.ReportRepNode in project tdq-studio-se by Talend.
the class LocalRepositoryObjectCRUD method moveRepositoryNodes.
/**
* move RepositoryNodes to the target RepositoryNode.
*
* @param repositoryNodes
* @param targetNode
* @throws PersistenceException
*/
private void moveRepositoryNodes(IRepositoryNode[] repositoryNodes, IRepositoryNode targetNode) throws PersistenceException {
if (repositoryNodes != null) {
for (IRepositoryNode sourceNode : repositoryNodes) {
if (sourceNode.getType() == ENodeType.REPOSITORY_ELEMENT) {
if (sourceNode instanceof AnalysisRepNode || sourceNode instanceof ConnectionRepNode) {
moveAnaConNode(sourceNode, targetNode);
} else if (sourceNode instanceof ReportRepNode) {
moveReportRepNode(sourceNode, targetNode);
} else {
IPath makeRelativeTo = getMakeRelativeTo(sourceNode);
IPath removeLastSegments = makeRelativeTo.removeLastSegments(1);
if (sourceNode instanceof SysIndicatorDefinitionRepNode) {
// SystemIndicatorDefinition can't be moved
if (!((SysIndicatorDefinitionRepNode) sourceNode).isSystemIndicator()) {
moveOthersNode(sourceNode, targetNode, removeLastSegments);
}
} else if (sourceNode instanceof PatternRepNode) {
moveOthersNode(sourceNode, targetNode, removeLastSegments);
} else if (sourceNode instanceof JrxmlTempleteRepNode) {
moveJrxmlFileRepNode(sourceNode, targetNode, makeRelativeTo);
} else if (sourceNode instanceof SourceFileRepNode || sourceNode instanceof RuleRepNode) {
moveOthersNode(sourceNode, targetNode, makeRelativeTo);
} else {
moveOthersNode(sourceNode, targetNode, removeLastSegments);
}
}
} else if (sourceNode.getType() == ENodeType.SIMPLE_FOLDER) {
moveFolderRepNode(sourceNode, targetNode);
}
// refresh the dq repository tree view
CorePlugin.getDefault().refreshDQView(targetNode.getParent());
// MOD qiongli 2012-4-23,only refresh the parent of source node at here.
CorePlugin.getDefault().refreshDQView(sourceNode.getParent());
}
}
}
use of org.talend.dq.nodes.ReportRepNode in project tdq-studio-se by Talend.
the class RespositoryDetailView method selectionChanged.
/*
* (non-Javadoc)
*
* @seeorg.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui. IWorkbenchPart,
* org.eclipse.jface.viewers.ISelection)
*/
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
clearContainer();
boolean isNeedcreateDefault = true;
try {
if (part instanceof DQRespositoryView) {
StructuredSelection sel = (StructuredSelection) selection;
// MOD by zshen for bug 15750 TODO 39(13) make Detail View can be used.
Object fe = sel.getFirstElement();
// MOD klliu 2011-02-24 if choose diffirent node ,that will load diffirent child ,so that not use up.
if (fe instanceof AnalysisRepNode || fe instanceof ReportRepNode || fe instanceof SysIndicatorDefinitionRepNode || fe instanceof PatternRepNode || fe instanceof RuleRepNode) {
fe = ((IRepositoryNode) fe).getObject();
}
if (fe instanceof IFile) {
IFile fe2 = (IFile) fe;
isNeedcreateDefault = createFileDetail(isNeedcreateDefault, fe2);
} else if (fe instanceof IRepositoryViewObject) {
isNeedcreateDefault = createFileDetail(isNeedcreateDefault, (IRepositoryViewObject) fe);
} else if (fe instanceof DBConnectionRepNode) {
DBConnectionRepNode connNode = (DBConnectionRepNode) fe;
// MOD sizhaoliu TDQ-6316
ConnectionItem connectionItem = (ConnectionItem) connNode.getObject().getProperty().getItem();
createDataProviderDetail(connectionItem);
isNeedcreateDefault = false;
} else if (fe instanceof DBCatalogRepNode) {
DBCatalogRepNode catalogNode = (DBCatalogRepNode) fe;
Catalog catalog = catalogNode.getCatalog();
createTdCatalogDetail(catalog);
isNeedcreateDefault = false;
} else if (fe instanceof DBSchemaRepNode) {
DBSchemaRepNode schemaNode = (DBSchemaRepNode) fe;
Schema schema = schemaNode.getSchema();
createTdSchemaDetail(schema);
isNeedcreateDefault = false;
} else if (fe instanceof DBTableRepNode) {
DBTableRepNode tableNode = (DBTableRepNode) fe;
// MOD gdbu 2011-9-14 TDQ-3243
if (!DQRepositoryNode.isOnFilterring()) {
tableNode.getChildren().get(0).getChildren();
}
// ~TDQ-3243
TdTable tdTable = tableNode.getTdTable();
createTableDetail(tdTable);
isNeedcreateDefault = false;
} else if (fe instanceof DBViewRepNode) {
DBViewRepNode viewNode = (DBViewRepNode) fe;
// MOD gdbu 2011-9-14 TDQ-3243
if (!DQRepositoryNode.isOnFilterring()) {
viewNode.getChildren().get(0).getChildren();
}
// ~TDQ-3243
createNameCommentDetail(viewNode.getTdView());
isNeedcreateDefault = false;
} else if (fe instanceof DBColumnRepNode) {
DBColumnRepNode columnNode = (DBColumnRepNode) fe;
TdColumn column = columnNode.getTdColumn();
createTdColumn(column);
isNeedcreateDefault = false;
} else if (fe instanceof IEcosComponent) {
IEcosComponent component = (IEcosComponent) fe;
createEcosComponent(component);
isNeedcreateDefault = false;
} else if (fe instanceof RegularExpression) {
// MOD mzhao 2009-04-20,Bug 6349.
RegularExpression regularExpression = (RegularExpression) fe;
createRegularExpression(regularExpression);
isNeedcreateDefault = false;
} else if (fe instanceof PatternLanguageRepNode) {
// MOD mzhao 2012-08-15,feature TDQ-4037.
PatternLanguageRepNode pattLangNode = (PatternLanguageRepNode) fe;
createRegularExpression(pattLangNode.getRegularExpression());
isNeedcreateDefault = false;
} else if (fe instanceof SourceFileRepNode) {
// MOD klliu 2001-02-28 bug 19154
IPath filePath = WorkbenchUtils.getFilePath((SourceFileRepNode) fe);
DQRepositoryNode node = (DQRepositoryNode) fe;
IFile file = ResourceManager.getRoot().getProject(node.getProject().getTechnicalLabel()).getFile(filePath);
createSqlFileDetail(file);
} else if (fe instanceof ExchangeComponentRepNode) {
// MOD klliu 2001-02-28 bug 19154
IEcosComponent ecosComponent = ((ExchangeComponentRepNode) fe).getEcosComponent();
IEcosComponent component = ecosComponent;
createEcosComponent(component);
isNeedcreateDefault = false;
// ADD by msjian 2011-5-12 21186: don't check whether the selected object is "MDMConnectionRepNode"
} else if (fe instanceof DFConnectionRepNode) {
DFConnectionRepNode dfNode = (DFConnectionRepNode) fe;
DelimitedFileConnection dfConnection = dfNode.getDfConnection();
createDFconnectionName(dfNode.getObject().getLabel());
createDataProviderDetail(dfConnection);
isNeedcreateDefault = false;
}
if (PluginChecker.isTDQLoaded()) {
if (fe instanceof EObject) {
createTechnicalDetail((EObject) fe);
} else if (fe instanceof IFile) {
createTechnicalDetail((IFile) fe);
} else if (fe instanceof IRepositoryViewObject) {
createTechnicalDetail((IRepositoryViewObject) fe);
} else {
createExtDefault();
}
}
if (!scomp.isDisposed()) {
scomp.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
composite.layout();
}
} else if (part instanceof CommonFormEditor) {
CommonFormEditor editor = (CommonFormEditor) part;
IEditorInput editorInput = editor.getEditorInput();
if (editorInput instanceof IFileEditorInput) {
IFileEditorInput input = (IFileEditorInput) editorInput;
IFile file = input.getFile();
isNeedcreateDefault = createFileDetail(isNeedcreateDefault, file);
}
}
if (isNeedcreateDefault) {
createDefault();
}
// feature 19053
if (!gContainer.isDisposed()) {
gContainer.layout();
if (tContainer != null) {
tContainer.layout();
}
}
} catch (MissingDriverException e) {
if (PluginChecker.isOnlyTopLoaded()) {
MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), // $NON-NLS-1$
DefaultMessagesImpl.getString("RespositoryDetailView.warning"), e.getErrorMessage());
} else {
log.error(e, e);
}
}
}
use of org.talend.dq.nodes.ReportRepNode in project tdq-studio-se by Talend.
the class DuplicateAction method selectAndReveal.
/**
* DOC bZhou Comment method "selectAndReveal".
*
* Selects and reveals the newly added resource in all parts of the active workbench window's active page.
*
* @param newLabel
*
* @param duplicateObject
* @throws BusinessException
*/
private void selectAndReveal(String newLabel, Item duplicateItem) throws BusinessException {
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = workbenchWindow.getActivePage();
IWorkbenchPart activePart = page.getActivePart();
RepositoryNode recursiveFind = null;
recursiveFind = getSelctionNode(newLabel, duplicateItem.getProperty());
if (recursiveFind != null) {
if (recursiveFind instanceof AnalysisRepNode || recursiveFind instanceof AnalysisSubFolderRepNode || recursiveFind instanceof ReportRepNode || recursiveFind instanceof ReportSubFolderRepNode) {
CorePlugin.getDefault().refreshDQView(RepositoryNodeHelper.findNearestSystemFolderNode(recursiveFind));
} else {
CorePlugin.getDefault().refreshDQView(recursiveFind.getParent());
refreshHiveConnectionParent(recursiveFind);
}
// MOD qiongli TDQ-5391 Avoid 'recursiveFind' to casue NPE .
if (activePart instanceof ISetSelectionTarget) {
ISelection selection = new StructuredSelection(recursiveFind);
((ISetSelectionTarget) activePart).selectReveal(selection);
}
}
}
Aggregations