/** * 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 { String connectionNameFromRepository = attributeInterface.getAttributeString(getLogTableCode() + PROP_LOG_TABLE_CONNECTION_NAME); if (connectionNameFromRepository != null) { connectionName = connectionNameFromRepository; } String schemaNameFromRepository = attributeInterface.getAttributeString(getLogTableCode() + PROP_LOG_TABLE_SCHEMA_NAME); if (schemaNameFromRepository != null) { schemaName = schemaNameFromRepository; } String tableNameFromRepository = attributeInterface.getAttributeString(getLogTableCode() + PROP_LOG_TABLE_TABLE_NAME); if (tableNameFromRepository != null) { tableName = tableNameFromRepository; } timeoutInDays = attributeInterface.getAttributeString(getLogTableCode() + PROP_LOG_TABLE_TIMEOUT_DAYS); 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 != null) { field.setFieldName( attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_FIELD_NAME + i)); field.setEnabled( attributeInterface.getAttributeBoolean( getLogTableCode() + PROP_LOG_TABLE_FIELD_ENABLED + i)); if (field.isSubjectAllowed()) { field.setSubject( attributeInterface.getAttributeString( getLogTableCode() + PROP_LOG_TABLE_FIELD_SUBJECT + i)); } } } } }