FileArchive mapping.ini: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Hebel (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „[GLOBAL] OBJECTID = Return %_TMP_DocID% OBJECTKIND = Return %_TMP_DocType% OBJECTTYPE = Return "S" [SYSTEMFIELDS] ; Generie…“) |
Hebel (Diskussion | Beiträge) |
||
| (9 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
| − | + | FileArchive.ini | |
| − | |||
| − | |||
| − | |||
| − | [SYSTEMFIELDS] | + | ; Make sure you configured "RootDir", "CheckLockfile", "Delete_Linked_Uploadfile_Dir", "Function", "EXCLUDEDFILEEXTENSION" and "IdxFileExtension" in the system.ini Importsection and you copied "FileArchive.tbc" like described in the [[Include#FileArchive|FileArchive]] documentation! |
| − | ; | + | |
| − | _TMP_Unique = ::sha2::sha256 -hex -filename %ORGFILENAME% | + | [GLOBAL] |
| − | _TMP_DocType = CheckDefinition "ALGE" | + | OBJECTID = Return %_TMP_DocID% |
| + | OBJECTKIND = Return %_TMP_DocType% | ||
| + | OBJECTTYPE = Return "S" | ||
| + | |||
| + | [SYSTEMFIELDS] | ||
| + | ; Generates a unique sha256 of file to avoid double files in Corsa | ||
| + | _TMP_Unique = ::sha2::sha256 -hex -filename %ORGFILENAME% | ||
| + | _TMP_DocType = CheckDefinition "ALGE" | ||
| + | |||
| + | _TMP_DocID = WebserviceCall ::CreateObject::DocumentByQuery %_TMP_DOCTYPE% *DUMMY* [list [list qrtReference dUnique qcAnd qoEqual %_TMP_UNIQUE%]] {} [list [list dUnique %_TMP_UNIQUE%]] | ||
| + | _TMP_ObjectCreated = Return "$::mapping::objectCreated" | ||
| + | |||
| + | ; The first subfolder is used as unique organisation name in Corsa. If the organisation name (=first subfolder name) can't be matched against Corsa, a new organisation will be created. | ||
| + | _TMP_CUSTOMER = lindex [regexp -inline {D:/NETZLAUFWERK/([^/]+?)/} %ORGFILENAME%] 1 | ||
| + | _TMP_ORGAID = WebserviceCall ::CreateObject::OrganisationByQuery ORGA *DUMMY* [list [list qrtDbField Naam qcAnd qoEqual %_TMP_CUSTOMER%]] [list [list ext_rela.naam1 %_TMP_CUSTOMER%]] [list [list oWfAkten Ja]] | ||
| + | |||
| + | poststuk.soort_ext = Return "I" | ||
| + | ws-ps_ob.object_type = Return "E" | ||
| + | poststuk.relatie_id = Return %_TMP_ORGAID% | ||
| + | ws-ps_ob.object_id = Return %_TMP_ORGAID% | ||
| + | |||
| + | ; Based on the secound subfolder name the document type will be mapped. | ||
| + | _TMP_FOLDER = lindex [regexp -inline {D:/NETZLAUFWERK/[^/]+?/([^/]+?)/} %ORGFILENAME%] 1 | ||
| + | _TMP_DocType = string map {Allgemein "ALGE" Sonstiges "ALGE" Schäden "ALGE" Verträge "VERT"} %_TMP_FOLDER% | ||
| + | |||
| + | ; The filename is used to describe the document registration. | ||
| + | _TMP_FILENAME = lindex [regexp -inline {.*/(.*)\.} %ORGFILENAME%] 1 | ||
| + | poststuk.inhoud1 = Return %_TMP_FILENAME% | ||
| + | poststuk.onderwerp = Return %_TMP_FILENAME% | ||
| + | |||
| + | ; Because of the deleted original file we will leave a MyCorsa NxT Hyperlink to this file in the same directory with the same name of the original file. Before "Document.docx" and after successfully imported "Document.docx.url". | ||
| + | _TMP_PATH = lindex [regexp -inline {(.*)/.*\.} %ORGFILENAME%] 1 | ||
| + | _TMP_URL = Return "http://CORSA-2016/scripts/wsisa.dll/WService=ws_test/stdw/viewobject.html? | ||
| + | object_type=S&object_id=%_TMP_DocID%" | ||
| + | _TMP_CREATENXTLINK = ::twapi::write_url_shortcut "%_TMP_PATH%/%_TMP_FILENAME%.url" %_TMP_URL% | ||
| + | |||
| + | [REFERENCEFIELDS] | ||
| + | dQUelle = Return "ImportService" | ||
| + | dVersion = Return "0.1" | ||
| + | |||
| + | [LINKS] | ||
| + | ; Zur Strukturierung wurden in Corsa Aktentypen mit manueller Nummerierung erstellt. Die Akten-ID wird aus einem Präfix und der Organisations-ID generiert und verknüpft. | ||
| + | LINKOBJECTTYPE = Return D | ||
| + | LINKOBJECTIDS = if {%_TMP_DocType% eq "VERT"} {Return "VE%_TMP_ORGAID%"} | ||
| + | |||
| + | [UPLOAD] | ||
| + | NAT = ErrorIfNotExists %ORGFILENAME% | ||
| + | NATVERSION = WebserviceCall NextVersion S %_TMP_DocID% | ||
| + | |||
| + | [ERROR] | ||
| + | CMD = if {%_TMP_ObjectCreated%} {WebserviceCall Direct DeleteObject "%OBJECTTYPE%" "%_TMP_DocID%"} | ||
| − | |||
| − | |||
| − | + | [[System.ini]] | |
| − | |||
| − | |||
| − | + | [FileArchive] | |
| − | + | Name = FileArchive | |
| − | + | Active = 1 | |
| − | + | UseJobService = 1 | |
| − | + | Priority = 33 | |
| − | + | SourceDir = ../../data/ready4import/FileArchive | |
| − | + | ErrorDir = ../../data/error/FileArchive | |
| − | + | '''RootDir = D:/FOLDERSTRUCTURE''' | |
| − | + | '''CheckLockfile = 1''' | |
| − | + | '''Delete_Linked_Uploadfile_Dir = 0''' | |
| − | + | '''Function = ::FileArchive::GetData $counter''' | |
| − | + | '''EXCLUDEDFILEEXTENSION = url''' | |
| − | + | ||
| − | + | '''IdxFileExtension = idx''' | |
| − | + | RecordSep = format %c 253 | |
| − | + | ColSep = format %c 255 | |
| − | + | ValueSep = format %c 254 | |
| − | + | MappingFile = ./mapping/FileArchive.ini | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Aktuelle Version vom 29. Juni 2017, 12:45 Uhr
FileArchive.ini
; Make sure you configured "RootDir", "CheckLockfile", "Delete_Linked_Uploadfile_Dir", "Function", "EXCLUDEDFILEEXTENSION" and "IdxFileExtension" in the system.ini Importsection and you copied "FileArchive.tbc" like described in the FileArchive documentation! [GLOBAL] OBJECTID = Return %_TMP_DocID% OBJECTKIND = Return %_TMP_DocType% OBJECTTYPE = Return "S" [SYSTEMFIELDS] ; Generates a unique sha256 of file to avoid double files in Corsa _TMP_Unique = ::sha2::sha256 -hex -filename %ORGFILENAME% _TMP_DocType = CheckDefinition "ALGE" _TMP_DocID = WebserviceCall ::CreateObject::DocumentByQuery %_TMP_DOCTYPE% *DUMMY* [list [list qrtReference dUnique qcAnd qoEqual %_TMP_UNIQUE%]] {} [list [list dUnique %_TMP_UNIQUE%]] _TMP_ObjectCreated = Return "$::mapping::objectCreated" ; The first subfolder is used as unique organisation name in Corsa. If the organisation name (=first subfolder name) can't be matched against Corsa, a new organisation will be created. _TMP_CUSTOMER = lindex [regexp -inline {D:/NETZLAUFWERK/([^/]+?)/} %ORGFILENAME%] 1 _TMP_ORGAID = WebserviceCall ::CreateObject::OrganisationByQuery ORGA *DUMMY* [list [list qrtDbField Naam qcAnd qoEqual %_TMP_CUSTOMER%]] [list [list ext_rela.naam1 %_TMP_CUSTOMER%]] [list [list oWfAkten Ja]] poststuk.soort_ext = Return "I" ws-ps_ob.object_type = Return "E" poststuk.relatie_id = Return %_TMP_ORGAID% ws-ps_ob.object_id = Return %_TMP_ORGAID% ; Based on the secound subfolder name the document type will be mapped. _TMP_FOLDER = lindex [regexp -inline {D:/NETZLAUFWERK/[^/]+?/([^/]+?)/} %ORGFILENAME%] 1 _TMP_DocType = string map {Allgemein "ALGE" Sonstiges "ALGE" Schäden "ALGE" Verträge "VERT"} %_TMP_FOLDER% ; The filename is used to describe the document registration. _TMP_FILENAME = lindex [regexp -inline {.*/(.*)\.} %ORGFILENAME%] 1 poststuk.inhoud1 = Return %_TMP_FILENAME% poststuk.onderwerp = Return %_TMP_FILENAME% ; Because of the deleted original file we will leave a MyCorsa NxT Hyperlink to this file in the same directory with the same name of the original file. Before "Document.docx" and after successfully imported "Document.docx.url". _TMP_PATH = lindex [regexp -inline {(.*)/.*\.} %ORGFILENAME%] 1 _TMP_URL = Return "http://CORSA-2016/scripts/wsisa.dll/WService=ws_test/stdw/viewobject.html? object_type=S&object_id=%_TMP_DocID%" _TMP_CREATENXTLINK = ::twapi::write_url_shortcut "%_TMP_PATH%/%_TMP_FILENAME%.url" %_TMP_URL% [REFERENCEFIELDS] dQUelle = Return "ImportService" dVersion = Return "0.1" [LINKS] ; Zur Strukturierung wurden in Corsa Aktentypen mit manueller Nummerierung erstellt. Die Akten-ID wird aus einem Präfix und der Organisations-ID generiert und verknüpft. LINKOBJECTTYPE = Return D LINKOBJECTIDS = if {%_TMP_DocType% eq "VERT"} {Return "VE%_TMP_ORGAID%"} [UPLOAD] NAT = ErrorIfNotExists %ORGFILENAME% NATVERSION = WebserviceCall NextVersion S %_TMP_DocID% [ERROR] CMD = if {%_TMP_ObjectCreated%} {WebserviceCall Direct DeleteObject "%OBJECTTYPE%" "%_TMP_DocID%"}
[FileArchive] Name = FileArchive Active = 1 UseJobService = 1 Priority = 33 SourceDir = ../../data/ready4import/FileArchive ErrorDir = ../../data/error/FileArchive RootDir = D:/FOLDERSTRUCTURE CheckLockfile = 1 Delete_Linked_Uploadfile_Dir = 0 Function = ::FileArchive::GetData $counter EXCLUDEDFILEEXTENSION = url IdxFileExtension = idx RecordSep = format %c 253 ColSep = format %c 255 ValueSep = format %c 254 MappingFile = ./mapping/FileArchive.ini