[midPoint] Access to UserType extensions from model-client

Nicolas Rossi nrossi at identicum.com
Wed Feb 8 00:56:37 CET 2017


Hi guys, we have a customer with a User schema extension and we are trying
to access this data using the API of UserType from external Java
application. We get the user with the model-client example but we couldn't
find the way to acces the extension properties. Here is an example:

ModelPortType modelPort = createModelPort();
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new
Holder<OperationResultType>();
SelectorQualifiedGetOptionsType options = new
SelectorQualifiedGetOptionsType();
modelPort.getObject(ModelClientUtil.getTypeQName(UserType.class),
"2f749a40-d535-470b-ba7d-639adc364a52", options, objectHolder,
resultHolder);
UserType user = (UserType) objectHolder.value;
ExtensionType et = user.getExtension();

for(int i=0; i < et.getAny().size(); i++)
{
Object o = et.getAny().get(i);
System.out.println("Extension --> " + o.toString());
}

Looking at the email sent from Ana Pereyra to the mailing list last week
asking about writing Extension Attributes I guees we should code something
like that:

QName relationQName = new QName("http://midpoint.identicum.com/xml/ns/metaP
<http://midpoint.identicum.com/xml/ns/metaAssignment>erson",
"extensionAttribute");
ExtensionType ext = new ExtensionType();
ext.asPrismContainerValue().getPropertyRealValue(relationQName);

But I don't have access to "asPrismContainerValue" method on the extension
type. I have been looking on github examples but there is no reference to
access this values. Has anyone tried this before ?

Thranks in advance,



Ing Nicolás Rossi
Identicum S.A.
Jorge Newbery 3226
Tel: +54 (11) 4552-3050
www.identicum.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170207/bcc8f1b8/attachment.htm>


More information about the midPoint mailing list