Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BISERVER-15176] reverting reverted BISERVER-15051 #9763

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/src/main/java/org/pentaho/di/core/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.http.conn.util.InetAddressUtils;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaString;
import org.pentaho.di.core.util.EnvUtil;
import org.pentaho.di.core.util.Utils;
import org.pentaho.di.i18n.BaseMessages;
Expand Down Expand Up @@ -1697,6 +1698,12 @@ public static String getShimDriverDeploymentLocation() {
*/
public static final String STRING_ONLY_USED_DB_TO_XML = "STRING_ONLY_USED_DB_TO_XML";

/**
Value to Configure if we want to disable/grayed out internal variables, and remove from the new/edit schedule.
*/
public static final String HIDE_INTERNAL_VARIABLES = "PENTAHO_SCHEDULER_HIDE_INTERNAL_VARIABLES";
public static final String HIDE_INTERNAL_VARIABLES_DEFAULT = "Y";

/**
* rounds double f to any number of places after decimal point Does arithmetic using BigDecimal class to avoid integer
* overflow while rounding
Expand Down
58 changes: 29 additions & 29 deletions engine/src/main/java/org/pentaho/di/trans/TransMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -5240,37 +5240,37 @@ public List<StringSearchResult> getStringList( boolean searchSteps, boolean sear
if ( searchDatabases ) {
for ( int i = 0; i < nrDatabases(); i++ ) {
DatabaseMeta meta = getDatabase( i );
stringList.add( new StringSearchResult( meta.getName(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseConnectionName" ) ) );
if ( meta.getHostname() != null ) {
stringList.add( new StringSearchResult( meta.getHostname(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseHostName" ) ) );
}
if ( meta.getDatabaseName() != null ) {
stringList.add( new StringSearchResult( meta.getDatabaseName(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseName" ) ) );
}
if ( meta.getUsername() != null ) {
stringList.add( new StringSearchResult( meta.getUsername(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseUsername" ) ) );
}
if ( meta.getPluginId() != null ) {
stringList.add( new StringSearchResult( meta.getPluginId(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseTypeDescription" ) ) );
}
if ( meta.getDatabasePortNumberString() != null ) {
stringList.add( new StringSearchResult( meta.getDatabasePortNumberString(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabasePort" ) ) );
}
if ( meta.getServername() != null ) {
stringList.add( new StringSearchResult( meta.getServername(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseServer" ) ) );
}

if( isDatabaseConnectionUsed( meta ) ){
stringList.add( new StringSearchResult( meta.getName(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseConnectionName" ) ) );
if ( meta.getHostname() != null ) {
stringList.add( new StringSearchResult( meta.getHostname(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseHostName" ) ) );
}
if ( meta.getDatabaseName() != null ) {
stringList.add( new StringSearchResult( meta.getDatabaseName(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseName" ) ) );
}
if ( meta.getUsername() != null ) {
stringList.add( new StringSearchResult( meta.getUsername(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseUsername" ) ) );
}
if ( meta.getPluginId() != null ) {
stringList.add( new StringSearchResult( meta.getPluginId(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseTypeDescription" ) ) );
}
if ( meta.getDatabasePortNumberString() != null ) {
stringList.add( new StringSearchResult( meta.getDatabasePortNumberString(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabasePort" ) ) );
}
if ( meta.getServername() != null ) {
stringList.add( new StringSearchResult( meta.getServername(), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabaseServer" ) ) );
}
if ( meta.getPassword() != null ) {
stringList.add( new StringSearchResult( Strings.repeat("*", meta.getPassword().length()), meta, this,
BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabasePassword" ) ) );

BaseMessages.getString( PKG, "TransMeta.SearchMetadata.DatabasePassword" ) ) );
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.pentaho.di.core.parameters.DuplicateParamException;
import org.pentaho.di.core.parameters.NamedParams;
import org.pentaho.di.core.parameters.NamedParamsDefault;
import org.pentaho.di.core.row.value.ValueMetaString;
import org.pentaho.di.job.JobExecutionConfiguration;
import org.pentaho.di.job.JobMeta;
import org.pentaho.di.repository.Repository;
Expand Down Expand Up @@ -113,6 +114,12 @@ public Map<String, String> getVariables( String kettleFilePath ) {
log.error( e );
}
}
/*Updating userVariables to remove based on the HideInternalVariable setting. If no other variables other than
Internal variables, then it won't show the Internal variable screen.*/
if ( ValueMetaString.convertStringToBoolean( System.getProperty( Const.HIDE_INTERNAL_VARIABLES,
Const.HIDE_INTERNAL_VARIABLES_DEFAULT ) ) ) {
userVariables.keySet().removeIf(key -> key.contains("Internal."));
}
}
return userVariables;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.pentaho.di.core.extension.ExtensionPointHandler;
import org.pentaho.di.core.extension.KettleExtensionPoint;
import org.pentaho.di.core.logging.LogLevel;
import org.pentaho.di.core.row.value.ValueMetaString;
import org.pentaho.di.core.util.Utils;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.trans.TransExecutionConfiguration;
Expand Down Expand Up @@ -135,6 +136,11 @@ private void getVariablesData() {
tableItem.setText( 2, Const.NVL( variableValue, "" ) );
}
}
//Internal Varibles should get disabled based on the kettle varible HIDE_INTERNAL_VARIABLES=Y
if ( ValueMetaString.convertStringToBoolean( System.getProperty( Const.HIDE_INTERNAL_VARIABLES,
Const.HIDE_INTERNAL_VARIABLES_DEFAULT ) ) ) {
wVariables.table.setEnabled(false);
}
wVariables.removeEmptyRows();
wVariables.setRowNums();
wVariables.optWidth( true );
Expand Down