[midPoint] Options / Dropdown for New User Properties

Jason Everling jeverling at bshp.edu
Tue Sep 13 01:29:08 CEST 2016


If you want a real dropdown, you could always hide those 2 attributes using
the default template and then create a schema extension attribute,

https://wiki.evolveum.com/display/midPoint/Custom+Schema+Extension

And for a dropdown example,

<xsd:schema elementFormDefault="qualified"
            targetNamespace="http://my.namespace.com"
xmlns:tns="http://my.namespace.com"
            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">

<xsd:simpleType name="myAttribute">
<xsd:annotation>
<xsd:documentation>Choices for Attribute</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
            <xsd:enumeration value="choice1">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>Choice 1</a:label>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="choice2">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>Choice 2</a:label>
                    </xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="choice3">
                <xsd:annotation>
                    <xsd:appinfo>
                        <a:label>Choice 3</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="myAttribute" type="tns:myAttribute" minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:appinfo>
<a:indexed>true</a:indexed>
<a:displayName> My Attribute</a:displayName>
<a:displayOrder>370</a:displayOrder>
<a:help>Some help text here</a:help>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>


JASON

On Mon, Sep 12, 2016 at 4:26 PM, <pdbogen at cernu.us> wrote:

> Thanks!
>
> This was extremely helpful. I do have a few comments, though:
>
> 1) I think this would have been easier to find if there was a link to it
> from
> the 'see also' section of
> https://wiki.evolveum.com/display/midPoint/Resource+Schema
>
> 2) The syntax for the table itself as described on
> https://wiki.evolveum.com/display/midPoint/Lookup+Tables seems to have two
> errors:
>
>   1. The closing tag for the second entry in the table is missing the `/`;
> and
>   2. The tags for each entry in the table should be 'row' rather than
> 'table'.
>
> These two changes allowed me to create and import a table properly; I was
> not
> able to do so when each entry was in `<table></table>`.
>
> 3) The rendering of a field that is restricted in this way is not perfect-
> it
> still behaves a bit like a text field in that I can type arbitrary values
> into
> it. It does indeed prohibit disallowed values, but I think that the user
> experience would be a little nicer if it were rendered as a drop-down.
> This is
> a very minor issue, thuogh.
>
> 4) No error is indicated when I _do_ try to provide a prohibited value.
> Since
> the field is a text field, it seems to allow me to type an arbitrary value
> in
> and submit it.
>
> Thanks again!
> - Patrick
>
> On Mon, Sep 12, 2016 at 03:09:16PM -0500, Jason Everling wrote:
> > Yep, Lookup Tables work great, I started using not long after it was
> added!
> > I think also if they try to add a value not in the table it will not save
> > it so they can only choose those specific values.
> >
> >
> >
> > JASON
> >
> > On Mon, Sep 12, 2016 at 3:02 PM, Pálos Gustáv <gustav.palos at evolveum.com
> >
> > wrote:
> >
> > > Hi,
> > >
> > > Please see:
> > > https://wiki.evolveum.com/display/midPoint/Lookup+Tables
> > >
> > > Gustav
> > >
> > > On Sep 12, 2016 9:51 PM, <pdbogen at cernu.us> wrote:
> > >
> > >> Hi!
> > >>
> > >> To simplify the UI somewhat for the expected end users of midpoint,
> I'd
> > >> like
> > >> to restrict a couple properties to a predefined set of options.
> > >>
> > >> I've already figured out how to suppress/require options (by changing
> the
> > >> global user template and adding either minOccurs=1 or ignore=true,
> but it
> > >> wasn't clear to me how to extend this to change an option from a
> freeform
> > >> field into a selection.
> > >>
> > >> I _suppose_ I could do this with roles and then induce the value of
> the
> > >> property, but that seems a little less intuitive than what I would
> like.
> > >>
> > >> I also suppose I could create an overlay that changes the actual UI,
> but
> > >> that
> > >> seems somewhat complex, and I was hoping to avoid it for what seems
> to be
> > >> to
> > >> be a straightforward requirement. (But I'm already using an overlay to
> > >> prepopulate a whole bunch of different artifacts, so maybe it's not
> that
> > >> much
> > >> extra work.)
> > >>
> > >> The fields I'd like to restrict are 'Organization' and 'Locality.'
> > >>
> > >> Any help is appreciated!
> > >> Thanks,
> > >> --
> > >>              .
> > >> Patrick Bogen .
> > >>             ...
> > >>
> > >> _______________________________________________
> > >> midPoint mailing list
> > >> midPoint at lists.evolveum.com
> > >> http://lists.evolveum.com/mailman/listinfo/midpoint
> > >>
> > >>
> > > _______________________________________________
> > > midPoint mailing list
> > > midPoint at lists.evolveum.com
> > > http://lists.evolveum.com/mailman/listinfo/midpoint
> > >
> > >
> >
> > --
> >
> >
> > CONFIDENTIALITY NOTICE:
> > This e-mail together with any attachments is proprietary and
> confidential;
> > intended for only the recipient(s) named above and may contain
> information
> > that is privileged. You should not retain, copy or use this e-mail or any
> > attachments for any purpose, or disclose all or any part of the contents
> to
> > any person. Any views or opinions expressed in this e-mail are those of
> the
> > author and do not represent those of the Baptist School of Health
> > Professions. If you have received this e-mail in error, or are not the
> > named recipient(s), you are hereby notified that any review,
> dissemination,
> > distribution or copying of this communication is prohibited by the sender
> > and to do so might constitute a violation of the Electronic
> Communications
> > Privacy Act, 18 U.S.C. section 2510-2521. Please immediately notify the
> > sender and delete this e-mail and any attachments from your computer.
>
> > _______________________________________________
> > midPoint mailing list
> > midPoint at lists.evolveum.com
> > http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
> --
>              .
> Patrick Bogen .
>             ...
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>

-- 


CONFIDENTIALITY NOTICE:
This e-mail together with any attachments is proprietary and confidential; 
intended for only the recipient(s) named above and may contain information 
that is privileged. You should not retain, copy or use this e-mail or any 
attachments for any purpose, or disclose all or any part of the contents to 
any person. Any views or opinions expressed in this e-mail are those of the 
author and do not represent those of the Baptist School of Health 
Professions. If you have received this e-mail in error, or are not the 
named recipient(s), you are hereby notified that any review, dissemination, 
distribution or copying of this communication is prohibited by the sender 
and to do so might constitute a violation of the Electronic Communications 
Privacy Act, 18 U.S.C. section 2510-2521. Please immediately notify the 
sender and delete this e-mail and any attachments from your computer. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20160912/4a8d4b9d/attachment.htm>


More information about the midPoint mailing list