本文整理汇总了Java中org.pentaho.di.resource.ResourceEntry.ResourceType类的典型用法代码示例。如果您正苦于以下问题:Java ResourceType类的具体用法?Java ResourceType怎么用?Java ResourceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceType类属于org.pentaho.di.resource.ResourceEntry包,在下文中一共展示了ResourceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
String realFilename = transMeta.environmentSubstitute(fileName);
String realTransname = transMeta.environmentSubstitute(transName);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Const.isEmpty(realFilename)) {
// Add the filename to the references, including a reference to this step meta data.
//
reference.getEntries().add( new ResourceEntry(realFilename, ResourceType.ACTIONFILE));
} else if (!Const.isEmpty(realTransname)) {
// Add the filename to the references, including a reference to this step meta data.
//
reference.getEntries().add( new ResourceEntry(realTransname, ResourceType.ACTIONFILE));
references.add(reference);
}
return references;
}
示例2: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
//
// Get the file path list from the FileInputList
//
String required[] = new String[fileName.length];
boolean subdirs[] = new boolean[fileName.length]; // boolean arrays are defaulted to false.
for (int i=0;i<required.length; required[i]="N", i++); //$NON-NLS-1$
String[] textFiles = FileInputList.createFilePathList(transMeta, fileName, fileMask, required, subdirs);
if ( textFiles!=null ) {
for (int i=0; i<textFiles.length; i++) {
reference.getEntries().add( new ResourceEntry(textFiles[i], ResourceType.FILE));
}
}
return references;
}
示例3: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
String realFilename = transMeta.environmentSubstitute(fileName);
String realTransname = transMeta.environmentSubstitute(transName);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Const.isEmpty(realFilename)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realFilename, ResourceType.ACTIONFILE));
} else if (!Const.isEmpty(realTransname)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realTransname, ResourceType.ACTIONFILE));
references.add(reference);
}
return references;
}
示例4: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
//
// Get the file path list from the FileInputList
//
String required[] = new String[fileName.length];
boolean subdirs[] = new boolean[fileName.length]; // boolean arrays are defaulted to false.
for (int i=0;i<required.length; required[i]="N", i++); //$NON-NLS-1$
String[] textFiles = FileInputList.createFilePathList(transMeta, fileName, fileMask, new String[] { null }, required, subdirs);
if ( textFiles!=null ) {
for (int i=0; i<textFiles.length; i++) {
reference.getEntries().add( new ResourceEntry(textFiles[i], ResourceType.FILE));
}
}
return references;
}
示例5: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) {
List<ResourceReference> references = new ArrayList<ResourceReference>( 5 );
ResourceReference reference = new ResourceReference( stepInfo );
references.add( reference );
//
// Get the file path list from the FileInputList
//
String[] required = new String[fileName.length];
boolean[] subdirs = new boolean[fileName.length]; // boolean arrays are defaulted to false.
for ( int i = 0; i < required.length; i++ ) {
required[i] = "N";
}
String[] textFiles =
FileInputList.createFilePathList( transMeta, fileName, fileMask, new String[] { null }, required, subdirs );
if ( textFiles != null ) {
for ( int i = 0; i < textFiles.length; i++ ) {
reference.getEntries().add( new ResourceEntry( textFiles[i], ResourceType.FILE ) );
}
}
return references;
}
示例6: testTransformationDependencyList
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
public void testTransformationDependencyList() throws Exception {
KettleEnvironment.init();
TransMeta transMeta = new TransMeta("test/org/pentaho/di/resource/trans/General - Change log processing.ktr"); //$NON-NLS-1$
List<ResourceReference> resourceReferences = transMeta.getResourceDependencies();
// printResourceReferences(resourceReferences);
assertEquals(2, resourceReferences.size());
ResourceReference genRef = null;
for (ResourceReference look : resourceReferences) {
if (look.getReferenceHolder().getTypeId().equals("TextFileInput")) {
genRef = look;
}
}
assertNotNull(genRef);
// System.out.println(genRef.toXml());
ResourceHolderInterface refHolder = genRef.getReferenceHolder();
assertEquals("TextFileInput", refHolder.getTypeId()); //$NON-NLS-1$
List<ResourceEntry> entries = genRef.getEntries();
assertEquals(1, entries.size());
ResourceEntry theEntry = entries.get(0);
assertEquals(ResourceType.FILE, theEntry.getResourcetype());
assertTrue(theEntry.getResource().endsWith("changelog.txt")); //$NON-NLS-1$
}
示例7: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) {
List<ResourceReference> references = new ArrayList<ResourceReference>( 5 );
String realFilename = transMeta.environmentSubstitute( fileName );
String realTransname = transMeta.environmentSubstitute( transName );
ResourceReference reference = new ResourceReference( stepInfo );
references.add( reference );
if ( !Utils.isEmpty( realFilename ) ) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add( new ResourceEntry( realFilename, ResourceType.ACTIONFILE ) );
} else if ( !Utils.isEmpty( realTransname ) ) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add( new ResourceEntry( realTransname, ResourceType.ACTIONFILE ) );
references.add( reference );
}
return references;
}
示例8: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
String realFilename = transMeta.environmentSubstitute(fileName);
String realTransname = transMeta.environmentSubstitute(jobName);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Const.isEmpty(realFilename)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realFilename, ResourceType.ACTIONFILE));
} else if (!Const.isEmpty(realTransname)) {
// Add the filename to the references, including a reference to this step
// meta data.
//
reference.getEntries().add(new ResourceEntry(realTransname, ResourceType.ACTIONFILE));
references.add(reference);
}
return references;
}
示例9: testTransformationDependencyList
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Test
public void testTransformationDependencyList() throws Exception {
TransMeta transMeta = new TransMeta( "test/org/pentaho/di/resource/trans/General - Change log processing.ktr" );
List<ResourceReference> resourceReferences = transMeta.getResourceDependencies();
assertEquals( 2, resourceReferences.size() );
ResourceReference genRef = null;
for ( ResourceReference look : resourceReferences ) {
if ( look.getReferenceHolder().getTypeId().equals( "TextFileInput" ) ) {
genRef = look;
}
}
assertNotNull( genRef );
ResourceHolderInterface refHolder = genRef.getReferenceHolder();
assertEquals( "TextFileInput", refHolder.getTypeId() );
List<ResourceEntry> entries = genRef.getEntries();
assertEquals( 1, entries.size() );
ResourceEntry theEntry = entries.get( 0 );
assertEquals( ResourceType.FILE, theEntry.getResourcetype() );
assertTrue( theEntry.getResource().endsWith( "changelog.txt" ) );
}
示例10: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Const.isEmpty(filename)) {
// Add the filename to the references, including a reference to this
// step meta data.
//
reference.getEntries()
.add(new ResourceEntry(transMeta.environmentSubstitute(filename), ResourceType.FILE));
}
return references;
}
示例11: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
List<ResourceReference> references = super.getResourceDependencies(jobMeta);
if (!Const.isEmpty(serverName)) {
String realServerName = jobMeta.environmentSubstitute(serverName);
ResourceReference reference = new ResourceReference(this);
reference.getEntries().add( new ResourceEntry(realServerName, ResourceType.SERVER));
references.add(reference);
}
return references;
}
示例12: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
List<ResourceReference> references = super.getResourceDependencies(jobMeta);
if (connection != null) {
ResourceReference reference = new ResourceReference(this);
reference.getEntries().add( new ResourceEntry(connection.getHostname(), ResourceType.SERVER));
reference.getEntries().add( new ResourceEntry(connection.getDatabaseName(), ResourceType.DATABASENAME));
references.add(reference);
}
return references;
}
示例13: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
List<ResourceReference> references = super.getResourceDependencies(jobMeta);
if ( (!Const.isEmpty(xslfilename)) && (!Const.isEmpty(xmlfilename)) ) {
String realXmlFileName = jobMeta.environmentSubstitute(xmlfilename);
String realXslFileName = jobMeta.environmentSubstitute(xslfilename);
ResourceReference reference = new ResourceReference(this);
reference.getEntries().add( new ResourceEntry(realXmlFileName, ResourceType.FILE));
reference.getEntries().add( new ResourceEntry(realXslFileName, ResourceType.FILE));
references.add(reference);
}
return references;
}
示例14: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta)
{
List<ResourceReference> references = super.getResourceDependencies(jobMeta);
if (!Const.isEmpty(servername))
{
String realServername = jobMeta.environmentSubstitute(servername);
ResourceReference reference = new ResourceReference(this);
reference.getEntries().add(new ResourceEntry(realServername, ResourceType.SERVER));
references.add(reference);
}
return references;
}
示例15: getResourceDependencies
import org.pentaho.di.resource.ResourceEntry.ResourceType; //导入依赖的package包/类
public List<ResourceReference> getResourceDependencies(JobMeta jobMeta) {
List<ResourceReference> references = super.getResourceDependencies(jobMeta);
if ((!Const.isEmpty(filename1)) && (!Const.isEmpty(filename2)) ) {
String realFilename1 = jobMeta.environmentSubstitute(filename1);
String realFilename2 = jobMeta.environmentSubstitute(filename2);
ResourceReference reference = new ResourceReference(this);
reference.getEntries().add( new ResourceEntry(realFilename1, ResourceType.FILE));
reference.getEntries().add( new ResourceEntry(realFilename2, ResourceType.FILE));
references.add(reference);
}
return references;
}