Examples:document mapping.ini: Unterschied zwischen den Versionen
| Zeile 36: | Zeile 36: | ||
== [REFERENCEFIELDS] == | == [REFERENCEFIELDS] == | ||
| − | + | Set the refference field in Corsa. Therefore an adjustment from CSV Data to Corsa required data is needed. | |
| − | ;bouwdsr = string map {Aanvraag "01 - Aanvraag" Vergunning "02 - Vergunning" Tekening "03 - Tekening" Overige "04 - Overig"} %Bouw document soort% | + | ;bouwdsr = string map {Aanvraag "01 - Aanvraag" Vergunning "02 - Vergunning" Tekening "03 - Tekening" Overige "04 - Overig"} %Bouw document soort% |
| − | + | Set the Unique ID and an Import Type Version | |
| − | ;dUnique = Return %_TMP_UniqueID% | + | ;dUnique = Return %_TMP_UniqueID% |
| − | + | If you have the document id in your CSV you can generate the sha directly here | |
| − | dUnique = ::sha2::sha256 -hex -filename %OrgFile% | + | dUnique = ::sha2::sha256 -hex -filename %OrgFile% |
| − | + | Import a Version of your configuration so you are able to adjust documents later easily by finding the Version | |
| − | ;dVersion = Return "Mappingversion 1.0" | + | ;dVersion = Return "Mappingversion 1.0" |
| − | |||
== [VARTAB] == | == [VARTAB] == | ||
Version vom 27. Februar 2019, 10:20 Uhr
document_mapping.ini
[GLOBAL]
Pay attention that these fields are available in all sections. Technically The reading process is 1. System fields 2. Reference fields and then global
- OBJECTID = Return %_TMP_OBJECTID%
OBJECTID = %Document Id% OBJECTKIND = Return "Invoice"
Actually supported: S, D, V, C, E, P
- OBJECTTYPE = Return S
OBJECTKIND = Return %Stuksoort code%
[SYSTEMFIELDS]
Generate a Unique ID (SHA256) for the document
- _TMP_PROT = LogMessage "Creating Unique ID for [file join \"D
- /stratoz/data/\" %OrgFile%]"
- _TMP_UniqueID =
- :sha2::sha256 -hex -filename [file join "D:/stratoz/data/" %OrgFile%]
In most cases you will have the full path to the import file in the csv. So simply use this.
_TMP_PROT = LogMessage "Creating Unique ID for %OrgFile%" _TMP_UniqueID = ::sha2::sha256 -hex -filename %OrgFile%
Create the document if not present (based on the unique id which will be checked against Corsa) yet, otherways get a new doc id from Corsa WebserviceCall ::CreateObject::DocumentByQuery <ObjectKind> <ObjectId> <Query> <SystemFieldsList> <ReferenceFieldsList>
- _TMP_OBJECTID = WebserviceCall
- :CreateObject::DocumentByQuery %Stuksoort code% *DUMMY* [list [list qrtReference dUnique qcAnd qoEqual %_TMP_UniqueID%]] [] [list [list dUnique %_TMP_UniqueID%]]
You will need this if you want to delete the newly created object when an error occours during the import process
- _TMP_objectCreated = CheckDefinition $
- :mapping::objectCreated
Setting the system fields
poststuk.reg_datum = Return %Registratie datum% poststuk.dat_poststuk = Return %Registratie datum% poststuk.onderwerp = Return %Onderwerp% obj_doc.naam = Return %Bestandnaam% poststuk.afgehandeld = Return %Afg%
System fields which are not able to import within the Webservice can be found here
[REFERENCEFIELDS]
Set the refference field in Corsa. Therefore an adjustment from CSV Data to Corsa required data is needed.
;bouwdsr = string map {Aanvraag "01 - Aanvraag" Vergunning "02 - Vergunning" Tekening "03 - Tekening" Overige "04 - Overig"} %Bouw document soort%
Set the Unique ID and an Import Type Version
;dUnique = Return %_TMP_UniqueID%
If you have the document id in your CSV you can generate the sha directly here
dUnique = ::sha2::sha256 -hex -filename %OrgFile%
Import a Version of your configuration so you are able to adjust documents later easily by finding the Version
;dVersion = Return "Mappingversion 1.0"
[VARTAB]
[LINKS]
Real Estate Import list Vastgoed = "ID00001,ID00002" LINKOBJECTTYPE = Return V LINKOBJECTIDS = split %Vastgoed% \,
Folder
Folder is linked to the id which is present in the csv
Folder can be created if Foldertype is set to manual so we can set the folder id. Otherwise the folder can be created automaticly and linked to this document registration.
LINKOBJECTTYPE = Return "D"
LINKOBJECTIDS = WebserviceCall CreateFolder2 Bouw "%Dossiers%" [list [list dossier.dossier_oms "%Dossier titel%"]] {} {} {}
[UPLOAD]
Use the next available version NATVERSION = WebserviceCall ::DocVersion::NextVersion %OBJECTID% NATMODE = Return 0 You can also directly import the archive, ocr and thumbnail files NATDSACTION = subst "-action NONE" ARC = ErrorIfNotExists %ArcFile% OCR = ErrorIfNotExists %OcrFile% TMB = ErrorIfNotExists %TmbFile%
[POSTIMPORT]
[OK]
[ERROR]
If you do not use a unique id to identify the object, you should delete the object when an error occours during the import process and import again when problems are fixed!
- CMD = if {%_TMP_objectCreated%} {WebserviceCall Direct DeleteObject "%OBJECTTYPE%" "%_TMP_OBJECTID %"}