Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:adm:systems_db_contracts [2018/03/05 09:11] stloukalp |
tutorial:adm:systems_db_contracts [2024/03/07 10:01] cem |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Systems - DB: Users' contracts synchronization ====== | ||
+ | |||
+ | ===== What do you need before you start ===== | ||
+ | |||
+ | * You need install **CzechIdM 7.7.0** | ||
+ | * You need be logged in as **admin**. | ||
+ | * You need enable **ACC** | ||
+ | * You need to create user with id **john.roe**. | ||
+ | * You must have database **jdbcTest** | ||
+ | |||
+ | < | ||
+ | CREATE DATABASE " | ||
+ | WITH OWNER = idmadmin | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | </ | ||
+ | |||
+ | < | ||
+ | CREATE TABLE public.contracts | ||
+ | ( | ||
+ | id character varying(255), | ||
+ | name character varying(255), | ||
+ | state character varying(255), | ||
+ | disbled character varying(255), | ||
+ | description character varying(255), | ||
+ | valid_from date, | ||
+ | valid_to date, | ||
+ | team_leader character varying(255), | ||
+ | leader character varying(255), | ||
+ | main character varying(255), | ||
+ | changed character varying(255), | ||
+ | organization_name character varying(255), | ||
+ | organization_code character varying(255), | ||
+ | owner character varying(255) | ||
+ | ) | ||
+ | WITH ( | ||
+ | OIDS=FALSE | ||
+ | ); | ||
+ | ALTER TABLE public.contracts | ||
+ | OWNER TO idmadmin; | ||
+ | |||
+ | </ | ||
+ | |||
+ | * And add two records: | ||
+ | |||
+ | < | ||
+ | INSERT INTO public.contracts( | ||
+ | id, name, state, disbled, description, | ||
+ | team_leader, | ||
+ | owner) | ||
+ | VALUES ( | ||
+ | ' | ||
+ | |||
+ | INSERT INTO public.contracts( | ||
+ | id, name, state, disbled, description, | ||
+ | team_leader, | ||
+ | owner) | ||
+ | VALUES ( | ||
+ | ' | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Create and edit DB system ===== | ||
+ | |||
+ | * We go into **Systems** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Fill **System name** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | < | ||
+ | ^ Host ^ jdbc: | ||
+ | | Port | 5432 | | ||
+ | | User | idmadmin | ||
+ | | User Password | ||
+ | | Database | ||
+ | | Table | contracts | ||
+ | | Key Column | ||
+ | | JDBC Driver | ||
+ | | JDBC Connection URL | jdbc: | ||
+ | |||
+ | </ | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Then go to tab **Scheme** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Then go to **Mapping** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Now fill in information from the picture below and click on **Save and continue**. | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * At the bottom of page, there are mapped attributes. We are going to add 7 attributes: | ||
+ | < | ||
+ | |||
+ | ^ Attribute in schema ^ Name ^ Identifier ^ Entity attr. ^ Entity field ^ IdM key ^ Transform from system ^ | ||
+ | | leader | ||
+ | | name | name | false | true | Name of position | position | ||
+ | | __NAME__ | ||
+ | | owner | owner | false | true | Owner | identity | ||
+ | | state | state | false | true | State | state | has | | ||
+ | | valid_from | ||
+ | | valid_to | ||
+ | |||
+ | </ | ||
+ | |||
+ | * In **Transformation from system** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Paste to **Transformation from system** | ||
+ | < | ||
+ | |||
+ | import org.joda.time.LocalDate; | ||
+ | |||
+ | if(attributeValue){ | ||
+ | return new LocalDate(attributeValue); | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | * Two examples how to fill attributes: | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Now we have 7 mapped attributes: | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Go to tab **Synchronization** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Fill the form as in the picture below and click on **Save and continue**, then click on green **arrow** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Confirm start synchronization: | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Wait a few seconds, so synchronization can finish its job. And then go to **Users** | ||
+ | * In tab positions there is now 3 contracts. The **Default** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | <note tip> | ||
+ | |||