当前位置: 首页>>代码示例>>Java>>正文


Java MappingMeta.setDirectoryPath方法代码示例

本文整理汇总了Java中org.pentaho.di.trans.steps.mapping.MappingMeta.setDirectoryPath方法的典型用法代码示例。如果您正苦于以下问题:Java MappingMeta.setDirectoryPath方法的具体用法?Java MappingMeta.setDirectoryPath怎么用?Java MappingMeta.setDirectoryPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.trans.steps.mapping.MappingMeta的用法示例。


在下文中一共展示了MappingMeta.setDirectoryPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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.setDirectoryPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。