本文整理了Java中org.pentaho.di.repository.Repository.loadJob
方法的一些代码示例,展示了Repository.loadJob
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.loadJob
方法的具体详情如下:
包路径:org.pentaho.di.repository.Repository
类名称:Repository
方法名:loadJob
[英]Load a job from the repository
[中]从存储库加载作业
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public JobMeta loadJob( String s, RepositoryDirectoryInterface repositoryDirectoryInterface, ProgressMonitorListener progressMonitorListener, String s1 ) throws KettleException {
return getDelegate().loadJob( s, repositoryDirectoryInterface, progressMonitorListener, s1 );
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public JobMeta loadJob( ObjectId objectId, String s ) throws KettleException {
return getDelegate().loadJob( objectId, s );
}
代码示例来源:origin: pentaho/pentaho-kettle
private void loadRepositoryJob( String transName, RepositoryDirectoryInterface repdir ) throws KettleException {
// Read the transformation...
//
executorJobMeta = repository.loadJob( transMeta.environmentSubstitute( transName ), repdir, null, null ); // reads
// last
// version
executorJobMeta.clearChanged();
}
代码示例来源:origin: pentaho/pentaho-kettle
private JobMeta getJobMetaFromRepository( Repository rep, CurrentDirectoryResolver r, String transPath ) throws KettleException {
String realJobName = "";
String realDirectory = "/";
int index = transPath.lastIndexOf( RepositoryFile.SEPARATOR );
if ( index != -1 ) {
realJobName = transPath.substring( index + 1 );
realDirectory = index == 0 ? RepositoryFile.SEPARATOR : transPath.substring( 0, index );
}
realDirectory = r.normalizeSlashes( realDirectory );
RepositoryDirectoryInterface repositoryDirectory = rep.loadRepositoryDirectoryTree().findDirectory( realDirectory );
if ( repositoryDirectory == null ) {
throw new KettleException( "Unable to find repository directory [" + Const.NVL( realDirectory, "" ) + "]" );
}
return rep.loadJob( realJobName, repositoryDirectory, null, null ); // reads
}
代码示例来源:origin: pentaho/pentaho-kettle
private JobMeta loadJob( Repository repository, String job ) throws KettleException {
if ( repository == null ) {
throw new KettleException( "Repository required." );
} else {
synchronized ( repository ) {
// With a repository we need to load it from /foo/bar/Transformation
// We need to extract the folder name from the path in front of the
// name...
//
String directoryPath;
String name;
int lastSlash = job.lastIndexOf( RepositoryDirectory.DIRECTORY_SEPARATOR );
if ( lastSlash < 0 ) {
directoryPath = "/";
name = job;
} else {
directoryPath = job.substring( 0, lastSlash );
name = job.substring( lastSlash + 1 );
}
RepositoryDirectoryInterface directory =
repository.loadRepositoryDirectoryTree().findDirectory( directoryPath );
ObjectId jobID = repository.getJobId( name, directory );
JobMeta transJob = repository.loadJob( jobID, null );
return transJob;
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
throw new KettleException( "Unable to find job '" + name + "' in directory :" + directory );
JobMeta jobMeta = repository.loadJob( jobID, null );
return jobMeta;
代码示例来源:origin: pentaho/pentaho-kettle
public void run( IProgressMonitor monitor ) throws InvocationTargetException, InterruptedException {
Spoon spoon = Spoon.getInstance();
try {
// Call extension point(s) before the file has been opened
ExtensionPointHandler.callExtensionPoint(
spoon.getLog(),
KettleExtensionPoint.JobBeforeOpen.id,
( objectId == null ) ? jobname : objectId.toString() );
if ( objectId != null ) {
jobInfo = rep.loadJob( objectId, versionLabel );
} else {
jobInfo = rep.loadJob( jobname, repdir, new ProgressMonitorAdapter( monitor ), versionLabel );
}
// Call extension point(s) now that the file has been opened
ExtensionPointHandler.callExtensionPoint( spoon.getLog(), KettleExtensionPoint.JobAfterOpen.id, jobInfo );
if ( jobInfo.hasMissingPlugins() ) {
MissingEntryDialog missingDialog = new MissingEntryDialog( shell, jobInfo.getMissingEntries() );
if ( missingDialog.open() == null ) {
jobInfo = null;
}
}
} catch ( KettleException e ) {
throw new InvocationTargetException( e, "Error loading job" );
}
}
};
代码示例来源:origin: pentaho/pentaho-kettle
private JobMeta loadJob( ReportSubjectLocation location ) throws KettleException {
JobMeta jobMeta;
if ( !Utils.isEmpty( location.getFilename() ) ) {
jobMeta = new JobMeta( location.getFilename(), repository );
} else {
jobMeta = repository.loadJob( location.getName(), location.getDirectory(), null, null );
}
return jobMeta;
}
代码示例来源:origin: pentaho/pentaho-kettle
JobMeta ji = rep.loadJob( jobs[i], repdir, null, null ); // reads last version
log.logBasic( "Exporting Jobs", "[" + jobs[i] + "] in directory [" + repdir.getPath() + "]" );
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by name,
* guess {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_NAME}.
* Load the job from the repository using the specified job name and directory.
*/
@Test
public void testConnectedLoad_RepByName_Guess() throws Exception {
Repository myrepo = mock( Repository.class );
doReturn( true ).when( myrepo ).isConnected();
doReturn( rdi ).when( myrepo ).loadRepositoryDirectoryTree();
doReturn( null ).when( myrepo ).getJobEntryAttributeString( any( ObjectId.class ), anyString() );
doReturn( JOB_ENTRY_FILE_NAME ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "name" );
doReturn( JOB_ENTRY_FILE_DIRECTORY ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "dir_path" );
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.loadRep( myrepo, store, JOB_ENTRY_JOB_OBJECT_ID, databases, servers );
jej.getJobMeta( myrepo, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME, jej.getSpecificationMethod() );
verify( myrepo, times( 1 ) ).loadJob( JOB_ENTRY_FILE_NAME, directory, null, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by {@link ObjectId},
* keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_REFERENCE}.
* Load the job from the repository using the specified {@link ObjectId}.
*/
@Test
public void testConnectedLoad_RepByRef() throws Exception {
Repository myrepo = mock( Repository.class );
doReturn( true ).when( myrepo ).isConnected();
doReturn( null ).when( myrepo ).getJobEntryAttributeString( any( ObjectId.class ), anyString() );
doReturn( "rep_ref" ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "specification_method" );
doReturn( JOB_ENTRY_JOB_OBJECT_ID.toString() ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "job_object_id" );
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.loadRep( myrepo, store, JOB_ENTRY_JOB_OBJECT_ID, databases, servers );
jej.getJobMeta( myrepo, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE, jej.getSpecificationMethod() );
verify( myrepo, times( 1 ) ).loadJob( JOB_ENTRY_JOB_OBJECT_ID, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by name using a single parameter,
* keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_NAME}.
* Load the job from the repository using the specified job name and directory.
*/
@Test
public void testConnectedLoad_RepByName_SingleParameter() throws Exception {
Repository myrepo = mock( Repository.class );
doReturn( true ).when( myrepo ).isConnected();
doReturn( rdi ).when( myrepo ).loadRepositoryDirectoryTree();
doReturn( null ).when( myrepo ).getJobEntryAttributeString( any( ObjectId.class ), anyString() );
doReturn( "rep_name" ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "specification_method" );
doReturn( "${repositoryfullfilepath}" ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "name" );
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.loadRep( myrepo, store, JOB_ENTRY_JOB_OBJECT_ID, databases, servers );
jej.getJobMeta( myrepo, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME, jej.getSpecificationMethod() );
verify( myrepo, times( 1 ) ).loadJob( "job.kjb", directory, null, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by {@link ObjectId},
* guess {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_REFERENCE}.
* Load the job from the repository using the specified {@link ObjectId}.
*/
@Test
public void testConnectedLoad_RepByRef_Guess() throws Exception {
Repository myrepo = mock( Repository.class );
doReturn( true ).when( myrepo ).isConnected();
doReturn( null ).when( myrepo ).getJobEntryAttributeString( any( ObjectId.class ), anyString() );
doReturn( JOB_ENTRY_JOB_OBJECT_ID.toString() ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "job_object_id" );
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.loadRep( myrepo, store, JOB_ENTRY_JOB_OBJECT_ID, databases, servers );
jej.getJobMeta( myrepo, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE, jej.getSpecificationMethod() );
verify( myrepo, times( 1 ) ).loadJob( JOB_ENTRY_JOB_OBJECT_ID, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by name,
* keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_NAME}.
* Load the job from the repository using the specified job name and directory.
*/
@Test
public void testConnectedLoad_RepByName() throws Exception {
Repository myrepo = mock( Repository.class );
doReturn( true ).when( myrepo ).isConnected();
doReturn( rdi ).when( myrepo ).loadRepositoryDirectoryTree();
doReturn( null ).when( myrepo ).getJobEntryAttributeString( any( ObjectId.class ), anyString() );
doReturn( "rep_name" ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "specification_method" );
doReturn( JOB_ENTRY_FILE_NAME ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "name" );
doReturn( JOB_ENTRY_FILE_DIRECTORY ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "dir_path" );
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.loadRep( myrepo, store, JOB_ENTRY_JOB_OBJECT_ID, databases, servers );
jej.getJobMeta( myrepo, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME, jej.getSpecificationMethod() );
verify( myrepo, times( 1 ) ).loadJob( JOB_ENTRY_FILE_NAME, directory, null, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by name using multiple parameters,
* keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_NAME}.
* Load the job from the repository using the specified job name and directory.
*/
@Test
public void testConnectedLoad_RepByName_MultipleParameters() throws Exception {
Repository myrepo = mock( Repository.class );
doReturn( true ).when( myrepo ).isConnected();
doReturn( rdi ).when( myrepo ).loadRepositoryDirectoryTree();
doReturn( null ).when( myrepo ).getJobEntryAttributeString( any( ObjectId.class ), anyString() );
doReturn( "rep_name" ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "specification_method" );
doReturn( "${jobname}" ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "name" );
doReturn( "${repositorypath}" ).when( myrepo ).getJobEntryAttributeString( JOB_ENTRY_JOB_OBJECT_ID, "dir_path" );
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.loadRep( myrepo, store, JOB_ENTRY_JOB_OBJECT_ID, databases, servers );
jej.getJobMeta( myrepo, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME, jej.getSpecificationMethod() );
verify( myrepo, times( 1 ) ).loadJob( "job.kjb", directory, null, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by {@link ObjectId},
* guess {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_REFERENCE}.
* Load the job from the repository using the specified {@link ObjectId}.
*/
@Test
public void testConnectedImport_RepByRef_Guess() throws Exception {
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.setJobObjectId( JOB_ENTRY_JOB_OBJECT_ID );
jej.loadXML( getNode( jej ), databases, servers, repository, store );
jej.getJobMeta( repository, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE, jej.getSpecificationMethod() );
verify( repository, times( 1 ) ).loadJob( JOB_ENTRY_JOB_OBJECT_ID, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by name,
* keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_NAME}.
* Load the job from the repository using the specified job name and directory.
*/
@Test
public void testConnectedImport_RepByName_Guess() throws Exception {
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.setJobName( JOB_ENTRY_FILE_NAME );
jej.setDirectory( JOB_ENTRY_FILE_DIRECTORY );
jej.loadXML( getNode( jej ), databases, servers, repository, store );
jej.getJobMeta( repository, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME, jej.getSpecificationMethod() );
verify( repository, times( 1 ) ).loadJob( JOB_ENTRY_FILE_NAME, directory, null, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by {@link ObjectId},
* keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_REFERENCE}.
* Load the job from the repository using the specified {@link ObjectId}.
*/
@Test
public void testConnectedImport_RepByRef() throws Exception {
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE );
jej.setJobObjectId( JOB_ENTRY_JOB_OBJECT_ID );
jej.loadXML( getNode( jej ), databases, servers, repository, store );
jej.getJobMeta( repository, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE, jej.getSpecificationMethod() );
verify( repository, times( 1 ) ).loadJob( JOB_ENTRY_JOB_OBJECT_ID, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* When connected to the repository and {@link JobEntryJob} references a child job by name,
* keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_NAME}.
* Load the job from the repository using the specified job name and directory.
*/
@Test
public void testConnectedImport_RepByName() throws Exception {
JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) );
jej.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME );
jej.setJobName( JOB_ENTRY_FILE_NAME );
jej.setDirectory( JOB_ENTRY_FILE_DIRECTORY );
jej.loadXML( getNode( jej ), databases, servers, repository, store );
jej.getJobMeta( repository, store, space );
assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME, jej.getSpecificationMethod() );
verify( repository, times( 1 ) ).loadJob( JOB_ENTRY_FILE_NAME, directory, null, null );
}
代码示例来源:origin: pentaho/pentaho-kettle
.loadJob( Mockito.eq( "test.kjb" ), Mockito.anyObject(), Mockito.anyObject(), Mockito.anyObject() );
内容来源于网络,如有侵权,请联系作者删除!