<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Hi!
<div><br /></div>
<div>Thank you for example!</div>
<div><br /></div>
<div>Yes, I checked this link https://github.com/Evolveum/midpoint/blob/master/samples/schema/extension-samples.xsd and didnt found how complex element used in UserExtensionType.</div>
<div><br /></div>
<div>I added my custom object “JobType” to UserExtensionType like this:</div>
<div><xsd:element name="jobs" type="tns:JobType" minOccurs="0" maxOccurs="unbounded”/><br /></div>
<div><br /></div>
<div>Here is xsd part for “JobType":</div>
<div>
<div><xsd:complexType name="JobType"></div>
<div><xsd:sequence></div>
<div><xsd:element name="jobTitle" type="xsd:string" minOccurs="0" maxOccurs="1"></div>
<div><xsd:annotation></div>
<div><xsd:appinfo></div>
<div><a:indexed>true</a:indexed></div>
<div><a:displayName>job title</a:displayName></div>
<div><a:displayOrder>310</a:displayOrder></div>
<div></xsd:appinfo></div>
<div></xsd:annotation></div>
<div></xsd:element></div>
<div></xsd:sequence></div>
<div></xsd:complexType></div>
</div>
<div><br /></div>
<div>
<div>And now I can see custom fields in midpoint:</div>
</div>
<div><img src="cid:1C2F18B8C3B246258DB1835EA87C79C2" data-originalsrc="file:///Users/berezkin/Desktop/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202017-03-01%20%D0%B2%2017.48.41.png" /><br /></div>
<div><br /></div>
<div>But it gives me an error of I try to save them:</div>
<div><span style="color: rgb(51, 51, 51); font-family: monospace; font-size: 11px; white-space: pre-wrap; background-color: rgb(255, 255, 255);">Caused by: java.lang.IllegalStateException: Cannot parse as {http://example.com/xml/ns/mySchema}JobType: parser ValueParser(DOMe, {http://example.com/xml/ns/mySchema}jobs: 1)</span><br /></div>
</div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
---
<div>Dmitry</div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
On 22 февр. 2017 г., 21:31 +0300, Jason Everling <jeverling@bshp.edu>, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div dir="ltr">can you post what have so far? Here is ours, trimmed down of course as we have many types from orgs, roles, and user types
<div><br /></div>
<div>
<div><?xml version="1.0" encoding="UTF-8" standalone="yes"?></div>
<div><br /></div>
<div><xsd:schema elementFormDefault="qualified"</div>
<div>            targetNamespace="<a href="http://midpoint.bshp.edu/bshp">http://midpoint.bshp.edu/bshp</a>"</div>
<div>xmlns:tns="<a href="http://midpoint.bshp.edu/bshp">http://midpoint.bshp.edu/bshp</a>"</div>
<div>            xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"</div>
<div>            xmlns:a="<a href="http://prism.evolveum.com/xml/ns/public/annotation-3">http://prism.evolveum.com/xml/ns/public/annotation-3</a>"</div>
<div>            xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"></div>
<div><br /></div>
<div><!-- Enumerated Objects --></div>
<div><xsd:simpleType name="bshpAffiliation"></div>
<div><xsd:annotation></div>
<div><xsd:documentation>Choices for Affiliation</xsd:documentation></div>
<div></xsd:annotation></div>
<div><xsd:restriction base="xsd:string"></div>
<div>            <xsd:enumeration value="faculty"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:label>faculty</a:label></div>
<div>                    </xsd:appinfo></div>
<div>                </xsd:annotation></div>
<div>            </xsd:enumeration></div>
<div>            <xsd:enumeration value="staff"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:label>staff</a:label></div>
<div>                    </xsd:appinfo></div>
<div>                </xsd:annotation></div>
<div>            </xsd:enumeration></div>
<div>            <xsd:enumeration value="student"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:label>student</a:label></div>
<div>                    </xsd:appinfo></div>
<div>                </xsd:annotation></div>
<div>            </xsd:enumeration></div>
<div>            <xsd:enumeration value="alumni"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:label>alumni</a:label></div>
<div>                    </xsd:appinfo></div>
<div>                </xsd:annotation></div>
<div>            </xsd:enumeration></div>
<div>            <xsd:enumeration value="external"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:label>external</a:label></div>
<div>                    </xsd:appinfo></div>
<div>                </xsd:annotation></div>
<div>            </xsd:enumeration></div>
<div>        </xsd:restriction></div>
<div>    </xsd:simpleType></div>
<div><br /></div>
<div>    <!-- User Extension --></div>
<div><br /></div>
<div>    <xsd:complexType name="UserTypeExtensionType"></div>
<div>        <xsd:annotation></div>
<div>            <xsd:appinfo></div>
<div>                <a:extension ref="c:UserType"/></div>
<div>            </xsd:appinfo></div>
<div>        </xsd:annotation></div>
<div>        <xsd:sequence></div>
<div>            <xsd:element name="otherMailbox" type="xsd:string" minOccurs="0" maxOccurs="unbounded"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:indexed>true</a:indexed></div>
<div>                        <a:displayName>Other Mailbox</a:displayName></div>
<div>                        <a:displayOrder>120</a:displayOrder></div>
<div>                        <a:help><a href="mailto:someone@example.com">someone@example.com</a></a:help></div>
<div>                    </xsd:appinfo></div>
<div>                </xsd:annotation></div>
<div>            </xsd:element></div>
<div>            <xsd:element name="campus" type="xsd:string" minOccurs="0" maxOccurs="1"></div>
<div>                <xsd:annotation></div>
<div>                    <xsd:appinfo></div>
<div>                        <a:indexed>true</a:indexed></div>
<div>                        <a:displayName>Campus</a:displayName></div>
<div>                        <a:displayOrder>160</a:displayOrder></div>
<div>                    </xsd:appinfo></div>
<div>                </xsd:annotation></div>
<div>            </xsd:element></div>
<div><xsd:element name="bshpAffiliation" type="tns:bshpAffiliation" minOccurs="0" maxOccurs="1"></div>
<div><xsd:annotation></div>
<div><xsd:appinfo></div>
<div><a:indexed>true</a:indexed></div>
<div><a:displayName>Affiliation</a:displayName></div>
<div><a:displayOrder>170</a:displayOrder></div>
<div></xsd:appinfo></div>
<div></xsd:annotation></div>
<div></xsd:element></div>
<div>        </xsd:sequence></div>
<div>    </xsd:complexType></div>
<div></xsd:schema></div>
</div>
<div class="gmail_extra"><br clear="all" />
<div>
<div class="gmail_signature">
<div dir="ltr">JASON</div>
</div>
</div>
<div class="gmail_quote"><br /></div>
</div>
<div class="gmail_extra"><br />
<div class="gmail_quote">On Wed, Feb 22, 2017 at 12:24 PM, Pálos Gustáv <span dir="ltr"><<a href="mailto:gustav.palos@evolveum.com" target="_blank">gustav.palos@evolveum.com</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">Hi Dmitry,
<div><br /></div>
<div>do you checked for example this sample?</div>
<div><a href="https://github.com/Evolveum/midpoint/blob/master/samples/schema/extension-samples.xsd" target="_blank">https://github.com/Evolveum/mi<wbr />dpoint/blob/master/samples/sch<wbr />ema/extension-samples.xsd</a><br /></div>
<div><br /></div>
<div>best regards,</div>
<div><br /></div>
<div>Gustav</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;">
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div class="gmail-h5">
<div>
<div class="gmail-m_-3592376083088728301gmail-h5">2017-02-22 18:49 GMT+01:00 Dmitriy Berezkin <span dir="ltr"><<a href="mailto:berezkin.dmitriy@gmail.com" target="_blank">berezkin.dmitriy@gmail.com</a>></span>:<br /></div>
</div>
</div>
</div>
<blockquote class="gmail_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #d35400;">
<div>
<div class="gmail-h5">
<div>
<div class="gmail-m_-3592376083088728301gmail-h5">
<div>
<div name="messageBodySection">Hi!<br /></div>
<div name="messageReplySection"><br />
Could you tell me how I can extend UserType with complexType object?<br />
<br />
I tried to add <xsd:complexType> under <xsd:sequence> of my custom xsd but got error:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;">
<div name="messageBodySection">
<div>
<div>org.springframework.beans.fact<wbr />ory.BeanCreationException: Error creating bean with name 'repositoryFactory': Injection of autowired dependencies failed; nested exception is org.springframework.beans.fact<wbr />ory.BeanCreationException: Could not autowire field: private <a href="http://com.evolveum.midpoint.prism.Pr" target="_blank">com.evolveum.midpoint.prism.Pr</a><wbr />ismContext com.evolveum.midpoint.init.Rep<wbr />ositoryFactory.prismContext; nested exception is org.springframework.beans.fact<wbr />ory.BeanCreationException: Error creating bean with name 'prismContext' defined in class path resource [ctx-configuration.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.Bean<wbr />InstantiationException: Failed to instantiate [com.evolveum.midpoint.prism.P<wbr />rismContext]: Factory method 'createInitializedPrismContext<wbr />' threw exception; nested exception is com.evolveum.midpoint.util.exc<wbr />eption.SchemaException: XML error during XSD schema parsing: <b>Unexpected <xsd:complexType> appears at line 65 column 42(embedded exception null)</b> in file C:\midpoint\schema\test1.xsd</div>
</div>
</div>
</blockquote>
<br />
Do you have any example of using complexType attribute with UserExtensionType?<br />
<br />
---<br />
<div name="messageSignatureSection">
<div>Dmitry</div>
</div>
</div>
</div>
<br /></div>
</div>
</div>
</div>
______________________________<wbr />_________________<br />
midPoint mailing list<br />
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br />
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mail<wbr />man/listinfo/midpoint</a><br />
<br /></blockquote>
</div>
<span class="gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><br />
<br clear="all" /></font></span>
<div><span class="gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888"><br /></font></font></span></div>
<span class="gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888">--<br /></font></font></span>
<div class="gmail-m_-3592376083088728301gmail-m_8526714387436473393gmail_signature"><span class="gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888">s pozdravom</font></font></span>
<div><span class="gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888"><br /></font></font></span></div>
<div><span class="gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888">Gustáv Pálos</font></font></span></div>
</div>
</div>
</blockquote>
</div>
<span class="gmail-HOEnZb"><font color="#888888"><br />
<br clear="all" /></font></span>
<div><span class="gmail-HOEnZb"><font color="#888888"><br /></font></span></div>
<span class="gmail-HOEnZb"><font color="#888888">--<br /></font></span>
<div class="gmail-m_-3592376083088728301gmail_signature">
<div dir="ltr">
<div><span class="gmail-HOEnZb"><font color="#888888">Gustáv Pálos</font></span></div>
<div><span class="gmail-HOEnZb"><font color="#888888">Identity Engineer</font></span></div>
<span class="gmail-HOEnZb"><font color="#888888"><a href="http://evolveum.com/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">evolveum.com</a><br /></font></span></div>
</div>
</div>
</div>
<br />
______________________________<wbr />_________________<br />
midPoint mailing list<br />
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br />
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr />mailman/listinfo/midpoint</a><br />
<br /></blockquote>
</div>
<br /></div>
</div>
_______________________________________________<br />
midPoint mailing list<br />
midPoint@lists.evolveum.com<br />
http://lists.evolveum.com/mailman/listinfo/midpoint<br /></blockquote>
</div>
</body>
</html>