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;
}
Aggregations