本文整理汇总了Java中org.pentaho.di.trans.steps.mapping.MappingMeta类的典型用法代码示例。如果您正苦于以下问题:Java MappingMeta类的具体用法?Java MappingMeta怎么用?Java MappingMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MappingMeta类属于org.pentaho.di.trans.steps.mapping包,在下文中一共展示了MappingMeta类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MappingDialog
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
public MappingDialog(Shell parent, Object in, TransMeta tr, String sname)
{
super(parent, (BaseStepMeta) in, tr, sname);
mappingMeta = (MappingMeta) in;
transModified = false;
// Make a copy for our own purposes...
// This allows us to change everything directly in the classes with
// listeners.
// Later we need to copy it to the input class on ok()
//
mappingParameters = (MappingParameters) mappingMeta.getMappingParameters().clone();
inputMappings = new ArrayList<MappingIODefinition>();
outputMappings = new ArrayList<MappingIODefinition>();
for (int i = 0; i < mappingMeta.getInputMappings().size(); i++)
inputMappings.add((MappingIODefinition) mappingMeta.getInputMappings().get(i).clone());
for (int i = 0; i < mappingMeta.getOutputMappings().size(); i++)
outputMappings.add((MappingIODefinition) mappingMeta.getOutputMappings().get(i).clone());
changeList = new ArrayList<ApplyChanges>();
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:MappingDialog.java
示例2: patchMappingSteps
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
private void patchMappingSteps(TransMeta transMeta) {
for (StepMeta stepMeta : transMeta.getSteps()) {
if (stepMeta.isMapping()) {
MappingMeta mappingMeta = (MappingMeta) stepMeta.getStepMetaInterface();
if (mappingMeta.getSpecificationMethod() == ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME) {
if (transDirOverride != null) {
mappingMeta.setDirectoryPath(transDirOverride);
continue;
}
String newPath = baseDirectory.getPath();
String extraPath = mappingMeta.getDirectoryPath();
if (newPath.endsWith("/") && extraPath.startsWith("/")) {
newPath=newPath.substring(0,newPath.length()-1);
} else if (!newPath.endsWith("/") && !extraPath.startsWith("/")) {
newPath+="/";
} else if (extraPath.equals("/")) {
extraPath="";
}
mappingMeta.setDirectoryPath(newPath+extraPath);
}
}
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:RepositoryImporter.java
示例3: setRepositoryOnMappingSteps
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
/**
* Set the Repository object on the Mapping step That way the mapping step can determine the output fields for
* repository hosted mappings... This is the exception to the rule so we don't pass this through the getFields()
* method. TODO: figure out a way to make this more generic.
*/
private void setRepositoryOnMappingSteps() {
for ( StepMeta step : steps ) {
if ( step.getStepMetaInterface() instanceof MappingMeta ) {
( (MappingMeta) step.getStepMetaInterface() ).setRepository( repository );
( (MappingMeta) step.getStepMetaInterface() ).setMetaStore( metaStore );
}
if ( step.getStepMetaInterface() instanceof SingleThreaderMeta ) {
( (SingleThreaderMeta) step.getStepMetaInterface() ).setRepository( repository );
( (SingleThreaderMeta) step.getStepMetaInterface() ).setMetaStore( metaStore );
}
if ( step.getStepMetaInterface() instanceof JobExecutorMeta ) {
( (JobExecutorMeta) step.getStepMetaInterface() ).setRepository( repository );
( (JobExecutorMeta) step.getStepMetaInterface() ).setMetaStore( metaStore );
}
if ( step.getStepMetaInterface() instanceof TransExecutorMeta ) {
( (TransExecutorMeta) step.getStepMetaInterface() ).setRepository( repository );
( (TransExecutorMeta) step.getStepMetaInterface() ).setMetaStore( metaStore );
}
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:TransMeta.java
示例4: MappingDialog
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
public MappingDialog( Shell parent, Object in, TransMeta tr, String sname ) {
super( parent, (BaseStepMeta) in, tr, sname );
mappingMeta = (MappingMeta) in;
transModified = false;
// Make a copy for our own purposes...
// This allows us to change everything directly in the classes with
// listeners.
// Later we need to copy it to the input class on ok()
//
mappingParameters = (MappingParameters) mappingMeta.getMappingParameters().clone();
inputMappings = new ArrayList<MappingIODefinition>();
outputMappings = new ArrayList<MappingIODefinition>();
for ( int i = 0; i < mappingMeta.getInputMappings().size(); i++ ) {
inputMappings.add( (MappingIODefinition) mappingMeta.getInputMappings().get( i ).clone() );
}
for ( int i = 0; i < mappingMeta.getOutputMappings().size(); i++ ) {
outputMappings.add( (MappingIODefinition) mappingMeta.getOutputMappings().get( i ).clone() );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:21,代码来源:MappingDialog.java
示例5: openMapping
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
/**
* Open the transformation mentioned in the mapping...
*/
public void openMapping() {
try {
MappingMeta meta = (MappingMeta) this.currentStep.getStepMetaInterface();
TransMeta mappingMeta = MappingMeta.loadMappingMeta(meta.getFileName(), meta.getTransName(), meta.getDirectoryPath(), spoon.rep, transMeta);
mappingMeta.clearChanged();
spoon.addTransGraph(mappingMeta);
} catch(Exception e) {
new ErrorDialog(shell, Messages.getString("TransGraph.Exception.UnableToLoadMapping.Title"), Messages.getString("TransGraph.Exception.UnableToLoadMapping.Message"), e);
}
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:14,代码来源:TransGraph.java
示例6: convertFromFileRepository
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
private void convertFromFileRepository(TransMeta transMeta) {
if (repository instanceof KettleFileRepository) {
KettleFileRepository fileRep = (KettleFileRepository)repository;
// The id of the transformation is the relative filename.
// Setting the filename also sets internal variables needed to load the trans/job referenced.
//
String transMetaFilename = fileRep.calcFilename(transMeta.getObjectId());
transMeta.setFilename(transMetaFilename);
for (StepMeta stepMeta : transMeta.getSteps()) {
if (stepMeta.isMapping()) {
MappingMeta mappingMeta = (MappingMeta) stepMeta.getStepMetaInterface();
// convert to a named based reference.
//
if (mappingMeta.getSpecificationMethod()==ObjectLocationSpecificationMethod.FILENAME) {
try {
TransMeta meta = MappingMeta.loadMappingMeta(mappingMeta, repository, transMeta);
FileObject fileObject = KettleVFS.getFileObject(meta.getFilename());
mappingMeta.setSpecificationMethod(ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME);
mappingMeta.setFileName(null);
mappingMeta.setTransName(meta.getName());
mappingMeta.setDirectoryPath(Const.NVL(calcRepositoryDirectory(fileRep, fileObject), "/"));
} catch(Exception e) {
log.logError("Unable to load transformation specified in map '"+mappingMeta.getName()+"'", e);
// Ignore this error, just leave everything the way it is.
}
}
}
}
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:36,代码来源:RepositoryExporter.java
示例7: setRepositoryOnMappingSteps
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
/**
* Set the Repository object on the Mapping step
* That way the mapping step can determine the output fields for repository hosted mappings...
* This is the exception to the rule so we don't pass this through the getFields() method.
*/
private void setRepositoryOnMappingSteps() {
for (StepMeta step : steps)
{
if (step.getStepMetaInterface() instanceof MappingMeta)
{
((MappingMeta)step.getStepMetaInterface()).setRepository(repository);
}
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:16,代码来源:TransMeta.java
示例8: getThisStepFields
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
/**
* Returns the fields that are emitted by a step
*
* @param stepMeta : The StepMeta object that's being queried
* @param nextStep : if non-null this is the next step that's call back to ask what's being sent
* @param row : A row containing the input fields or an empty row if no input is required.
*
* @return A Row containing the output fields.
*/
public RowMetaInterface getThisStepFields(StepMeta stepMeta, StepMeta nextStep, RowMetaInterface row, ProgressMonitorListener monitor) throws KettleStepException
{
// Then this one.
if(log.isDebug()) log.logDebug(toString(), Messages.getString("TransMeta.Log.GettingFieldsFromStep",stepMeta.getName(), stepMeta.getStepID())); //$NON-NLS-1$ //$NON-NLS-2$
String name = stepMeta.getName();
if (monitor != null)
{
monitor.subTask(Messages.getString("TransMeta.Monitor.GettingFieldsFromStepTask.Title", name )); //$NON-NLS-1$ //$NON-NLS-2$
}
StepMetaInterface stepint = stepMeta.getStepMetaInterface();
RowMetaInterface inform[] = null;
StepMeta[] lu = getInfoStep(stepMeta);
if (Const.isEmpty(lu))
{
inform = new RowMetaInterface[] { stepint.getTableFields(), };
}
else
{
inform = new RowMetaInterface[lu.length];
for (int i=0;i<lu.length;i++) inform[i] = getStepFields(lu[i]);
}
// Set the Repository object on the Mapping step
// That way the mapping step can determine the output fields for repository hosted mappings...
// This is the exception to the rule so we don't pass this through the getFields() method.
//
for (StepMeta step : steps)
{
if (step.getStepMetaInterface() instanceof MappingMeta)
{
((MappingMeta)step.getStepMetaInterface()).setRepository(repository);
}
}
// Go get the fields...
//
stepint.getFields(row, name, inform, nextStep, this);
return row;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:52,代码来源:TransMeta.java
示例9: convertFromFileRepository
import org.pentaho.di.trans.steps.mapping.MappingMeta; //导入依赖的package包/类
private void convertFromFileRepository( TransMeta transMeta ) {
Object[] metaInjectObjectArray = new Object[4];
metaInjectObjectArray[0] = transMeta;
metaInjectObjectArray[1] = PKG;
if ( repository instanceof KettleFileRepository ) {
KettleFileRepository fileRep = (KettleFileRepository) repository;
metaInjectObjectArray[2] = fileRep;
// The id of the transformation is the relative filename.
// Setting the filename also sets internal variables needed to load the trans/job referenced.
//
String transMetaFilename = fileRep.calcFilename( transMeta.getObjectId() );
transMeta.setFilename( transMetaFilename );
for ( StepMeta stepMeta : transMeta.getSteps() ) {
if ( stepMeta.isMapping() ) {
MappingMeta mappingMeta = (MappingMeta) stepMeta.getStepMetaInterface();
// convert to a named based reference.
//
if ( mappingMeta.getSpecificationMethod() == ObjectLocationSpecificationMethod.FILENAME ) {
try {
TransMeta meta = MappingMeta.loadMappingMeta( mappingMeta, fileRep, fileRep.metaStore, transMeta );
FileObject fileObject = KettleVFS.getFileObject( meta.getFilename() );
mappingMeta.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME );
mappingMeta.setFileName( null );
mappingMeta.setTransName( meta.getName() );
mappingMeta.setDirectoryPath( Const.NVL( calcRepositoryDirectory( fileRep, fileObject ), "/" ) );
} catch ( Exception e ) {
log.logError( BaseMessages.getString( PKG, "Repository.Exporter.Log.UnableToLoadTransInMap", mappingMeta
.getName() ), e );
}
}
}
metaInjectObjectArray[3] = stepMeta;
try {
ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.RepositoryExporterPatchTransStep.id, metaInjectObjectArray );
} catch ( KettleException ke ) {
log.logError( ke.getMessage(), ke );
}
}
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:50,代码来源:RepositoryExporter.java
注:本文中的org.pentaho.di.trans.steps.mapping.MappingMeta类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论