Search in sources :

Example 1 with MDMRepositoryNode

use of org.talend.mdm.repository.core.bridge.MDMRepositoryNode in project tmdm-studio-se by Talend.

the class RepositoryResourceUtil method convertToNode.

public static RepositoryNode convertToNode(IRepositoryViewObject viewObj) {
    Item item = viewObj.getProperty().getItem();
    ENodeType type = ENodeType.REPOSITORY_ELEMENT;
    if (item instanceof ContainerItem) {
        FolderType folderType = ((ContainerItem) item).getType();
        switch(folderType.getValue()) {
            case FolderType.SYSTEM_FOLDER:
                type = ENodeType.SYSTEM_FOLDER;
                break;
            case FolderType.STABLE_SYSTEM_FOLDER:
                type = ENodeType.STABLE_SYSTEM_FOLDER;
                break;
            case FolderType.FOLDER:
                type = ENodeType.SIMPLE_FOLDER;
                break;
            default:
                break;
        }
    }
    ERepositoryObjectType repObjType = viewObj.getRepositoryObjectType();
    RepositoryNode node = new MDMRepositoryNode(viewObj, null, type);
    node.setProperties(EProperties.LABEL, viewObj.getLabel());
    node.setProperties(EProperties.CONTENT_TYPE, repObjType);
    addChildrenToNode(viewObj, node);
    return node;
}
Also used : ContainerItem(org.talend.mdm.repository.model.mdmproperties.ContainerItem) TDQMatchRuleItem(org.talend.dataquality.properties.TDQMatchRuleItem) WorkspaceRootItem(org.talend.mdm.repository.model.mdmproperties.WorkspaceRootItem) Item(org.talend.core.model.properties.Item) FolderItem(org.talend.core.model.properties.FolderItem) BusinessProcessItem(org.talend.core.model.properties.BusinessProcessItem) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) ContainerItem(org.talend.mdm.repository.model.mdmproperties.ContainerItem) MDMRepositoryNode(org.talend.mdm.repository.core.bridge.MDMRepositoryNode) ENodeType(org.talend.repository.model.IRepositoryNode.ENodeType) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType) RepositoryNode(org.talend.repository.model.RepositoryNode) MDMRepositoryNode(org.talend.mdm.repository.core.bridge.MDMRepositoryNode) FolderType(org.talend.core.model.properties.FolderType)

Aggregations

BusinessProcessItem (org.talend.core.model.properties.BusinessProcessItem)1 FolderItem (org.talend.core.model.properties.FolderItem)1 FolderType (org.talend.core.model.properties.FolderType)1 Item (org.talend.core.model.properties.Item)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 TDQMatchRuleItem (org.talend.dataquality.properties.TDQMatchRuleItem)1 MDMRepositoryNode (org.talend.mdm.repository.core.bridge.MDMRepositoryNode)1 ContainerItem (org.talend.mdm.repository.model.mdmproperties.ContainerItem)1 MDMServerObjectItem (org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem)1 WorkspaceRootItem (org.talend.mdm.repository.model.mdmproperties.WorkspaceRootItem)1 ENodeType (org.talend.repository.model.IRepositoryNode.ENodeType)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1