本文整理汇总了Java中org.pentaho.di.core.variables.Variables.getADefaultVariableSpace方法的典型用法代码示例。如果您正苦于以下问题:Java Variables.getADefaultVariableSpace方法的具体用法?Java Variables.getADefaultVariableSpace怎么用?Java Variables.getADefaultVariableSpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.variables.Variables
的用法示例。
在下文中一共展示了Variables.getADefaultVariableSpace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
private void show()
{
if (rowDatas.size()==0) return;
int nr = wStepList.getSelectionIndex();
java.util.List<Object[]> buffer = (java.util.List<Object[]>)rowDatas.get(nr);
RowMetaInterface rowMeta = (RowMetaInterface)rowMetas.get(nr);
String name = (String)stepNames.get(nr);
if (rowMeta!=null && buffer!=null && buffer.size()>0)
{
PreviewRowsDialog prd = new PreviewRowsDialog(shell,
Variables.getADefaultVariableSpace(),
SWT.NONE, name, rowMeta, buffer);
prd.open();
}
else
{
MessageBox mb = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);
mb.setText(Messages.getString("EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Title"));
mb.setMessage(Messages.getString("EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Message"));
mb.open();
}
}
示例2: show
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
private void show()
{
if (rowDatas.size()==0) return;
int nr = wStepList.getSelectionIndex();
java.util.List<Object[]> buffer = (java.util.List<Object[]>)rowDatas.get(nr);
RowMetaInterface rowMeta = (RowMetaInterface)rowMetas.get(nr);
String name = (String)stepNames.get(nr);
if (rowMeta!=null && buffer!=null && buffer.size()>0)
{
PreviewRowsDialog prd = new PreviewRowsDialog(shell,
Variables.getADefaultVariableSpace(),
SWT.NONE, name, rowMeta, buffer);
prd.open();
}
else
{
MessageBox mb = new MessageBox(shell, SWT.ICON_INFORMATION | SWT.OK);
mb.setText(BaseMessages.getString(PKG, "EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Title"));
mb.setMessage(BaseMessages.getString(PKG, "EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Message"));
mb.open();
}
}
示例3: getUsedVariables
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void getUsedVariables( JobMeta jobMeta ) {
Properties sp = new Properties();
VariableSpace space = Variables.getADefaultVariableSpace();
String[] keys = space.listVariables();
for ( int i = 0; i < keys.length; i++ ) {
sp.put( keys[i], space.getVariable( keys[i] ) );
}
List<String> vars = jobMeta.getUsedVariables();
if ( vars != null && vars.size() > 0 ) {
HashMap<String, String> newVariables = new HashMap<String, String>();
for ( int i = 0; i < vars.size(); i++ ) {
String varname = vars.get( i );
if ( !varname.startsWith( Const.INTERNAL_VARIABLE_PREFIX ) ) {
newVariables.put( varname, Const.NVL( variables.get( varname ), sp.getProperty( varname, "" ) ) );
}
}
// variables.clear();
variables.putAll( newVariables );
}
}
示例4: show
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
private void show() {
if ( rowDatas.size() == 0 ) {
return;
}
int nr = wStepList.getSelectionIndex();
java.util.List<Object[]> buffer = rowDatas.get( nr );
RowMetaInterface rowMeta = rowMetas.get( nr );
String name = stepNames.get( nr );
if ( rowMeta != null && buffer != null && buffer.size() > 0 ) {
PreviewRowsDialog prd =
new PreviewRowsDialog( shell, Variables.getADefaultVariableSpace(), SWT.NONE, name, rowMeta, buffer );
prd.open();
} else {
MessageBox mb = new MessageBox( shell, SWT.ICON_INFORMATION | SWT.OK );
mb.setText( BaseMessages.getString( PKG, "EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Title" ) );
mb.setMessage( BaseMessages.getString( PKG, "EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Message" ) );
mb.open();
}
}
示例5: getTransSQL
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
/**
* Get & show the SQL required to run the loaded transformation...
*
*/
public void getTransSQL( TransMeta transMeta ) {
GetSQLProgressDialog pspd = new GetSQLProgressDialog( spoon.getShell(), transMeta );
List<SQLStatement> stats = pspd.open();
if ( stats != null ) {
// null means error, but we already displayed the error
if ( stats.size() > 0 ) {
SQLStatementsDialog ssd =
new SQLStatementsDialog( spoon.getShell(), Variables.getADefaultVariableSpace(), SWT.NONE, stats );
String sn = ssd.open();
if ( sn != null ) {
StepMeta esi = transMeta.findStep( sn );
if ( esi != null ) {
spoon.delegates.steps.editStep( transMeta, esi );
}
}
} else {
MessageBox mb = new MessageBox( spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION );
mb.setMessage( BaseMessages.getString( PKG, "Spoon.Dialog.NoSQLNeedEexecuted.Message" ) );
mb.setText( BaseMessages.getString( PKG, "Spoon.Dialog.NoSQLNeedEexecuted.Title" ) ); // "SQL"
mb.open();
}
}
}
示例6: getUsedVariables
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void getUsedVariables(JobMeta jobMeta)
{
Properties sp = new Properties();
VariableSpace space = Variables.getADefaultVariableSpace();
String keys[] = space.listVariables();
for ( int i=0; i<keys.length; i++ )
{
sp.put(keys[i], space.getVariable(keys[i]));
}
List<String> vars = jobMeta.getUsedVariables();
if (vars!=null && vars.size()>0)
{
HashMap<String, String> newVariables = new HashMap<String, String>();
for (int i=0;i<vars.size();i++)
{
String varname = (String)vars.get(i);
if (!varname.startsWith(Const.INTERNAL_VARIABLE_PREFIX))
{
newVariables.put(varname, Const.NVL(variables.get(varname), sp.getProperty(varname, "")));
}
}
// variables.clear();
variables.putAll(newVariables);
}
}
示例7: getAllVariables
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void getAllVariables(TransMeta transMeta)
{
Properties sp = new Properties();
VariableSpace space = Variables.getADefaultVariableSpace();
String keys[] = space.listVariables();
for ( int i=0; i<keys.length; i++ )
{
sp.put(keys[i], space.getVariable(keys[i]));
}
String[] vars = transMeta.listVariables();
if (vars!=null && vars.length>0)
{
HashMap<String, String> newVariables = new HashMap<String, String>();
for (int i=0;i<vars.length;i++)
{
String varname = vars[i];
newVariables.put(varname, Const.NVL(variables.get(varname), sp.getProperty(varname, "")));
}
// variables.clear();
variables.putAll(newVariables);
}
// Also add the internal job variables if these are set...
//
for (String variableName : Const.INTERNAL_JOB_VARIABLES)
{
String value = transMeta.getVariable(variableName);
if (!Const.isEmpty(value)) variables.put(variableName, value);
}
}
示例8: getUsedVariables
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void getUsedVariables(TransMeta transMeta)
{
Properties sp = new Properties();
VariableSpace space = Variables.getADefaultVariableSpace();
String keys[] = space.listVariables();
for ( int i=0; i<keys.length; i++ )
{
sp.put(keys[i], space.getVariable(keys[i]));
}
List<String> vars = transMeta.getUsedVariables();
if (vars!=null && vars.size()>0)
{
HashMap<String, String> newVariables = new HashMap<String, String>();
for (int i=0;i<vars.size();i++)
{
String varname = (String)vars.get(i);
if (!varname.startsWith(Const.INTERNAL_VARIABLE_PREFIX))
{
newVariables.put(varname, Const.NVL(variables.get(varname), sp.getProperty(varname, "")));
}
}
// variables.clear();
variables.putAll(newVariables);
}
// Also add the internal job variables if these are set...
//
for (String variableName : Const.INTERNAL_JOB_VARIABLES)
{
String value = transMeta.getVariable(variableName);
if (!Const.isEmpty(value)) variables.put(variableName, value);
}
}
示例9: getTransSQL
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
/**
* Get & show the SQL required to run the loaded transformation...
*
*/
public void getTransSQL(TransMeta transMeta)
{
GetSQLProgressDialog pspd = new GetSQLProgressDialog(spoon.getShell(), transMeta);
List<SQLStatement> stats = pspd.open();
if (stats != null) // null means error, but we already displayed the
// error
{
if (stats.size() > 0)
{
SQLStatementsDialog ssd = new SQLStatementsDialog(spoon.getShell(), Variables
.getADefaultVariableSpace(), SWT.NONE, stats);
String sn = ssd.open();
if (sn != null)
{
StepMeta esi = transMeta.findStep(sn);
if (esi != null)
{
spoon.delegates.steps.editStep(transMeta,esi);
}
}
} else
{
MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION);
mb.setMessage(Messages.getString("Spoon.Dialog.NoSQLNeedEexecuted.Message"));
mb.setText(Messages.getString("Spoon.Dialog.NoSQLNeedEexecuted.Title"));// "SQL"
mb.open();
}
}
}
示例10: showLastImpactAnalyses
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void showLastImpactAnalyses(TransMeta transMeta) {
if (transMeta == null)
return;
TransGraph transGraph = delegates.trans.findTransGraphOfTransformation(transMeta);
if (transGraph == null)
return;
List<Object[]> rows = new ArrayList<Object[]>();
RowMetaInterface rowMeta = null;
for (int i = 0; i < transGraph.getImpact().size(); i++) {
DatabaseImpact ii = (DatabaseImpact) transGraph.getImpact().get(i);
RowMetaAndData row = ii.getRow();
rowMeta = row.getRowMeta();
rows.add(row.getData());
}
if (rows.size() > 0) {
// Display all the rows...
PreviewRowsDialog prd = new PreviewRowsDialog(shell, Variables.getADefaultVariableSpace(), SWT.NONE, "-", rowMeta, rows);
prd.setTitleMessage(Messages.getString("Spoon.Dialog.ImpactAnalyses.Title"), Messages.getString("Spoon.Dialog.ImpactAnalyses.Message"));// "Impact analyses"
// "Result of analyses:"
prd.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
if (transGraph.isImpactFinished()) {
mb.setMessage(Messages.getString("Spoon.Dialog.TransformationNoImpactOnDatabase.Message"));// "As far as I can tell, this transformation has no impact on any database."
} else {
mb.setMessage(Messages.getString("Spoon.Dialog.RunImpactAnalysesFirst.Message"));// "Please run the impact analyses first on this transformation."
}
mb.setText(Messages.getString("Spoon.Dialog.ImpactAnalyses.Title"));// Impact
mb.open();
}
}
示例11: getTransSQL
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
/**
* Get & show the SQL required to run the loaded transformation...
*
*/
public void getTransSQL(TransMeta transMeta)
{
GetSQLProgressDialog pspd = new GetSQLProgressDialog(spoon.getShell(), transMeta);
List<SQLStatement> stats = pspd.open();
if (stats != null) // null means error, but we already displayed the
// error
{
if (stats.size() > 0)
{
SQLStatementsDialog ssd = new SQLStatementsDialog(spoon.getShell(), Variables
.getADefaultVariableSpace(), SWT.NONE, stats);
String sn = ssd.open();
if (sn != null)
{
StepMeta esi = transMeta.findStep(sn);
if (esi != null)
{
spoon.delegates.steps.editStep(transMeta,esi);
}
}
} else
{
MessageBox mb = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION);
mb.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.NoSQLNeedEexecuted.Message"));
mb.setText(BaseMessages.getString(PKG, "Spoon.Dialog.NoSQLNeedEexecuted.Title"));// "SQL"
mb.open();
}
}
}
示例12: showLastImpactAnalyses
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void showLastImpactAnalyses(TransMeta transMeta) {
if (transMeta == null)
return;
TransGraph transGraph = delegates.trans.findTransGraphOfTransformation(transMeta);
if (transGraph == null)
return;
List<Object[]> rows = new ArrayList<Object[]>();
RowMetaInterface rowMeta = null;
for (int i = 0; i < transGraph.getImpact().size(); i++) {
DatabaseImpact ii = (DatabaseImpact) transGraph.getImpact().get(i);
RowMetaAndData row = ii.getRow();
rowMeta = row.getRowMeta();
rows.add(row.getData());
}
if (rows.size() > 0) {
// Display all the rows...
PreviewRowsDialog prd = new PreviewRowsDialog(shell, Variables.getADefaultVariableSpace(), SWT.NONE, "-",
rowMeta, rows);
prd.setTitleMessage(
// "Impact analyses"
// "Result of analyses:"
BaseMessages.getString(PKG, "Spoon.Dialog.ImpactAnalyses.Title"), BaseMessages.getString(PKG,
"Spoon.Dialog.ImpactAnalyses.Message"));
prd.open();
} else {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
if (transGraph.isImpactFinished()) {
// "As far as I can tell, this transformation has no impact on any database."
mb.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.TransformationNoImpactOnDatabase.Message"));
} else {
// "Please run the impact analyses first on this transformation."
mb.setMessage(BaseMessages.getString(PKG, "Spoon.Dialog.RunImpactAnalysesFirst.Message"));
}
mb.setText(BaseMessages.getString(PKG, "Spoon.Dialog.ImpactAnalyses.Title"));// Impact
mb.open();
}
}
示例13: getAllVariables
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void getAllVariables( TransMeta transMeta ) {
Properties sp = new Properties();
VariableSpace space = Variables.getADefaultVariableSpace();
String[] keys = space.listVariables();
for ( int i = 0; i < keys.length; i++ ) {
sp.put( keys[i], space.getVariable( keys[i] ) );
}
String[] vars = transMeta.listVariables();
if ( vars != null && vars.length > 0 ) {
HashMap<String, String> newVariables = new HashMap<String, String>();
for ( int i = 0; i < vars.length; i++ ) {
String varname = vars[i];
newVariables.put( varname, Const.NVL( variables.get( varname ), sp.getProperty( varname, "" ) ) );
}
// variables.clear();
variables.putAll( newVariables );
}
// Also add the internal job variables if these are set...
//
for ( String variableName : Const.INTERNAL_JOB_VARIABLES ) {
String value = transMeta.getVariable( variableName );
if ( !Utils.isEmpty( value ) ) {
variables.put( variableName, value );
}
}
}
示例14: getUsedVariables
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
public void getUsedVariables( TransMeta transMeta ) {
Properties sp = new Properties();
VariableSpace space = Variables.getADefaultVariableSpace();
String[] keys = space.listVariables();
for ( int i = 0; i < keys.length; i++ ) {
sp.put( keys[i], space.getVariable( keys[i] ) );
}
List<String> vars = transMeta.getUsedVariables();
if ( vars != null && vars.size() > 0 ) {
HashMap<String, String> newVariables = new HashMap<String, String>();
for ( int i = 0; i < vars.size(); i++ ) {
String varname = vars.get( i );
if ( !varname.startsWith( Const.INTERNAL_VARIABLE_PREFIX ) ) {
newVariables.put( varname, Const.NVL( variables.get( varname ), sp.getProperty( varname, "" ) ) );
}
}
// variables.clear();
variables.putAll( newVariables );
}
// Also add the internal job variables if these are set...
//
for ( String variableName : Const.INTERNAL_JOB_VARIABLES ) {
String value = transMeta.getVariable( variableName );
if ( !Utils.isEmpty( value ) ) {
variables.put( variableName, value );
}
}
}
示例15: addGrid
import org.pentaho.di.core.variables.Variables; //导入方法依赖的package包/类
private void addGrid()
{
Composite composite = new Composite(sashform, SWT.NONE);
props.setLook(composite);
FormLayout formLayout = new FormLayout ();
formLayout.marginWidth = Const.FORM_MARGIN;
formLayout.marginHeight = Const.FORM_MARGIN;
composite.setLayout(formLayout);
wReload = new Button(composite, SWT.NONE);
wReload.setText(" &Reload ");
wLocale= new Button(composite, SWT.NONE);
wLocale.setText(" &Select locale ");
wClose = new Button(composite, SWT.NONE);
wClose.setText(" &Close ");
wVerify = new Button(composite, SWT.CHECK);
wVerify.setText("&Verify usage");
wVerify.setSelection(true); // Check it!
wUsed = new Button(composite, SWT.CHECK);
wUsed.setText("&Remove used keys");
wUsed.setSelection(false); // Check it!
wAvailable= new Button(composite, SWT.CHECK);
wAvailable.setText("&Check key against other locale");
wAvailable.setSelection(true); // Check it!
BaseStepDialog.positionBottomButtons(composite, new Button[] { wReload, wLocale, wClose, wVerify, wUsed, wAvailable } , Const.MARGIN, null);
ColumnInfo[] colinf=new ColumnInfo[]
{
new ColumnInfo("Locale", ColumnInfo.COLUMN_TYPE_TEXT, true),
new ColumnInfo("Package", ColumnInfo.COLUMN_TYPE_TEXT, true),
new ColumnInfo("Class", ColumnInfo.COLUMN_TYPE_TEXT, true),
new ColumnInfo("Key", ColumnInfo.COLUMN_TYPE_TEXT, true),
new ColumnInfo("Value", ColumnInfo.COLUMN_TYPE_TEXT, true),
new ColumnInfo("Used?", ColumnInfo.COLUMN_TYPE_TEXT, true),
new ColumnInfo("Not available in", ColumnInfo.COLUMN_TYPE_TEXT, true),
};
wGrid=new TableView( Variables.getADefaultVariableSpace(),
composite,
SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI,
colinf,
0,
null,
PropsUI.getInstance()
);
FormData fdGrid=new FormData();
fdGrid.left = new FormAttachment(0, 0);
fdGrid.top = new FormAttachment(0, 0);
fdGrid.right = new FormAttachment(100, 0);
fdGrid.bottom = new FormAttachment(wReload, -Const.MARGIN*3);
wGrid.setLayoutData(fdGrid);
}