use of org.talend.core.repository.model.FolderHelper in project tdq-studio-se by Talend.
the class WorkbenchUtils method isTDQOrMetadataRootFolder.
/**
* if it is TDQ_Data Profiling,TDQ_Libraries or metadata.
*
* @param folderItem
* @return
*/
public static boolean isTDQOrMetadataRootFolder(FolderItem folderItem, org.talend.core.model.properties.Project newProject) {
FolderHelper folderHelper = LocalFolderHelper.createInstance(newProject, ProxyRepositoryFactory.getInstance().getRepositoryContext().getUser());
String path = folderHelper.getFullFolderPath(folderItem);
if (path != null && (path.startsWith(RepositoryNodeHelper.PREFIX_TDQ) || path.startsWith(EResourceConstant.METADATA.getName()))) {
return true;
}
return false;
}
use of org.talend.core.repository.model.FolderHelper in project tdq-studio-se by Talend.
the class RepositoryNodeBuilder method getFolderHelper.
/**
* create a Local folder Helper
*
* @return Local Folder helper
*
* @deprecated use {@link AbstractEMFRepositoryFactory#getFolderHelper()} instead.
*/
@Deprecated
public FolderHelper getFolderHelper() {
RepositoryContext repositoryContext = (RepositoryContext) CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
Project project = null;
FolderHelper folderHelper = null;
if (repositoryContext != null) {
project = repositoryContext.getProject();
if (project != null) {
folderHelper = LocalFolderHelper.createInstance(project.getEmfProject(), repositoryContext.getUser());
}
}
return folderHelper;
}
use of org.talend.core.repository.model.FolderHelper in project tdq-studio-se by Talend.
the class UnitTestBuildHelper method createRealDataProfilingNode.
/**
* create the real RepositoryNode for DataProfiling.
*
* @return
*/
public static RepositoryNode createRealDataProfilingNode(IProject project) {
RepositoryNode node = null;
RepositoryNodeBuilder instance = RepositoryNodeBuilder.getInstance();
FolderHelper folderHelper = instance.getFolderHelper();
IFolder iFolder = project.getFolder(Path.fromPortableString(ERepositoryObjectType.TDQ_DATA_PROFILING.getFolder()));
IRepositoryViewObject viewObject = null;
if (folderHelper != null) {
IPath relativePath = iFolder.getFullPath().makeRelativeTo((project).getFullPath());
FolderItem folder2 = folderHelper.getFolder(relativePath);
if (folder2 != null && relativePath != null) {
viewObject = new Folder(folder2.getProperty(), instance.retrieveRepObjectTypeByPath(relativePath.toOSString()));
}
} else {
viewObject = new Folder(iFolder.getName(), iFolder.getName());
}
node = new RepositoryNode(viewObject, null, ENodeType.SYSTEM_FOLDER);
viewObject.setRepositoryNode(node);
return node;
}
Aggregations