Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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 install **CzechIdM 7.7.0** (and higher).+ 
 +  * You need install **CzechIdM 7.7.0**  (and higher).
   * You need be logged in as **admin**.   * You need be logged in as **admin**.
-  * You need enable **ACC** module. +  * You need enable **ACC**  module. 
-  * You must have database **jdbcTest** with table **contracts**:+  * You must have database **jdbcTest**  with table **contracts**: 
 <code> <code>
 CREATE DATABASE "jdbcTest" CREATE DATABASE "jdbcTest"
Line 14: Line 16:
        LC_CTYPE = 'cs_CZ.UTF-8'        LC_CTYPE = 'cs_CZ.UTF-8'
        CONNECTION LIMIT = -1;        CONNECTION LIMIT = -1;
 +
 </code> </code>
 +
 <code> <code>
 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;
 +
 </code> </code>
 +
   * And add two records:   * And add two records:
 +
 <code> <code>
 INSERT INTO public.contracts( INSERT INTO public.contracts(
-            id, name, state, disbled, description, valid_from, valid_to,  +            id, name, state, disbled, description, valid_from, valid_to, 
-            team_leader, leader, main, changed, organization_name, organization_code, +            team_leader, leader, main, changed, organization_name, organization_code,
             owner)             owner)
     VALUES (     VALUES (
Line 49: Line 56:
  
 INSERT INTO public.contracts( INSERT INTO public.contracts(
-            id, name, state, disbled, description, valid_from, valid_to,  +            id, name, state, disbled, description, valid_from, valid_to, 
-            team_leader, leader, main, changed, organization_name, organization_code, +            team_leader, leader, main, changed, organization_name, organization_code,
             owner)             owner)
     VALUES (     VALUES (
 '2','Contract two','20','true','revolutionize viral experiences','2017-04-06',null,null,null,'true','2016-06-15','Einti','60429-911','john.roe'); '2','Contract two','20','true','revolutionize viral experiences','2017-04-06',null,null,null,'true','2016-06-15','Einti','60429-911','john.roe');
 +
 </code> </code>
  
 ===== Create and edit DB system ===== ===== Create and edit DB system =====
-  * We go into **Systems** agenda and add a new system. Click on green button **Add**. + 
-{{ :tutorial:adm:sync_02.png |}} +  * We go into **Systems**  agenda and add a new system. Click on green button **Add**. 
-  * Fill **System name** and at bottom of page there is green button **Save and continue**, so click on it. + 
-{{ :tutorial:adm:contracts_03.png |}} +{{  .:sync_02.png  }} 
-Go to **Configuration** tab and fill in information about your database. Ours are as such:+ 
 +  * Fill **System name**  and at bottom of page there is green button **Save and continue**, so click on it. 
 + 
 +{{  .:contracts_03.png  }}Go to **Configuration**  tab and fill in information about your database. Ours are as such: 
 <code> <code>
 ^ Host                 ^ jdbc:postgresql://localhost:5432/jdbcTest  ^ ^ Host                 ^ jdbc:postgresql://localhost:5432/jdbcTest  ^
Line 72: Line 84:
 | JDBC Driver          | org.postgresql.Driver                      | | JDBC Driver          | org.postgresql.Driver                      |
 | JDBC Connection URL  | jdbc:postgresql://localhost:5432/jdbcTest  | | JDBC Connection URL  | jdbc:postgresql://localhost:5432/jdbcTest  |
 +
 </code> </code>
-{{ :tutorial:adm:contracts_04.png |}} + 
-  * Then go to tab **Scheme** and generate scheme. +{{  .:contracts_04.png  }} 
-{{ :tutorial:adm:contracts_05.png |}} + 
-  * Then go to **Mapping** and click on **Add** button. +  * Then go to tab **Scheme**  and generate scheme. 
-{{ :tutorial:adm:contracts_06.png |}}+ 
 +{{  .:contracts_05.png  }} 
 + 
 +  * Then go to **Mapping**  and click on **Add**  button. 
 + 
 +{{  .:contracts_06.png  }} 
   * 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**.
-{{ :tutorial:adm:contracts_07.png |}}+ 
 +{{  .:contracts_07.png  }} 
   * 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:
 <code> <code>
 +
 ^ 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     | false      | true         | Guarantess       | guarantees | does not have         | | leader              | leader     | false      | true         | Guarantess       | guarantees | does not have         |
 | name                | name       | false      | true         | Name of position | position   | does not have         | | name                | name       | false      | true         | Name of position | position   | does not have         |
-| __NAME__            | __NAME__   | true       | false        |                  |            | does not have         |+| __NAME__            | __NAME__   | true       | false        |   |            | does not have         |
 | owner               | owner      | false      | true         | Owner            | identity   | does not have         | | owner               | owner      | false      | true         | Owner            | identity   | does not have         |
 | state               | state      | false      | true         | State            | state      | has                   | | state               | state      | false      | true         | State            | state      | has                   |
 | valid_from          | valid_from | false      | true         | Valid from       | validFrom  | has                   | | valid_from          | valid_from | false      | true         | Valid from       | validFrom  | has                   |
 | valid_to            | valid_to   | false      | true         | Valid till       | validTill  | has                   | | valid_to            | valid_to   | false      | true         | Valid till       | validTill  | has                   |
 +
 </code> </code>
-  * In **Transformation from system** field of **state** attribute there is green button **Insert script** select **Compiles identity-relation state** and click **Select** 
-{{ :tutorial:adm:contracts_07_02.png |}} 
-  * Paste to **Transformation from system** field of **valid\_from** and **valid\_to** attributes: 
  
 +  * In **Transformation from system**  field of **state**  attribute there is green button **Insert script**  select **Compiles identity-relation state**  and click **Select**
 +
 +{{  .:contracts_07_02.png  }}
 +
 +  * Paste to **Transformation from system**  field of **valid\_from**  and **valid\_to**  attributes:
 <code> <code>
 +
 import org.joda.time.LocalDate; import org.joda.time.LocalDate;
- +
 if(attributeValue){ if(attributeValue){
     return new LocalDate(attributeValue);     return new LocalDate(attributeValue);
 } }
 +
 </code> </code>
  
   * Two examples how to fill attributes:   * Two examples how to fill attributes:
-{{ :tutorial:adm:contracts_08.png |}} + 
-{{ :tutorial:adm:contracts_09.png |}}+{{  .:contracts_08.png  }}{{  .:contracts_09.png  }} 
   * Now we have 7 mapped attributes:   * Now we have 7 mapped attributes:
-{{ :tutorial:adm:contracts_10.png |}} + 
-  * Go to tab **Synchronization** and **Add** new synchronization. +{{  .:contracts_10.png  }} 
-{{ :tutorial:adm:contracts_11.png |}} + 
-  * 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**  and **Add**  new synchronization. 
-{{ :tutorial:adm:contracts_12.png |}}+ 
 +{{  .:contracts_11.png  }} 
 + 
 +  * 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: 
 + 
 +{{  .:contracts_12.png  }} 
   * Confirm start synchronization:   * Confirm start synchronization:
-{{ :tutorial:adm:sync_13.png |}} + 
-  * 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**. +{{  .:sync_13.png  }} 
-  * 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. + 
-{{ :tutorial:adm:contracts_14.png |}} +  * 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**. 
-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**  contract has been here since creating this user (for testing purposes) and the other two are synchronized from the database. 
 + 
 +{{  .:contracts_14.png  }}If you have it in a state like in the upper picture you successfully complete this tutorial.
  
 <note tip>Thank you for following this tutorial, I hope it was useful.</note> <note tip>Thank you for following this tutorial, I hope it was useful.</note>
 +
 +
  • by cem