Webmasters, gagnez de l'argent en affichant des bannières contextuelles Oxado
SourceForge.net Logo
Support This Project
   LeCouteauSuisse Project
Welcome ! [ Home ]  ·  [ Downloads ]  ·  [ Forums ]  ·  [ News ]  ·  [ Documentations ]  
[ Home ]

[ Documentations ]

Configuration Samples


XML File

We have a file of invoices like this :

<invoices>
	<invoice>
		<item name="chocolate" price="12" quantity="2"/>
		<item name="coffee" price="10" quantity="3"/>
	</invoice>
	<invoice>
		<item name="orange" price="1" quantity="22"/>
		<item name="lemon" price="1" quantity="22"/>
	</invoice>
</invoices>
A record is a node of <invoice>. The XPath to extract each invoice will be '/invoices/invoice'. the configuration will be :
<generator name="XMLToEvent" type="LeCouteauSuisse.Components.FileToEventGenerator, 
	LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0">
	<settings>
		<setting key="type" value="LeCouteauSuisse.Components.XMLFileToEventSplitter,
			LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0"/>
		<setting key="path" value="c:\Files"/>
		<setting key="fileFilter" value="*.xml"/>
		<setting key="includeSubdirectories" value="false"/>
		<!-- XML attribute -->
		<setting key="xpath" value="/invoices/invoice"/>
	</settings>
</generator>

CSV File

We have a file of invoices with column separated with semmicolon like this :

invoice;item;price;quantity
invoice 1;chocolate;12;2
invoice 1;coffee;10;3
invoice 2;orange;1;22
invoice 2;lemon;1;22
A record is a line and each field is separate by a semicolon. the configuration will be :
<generator name="CSVToEvent" type="LeCouteauSuisse.Components.FileToEventGenerator, 
	LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0">
	<settings>
		<setting key="type" value="LeCouteauSuisse.Components.DelimitedFileToEventSplitter,
			LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0"/>
		<setting key="path" value="c:\Files"/>
		<setting key="fileFilter" value="*.csv"/>
		<setting key="includeSubdirectories" value="false"/>
		<!-- Delimited attribute -->
		<setting key="headerLines" value="1"/>
		<setting key="headerLineWithColumnsName" value="1"/>
		<setting key="footerLines" value="0"/>
		<setting key="ignoreEmptyLine" value="true"/>
		<setting key="encoding" value="ASCII"/>
		<setting key="columnSeparator" value=";"/>
	</settings>
</generator>

Structured File

We have a file of invoices. An line will describe the invoice and following lines will describe items. An invoice line begin with number 0 and item line begin with number 1. An invoice line have a reference of 5 characters followed by a name of 30 characters. An item line have a name of 20 characters followed by a quantity of 5 characters and a price of 5 characters.

0 ref1Invoice of coffee             
1chocolate           2    12   
1coffee              3    10   
0 ref2Invoice of fruit              
1orange             22     1  
1lemon              22     1   
A record is a line of invoice and all item lines. the configuration will be :
<generator name="StructureToEvent" type="LeCouteauSuisse.Components.FileToEventGenerator, 
	LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0">
	<settings>
		<setting key="type" value="LeCouteauSuisse.Components.FixedFileToEventSplitter,
			LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0"/>
		<setting key="path" value="c:\Files"/>
		<setting key="fileFilter" value="*.txt"/>
		<setting key="includeSubdirectories" value="false"/>
		<!-- Delimited attribute -->
		<setting key="headerLines" value="0"/>
		<setting key="footerLines" value="0"/>
		<setting key="ignoreEmptyLine" value="true"/>
		<setting key="encoding" value="ASCII"/>
		<setting key="masterRecord" value="invoiceRecord"/>
		<setting key="allRecord" value="invoiceRecord,itemRecord"/>
		<setting key="invoiceRecord" value="Invoice line,P0,5,30"/>
		<setting key="itemRecord" value="Item line,P1,20,5,5"/>
	</settings>
</generator>


LeCouteauSuisse