<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="Roboto">Hi,</font></p>
<p><font face="Roboto">I had some scratches since my customAttribute
is a multivalued one. By the way, I have succesfully made this
using the following code:<br>
<br>
import com.evolveum.midpoint.prism.delta.*;<br>
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;<br>
import com.evolveum.midpoint.prism.path.ItemPath;<br>
import javax.xml.namespace.QName;<br>
import com.evolveum.midpoint.prism.PrismConstants;<br>
<br>
UserType user = (UserType) focus;<br>
<br>
def attributeName = "documentalVisibility"<br>
def NameSpace = <a class="moz-txt-link-rfc2396E" href="http://my.custom.namespace/xml/ns/mise">"http://my.custom.namespace/xml/ns/mise"</a>;<br>
<br>
def attributeQName = new QName(NS, attr_name)<br>
def attributeItemPath = new
ItemPath(PrismConstants.EXTENSION_LOCAL_NAME, attr_QNAME);<br>
def attributeValues = basic.getExtensionPropertyValues(user,
NameSpace, attributeName).toArray();<br>
def mod =
ObjectDelta.createModificationDeleteProperty(UserType.class,
user.getOid(), attributeItemPath, prismContext,
attributeValues);<br>
<br>
modelContext.getFocusContext().addPrimaryDelta(mod)<br>
modelContext.rot();<br>
</font></p>
<p>Thank you Arnost,<br>
Marco<br>
</p>
<br>
<div class="moz-cite-prefix">On 10/26/2017 07:46 PM, Arnošt Starosta
- AMI Praha a.s. wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGPA3FLqgFPn6ADDhZtxCWGVZxTLOArgEq=Ah-WN3ZsC75qaMA@mail.gmail.com">
<div dir="ltr">You can use an ItemPath like this
<div><br>
</div>
<div>new ItemPath(PrismConstants.EXTENSION_LOCAL_NAME, new
QName('<a href="http://your" moz-do-not-send="true">http://your</a>
extension namespace', attributeName))<br>
</div>
<div><br>
</div>
<div>If you added your extension attribute in the example xsd
provided with the overlay project and didn't change the
namespace, the default namespace is '<a
href="http://example.com/xml/ns/midpoint/schema/extension-3"
moz-do-not-send="true">http://example.com/xml/ns/midpoint/schema/extension-3</a>'.</div>
<div><br>
</div>
<div>arnost</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-10-26 18:31 GMT+02:00 Marco
Benucci <span dir="ltr"><<a href="mailto:m.benucci@nsr.it"
target="_blank" moz-do-not-send="true">m.benucci@nsr.it</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thank you for your reply. <br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">I'm doing this right now!<br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">How can I add the modificationDeleteProperty
of a customAttribute? I'm having troubles with it ItemPath
and QNames... <br>
</div>
<div class="HOEnZb">
<div class="h5">
<div dir="ltr"><br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr"><br>
</div>
<div class="m_4589299420285113920wps_quotion">Il 26 ott
2017 6:21 PM, Arnošt Starosta - AMI Praha a.s. <<a
href="mailto:arnost.starosta@ami.cz" target="_blank"
moz-do-not-send="true">arnost.starosta@ami.cz</a>>
ha scritto:<br type="attribution">
<blockquote class="m_4589299420285113920quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div dir="ltr">Hi Marco,
<div><br>
</div>
<div>i sometimes inject changes in the primary
delta. is that a good practice? don't know, but
it works</div>
<div><br>
</div>
<div>mod = ObjectDelta.<wbr>createModificationDeleteProper<wbr>ty(...)</div>
<div>primary.swallow(mod)</div>
<div><br>
</div>
<div>?<br>
</div>
<div><br>
</div>
<div>if this does not work, try to tell midpoint
to recompute the context with</div>
<div><br>
</div>
<div>modelContext.rot()</div>
<div><br>
</div>
<div>hope this helps</div>
<div><br>
</div>
<div>arnost</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-10-26 15:42
GMT+02:00 Marco Benucci <span dir="ltr"><<a
href="mailto:m.benucci@nsr.it"
target="_blank" moz-do-not-send="true">m.benucci@nsr.it</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p><font face="Roboto">Hi,</font></p>
<p><font face="Roboto">we are running
midPoint 3.6 and we'd like to remove the
value of a multi-valued extion-attribute
named "documentalVisibility" when
another extension-attribute (named
primaryOrganization) is changed.<br>
<br>
I thought that we could use <a
class="m_4589299420285113920m_-6475601757804285234moz-txt-link-freetext"
href="https://wiki.evolveum.com/display/midPoint/Scripting+Hooks"
target="_blank" moz-do-not-send="true">https://wiki.evolveum.com/<wbr>display/midPoint/Scripting+<wbr>Hooks</a>.</font></p>
<p><font face="Roboto">We can check if the
attribute primaryOrganization is changed
looking in <br>
modelContext.<wbr>getPrimaryChanges(), <br>
but we cannot recreate a delete delta
that </font>can be used in the <br>
modelContext.getFocusContext()<wbr>.swallowToSecondaryDelta()...<br>
<br>
Can you help me?<br>
<br>
Thank you,<br>
Marco</p>
<p><br>
</p>
</div>
<br>
______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com"
target="_blank" moz-do-not-send="true">midPoint@lists.evolveum.com</a><br>
<a
href="http://lists.evolveum.com/mailman/listinfo/midpoint"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_4589299420285113920gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<table
style="font-family:Verdana,Arial,Helvetica,sans-serif;border-collapse:collapse;padding:0px;margin:0px;border-width:0px!important;border-style:solid!important;width:482px!important">
<tbody>
<tr
style="padding:0px;margin:0px;border:0px
solid gray!important">
<td
style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:160px;vertical-align:bottom;padding:0px;border:0px
solid gray!important">
<p><span
style="font-size:14px;font-weight:bold">Arnošt
Starosta</span><br>
solution architect<br>
<br>
gsm: <a
href="tel:+420%20603%20794%20932"
value="+420603794932"
target="_blank"
moz-do-not-send="true">[+420]
603 794 932</a><br>
e-mail: <a
href="mailto:arnost.starosta@ami.cz"
target="_blank"
moz-do-not-send="true">arnost.starosta@ami.cz</a></p>
</td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right:1px
solid
rgb(204,204,204);padding:0px;border-top:0px
solid
gray!important;border-bottom:0px
solid
gray!important;border-left:0px
solid gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px
solid gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;vertical-align:bottom;padding:0px;width:123px;border:0px
solid gray!important">
<p>AMI Praha a.s.<br>
Pláničkova 11<br>
162 00 Praha 6<br>
tel.: <a
href="tel:+420%20274%20783%20239"
value="+420274783239"
target="_blank"
moz-do-not-send="true">[+420]
274 783 239</a><br>
web: <a
href="http://www.ami.cz/"
target="_blank"
moz-do-not-send="true">www.ami.cz</a></p>
</td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right:1px
solid
rgb(204,204,204);padding:0px;border-top:0px
solid
gray!important;border-bottom:0px
solid
gray!important;border-left:0px
solid gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px
solid gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;margin:8px;border:0px
solid gray!important;width:116px">
<p><img
src="http://www.ami.cz/images/podpis/ami_logo.gif"
alt="AMI Praha a.s."
style="border:0px"
moz-do-not-send="true"></p>
</td>
</tr>
<tr
style="padding:0px;margin:0px;border:0px
solid gray!important">
<td colspan="7"
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;width:480px;border:0px
solid gray!important"><br>
<a
href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management"
target="_blank"
moz-do-not-send="true"><img
src="http://www.ami.cz/images/podpis/AMI-podpis-IdM_1.png"
alt="AMI Praha a.s."
style="border:0px;width:480px!important;height:82px!important"
moz-do-not-send="true"></a></td>
</tr>
<tr
style="padding:0px;margin:0px;border:0px
solid gray!important">
<td colspan="7"
style="color:rgb(128,128,128);font-family:Arial,sans-serif;font-size:11px;padding:0px;border:0px
solid gray!important"><br>
Textem tohoto e-mailu podepisující
neslibuje uzavřít ani neuzavírá za
společnost AMI Praha a.s.<br>
jakoukoliv smlouvu. Každá smlouva,
pokud bude uzavřena, musí mít
výhradně písemnou formu.<br>
<br>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<table
style="font-family:Verdana,Arial,Helvetica,sans-serif;border-collapse:collapse;padding:0px;margin:0px;border-width:0px!important;border-style:solid!important;width:482px!important">
<tbody>
<tr style="padding:0px;margin:0px;border:0px solid
gray!important">
<td
style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:160px;vertical-align:bottom;padding:0px;border:0px
solid gray!important">
<p><span style="font-size:14px;font-weight:bold">Arnošt
Starosta</span><br>
solution architect<br>
<br>
gsm: [+420] 603 794 932<br>
e-mail: <a
href="mailto:arnost.starosta@ami.cz"
target="_blank" moz-do-not-send="true">arnost.starosta@ami.cz</a></p>
</td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right:1px
solid
rgb(204,204,204);padding:0px;border-top:0px
solid gray!important;border-bottom:0px solid
gray!important;border-left:0px solid
gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px
solid gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;vertical-align:bottom;padding:0px;width:123px;border:0px
solid gray!important">
<p>AMI Praha a.s.<br>
Pláničkova 11<br>
162 00 Praha 6<br>
tel.: [+420] 274 783 239<br>
web: <a href="http://www.ami.cz/"
target="_blank" moz-do-not-send="true">www.ami.cz</a></p>
</td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;border-right:1px
solid
rgb(204,204,204);padding:0px;border-top:0px
solid gray!important;border-bottom:0px solid
gray!important;border-left:0px solid
gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;border:0px
solid gray!important"> </td>
<td
style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;margin:8px;border:0px
solid gray!important;width:116px">
<p><img
src="http://www.ami.cz/images/podpis/ami_logo.gif"
alt="AMI Praha a.s." style="border:0px"
moz-do-not-send="true"></p>
</td>
</tr>
<tr style="padding:0px;margin:0px;border:0px solid
gray!important">
<td colspan="7"
style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;padding:0px;width:480px;border:0px
solid gray!important"><br>
<a
href="http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management"
target="_blank" moz-do-not-send="true"><img
src="http://www.ami.cz/images/podpis/AMI-podpis-IdM_1.png"
alt="AMI Praha a.s."
style="border:0px;width:480px!important;height:82px!important"
moz-do-not-send="true"></a></td>
</tr>
<tr style="padding:0px;margin:0px;border:0px solid
gray!important">
<td colspan="7"
style="color:rgb(128,128,128);font-family:Arial,sans-serif;font-size:11px;padding:0px;border:0px
solid gray!important"><br>
Textem tohoto e-mailu podepisující neslibuje
uzavřít ani neuzavírá za společnost AMI Praha
a.s.<br>
jakoukoliv smlouvu. Každá smlouva, pokud bude
uzavřena, musí mít výhradně písemnou formu.<br>
<br>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>