<div dir="ltr">You shouldn't need to define another complex type, all your user extensions could be under <xsd:complexType name="UserExtensionType"><div><br></div><div><div style="font-size:12.8px"><xsd:complexType name="UserTypeExtensionType"></div><div style="font-size:12.8px">        <xsd:annotation></div><div style="font-size:12.8px">            <xsd:appinfo></div><div style="font-size:12.8px">                <a:extension ref="c:UserType"/></div><div style="font-size:12.8px">            </xsd:appinfo></div><div style="font-size:12.8px">        </xsd:annotation></div><div style="font-size:12.8px">        <xsd:sequence></div><div style="font-size:12.8px">            <span style="font-family:-apple-system,blinkmacsystemfont,sans-serif;font-size:14px"><xsd:element name="jobTitle" type="xsd:string" minOccurs="0" maxOccurs="1"></span></div><span class="m_5670823781704180452gmail-im" style="font-family:-apple-system,blinkmacsystemfont,sans-serif;font-size:14px"><div>                   <xsd:annotation></div><div>                       <xsd:appinfo></div><div>                            <a:indexed>true</a:indexed></div></span><div style="font-family:-apple-system,blinkmacsystemfont,sans-serif;font-size:14px">                            <a:displayName>job title</a:displayName></div><div style="font-family:-apple-system,blinkmacsystemfont,sans-serif;font-size:14px">                            <a:displayOrder>310</a:display<wbr>Order></div><span class="m_5670823781704180452gmail-im" style="font-family:-apple-system,blinkmacsystemfont,sans-serif;font-size:14px"><div>                      </xsd:appinfo></div><div>                  </xsd:annotation></div><div>            </xsd:element></div></span><div style="font-size:12.8px">            <xsd:element name="another1" type="xsd:string" minOccurs="0" maxOccurs="1"></div><div style="font-size:12.8px">                <xsd:annotation></div><div style="font-size:12.8px">                    <xsd:appinfo></div><div style="font-size:12.8px">                        <a:indexed>true</a:indexed></div><div style="font-size:12.8px">                        <a:displayName><span style="font-size:12.8px">Another 1</span></a:displayName></div><div style="font-size:12.8px">                        <a:displayOrder>160</a:display<wbr>Order></div><div style="font-size:12.8px">                    </xsd:appinfo></div><div style="font-size:12.8px">                </xsd:annotation></div><div style="font-size:12.8px">            </xsd:element></div><div style="font-size:12.8px"><div style="font-size:12.8px">            <xsd:element name="another2" type="xsd:string" minOccurs="0" maxOccurs="1"></div><div style="font-size:12.8px">                <xsd:annotation></div><div style="font-size:12.8px">                    <xsd:appinfo></div><div style="font-size:12.8px">                        <a:indexed>true</a:indexed></div><div style="font-size:12.8px">                        <a:displayName><span style="font-size:12.8px">Another 2</span></a:displayName></div><div style="font-size:12.8px">                        <a:displayOrder>170</a:display<wbr>Order></div><div style="font-size:12.8px">                    </xsd:appinfo></div><div style="font-size:12.8px">                </xsd:annotation></div><div style="font-size:12.8px">            </xsd:element></div></div><div style="font-size:12.8px">        </xsd:sequence></div><div style="font-size:12.8px">    </xsd:complexType></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">If that is really what you are trying to do, you just need to add the extension reference to usertype,</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div style="font-size:12.8px"><xsd:complexType name="JobType"></div><div style="font-size:12.8px"><font color="#ff0000">        <xsd:annotation></font></div><div style="font-size:12.8px"><font color="#ff0000">            <xsd:appinfo></font></div><div style="font-size:12.8px"><font color="#ff0000">                <a:extension ref="c:UserType"/></font></div><div style="font-size:12.8px"><font color="#ff0000">            </xsd:appinfo></font></div><div style="font-size:12.8px"><font color="#ff0000">        </xsd:annotation></font></div><div style="font-size:12.8px"><xsd:sequence></div><div style="font-size:12.8px"><xsd:element name="jobTitle" type="xsd:string" minOccurs="0" maxOccurs="1"></div><div style="font-size:12.8px"><xsd:annotation></div><div style="font-size:12.8px"><xsd:appinfo></div><div style="font-size:12.8px"><a:indexed>true</a:indexed></div><div style="font-size:12.8px"><a:displayName>job title</a:displayName></div><div style="font-size:12.8px"><a:displayOrder>310</a:<wbr>displayOrder></div><div style="font-size:12.8px"></xsd:appinfo></div><div style="font-size:12.8px"></xsd:annotation></div><div style="font-size:12.8px"></xsd:element></div><div style="font-size:12.8px"></xsd:sequence></div><div style="font-size:12.8px"></xsd:complexType></div></div><div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_5670823781704180452gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">JASON</div></div></div>
<br><div class="gmail_quote">On Wed, Mar 1, 2017 at 8:51 AM, Dmitriy Berezkin <span dir="ltr"><<a href="mailto:berezkin.dmitriy@gmail.com" target="_blank">berezkin.dmitriy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>
<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 <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> 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><span>
<div><xsd:annotation></div>
<div><xsd:appinfo></div>
<div><a:indexed>true</a:indexed></div>
</span><div><a:displayName>job title</a:displayName></div>
<div><a:displayOrder>310</a:display<wbr>Order></div><span>
<div></xsd:appinfo></div>
<div></xsd:annotation></div>
<div></xsd:element></div>
<div></xsd:sequence></div>
<div></xsd:complexType></div>
</span></div>
<div><br></div>
<div>
<div>And now I can see custom fields in midpoint:</div>
</div>
<div><img src="cid:1C2F18B8C3B246258DB1835EA87C79C2"><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.IllegalStateExceptio<wbr>n: Cannot parse as {<a href="http://example.com/xml/ns/mySchema%7DJobType" target="_blank">http://example.com/xml/ns/myS<wbr>chema}JobType</a>: parser ValueParser(DOMe, {<a href="http://example.com/xml/ns/mySchema%7Djobs" target="_blank">http://example.com/xml/ns/myS<wbr>chema}jobs</a>: 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><div class="m_5670823781704180452h5">
<div name="messageReplySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif"><br>
On 22 февр. 2017 г., 21:31 +0300, Jason Everling <<a href="mailto:jeverling@bshp.edu" target="_blank">jeverling@bshp.edu</a>>, 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" target="_blank">http://midpoi<wbr>nt.bshp.edu/bshp</a>"</div>
<div>xmlns:tns="<a href="http://midpoint.bshp.edu/bshp" target="_blank">http://midpoint.bsh<wbr>p.edu/bshp</a>"</div>
<div>            xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.evolv<wbr>eum.com/xml/ns/public/common/<wbr>common-3</a>"</div>
<div>            xmlns:a="<a href="http://prism.evolveum.com/xml/ns/public/annotation-3" target="_blank">http://prism.evolveum<wbr>.com/xml/ns/public/annotation-<wbr>3</a>"</div>
<div>            xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2<wbr>001/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<wbr>></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:display<wbr>Order></div>
<div>                        <a:help><a href="mailto:someone@example.com" target="_blank">someone@example.com</a></a<wbr>: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:displ<wbr>ayName></div>
<div>                        <a:displayOrder>160</a:display<wbr>Order></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:<wbr>displayName></div>
<div><a:displayOrder>170</a:display<wbr>Order></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="m_5670823781704180452m_4207201061685614402gmail_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="m_5670823781704180452m_4207201061685614402gmail-h5">
<div>
<div class="m_5670823781704180452m_4207201061685614402gmail-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="m_5670823781704180452m_4207201061685614402gmail-h5">
<div>
<div class="m_5670823781704180452m_4207201061685614402gmail-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="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><br>
<br clear="all"></font></span>
<div><span class="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888"><br></font></font></span></div>
<span class="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888">--<br></font></font></span>
<div class="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail-m_8526714387436473393gmail_signature"><span class="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888">s pozdravom</font></font></span>
<div><span class="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888"><br></font></font></span></div>
<div><span class="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail-HOEnZb"><font color="#888888"><font color="#888888">Gustáv Pálos</font></font></span></div>
</div>
</div>
</blockquote>
</div>
<span class="m_5670823781704180452m_4207201061685614402gmail-HOEnZb"><font color="#888888"><br>
<br clear="all"></font></span>
<div><span class="m_5670823781704180452m_4207201061685614402gmail-HOEnZb"><font color="#888888"><br></font></span></div>
<span class="m_5670823781704180452m_4207201061685614402gmail-HOEnZb"><font color="#888888">--<br></font></span>
<div class="m_5670823781704180452m_4207201061685614402gmail-m_-3592376083088728301gmail_signature">
<div dir="ltr">
<div><span class="m_5670823781704180452m_4207201061685614402gmail-HOEnZb"><font color="#888888">Gustáv Pálos</font></span></div>
<div><span class="m_5670823781704180452m_4207201061685614402gmail-HOEnZb"><font color="#888888">Identity Engineer</font></span></div>
<span class="m_5670823781704180452m_4207201061685614402gmail-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" 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>
<br></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" target="_blank">http://lists.evolveum.com/mail<wbr>man/listinfo/midpoint</a><br></blockquote>
</div>
</div></div></div>

<br>______________________________<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><br></div></div>