Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • charset- Optional charset used for reading the csv file. Defaults to ISO-8859-1.
  • description - Optional description only used for reference.
  • importFile - Path and name of a csv file from the model. This file will be imported.
  • displayName - name used to display the import file name in the ModuleRunTableDisplay component.
  • table - mapping of column names to displayNames and types that will be used to store in the into FEWS database. If a column isn't mapped the csv column name is used as displayName and String is used as column type. The following types can be mapped using the name attribute to map a csv column name to a displayName:
    • stringColumn - set the column type to string.
    • booleanColumn - set the column type to boolean. Only the values 'true' and 'false' are allowed.
    • integerColumn - set the column type to integer.
    • doubleColumn - set the column type to double.
    • dateTimeColumn - set the column type to dateTime. In case a date pattern is specified, the string will be parsed according this format. If no format was specified, a timestamp is assumed in milliseconds.

...

In the following example one importCsvModuleRunTablesActivity is specified for the import file import_csv_module_test1.csv. In case more than one csv file has to be imported, for each csv file an activity has to be configured. Not that in this example the csv column 'Float' hasn't been mapped. This will result in importing the 'Float' column as a String column into FEWS.

Code Block
xml
xml
		<importActivities>
			<importCsvModuleRunTablesActivity>
				<charset>UTF-8</charset>
				<description>Csv Module Data Activity Test case.</description>
				<importFile>import_csv_module_test1.csv</importFile>
				<displayName>Import CSV Module Test1</displayName>
				<table>
					<!-- Map de following CSV definition:
								DateTime;Status;Boolean;Integer;Float;Double;String
								2003-02-22 00:00;Ok;yes;14;1.4;1.45;Hello world 1
								2003-02-23 00:00;Not Ok;;true;24;2.4;2.45;Hello world 2
					-->
					<dateTimeColumn name="DateTime" displayName="datum" pattern="yyyy-MM-dd HH:ss"/>
					<stringColumn name="Status" displayName="status field"/>
					<booleanColumn name="Boolean" displayName="Yes or No"/>
					<integerColumn name="Integer" displayName="Int field"/>
					<doubleColumn name="Double" displayName="Double field"/>
					<stringColumn name="String" displayName="String field"/>
				</table>
			</importCsvModuleRunTablesActivity>
		</importActivities>

...