[midPoint] ComplexType inside Schema Extension?

Jason Everling jeverling at bshp.edu
Mon Jun 19 22:49:28 CEST 2017


Is there a reason for having to add a new complextype and not just use the
one already there and add your attributes? It would look like below,

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

    <xsd:complexType name="UserExtensionType">
        <xsd:annotation>
            <xsd:appinfo>
                <a:extension ref="c:UserType"/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
<xsd:element name="idExercicio" type="xsd:string"
minOccurs="1"></xsd:element>
<xsd:element name="dataInicioExercicio" type="xsd:dateTime"
minOccurs="1"></xsd:element>
        <xsd:element name="dataFimExercicio" type="xsd:dateTime"
minOccurs="0"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>



As for your way I think you have to reference the type,

    <xsd:complexType name="ExercicioType">
        <xsd:annotation>
            <xsd:appinfo>
                <a:extension ref="c:UserType"/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name ="idExercicio" type="xsd:string"
minOccurs="1"></xsd:element>
            <xsd:element name="dataInicioExercicio" type="xsd:dateTime"
minOccurs="1"></xsd:element>
            <xsd:element name="dataFimExercicio" type="xsd:dateTime"
minOccurs="0"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>


JASON

On Mon, Jun 19, 2017 at 3:35 PM, Alcides Carlos de Moraes Neto <
alcides.neto at gmail.com> wrote:

> Hello,
>
> I'm trying to create a user extension attribute that is a complexType. I'm
> able to import the schema, but I cannot save the object using the XML
> editor.
>
> Here's my XSD:
>
> <xsd:schema elementFormDefault="qualified"
>             targetNamespace="http://example.com/xml/ns/mySchema"
>             xmlns:tns="http://example.com/xml/ns/mySchema"
>             xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
>             xmlns:c="http://midpoint.evolveum.com/xml/ns/public/
> common/common-3"
>             xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>     <xsd:complexType name="UserExtensionType">
>         <xsd:annotation>
>             <xsd:appinfo>
>                 <a:extension ref="c:UserType"/>
>             </xsd:appinfo>
>         </xsd:annotation>
>         <xsd:sequence>
>         <xsd:element name="exercicio" minOccurs="0" maxOccurs="unbounded"
> type="tns:ExercicioType"></xsd:element>
>         </xsd:sequence>
>     </xsd:complexType>
>
>     <xsd:complexType name="ExercicioType">
>         <xsd:sequence>
>             <xsd:element name ="idExercicio" type="xsd:string"
> minOccurs="1"></xsd:element>
>             <xsd:element name="dataInicioExercicio" type="xsd:dateTime"
> minOccurs="1"></xsd:element>
>             <xsd:element name="dataFimExercicio" type="xsd:dateTime"
> minOccurs="0"></xsd:element>
>         </xsd:sequence>
>     </xsd:complexType>
> </xsd:schema>
>
> Here's my user. It's a very simple user I created first using the GUI. I
> then added the <extension>
>
> <user xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
>       xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
>       xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
>       xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
>       xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/
> connector/icf-1/resource-schema-3"
>       xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/
> resource/instance-3"
>       oid="542aba1d-457f-43bc-9664-3b91e30ea416"
>       version="2">
>    <name>Fulano</name>
>    <extension xmlns:ex="http://example.com/xml/ns/mySchema">
>        <ex:exercicio>
>            <ex:idExercicio>123</ex:idExercicio>
>            <ex:dataInicioExercicio>2017-06-19T17:02:31.468Z</ex:
> dataInicioExercicio>
>        </ex:exercicio>
>    </extension>
>    <metadata>
>       <requestTimestamp>2017-06-19T17:02:31.468Z</requestTimestamp>
>       <requestorRef oid="00000000-0000-0000-0000-000000000002"
> type="c:UserType"><!-- administrator --></requestorRef>
>       <createTimestamp>2017-06-19T17:02:31.540Z</createTimestamp>
>       <creatorRef oid="00000000-0000-0000-0000-000000000002"
> type="c:UserType"><!-- administrator --></creatorRef>
>       <createChannel>http://midpoint.evolveum.com/xml/ns/
> public/gui/channels-3#user</createChannel>
>       <modifyTimestamp>2017-06-19T17:17:08.229Z</modifyTimestamp>
>       <modifierRef xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/
> common/common-3"
>                    oid="00000000-0000-0000-0000-000000000002"
>                    type="tns:UserType"><!-- administrator --></modifierRef>
>       <modifyChannel>http://midpoint.evolveum.com/xml/ns/
> public/gui/channels-3#user</modifyChannel>
>    </metadata>
>    <activation>
>       <effectiveStatus>enabled</effectiveStatus>
>       <enableTimestamp>2017-06-19T17:02:31.493Z</enableTimestamp>
>    </activation>
>    <iteration>0</iteration>
>    <iterationToken/>
> </user>
>
> I get the following error:
> Cannot parse as {http://example.com/xml/ns/mySchema}ExercicioType: ( {
> http://example.com/xml/ns/mySchema}idExercicio => parser
> ValueParser(DOMe, {http://example.com/xml/ns/mySchema}idExercicio: 123) {
> http://example.com/xml/ns/mySchema}dataInicioExercicio => parser
> ValueParser(DOMe, {http://example.com/xml/ns/mySchema}dataInicioExercicio:
> 2017-06-19T17:02:31.468Z) )
>
> Is this not possible? I have not seen any examples or questions.
>
>
>
>
>
> _______________________________________________
> 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/20170619/89c66f64/attachment.htm>


More information about the midPoint mailing list