|
From: <tri...@us...> - 2008-12-03 11:51:03
|
Revision: 888
http://equanda.svn.sourceforge.net/equanda/?rev=888&view=rev
Author: triathlon98
Date: 2008-12-03 11:49:04 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
EQ-287 documentation improvements
Modified Paths:
--------------
trunk/equanda-tool/src/site/wiki/index.wiki
trunk/src/site/site.xml
Added Paths:
-----------
trunk/src/site/wiki/tool/ExportFileFormat.wiki
trunk/src/site/wiki/tool/ImportFileFormat.wiki
trunk/src/site/wiki/tool/ImportServlet.wiki
trunk/src/site/wiki/tool/export.wiki
trunk/src/site/wiki/tool/fscript.wiki
trunk/src/site/wiki/tool/import.wiki
trunk/src/site/wiki/tool/print.wiki
trunk/src/site/wiki/tool/tool.wiki
trunk/src/site/wiki/tool/translations.wiki
Removed Paths:
-------------
trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki
trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki
trunk/equanda-tool/src/site/wiki/ImportServlet.wiki
trunk/equanda-tool/src/site/wiki/export.wiki
trunk/equanda-tool/src/site/wiki/fscript.wiki
trunk/equanda-tool/src/site/wiki/import.wiki
trunk/equanda-tool/src/site/wiki/print.wiki
trunk/equanda-tool/src/site/wiki/tool.wiki
trunk/equanda-tool/src/site/wiki/translations.wiki
Deleted: trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,39 +0,0 @@
-h1. File format for export description
-
-This file format is used by the export tool and export classes.
-It allows you to describe which fields need to be exported from which table,
-and the order of the fields and the export filename.
-
-The file has the shape and form of a (case sensitive) .ini file.
-
-The sections in the file indicate the tables which can be exported.
-
-For each section you can specify the following :
-
-- file : name of the file in which the exported object is saved.
-- suppressHeaderLines : when "true" the header lines is not saved in the file.
-- suppressDuplicateLines : when "true" a line is only appended in the file if it was not yet present.
-- _number_ : field which needs exporting, count starts from 1. Needs to be consecutive.
-
-For the filename, you can use a field from the reference object in the filename.
-This is done using the ${_fieldname_} syntax.
-
-For the fields, a special syntax "FieldName$expression" can be used. In that case the given fieldname if used as field name, and the [FScript|fscript.html] expression is used to calculate the field value. If the special fieldname "NOQUOTES" is used, then the result string is not processed (quoted) before exporting. This can be useful when calculating the entire export line.
-
-Example
-{code}
-[WeightGroup]
-file=WG${Reference}.txt
-1=Reference
-2=LocalReference
-3=Client
-4=Date
-5=Today$datesys()
-
-[Weight]
-file=WG${Reference}.txt
-1=Reference
-2=Count
-3=WeightNet
-4=Sale
-{code}
Deleted: trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,124 +0,0 @@
-h1. Import file format
-
-This document describes the file format to import data into equanda applications.
-This file format applies both to the [ImportServlet] and to the [Import] tool.
-
-The equanda import file format is roughly based on CSV files.
-However, many extensions have been provided to make the import file self-contained,
-provide for powerful features like multiple fields and links,
-to allow data for different tables to be sent in one connection
-and that the table and field names can be specified.
-
-h2. General rules
-
-- Empty lines are discarded
-- Lines starting with a semicolon or hash are comments and are also discarded
-- Lines starting with a colon are directives.
-- All other lines are considered as data
-
-h2. File structure
-
-- The file can contain zero or more data blocks.
-- A data block starts with a table directive, followed by data lines
-
-h2. Table directives
-
-- A table directive starts with ":table:" followed by the (root) table name (possibly surrounded by whitespace, and optionally including a selector), followed by another semicolon and the list of field names which are included in the data lines.
-- The field names are separated by a comma.
-- Apart from the real field names, "UOID" may be used to indicate the uoid, and "equandaType" can be used to indicate the record type.
-- Whitespace around the fieldname is discarded.
-- Field names are case sensitive (exactly the same as the definition in equanda).
-- For linked fields, the field name has to either include the selector to select the linked record(s) or a list of fields (between square brackets) or both. When linking multiple fields which are specified using fields, the field names should be in double square brackets ("[[" and "]]", with no space in between).
-- Only root table names can be used. You have to use equandaType to distinguish between variants of a root type.
-
-Some example table directives :
-{code}
-:table:Company:equandaType,Reference,Name
-:table:Company/Company: Reference, Name, PersonName, Address, Zip, City, Country, VAT, Customer, Supplier
-:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo/EECNumber
-:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo[Activity,EECNumber,OfficialRegistrationNumber]
-{code}
-
-_NOTE_ for the selectors, you can only use those selectors which select only fields from the table itself.
-If the selector includes referenced fields from other tables, it cannot be used to select the records in the import file.
-
-h2. Data line structure
-
-- No data line may occur in the file before the first table directive.
-- Field values are comma separated
-- String field values are enclosed in double quotes. Any double quotes inside the field value have to be doubled.
-- When a string value is not quoted, all whitespace in it is discarded.
-- Inside a quoted string, quotes, newlines, carriage returns and tabs can be indicated with a backslash followed by a double quote, 'n', 'r', 't' respectively. Any backslashes which should be part of the actual value need to be doubled.
-- Numeric fields are included with a dot as decimal point.
-- Whitespace around the field values is discarded
-- Null can be represented by "null" (without quotes). To use the string value "null", the null has to be quoted.
-- Fields may be skipped (that is no value or just whitespace, but with sperating comma), in which case this is interpreted as if the field was not declared in the table directive. If no field values follow, then the commas may also be discarded.
-- Multiple fields which have more than one value need to have their values enclosed in square brackets (same rules for quoting, whitespace etc). Eg '["val", "bla" , "alb" ]'
-- Linked fields are indicated by the selector parameters (if more than one parameter, then the different parameters have to be in square brackets again).
-
-
-h2. Import / Update
-
-The import servlet / tool can be used both for importing and for updating data.
-
-When a record is specified, equanda uses the specified selector to check whether the record already exists.
-If it does, then the fields are updated, otherwise a new record is inserted.
-
-When no selector is specified, equanda tries to see whether the data line included a unique field.
-If it does, this field is used to check for existence of the record.
-When more than one unique field is included,
-it is not defined which field will be used first to try to select a matching record.
-
-
-h2. Linked records
-
-The data line can include linked records either using a selector, or by specifying the actual value.
-
-When using a selector name, the value is the list of parameters for the selector.
-If there is more than one parameter then this list needs to be enclosed in square brackets.
-If the field is single linked, and the selector returns more than one record, then the import fails.
-
-Alternatively, you may use a field list (optionally combined with a selector).
-This will create or update the record and link it.
-
-
-h2. Examples
-
-A couple of simple examples for some fictive tables (definition not included and may be different for each example).
-
-{code}
-:table: JustAString : Value
-Simple test
-{code}
-
-This will include the string "Simpletest" without space, as spaces are discarded when the value is not quoted.
-
-{code}
-:table:Address: Reference, Street, Location
-"addr1", "Mechelbaan", "Putte"
-:table:Person: Name, Address/Reference
-"Joachim", "addr1"
-{code}
-
-Simple example of a linked record.
-
-{code}
-:table:Person: Name, Address[Street, Location]
-"Joachim", ["Mechelbaan", "Putte"]
-{code}
-
-Simple example of a multiple linked record.
-
-{code}
-:table:Person: Name, Address[[Street, Location]]
-"Wim", [ ["Kerklaan", "Putte"], ["Heistraat", "Bree"] ]
-{code}
-
-Use of the automatic creation of linked records.
-
-{code}
-:table:Person: Name, Address[ Street, Location/Zip[Zip,City] ]
-"Joachim", [ "Mechelbaan", [ "2580", "Putte" ] ]
-{code}
-
-Advanced linked record with nesting and combined selector and fieldlist for "Location".
Deleted: trunk/equanda-tool/src/site/wiki/ImportServlet.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/ImportServlet.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/ImportServlet.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,74 +0,0 @@
-h1. Import servlet
-
-The actual data can be sent to the equanda generated application using a servlet. Alternatively a web page can be provided (and by default it is), where you can cut and past the import file.
-
-The servlet can be called with code like the following :
-
-{code}
-URLConnection cnx=url.openConnection();
-
-// Set connection parameters
-cnx.setDoInput(true);
-cnx.setDoOutput(true);
-cnx.setUseCaches(false);
-cnx.setRequestProperty("Content-Type", "text/plain");
-
-// write the request
-Writer out=new BufferedWriter(new OutputStreamWriter(cnx.getOutputStream()));
-// write the data
-out.flush();
-out.close();
-
-// now read the response
-BufferedInputStream in=new BufferedInputStream(cnx.getInputStream());
-// handle the reply
-in.close();
-{code}
-
-If the data file starts with "data=� then this is removed from the data (this is done to allow the data to come from a form).
-
-The servlet send a short replies with "OK" if the file was processed properly.
-If there was a problem during the import, the reply is "FAILED " followed by a human readable reason of failure.
-
-If your servlet is secured (it should be), then it is best to use the org.equanda.client.ImportClient class.
-This will handle the login both in case of BASIC and FORM based authentication.
-
-The actual servlet can be generated with a ant task like the following :
-
-{code}
- <equanda
- appdir="${rootdir}/build/om"
- definition="dm.xml"
- outputdir="${build.generate.dir}"
- package="test.ymport"
- template="import"
- generateAll="${equanda.generate-all}">
- <config name="extra">
- <attribute name="ejb-package" value="test"/>
- </config>
- </equanda>
-{code}
-
-Note that "import� is a reserved word in Java and thus cannot be used as package name.
-
-To use the servlet, a definition like the example which follows has to be added to your web.xml file in your web archive.
-
-{code}
- <servlet>
- <servlet-name>Import</servlet-name>
- <servlet-class>org.equanda.ymport.Servlet</servlet-class>
- <init-param>
- <param-name>DatabaseMap</param-name>
- <param-value>test.ymport.DatabaseMap</param-value>
- </init-param>
- </servlet>
-{code}
-
-Obviously, this servlet also has to be mapped to a URL, but that�s all there is to it.
-
-
-h2. Charset issues
-
-On the servlet connection, it is possible to indicate the character encoding which is used in the communication.
-This can be modified as needed on the client side to match the charset for the text file.
-
Deleted: trunk/equanda-tool/src/site/wiki/export.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/export.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/export.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,239 +0,0 @@
-h1. Export tool
-
-The export tool allows you to export data from a equanda generated application to text (ascii).
-Alternatively, the data which is exported can be processed using a script which then handles it further.
-This option is typically used to synchronize with another application
-(one-way synchronization, use the [Import] tool for the other direction).
-
-h2. General configuration
-
-The export program expects the name of the configuration .ini file as parameter.
-If this parameter is not given, a file called "export.ini" in the current directory is used.
-
-The export can be configured using a .ini file with the following base format :
-
-{code}
-[general]
-scanPeriod=30
-
-exportDirectory=c:\export
-exportInfo=exportInfo=org.ictrace.demo.maps.ExportMap
-exportIni=exportConfig.ini
-
-window=display
-
-server=192.168.0.252
-login=myname
-password=mypass
-{code}
-
-- scanPeriod : time in seconds between attempts to pick up files to import, default 120
-- exportDirectory : directory where the export files need to be written
-- window : indicates whether a window needs to be displayed or not (values "display" or "hidden")
-- exportInfo : full class name of the ExportInfo map needed for export
-- exportIni : defines the [ExportFileFormat] which should be used
-- server : name or ip address of server
-- login : login to connect to the equanda application
-- password : password to connect to the equanda application
-
-
-h2. What to export
-
-The .ini file also defines what to export.
-This is done by specifying the objects which need to be selected.
-For each object selected, you can have selections of secondary (related) objects which are also exported.
-After the export, the tool can automatically update one of the fields to mark that the export was succesful.
-
-For example
-{code}
-[object,1]
-
-selectorJndi=IC-trace/WeightGroupSelector
-selectorName=org.ictrace.client.WeightGroupSelector
-
-selectorName=ImportStatus
-selectorParamType1=String
-selectorParamValue1=Y
-
-setField1=ERPImportStatus
-setFieldType1=String
-setFieldValue1=D
-
-script=WeightGroup.esc
-
-[object,1,1]
-
-selectorJndi=IC-trace/WeightGroupTotalSelector
-selectorName=org.ictrace.client.WeightGroupTotalSelector
-
-selectorName=WeightGroup
-selectorParamType1=String
-selectorParamValue1=${Reference}
-
-script=WeightGroup.esc
-{code}
-
-This excerpt shows all the options.
-The first (and only) primary selector is indicated in the [object,1] section.
-The secondary selections for these are in the [object,1,X] sections, with "X" a number from one upwards.
-
-For each section, you can specify the JNDI name and classname for the bean to use.
-The classname should be without trailing "EJB" or "EJBHome".
-You can also specify the selector to be used, and the type and value for each paramater.
-For secondary objects, fields from the primary object can be used to as parameter value using the "${FieldName}" syntax.
-
-For each object, you can also optionally spacify fields which need to be set when the import was successful.
-You can also choose whether the export is to a file,
-or whether a user defined [FScript|fscript.html] script should handle the export (in which case the file is not generated).
-
-*Key Set Details*
-
-- selectorJndi : JNDI name whether the object which is selected can be found, normally a prefix followed by the table name.
-- selectorName : full name of the selector class (without trailing "EJB")
-
-- selectorName : the name of the selector to be used
-- selectorParamTypeX : type of the selector's Xth parameter, can be _String_, _int_, _double_, _boolean_, _Timestamp_, _Date_
-- selectorParamValueX : value of the selector's Xth parameter
-
-- setFieldX : name of the field to be set (after the object is exported)
-- setFieldTypeX : type of the field to be set, same choices as selectorParamType
-- setFieldValue1X : value for the field to be set
-
-- script : name of the script which is used to export the object
-
-_NOTE:_ All keys are _case sensitive_ !!!
-
-
-h2. Using scripts in export
-
-Like in [Import|import.html] you can also use scripts to export the data,
-possibly including the data directly into a different database.
-
-The program accepts [FScript|fscript.html] scripts to build the data to be exported.
-The script should have the following structure (example with some debug info) :
-
-{code}
-func primary(object prim)
- debug("primary called for "+prim)
- return TRUE
-endfunc
-
-func primary_done(object prim)
- debug("primary_done called for "+prim)
- display("importing "+prim)
- return TRUE
-endfunc
-
-func secondary(object prim, object sec)
- debug("secondary called for "+prim+":"+sec)
- return FALSE
-endfunc{code}
-
-The [FScript|fscript.html] extensions from the util module are available.
-
-The functions should return "TRUE" or "FALSE" depending on whether the export was successful or not.
-If the export was not successful, then the variables which need to be set are not modified.
-
-When you return "FALSE" for the primary object, then the secondary objects are not exported.
-When one of the secondary objects returned "FALSE", then the fields for the primary object are not set.
-
-If the primary and all the secondary objects have been successfully imported,
-then the "primary_done" function is called. This can be used for cleanup, or to mark that the export has finished.
-
-{private}
-old export.ini as example :
-[general]
-title=Export
-usePrefix=false
-window=display
-;window=hidden
-login=local
-password=local
-scanPeriod=10
-debug=true
-server=localhost
-port=8080
-protocol=http
-alertProxyName=org.ictrace.client.equandaAlertProxy
-
-[database]
-name1=IC-TRACE.FDB
-;driver1=sun.jdbc.odbc.JdbcOdbcDriver
-;location1=jdbc:odbc:CodeBase Datasource;database=c:\data\db
-driver1=org.firebirdsql.jdbc.FBDriver
-location1=jdbc:firebirdsql:localhost/3050:C:\data\ic-trace\IC-TRACE.FDB
-user1=sysdba
-password1=masterkey
-
-[config]
-AankoopbonPrefix=AANK-
-BestelbonPrefix=VERK-
-KlantPrefix=K-
-LeverancierPrefix=L-
-
-[settings]
-script1=company.isc
-server=127.0.0.1
-exportDirectory=c:\
-exportInfo=org.ictrace.tool.export.maps.ExportMap
-exportIni=exportConfig.ini
-
-[object,1]
-
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=testCompany
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=Something
-
-setField2=Phone
-setFieldType2=String
-setFieldValue2=123456
-
-[object,1,1]
-
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=${NameAlt}
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=SomethingElse
-
-old exportConfig.ini as example
-[WeightGroup]
-file=WG${Reference}.txt
-1=Reference
-2=LocalReference
-
-[Weight]
-file=WG${Reference}.txt
-1=Reference
-2=Count
-3=WeightNet
-4=Sale
-
-[WeightGroupTotal]
-file=WG${Reference}.txt
-1=UOID
-2=LineIdentifier
-3=WeightGroup
-4=WeightObtained
-5=CountObtained
-
-[Company]
-file=Company${Reference}.txt
-1=Name
-2=NameAlt
-3=PersonName
-4=TraceId
-5=Phone
-{private}
\ No newline at end of file
Deleted: trunk/equanda-tool/src/site/wiki/fscript.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/fscript.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/fscript.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,6 +0,0 @@
-h1. Fscript
-
-FScript is a very simple scripting language which is available on sourceforge,
-see http://fscript.sourceforge.net/index.html.
-
-~~Placeholder, should include details of all FScript related classes in util~~
Deleted: trunk/equanda-tool/src/site/wiki/import.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/import.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/import.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,150 +0,0 @@
-h1. Import tool
-
-This is a tool which can be used to easy importing data into a equanda application.
-The program scans a directory for import files to appear (very configurable) and imports them using [ImportServlet].
-There is special handling to allow errors to be caught and corrected.
-Alternatively, this program can also execute scripts which can be used to build the import file at runtime
-(thus allowing a direct link with JDBC data sources etc).
-This option is typically used to synchronize with another application
-(one-way synchronization, use the [Export] tool for the other direction).
-
-
-h2. Usage
-
-The import tool can either scan directories for import files to appear,
-or can run scripts which produce the import file (probably by reading data from a proprietary system).
-
-The file format for importing is [ImportFileFormat].
-
-
-h2. General configuration
-
-The tool (class org.equanda.tool.ymport.ImportClient) accepts one optional parameter,
-the name of an .ini file which is used for the configuration.
-If no parameter is given, the program tries to open "import.ini".
-
-The .ini file has the following format
-
-{code}
- [general]
- scanPeriod=30
- outputExtension=err
- window=display
- search=local
- importURL=http://192.168.0.252:8080/admin/import/import
-
- [mail]
- server=mail.paragon-software.ro
- port=110
- use...@pa...
- password=testtest
- directory=/data/
- acc...@pa...;kun...@ya...
- connectionTimeout=30
- socketTimeout=30
-
- [scan]
- dir1=c:\import
- input1=*.txt
- charset1=ISO-8859-1
- dir2=g:\import
- input2=*.import
- script2=import.isc
-
- [script]
- debug=false
- script1=weight.isc
- script2=article.isc
-
- [database]
- name1=vlees
- driver1=sun.jdbc.odbc.JdbcOdbcDriver
- location1=jdbc:odbc:CodeBase Datasource;database=C:\dbf\
- user1=
- password1=
-{code}
-
-This has the following meaning
-
-h3. general section
-- scanPeriod : time in seconds between attempts to pick up files to import or attempt to run the import scripts. Defaults to 60s.
-- outputExtension : extension for output (error) files. The extension of the input file is replaced, or the extension is added if the input file had no extension.
-- window : indicates whether a window needs to be displayed or not (values "display" or "hidden").
-- search : indicates whether the program should only scan in the scan directories, or also in subsidrectories. Possible values are: "deep" and "local".
-
-h3. mail section
-This allows mails to be read which can then be imported. The attachments will be placed in the chosen location for further processing (scanning). Only mails from the list of allowed senders are accepted (slight security measure as anyboy could send mails to the designated mailbox.
- {warning}
- Accepting data to be imported from mails is always a security risc as sender addresses are very easy to forge. Once somebody knows the mail address and sender address top use, they can inject and overwrite anything in the database.
- {warning}
-- _server_ : mail server to get mails from
-- _user_ : user to get mails for
-- _password_ : password for the user
-- _accept_ : senders for which the emails are accepted
-- _directory_ : location where the attachments need to be saved
-- _connectionTimeout_, _socketTimeout_ : timeouts for connection, in seconds, default is 30
-
-h3. scan section
-- This can contain the directories which have to be scanned for input files (scanX with X a number) and a regular expression (inputX) indicating the files which need to be imported (default is *), for the directory with the same number
-- It may also contain the charset to be used for the files from the matching directory. When charset is not set, the system default is used.
-- For each level, an import script file can be specified. The "build(string filename)" function is called in this script to allow conversion from other types of files.
-
-h3. script section
-- debug : can be "true" or "false". Normally the data which is built is immediately sent to the import servlet. However, when debug is "true", then the data is not imported but simply written to an output file in the current directory.
-- scriptX (with X a number) : name of a script file which builds the data to be imported.
-
-- database section
-- As with script and scan, the names need to end with a number to indicate what belongs together. Counting starts at one and should be continuous. The database section is only relevant for import scripts.
-- name : name for the database, as used in "Dbset(var[,name])"
-- driver : JDBC driver class
-- location : database url for connection with the database
-- user, password : username and password for the connection
-
-h3. config section
-- In the config section extra kay/value pairs can be put which can be retrieved in the scripts using "config(key)".
-
-
-h2. Program functioning
-
-The import itself starts by computing the name of the error file
-(the extension (everything after the last dot, if any) is replaced by "outputExtension").
-If the error file exists, the import file is skipped.
-It then tries to open the import file in read/write mode.
-If that fails, the file is skipped (it will be picked up again in the next scan).
-When the file is opened, the contents is sent to the import servlet.
-If the import was successful, then the input file is deleted.
-If the import failed, the return message from the servlet is written in the error file.
-
-
-h2. Script handling
-
-The program accepts [FScript|fscript.html] scripts to build the data to be imported.
-The script should have the following structure :
-
-{code}
-func build()
- # this functions is called to builds the import file
- # You have the following commands for this
- # table(selectorName, commaSeperatedFields)
- # field(data) : add a field value
- # line([string]) : next line or add line with given text
- # quote(string) : quote a string using single quotes, doubles the single quotes in the string
- # import() : import the current data, returns whther the import was succesful
- # (allows forcing import halfway through the script)
- # if references need storing,
- # use the "list" variable (of type "List")
-endfunc
-
-func onSuccess()
- # this function is called when the import was succesful
- # can be used to mark te data as imported
- # (again, referencing the contents of "list")
-endfunc
-
-func onError(string error)
- # this function is called if the import failed
- # the "list" data is still available
-endfunc
-{code}
-
-The [FScript|fscript.html] extensions from the util module are available.
Modified: trunk/equanda-tool/src/site/wiki/index.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/index.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/index.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,10 +1,7 @@
-h1. equanda-tool module
+h1. equanda-tool
-This module contains some tools which are useful for equanda generated applications.
-The following tools currently exist.
+The equanda-tool module contains some tools which are very handy in combinations with equanda applications.
-- [Import|import.html] : tool to import data based on a text file or a script.
-- [Export|export.html] : tool to export data into a text file or into a script.
-- [Print|print.html] : tool for automatically printing (scheduling) reports.
-- [Combined|tool.html] : tool for combining the tools above.
-- [Translations|translations.html] : tool for editing and manaing the translations file.
+For more information about the the contents of this module can be found on the [project site|http://equanda.org/].
+
+equanda is a tool which helps you to build enterprise grade (JEE based) applications with minimal effort. Through code generation, a useful and functional base skeleton is created from the domain model. This application can be customized and the customizations remain active when the domain model changes and the skeleton is regenerated. This way, the cost of maintaining an evolving application is reduced by eliminating repetitive coding and assuring a consistent code base and user interface.
Deleted: trunk/equanda-tool/src/site/wiki/print.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/print.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/print.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,25 +0,0 @@
-h1. Print tool
-
-.....
-
-{code}
-[general]
-title=Print
-usePrefix=false
-window=display
-;window=hidden
-login=local
-password=local
-scanPeriod=10
-debug=true
-server=localhost
-port=8080
-protocol=http
-alertProxyName=org.ictrace.client.equandaAlertProxy
-
-[settings]
-reportURL=report/report
-
-[scan]
-class1=org.ictrace.tool.report.ReportProviderImpl
-{code}
\ No newline at end of file
Deleted: trunk/equanda-tool/src/site/wiki/tool.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/tool.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/tool.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,107 +0,0 @@
-h1. Combined tool
-
-You can also run all the tools in one go. You then have one combined configuration file which configure the settings for each of the individual tools.
-
-{code}
-;;;;;;;;;;;;;;;;;;;;;;;;;; General Section ;;;;;;;;;;;;;;;;;;;;;;
-[general]
-title=Export-Import-Print
-usePrefix=true
-window=display
-;window=hidden
-login=local
-password=local
-scanPeriod=10
-debug=true
-server=localhost
-port=8080
-protocol=http
-alertProxyName=org.ictrace.client.equandaAlertProxy
-
-[database]
-name1=IC-TRACE.FDB
-;driver1=sun.jdbc.odbc.JdbcOdbcDriver
-;location1=jdbc:odbc:CodeBase Datasource;database=c:\data\db
-driver1=org.firebirdsql.jdbc.FBDriver
-location1=jdbc:firebirdsql:localhost/3050:C:\data\ic-trace\IC-TRACE.FDB
-user1=sysdba
-password1=masterkey
-
-[config]
-AankoopbonPrefix=AANK-
-BestelbonPrefix=VERK-
-KlantPrefix=K-
-LeverancierPrefix=L-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;; Print Section ;;;;;;;;;;;;;;;;;;;;;;;;
-[print,settings]
-scanPeriod=50
-reportURL=report/report
-
-[print,scan]
-class1=org.ictrace.tool.report.ReportProviderImpl
-
-;;;;;;;;;;;;;;;;;;;;;;;;;; Import Section ;;;;;;;;;;;;;;;;;;;;;;;
-[import,settings]
-scanPeriod=40
-outputExtension=err
-search=deep
-;search=local
-importURL=import/import
-
-[import,scan]
-dir1=/import
-input1=*.*
-charset1=ISO-8859-1
-;dir2=c:\ic-trace\
-;input2=*.import
-
-[import,mail]
-server=mail.paragon-software.ro
-port=110
-use...@pa...
-password=testtest
-directory=/data/
-acc...@pa...;kun...@ya...
-connectionTimeout=30
-socketTimeout=30
-
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;; Export Section ;;;;;;;;;;;;;;;;;;;;;;;
-[export,settings]
-script1=company.isc
-scanPeriod=30
-server=127.0.0.1
-exportDirectory=c:\
-exportInfo=org.ictrace.tool.export.maps.ExportMap
-exportIni=exportConfig.ini
-
-[export,object,1]
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=testCompany
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=Something
-
-setField2=Phone
-setFieldType2=String
-setFieldValue2=123456
-
-[export,object,1,1]
-selectorJndi=IC-trace/CompanySelector
-selectorName=org.ictrace.client.CompanySelector
-
-selectorName=Name
-selectorParamType1=String
-selectorParamValue1=${NameAlt}
-
-setField1=PersonName
-setFieldType1=String
-setFieldValue1=SomethingElse
-{code}
\ No newline at end of file
Deleted: trunk/equanda-tool/src/site/wiki/translations.wiki
===================================================================
--- trunk/equanda-tool/src/site/wiki/translations.wiki 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/equanda-tool/src/site/wiki/translations.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -1,27 +0,0 @@
-h1. Translations editor
-
-Though this tool is normally run using the maven plugin (which gets all the configuration from the pom), it is also possible to use the translations tool directly. In that case, you have to pass the ini file which contains the settngs.
-
-{code}
-[config]
-# the file to be edited
-target-file=/java/equanda/test/src/etc/site_tapestry/site.war/translations.txt
-# the lack of labels will be checked (and the table lines coloured) only for these languages
-verify-languages=en;fr;nl;ro
-# should the menus for importing from db description be available?
-show-db=true
-
-[gui]
-width=1000
-height=600
-
-# settings for the import of keys from xml descriptions of the database
-[equanda]
-appdir=/java/equanda/test/src/equanda/xejb
-definition=dm.xml
-import-db-keys-only=false
-infrastructure=true
-context=equanda-table
-# there may be some extra keys in the equanda-table context, not representing db items. Don't want to remove these when checking if items are still in the database
-key-prefixes-to-keep=
-{code}
\ No newline at end of file
Modified: trunk/src/site/site.xml
===================================================================
--- trunk/src/site/site.xml 2008-12-03 11:44:47 UTC (rev 887)
+++ trunk/src/site/site.xml 2008-12-03 11:49:04 UTC (rev 888)
@@ -64,6 +64,14 @@
<item name="Import" href="plugin/import.html"/>
</menu>
+ <menu name="tool">
+ <item name="Import" href="tool/import.html"/>
+ <item name="Export" href="tool/export.html"/>
+ <item name="Print" href="tool/print.html"/>
+ <item name="Combined" href="tool/tool.html"/>
+ <item name="Translations" href="tool/translations.html"/>
+ </menu>
+
<menu ref="modules" />
<menu ref="reports" />
</body>
Copied: trunk/src/site/wiki/tool/ExportFileFormat.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/ExportFileFormat.wiki)
===================================================================
--- trunk/src/site/wiki/tool/ExportFileFormat.wiki (rev 0)
+++ trunk/src/site/wiki/tool/ExportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,39 @@
+h1. File format for export description
+
+This file format is used by the export tool and export classes.
+It allows you to describe which fields need to be exported from which table,
+and the order of the fields and the export filename.
+
+The file has the shape and form of a (case sensitive) .ini file.
+
+The sections in the file indicate the tables which can be exported.
+
+For each section you can specify the following :
+
+- file : name of the file in which the exported object is saved.
+- suppressHeaderLines : when "true" the header lines is not saved in the file.
+- suppressDuplicateLines : when "true" a line is only appended in the file if it was not yet present.
+- _number_ : field which needs exporting, count starts from 1. Needs to be consecutive.
+
+For the filename, you can use a field from the reference object in the filename.
+This is done using the ${_fieldname_} syntax.
+
+For the fields, a special syntax "FieldName$expression" can be used. In that case the given fieldname if used as field name, and the [FScript|fscript.html] expression is used to calculate the field value. If the special fieldname "NOQUOTES" is used, then the result string is not processed (quoted) before exporting. This can be useful when calculating the entire export line.
+
+Example
+{code}
+[WeightGroup]
+file=WG${Reference}.txt
+1=Reference
+2=LocalReference
+3=Client
+4=Date
+5=Today$datesys()
+
+[Weight]
+file=WG${Reference}.txt
+1=Reference
+2=Count
+3=WeightNet
+4=Sale
+{code}
Copied: trunk/src/site/wiki/tool/ImportFileFormat.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/ImportFileFormat.wiki)
===================================================================
--- trunk/src/site/wiki/tool/ImportFileFormat.wiki (rev 0)
+++ trunk/src/site/wiki/tool/ImportFileFormat.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,124 @@
+h1. Import file format
+
+This document describes the file format to import data into equanda applications.
+This file format applies both to the [ImportServlet] and to the [Import] tool.
+
+The equanda import file format is roughly based on CSV files.
+However, many extensions have been provided to make the import file self-contained,
+provide for powerful features like multiple fields and links,
+to allow data for different tables to be sent in one connection
+and that the table and field names can be specified.
+
+h2. General rules
+
+- Empty lines are discarded
+- Lines starting with a semicolon or hash are comments and are also discarded
+- Lines starting with a colon are directives.
+- All other lines are considered as data
+
+h2. File structure
+
+- The file can contain zero or more data blocks.
+- A data block starts with a table directive, followed by data lines
+
+h2. Table directives
+
+- A table directive starts with ":table:" followed by the (root) table name (possibly surrounded by whitespace, and optionally including a selector), followed by another semicolon and the list of field names which are included in the data lines.
+- The field names are separated by a comma.
+- Apart from the real field names, "UOID" may be used to indicate the uoid, and "equandaType" can be used to indicate the record type.
+- Whitespace around the fieldname is discarded.
+- Field names are case sensitive (exactly the same as the definition in equanda).
+- For linked fields, the field name has to either include the selector to select the linked record(s) or a list of fields (between square brackets) or both. When linking multiple fields which are specified using fields, the field names should be in double square brackets ("[[" and "]]", with no space in between).
+- Only root table names can be used. You have to use equandaType to distinguish between variants of a root type.
+
+Some example table directives :
+{code}
+:table:Company:equandaType,Reference,Name
+:table:Company/Company: Reference, Name, PersonName, Address, Zip, City, Country, VAT, Customer, Supplier
+:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo/EECNumber
+:table:Company/TraceId: equandaType, Reference, TraceId, Name, MeatCompanyInfo[Activity,EECNumber,OfficialRegistrationNumber]
+{code}
+
+_NOTE_ for the selectors, you can only use those selectors which select only fields from the table itself.
+If the selector includes referenced fields from other tables, it cannot be used to select the records in the import file.
+
+h2. Data line structure
+
+- No data line may occur in the file before the first table directive.
+- Field values are comma separated
+- String field values are enclosed in double quotes. Any double quotes inside the field value have to be doubled.
+- When a string value is not quoted, all whitespace in it is discarded.
+- Inside a quoted string, quotes, newlines, carriage returns and tabs can be indicated with a backslash followed by a double quote, 'n', 'r', 't' respectively. Any backslashes which should be part of the actual value need to be doubled.
+- Numeric fields are included with a dot as decimal point.
+- Whitespace around the field values is discarded
+- Null can be represented by "null" (without quotes). To use the string value "null", the null has to be quoted.
+- Fields may be skipped (that is no value or just whitespace, but with sperating comma), in which case this is interpreted as if the field was not declared in the table directive. If no field values follow, then the commas may also be discarded.
+- Multiple fields which have more than one value need to have their values enclosed in square brackets (same rules for quoting, whitespace etc). Eg '["val", "bla" , "alb" ]'
+- Linked fields are indicated by the selector parameters (if more than one parameter, then the different parameters have to be in square brackets again).
+
+
+h2. Import / Update
+
+The import servlet / tool can be used both for importing and for updating data.
+
+When a record is specified, equanda uses the specified selector to check whether the record already exists.
+If it does, then the fields are updated, otherwise a new record is inserted.
+
+When no selector is specified, equanda tries to see whether the data line included a unique field.
+If it does, this field is used to check for existence of the record.
+When more than one unique field is included,
+it is not defined which field will be used first to try to select a matching record.
+
+
+h2. Linked records
+
+The data line can include linked records either using a selector, or by specifying the actual value.
+
+When using a selector name, the value is the list of parameters for the selector.
+If there is more than one parameter then this list needs to be enclosed in square brackets.
+If the field is single linked, and the selector returns more than one record, then the import fails.
+
+Alternatively, you may use a field list (optionally combined with a selector).
+This will create or update the record and link it.
+
+
+h2. Examples
+
+A couple of simple examples for some fictive tables (definition not included and may be different for each example).
+
+{code}
+:table: JustAString : Value
+Simple test
+{code}
+
+This will include the string "Simpletest" without space, as spaces are discarded when the value is not quoted.
+
+{code}
+:table:Address: Reference, Street, Location
+"addr1", "Mechelbaan", "Putte"
+:table:Person: Name, Address/Reference
+"Joachim", "addr1"
+{code}
+
+Simple example of a linked record.
+
+{code}
+:table:Person: Name, Address[Street, Location]
+"Joachim", ["Mechelbaan", "Putte"]
+{code}
+
+Simple example of a multiple linked record.
+
+{code}
+:table:Person: Name, Address[[Street, Location]]
+"Wim", [ ["Kerklaan", "Putte"], ["Heistraat", "Bree"] ]
+{code}
+
+Use of the automatic creation of linked records.
+
+{code}
+:table:Person: Name, Address[ Street, Location/Zip[Zip,City] ]
+"Joachim", [ "Mechelbaan", [ "2580", "Putte" ] ]
+{code}
+
+Advanced linked record with nesting and combined selector and fieldlist for "Location".
Copied: trunk/src/site/wiki/tool/ImportServlet.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/ImportServlet.wiki)
===================================================================
--- trunk/src/site/wiki/tool/ImportServlet.wiki (rev 0)
+++ trunk/src/site/wiki/tool/ImportServlet.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,74 @@
+h1. Import servlet
+
+The actual data can be sent to the equanda generated application using a servlet. Alternatively a web page can be provided (and by default it is), where you can cut and past the import file.
+
+The servlet can be called with code like the following :
+
+{code}
+URLConnection cnx=url.openConnection();
+
+// Set connection parameters
+cnx.setDoInput(true);
+cnx.setDoOutput(true);
+cnx.setUseCaches(false);
+cnx.setRequestProperty("Content-Type", "text/plain");
+
+// write the request
+Writer out=new BufferedWriter(new OutputStreamWriter(cnx.getOutputStream()));
+// write the data
+out.flush();
+out.close();
+
+// now read the response
+BufferedInputStream in=new BufferedInputStream(cnx.getInputStream());
+// handle the reply
+in.close();
+{code}
+
+If the data file starts with "data=� then this is removed from the data (this is done to allow the data to come from a form).
+
+The servlet send a short replies with "OK" if the file was processed properly.
+If there was a problem during the import, the reply is "FAILED " followed by a human readable reason of failure.
+
+If your servlet is secured (it should be), then it is best to use the org.equanda.client.ImportClient class.
+This will handle the login both in case of BASIC and FORM based authentication.
+
+The actual servlet can be generated with a ant task like the following :
+
+{code}
+ <equanda
+ appdir="${rootdir}/build/om"
+ definition="dm.xml"
+ outputdir="${build.generate.dir}"
+ package="test.ymport"
+ template="import"
+ generateAll="${equanda.generate-all}">
+ <config name="extra">
+ <attribute name="ejb-package" value="test"/>
+ </config>
+ </equanda>
+{code}
+
+Note that "import� is a reserved word in Java and thus cannot be used as package name.
+
+To use the servlet, a definition like the example which follows has to be added to your web.xml file in your web archive.
+
+{code}
+ <servlet>
+ <servlet-name>Import</servlet-name>
+ <servlet-class>org.equanda.ymport.Servlet</servlet-class>
+ <init-param>
+ <param-name>DatabaseMap</param-name>
+ <param-value>test.ymport.DatabaseMap</param-value>
+ </init-param>
+ </servlet>
+{code}
+
+Obviously, this servlet also has to be mapped to a URL, but that�s all there is to it.
+
+
+h2. Charset issues
+
+On the servlet connection, it is possible to indicate the character encoding which is used in the communication.
+This can be modified as needed on the client side to match the charset for the text file.
+
Copied: trunk/src/site/wiki/tool/export.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/export.wiki)
===================================================================
--- trunk/src/site/wiki/tool/export.wiki (rev 0)
+++ trunk/src/site/wiki/tool/export.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,239 @@
+h1. Export tool
+
+The export tool allows you to export data from a equanda generated application to text (ascii).
+Alternatively, the data which is exported can be processed using a script which then handles it further.
+This option is typically used to synchronize with another application
+(one-way synchronization, use the [Import] tool for the other direction).
+
+h2. General configuration
+
+The export program expects the name of the configuration .ini file as parameter.
+If this parameter is not given, a file called "export.ini" in the current directory is used.
+
+The export can be configured using a .ini file with the following base format :
+
+{code}
+[general]
+scanPeriod=30
+
+exportDirectory=c:\export
+exportInfo=exportInfo=org.ictrace.demo.maps.ExportMap
+exportIni=exportConfig.ini
+
+window=display
+
+server=192.168.0.252
+login=myname
+password=mypass
+{code}
+
+- scanPeriod : time in seconds between attempts to pick up files to import, default 120
+- exportDirectory : directory where the export files need to be written
+- window : indicates whether a window needs to be displayed or not (values "display" or "hidden")
+- exportInfo : full class name of the ExportInfo map needed for export
+- exportIni : defines the [ExportFileFormat] which should be used
+- server : name or ip address of server
+- login : login to connect to the equanda application
+- password : password to connect to the equanda application
+
+
+h2. What to export
+
+The .ini file also defines what to export.
+This is done by specifying the objects which need to be selected.
+For each object selected, you can have selections of secondary (related) objects which are also exported.
+After the export, the tool can automatically update one of the fields to mark that the export was succesful.
+
+For example
+{code}
+[object,1]
+
+selectorJndi=IC-trace/WeightGroupSelector
+selectorName=org.ictrace.client.WeightGroupSelector
+
+selectorName=ImportStatus
+selectorParamType1=String
+selectorParamValue1=Y
+
+setField1=ERPImportStatus
+setFieldType1=String
+setFieldValue1=D
+
+script=WeightGroup.esc
+
+[object,1,1]
+
+selectorJndi=IC-trace/WeightGroupTotalSelector
+selectorName=org.ictrace.client.WeightGroupTotalSelector
+
+selectorName=WeightGroup
+selectorParamType1=String
+selectorParamValue1=${Reference}
+
+script=WeightGroup.esc
+{code}
+
+This excerpt shows all the options.
+The first (and only) primary selector is indicated in the [object,1] section.
+The secondary selections for these are in the [object,1,X] sections, with "X" a number from one upwards.
+
+For each section, you can specify the JNDI name and classname for the bean to use.
+The classname should be without trailing "EJB" or "EJBHome".
+You can also specify the selector to be used, and the type and value for each paramater.
+For secondary objects, fields from the primary object can be used to as parameter value using the "${FieldName}" syntax.
+
+For each object, you can also optionally spacify fields which need to be set when the import was successful.
+You can also choose whether the export is to a file,
+or whether a user defined [FScript|fscript.html] script should handle the export (in which case the file is not generated).
+
+*Key Set Details*
+
+- selectorJndi : JNDI name whether the object which is selected can be found, normally a prefix followed by the table name.
+- selectorName : full name of the selector class (without trailing "EJB")
+
+- selectorName : the name of the selector to be used
+- selectorParamTypeX : type of the selector's Xth parameter, can be _String_, _int_, _double_, _boolean_, _Timestamp_, _Date_
+- selectorParamValueX : value of the selector's Xth parameter
+
+- setFieldX : name of the field to be set (after the object is exported)
+- setFieldTypeX : type of the field to be set, same choices as selectorParamType
+- setFieldValue1X : value for the field to be set
+
+- script : name of the script which is used to export the object
+
+_NOTE:_ All keys are _case sensitive_ !!!
+
+
+h2. Using scripts in export
+
+Like in [Import|import.html] you can also use scripts to export the data,
+possibly including the data directly into a different database.
+
+The program accepts [FScript|fscript.html] scripts to build the data to be exported.
+The script should have the following structure (example with some debug info) :
+
+{code}
+func primary(object prim)
+ debug("primary called for "+prim)
+ return TRUE
+endfunc
+
+func primary_done(object prim)
+ debug("primary_done called for "+prim)
+ display("importing "+prim)
+ return TRUE
+endfunc
+
+func secondary(object prim, object sec)
+ debug("secondary called for "+prim+":"+sec)
+ return FALSE
+endfunc{code}
+
+The [FScript|fscript.html] extensions from the util module are available.
+
+The functions should return "TRUE" or "FALSE" depending on whether the export was successful or not.
+If the export was not successful, then the variables which need to be set are not modified.
+
+When you return "FALSE" for the primary object, then the secondary objects are not exported.
+When one of the secondary objects returned "FALSE", then the fields for the primary object are not set.
+
+If the primary and all the secondary objects have been successfully imported,
+then the "primary_done" function is called. This can be used for cleanup, or to mark that the export has finished.
+
+{private}
+old export.ini as example :
+[general]
+title=Export
+usePrefix=false
+window=display
+;window=hidden
+login=local
+password=local
+scanPeriod=10
+debug=true
+server=localhost
+port=8080
+protocol=http
+alertProxyName=org.ictrace.client.equandaAlertProxy
+
+[database]
+name1=IC-TRACE.FDB
+;driver1=sun.jdbc.odbc.JdbcOdbcDriver
+;location1=jdbc:odbc:CodeBase Datasource;database=c:\data\db
+driver1=org.firebirdsql.jdbc.FBDriver
+location1=jdbc:firebirdsql:localhost/3050:C:\data\ic-trace\IC-TRACE.FDB
+user1=sysdba
+password1=masterkey
+
+[config]
+AankoopbonPrefix=AANK-
+BestelbonPrefix=VERK-
+KlantPrefix=K-
+LeverancierPrefix=L-
+
+[settings]
+script1=company.isc
+server=127.0.0.1
+exportDirectory=c:\
+exportInfo=org.ictrace.tool.export.maps.ExportMap
+exportIni=exportConfig.ini
+
+[object,1]
+
+selectorJndi=IC-trace/CompanySelector
+selectorName=org.ictrace.client.CompanySelector
+
+selectorName=Name
+selectorParamType1=String
+selectorParamValue1=testCompany
+
+setField1=PersonName
+setFieldType1=String
+setFieldValue1=Something
+
+setField2=Phone
+setFieldType2=String
+setFieldValue2=123456
+
+[object,1,1]
+
+selectorJndi=IC-trace/CompanySelector
+selectorName=org.ictrace.client.CompanySelector
+
+selectorName=Name
+selectorParamType1=String
+selectorParamValue1=${NameAlt}
+
+setField1=PersonName
+setFieldType1=String
+setFieldValue1=SomethingElse
+
+old exportConfig.ini as example
+[WeightGroup]
+file=WG${Reference}.txt
+1=Reference
+2=LocalReference
+
+[Weight]
+file=WG${Reference}.txt
+1=Reference
+2=Count
+3=WeightNet
+4=Sale
+
+[WeightGroupTotal]
+file=WG${Reference}.txt
+1=UOID
+2=LineIdentifier
+3=WeightGroup
+4=WeightObtained
+5=CountObtained
+
+[Company]
+file=Company${Reference}.txt
+1=Name
+2=NameAlt
+3=PersonName
+4=TraceId
+5=Phone
+{private}
\ No newline at end of file
Copied: trunk/src/site/wiki/tool/fscript.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/fscript.wiki)
===================================================================
--- trunk/src/site/wiki/tool/fscript.wiki (rev 0)
+++ trunk/src/site/wiki/tool/fscript.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,6 @@
+h1. Fscript
+
+FScript is a very simple scripting language which is available on sourceforge,
+see http://fscript.sourceforge.net/index.html.
+
+~~Placeholder, should include details of all FScript related classes in util~~
Copied: trunk/src/site/wiki/tool/import.wiki (from rev 883, trunk/equanda-tool/src/site/wiki/import.wiki)
===================================================================
--- trunk/src/site/wiki/tool/import.wiki (rev 0)
+++ trunk/src/site/wiki/tool/import.wiki 2008-12-03 11:49:04 UTC (rev 888)
@@ -0,0 +1,150 @@
+h1. Import tool
+
+This is a tool which can be used to easy importing data into a equanda application.
+The program scans a directory for import files to appear (very configurable) and imports them using [ImportServlet].
+There is special handling to allow errors to be caught and corrected.
+Alternatively, this program can also execute scripts which can be used to build the import file at runtime
+(thus allowing a direct link with JDBC data sources etc).
+This option is typically used to synchronize with another application
+(one-way synchronization, use the [Export] tool for the other direction).
+
+
+h2. Usage
+
+The import tool can either scan directories for import files to appear,
+or can run scripts which produce the import file (probably by reading data from a proprietary system).
+
+The file format for importing is [ImportFileFormat].
+
+
+h2. General configuration
+
+The tool (class org.equanda.tool.ymport.ImportClient) accepts one optional parameter,
+the name of an .ini file which is used for the configuration.
+If no parameter is given, the program tries to open "import.ini".
+
+The .ini file has the following format
+
+{code}
+ [general]
+ scanPeriod=30
+ outputExtension=err
+ window=display
+ search=local
+ importURL=http://192.168.0.252:8080/admin/import/import
+
+ [mail]
+ server=mail.paragon-software.ro
+ port=110
+ use...@pa...
+ password=testtest
+ directory=/data/
+ acc...@pa...;kun...@ya...
+ connectionTimeout=30
+ socketTimeout=30
+
+ [scan]
+ dir1=c:\import
+ input1=*.txt
+ charset1=ISO-8859-1
+ dir2=g:\import
+ input2=*.import
+ script2=import.isc
+
+ [script]
+ debug=false
+ script1=weight.isc
+ script2=article.isc
+
+ [database]
+ name1=vlees
+ driver1=sun.jdbc.odbc.JdbcOdbcDriver
+ location1=jdbc:odbc:CodeBase Datasource;database=C:\dbf\
+ user1=
+ password1=
+{code}
+
+This has the following meaning
+
+h3. general section
+- scanPeriod : time in seconds between attempts to pick up files to import or attempt to run the import scripts. Defaults to 60s.
+- outputExtension : extension for output (error) files. The extension of the input file is replaced, or the extension is added if the input file had no extension.
+- window : indicates whether a window needs to be displayed or not (values "display" or "hidden").
+- search : indicates whether the program should only scan in the scan directories, or also in subsidrectories. Possible values are: "deep" and "local".
+
+h3. mail section
+This allows mails to be read which can then be imported. The attachments will be placed in the chosen location for further processing (scanning). Only mails from the list of allowed senders are accepted (slight security measure as anyboy could send mails to the designated mailbox.
+ {warning}
+ Accepting data to be imported from mails is always a security risc as sender addresses are very easy to forge. Once somebody knows the mail address and sender address top use, they can inject and overwrite anything in the database.
+ {warning}
+- _server_ : mail server to get mails from
+- _user_ : user to get mails for
+- _password_ : password for the user
+- _accept_ : senders for which the emails are accepted
+- _directory_ : location where the attachments need to be saved
+- _connectionTimeout_, _socketTimeout_ : timeouts for connection, in seconds, default is 30
+
+h3. scan section
+- This can contain the directories which have to be scanned for input files (scanX with X a number) and a regular expression (inputX) indicating the files which need to be imported (default is *), for the directory with the same number
+- It may also contain the charset to be used for the files from the matching directory. When charset is not set, the system default is used.
+- For each level, an import script file can be specified. The "build(string filename)" function is called in this script to allow conversion from other types of files.
+
+h3. script section
+- debug : can be "true" or "false". Normally the data which is built is immediately sent to the import servlet. However, when debug is "true", then the data is not imported but simply written to an output file in the current directory.
+- scriptX (with X a number) : name of a script file which builds the data to be imported.
+
+- database section
+- As with script and scan, the names need to end with a number to indicate what belongs together. Counting starts at one and should be continuous. The database section is only relevant for import scripts.
+- name : name for the database, as used in "Dbset(var[,name])"
+- driver : JDBC driver class
+- location : database url for connection with the database
+- user, password : username and password for the connection
+
+h3. config section
+- In the config section extra kay/value pairs can be put which can be retrieved in the scripts using "config(key)".
+
+
+h2. Program functioning
+
+The import itself starts by computing the name of the error file
+(the extension (everything after the last dot, if any) is replaced by "outputExtension").
+If the error file exists, the import file is skipped.
+It then tries to open the import file in read/write mode.
+If that fails, the file is skipped (it will be picked up again in the next scan).
+When the file is opened, the contents is sent to the import servlet.
+If the import was successful, then the input file is deleted.
+If the import failed, the return message from the servlet is written in the error file.
+
+
+h2. Script handling
+
+The program accepts [FScript|fscript.html] scripts to build the data to be imported.
+The script should have the following structure :
+
+{code}
+func build()
+ # this functions is called to builds the import file
+ # You have the following commands for this
+ # table(selectorName, commaSeperatedFields)
+ # field(data) : add a field value
+ # line([string]) : next line or add line with given text
+ # quote(string) : quote a string using single quotes, doubles the single quotes in the string
+ # import() : import the current data, returns whther the import was succesful
+ # (allows forcing import halfway through th...
[truncated message content] |