本文整理汇总了Java中org.pentaho.di.core.xml.XMLHandler.countNodes方法的典型用法代码示例。如果您正苦于以下问题:Java XMLHandler.countNodes方法的具体用法?Java XMLHandler.countNodes怎么用?Java XMLHandler.countNodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.xml.XMLHandler
的用法示例。
在下文中一共展示了XMLHandler.countNodes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore)
throws KettleXMLException {
super.loadXML(stepnode, databases, metaStore);
String truncateStr = XMLHandler.getTagValue(stepnode, "truncate");
if (truncateStr.equals("true")) {
setTruncate(true);
} else {
setTruncate(false);
}
int nrStreamFields = XMLHandler.countNodes(stepnode, "stream_fields");
streamFields = new ArrayList<String>(nrStreamFields);
for (int i = 0; i < nrStreamFields; i++) {
Node fieldNode = XMLHandler.getSubNodeByNr(stepnode, "stream_fields", i);
streamFields.add(XMLHandler.getTagValue(fieldNode, "name"));
}
}
示例2: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore)
throws KettleXMLException {
setEndpoint(XMLHandler.getTagValue(stepnode, "endpoint"));
setTunnelEndpoint(XMLHandler.getTagValue(stepnode, "tunnelEndpoint"));
setAccessId(XMLHandler.getTagValue(stepnode, "accessId"));
setAccessKey(XMLHandler.getTagValue(stepnode, "accessKey"));
setProjectName(XMLHandler.getTagValue(stepnode, "projectName"));
setTableName(XMLHandler.getTagValue(stepnode, "tableName"));
setPartition(XMLHandler.getTagValue(stepnode, "partition"));
int nrFields = XMLHandler.countNodes(stepnode, "fields");
odpsFields = new ArrayList<OdpsField>(nrFields);
for (int i = 0; i < nrFields; i++) {
Node fieldNode = XMLHandler.getSubNodeByNr(stepnode, "fields", i);
OdpsField field = new OdpsField();
field.setName(XMLHandler.getTagValue(fieldNode, "name"));
field.setType(XMLHandler.getTagValue(fieldNode, "type"));
field.setComment(XMLHandler.getTagValue(fieldNode, "comment"));
odpsFields.add(field);
}
}
示例3: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
loglevel = XMLHandler.getTagValue(stepnode, "loglevel");
displayHeader = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "displayHeader"));
logmessage = XMLHandler.getTagValue(stepnode, "logmessage");
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrfields = XMLHandler.countNodes(fields, "field");
allocate(nrfields);
for (int i = 0; i < nrfields; i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
fieldName[i] = XMLHandler.getTagValue(fnode, "name");
}
}
catch (Exception e)
{
throw new KettleXMLException("Unable to load step info from XML", e);
}
}
示例4: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases,
IMetaStore metaStore) throws KettleXMLException {
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrfields = XMLHandler.countNodes(fields, "field");
allocate(nrfields);
for (int i = 0; i < nrfields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
outputFields[i] = new TextFileField();
outputFields[i].setName(XMLHandler.getTagValue(fnode, "name"));
outputFields[i].setType(XMLHandler.getTagValue(fnode, "type"));
outputFields[i].setFormat(XMLHandler.getTagValue(fnode, "format"));
outputFields[i].setCurrencySymbol(XMLHandler.getTagValue(fnode,
"currency"));
outputFields[i].setDecimalSymbol(XMLHandler.getTagValue(fnode,
"decimal"));
outputFields[i].setGroupingSymbol(XMLHandler.getTagValue(fnode,
"group"));
outputFields[i].setTrimType(ValueMeta.getTrimTypeByCode(XMLHandler
.getTagValue(fnode, "trim_type")));
outputFields[i].setNullString(XMLHandler.getTagValue(fnode,
"nullif"));
outputFields[i].setLength(Const.toInt(
XMLHandler.getTagValue(fnode, "length"), -1));
outputFields[i].setPrecision(Const.toInt(
XMLHandler.getTagValue(fnode, "precision"), -1));
}
targetFieldName = XMLHandler.getTagValue(stepnode,
ConcatFieldsNodeNameSpace, "targetFieldName");
targetFieldLength = Const.toInt(XMLHandler.getTagValue(stepnode,
ConcatFieldsNodeNameSpace, "targetFieldLength"), 0);
}
示例5: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep) throws KettleXMLException
{
try
{
super.loadXML(entrynode, databases, slaveServers);
String dbname = XMLHandler.getTagValue(entrynode, "connection");
this.connection = DatabaseMeta.findDatabase(databases, dbname);
this.argFromPrevious = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous"));
Node fields = XMLHandler.getSubNode(entrynode, "fields"); //$NON-NLS-1$
// How many field arguments?
int nrFields = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
this.arguments = new String[nrFields];
this.schemaname = new String[nrFields];
// Read them all...
for (int i = 0; i < nrFields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
this.arguments[i] = XMLHandler.getTagValue(fnode, "name"); //$NON-NLS-1$
this.schemaname[i] = XMLHandler.getTagValue(fnode, "schemaname"); //$NON-NLS-1$
}
}
catch(KettleException e)
{
throw new KettleXMLException(Messages.getString("JobEntryTruncateTables.UnableLoadXML"),e);
}
}
示例6: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
urlInField = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "url_in_field"));
urlFieldname = XMLHandler.getTagValue(stepnode, "url_field_name");
includeRowNumber = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "rownum"));
rowNumberField = XMLHandler.getTagValue(stepnode, "rownum_field");
includeUrl = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "include_url"));
urlField = XMLHandler.getTagValue(stepnode, "url_Field");
readfrom = XMLHandler.getTagValue(stepnode, "read_from");
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrFields = XMLHandler.countNodes(fields, "field");
Node urlnode = XMLHandler.getSubNode(stepnode, "urls");
int nrUrls = XMLHandler.countNodes(urlnode, "url");
allocate(nrUrls,nrFields);
for (int i=0;i<nrUrls;i++)
{
Node urlnamenode = XMLHandler.getSubNodeByNr(urlnode, "url", i);
url[i] = XMLHandler.getNodeValue(urlnamenode);
}
for (int i=0;i<nrFields;i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
RssInputField field = new RssInputField(fnode);
inputFields[i] = field;
}
// Is there a limit on the number of rows we process?
rowLimit = Const.toLong(XMLHandler.getTagValue(stepnode, "limit"), 0L);
}
catch(Exception e)
{
throw new KettleXMLException("Unable to load step info from XML", e);
}
}
示例7: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep) throws KettleXMLException
{
try
{
super.loadXML(entrynode, databases, slaveServers);
copy_empty_folders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "copy_empty_folders")); //$NON-NLS-1$ //$NON-NLS-2$
arg_from_previous = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous") ); //$NON-NLS-1$ //$NON-NLS-2$
overwrite_files = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "overwrite_files") ); //$NON-NLS-1$ //$NON-NLS-2$
include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders") ); //$NON-NLS-1$ //$NON-NLS-2$
remove_source_files = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "remove_source_files") ); //$NON-NLS-1$ //$NON-NLS-2$
add_result_filesname = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_result_filesname") ); //$NON-NLS-1$ //$NON-NLS-2$
destination_is_a_file = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "destination_is_a_file") ); //$NON-NLS-1$ //$NON-NLS-2$
create_destination_folder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "create_destination_folder") ); //$NON-NLS-1$ //$NON-NLS-2$
Node fields = XMLHandler.getSubNode(entrynode, "fields"); //$NON-NLS-1$
// How many field arguments?
int nrFields = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
source_filefolder = new String[nrFields];
destination_filefolder = new String[nrFields];
wildcard = new String[nrFields];
// Read them all...
for (int i = 0; i < nrFields; i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);//$NON-NLS-1$
source_filefolder[i] = XMLHandler.getTagValue(fnode, "source_filefolder");//$NON-NLS-1$
destination_filefolder[i] = XMLHandler.getTagValue(fnode, "destination_filefolder");//$NON-NLS-1$
wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");//$NON-NLS-1$
}
}
catch(KettleXMLException xe)
{
throw new KettleXMLException(BaseMessages.getString(PKG, "JobCopyFiles.Error.Exception.UnableLoadXML"), xe);
}
}
示例8: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
public void readData( Node stepnode ) throws KettleXMLException {
try {
filename = XMLHandler.getTagValue( stepnode, FILENAME );
acceptFilenameFromField = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, FILENAME_IN_FIELD ) );
filenameField = XMLHandler.getTagValue( stepnode, FILENAME_FIELD );
createParentFolder = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, CREATE_PARENT_FOLDER ) );
cleanOutput = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, CLEAN_OUTPUT ) );
stepNrInFilename = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, INCLUDE_STEP_NR ) );
partNrInFilename = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, INCLUDE_PART_NR ) );
dateInFilename = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, INCLUDE_DATE ) );
timeInFilename = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, INCLUDE_TIME ) );
specifyFormat = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, SPECIFY_FORMAT ) );
dateTimeFormat = XMLHandler.getTagValue( stepnode, DATE_FORMAT );
addToResult = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, ADD_TO_RESULT ) );
blockSize = XMLHandler.getTagValue( stepnode, BLOCKSIZE );
pageSize = XMLHandler.getTagValue( stepnode, PAGESIZE );
compressionCodec = XMLHandler.getTagValue( stepnode, COMPRESSION );
enableDictionaryCompression = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, DICTIONARY_COMPRESSION ) );
Node fields = XMLHandler.getSubNode( stepnode, "fields" );
int nrfields = XMLHandler.countNodes( fields, "field" );
allocate( nrfields );
for ( int i = 0; i < nrfields; i++ ) {
Node fnode = XMLHandler.getSubNodeByNr( fields, "field", i );
outputFields[i] = new ParquetOutputField();
outputFields[i].setName( XMLHandler.getTagValue( fnode, NAME ) );
outputFields[i].setPath( XMLHandler.getTagValue( fnode, PATH ) );
outputFields[i].setNullable( "Y".equalsIgnoreCase( XMLHandler.getTagValue( fnode, NULLABLE ) ) );
}
} catch ( Exception e ) {
throw new KettleXMLException( "Unable to load step info from XML", e );
}
}
示例9: readLiteralFormatFromData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private LiteralFormat readLiteralFormatFromData(Node formatNode){
Node supportedUOMsNodes = XMLHandler.getSubNode(formatNode, LiteralFormat.SUPPORTED_UOMS);
int count = XMLHandler.countNodes(supportedUOMsNodes, "UOM");
List<String> supported_uoms = new ArrayList<String>(count);
for (int i = 0; i < count; i++) {
supported_uoms.add(XMLHandler.getNodeValue(XMLHandler.getSubNodeByNr(supportedUOMsNodes, "UOM", i)));
}
String default_uom = XMLHandler.getNodeValue(XMLHandler.getSubNode(formatNode, LiteralFormat.DEFAULT_UOM));
String default_value = XMLHandler.getNodeValue(XMLHandler.getSubNode(formatNode, LiteralFormat.DEFAULT_VALUE));
String datatype = XMLHandler.getNodeValue(XMLHandler.getSubNode(formatNode, LiteralFormat.DATATYPE));
return new LiteralFormat(datatype, supported_uoms, default_uom, default_value);
}
示例10: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode)
throws KettleXMLException
{
try
{
fieldToUse = XMLHandler.getTagValue(stepnode, "field_to_use"); //$NON-NLS-1$
targetField = XMLHandler.getTagValue(stepnode, "target_field"); //$NON-NLS-1$
nonMatchDefault = XMLHandler.getTagValue(stepnode, "non_match_default"); //$NON-NLS-1$
Node fields = XMLHandler.getSubNode(stepnode, "fields"); //$NON-NLS-1$
int count = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
allocate(count);
for (int i=0;i<count;i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
sourceValue[i] = XMLHandler.getTagValue(fnode, "source_value"); //$NON-NLS-1$
targetValue[i] = XMLHandler.getTagValue(fnode, "target_value"); //$NON-NLS-1$
}
}
catch(Exception e)
{
throw new KettleXMLException(BaseMessages.getString(PKG, "ValueMapperMeta.RuntimeError.UnableToReadXML.VALUEMAPPER0004"), e); //$NON-NLS-1$
}
}
示例11: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metastore) throws KettleXMLException {
this.cassandraNodes = XMLHandler.getTagValue(stepnode, CASSANDRA_NODES);
this.cassandraPort = XMLHandler.getTagValue(stepnode, CASSANDRA_PORT);
this.username = XMLHandler.getTagValue(stepnode, USERNAME);
this.password = XMLHandler.getTagValue(stepnode, PASSWORD);
if (!Const.isEmpty(this.password)) {
this.password = Encr.decryptPasswordOptionallyEncrypted(this.password);
}
this.keyspace = XMLHandler.getTagValue(stepnode, CASSANDRA_KEYSPACE);
this.SslEnabled = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, CASSANDRA_WITH_SSL));
this.trustStoreFilePath = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_FILE_PATH);
this.trustStorePass = XMLHandler.getTagValue(stepnode, CASSANDRA_TRUSTSTORE_PASS);
if (!Const.isEmpty(this.trustStorePass)) {
this.trustStorePass = Encr.decryptPasswordOptionallyEncrypted(this.trustStorePass);
}
this.columnfamily = XMLHandler.getTagValue(stepnode, CASSANDRA_COLUMN_FAMILY);
this.syncMode = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, SYNC_ENABLED));
String batchSize = XMLHandler.getTagValue(stepnode, BATCH_SIZE);
this.batchSize = (Const.isEmpty(batchSize) ? 1000 : Integer.valueOf(batchSize));
String sCompression = XMLHandler.getTagValue(stepnode, QUERY_COMPRESSION);
this.compression = (Const.isEmpty(sCompression) ? ConnectionCompression.SNAPPY : ConnectionCompression.fromString(sCompression));
this.specifyFields = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, SPECIFY_FIELDS));
Node fields = XMLHandler.getSubNode(stepnode, FIELD_MAPPING);
int nrRows = XMLHandler.countNodes(fields, FIELD);
allocate(nrRows);
for (int i = 0; i < nrRows; i++) {
Node knode = XMLHandler.getSubNodeByNr(fields, FIELD, i);
this.cassandraFields[i] = XMLHandler.getTagValue(knode, COLUMN_NAME);
this.streamFields[i] = XMLHandler.getTagValue(knode, STREAM_NAME);
}
this.ttl = Const.toInt(XMLHandler.getTagValue(stepnode, TTL), 0);
}
示例12: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
/**
* This method is called by PDI when a step needs to load its configuration from XML.
*
* Please use org.pentaho.di.core.xml.XMLHandler to conveniently read from the
* XML node passed in.
*
* @param stepnode the XML node containing the configuration
* @param databases the databases available in the transformation
* @param metaStore the metaStore to optionally read from
*/
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
try {
setProvider( providerHandler.getProviderByName(
XMLHandler.getNodeValue (XMLHandler.getSubNode( stepnode, "provider_id" ) ) ) );
dataflow.setId( XMLHandler.getNodeValue( XMLHandler.getSubNode( stepnode, "flow_id" ) ) );
dataflow.setName( XMLHandler.getNodeValue( XMLHandler.getSubNode( stepnode, "flow_desc" ) ) );
setSdmxQuery(XMLHandler.getNodeValue( XMLHandler.getSubNode( stepnode, "query_sdmx" ) ) );
Node dims = XMLHandler.getSubNode( stepnode, "dimensions" );
int nrDimensions = XMLHandler.countNodes( dims, "dimension" );
for ( int i = 0; i < nrDimensions; i++ ) {
Node dimNode = XMLHandler.getSubNodeByNr( dims, "dimension", i );
Dimension d = new Dimension();
d.setId( XMLHandler.getTagValue( dimNode, "dim_id" ) );
d.setPosition( Integer.parseInt( XMLHandler.getTagValue( dimNode, "dim_position" ) ) );
String code = XMLHandler.getTagValue( dimNode, "dim_code" );
dimensionToCodes.put( d, ( code == null ? "" : code ) );
}
Node fieldsNode = XMLHandler.getSubNode( stepnode, "fields" );
int nrfields = XMLHandler.countNodes( fieldsNode, "field" );
allocateFields( nrfields );
for ( int i = 0; i < nrfields; i++ ) {
Node fnode = XMLHandler.getSubNodeByNr( fieldsNode, "field", i );
fields[i] = new SdmxInputField();
fields[i].setName( XMLHandler.getTagValue( fnode, "name" ) );
fields[i].setType( ValueMetaBase.getType( XMLHandler.getTagValue( fnode, "type" ) ) );
fields[i].setLength( Const.toInt( XMLHandler.getTagValue( fnode, "length" ), -1 ) );
fields[i].setPrecision( Const.toInt( XMLHandler.getTagValue( fnode, "precision" ), -1 ) );
String srepeat = XMLHandler.getTagValue( fnode, "repeat" );
fields[i].setTrimType( ValueMetaBase.getTrimTypeByCode( XMLHandler.getTagValue( fnode, "trim_type" ) ) );
if ( srepeat != null ) {
fields[i].setRepeated( YES.equalsIgnoreCase( srepeat ) );
} else {
fields[i].setRepeated( false );
}
fields[i].setFormat( XMLHandler.getTagValue( fnode, "format" ) );
fields[i].setCurrencySymbol( XMLHandler.getTagValue( fnode, "currency" ) );
fields[i].setDecimalSymbol( XMLHandler.getTagValue( fnode, "decimal" ) );
fields[i].setGroupSymbol( XMLHandler.getTagValue( fnode, "group" ) );
}
} catch (Exception e) {
throw new KettleXMLException("Sdmx plugin unable to read step info from XML node", e);
}
}
示例13: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
public void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String, Counter> counters)
throws KettleXMLException {
try {
carbonProps = XMLHandler.getTagValue(stepnode, "carbonProps");
carbondim = XMLHandler.getTagValue(stepnode, "dim");
carbonmsr = XMLHandler.getTagValue(stepnode, "msr");
carbonhier = XMLHandler.getTagValue(stepnode, "hier");
carbonTime = XMLHandler.getTagValue(stepnode, "time");
driverClass = XMLHandler.getTagValue(stepnode, "driverClass");
connectionURL = XMLHandler.getTagValue(stepnode, "connectionURL");
userName = XMLHandler.getTagValue(stepnode, "userName");
password = XMLHandler.getTagValue(stepnode, "password");
carbonMetaHier = XMLHandler.getTagValue(stepnode, "carbonMetaHier");
carbonhierColumn = XMLHandler.getTagValue(stepnode, "carbonhierColumn");
foreignKeyHierarchyString = XMLHandler.getTagValue(stepnode, "foreignKeyHierarchyString");
complexTypeString = XMLHandler.getTagValue(stepnode, "complexTypeString");
columnPropertiesString = XMLHandler.getTagValue(stepnode, "columnPropertiesString");
complexDelimiterLevel1 = XMLHandler.getTagValue(stepnode, "complexDelimiterLevel1");
complexDelimiterLevel2 = XMLHandler.getTagValue(stepnode, "complexDelimiterLevel2");
primaryKeysString = XMLHandler.getTagValue(stepnode, "primaryKeysString");
carbonMeasureNames = XMLHandler.getTagValue(stepnode, "carbonMeasureNames");
actualDimNames = XMLHandler.getTagValue(stepnode, "actualDimNames");
normHiers = XMLHandler.getTagValue(stepnode, "normHiers");
msrAggregatorString = XMLHandler.getTagValue(stepnode, "msrAggregatorString");
heirKeySize = XMLHandler.getTagValue(stepnode, "heirKeySize");
forgienKeyPrimayKeyString = XMLHandler.getTagValue(stepnode, "forgienKeyPrimayKeyString");
heirNadDimsLensString = XMLHandler.getTagValue(stepnode, "heirNadDimsLensString");
measureDataType = XMLHandler.getTagValue(stepnode, "measureDataType");
columnAndTableNameColumnMapForAggString =
XMLHandler.getTagValue(stepnode, "columnAndTableName_ColumnMapForAggString");
dimesionTableNames = XMLHandler.getTagValue(stepnode, "dimHierReleation");
dimensionColumnIds = XMLHandler.getTagValue(stepnode, "dimensionColumnIds");
noDictionaryDims = XMLHandler.getTagValue(stepnode, "dimNoDictionary");
columnsDataTypeString = XMLHandler.getTagValue(stepnode, "dimColDataTypes");
tableName = XMLHandler.getTagValue(stepnode, "factOrAggTable");
tableName = XMLHandler.getTagValue(stepnode, "tableName");
databaseName = XMLHandler.getTagValue(stepnode, "databaseName");
denormColumNames = XMLHandler.getTagValue(stepnode, "denormColumNames");
partitionID = XMLHandler.getTagValue(stepnode, "partitionID");
segmentId = XMLHandler.getTagValue(stepnode, "segmentId");
taskNo = XMLHandler.getTagValue(stepnode, "taskNo");
columnSchemaDetails = XMLHandler.getTagValue(stepnode, "columnSchemaDetails");
tableOption = XMLHandler.getTagValue(stepnode, "tableOption");
String batchConfig = XMLHandler.getTagValue(stepnode, "batchSize");
if (batchConfig != null) {
batchSize = Integer.parseInt(batchConfig);
}
String dimeFileConfig = XMLHandler.getTagValue(stepnode, "genDimFiles");
if (dimeFileConfig != null) {
generateDimFiles = Boolean.parseBoolean(dimeFileConfig);
}
storeType = XMLHandler.getTagValue(stepnode, "storeType");
metaHeirSQLQuery = XMLHandler.getTagValue(stepnode, "metadataFilePath");
isAggregate = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "isAggregate"));
int nrKeys = XMLHandler.countNodes(stepnode, "lookup");
allocate(nrKeys);
} catch (Exception e) {
throw new KettleXMLException("Template Plugin Unable to read step info from XML node", e);
}
}
示例14: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException {
try {
filename = XMLHandler.getTagValue(stepnode, getXmlCode("FILENAME"));
filenameField = XMLHandler.getTagValue(stepnode, getXmlCode("FILENAME_FIELD"));
rowNumField = XMLHandler.getTagValue(stepnode, getXmlCode("ROW_NUM_FIELD"));
includingFilename =
"Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, getXmlCode("INCLUDE_FILENAME")));
delimiter = XMLHandler.getTagValue(stepnode, getXmlCode("DELIMITER"));
enclosure = XMLHandler.getTagValue(stepnode, getXmlCode("ENCLOSURE"));
escapeEnclosure =
"Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, getXmlCode("ESACAPE_ENCLOSURE")));
bufferSize = XMLHandler.getTagValue(stepnode, getXmlCode("BUFFERSIZE"));
headerPresent =
"Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, getXmlCode("HEADER_PRESENT")));
lazyConversionActive =
"Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, getXmlCode("LAZY_CONVERSION")));
isaddresult =
"Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, getXmlCode("ADD_FILENAME_RESULT")));
runningInParallel =
"Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, getXmlCode("PARALLEL")));
String nlp = XMLHandler.getTagValue(stepnode, getXmlCode("NEWLINE_POSSIBLE"));
if (Const.isEmpty(nlp)) {
if (runningInParallel) {
newlinePossibleInFields = false;
} else {
newlinePossibleInFields = true;
}
} else {
newlinePossibleInFields = "Y".equalsIgnoreCase(nlp);
}
encoding = XMLHandler.getTagValue(stepnode, getXmlCode("ENCODING"));
blocksID = XMLHandler.getTagValue(stepnode, "blocksID");
partitionID = XMLHandler.getTagValue(stepnode, "partitionID");
escapeCharacter = XMLHandler.getTagValue(stepnode, "escapeCharacter");
quoteCharacter = XMLHandler.getTagValue(stepnode, "quoteCharacter");
commentCharacter = XMLHandler.getTagValue(stepnode, "commentCharacter");
maxColumns = XMLHandler.getTagValue(stepnode, "maxColumns");
Node fields = XMLHandler.getSubNode(stepnode, getXmlCode("FIELDS"));
int nrfields = XMLHandler.countNodes(fields, getXmlCode("FIELD"));
allocate(nrfields);
for (int i = 0; i < nrfields; i++) {
inputFields[i] = new TextFileInputField();
Node fnode = XMLHandler.getSubNodeByNr(fields, getXmlCode("FIELD"), i);
inputFields[i].setName(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_NAME")));
inputFields[i]
.setType(ValueMeta.getType(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_TYPE"))));
inputFields[i].setFormat(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_FORMAT")));
inputFields[i]
.setCurrencySymbol(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_CURRENCY")));
inputFields[i].setDecimalSymbol(XMLHandler.getTagValue(fnode,
getXmlCode("FIELD_DECIMAL")));
inputFields[i].setGroupSymbol(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_GROUP")));
inputFields[i]
.setLength(Const.toInt(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_LENGTH")), -1));
inputFields[i].setPrecision(
Const.toInt(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_PRECISION")), -1));
inputFields[i].setTrimType(ValueMeta
.getTrimTypeByCode(XMLHandler.getTagValue(fnode, getXmlCode("FIELD_TRIM_TYPE"))));
}
} catch (Exception e) {
throw new KettleXMLException("Unable to load step info from XML", e);
}
}
示例15: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
/**
* Reads the XML data to get the step metadata
*
* @param stepNode The XML node for the step
* @throws KettleXMLException
*/
private void readData( Node stepNode, List<? extends SharedObjectInterface> databases ) throws KettleXMLException {
try {
databaseMeta = DatabaseMeta.findDatabase( databases, XMLHandler.getTagValue( stepNode, CONNECTION ) );
targetSchema = XMLHandler.getTagValue( stepNode, TARGET_SCHEMA );
targetTable = XMLHandler.getTagValue( stepNode, TARGET_TABLE );
locationType = XMLHandler.getTagValue( stepNode, LOCATION_TYPE );
stageName = XMLHandler.getTagValue( stepNode, STAGE_NAME );
workDirectory = XMLHandler.getTagValue( stepNode, WORK_DIRECTORY );
onError = XMLHandler.getTagValue( stepNode, ON_ERROR );
errorLimit = XMLHandler.getTagValue( stepNode, ERROR_LIMIT );
splitSize = XMLHandler.getTagValue( stepNode, SPLIT_SIZE );
removeFiles = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, REMOVE_FILES ) );
dataType = XMLHandler.getTagValue( stepNode, DATA_TYPE );
trimWhitespace = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, TRIM_WHITESPACE ) );
nullIf = XMLHandler.getTagValue( stepNode, NULL_IF );
errorColumnMismatch = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, ERROR_COLUMN_MISMATCH ) );
stripNull = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, STRIP_NULL ) );
ignoreUtf8 = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, IGNORE_UTF_8 ) );
allowDuplicateElements = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, ALLOW_DUPLICATE_ELEMENT ) );
enableOctal = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, ENABLE_OCTAL ) );
specifyFields = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepNode, SPECIFY_FIELDS ) );
jsonField = XMLHandler.getTagValue( stepNode, JSON_FIELD );
Node fields = XMLHandler.getSubNode( stepNode, FIELDS );
int nrfields = XMLHandler.countNodes( fields, FIELD );
allocate( nrfields );
for ( int i = 0; i < nrfields; i++ ) {
Node fnode = XMLHandler.getSubNodeByNr( fields, FIELD, i );
snowflakeBulkLoaderFields[i] = new SnowflakeBulkLoaderField();
snowflakeBulkLoaderFields[i].setStreamField( XMLHandler.getTagValue( fnode, STREAM_FIELD ) );
snowflakeBulkLoaderFields[i].setTableField( XMLHandler.getTagValue( fnode, TABLE_FIELD ) );
}
} catch ( Exception e ) {
throw new KettleXMLException( "Unable to load step info from XML", e );
}
}