/** * Return the subject in the form of a string for the specified ID. * * @param id * the id of the field to look for. * @return the string of the subject (name of step) or null if nothing was found. */ public String getSubjectString( String id ) { LogTableField field = findField( id ); if ( field == null ) { return null; } if ( field.getSubject() == null ) { return null; } return field.getSubject().toString(); }
/** * Get the subject of a field with the specified ID * * @param id * @return the subject or null if no field could be find with the specified id */ public Object getSubject( String id ) { LogTableField field = findField( id ); if ( field == null ) { return null; } return field.getSubject(); }
protected String getFieldsXML() { StringBuilder retval = new StringBuilder(); for ( LogTableField field : fields ) { retval.append( " " ).append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "id", field.getId() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enabled", field.isEnabled() ) ); retval.append( " " ).append( XMLHandler.addTagValue( "name", field.getFieldName() ) ); if ( field.isSubjectAllowed() ) { retval.append( " " ).append( XMLHandler.addTagValue( "subject", field.getSubject() == null ? null : field.getSubject().toString() ) ); } retval.append( " " ).append( XMLHandler.closeTag( XML_TAG ) ).append( Const.CR ); } return retval.toString(); }
/** * Save this core information of the log table to the repository using the specified attribute interface. * * @param attributeInterface * The attribute interface to use to set attributes * @throws KettleException */ public void saveToRepository( RepositoryAttributeInterface attributeInterface ) throws KettleException { attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_CONNECTION_NAME, getConnectionName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_SCHEMA_NAME, getSchemaName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_TABLE_NAME, getTableName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_TIMEOUT_DAYS, getTimeoutInDays() ); // Store the fields too... // for ( int i = 0; i < getFields().size(); i++ ) { LogTableField field = getFields().get( i ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_ID + i, field.getId() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_NAME + i, field.getFieldName() ); attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_ENABLED + i, field.isEnabled() ); if ( field.isSubjectAllowed() ) { attributeInterface.setAttribute( getLogTableCode() + PROP_LOG_TABLE_FIELD_SUBJECT + i, field.getSubject() == null ? null : field .getSubject().toString() ); } } }
public void loadFromRepository( RepositoryAttributeInterface attributeInterface ) throws KettleException { super.loadFromRepository( attributeInterface ); logInterval = attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_INTERVAL ); logSizeLimit = attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_SIZE_LIMIT ); for ( int i = 0; i < getFields().size(); i++ ) { String id = attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_FIELD_ID + i ); // Only read further if the ID is available. // For backward compatibility, this might not be provided yet! // if ( id != null ) { LogTableField field = findField( id ); if ( field.isSubjectAllowed() ) { // BaseLogTable.loadFromRepository sets subject as a String // String stepname = (String) field.getSubject(); if ( !Utils.isEmpty( stepname ) ) { field.setSubject( StepMeta.findStep( steps, stepname ) ); } else { field.setSubject( null ); } } } } }
.setText( new String[] { "", Const.NVL( field.getFieldName(), "" ), field.getSubject() == null ? "" : field.getSubject().toString(), Const.NVL( field.getDescription(), "" ) } );
if ( readField.getSubject() == null && mappingInputs != null && mappingInputs.length >= 1 ) { readField.setSubject( mappingInputs[0].getStepMeta() ); if ( writeField.getSubject() == null && mappingOutputs != null && mappingOutputs.length >= 1 ) { writeField.setSubject( mappingOutputs[0].getStepMeta() );