Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
tutorial:adm:systems_db_contracts [2018/03/05 09:13] stloukalp |
tutorial:adm:systems_db_contracts [2024/03/07 12:33] cem |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== What do you need before you start ===== | ===== What do you need before you start ===== | ||
- | | + | |
+ | | ||
* You need be logged in as **admin**. | * You need be logged in as **admin**. | ||
- | * You need enable **ACC** module. | + | * You need enable **ACC** |
- | * You must have database **jdbcTest** with table **contracts**: | + | * You must have database **jdbcTest** |
< | < | ||
CREATE DATABASE " | CREATE DATABASE " | ||
Line 14: | Line 16: | ||
| | ||
| | ||
+ | |||
</ | </ | ||
+ | |||
< | < | ||
CREATE TABLE public.contracts | CREATE TABLE public.contracts | ||
Line 38: | Line 42: | ||
ALTER TABLE public.contracts | ALTER TABLE public.contracts | ||
OWNER TO idmadmin; | OWNER TO idmadmin; | ||
+ | |||
</ | </ | ||
+ | |||
* And add two records: | * And add two records: | ||
+ | |||
< | < | ||
INSERT INTO public.contracts( | INSERT INTO public.contracts( | ||
- | id, name, state, disbled, description, | + | id, name, state, disbled, description, |
- | team_leader, | + | team_leader, |
owner) | owner) | ||
VALUES ( | VALUES ( | ||
Line 49: | Line 56: | ||
INSERT INTO public.contracts( | INSERT INTO public.contracts( | ||
- | id, name, state, disbled, description, | + | id, name, state, disbled, description, |
- | team_leader, | + | team_leader, |
owner) | owner) | ||
VALUES ( | VALUES ( | ||
' | ' | ||
+ | |||
</ | </ | ||
===== Create and edit DB system ===== | ===== Create and edit DB system ===== | ||
- | | + | |
- | {{ : | + | |
- | * Fill **System name** and at bottom of page there is green button **Save and continue**, so click on it. | + | |
- | {{ : | + | {{ .: |
- | Go to **Configuration** tab and fill in information about your database. Ours are as such: | + | |
+ | * Fill **System name** | ||
+ | |||
+ | {{ .: | ||
< | < | ||
^ Host ^ jdbc: | ^ Host ^ jdbc: | ||
Line 72: | Line 84: | ||
| JDBC Driver | | JDBC Driver | ||
| JDBC Connection URL | jdbc: | | JDBC Connection URL | jdbc: | ||
+ | |||
</ | </ | ||
- | {{ : | + | |
- | * Then go to tab **Scheme** and generate scheme. | + | {{ .: |
- | {{ : | + | |
- | * Then go to **Mapping** and click on **Add** button. | + | * Then go to tab **Scheme** |
- | {{ : | + | |
+ | {{ .: | ||
+ | |||
+ | * Then go to **Mapping** | ||
+ | |||
+ | {{ .: | ||
* Now fill in information from the picture below and click on **Save and continue**. | * 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: | * 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 ^ | ^ Attribute in schema ^ Name ^ Identifier ^ Entity attr. ^ Entity field ^ IdM key ^ Transform from system ^ | ||
| leader | | leader | ||
| name | name | false | true | Name of position | position | | name | name | false | true | Name of position | position | ||
- | | __NAME__ | + | | __NAME__ |
| owner | owner | false | true | Owner | identity | | owner | owner | false | true | Owner | identity | ||
| state | state | false | true | State | state | has | | | state | state | false | true | State | state | has | | ||
| valid_from | | valid_from | ||
| valid_to | | valid_to | ||
+ | |||
</ | </ | ||
- | * In **Transformation from system** field of **state** attribute there is green button **Insert script** select **Compiles identity-relation state** and click **Select** | ||
- | {{ : | ||
- | * Paste to **Transformation from system** field of **valid\_from** and **valid\_to** attributes: | ||
+ | * In **Transformation from system** | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | * Paste to **Transformation from system** | ||
< | < | ||
+ | |||
import org.joda.time.LocalDate; | import org.joda.time.LocalDate; | ||
- | + | ||
if(attributeValue){ | if(attributeValue){ | ||
return new LocalDate(attributeValue); | return new LocalDate(attributeValue); | ||
} | } | ||
+ | |||
</ | </ | ||
* Two examples how to fill attributes: | * Two examples how to fill attributes: | ||
- | {{ : | + | |
- | {{ : | + | {{ .: |
* Now we have 7 mapped attributes: | * Now we have 7 mapped attributes: | ||
- | {{ : | + | |
- | * Go to tab **Synchronization** and **Add** new synchronization. | + | {{ .: |
- | {{ : | + | |
- | * Fill the form as in the picture below and click on **Save and continue**, then click on green **arrow** and option **Save and run sync** will show up, so click on it: | + | * 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: | * Confirm start synchronization: | ||
- | {{ : | + | |
- | * Wait a few seconds, so synchronization can finish its job. And then go to **Users** section (in the left menu). And find user **john.roe**. | + | {{ .: |
- | * In tab positions there is now 3 contracts. The **Default** contract has been here since creating this user (for testing purposes) and the other two are synchronized from the database. | + | |
- | {{ : | + | * Wait a few seconds, so synchronization can finish its job. And then go to **Users** |
- | If you have it in a state like in the upper picture you successfully complete this tutorial. | + | * In tab positions there is now 3 contracts. The **Default** |
+ | |||
+ | {{ .: | ||
<note tip> | <note tip> | ||
+ | |||
+ |