| //// |
| ****************************************************************************** |
| * Copyright 2018 Mettenmeier GmbH. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| ****************************************************************************** |
| //// |
| = openKonsequenz "StandbyPlanning" - How to configure the module |
| :Date: 2018-06-07 |
| :Revision: 1 |
| |
| == Keycloak |
| Define the following client(s), roles and users. |
| |
| .create keycloak client |
| [source] |
| standbyplanning |
| |
| .create keycloak client roles |
| [source] |
| BP_Admin |
| BP_Gruppenleiter |
| BP_Leseberechtigte |
| BP_Sachbearbeiter |
| |
| .create keycloak user |
| [source] |
| user= bp_leser pwd= mm |
| user= bp_leiter pwd= mm |
| user= bp_bearbeiter pwd= mm |
| user= bp_admin pwd= mm |
| |
| == Datenbank (Postgres) [[Postgres]] |
| A postgres database and a user have to be created. After that all the needed tables and sequences will be genreated bei the "Standby Planning" backend (spbe). |
| |
| .user |
| [source] |
| -- Role: bp |
| -- DROP ROLE bp; |
| CREATE ROLE bp LOGIN |
| ENCRYPTED PASSWORD 'md5b03632e190331f379668603ee46d4772' |
| NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; |
| |
| .database |
| [source] |
| --CREATE DATABASE "BP" |
| WITH OWNER = bp |
| ENCODING = 'UTF8' |
| TABLESPACE = pg_default |
| LC_COLLATE = 'en_US.UTF-8' |
| LC_CTYPE = 'en_US.UTF-8' |
| CONNECTION LIMIT = -1; |
| |
| == oK auth&auth core module [[AuthAuth]] |
| |
| The frontend and backend of the auth&auth modul have to be put into the webapps folder to allow the use of the module. |
| [source] |
| webapps/portal.war |
| webapps/portalFE |
| |
| Configure the portalFE url to your local environment. For more details see the documentation of the auth&auth core-module. |
| |
| [source] |
| webapps/portal/WEB-INF/classes/backendConfigProduction.json // URL to keycloak |
| webapps/portal/WEB-INF/classes/moduleConfigDevLocal.json // Modulconfiguration Dev |
| webapps/portal/WEB-INF/classes/moduleConfigProduction.json // Modulconfiguration Prod |
| |
| In moduleConfigProduction.json is the following module entry needed: |
| |
| [source] |
| { |
| "name": "Bereitschaftsplanung", |
| "cols": 1, |
| "rows": 1, |
| "color": "#ffffff", |
| "link": "https://localhost:8080/spfe", |
| "pictureLink": "https://www.openkonsequenz.de/medien/cache/main_image/l_bereitschaftsplan_57882047.jpg", |
| "requiredRole": "planning-access" |
| } |
| |
| === server.xml |
| The following Resources have added to the *<GlobalNamingResources>* section of the tomcat server.xml. |
| [source, xml] |
| |
| <!--BP resource--> |
| <Resource auth="Container" |
| driverClassName="org.postgresql.Driver" |
| factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" maxActive="20" |
| minIdle="5" name="jdbc/BP" password="bp" type="javax.sql.DataSource" |
| uniqueResourceName="bp" url="jdbc:postgresql://localhost:5432/BP" |
| username="bp" /> |
| |
| |
| == Setup the Application Standbyplanning |
| You need to build the standbyplanning frontend and backend. Then you will get two *.war files. |
| [source] |
| spfe.war |
| spbe.war |
| |
| Both war files should be placed into the webapps folder of the application server. |
| [source] |
| webapps/spfe.war |
| webapps/spbe.war |
| |
| === Define frontend auth&auth URL |
| Define the URL to your openkonsequenz auth&auth modul. For your local development you can use http instead of https. |
| |
| .change url in spfe/main*.js |
| [source] |
| loginPage:"https://localhost:8080/portalFE/#/login" |
| |
| === Define application backend Rest-URL. |
| In Angular you use environment.ts files in order to change urls before building the Application. In your build command you specify which environment should be used. Currently there are 3 environment files: |
| [source] |
| environment.prod.ts |
| environment.qa.ts |
| environment.ts |
| |
| It depending on which rest url you want to build you have to chose the correct environment file or adjust the urls within it. |
| |
| The configuration might look like this for a server which runs on localhost on port 8080: |
| [source] |
| basePath:"https://localhost:8080/spbe/webapi" |
| |
| |
| == Define application properties[[ApplicationProperties]] |
| |
| After deplying the backend war file to the server, you will find the folder *spbe*. If you have to configure for example the auth&auth URL, then see the application.properties under |
| |
| [source] |
| spbe\WEB-INF\classes\application.properties |
| |
| There you will find the runtime spezific application environments like: |
| |
| [source] |
| * Database Configuration |
| * Keycloak Portal |
| * Application |
| * Reports |
| * Distance Service |
| * SQL-init-scripts |
| * Mail |
| * placeholder user ids |
| |
| === Cyclic report generation |
| |
| [option="header", cols="1,1"] |
| |=== |
| | Key | Description |
| |report.cyclic.datePattern | yyyyMMdd - +{Date}+ replacement pattern |
| |report.cyclic.timePattern | HHmm - +{Time}+ replacement pattern |
| |report.cyclic.weekPattern | ww - +{Week}+ replacement pattern |
| |report.cyclic.zoneName | Europe/Berlin - time zone |
| |report.cyclic.locale | de - Locale |
| |report.cyclic.archiveReport | true - enable/disable archive |
| |report.cyclic.archivePath | /opt/openkdg/reports - archive folder path |
| |report.cyclic.sendReportMail | true - enable/disable send mail |
| |report.mail.propertiesPath | /opt/openkdg/mail-notification.properties - mail config |
| |report.cyclic.checkCron | 15 0/5 * * * ? - cron schedule for trigger lookups |
| |report.cyclic.slotDeltaMin | 5 - trigger time slot minutes (should match cron schedule trigger delta) |
| |=== |
| |
| == Cyclic report generation mail properties |
| |
| The file referenced by the report.mail.propertiesPath in the application properies should contain a set of mail connection properties. |
| |
| * mail.imap.user = username username of the mail account |
| * mail.imap.password = password password of the mail account |
| * mail.smtp.host = smtp.host.tld SMTP host address |
| * mail.smtp.auth = true enable authentication |
| * mail.smtp.from = standbyplanningreports@company.tld email address of the sender |
| * mail.smtp.port = 465 port |
| * mail.smtp.socketFactory.port = 465 |
| * mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory |
| * mail.smtp.socketFactory.fallback = false |
| |