[midPoint] Add complex type element to user type

Jason Everling jeverling at bshp.edu
Wed Feb 22 19:27:19 CET 2017


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

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<xsd:schema elementFormDefault="qualified"
            targetNamespace="http://midpoint.bshp.edu/bshp"
xmlns:tns="http://midpoint.bshp.edu/bshp"
            xmlns:c="
http://midpoint.evolveum.com/xml/ns/public/common/common-3"
            xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<!-- Enumerated Objects -->
<xsd:simpleType name="bshpAffiliation">
<xsd:annotation>
<xsd:documentation>Choices for Affiliation</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
            <xsd:enumeration value="faculty">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>faculty</a:label>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="staff">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>staff</a:label>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="student">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>student</a:label>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="alumni">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>alumni</a:label>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="external">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>external</a:label>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <!-- User Extension -->

    <xsd:complexType name="UserTypeExtensionType">
        <xsd:annotation>
            <xsd:appinfo>
                <a:extension ref="c:UserType"/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="otherMailbox" type="xsd:string"
minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:indexed>true</a:indexed>
                        <a:displayName>Other Mailbox</a:displayName>
                        <a:displayOrder>120</a:displayOrder>
                        <a:help>someone at example.com</a:help>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="campus" type="xsd:string" minOccurs="0"
maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:indexed>true</a:indexed>
                        <a:displayName>Campus</a:displayName>
                        <a:displayOrder>160</a:displayOrder>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
<xsd:element name="bshpAffiliation" type="tns:bshpAffiliation"
minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:appinfo>
<a:indexed>true</a:indexed>
<a:displayName>Affiliation</a:displayName>
<a:displayOrder>170</a:displayOrder>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

JASON


On Wed, Feb 22, 2017 at 12:24 PM, Pálos Gustáv <gustav.palos at evolveum.com>
wrote:

> Hi Dmitry,
>
> do you checked for example this sample?
> https://github.com/Evolveum/midpoint/blob/master/samples/sch
> ema/extension-samples.xsd
>
> best regards,
>
> Gustav
>
>
>> 2017-02-22 18:49 GMT+01:00 Dmitriy Berezkin <berezkin.dmitriy at gmail.com>:
>>
>>> Hi!
>>>
>>> Could you tell me how I can extend UserType with complexType object?
>>>
>>> I tried to add <xsd:complexType> under <xsd:sequence> of my custom xsd
>>> but got error:
>>>
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean with name 'repositoryFactory': Injection of autowired dependencies
>>> failed; nested exception is org.springframework.beans.factory.BeanCreationException:
>>> Could not autowire field: private com.evolveum.midpoint.prism.PrismContext
>>> com.evolveum.midpoint.init.RepositoryFactory.prismContext; nested
>>> exception is org.springframework.beans.factory.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.BeanInstantiationException:
>>> Failed to instantiate [com.evolveum.midpoint.prism.PrismContext]:
>>> Factory method 'createInitializedPrismContext' threw exception; nested
>>> exception is com.evolveum.midpoint.util.exception.SchemaException: XML
>>> error during XSD schema parsing: *Unexpected <xsd:complexType> appears
>>> at line 65 column 42(embedded exception null)* in file
>>> C:\midpoint\schema\test1.xsd
>>>
>>>
>>> Do you have any example of using complexType attribute
>>> with UserExtensionType?
>>>
>>> ---
>>> Dmitry
>>>
>>> _______________________________________________
>>> midPoint mailing list
>>> midPoint at lists.evolveum.com
>>> http://lists.evolveum.com/mailman/listinfo/midpoint
>>>
>>>
>>
>>
>> --
>> s pozdravom
>>
>> Gustáv Pálos
>>
>
>
>
> --
> Gustáv Pálos
> Identity Engineer
> evolveum.com
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170222/98a90b4f/attachment.htm>


More information about the midPoint mailing list