當前位置: 首頁>>代碼示例>>Java>>正文


Java VariableSpace.setVariable方法代碼示例

本文整理匯總了Java中org.pentaho.di.core.variables.VariableSpace.setVariable方法的典型用法代碼示例。如果您正苦於以下問題:Java VariableSpace.setVariable方法的具體用法?Java VariableSpace.setVariable怎麽用?Java VariableSpace.setVariable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pentaho.di.core.variables.VariableSpace的用法示例。


在下文中一共展示了VariableSpace.setVariable方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testGetUrl

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
@Test
public void testGetUrl() {
  VariableSpace space = new Variables();
  space.setVariable("SERVER", "hcpdemo.com");
  space.setVariable("PORT", "8000");
  space.setVariable("NAMESPACE", "hcp-demo");
  space.setVariable("TENANT", "pentaho");
  
  HCPConnection connection = new HCPConnection();
  connection.setServer("${SERVER}");
  connection.setPort("${PORT}");
  connection.setNamespace("${NAMESPACE}");
  connection.setTenant("${TENANT}");
  
  String restUrl = connection.getRestUrl(space);
  assertEquals("http://pentaho.hcp-demo.hcpdemo.com:8000/rest", restUrl);    
}
 
開發者ID:mattcasters,項目名稱:pdi-hcp-plugin,代碼行數:18,代碼來源:HCPConnectionTest.java

示例2: setInternalKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
/**
 * This method sets various internal kettle variables that can be used by
 * the transformation.
 */
public void setInternalKettleVariables(VariableSpace var) {
  setInternalFilenameKettleVariables(var);
  setInternalNameKettleVariable(var);
  
	// The name of the directory in the repository
	var.setVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, directory != null ? directory.getPath() : ""); //$NON-NLS-1$

	// Undefine the transformation specific variables:
	// transformations can't run jobs, so if you use these they are 99.99%
	// wrong.
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY, null);
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:22,代碼來源:JobMeta.java

示例3: setInternalFilenameKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
private void setInternalFilenameKettleVariables(VariableSpace var) {
  if (filename != null) // we have a filename that's defined.
  {
    try {
      FileObject fileObject = KettleVFS.getFileObject(filename, var);
      FileName fileName = fileObject.getName();

      // The filename of the job
      var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, fileName.getBaseName());

      // The directory of the job
      FileName fileDir = fileName.getParent();
      var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, fileDir.getURI());
    } catch (Exception e) {
      var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "");
      var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, "");
    }
  } else {
    var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, ""); //$NON-NLS-1$
    var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, ""); //$NON-NLS-1$
  }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:23,代碼來源:JobMeta.java

示例4: setInternalKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
/**
 * This method sets various internal kettle variables that can be used by
 * the transformation.
 */
public void setInternalKettleVariables(VariableSpace var) {
	if (filename != null) // we have a filename that's defined.
	{
		try {
			FileObject fileObject = KettleVFS.getFileObject(filename);
			FileName fileName = fileObject.getName();

			// The filename of the transformation
			var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, fileName.getBaseName());

			// The directory of the transformation
			FileName fileDir = fileName.getParent();
			var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, fileDir.getURI());
		} catch (IOException e) {
			var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "");
			var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, "");
		}
	} else {
		var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, ""); //$NON-NLS-1$
		var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, ""); //$NON-NLS-1$
	}

	// The name of the job
	var.setVariable(Const.INTERNAL_VARIABLE_JOB_NAME, Const.NVL(name, "")); //$NON-NLS-1$

	// The name of the directory in the repository
	var.setVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, directory != null ? directory.getPath() : ""); //$NON-NLS-1$

	// Undefine the transformation specific variables:
	// transformations can't run jobs, so if you use these they are 99.99%
	// wrong.
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, null);
	var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY, null);
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:43,代碼來源:JobMeta.java

示例5: setParametersAsVariablesInUI

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
public void setParametersAsVariablesInUI(NamedParams namedParameters, VariableSpace space) {
      for (String param : namedParameters.listParameters()) {
    	  try {
    		  space.setVariable(param, Const.NVL(namedParameters.getParameterValue(param), Const.NVL(namedParameters.getParameterDefault(param), Const.NVL(space.getVariable(param), ""))));
    	  }
    	  catch(Exception e) {
    		  // ignore this
    	  }
      }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:11,代碼來源:Spoon.java

示例6: setInternalKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
public void setInternalKettleVariables(VariableSpace var)
{        
  setInternalFilenameKettleVariables(var);
  setInternalNameKettleVariable(var);

    // The name of the directory in the repository
    //
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY, directory!=null?directory.getPath():"");
    
    // Here we don't remove the job specific parameters, as they may come in handy.
    //
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "Parent Job File Directory"); //$NON-NLS-1$
    }
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, "Parent Job Filename"); //$NON-NLS-1$
    }
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_NAME)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_NAME, "Parent Job Name"); //$NON-NLS-1$
    }
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, "Parent Job Repository Directory"); //$NON-NLS-1$        
    }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:29,代碼來源:TransMeta.java

示例7: setInternalFilenameKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
private void setInternalFilenameKettleVariables(VariableSpace var) {
  // If we have a filename that's defined, set variables.  If not, clear them.
  //
  if (!Const.isEmpty(filename)) 
  {
    try {
      FileObject fileObject = KettleVFS.getFileObject(filename, var);
      FileName fileName = fileObject.getName();

      // The filename of the transformation
      var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, fileName.getBaseName());

      // The directory of the transformation
      FileName fileDir = fileName.getParent();
      var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, fileDir.getURI());
    } catch (KettleFileException e) {
      log.logError("Unexpected error setting internal filename variables!", e);
      
      var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, "");
      var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, "");
    }
  } else {
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, "");
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, "");
  }

}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:28,代碼來源:TransMeta.java

示例8: setParametersAsVariablesInUI

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
public void setParametersAsVariablesInUI(NamedParams namedParameters, VariableSpace space) {
  for (String param : namedParameters.listParameters()) {
    try {
      space.setVariable(param, Const.NVL(namedParameters.getParameterValue(param), Const.NVL(namedParameters
          .getParameterDefault(param), Const.NVL(space.getVariable(param), ""))));
    } catch (Exception e) {
      // ignore this
    }
  }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:11,代碼來源:Spoon.java

示例9: setInternalKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
public void setInternalKettleVariables(VariableSpace var)
{
    if (jobMeta != null && jobMeta.getFilename() !=null) // we have a finename that's defined.
    {
        try
        {
            FileObject fileObject = KettleVFS.getFileObject(jobMeta.getFilename());
            FileName fileName = fileObject.getName();
            
            // The filename of the transformation
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, fileName.getBaseName());

            // The directory of the transformation
            FileName fileDir = fileName.getParent();
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, fileDir.getURI());
        }
        catch(IOException e)
        {
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "");
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, "");
        }
    }
    else
    {
        var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, ""); //$NON-NLS-1$
        var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, ""); //$NON-NLS-1$
    }

    // The name of the job
    var.setVariable(Const.INTERNAL_VARIABLE_JOB_NAME, Const.NVL(jobMeta.getName(), "")); //$NON-NLS-1$

    // The name of the directory in the repository
    var.setVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, jobMeta.getDirectory() != null ? jobMeta.getDirectory().getPath() : ""); //$NON-NLS-1$
    
    // Undefine the transformation specific variables
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY, null);
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:43,代碼來源:Job.java

示例10: setInternalKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
public void setInternalKettleVariables(VariableSpace var)
{        
    if (!Const.isEmpty(filename)) // we have a finename that's defined.
    {
        try
        {
            FileObject fileObject = KettleVFS.getFileObject(filename);
            FileName fileName = fileObject.getName();
            
            // The filename of the transformation
            var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, fileName.getBaseName());

            // The directory of the transformation
            FileName fileDir = fileName.getParent();
            var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, fileDir.getURI());
        }
        catch(IOException e)
        {
            var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, "");
            var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, "");
        }
    }
    else
    {
        var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, "");
        var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, "");
    }
    
    // The name of the transformation
    //
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, Const.NVL(name, ""));

    // The name of the directory in the repository
    //
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY, directory!=null?directory.getPath():"");
    
    // Here we don't remove the job specific parameters, as they may come in handy.
    //
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "Parent Job File Directory"); //$NON-NLS-1$
    }
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, "Parent Job Filename"); //$NON-NLS-1$
    }
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_NAME)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_NAME, "Parent Job Name"); //$NON-NLS-1$
    }
    if (var.getVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY)==null)
    {
    	var.setVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, "Parent Job Repository Directory"); //$NON-NLS-1$        
    }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:56,代碼來源:TransMeta.java

示例11: setInternalKettleVariables

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
public void setInternalKettleVariables(VariableSpace var)
{
    if (jobMeta != null && jobMeta.getFilename() !=null) // we have a finename that's defined.
    {
        try
        {
            FileObject fileObject = KettleVFS.getFileObject(jobMeta.getFilename(), this);
            FileName fileName = fileObject.getName();
            
            // The filename of the transformation
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, fileName.getBaseName());

            // The directory of the transformation
            FileName fileDir = fileName.getParent();
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, fileDir.getURI());
        }
        catch(Exception e)
        {
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, "");
            var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, "");
        }
    }
    else
    {
        var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY, ""); //$NON-NLS-1$
        var.setVariable(Const.INTERNAL_VARIABLE_JOB_FILENAME_NAME, ""); //$NON-NLS-1$
    }

    // The name of the job
    var.setVariable(Const.INTERNAL_VARIABLE_JOB_NAME, Const.NVL(jobMeta.getName(), "")); //$NON-NLS-1$

    // The name of the directory in the repository
    var.setVariable(Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY, jobMeta.getRepositoryDirectory() != null ? jobMeta.getRepositoryDirectory().getPath() : ""); //$NON-NLS-1$
    
    // Undefine the transformation specific variables
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_DIRECTORY, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_FILENAME_NAME, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, null);
    var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_REPOSITORY_DIRECTORY, null);
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:43,代碼來源:Job.java

示例12: setInternalNameKettleVariable

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
private void setInternalNameKettleVariable(VariableSpace var) {
  // The name of the job
  var.setVariable(Const.INTERNAL_VARIABLE_JOB_NAME, Const.NVL(name, "")); //$NON-NLS-1$
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:5,代碼來源:JobMeta.java

示例13: setInternalNameKettleVariable

import org.pentaho.di.core.variables.VariableSpace; //導入方法依賴的package包/類
private void setInternalNameKettleVariable(VariableSpace var) {
  // The name of the transformation
  //
  var.setVariable(Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, Const.NVL(name, ""));
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:6,代碼來源:TransMeta.java


注:本文中的org.pentaho.di.core.variables.VariableSpace.setVariable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。