Search in sources :

Example 1 with ISubRepositoryObject

use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.

the class RepositoryNodeHelper method isStateDeleted.

/**
 * if logical delete state is true .
 *
 * @param node
 * @return
 */
public static boolean isStateDeleted(IRepositoryNode node) {
    final IRepositoryViewObject viewObject = node.getObject();
    final IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
    // TDQ's ISubRepositoryObject will return a null when call getAbstractMetadataObject()
    if (viewObject instanceof ISubRepositoryObject) {
        ISubRepositoryObject subRepositoryObject = (ISubRepositoryObject) viewObject;
        if (subRepositoryObject.getAbstractMetadataObject() == null) {
            return false;
        }
    }
    if (node instanceof ReportAnalysisRepNode || node instanceof ReportFileRepNode) {
        return false;
    } else {
        if (viewObject != null && factory.getStatus(viewObject) == ERepositoryStatus.DELETED) {
            return true;
        }
    }
    return false;
}
Also used : ReportFileRepNode(org.talend.dq.nodes.ReportFileRepNode) ISubRepositoryObject(org.talend.core.model.repository.ISubRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ReportAnalysisRepNode(org.talend.dq.nodes.ReportAnalysisRepNode) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory)

Example 2 with ISubRepositoryObject

use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.

the class ModelElementTreeMenuProvider method getSelectedNode.

/**
 * DOC msjian Comment method "getSelectedNode".
 *
 * @param selection
 * @return
 */
protected RepositoryNode getSelectedNode(TreeItem[] selection) {
    ModelElementIndicator meIndicator = (ModelElementIndicator) selection[0].getData(AbstractColumnDropTree.MODELELEMENT_INDICATOR_KEY);
    ModelElement me = ((ISubRepositoryObject) meIndicator.getModelElementRepositoryNode().getObject()).getModelElement();
    RepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(me);
    if (recursiveFind == null) {
        recursiveFind = RepositoryNodeHelper.createRepositoryNode(me);
    }
    return recursiveFind;
}
Also used : ModelElement(orgomg.cwm.objectmodel.core.ModelElement) ISubRepositoryObject(org.talend.core.model.repository.ISubRepositoryObject) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator)

Example 3 with ISubRepositoryObject

use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.

the class DQDBFolderRepositoryNode method getConnectionFromViewObject.

protected void getConnectionFromViewObject() {
    IRepositoryViewObject object = this.getObject() == null ? this.getParent().getObject() : this.getObject();
    if (object != null && object instanceof ISubRepositoryObject) {
        Property property = ((ISubRepositoryObject) object).getProperty();
        if (property == null) {
            return;
        }
        Item theItem = property.getItem();
        if (theItem != null && theItem instanceof ConnectionItem) {
            connection = ((ConnectionItem) theItem).getConnection();
        }
    }
}
Also used : ConnectionItem(org.talend.core.model.properties.ConnectionItem) Item(org.talend.core.model.properties.Item) ISubRepositoryObject(org.talend.core.model.repository.ISubRepositoryObject) ConnectionItem(org.talend.core.model.properties.ConnectionItem) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) Property(org.talend.core.model.properties.Property)

Example 4 with ISubRepositoryObject

use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.

the class TwoPartCheckSelectionDialog method getRealNodeFromRepository.

/**
 * DOC talend Comment method "getRealNodeFromRepository".
 *
 * @param selectNode
 * @return
 */
protected IRepositoryNode getRealNodeFromRepository(IRepositoryNode selectNode) {
    IRepositoryNode returnNode = null;
    ModelElement currModelElement = null;
    if (selectNode.getObject() instanceof ISubRepositoryObject) {
        currModelElement = ((ISubRepositoryObject) selectNode.getObject()).getModelElement();
    }
    if (currModelElement != null) {
        returnNode = RepositoryNodeHelper.recursiveFind(currModelElement);
    }
    return returnNode;
}
Also used : ModelElement(orgomg.cwm.objectmodel.core.ModelElement) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ISubRepositoryObject(org.talend.core.model.repository.ISubRepositoryObject)

Aggregations

ISubRepositoryObject (org.talend.core.model.repository.ISubRepositoryObject)4 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)2 IRepositoryNode (org.talend.repository.model.IRepositoryNode)2 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)2 ConnectionItem (org.talend.core.model.properties.ConnectionItem)1 Item (org.talend.core.model.properties.Item)1 Property (org.talend.core.model.properties.Property)1 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)1 ReportAnalysisRepNode (org.talend.dq.nodes.ReportAnalysisRepNode)1 ReportFileRepNode (org.talend.dq.nodes.ReportFileRepNode)1 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1