====== Systems - DB: TreeNodes (org. structure) provisioning ====== ===== What do you need before you start ===== * You need install **CzechIdM 7.7.0** (and higher). * You need be logged in as **admin**. * You need enable **ACC** module. * You must have database **jdbcTest** with table **organizations**: CREATE DATABASE "jdbcTest" WITH OWNER = idmadmin ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'cs_CZ.UTF-8' LC_CTYPE = 'cs_CZ.UTF-8' CONNECTION LIMIT = -1; CREATE TABLE public.organizations ( id character varying(255), code character varying(255), name character varying(255), parent character varying(255) ) WITH ( OIDS=FALSE ); ALTER TABLE public.organizations OWNER TO idmadmin; ===== Create and edit DB system ===== We have completely empty organization's agenda. {{ :tutorial:adm:sync_01.png |}} Now we go into **Systems** agenda and add new system. Click on green button **Add**. {{ :tutorial:adm:sync_02.png |}} Fill **System name** and at bottom of page there is green button **Save and continue**, so click on it. {{ :tutorial:adm:sync_03.png |}} Go to **Configuration** tab and fill in information about your database. Ours are as such: ^ Host ^ jdbc:postgresql://localhost:5432/jdbcTest ^ | Port | 5432 | | User | idmadmin | | User Password | ******** | | Database | jdbcTest | | Table | organizations | | Key Column | id | | JDBC Driver | org.postgresql.Driver | | JDBC Connection URL | jdbc:postgresql://localhost:5432/jdbcTest | {{ :tutorial:adm:sync_04.png |}} Then go to tab **Scheme** and generate scheme. {{ :tutorial:adm:sync_05.png |}} Then go to **Mapping** and click on **Add** button. {{ :tutorial:adm:sync_06.png |}} Now fill in information from picture bellow and click on **Save and continue**. {{ :tutorial:adm:prov_07.png |}} At the bottom of page, there are mapped attributes. We are going to add 4 attributes: ^ Attribute in schema ^ Name ^ Identifier ^ Entity attr. ^ Extended attr. ^ Entity field ^ IdM key ^ | code | code | false | true | false | Code (String) | | | name | name | false | true | false | Name (String) | | | parent | parent | false | true | false | Parent (String) | | | __NAME__ | __NAME__ | true | false | true | | externalId | Fill "code, name, parent" as in the picture: {{ :tutorial:adm:prov_08.png |}} But "\_\_NAME\_\_" fill like this picture: {{ :tutorial:adm:prov_09.png |}} Now we have 4 mapped attributes: {{ :tutorial:adm:prov_10.png |}} Go to the section **Organization** (in the left menu) to **Structure elements** tab and **Add** new organization. {{ :tutorial:adm:prov_11.png |}} Fill in information of root organization: {{ :tutorial:adm:prov_12.png |}} Then add another organization, but this one will be child of root: {{ :tutorial:adm:prov_13.png |}} As you can see in section **Organization** we have two structure elements. {{ :tutorial:adm:prov_14.png |}} And in database: {{ :tutorial:adm:prov_15.png |}} If you have it in a state like in the upper picture you successfully complete this tutorial. Thank you for trying this tutorial, I hope it was useful.