Search in sources :

Example 36 with RepositoryNode

use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.

the class GenericWizardInternalService method createRepositoryNode.

@Override
public RepositoryNode createRepositoryNode(RepositoryNode curParentNode, String label, ERepositoryObjectType type, ENodeType nodeType) {
    RepositoryNode dynamicNode = new RepositoryNode(null, (RepositoryNode) curParentNode.getRoot(), nodeType);
    dynamicNode.setProperties(EProperties.LABEL, label);
    dynamicNode.setProperties(EProperties.CONTENT_TYPE, type);
    curParentNode.getChildren().add(dynamicNode);
    return dynamicNode;
}
Also used : RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 37 with RepositoryNode

use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.

the class GenericRepositoryContentHandler method createTable.

private void createTable(RepositoryNode parentNode, IRepositoryViewObject repObj, MetadataTable metadataTable) {
    if (!SubItemHelper.isDeleted(metadataTable)) {
        RepositoryNode tableNode = RepositoryNodeManager.createMetatableNode(parentNode, repObj, metadataTable);
        parentNode.getChildren().add(tableNode);
        if (metadataTable.getColumns().size() > 0) {
            RepositoryNodeManager.createColumns(tableNode, repObj, metadataTable);
        }
    }
}
Also used : StableRepositoryNode(org.talend.repository.model.StableRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 38 with RepositoryNode

use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.

the class GenericRepositoryContentHandler method createSubNodes.

private void createSubNodes(RepositoryNode parentNode, IRepositoryViewObject repObj, Package pack) {
    List<SubContainer> subContainers = PackageHelper.getOwnedElements(pack, SubContainer.class);
    if (subContainers.size() > 0) {
        for (SubContainer subContainer : subContainers) {
            RepositoryNode subContainerNode = createSubContainerNode(parentNode, subContainer.getName());
            createSubNodes(subContainerNode, repObj, subContainer);
        }
    } else {
        List<MetadataTable> metadataTables = PackageHelper.getOwnedElements(pack, MetadataTable.class);
        for (MetadataTable metadataTable : metadataTables) {
            createTable(parentNode, repObj, metadataTable);
        }
    }
}
Also used : MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) StableRepositoryNode(org.talend.repository.model.StableRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) SubContainer(org.talend.repository.generic.model.genericMetadata.SubContainer)

Example 39 with RepositoryNode

use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.

the class ReadRoutineAction method init.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.repository.ui.actions.ITreeContextualAction#init(org.eclipse.jface.viewers.TreeViewer,
     * org.eclipse.jface.viewers.IStructuredSelection)
     */
public void init(TreeViewer viewer, IStructuredSelection selection) {
    super.init(viewer, selection);
    boolean canWork = !selection.isEmpty() && selection.size() == 1;
    if (canWork) {
        RepositoryNode node = (RepositoryNode) selection.getFirstElement();
        if (node.getObjectType() != ERepositoryObjectType.ROUTINES) {
            canWork = false;
        }
        if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.LOCK_BY_USER) {
            canWork = false;
        }
    }
    setEnabled(canWork);
}
Also used : RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 40 with RepositoryNode

use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.

the class ExportItemWizardPage method getUnTestCaseChildren.

private List<Object> getUnTestCaseChildren(Object[] children) {
    ITestContainerProviderService testContainerService = null;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
        testContainerService = (ITestContainerProviderService) GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    }
    List<Object> childrenNodes = new ArrayList<Object>();
    for (Object obj : children) {
        if ((obj instanceof RepositoryNode) && testContainerService != null) {
            boolean isTestCase = testContainerService.isTestContainerType(((RepositoryNode) obj).getObjectType());
            if (!isTestCase) {
                childrenNodes.add(obj);
            }
        } else {
            childrenNodes.add(obj);
        }
    }
    return childrenNodes;
}
Also used : ArrayList(java.util.ArrayList) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) RepositoryObject(org.talend.core.model.repository.RepositoryObject) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IProjectRepositoryNode(org.talend.repository.model.nodes.IProjectRepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ITestContainerProviderService(org.talend.core.ui.ITestContainerProviderService)

Aggregations

RepositoryNode (org.talend.repository.model.RepositoryNode)250 IRepositoryNode (org.talend.repository.model.IRepositoryNode)94 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)74 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)44 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)44 ProjectRepositoryNode (org.talend.core.repository.model.ProjectRepositoryNode)42 Item (org.talend.core.model.properties.Item)38 ArrayList (java.util.ArrayList)33 PersistenceException (org.talend.commons.exception.PersistenceException)27 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)27 ProcessItem (org.talend.core.model.properties.ProcessItem)23 RepositoryObject (org.talend.core.model.repository.RepositoryObject)22 ISelection (org.eclipse.jface.viewers.ISelection)20 ConnectionItem (org.talend.core.model.properties.ConnectionItem)20 IProjectRepositoryNode (org.talend.repository.model.nodes.IProjectRepositoryNode)20 List (java.util.List)18 Property (org.talend.core.model.properties.Property)18 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)17 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)16 WizardDialog (org.eclipse.jface.wizard.WizardDialog)13