本文整理匯總了Java中org.pentaho.di.core.Const類的典型用法代碼示例。如果您正苦於以下問題:Java Const類的具體用法?Java Const怎麽用?Java Const使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Const類屬於org.pentaho.di.core包,在下文中一共展示了Const類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.pentaho.di.core.Const; //導入依賴的package包/類
@Override
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
if ( !super.init( smi, sdi ) ) {
return false;
}
meta = (ZendeskInputMeta) smi;
data = (ZendeskInputData) sdi;
String subDomain = environmentSubstitute( meta.getSubDomain() );
String username = environmentSubstitute( meta.getUsername() );
String password = Encr.decryptPasswordOptionallyEncrypted( environmentSubstitute( meta.getPassword() ) );
if ( Const.isEmpty( subDomain ) || Const.isEmpty( username ) || Const.isEmpty( password ) ) {
logError( BaseMessages.getString( PKG, "ZendeskInput.Error.MissingCredentials" ) );
return false;
}
data.conn = createConnection( subDomain, username, password, meta.isToken() );
if ( data.conn == null || data.conn.isClosed() ) {
return false;
}
return true;
}
示例2: getXML
import org.pentaho.di.core.Const; //導入依賴的package包/類
@Override public String getXML() throws KettleException {
StringBuilder retVal = new StringBuilder();
retVal.append(super.getXML());
retVal.append(" ")
.append(XMLHandler.addTagValue("truncate", isTruncate() ? "true" : "false"));
for (int i = 0; i < streamFields.size(); i++) {
String streamField = streamFields.get(i);
retVal.append(" <stream_fields>").append(Const.CR);
retVal.append(" ").append(XMLHandler.addTagValue("name", streamField.toLowerCase()));
retVal.append(" </stream_fields>").append(Const.CR);
}
return retVal.toString();
}
示例3: getXML
import org.pentaho.di.core.Const; //導入依賴的package包/類
@Override public String getXML() throws KettleException {
StringBuilder retVal = new StringBuilder();
retVal.append(" ").append(XMLHandler.addTagValue("endpoint", getEndpoint())).append(" ")
.append(" ").append(XMLHandler.addTagValue("tunnelEndpoint", getTunnelEndpoint()))
.append(XMLHandler.addTagValue("accessId", getAccessId())).append(" ")
.append(XMLHandler.addTagValue("accessKey", getAccessKey())).append(" ")
.append(XMLHandler.addTagValue("projectName", getProjectName())).append(" ")
.append(XMLHandler.addTagValue("tableName", getTableName())).append(" ")
.append(XMLHandler.addTagValue("partition", getPartition()));
for (int i = 0; i < odpsFields.size(); i++) {
OdpsField field = odpsFields.get(i);
retVal.append(" <fields>").append(Const.CR);
retVal.append(" ")
.append(XMLHandler.addTagValue("name", field.getName().toLowerCase()));
retVal.append(" ").append(XMLHandler.addTagValue("type", field.getType()));
retVal.append(" ").append(XMLHandler.addTagValue("comment", field.getComment()));
retVal.append(" </fields>").append(Const.CR);
}
return retVal.toString();
}
示例4: getData
import org.pentaho.di.core.Const; //導入依賴的package包/類
private void getData() {
this.wCompression.setText(this.meta.getCompression().toString());
if (!Const.isEmpty(this.meta.getCqlStatement())) {
this.wtCql.setText(this.meta.getCqlStatement());
}
this.wLimit.setText(String.valueOf(this.meta.getRowLimit()));
boolean hasInfo = (this.meta.getStepIOMeta().getInfoStreams() != null) && (!this.meta.getStepIOMeta().getInfoStreams().isEmpty());
this.wEachRow.setEnabled(hasInfo);
this.wlEachRow.setEnabled(hasInfo);
setCQLToolTip();
setFlags();
this.wStepname.selectAll();
this.wStepname.setFocus();
}
示例5: getData
import org.pentaho.di.core.Const; //導入依賴的package包/類
private void getData() {
try {
MetaStoreFactory<StreamingService> factory = new MetaStoreFactory<StreamingService>(StreamingService.class, metaStore, PentahoDefaults.NAMESPACE);
List<String> names = factory.getElementNames();
Collections.sort(names);
wServiceName.setItems(names.toArray(new String[names.size()]));
} catch(MetaStoreException e) {
LogChannel.GENERAL.logError("Error reading streaming service names from the metastore", e);
}
wServiceName.setText( Const.NVL(input.getServiceName(), ""));
wIdField.setText(Const.NVL(input.getIdField(), ""));
wTimeStampField.setText(Const.NVL(input.getTimestampField(), ""));
String[] slaves = transMeta.getSlaveServerNames();
Arrays.sort(slaves);
wSlaveServer.setItems(slaves);
wSlaveServer.setText(Const.NVL(input.getSlaveServer(), ""));
wStepname.selectAll();
wStepname.setFocus();
}
示例6: ok
import org.pentaho.di.core.Const; //導入依賴的package包/類
private void ok() {
if ( Const.isEmpty( wStepname.getText() ) ) {
return;
}
stepname = wStepname.getText(); // return value
input.setChanged();
input.setServiceName( wServiceName.getText() );
input.setIdField( wIdField.getText() );
input.setTimestampField( wTimeStampField.getText() );
input.setSlaveServer( wSlaveServer.getText() );
dispose();
}
示例7: lookupTransObjectId
import org.pentaho.di.core.Const; //導入依賴的package包/類
/**
* Try to look up the transObjectId for transformation which are referenced by path
* @param repository The repository to use.
* @throws KettleException
*/
public void lookupTransObjectId( Repository repository ) throws KettleException {
if ( repository == null )
return;
if ( Const.isEmpty( transFilename ) && transObjectId == null && !Const.isEmpty( transRepositoryPath ) ) {
// see if there is a path specified to a repository name
//
String path = "/";
String name = transRepositoryPath;
int lastSlashIndex = name.lastIndexOf( '/' );
if ( lastSlashIndex >= 0 ) {
path = transRepositoryPath.substring( 0, lastSlashIndex + 1 );
name = transRepositoryPath.substring( lastSlashIndex + 1 );
}
RepositoryDirectoryInterface tree = repository.loadRepositoryDirectoryTree();
RepositoryDirectoryInterface rd = tree.findDirectory( path );
if ( rd == null )
rd = tree; // root
ObjectId transformationID = repository.getTransformationID( name, rd );
transObjectId = transformationID == null ? null : transformationID.getId();
}
}
示例8: ok
import org.pentaho.di.core.Const; //導入依賴的package包/類
/**
* Called when the user confirms the dialog
*/
private void ok() {
if ( Const.isEmpty( wStepname.getText() ) ) {
return;
}
// The "stepname" variable will be the return value for the open() method.
// Setting to step name from the dialog control
stepname = wStepname.getText();
// Setting the settings to the meta object
// close the SWT dialog window
saveMeta( meta );
dispose();
}
示例9: addTableView
import org.pentaho.di.core.Const; //導入依賴的package包/類
private void addTableView() {
int margin = Const.MARGIN;
ColumnInfo[] colinf = new ColumnInfo[rowMeta.size()];
for ( int i = 0; i < rowMeta.size(); i++ ) {
ValueMetaInterface v = rowMeta.getValueMeta( i );
colinf[i] = new ColumnInfo( v.getName(), ColumnInfo.COLUMN_TYPE_TEXT, v.isNumeric() );
colinf[i].setToolTip( v.toStringMeta() );
colinf[i].setValueMeta( v );
}
wSeriesTable =
new TableView( variables, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 0, null, props );
wSeriesTable.setShowingBlueNullValues( true ); //// TODO: 25/05/16 wat?
fdSeriesTable = new FormData();
fdSeriesTable.left = new FormAttachment( 0, 0 );
fdSeriesTable.top = new FormAttachment( 0, margin );
fdSeriesTable.right = new FormAttachment( 100, 0 );
fdSeriesTable.bottom = new FormAttachment( 100, -50 );
wSeriesTable.setLayoutData( fdSeriesTable );
fillTableView();
}
示例10: appendFields
import org.pentaho.di.core.Const; //導入依賴的package包/類
private void appendFields( StringBuilder sb ) {
sb.append( " <fields>" ).append( Const.CR );
for ( int i = 0; i < fields.length; i++ ) {
sb.append( " <field>" ).append( Const.CR );
sb.append( " " ).append( XMLHandler.addTagValue( "name", fields[i].getName() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "type", fields[i].getTypeDesc() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "length", fields[i].getLength() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "precision", fields[i].getPrecision() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "trim_type", fields[i].getTrimTypeCode() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "repeat", fields[i].isRepeated() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "format", fields[i].getFormat() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "currency", fields[i].getCurrencySymbol() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "decimal", fields[i].getDecimalSymbol() ) );
sb.append( " " ).append( XMLHandler.addTagValue( "group", fields[i].getGroupSymbol() ) );
sb.append( " </field>" ).append( Const.CR );
}
sb.append( " </fields>" ).append( Const.CR );
}
示例11: ok
import org.pentaho.di.core.Const; //導入依賴的package包/類
private void ok() {
if ( Const.isEmpty( wStepname.getText() ) ) {
return;
}
stepname = wStepname.getText(); // return value
input.setConnection(null);
String connectionName = wConnection.getText();
if (StringUtils.isNotEmpty(connectionName)) {
try{
HCPConnection connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
input.setConnection(connection);
} catch(Exception exception) {
new ErrorDialog(shell,
BaseMessages.getString(PKG, "HCPDeleteDialog.Error.ErrorLoadingConnectionWithName.Title"),
BaseMessages.getString(PKG, "HCPDeleteDialog.Error.ErrorLoadingConnectionWithName.Message", connectionName), exception);
}
}
input.setTargetFileField(wTargetFileField.getText() );
input.setResponseCodeField(wResponseCodeField.getText());
input.setResponseTimeField(wResponseTimeField.getText());
dispose();
}
示例12: updateTopicCombo
import org.pentaho.di.core.Const; //導入依賴的package包/類
private void updateTopicCombo( RowMetaInterface previousFields ) {
if ( m_wTopicFromIncomingField.getSelection() ) {
m_wlTopicName.setText( BaseMessages.getString( MQTTPublisherMeta.PKG, "MQTTClientDialog.TopicNameFromField" ) );
} else {
m_wlTopicName.setText( BaseMessages
.getString( org.pentaho.di.trans.steps.pentahomqttpublisher.MQTTPublisherMeta.PKG,
"MQTTClientDialog.TopicName.Label" ) );
}
String current = m_wTopicName.getText();
m_wTopicName.removeAll();
if ( m_wTopicFromIncomingField.getSelection() ) {
m_wTopicName.setItems( previousFields.getFieldNames() );
}
if ( !Const.isEmpty( current ) ) {
m_wTopicName.setText( current );
}
}
示例13: setComboBoxes
import org.pentaho.di.core.Const; //導入依賴的package包/類
/**
* Sets the input stream field names in the JSON field drop down, and the Stream field drop down in the field
* mapping table.
*/
private void setComboBoxes() {
// Something was changed in the row.
//
final Map<String, Integer> fields = new HashMap<>();
// Add the currentMeta fields...
fields.putAll( inputFields );
Set<String> keySet = fields.keySet();
List<String> entries = new ArrayList<>( keySet );
String[] fieldNames = entries.toArray( new String[entries.size()] );
Const.sortStrings( fieldNames );
colinf[0].setComboValues( fieldNames );
}
示例14: getTableName
import org.pentaho.di.core.Const; //導入依賴的package包/類
/**
* Opens a dialog to select a table name
*/
private void getTableName() {
// New class: SelectTableDialog
int connr = wConnection.getSelectionIndex();
if ( connr >= 0 ) {
DatabaseMeta inf = transMeta.getDatabase( connr );
if ( log.isDebug() ) {
logDebug( BaseMessages.getString( PKG, "SnowflakeBulkLoader.Dialog..Log.LookingAtConnection", inf.toString() ) );
}
DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() );
std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() );
if ( std.open() ) {
wSchema.setText( Const.NVL( std.getSchemaName(), "" ) );
wTable.setText( Const.NVL( std.getTableName(), "" ) );
setTableFieldCombo();
}
} else {
MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
mb.setMessage( BaseMessages.getString( PKG, "SnowflakeBulkLoader.Dialog.ConnectionError2.DialogMessage" ) );
mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
mb.open();
}
}
示例15: formatField
import org.pentaho.di.core.Const; //導入依賴的package包/類
/**
* Takes an input field and converts it to bytes to be stored in the temp file.
* @param v The metadata about the column
* @param valueData The column data
* @return The bytes for the value
* @throws KettleValueException
*/
private byte[] formatField( ValueMetaInterface v, Object valueData ) throws KettleValueException {
if ( v.isString() ) {
if ( v.isStorageBinaryString() && v.getTrimType() == ValueMetaInterface.TRIM_TYPE_NONE && v.getLength() < 0
&& Const.isEmpty( v.getStringEncoding() ) ) {
return (byte[]) valueData;
} else {
String svalue = ( valueData instanceof String ) ? (String) valueData : v.getString( valueData );
// trim or cut to size if needed.
//
return convertStringToBinaryString( v, Const.trimToType( svalue, v.getTrimType() ) );
}
} else {
return v.getBinaryString( valueData );
}
}