本文整理汇总了Java中org.pentaho.di.repository.RepositoryDirectory类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryDirectory类的具体用法?Java RepositoryDirectory怎么用?Java RepositoryDirectory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryDirectory类属于org.pentaho.di.repository包,在下文中一共展示了RepositoryDirectory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getDirectory
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
/**
* 获取资源库所有目录信息
*
* @param rdi
* @param list
*/
private List<?> getDirectory(RepositoryDirectoryInterface rdi,
List<KettleTree> list) {
try {
RepositoryDirectoryInterface tree = repo
.loadRepositoryDirectoryTree().findDirectory(
rdi.getObjectId());
for (int i = 0; i < rdi.getNrSubdirectories(); i++) {
RepositoryDirectory subTree = tree.getSubdirectory(i);
KettleTree d = new KettleTree();
d.setId(subTree.getObjectId().toString());
d.setpId(rdi.getObjectId().toString());
d.setName(subTree.getName());
d.setDir(subTree.getPath());
d.setaId(subTree.getObjectId().toString());
d.setClick("false");
d.setOpen("false");
d.setIsParent("true");
d.setType("dir");
list.add(d);
}
} catch (Exception e) {
}
return list;
}
开发者ID:jiangzongyao,项目名称:kettle_support_kettle8.0,代码行数:31,代码来源:KettleReposServiceImpl.java
示例2: toString
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
public String toString()
{
String string = "";
if (sourceRepository && !Const.isEmpty(directory) && !Const.isEmpty(repositoryName))
{
string+="["+repositoryName+"] ";
if (directory.endsWith(RepositoryDirectory.DIRECTORY_SEPARATOR))
{
string+=": "+directory+filename;
}
else
{
string+=": "+RepositoryDirectory.DIRECTORY_SEPARATOR+filename;
}
}
else
{
string+=filename;
}
return string;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:25,代码来源:LastUsedFile.java
示例3: delDirectory
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
public void delDirectory(TreeItem ti, RepositoryDirectory repdir)
{
try
{
repdir.delFromRep(rep);
refreshTree();
}
catch(KettleException e)
{
new ErrorDialog(shell,
Messages.getString("RepositoryExplorerDialog.Directory.Delete.ErrorRemoving.Title"), //$NON-NLS-1$
Messages.getString("RepositoryExplorerDialog.Directory.Delete.ErrorRemoving.Message1"), //$NON-NLS-1$
e
);
}
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:RepositoryExplorerDialog.java
示例4: importAll
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
public void importAll()
{
FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
if (dialog.open()!=null)
{
String[] filenames = dialog.getFileNames();
if (filenames.length > 0)
{
SelectDirectoryDialog sdd = new SelectDirectoryDialog(shell, SWT.NONE, rep);
RepositoryDirectory baseDirectory = sdd.open();
if (baseDirectory!=null)
{
RepositoryImportProgressDialog ripd = new RepositoryImportProgressDialog(shell, SWT.NONE, rep, dialog.getFilterPath(), filenames, baseDirectory);
ripd.open();
refreshTree();
}
}
}
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:21,代码来源:RepositoryExplorerDialog.java
示例5: selectRepositoryTrans
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
private void selectRepositoryTrans()
{
try
{
SelectObjectDialog sod = new SelectObjectDialog(shell, repository);
String transName = sod.open();
RepositoryDirectory repdir = sod.getDirectory();
if (transName != null && repdir != null)
{
loadRepositoryTrans(transName, repdir);
wTransName.setText(mappingTransMeta.getName());
wTransDir.setText(mappingTransMeta.getDirectory().getPath());
wFilename.setText("");
wRepRadio.setSelection(true);
wFileRadio.setSelection(false);
}
} catch (KettleException ke)
{
new ErrorDialog(
shell,
Messages.getString("MappingDialog.ErrorSelectingObject.DialogTitle"), Messages.getString("MappingDialog.ErrorSelectingObject.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
}
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:24,代码来源:MappingDialog.java
示例6: loadTransformation
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
private void loadTransformation() throws KettleException
{
if (wFileRadio.getSelection() && !Const.isEmpty(wFilename.getText())) // Read
// from
// file...
{
loadFileTrans(wFilename.getText());
} else
{
if (wRepRadio.getSelection() && repository != null && !Const.isEmpty(wTransName.getText())
&& !Const.isEmpty(wTransDir.getText()))
{
RepositoryDirectory repdir = repository.getDirectoryTree().findDirectory(wTransDir.getText());
if (repdir == null)
{
throw new KettleException(Messages.getString("MappingDialog.Exception.UnableToFindRepositoryDirectory)"));
}
loadRepositoryTrans(wTransName.getText(), repdir);
} else
{
throw new KettleException(Messages.getString("MappingDialog.Exception.NoValidMappingDetailsFound"));
}
}
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:25,代码来源:MappingDialog.java
示例7: toString
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
public String toString() {
if (!Const.isEmpty(filename)) {
if (Const.isEmpty(name)) {
return filename;
} else {
return filename+" : "+name;
}
}
if (name != null) {
if (directory!=null) {
String path = directory.getPath();
if (path.endsWith(RepositoryDirectory.DIRECTORY_SEPARATOR)) {
return path+name;
} else {
return path+RepositoryDirectory.DIRECTORY_SEPARATOR+name;
}
} else {
return name;
}
} else {
return JobMeta.class.getName();
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:25,代码来源:JobMeta.java
示例8: loadRepositoryDirectoryTree
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
public RepositoryDirectoryInterface loadRepositoryDirectoryTree(RepositoryDirectoryInterface root) throws KettleException {
try {
synchronized(repository){
root.clear();
ObjectId subids[] = repository.getSubDirectoryIDs(root.getObjectId());
for (int i = 0; i < subids.length; i++) {
RepositoryDirectory subdir = new RepositoryDirectory();
loadRepositoryDirectory(subdir, subids[i]);
root.addSubdirectory(subdir);
}
}
return root;
} catch (Exception e) {
throw new KettleException("An error occured loading the directory tree from the repository", e);
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:KettleDatabaseRepositoryDirectoryDelegate.java
示例9: 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
示例10: 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
示例11: toString
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
/**
* @return the textual representation of the transformation: it's name. If the name has not been set, the classname
* is returned.
*/
public String toString()
{
if (!Const.isEmpty(filename)) {
if (Const.isEmpty(name)) {
return filename;
} else {
return filename+" : "+name;
}
}
if (name != null) {
if (directory!=null) {
String path = directory.getPath();
if (path.endsWith(RepositoryDirectory.DIRECTORY_SEPARATOR)) {
return path+name;
} else {
return path+RepositoryDirectory.DIRECTORY_SEPARATOR+name;
}
} else {
return name;
}
} else {
return TransMeta.class.getName();
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:30,代码来源:TransMeta.java
示例12: refreshTree
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
private void refreshTree() {
try {
wTree.removeAll();
TreeItem ti = null;
// If the directory is a root directory and is visible to the user we will
// display that on the UI otherwise we will hide it
if (directoryTree.isRoot() && directoryTree.isVisible()) {
ti = new TreeItem(wTree, SWT.NONE);
ti.setImage(GUIResource.getInstance().getImageFolderConnections());
ti.setExpanded(true);
RepositoryDirectoryUI.getTreeWithNames(ti, rep, dircolor, sortColumn, includeDeleted, ascending, showTrans, showJobs, directoryTree, filterString, pattern);
} else {
for (int i = 0; i < directoryTree.getNrSubdirectories(); i++) {
RepositoryDirectory subdir = directoryTree.getSubdirectory(i);
ti = new TreeItem(wTree, SWT.NONE);
ti.setImage(GUIResource.getInstance().getImageArrow());
RepositoryDirectoryUI.getTreeWithNames(ti, rep, dircolor, sortColumn, includeDeleted, ascending, showTrans, showJobs, subdir, filterString, pattern);
}
}
} catch (KettleException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "SelectObjectDialog.Dialog.UnexpectedError.Title"), BaseMessages.getString(PKG, "SelectObjectDialog.Dialog.UnexpectedError.Message"), e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:SelectObjectDialog.java
示例13: toString
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
public String toString() {
String string = "";
if ( sourceRepository && !Utils.isEmpty( directory ) && !Utils.isEmpty( repositoryName ) ) {
string += "[" + repositoryName + "] ";
if ( directory.endsWith( RepositoryDirectory.DIRECTORY_SEPARATOR ) ) {
string += ": " + directory + filename;
} else {
string += ": " + directory + RepositoryDirectory.DIRECTORY_SEPARATOR + filename;
}
} else {
string += filename;
}
return string;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:LastUsedFile.java
示例14: toString
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
/**
* Gets a textual representation of the job. If its name has been set, it will be returned,
* otherwise the classname is returned.
*
* @return the textual representation of the job.
*/
public String toString() {
if (!Const.isEmpty(filename)) {
if (Const.isEmpty(name)) {
return filename;
} else {
return filename+" : "+name;
}
}
if (name != null) {
if (directory!=null) {
String path = directory.getPath();
if (path.endsWith(RepositoryDirectory.DIRECTORY_SEPARATOR)) {
return path+name;
} else {
return path+RepositoryDirectory.DIRECTORY_SEPARATOR+name;
}
} else {
return name;
}
} else {
return JobMeta.class.getName();
}
}
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:31,代码来源:JobMeta.java
示例15: beforeTest
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
@Before
public void beforeTest() throws Exception {
mockObjectId = mock( ObjectId.class );
when( mockObjectId.getId() ).thenReturn( ID );
mockRepositoryDirectory = mock( RepositoryDirectory.class );
when( mockRepositoryDirectory.getObjectId() ).thenReturn( mockObjectId );
mockParent = mock( UIRepositoryDirectory.class );
mockAclService = mock( IAclService.class );
mockRepository = mock( Repository.class );
when( mockRepository.hasService( IAclService.class ) ).thenReturn( true );
when( mockRepository.getService( IAclService.class ) ).thenReturn( mockAclService );
mockPurRepository = mock( PurRepository.class );
when( mockPurRepository.hasService( IAclService.class ) ).thenReturn( true );
when( mockPurRepository.getService( IAclService.class ) ).thenReturn( mockAclService );
uiRepDir = new UIEERepositoryDirectory( mockRepositoryDirectory, mockParent, mockRepository );
uiPurRepDir = new UIEERepositoryDirectory( mockRepositoryDirectory, mockParent, mockPurRepository );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:UIEERepositoryDirectoryTest.java
示例16: testRefresh
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
@Test
public void testRefresh() throws Exception {
RepositoryDirectory root = new RepositoryDirectory();
LongObjectId rootObjectId = new LongObjectId( 0L );
root.setObjectId( rootObjectId );
RepositoryDirectory dir = new RepositoryDirectory();
dir.setObjectId( new LongObjectId( 1L ) );
root.addSubdirectory( dir );
RepositoryExtended repo = mock( RepositoryExtended.class );
UserInfo userInfo = new UserInfo();
userInfo.setAdmin( true );
Mockito.when( repo.getUserInfo() ).thenReturn( userInfo );
RepositoryDirectory rd = Mockito.mock( RepositoryDirectory.class );
Mockito.when( rd.findDirectory( Mockito.eq( rootObjectId ) ) )
.thenReturn( Mockito.mock( RepositoryDirectory.class ) );
Mockito.when( repo.loadRepositoryDirectoryTree( "/", "*.ktr|*.kjb", -1, true, true, true ) ).thenReturn( rd );
UIRepositoryDirectory uiDir = new UIRepositoryDirectory( root, null, repo );
uiDir.refresh();
Mockito.verify( repo ).loadRepositoryDirectoryTree( "/", "*.ktr|*.kjb", -1, true, true, true );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:UIRepositoryDirectoryTest.java
示例17: generateDomainJobButton
import org.pentaho.di.repository.RepositoryDirectory; //导入依赖的package包/类
protected void generateDomainJobButton(StarDomain starDomain) {
final Spoon spoon = Spoon.getInstance();
List<DatabaseMeta> sharedDatabases = SharedDatabaseUtil.loadSharedDatabases();
JobGenerator jobGenerator = new JobGenerator(starDomain, spoon.rep, new RepositoryDirectory(), sharedDatabases, defaultLocale);
try {
List<TransMeta> transMetas = jobGenerator.generateDimensionTransformations();
for (TransMeta transMeta : transMetas) {
spoon.addTransGraph(transMeta);
}
SpoonPerspectiveManager.getInstance().activatePerspective(MainSpoonPerspective.class);
} catch(Exception e) {
new ErrorDialog(spoon.getShell(),
BaseMessages.getString(PKG, "StarModelerPerspective.ErrorGeneratingSqlJob.Title"),
BaseMessages.getString(PKG, "StarModelerPerspective.ErrorGeneratingSqlJob.Message"), e);
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:21,代码来源:StarModelerPerspective.java
示例18: 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
示例19: 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
示例20: 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
注:本文中的org.pentaho.di.repository.RepositoryDirectory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论