<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 8/31/2016 3:26 AM, Stian Thorgersen
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAJgngAeNQbiHgWAhbJL_ZgDhHvjMZbfKf3a2ENuk1PffqZE1Zg@mail.gmail.com"
      type="cite">
      <div dir="ltr">One thing I'm not so keen on is the syntax for a
        list.</div>
    </blockquote>
    I'm not either.  I hate having to escape quotes with &amp;quot;  <br>
    <br>
    I tried something like this, which looks nicer in XML:<br>
    <br>
           &lt;spi name="eventsStore"&gt;<br>
                    &lt;default-provider&gt;jpa&lt;/default-provider&gt;<br>
                    &lt;provider name="jpa" enabled="true"&gt;<br>
                        &lt;properties&gt;<br>
                            &lt;property name="regularProp"
    value="myValue"/&gt;<br>
                            &lt;property name="exclude-events"&gt;<br>
                                     &lt;value&gt;EVENT1&lt;/value&gt;<br>
                                     &lt;value&gt;EVENT2&lt;/value&gt;<br>
                            &lt;/property&gt;<br>
                        &lt;/properties&gt;<br>
                    &lt;/provider&gt;<br>
                &lt;/spi&gt;<br>
    <br>
    The problem was that it made the code get really ugly.  I can take
    another stab at it later though.  Some refactoring would probably
    make it easier to implement.<br>
    <br>
    The good news is that you don't use lists very much and they look
    fine in CLI, where you can do something like this:<br>
/subsystem=keycloak-server/spi=eventsStore/provider=jpa/:map-put(name=properties,key=exclude-events,value=[EVENT1,EVENT2])<br>
    <br>
    <blockquote
cite="mid:CAJgngAeNQbiHgWAhbJL_ZgDhHvjMZbfKf3a2ENuk1PffqZE1Zg@mail.gmail.com"
      type="cite">
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 26 August 2016 at 14:24, Stan
          Silvert <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Now that
            changes for KEYCLOAK-3196 are merged,  everything you used
            to<br>
            configure in keycloak-server.json will now be configured in<br>
            standalone.xml, standalone-ha.xml, or domain.xml.<br>
            <br>
            If you need to make a change to the default
            keycloak-subsystem<br>
            configuration, you will need to edit this file:<br>
            <a moz-do-not-send="true"
href="https://github.com/keycloak/keycloak/blob/master/wildfly/server-subsystem/src/main/config/default-server-subsys-config.properties"
              rel="noreferrer" target="_blank">https://github.com/keycloak/<wbr>keycloak/blob/master/wildfly/<wbr>server-subsystem/src/main/<wbr>config/default-server-subsys-<wbr>config.properties</a><br>
            <br>
            This file contains a single multi-line property containing
            the subsystem<br>
            xml declaration.  Maven filtering is used to read this
            property and<br>
            inject it everywhere it needs to go.  Editing this file will
            also take<br>
            care of propagating it to the distributions like server-dist
            and demo-dist.<br>
            <br>
            Also, you need to create CLI commands for each change by
            editing this file:<br>
            <a moz-do-not-send="true"
href="https://github.com/keycloak/keycloak/blob/master/wildfly/server-subsystem/src/main/resources/cli/default-keycloak-subsys-config.cli"
              rel="noreferrer" target="_blank">https://github.com/keycloak/<wbr>keycloak/blob/master/wildfly/<wbr>server-subsystem/src/main/<wbr>resources/cli/default-<wbr>keycloak-subsys-config.cli</a><br>
            <br>
            This CLI snippet is used in the scripts required by the
            overlay<br>
            distribution.<br>
            <br>
            We have always had the problem that whenever someone changes<br>
            keycloak-server.json, they forget to make corresponding
            changes that<br>
            affect the various distributions.  With the switch to
            standalone.xml, we<br>
            now have just these two files to edit instead of five or
            six.<br>
            <br>
            Below, I'm pasting part of the asciidoc documentation I'm
            working on for<br>
            this.  It explains how to configure SPI's in standalone.xml.
            Also, if<br>
            someone can tell me if what I said about default-provider is
            accurate<br>
            I'd appreciate that:<br>
            <br>
            ------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>----<br>
            All elements in an SPI declaration are optional, but a full
            SPI declaration<br>
              looks like this:<br>
            [source,xml]<br>
            ----<br>
            &lt;spi name="dblock"&gt;<br>
                 &lt;default-provider&gt;mongo&lt;/<wbr>default-provider&gt;<br>
                 &lt;provider name="jpa" enabled="true"&gt;<br>
                     &lt;properties&gt;<br>
                         &lt;property name="lockWaitTimeout"
            value="800"/&gt;<br>
                     &lt;/properties&gt;<br>
                 &lt;/provider&gt;<br>
                 &lt;provider name="mongo" enabled="true"&gt;<br>
                     &lt;properties&gt;<br>
                         &lt;property name="lockRecheckTime"
            value="2"/&gt;<br>
                         &lt;property name="lockWaitTimeout"
            value="600"/&gt;<br>
                     &lt;/properties&gt;<br>
                 &lt;/provider&gt;<br>
            &lt;/spi&gt;<br>
            ----<br>
            Here we have two providers defined for the SPI `dblock`. 
            The<br>
            `default-provider`<br>
            is listed as `mongo`.  However it is up to the SPI to decide
            how it will<br>
            treat<br>
            this setting.  Some SPIs allow more than one provider and
            some do not.  So<br>
            `default-provider` can help the SPI to choose.<br>
            <br>
            Also notice that each provider defines its own set of
            configuration<br>
            properties.<br>
            The fact that both providers above have a property called<br>
            `lockWaitTimeout` is just a<br>
            coincidence.<br>
            <br>
            The type of each property value is interpreted by the
            provider. However,<br>
            there<br>
            is one exception.  Consider the `jpa` provider for the
            `eventStore` API:<br>
            [source,xml]<br>
            ----<br>
            &lt;spi name="eventsStore"&gt;<br>
                 &lt;provider name="jpa" enabled="true"&gt;<br>
                     &lt;properties&gt;<br>
                         &lt;property name="exclude-events"
            value="[&amp;quot;EVENT1&amp;quot;,<br>
            &amp;quot;EVENT2&amp;quot;]"/&gt;<br>
                     &lt;/properties&gt;<br>
                 &lt;/provider&gt;<br>
            &lt;/spi&gt;<br>
            ----<br>
            We see that the value begins and ends with square brackets. 
            That means that<br>
            the value will be passed to the provider as a list.  In this
            example,<br>
            the system will pass the<br>
            provider a list with two element values _EVENT1_ and
            _EVENT2_. To add<br>
            more values<br>
            to the list, just separate each list element with a comma.
            Unfortunately,<br>
            you do need to escape the quotes surrounding each list
            element with<br>
            `\&amp;quot;`.<br>
            ______________________________<wbr>_________________<br>
            keycloak-dev mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
            <a moz-do-not-send="true"
              href="https://lists.jboss.org/mailman/listinfo/keycloak-dev"
              rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/keycloak-dev</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>