本文整理匯總了Java中org.pentaho.di.trans.step.StepMeta類的典型用法代碼示例。如果您正苦於以下問題:Java StepMeta類的具體用法?Java StepMeta怎麽用?Java StepMeta使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StepMeta類屬於org.pentaho.di.trans.step包,在下文中一共展示了StepMeta類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateTransformationImage
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
/**
* 生成轉換圖 <br/>
* @author jingma
* @param transMeta
* @return
* @throws Exception
*/
public static BufferedImage generateTransformationImage( TransMeta transMeta ) throws Exception {
float magnification = 1.0f;
Point maximum = transMeta.getMaximum();
maximum.multiply( magnification );
SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 );
TransPainter transPainter =
new TransPainter(
gc, transMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(),
new ArrayList<StepMeta>(), 32, 1, 0, 0, true, "Arial", 10 );
transPainter.setMagnification( magnification );
transPainter.buildTransformationImage();
BufferedImage image = (BufferedImage) gc.getImage();
return image;
}
示例2: transCopy
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
/**
* 將指定轉換複製到KettleUtils中的資源庫 <br/>
* @author jingma
* @param jobName 轉換名稱
* @param jobPath 轉換路徑
* @param fromRepository 來源資源庫
* @param toRepository 目標資源庫
* @throws KettleException
*/
public static void transCopy(String transName,String transPath,Repository fromRepository,
Repository toRepository) throws KettleException {
TransMeta tm = KettleUtils.loadTrans(transName, transPath, fromRepository);
for(StepMeta sm:tm.getSteps()){
if(sm.isJobExecutor()){
JobExecutorMeta jem = (JobExecutorMeta)sm.getStepMetaInterface();
jobCopy(jem.getJobName(),jem.getDirectoryPath(),fromRepository,toRepository);
}
else if(sm.getStepMetaInterface() instanceof TransExecutorMeta){
TransExecutorMeta te = (TransExecutorMeta)sm.getStepMetaInterface();
transCopy(te.getTransName(), te.getDirectoryPath(),fromRepository,toRepository);
}
}
if(!isDirectoryExist(toRepository,transPath)){
//所在目錄不存在則創建
toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), transPath);
}
tm.setRepository(toRepository);
tm.setMetaStore(toRepository.getMetaStore());
KettleUtils.saveTrans(toRepository,tm);
}
示例3: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
public void getFields(RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) {
JSONArray transInfo = configInfo.getJSONArray(TRANS_INFO);
for(JSONObject ti:transInfo.toArray(new JSONObject[]{})){
//將轉換結果賦予新字段的,添加新字段
if(ti.containsKey(RESULT_LATER)&&StringUtils.isNotBlank(ti.getString(RESULT_LATER))){
addField(r,ti.getString(TRANS_FIELD)+ti.getString(RESULT_LATER),
ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,ti.getString(TRANS_FIELD)+"名稱");
}
if(RULE_TOJSON.equals(ti.getString(TRANS_RULE))){
//轉換為JSON串
addField(r,ti.getString(TRANS_FIELD),
ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,ti.getString(TRANS_FIELD));
}
if(RULE_TOTXT.equals(ti.getString(TRANS_RULE))){
//轉換為JSON串
addField(r,ti.getString(TRANS_FIELD),
ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,ti.getString(TRANS_FIELD));
}
}
if(isHbjl()){
addField(r,"GROUP_KEY",ValueMeta.TYPE_STRING,ValueMeta.TRIM_TYPE_BOTH,origin,"分組字段拚接出的key");
}
}
示例4: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
/**
* This method is called to determine the changes the step is making to the row-stream.
* To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
* the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
* row-stream.
*
* @param inputRowMeta the row structure coming in to the step
* @param name the name of the step making the changes
* @param info row structures of any info steps coming in
* @param nextStep the description of a step this step is passing rows to
* @param space the variable space for resolving variables
* @param repository the repository instance optionally read from
* @param metaStore the metaStore to optionally read from
*/
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{
for ( int i = 0; i < fields.length; i++ ) {
int type = fields[i].getType();
if ( type == ValueMetaInterface.TYPE_NONE) type = ValueMetaInterface.TYPE_STRING;
try {
ValueMetaInterface v = ValueMetaFactory.createValueMeta( fields[i].getName(), type );
v.setConversionMask( fields[i].getFormat() );
v.setLength( fields[i].getLength() );
v.setPrecision( fields[i].getPrecision() );
v.setCurrencySymbol( fields[i].getCurrencySymbol() );
v.setDecimalSymbol( fields[i].getDecimalSymbol() );
v.setGroupingSymbol( fields[i].getGroupSymbol() );
v.setTrimType( fields[i].getTrimType() );
v.setOrigin( name );
inputRowMeta.addValueMeta( v );
} catch (KettlePluginException e) {
throw new KettleStepException( e );
}
}
}
示例5: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
// Optionally add a fields...
//
if (StringUtils.isNotEmpty(responseCodeField)) {
ValueMetaInterface codeValue = new ValueMetaInteger(responseCodeField);
codeValue.setLength(3);
codeValue.setOrigin(name);
inputRowMeta.addValueMeta(codeValue);
}
if (StringUtils.isNotEmpty(responseTimeField)) {
ValueMetaInterface timeValue = new ValueMetaInteger(responseTimeField);
timeValue.setLength(7);
timeValue.setOrigin(name);
inputRowMeta.addValueMeta(timeValue);
}
}
示例6: getHadoopInputStep
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
private StepMeta getHadoopInputStep(GraphConfigurationInfo graphConfiguration)
throws GraphGeneratorException {
HadoopFileInputMeta fileInputMeta = new HadoopFileInputMeta();
fileInputMeta.setFilenameField("filename");
fileInputMeta.setFileName(new String[] { "${csvInputFilePath}" });
fileInputMeta.setDefault();
fileInputMeta.setEncoding("UTF-8");
fileInputMeta.setEnclosure("\"");
fileInputMeta.setHeader(true);
fileInputMeta.setSeparator(",");
fileInputMeta.setAcceptingFilenames(true);
fileInputMeta.setAcceptingStepName("getFileNames");
fileInputMeta.setFileFormat("mixed");
StepMeta csvDataStep = new StepMeta("HadoopFileInputPlugin", (StepMetaInterface) fileInputMeta);
csvDataStep.setLocation(100, 100);
int copies = Integer.parseInt(instance.getProperty(CarbonCommonConstants.NUM_CORES_LOADING,
CarbonCommonConstants.DEFAULT_NUMBER_CORES));
if (copies > 1) {
csvDataStep.setCopies(4);
}
csvDataStep.setDraw(true);
csvDataStep.setDescription("Read raw data from " + GraphGeneratorConstants.CSV_INPUT);
return csvDataStep;
}
示例7: getTableInputStep
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
private StepMeta getTableInputStep(GraphConfigurationInfo configurationInfo)
throws GraphGeneratorException {
TableInputMeta tableInput = new TableInputMeta();
tableInput.setDatabaseMeta(getDatabaseMeta(configurationInfo));
tableInput.setSQL(configurationInfo.getTableInputSqlQuery());
//
StepMeta tableInputStep =
new StepMeta(GraphGeneratorConstants.TABLE_INPUT, (StepMetaInterface) tableInput);
xAxixLocation += 120;
tableInputStep.setLocation(xAxixLocation, yAxixLocation);
//
tableInputStep.setDraw(true);
tableInputStep
.setDescription("Read Data From Fact Table: " + GraphGeneratorConstants.TABLE_INPUT);
return tableInputStep;
}
示例8: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void getFields(RowMetaInterface row, String name,
RowMetaInterface[] info, StepMeta nextStep, VariableSpace space,
Repository repository, IMetaStore metaStore)
throws KettleStepException {
// Check Target Field Name
if (Const.isEmpty(targetFieldName)) {
throw new KettleStepException(BaseMessages.getString(PKG,
"ConcatFieldsMeta.CheckResult.TargetFieldNameMissing"));
}
// add targetFieldName
ValueMetaInterface vValue = new ValueMetaDom(targetFieldName,
ValueMetaDom.TYPE_DOM, targetFieldLength, 0);
vValue.setOrigin(name);
row.addValueMeta(vValue);
}
示例9: handleStreamSelection
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void handleStreamSelection( StreamInterface stream ) {
List<StreamInterface> targets = getStepIOMeta().getTargetStreams();
int index = targets.indexOf( stream );
StepMeta step = targets.get( index ).getStepMeta();
switch ( index ) {
case 0:
setArticleStepMeta( step );
break;
case 1:
setTranslationStepMeta( step );
break;
default:
break;
}
}
示例10: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldIdFieldname() ),
ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldUrlFieldname() ),
ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldTypeFieldname() ),
ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldTitleFieldname() ),
ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldActiveFieldname() ),
ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldRequiredFieldname() ),
ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldVisibleEndUsersFieldname() ),
ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
示例11: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionNameFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSourceLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionHtmlUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getPositionFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
示例12: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@SuppressWarnings( "deprecation" )
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space ) throws KettleStepException {
try {
if ( m_fields == null || m_fields.size() == 0 ){
// TODO: get the name "json" from dialog
ValueMetaInterface jsonValueMeta = ValueMetaFactory.createValueMeta("JSON", ValueMetaInterface.TYPE_STRING);
jsonValueMeta.setOrigin( origin );
rowMeta.addValueMeta( jsonValueMeta );
}else{
// get the selected fields
for ( SequoiaDBInputField f : m_fields ){
ValueMetaInterface vm = ValueMetaFactory.createValueMeta(f.m_fieldName, ValueMetaFactory.getIdForValueMeta( f.m_kettleType ));
vm.setOrigin( origin );
rowMeta.addValueMeta( vm );
}
}
} catch (KettlePluginException e) {
throw new KettleStepException(e);
}
}
示例13: handleStreamSelection
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void handleStreamSelection( StreamInterface stream ) {
List<StreamInterface> targets = getStepIOMeta().getTargetStreams();
int index = targets.indexOf( stream );
StepMeta step = targets.get( index ).getStepMeta();
switch ( index ) {
case 0:
setTicketOverviewStepMeta( step );
break;
case 1:
setTicketCommentsStepMeta( step );
break;
case 2:
setTicketCustomFieldsStepMeta( step );
break;
case 3:
setTicketTagsStepMeta( step );
case 4:
setTicketCollaboratorsStepMeta( step );
default:
break;
}
}
示例14: getFields
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryNameFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getDescriptionFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getSourceLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryHtmlUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getPositionFieldname() ), ValueMetaInterface.TYPE_INTEGER );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
示例15: handleStreamSelection
import org.pentaho.di.trans.step.StepMeta; //導入依賴的package包/類
@Override
public void handleStreamSelection( StreamInterface stream ) {
List<StreamInterface> targets = getStepIOMeta().getTargetStreams();
int index = targets.indexOf( stream );
StepMeta step = targets.get( index ).getStepMeta();
switch ( index ) {
case 0:
setUserStepMeta( step );
break;
case 1:
setUserIdentityStepMeta( step );
break;
default:
break;
}
}