[midPoint] Idiot question concerning date/time handling
Collins, Kevin
K.J.Collins at hw.ac.uk
Fri Apr 17 09:44:39 CEST 2020
Hi Gustav,
Many thanks. Two follow-up questions, if I may...
* Does the administrative status need to be worked out in the code or will Midpoint do this all by itself? Based on your code it successfully imports start_date and end_date from the Postgres table and leaves the administrativeStatus as "undefined" (which, according to the balloon help seems to be what I want - Midpoint takes care of determining if the account should be active or not), and
* Can the date display format be set to UK (dd-MM-yyyy) rather than US (MM-dd-yyyy)
________________________________
From: midPoint <midpoint-bounces at lists.evolveum.com> on behalf of Pálos Gustáv <gustav.palos at gmail.com>
Sent: 17 April 2020 07:53
To: midPoint General Discussion <midpoint at lists.evolveum.com>
Subject: Re: [midPoint] Idiot question concerning date/time handling
Hi Kevin,
yes you need to convert it, like this:
<expression>
<script>
<code>basic.parseDateTime("yyyy-MM-dd HH:mm:ss", "2020-04-17 07:00:00")</code>
</script>
</expression>
Best regards,
Gustav
pi 17. 4. 2020 o 8:18 Collins, Kevin <K.J.Collins at hw.ac.uk<mailto:K.J.Collins at hw.ac.uk>> napísal(a):
Hi everyone,
I hope that everyone is well and coping with the new working patterns that many of us have had to adopt.
I have a question that may have been answered previously, but I can't find it.
The "source of truth" for user data is in a Postgresql table with start_date and end_date supplied. The columns for start_date and end_date are defined in the table as "timestamp without timezone" and take the form "yyyy-MM-dd HH:mm:ss", (example "2020-04-17 07:00:00").
I'm trying to set up activation for any users coming in from this data feed so that Midpoint knows when it's time to create, activate, suspend or archive the user account. I have got the MidPoint database table connector connecting to the database and can import some attributes. However, I can't get the start_date into validFrom and end_date into validTo.
=-=-=-=-=-=-=-=
<activation>
<validFrom>
<inbound>
<authoritative>true</authoritative>
<exclusive>false</exclusive>
<strength>normal</strength>
<source>
<c:path>$account/attributes/start_date</c:path>
</source>
<target>
<c:path>$focus/activation/validFrom</c:path>
</target>
</inbound>
</validFrom>
<validTo>
<inbound>
<authoritative>true</authoritative>
<exclusive>false</exclusive>
<strength>normal</strength>
<source>
<c:path>$account/attributes/end_date</c:path>
</source>
<target>
<c:path>$focus/activation/validTo</c:path>
</target>
</inbound>
</validTo>
</activation>
=-=-=-=-=-=-=-=
(And I haven't got a clue - yet!! - as to how to determine the administrative status from these dates. I think that it should be "undefined" to allow Midpoint to make the decision).
Do I have to convert the dates from Postgresql's timestamp-without-timezone into something else?
Help would be appreciated with this PoC.
Stay safe, stay well !!
Regards,
-Kev_C
--
Kevin Collins,
Edinburgh,
Scotland, UK
________________________________
Founded in 1821, Heriot-Watt is a leader in ideas and solutions. With campuses and students across the entire globe we span the world, delivering innovation and educational excellence in business, engineering, design and the physical, social and life sciences. This email is generated from the Heriot-Watt University Group, which includes:
1. Heriot-Watt University, a Scottish charity registered under number SC000278
2. Heriot- Watt Services Limited (Oriam), Scotland's national performance centre for sport. Heriot-Watt Services Limited is a private limited company registered is Scotland with registered number SC271030 and registered office at Research & Enterprise Services Heriot-Watt University, Riccarton, Edinburgh, EH14 4AS.
The contents (including any attachments) are confidential. If you are not the intended recipient of this e-mail, any disclosure, copying, distribution or use of its contents is strictly prohibited, and you should please notify the sender immediately and then delete it (including any attachments) from your system.
_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
https://lists.evolveum.com/mailman/listinfo/midpoint
--
s pozdravom
Gustáv Pálos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200417/503e68f7/attachment.htm>
More information about the midPoint
mailing list