本文整理汇总了Java中org.pentaho.di.repository.RepositoryObject类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryObject类的具体用法?Java RepositoryObject怎么用?Java RepositoryObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryObject类属于org.pentaho.di.repository包,在下文中一共展示了RepositoryObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getObjectInformation_GetDatabaseInformation
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
@Test
public void getObjectInformation_GetDatabaseInformation() throws Exception {
KettleDatabaseRepositoryDatabaseDelegate databaseDelegate =
spy( new KettleDatabaseRepositoryDatabaseDelegate( repository ) );
repository.databaseDelegate = databaseDelegate;
RowMeta meta = createMetaForDatabase();
Object[] values = new Object[ meta.size() ];
values[ Arrays.asList( meta.getFieldNames() ).indexOf( KettleDatabaseRepositoryBase.FIELD_DATABASE_NAME ) ] = EXISTING_ID;
doReturn( new RowMetaAndData( meta, values ) )
.when( databaseDelegate )
.getDatabase( new StringObjectId( EXISTING_ID ) );
RepositoryObject actual = repository.getObjectInformation( new StringObjectId( EXISTING_ID ), RepositoryObjectType.DATABASE );
assertEquals( new StringObjectId( EXISTING_ID ), actual.getObjectId() );
assertEquals( EXISTING_ID, actual.getName() );
assertEquals( RepositoryObjectType.DATABASE, actual.getObjectType() );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:KettleDatabaseRepository_GetObjectInformation_Test.java
示例2: selectRepositoryTrans
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void selectRepositoryTrans() {
RepositoryObject repositoryObject = DialogHelper.selectRepositoryObject( "*.ktr", log );
try {
if ( repositoryObject != null ) {
loadRepositoryTrans( repositoryObject.getName(), repositoryObject.getRepositoryDirectory() );
String path = DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(), mappingTransMeta.getRepositoryDirectory().getPath() );
String fullPath = ( path.equals( "/" ) ? "/" : path + "/" ) + mappingTransMeta.getName();
wPath.setText( fullPath );
specificationMethod = ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME;
}
} catch ( KettleException ke ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "MappingDialog.ErrorSelectingObject.DialogTitle" ),
BaseMessages.getString( PKG, "MappingDialog.ErrorSelectingObject.DialogMessage" ), ke );
}
}
示例3: getByReferenceData
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void getByReferenceData( ObjectId transObjectId ) {
try {
if ( repository == null ) {
throw new KettleException( BaseMessages.getString(
PKG, "MappingDialog.Exception.NotConnectedToRepository.Message" ) );
}
RepositoryObject transInf = repository.getObjectInformation( transObjectId, RepositoryObjectType.TRANSFORMATION );
String path = DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(), transInf.getRepositoryDirectory().getPath() );
String fullPath =
Const.NVL( path, "" ) + "/" + Const.NVL( transInf.getName(), "" );
wPath.setText( fullPath );
} catch ( KettleException e ) {
new ErrorDialog( shell, BaseMessages.getString(
PKG, "MappingDialog.Exception.UnableToReferenceObjectId.Title" ), BaseMessages.getString(
PKG, "MappingDialog.Exception.UnableToReferenceObjectId.Message" ), e );
}
}
示例4: selectRepositoryTrans
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void selectRepositoryTrans() {
RepositoryObject repositoryObject = DialogHelper.selectRepositoryObject( "*.ktr", log );
try {
if ( repositoryObject != null ) {
loadRepositoryTrans( repositoryObject.getName(), repositoryObject.getRepositoryDirectory() );
String path = DialogUtils.getPath( transMeta.getRepositoryDirectory().getPath(),
executorTransMeta.getRepositoryDirectory().getPath() );
String fullPath = ( path.equals( "/" ) ? "/" : path + "/" ) + executorTransMeta.getName();
wPath.setText( fullPath );
specificationMethod = ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME;
}
} catch ( KettleException ke ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "TransExecutorDialog.ErrorSelectingObject.DialogTitle" ),
BaseMessages.getString( PKG, "TransExecutorDialog.ErrorSelectingObject.DialogMessage" ), ke );
}
}
示例5: selectRepositoryTrans
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void selectRepositoryTrans() {
RepositoryObject repositoryObject = DialogHelper.selectRepositoryObject( "*.ktr", log );
try {
if ( repositoryObject != null ) {
loadRepositoryTrans( repositoryObject.getName(), repositoryObject.getRepositoryDirectory() );
String path = DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(), mappingTransMeta.getRepositoryDirectory().getPath() );
String fullPath = ( path.equals( "/" ) ? "/" : path + "/" ) + mappingTransMeta.getName();
wPath.setText( fullPath );
specificationMethod = ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME;
}
} catch ( KettleException ke ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "SingleThreaderDialog.ErrorSelectingObject.DialogTitle" ),
BaseMessages.getString( PKG, "SingleThreaderDialog.ErrorSelectingObject.DialogMessage" ), ke );
}
}
示例6: selectRepositoryJob
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void selectRepositoryJob() {
RepositoryObject repositoryObject = DialogHelper.selectRepositoryObject( "*.kjb", log );
try {
if ( repositoryObject != null ) {
loadRepositoryJob( repositoryObject.getName(), repositoryObject.getRepositoryDirectory() );
String path = DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(), executorJobMeta.getRepositoryDirectory().getPath() );
String fullPath = ( path.equals( "/" ) ? "/" : path + "/" ) + executorJobMeta.getName();
wPath.setText( fullPath );
specificationMethod = ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME;
}
} catch ( KettleException ke ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "SingleThreaderDialog.ErrorSelectingObject.DialogTitle" ),
BaseMessages.getString( PKG, "SingleThreaderDialog.ErrorSelectingObject.DialogMessage" ), ke );
}
}
示例7: selectRepositoryTrans
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void selectRepositoryTrans() {
RepositoryObject repositoryObject = DialogHelper.selectRepositoryObject( "*.ktr", log );
try {
if ( repositoryObject != null ) {
loadRepositoryTrans( repositoryObject.getName(), repositoryObject.getRepositoryDirectory() );
String path = DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(), mappingTransMeta.getRepositoryDirectory().getPath() );
String fullPath = ( path.equals( "/" ) ? "/" : path + "/" ) + mappingTransMeta.getName();
wPath.setText( fullPath );
specificationMethod = ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME;
}
} catch ( KettleException ke ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "SimpleMappingDialog.ErrorSelectingObject.DialogTitle" ),
BaseMessages.getString( PKG, "SimpleMappingDialog.ErrorSelectingObject.DialogMessage" ), ke );
}
}
示例8: getByReferenceData
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void getByReferenceData( ObjectId transObjectId ) {
try {
if ( repository == null ) {
throw new KettleException( BaseMessages.getString(
PKG, "SimpleMappingDialog.Exception.NotConnectedToRepository.Message" ) );
}
RepositoryObject transInf = repository.getObjectInformation( transObjectId, RepositoryObjectType.TRANSFORMATION );
String path = DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(), transInf.getRepositoryDirectory().getPath() );
String fullPath =
Const.NVL( path, "" ) + "/" + Const.NVL( transInf.getName(), "" );
wPath.setText( fullPath );
} catch ( KettleException e ) {
new ErrorDialog( shell, BaseMessages.getString(
PKG, "SimpleMappingDialog.Exception.UnableToReferenceObjectId.Title" ), BaseMessages.getString(
PKG, "SimpleMappingDialog.Exception.UnableToReferenceObjectId.Message" ), e );
}
}
示例9: getByReferenceData
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void getByReferenceData( ObjectId transObjectId ) {
try {
RepositoryObject transInf = repository.getObjectInformation( transObjectId, RepositoryObjectType.TRANSFORMATION );
String
path =
DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(),
transInf.getRepositoryDirectory().getPath() );
String fullPath = Const.NVL( path, "" ) + "/" + Const.NVL( transInf.getName(), "" );
wTransPath.setText( fullPath );
} catch ( KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "JobEntryTransDialog.Exception.UnableToReferenceObjectId.Title" ),
BaseMessages.getString( PKG, "JobEntryTransDialog.Exception.UnableToReferenceObjectId.Message" ), e );
}
}
示例10: selectRepositoryObject
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
public static RepositoryObject selectRepositoryObject( String filter, LogChannel log ) {
try {
FileDialogOperation fileDialogOperation =
new FileDialogOperation( FileDialogOperation.OPEN, FileDialogOperation.ORIGIN_OTHER );
if ( !Utils.isEmpty( filter ) ) {
fileDialogOperation.setFilter( filter );
}
ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.SpoonOpenSaveRepository.id,
fileDialogOperation );
return (RepositoryObject) fileDialogOperation.getRepositoryObject();
} catch ( KettleException ke ) {
// Ignore
}
return null;
}
示例11: removeRecent
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private boolean removeRecent( String id, String type ) {
RepositoryObject repositoryObject = null;
try {
repositoryObject = getRepository().getObjectInformation( () -> id,
( type == "transformation" ? RepositoryObjectType.TRANSFORMATION : RepositoryObjectType.JOB ) );
} catch ( Exception e ) {
return false;
}
if ( repositoryObject != null ) {
Collection<List<LastUsedFile>> lastUsedRepoFiles = PropsUI.getInstance().getLastUsedRepoFiles().values();
for ( List<LastUsedFile> lastUsedFiles : lastUsedRepoFiles ) {
for ( LastUsedFile lastUsedFile : lastUsedFiles ) {
if ( lastUsedFile.getDirectory().equals( repositoryObject.getRepositoryDirectory().getPath() ) && lastUsedFile
.getFilename().equals( repositoryObject.getName() ) ) {
lastUsedFiles.remove( lastUsedFile );
return true;
}
}
}
}
return true;
}
示例12: renameRecent
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private boolean renameRecent( String id, String type, String name ) {
RepositoryObject repositoryObject = null;
try {
repositoryObject = getRepository().getObjectInformation( () -> id,
( type == "transformation" ? RepositoryObjectType.TRANSFORMATION : RepositoryObjectType.JOB ) );
} catch ( Exception e ) {
return false;
}
if ( repositoryObject != null ) {
Collection<List<LastUsedFile>> lastUsedRepoFiles = PropsUI.getInstance().getLastUsedRepoFiles().values();
for ( List<LastUsedFile> lastUsedFiles : lastUsedRepoFiles ) {
for ( LastUsedFile lastUsedFile : lastUsedFiles ) {
if ( lastUsedFile.getDirectory().equals( repositoryObject.getRepositoryDirectory().getPath() ) && lastUsedFile
.getFilename().equals( repositoryObject.getName() ) ) {
lastUsedFile.setFilename( name );
return true;
}
}
}
}
return true;
}
示例13: loadFiles
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
public List<RepositoryFile> loadFiles( String id ) {
try {
List<RepositoryElementMetaInterface> repositoryElementMetaInterfaces =
getRepository().getJobAndTransformationObjects( () -> id, false );
List<RepositoryFile> repositoryFiles = new ArrayList<>();
for ( RepositoryObjectInterface repositoryObject : repositoryElementMetaInterfaces ) {
org.pentaho.di.repository.RepositoryObject ro = (org.pentaho.di.repository.RepositoryObject) repositoryObject;
RepositoryFile repositoryFile = new RepositoryFile();
repositoryFile.setObjectId( repositoryObject.getObjectId() );
repositoryFile.setName( repositoryObject.getName() );
repositoryFile.setType( ro.getObjectType().getTypeDescription() );
repositoryFile.setExtension( ro.getObjectType().getExtension() );
repositoryFile.setDate( ro.getModifiedDate() );
repositoryFile.setObjectId( ro.getObjectId() );
repositoryFile.setPath( ro.getRepositoryDirectory().getPath() );
repositoryFiles.add( repositoryFile );
}
return repositoryFiles;
} catch ( KettleException ke ) {
return Collections.emptyList();
}
}
示例14: selectRepositoryTrans
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void selectRepositoryTrans() {
RepositoryObject repositoryObject = DialogHelper.selectRepositoryObject( "*.ktr", log );
try {
if ( repositoryObject != null ) {
loadRepositoryTrans( repositoryObject.getName(), repositoryObject.getRepositoryDirectory() );
String path = DialogUtils
.getPath( transMeta.getRepositoryDirectory().getPath(), injectTransMeta.getRepositoryDirectory().getPath() );
String fullPath = ( path.equals( "/" ) ? "/" : path + "/" ) + injectTransMeta.getName();
wPath.setText( fullPath );
specificationMethod = ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME;
}
} catch ( KettleException ke ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "SingleThreaderDialog.ErrorSelectingObject.DialogTitle" ),
BaseMessages.getString( PKG, "SingleThreaderDialog.ErrorSelectingObject.DialogMessage" ), ke );
}
}
示例15: getByReferenceData
import org.pentaho.di.repository.RepositoryObject; //导入依赖的package包/类
private void getByReferenceData( ObjectId transObjectId ) {
try {
if ( repository == null ) {
throw new KettleException( BaseMessages.getString(
PKG, "MappingDialog.Exception.NotConnectedToRepository.Message" ) );
}
RepositoryObject transInf = repository.getObjectInformation( transObjectId, RepositoryObjectType.JOB );
if ( transInf != null ) {
getByReferenceData( transInf );
}
} catch ( KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "MappingDialog.Exception.UnableToReferenceObjectId.Title" ),
BaseMessages.getString( PKG, "MappingDialog.Exception.UnableToReferenceObjectId.Message" ), e );
}
}