本文整理匯總了Java中org.pentaho.di.trans.TransMeta.getObjectId方法的典型用法代碼示例。如果您正苦於以下問題:Java TransMeta.getObjectId方法的具體用法?Java TransMeta.getObjectId怎麽用?Java TransMeta.getObjectId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.trans.TransMeta
的用法示例。
在下文中一共展示了TransMeta.getObjectId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ok
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
@Override
public void ok( TransMeta transMeta ) throws KettleException {
try {
// Get streaming service details...
//
StreamingService streamingService = new StreamingService();
streamingService.setName( wServiceName.getText() );
streamingService.setStepname( wServiceStep.getText() );
streamingService.setCacheDuration( wServiceCacheDuration.getText() );
streamingService.setCacheSize( wServiceCacheSize.getText() );
streamingService.setPreloaded( wPreloadService.getSelection() );
streamingService.setClearingOnStart( wClearOnStart.getSelection() );
streamingService.setCacheFlipping(wReplaceAtTransEnd.getSelection());
streamingService.setLogLevel( LogLevel.values()[wLogLevel.getSelectionIndex()] );
streamingService.setTransFilename( transMeta.getFilename() );
Repository repository = transMeta.getRepository();
if ( repository != null ) {
if ( repository.getRepositoryMeta().getRepositoryCapabilities().supportsReferences() ) {
ObjectId objectId = transMeta.getObjectId();
streamingService.setTransObjectId( objectId == null ? null : objectId.getId() );
}
streamingService.setTransRepositoryPath( transMeta.getRepositoryDirectory().getPath() + "/" + transMeta.getName() );
}
MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, transMeta.getMetaStore(), PentahoDefaults.NAMESPACE );
rtFactory.saveElement( streamingService );
transMeta.setAttribute( StreamingConst.STREAMING_GROUP, StreamingConst.STREAMING_SERVICE_NAME, streamingService.getName() );
transMeta.setChanged();
} catch ( Exception e ) {
throw new KettleException( "Error saveing streaming service metadata", e );
}
}
示例2: findUnitTests
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
private List<TransUnitTest> findUnitTests(TransMeta transMeta, DelegatingMetaStore metaStore) {
MetaStoreFactory<TransUnitTest> factory = new MetaStoreFactory<TransUnitTest>(TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE);
List<TransUnitTest> tests = new ArrayList<TransUnitTest>();
try {
List<TransUnitTest> allTests = factory.getElements();
for (TransUnitTest test : allTests) {
// Match the filename
//
if (StringUtils.isNotEmpty(transMeta.getFilename())) {
if (transMeta.getFilename().equals(test.getTransFilename())) {
tests.add(test);
}
} else {
if (transMeta.getRepository()!=null) {
// No filename, check the object_id ...
//
if (transMeta.getObjectId()!=null && transMeta.getObjectId().getId().equals(test.getTransObjectId())) {
tests.add(test);
} else {
// Try the repository path..
//
// What is the repsository path?
String repositoryPath = transMeta.getRepositoryDirectory().getPath() + "/" + transMeta.getName();
if (repositoryPath.equals(test.getTransRepositoryPath())) {
tests.add(test);
}
}
}
}
}
} catch(Exception exception) {
new ErrorDialog(Spoon.getInstance().getShell(),
BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorFindingUnitTestsForTransformation.Title"),
BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorFindingUnitTestsForTransformation.Message"),
exception);
}
return tests;
}