[midPoint] Convert from gregorian calendar to Oracle Timestamp

Andrea Picconi andrea.picconi at innovery.net
Thu Nov 19 17:42:19 CET 2020


Hi all,

I need to convert a date format from gregorian calendar to Oracle Timestamp.
By now I'm using this script that does the opposite (inside an output mapping):

<expression>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<http://www.w3.org/2001/XMLSchema-instance%22> xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"<http://midpoint.evolveum.com/xml/ns/public/common/common-3%22> xsi:type="c:ScriptExpressionEvaluatorType">
<code>
import java.text.SimpleDateFormat;
import java.text.DateFormat;

DateFormat dtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

if (input!=null) {
Date dt = dtf.parse(input);
log.info("convertedValidFrom = " + dt);
return com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar(dt);
} else {
return null;
}
</code>
</script>
</expression>

How could I convert it to make it do the opposite?

Regards,

Andrea Picconi
IAM (Identity Access Management)

[Innovery]
Skype: precons
T:  +39 06 51963439 (int. 196)

Strada Quattro Palazzina A6 c/o Centro Direzionale Milanofiori, 20057 Assago (MI).
www.innovery.net<http://www.innovery.net/> |  T: +39 06 519 63 439

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201119/633a1a57/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 8058 bytes
Desc: image003.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201119/633a1a57/attachment.png>


More information about the midPoint mailing list