当前位置: 首页>>代码示例>>Java>>正文


Java RepositoryDirectory.setObjectId方法代码示例

本文整理汇总了Java中org.pentaho.di.repository.RepositoryDirectory.setObjectId方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryDirectory.setObjectId方法的具体用法?Java RepositoryDirectory.setObjectId怎么用?Java RepositoryDirectory.setObjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.repository.RepositoryDirectory的用法示例。


在下文中一共展示了RepositoryDirectory.setObjectId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRepositoryDirectory

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectoryInterface createRepositoryDirectory(RepositoryDirectoryInterface parentDirectory, String directoryPath) throws KettleException {
	String folder = calcDirectoryName(parentDirectory);
	String newFolder = folder;
	if (folder.endsWith("/")) newFolder+=directoryPath; else newFolder+="/"+directoryPath;
	
	FileObject parent = KettleVFS.getFileObject(newFolder);
	try {
		parent.createFolder();
	} catch (FileSystemException e) {
		throw new KettleException("Unable to create folder "+newFolder, e);
	}
	
	// Incremental change of the directory structure...
	//
	RepositoryDirectory newDir = new RepositoryDirectory(parentDirectory, directoryPath);
	parentDirectory.addSubdirectory(newDir);
	newDir.setObjectId(new StringObjectId(newDir.toString()));
	
	return newDir;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:21,代码来源:KettleFileRepository.java

示例2: loadRepositoryDirectoryTree

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectoryInterface loadRepositoryDirectoryTree(RepositoryDirectoryInterface dir) throws KettleException {
	try {
		String folderName = calcDirectoryName(dir);
		FileObject folder = KettleVFS.getFileObject(folderName);
		
		for (FileObject child : folder.getChildren()) {
			if (child.getType().equals(FileType.FOLDER)) {
			  if (!child.isHidden() || !repositoryMeta.isHidingHiddenFiles()) {
				RepositoryDirectory subDir = new RepositoryDirectory(dir, child.getName().getBaseName());
				subDir.setObjectId(new StringObjectId(calcObjectId(subDir)));
				dir.addSubdirectory(subDir);
				
				loadRepositoryDirectoryTree(subDir);
			  }
			}
		}
		
		return dir;
	}
	catch(Exception e) {
		throw new KettleException("Unable to load the directory tree from this file repository", e);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:KettleFileRepository.java

示例3: initRepositoryDirectoryTree

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
private RepositoryDirectoryInterface initRepositoryDirectoryTree( RepositoryFileTree repoTree )
  throws KettleException {
  RepositoryFile rootFolder = repoTree.getFile();
  RepositoryDirectory rootDir = new RepositoryDirectory();
  rootDir.setObjectId( new StringObjectId( rootFolder.getId().toString() ) );
  fillRepositoryDirectoryFromTree( rootDir, repoTree );

  // Example: /etc
  RepositoryDirectory etcDir = rootDir.findDirectory( ClientRepositoryPaths.getEtcFolderPath() );

  RepositoryDirectory newRoot = new RepositoryDirectory();
  newRoot.setObjectId( rootDir.getObjectId() );
  newRoot.setVisible( false );

  for ( int i = 0; i < rootDir.getNrSubdirectories(); i++ ) {
    RepositoryDirectory childDir = rootDir.getSubdirectory( i );
    // Don't show /etc
    boolean isEtcChild = childDir.equals( etcDir );
    if ( isEtcChild ) {
      continue;
    }
    newRoot.addSubdirectory( childDir );
  }
  return newRoot;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:PurRepository.java

示例4: testGetRepositoryObjectsNulled

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testGetRepositoryObjectsNulled() throws Exception {
  RepositoryDirectory root = new RepositoryDirectory();
  root.setObjectId( new LongObjectId( 0L ) );
  RepositoryDirectory dir = new RepositoryDirectory();
  dir.setObjectId( new LongObjectId( 1L ) );
  root.addSubdirectory( dir );

  RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
  when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );

  Repository repo = mock( Repository.class );
  when( repo.getJobAndTransformationObjects( dir.getObjectId(), false ) ).thenReturn(
      Collections.singletonList( meta ) );
  when( repo.getJobAndTransformationObjects( root.getObjectId(), false ) ).thenReturn( Collections.emptyList() );

  UIRepositoryDirectory uiDir = new UIRepositoryDirectory( root, null, repo );
  UIRepositoryObjects objects = uiDir.getRepositoryObjects();
  assertNotNull( objects );
  uiDir = new UIRepositoryDirectory( dir, uiDir, repo );
  objects = uiDir.getRepositoryObjects();
  assertEquals( 1, objects.size() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:24,代码来源:UIRepositoryDirectoryTest.java

示例5: createRepositoryDirectory

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectoryInterface createRepositoryDirectory(RepositoryDirectoryInterface parentDirectory, String directoryPath) throws KettleException {
	String folder = calcDirectoryName(parentDirectory);
	String newFolder = folder;
	if (folder.endsWith("/")) newFolder+=directoryPath; else newFolder+="/"+directoryPath;
	
	FileObject parent = KettleVFS.getFileObject(newFolder);
	try {
		parent.createFolder();
	} catch (FileSystemException e) {
		throw new KettleException("Unable to create folder "+newFolder, e);
	}
	
	// Incremental change of the directory structure...
	//
	RepositoryDirectory newDir = new RepositoryDirectory(parentDirectory, directoryPath);
	parentDirectory.addSubdirectory(newDir);
	newDir.setObjectId(new StringObjectId(calcObjectId(newDir)));
	
	return newDir;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:21,代码来源:KettleFileRepository.java

示例6: fillRepositoryDirectoryFromTree

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
private void fillRepositoryDirectoryFromTree( final RepositoryDirectoryInterface parentDir,
                                      final RepositoryFileTree treeNode ) throws KettleException {
  try {
    List<RepositoryElementMetaInterface> fileChildren = new ArrayList<RepositoryElementMetaInterface>();
    List<RepositoryFileTree> children = treeNode.getChildren();
    if ( children != null ) {
      for ( RepositoryFileTree child : children ) {
        if ( child.getFile().isFolder() ) {
          RepositoryDirectory dir = new RepositoryDirectory( parentDir, child.getFile().getName() );
          dir.setObjectId( new StringObjectId( child.getFile().getId().toString() ) );
          parentDir.addSubdirectory( dir );
          fillRepositoryDirectoryFromTree( dir, child );
        } else {
          // a real file, like a Transformation or Job
          RepositoryLock lock = unifiedRepositoryLockService.getLock( child.getFile() );
          RepositoryObjectType objectType = getObjectType( child.getFile().getName() );

          fileChildren.add( new EERepositoryObject( child, parentDir, null, objectType, null, lock, false ) );
        }
      }
      parentDir.setRepositoryObjects( fileChildren );
    }
  } catch ( Exception e ) {
    throw new KettleException( "Unable to load directory structure from repository", e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:PurRepository.java

示例7: loadRepositoryDirectoryTree

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectoryInterface loadRepositoryDirectoryTree(RepositoryDirectoryInterface dir) throws KettleException {
	try {
		String folderName = calcDirectoryName(dir);
		FileObject folder = KettleVFS.getFileObject(folderName);
		
     for (FileObject child : folder.getChildren()) {
       if (child.getType().equals(FileType.FOLDER)) {
         if (!child.isHidden() || !repositoryMeta.isHidingHiddenFiles()) {
           RepositoryDirectory subDir = new RepositoryDirectory(dir, child.getName().getBaseName());
           subDir.setObjectId(new StringObjectId(calcObjectId(subDir)));
           dir.addSubdirectory(subDir);

           loadRepositoryDirectoryTree(subDir);
         }
       }
     }

		return dir;
	}
	catch(Exception e) {
		throw new KettleException("Unable to load the directory tree from this file repository", e);
	}
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:24,代码来源:KettleFileRepository.java

示例8: createRepositoryDirectory

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Override
public RepositoryDirectoryInterface createRepositoryDirectory( RepositoryDirectoryInterface parentDirectory,
  String directoryPath ) throws KettleException {
  String folder = calcDirectoryName( parentDirectory );
  String newFolder = folder;
  if ( folder.endsWith( "/" ) ) {
    newFolder += directoryPath;
  } else {
    newFolder += "/" + directoryPath;
  }

  FileObject parent = KettleVFS.getFileObject( newFolder );
  try {
    parent.createFolder();
  } catch ( FileSystemException e ) {
    throw new KettleException( "Unable to create folder " + newFolder, e );
  }

  // Incremental change of the directory structure...
  //
  RepositoryDirectory newDir = new RepositoryDirectory( parentDirectory, directoryPath );
  parentDirectory.addSubdirectory( newDir );
  newDir.setObjectId( new StringObjectId( calcObjectId( newDir ) ) );

  return newDir;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:KettleFileRepository.java

示例9: loadRepositoryDirectoryTree

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectoryInterface loadRepositoryDirectoryTree( RepositoryDirectoryInterface dir ) throws KettleException {
  try {
    String folderName = calcDirectoryName( dir );
    FileObject folder = KettleVFS.getFileObject( folderName );

    for ( FileObject child : folder.getChildren() ) {
      if ( child.getType().equals( FileType.FOLDER ) ) {
        if ( !child.isHidden() || !repositoryMeta.isHidingHiddenFiles() ) {
          if ( !".meta".equals( child.getName().getBaseName() ) ) {
            RepositoryDirectory subDir = new RepositoryDirectory( dir, child.getName().getBaseName() );
            subDir.setObjectId( new StringObjectId( calcObjectId( subDir ) ) );
            dir.addSubdirectory( subDir );

            loadRepositoryDirectoryTree( subDir );
          }
        }
      }
    }

    return dir;
  } catch ( Exception e ) {
    throw new KettleException( "Unable to load the directory tree from this file repository", e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:25,代码来源:KettleFileRepository.java

示例10: testGetRepositoryObjectsFilled

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testGetRepositoryObjectsFilled() throws Exception {
  RepositoryDirectory root = new RepositoryDirectory();
  root.setObjectId( new LongObjectId( 0L ) );
  RepositoryDirectory dir = new RepositoryDirectory();
  dir.setObjectId( new LongObjectId( 1L ) );
  root.addSubdirectory( dir );
  RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
  when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );

  root.setRepositoryObjects( Collections.emptyList() );
  dir.setRepositoryObjects( Collections.singletonList( meta ) );

  Repository repo = mock( Repository.class );
  UIRepositoryDirectory uiDir = new UIRepositoryDirectory( root, null, repo );
  UIRepositoryObjects objects = uiDir.getRepositoryObjects();
  assertNotNull( objects );
  uiDir = new UIRepositoryDirectory( dir, uiDir, repo );
  objects = uiDir.getRepositoryObjects();
  assertEquals( 1, objects.size() );
  verifyZeroInteractions( repo );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:UIRepositoryDirectoryTest.java

示例11: testLoadRepositoryObjectsFilled

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testLoadRepositoryObjectsFilled() throws Exception {
  RepositoryDirectory root = new RepositoryDirectory();
  root.setObjectId( new LongObjectId( 0L ) );
  RepositoryDirectory dir = new RepositoryDirectory();
  dir.setObjectId( new LongObjectId( 1L ) );
  root.addSubdirectory( dir );
  RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
  when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );

  root.setRepositoryObjects( Collections.emptyList() );
  dir.setRepositoryObjects( Collections.singletonList( meta ) );
  Repository repo = mock( Repository.class );

  assertTrue( RepositoryDirectoryUI.loadRepositoryObjects( root, true, true, repo ).isEmpty() );
  assertEquals( 1, RepositoryDirectoryUI.loadRepositoryObjects( dir, true, true, repo ).size() );

  verifyZeroInteractions( repo );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:RepositoryDirectoryUITest.java

示例12: testLoadRepositoryObjectsNulled

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
@Test
public void testLoadRepositoryObjectsNulled() throws Exception {
  RepositoryDirectory root = new RepositoryDirectory();
  root.setObjectId( new LongObjectId( 0L ) );
  RepositoryDirectory dir = new RepositoryDirectory();
  dir.setObjectId( new LongObjectId( 1L ) );
  root.addSubdirectory( dir );
  RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
  when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );

  Repository repo = mock( Repository.class );
  when( repo.getJobAndTransformationObjects( dir.getObjectId(), false ) ).thenReturn(
      Collections.singletonList( meta ) );
  when( repo.getJobAndTransformationObjects( root.getObjectId(), false ) ).thenReturn( Collections.emptyList() );

  assertTrue( RepositoryDirectoryUI.loadRepositoryObjects( root, true, true, repo ).isEmpty() );
  assertEquals( 1, RepositoryDirectoryUI.loadRepositoryObjects( dir, true, true, repo ).size() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:RepositoryDirectoryUITest.java

示例13: loadRepositoryDirectoryTree

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectoryInterface loadRepositoryDirectoryTree() throws KettleException {
	RepositoryDirectory root = new RepositoryDirectory();
	root.setObjectId(new LongObjectId(0L));
	return directoryDelegate.loadRepositoryDirectoryTree(root);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:6,代码来源:KettleDatabaseRepository.java

示例14: getUserHomeDirectory

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectory getUserHomeDirectory() throws KettleException {
  RepositoryDirectory root = new RepositoryDirectory();
  root.setObjectId(new LongObjectId(0L));
  directoryDelegate.loadRepositoryDirectory(root, root.getObjectId());
  return root;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:7,代码来源:KettleDatabaseRepository.java

示例15: getUserHomeDirectory

import org.pentaho.di.repository.RepositoryDirectory; //导入方法依赖的package包/类
public RepositoryDirectoryInterface getUserHomeDirectory() throws KettleException {
  RepositoryDirectory root = new RepositoryDirectory();
  root.setObjectId(null);
  return loadRepositoryDirectoryTree(root);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:6,代码来源:KettleFileRepository.java


注:本文中的org.pentaho.di.repository.RepositoryDirectory.setObjectId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。