<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi Dmitriy,</p>
<p>not sure what are you trying to achieve, but the most complicated
thing I ever needed in schema extension was enumeration (which
could be replaced by lookup tables now...)</p>
<p>This is an example from my schema extension for roles.<br>
</p>
<p>...</p>
<p> <xsd:simpleType name="XServiceIntegrationType"><br>
<xsd:annotation><br>
<xsd:documentation>Enum for X
IntegrationType</xsd:documentation><br>
<xsd:appinfo><br>
<a:displayName>X Integration
Type</a:displayName><br>
<a:displayOrder>150</a:displayOrder><br>
</xsd:appinfo><br>
</xsd:annotation><br>
<xsd:restriction base="xsd:string"><br>
<xsd:enumeration value="LEVEL0"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:label>LEVEL0</a:label><br>
</xsd:appinfo><br>
</xsd:annotation><br>
</xsd:enumeration><br>
<xsd:enumeration value="LEVEL0A"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:label>LEVEL0A</a:label><br>
</xsd:appinfo><br>
</xsd:annotation><br>
</xsd:enumeration><br>
<xsd:enumeration value="LEVEL0M"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:label>LEVEL0M</a:label><br>
</xsd:appinfo><br>
</xsd:annotation><br>
</xsd:enumeration><br>
<xsd:enumeration value="LEVEL1"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:label>LEVEL1</a:label><br>
</xsd:appinfo><br>
</xsd:annotation><br>
</xsd:enumeration><br>
<xsd:enumeration value="LEVEL2"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:label>LEVEL2</a:label><br>
</xsd:appinfo><br>
</xsd:annotation><br>
</xsd:enumeration><br>
<xsd:enumeration value="LEVEL3"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:label>LEVEL3</a:label><br>
</xsd:appinfo><br>
</xsd:annotation><br>
</xsd:enumeration><br>
</xsd:restriction><br>
</xsd:simpleType><br>
...</p>
<p> <xsd:complexType name="RoleTypeExtensionType"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:extension ref="c:RoleType"/><br>
</xsd:appinfo><br>
</xsd:annotation><br>
<xsd:sequence><br>
<xsd:element name="<b>xxxServiceIntegrationType</b>" type="<b>tns:XServiceIntegrationType</b>"
minOccurs="0"><br>
<xsd:annotation><br>
<xsd:appinfo><br>
<a:indexed>true</a:indexed><br>
<a:displayName>X Service Integration
Type</a:displayName><br>
<a:displayOrder>150</a:displayOrder><br>
</xsd:appinfo><br>
</xsd:annotation><br>
</xsd:element><br>
...<br>
</xsd:sequence><br>
</xsd:complexType><br>
...<br>
</p>
Regards,<br>
Ivan<br>
<br>
<div class="moz-cite-prefix">On 03/01/2017 03:51 PM, Dmitriy
Berezkin wrote:<br>
</div>
<blockquote cite="mid:5884600e-2e5e-4699-8bd4-ad43bd807826@Spark"
type="cite">
<title></title>
<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 class="moz-txt-link-freetext" href="https://github.com/Evolveum/midpoint/blob/master/samples/schema/extension-samples.xsd">https://github.com/Evolveum/midpoint/blob/master/samples/schema/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>
<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:part1.2F57FD97.03D210FB@evolveum.com"
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 {<a class="moz-txt-link-freetext" href="http://example.com/xml/ns/mySchema">http://example.com/xml/ns/mySchema</a>}JobType: parser ValueParser(DOMe, {<a class="moz-txt-link-freetext" href="http://example.com/xml/ns/mySchema">http://example.com/xml/ns/mySchema</a>}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
<a class="moz-txt-link-rfc2396E" href="mailto:jeverling@bshp.edu"><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
moz-do-not-send="true"
href="http://midpoint.bshp.edu/bshp">http://midpoint.bshp.edu/bshp</a>"</div>
<div>xmlns:tns="<a moz-do-not-send="true"
href="http://midpoint.bshp.edu/bshp">http://midpoint.bshp.edu/bshp</a>"</div>
<div> xmlns:c="<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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
moz-do-not-send="true"
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
moz-do-not-send="true"
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 moz-do-not-send="true"
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
moz-do-not-send="true"
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
moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:midPoint@lists.evolveum.com"
target="_blank">midPoint@lists.evolveum.com</a><br>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a moz-do-not-send="true"
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>
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Ivan Noris
Senior Identity Engineer
evolveum.com
</pre>
</body>
</html>