Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:adm:vema_cloud [2019/08/07 10:57] poulm created |
tutorial:adm:vema_cloud [2020/05/15 06:36] kubicar [Systems - VEMA: Synchronization] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Systems - VEMA: Synchronization ====== | ====== Systems - VEMA: Synchronization ====== | ||
+ | You may have VEMA installed locally or in the cloud. The basic principals of integration of VEMA and VEMA Cloud with CzechIdM are very similar or the same. In both cases we will use an external MS-SQL database " | ||
+ | * VEMA PAM - work and payroll data(Prace a mzdy) | ||
+ | * VEMA PER - personel/HR data(Personalistika) | ||
+ | ===== VEMA cloud ===== | ||
+ | - Prepare the Windows server with VEMA thick client | ||
+ | * It's necessary to install **v4data** package. Start VEMA Administrator, | ||
+ | |||
+ | - Prepare MS-SQL database for the " | ||
+ | - Install the scripts: | ||
+ | - Create an user in VEMA with a permission to switch to the admin role and with access to the personal data (recommended role name = "IDM export" | ||
+ | - Create a database user in MS-SQL database " | ||
+ | - Create the MS-SQL " | ||
+ | -- create table skript pro vytvoreni tabulek v MS SQL pro export z Vema | ||
+ | -- if ' | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | pzar int PRIMARY KEY NOT NULL, | ||
+ | pzart nchar(255) | ||
+ | ); | ||
+ | CREATE UNIQUE INDEX PK_TPZR ON " | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | povfc int PRIMARY KEY NOT NULL, | ||
+ | | ||
+ | ); | ||
+ | CREATE UNIQUE INDEX PK_TODP ON " | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | kat int PRIMARY KEY NOT NULL, | ||
+ | katt nchar(255) | ||
+ | ); | ||
+ | CREATE UNIQUE INDEX PK_TKAT ON " | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | zames int PRIMARY KEY NOT NULL, | ||
+ | | ||
+ | kateg int, | ||
+ | skjkz int, | ||
+ | povfc int, | ||
+ | funkc int, | ||
+ | | ||
+ | pocrd int, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ) | ||
+ | ; | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | ros int PRIMARY KEY NOT NULL, | ||
+ | rost nchar(255) | ||
+ | ) | ||
+ | |||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | oscis int PRIMARY KEY NOT NULL, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | rocis nchar(15), | ||
+ | cpoj nchar(15), | ||
+ | ICL nchar(6), | ||
+ | | ||
+ | datlp datetime, | ||
+ | | ||
+ | | ||
+ | | ||
+ | rosu int | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | oscis int NOT NULL, | ||
+ | cicin int NOT NULL, | ||
+ | povfc int DEFAULT (NULL), | ||
+ | kateg int DEFAULT (NULL), | ||
+ | | ||
+ | pzar int DEFAULT (NULL), | ||
+ | utvar nchar(6) DEFAULT (NULL), | ||
+ | zauc datetime NOT NULL, | ||
+ | zapl datetime default (NULL), | ||
+ | ppvdr int default (NULL), | ||
+ | | ||
+ | zames int DEFAULT (NULL), | ||
+ | | ||
+ | | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | oscis int NOT NULL, | ||
+ | cicin int NOT NULL, | ||
+ | ppvza datetime NOT NULL, | ||
+ | ppvko datetime DEFAULT (NULL), | ||
+ | | ||
+ | | ||
+ | ); | ||
+ | |||
+ | CREATE TABLE " | ||
+ | ( | ||
+ | oscis int NOT NULL, | ||
+ | vynz datetime NOT NULL, | ||
+ | vynk datetime DEFAULT (NULL), | ||
+ | vynd int NOT NULL, | ||
+ | | ||
+ | | ||
+ | ); | ||
+ | |||
+ | create table tutv ( | ||
+ | utvar nchar(50) not NULL, | ||
+ | utvart nchar(255) default NULL, | ||
+ | zapl datetime default NULL, | ||
+ | kopl datetime default NULL, | ||
+ | zkratka nchar(20) default NULL, | ||
+ | constraint utvar_pkey primary key (utvar) | ||
+ | ); | ||
+ | |||
+ | create table czisco ( | ||
+ | czisco nchar(10) not NULL, | ||
+ | praczar nchar(255) not NULL, | ||
+ | praczarzk nchar(10) not NULL, | ||
+ | constraint czisco_pkey primary key (czisco) | ||
+ | ); | ||
+ | </ | ||
+ | - Install test scripts to a folder and change the log file path according to your environment. Default is '' | ||
+ | - test3.py:< | ||
+ | # -*- coding: utf-8 -*- | ||
+ | |||
+ | from __future__ import unicode_literals | ||
+ | from vmsys import RunAppFile | ||
+ | from v4data.dbv import DBVDatabase, | ||
+ | from v4core.meta import Property, PNumber | ||
+ | |||
+ | def LogInfo(message): | ||
+ | log = open(' | ||
+ | log.write(u' | ||
+ | log.close() | ||
+ | |||
+ | class PersInfoTable(DBVData): | ||
+ | fileName = ' | ||
+ | |||
+ | class PAM(DBVDatabase): | ||
+ | data = [PersInfoTable] | ||
+ | |||
+ | class MyApp(DBVApp): | ||
+ | db = PAM | ||
+ | def run(self): | ||
+ | for row in self.db.PersInfoTable(): | ||
+ | LogInfo(u' | ||
+ | break; | ||
+ | |||
+ | main = MyApp | ||
+ | </ | ||
+ | - test6.py:< | ||
+ | # -*- coding: utf-8 -*- | ||
+ | |||
+ | from __future__ import unicode_literals | ||
+ | from vmsys import RunAppFile | ||
+ | from v4data.dbv import DBVDatabase, | ||
+ | from v4core.meta import Property, PNumber | ||
+ | import PyVRDA, pyodbc | ||
+ | |||
+ | def LogInfo(message): | ||
+ | log = open(' | ||
+ | log.write(u' | ||
+ | log.close() | ||
+ | |||
+ | class MyApp(DBVApp): | ||
+ | def run(self): | ||
+ | |||
+ | conn = pyodbc.connect(' | ||
+ | cursor = conn.cursor() | ||
+ | cursor.execute(' | ||
+ | conn.commit() | ||
+ | LogInfo(u' | ||
+ | conn.close() | ||
+ | |||
+ | LogInfo(u' | ||
+ | |||
+ | main = MyApp | ||
+ | </ | ||
+ | - Run the test scripts <code cmd> | ||
+ | - the path to the '' | ||
+ | - Check the results | ||
+ | * test3.py - tests the communication with VEMA. Note: You might need to change the name of data file you want to read from. The default is " | ||
+ | * test6.py - tests ability to write into the " | ||
+ | * **Expected results:** | ||
+ | - No errors while running the scripts | ||
+ | - test3.py: Writest a list of family names from VEMA's data file to the log file '' | ||
+ | - test6.py: Inserts a record into the table osobyt in the " | ||
+ | |||
+ | ===== Local VEMA installation ===== | ||
BOTH local and cloud solutions pleas. TODO | BOTH local and cloud solutions pleas. TODO | ||
+ | |||
+ | ===== Common part ===== | ||
+ | |||
+ | Then you need to implement a certain script which will read the data you want from VEMA and write them to the " | ||
+ | |||
+ | The script must be run automatically e.g. once a day. | ||
+ | |||
+ | In IDM you will create a System with the Database Table Connector or Scripted SQL Connector according to the certain use-case. The first case is covered tutorials [[tutorial: | ||
+ |