<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Roboto;
panose-1:2 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR-CH" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Good afternoon,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I am currently updating a the email notification in my SystemConfiguration to send emails to the new users.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">My configuration is very close to that is described in
<a href="https://docs.evolveum.com/midpoint/reference/misc/self-registration/">https://docs.evolveum.com/midpoint/reference/misc/self-registration/</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I ensured that the property defaultHostname has been updated to the new property publicHttpUrlPattern<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"> <subjectExpression><o:p></o:p></p>
<p class="MsoNormal"> <value>Création de votre compte à l'université de Paris</value><o:p></o:p></p>
<p class="MsoNormal"> </subjectExpression><o:p></o:p></p>
<p class="MsoNormal"> <bodyExpression><o:p></o:p></p>
<p class="MsoNormal"> <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><o:p></o:p></p>
<p class="MsoNormal"> <code><o:p></o:p></p>
<p class="MsoNormal"> import com.evolveum.midpoint.schema.constants.SchemaConstants;<o:p></o:p></p>
<p class="MsoNormal"> import com.evolveum.midpoint.notifications.api.events.ModelEvent;<o:p></o:p></p>
<p class="MsoNormal"> <span lang="EN-US">import com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationMessageType;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span>import java.net.URLEncoder;<o:p></o:p></p>
<p class="MsoNormal"> import java.nio.charset.StandardCharsets;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> <span lang="EN-US">modelEvent = (ModelEvent) event;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> newUser = modelEvent.getFocusContext().getObjectNew();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> [snip]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> bodyMessage += "blah blah " + midpoint<span style="background:yellow;mso-highlight:yellow">.getDefaultHostname()</span> ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> return bodyMessage;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></code><o:p></o:p></p>
<p class="MsoNormal"> </script><o:p></o:p></p>
<p class="MsoNormal"> </bodyExpression><o:p></o:p></p>
<p class="MsoNormal"> <transport>mail</transport><o:p></o:p></p>
<p class="MsoNormal"> <transport>file:xxxxx</transport><o:p></o:p></p>
<p class="MsoNormal"> <span lang="EN-US"></simpleUserNotifier><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In the <mail> section I force the redirection to a file.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">However no email is sent because for each account activation there is an exception message:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ERROR (com.evolveum.midpoint.notifications.api.NotificationManager): Event couldn't be processed; event = ModelEventImpl{id=1642688194449-0-1,requester=SimpleObjectRef{oid='00000000-0000-0000-0000-000000000002', objectType=user:00000000-0000-0000-0000-000000000002(administrator)},requestee=SimpleObjectRef{oid='8ce2d1eb-d694-4ca1-b57d-026df2404457',
objectType=user:8ce2d1eb-d694-4ca1-b57d-026df2404457(aamod.utpal1)}}.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">com.evolveum.midpoint.util.exception.SystemException: com.evolveum.midpoint.util.exception.ExpressionEvaluationException: Groovy Evaluation Failed: No signature of method:
<span style="background:yellow;mso-highlight:yellow">com.evolveum.midpoint.model.impl.expr.MidpointFunctionsImpl.getDefaultHostname()</span> is applicable for argument types: () values: []<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Here I am lost because the getDefaultHostname used to be in the SystemConfigurationType class in 3.5 but was removed as soon as 4.0.1:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">https://evolveum.com/downloads/midpoint/3.5/midpoint-api-3.5-javadoc/com/evolveum/midpoint/xml/ns/_public/common/common_3/SystemConfigurationType.html<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><a href="https://evolveum.com/downloads/midpoint/4.0.1/midpoint-api-4.0.1-javadoc/com/evolveum/midpoint/xml/ns/_public/common/common_3/SystemConfigurationType.html">https://evolveum.com/downloads/midpoint/4.0.1/midpoint-api-4.0.1-javadoc/com/evolveum/midpoint/xml/ns/_public/common/common_3/SystemConfigurationType.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regarding the MidpointFunctionsImpl class. I am not able to find any reference to a getDefaultHostName method : <a href="https://evolveum.com/downloads/midpoint/4.0.2/midpoint-4.0.2-javadoc/com/evolveum/midpoint/model/impl/expr/MidpointFunctionsImpl.html">https://evolveum.com/downloads/midpoint/4.0.2/midpoint-4.0.2-javadoc/com/evolveum/midpoint/model/impl/expr/MidpointFunctionsImpl.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">As stated above this functionality was working in midpoint 4.0.1, could you please explain me where to find the new method or if there is something broken in 4.4 ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you very much for your precious help.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="188" style="width:141.0pt;border:none;border-right:solid #FF1738 2.25pt;padding:0cm 7.5pt 0cm 0cm">
<p class="MsoNormal" align="right" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:right">
<a href="https://www.positivethinking.tech/"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:FR-CH;text-decoration:none"><img border="0" width="170" height="79" style="width:1.7708in;height:.8229in" id="_x0000_i1031" src="cid:image001.png@01D80E16.AA2A06E0" alt="logo"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><o:p></o:p></span></p>
</td>
<td width="10" style="width:7.5pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"> <o:p></o:p></span></p>
</td>
<td width="497" valign="top" style="width:372.75pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:#FF0044;mso-fareast-language:FR-CH">Sébastien Marbrier</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:#FF0044;mso-fareast-language:FR-CH">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"> | Senior IT Consultant<br>
</span><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"><a href="mailto:smarbrier@positivethinking.tech"><span lang="EN-US" style="color:#FF0044">smarbrier@positivethinking.tech</span></a></span><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH">
</span><span lang="EN-US" style="font-size:5.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"><br>
</span><span lang="EN-US" style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"><br>
Tel. </span><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"><a href="tel:+41%2021%20601%2081%2000"><span style="color:#777777;text-decoration:none">+41 21 601 81 00</span></a>
</span><span style="font-size:5.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"><br>
</span><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><a href="https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:FR-CH;text-decoration:none"><img border="0" width="20" height="20" style="width:.2083in;height:.2083in" id="_x0000_i1030" src="cid:image002.png@01D80E16.AA2A06E0" alt="Teams chat"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><a href="https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech"><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777;text-decoration:none"> </span></a>
<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><a href="https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech"><span lang="EN-US" style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777">Chat
with me on Teams</span></a></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH">
<span lang="EN-US"><o:p></o:p></span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US" style="font-size:1.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"><br>
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border:none;border-right:solid #FF1738 2.25pt;padding:0cm 7.5pt 0cm 0cm">
<p class="MsoNormal" align="right" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:right">
<span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><br>
</span><a href="https://www.linkedin.com/company/the-positive-thinking-company/" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:FR-CH;text-decoration:none"><img border="0" width="20" height="20" style="width:.2083in;height:.2083in" id="_x0000_i1029" src="cid:image003.png@01D80E16.AA2A06E0" alt="LinkedIn"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH">
</span><a href="https://www.instagram.com/positivethinkingcompany/" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:FR-CH;text-decoration:none"><img border="0" width="20" height="20" style="width:.2083in;height:.2083in" id="_x0000_i1028" src="cid:image004.png@01D80E16.AA2A06E0" alt="Instagram"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH">
</span><a href="https://twitter.com/PTC_Tech" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:FR-CH;text-decoration:none"><img border="0" width="20" height="20" style="width:.2083in;height:.2083in" id="_x0000_i1027" src="cid:image005.png@01D80E16.AA2A06E0" alt="Vimeo"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH">
</span><a href="https://youtube.com/channel/UCfaImWa6r0IoZoUYLhbiF7w" target="_blank"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue;mso-fareast-language:FR-CH;text-decoration:none"><img border="0" width="20" height="20" style="width:.2083in;height:.2083in" id="_x0000_i1026" src="cid:image006.png@01D80E16.AA2A06E0" alt="Vimeo"></span></a><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><o:p></o:p></span></p>
</td>
<td valign="bottom" style="padding:0cm 0cm 0cm 0cm"></td>
<td valign="bottom" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH">Avenue de cour, 135 – 1007 Lausanne<br>
<a href="https://www.positivethinking.tech/"><span style="color:#FF0044">www.positivethinking.tech</span></a>
<br>
</span><span style="font-size:3.5pt;font-family:"Tahoma",sans-serif;color:#777777;mso-fareast-language:FR-CH"> </span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:8.0pt;font-family:Roboto;color:#FF0044;mso-fareast-language:FR-CH">Help save paper, do you really need to print this email?</span></b><span lang="EN-US" style="font-size:8.0pt;font-family:Roboto;color:#FF0044;mso-fareast-language:FR-CH">
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:FR-CH"><br>
</span><i><span lang="EN-US" style="font-size:8.0pt;font-family:Roboto;color:#777777;mso-fareast-language:FR-CH">The content of this email and any attachments are confidential and are intended solely for the person and/or company to whom they are addressed.
The information may also be legally privileged. No employee or agent is authorized to conclude any binding agreement on behalf of Positive Thinking Company with another party by email without express written confirmation. If you have received this email in
error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by return E-mail and delete this message, its attachments and all copies from your system.
Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions.
</span></i><i><span style="font-size:8.0pt;font-family:Roboto;color:#777777;mso-fareast-language:FR-CH">Thank you for your cooperation.
<br>
</span></i><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p></p>
<hr>
<span style="font-size:8px"><em><span style="font-family:Roboto,Arial"><span style="color:#777777">Positive Thinking Company puts security at a high priority in its conduct of business. Therefore, we have put our best efforts into ensuring that this email and
its attached documents are error and virus-free. Nonetheless, full security of emails/documents cannot be ensured. Therefore, the recipient is responsible for checking the email/documents for threats with its own security measures, prior to opening it. Positive
Thinking Company does not accept liability for any damage inflicted by using the content of this email/documents. If you are not the intended recipient, please notify the sender and delete this email/document.</span></span></em></span>
<p></p>
</body>
</html>