[midPoint] [Midpoint 4.4] Prism API change broke my script.

Richard Richter virgo at evolveum.com
Fri Jan 14 15:38:26 CET 2022


Hi Sebastien 

There is a couple of options, depending on the script you are in, so you may try them one by one: 
- sometimes prismContext is available in the script directly, 
- typically, midpoint is available, which provides PrismContext via property: midpoint.prismContext.deltaFor(... etc. 
- in an unlikely situation that these two method above do not work, you can go extreme with PrismContext.get(), but the examples above are definitely more idiomatic in scripts 

Cheers 

Richard Richter 
Evolveum 
midPoint Developer 


From: "midPoint General Discussion" <midpoint at lists.evolveum.com> 
To: "midPoint General Discussion" <midpoint at lists.evolveum.com> 
Cc: "Sébastien MARBRIER" <smarbrier at positivethinking.tech> 
Sent: Friday, January 14, 2022 2:02:50 PM 
Subject: [midPoint] [Midpoint 4.4] Prism API change broke my script. 



Hello, 



In previous releases of midpoint, I was able to retrieve an ItenDelta this way: 

deltaItem= modelContext.getPrismContext().deltaFor(UserType.class).item(PrismConstants.EXTENSION_LOCAL_NAME, dateAcceptationCharteName).add(mydate).asItemDelta(); 



Unfortunately since midpoint 4.4 the getPrismContext method is no longer into the LensContext class ( [ https://evolveum.com/downloads/midpoint/4.0.1/midpoint-4.0.1-javadoc/com/evolveum/midpoint/model/impl/lens/LensContext.html | https://evolveum.com/downloads/midpoint/4.0.1/midpoint-4.0.1-javadoc/com/evolveum/midpoint/model/impl/lens/LensContext.html ] ) 



The compiler suggests me to replace the getPrismContext by the GetFocusContext() and after I have done the change, to replace deltaFor by iterator but I am pretty sure it misleads me. 



My idea would be to create an ItemDelta object directly but I do not understand how do it. 

Can somebody help ? 



Thanks 



[ https://www.positivethinking.tech/ ] 	

	

Sébastien Marbrier | Senior IT Consultant 
[ mailto:smarbrier at positivethinking.tech | smarbrier at positivethinking.tech ] 

Tel. +41 21 601 81 00 


[ https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech ] 	

[ https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech |   ] 	

[ https://teams.microsoft.com/l/chat/0/0?users=smarbrier@positivethinking.tech | Chat
 with me on Teams ] 






[ https://www.linkedin.com/company/the-positive-thinking-company/ ] [ https://www.instagram.com/positivethinkingcompany/ ] [ https://twitter.com/PTC_Tech ] [ https://youtube.com/channel/UCfaImWa6r0IoZoUYLhbiF7w ] 		

Avenue de cour, 135 – 1007 Lausanne 
[ https://www.positivethinking.tech/ | www.positivethinking.tech ] 



Help save paper, do you really need to print this email? 
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. Thank you for your cooperation. 












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. 


_______________________________________________ 
midPoint mailing list 
midPoint at lists.evolveum.com 
https://lists.evolveum.com/mailman/listinfo/midpoint 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220114/689c94ed/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7735 bytes
Desc: image001.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220114/689c94ed/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 686 bytes
Desc: image002.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220114/689c94ed/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2337 bytes
Desc: image003.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220114/689c94ed/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 2756 bytes
Desc: image004.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220114/689c94ed/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 2358 bytes
Desc: image005.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220114/689c94ed/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 2669 bytes
Desc: image006.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220114/689c94ed/attachment-0011.png>


More information about the midPoint mailing list