Update docs for change of themes and providers directories to reflect 1.9.x refactoring.

This commit is contained in:
Marc Savy 2016-02-25 09:48:44 +00:00
parent 14ea988b24
commit b7f4d52de1
2 changed files with 24 additions and 26 deletions

View file

@ -99,19 +99,19 @@ public class MyEventListenerProvider implements EventListenerProvider {
contain the full name of your ProviderFactory implementation:
<programlisting><![CDATA[org.acme.provider.MyEventListenerProviderFactory]]></programlisting>
</para>
<section>
<title>Show info from you SPI implementation in Keycloak admin console</title>
<para>
Sometimes it is useful to show additional info about your Provider to a Keycloak administrator.
You can show provider build time informations (eg. version of custom provider currently installed),
current configuration of the provider (eg. url of remote system your provider talks to) or some operational
info (average time of response from remote system your provider talks to).
You can show provider build time informations (eg. version of custom provider currently installed),
current configuration of the provider (eg. url of remote system your provider talks to) or some operational
info (average time of response from remote system your provider talks to).
Keycloak admin console provides Server Info page to show this kind of information.
</para>
<para>
To show info from your provider it is enough to implement
<literal>org.keycloak.provider.ServerInfoAwareProviderFactory</literal> interface in your ProviderFactory.
<para>
To show info from your provider it is enough to implement
<literal>org.keycloak.provider.ServerInfoAwareProviderFactory</literal> interface in your ProviderFactory.
Example implementation for MyEventListenerProviderFactory from previous example:
<programlisting><![CDATA[
package org.acme.provider;
@ -122,7 +122,7 @@ public class MyEventListenerProviderFactory implements EventListenerProviderFact
private List<Event> events;
private int max;
...
@Override
@ -144,9 +144,9 @@ public class MyEventListenerProviderFactory implements EventListenerProviderFact
}
]]></programlisting>
</para>
</section>
</section>
</section>
<section>
@ -199,7 +199,7 @@ public class MyEventListenerProviderFactory implements EventListenerProviderFact
<title>Register a provider using file-system</title>
<para>
To register your provider simply copy the JAR including the ProviderFactory and Provider classes and the
provider configuration file to <literal>standalone/configuration/providers</literal>.
provider configuration file to server's root <literal>providers</literal> directory.
</para>
<para>
You can also define multiple provider class-path if you want to create isolated class-loaders. To do this

View file

@ -65,8 +65,9 @@
<section>
<title>Default themes</title>
<para>
Keycloak comes bundled with default themes in <literal>standalone/configuration/themes</literal>. You should
not edit the bundled themes directly. Instead create a new theme that extends a bundled theme.
Keycloak comes bundled with default themes in the server's root <literal>themes</literal> directory.
You should not edit the bundled themes directly. Instead create a new theme that extends a
bundled theme.
</para>
</section>
@ -101,26 +102,25 @@
"cacheTemplates": false,
"cacheThemes": false,
"folder": {
"dir": "${jboss.server.config.dir}/themes"
"dir": "${jboss.home.dir}/themes"
}
},
]]></programlisting>
Remember to re-enable caching in production as it will significantly impact performance.
</para>
<para>
To create a new theme create a directory for the theme in <literal>.../standalone/configuration/themes</literal>.
To create a new theme create a directory for the theme in the server's root <literal>themes</literal>.
The name of the directory should be the name of the theme. For example to create a theme called <literal>example-theme</literal>
create the directory <literal>.../standalone/configuration/themes/example-theme</literal>. Inside the theme
create the directory <literal>themes/example-theme</literal>. Inside the theme
directory you then need to create a directory for each of the types your theme is going to provide. For example
to add the login type to the <literal>example-theme</literal> theme create the directory
<literal>.../standalone/configuration/themes/example-theme/login</literal>.
<literal>themes/example-theme/login</literal>.
</para>
<para>
For each type create a file <literal>theme.properties</literal> which allows setting some configuration for
the theme, for example what theme it overrides and if it should import any themes. For the above example we
want to override the base theme and import common resources from the Keycloak theme. To do this create the
file <literal>.../standalone/configuration/themes/example-theme/login/theme.properties</literal> with the
following contents:
file <literal>themes/example-theme/login/theme.properties</literal> with following contents:
<programlisting>[<![CDATA[
parent=base
import=common/keycloak
@ -211,10 +211,9 @@ import=common/keycloak
Keycloak uses <ulink url="http://freemarker.org">Freemarker Templates</ulink> in order to generate HTML.
These templates are defined in <literal>.ftl</literal> files and can be overriden from the base theme.
Check out the Freemarker website on how to form a template file. To override the login template for the
<literal>example-theme</literal> copy <literal>../standalone/configuration/themes/base/login/login.ftl</literal>
to <literal>../standalone/configuration/themes/example-theme/login</literal> and open it in an editor. After
the first line (&lt;#import ...&gt;) add <literal>&lt;h1&gt;HELLO WORLD!&lt;/h1&gt;</literal> then refresh
the page.
<literal>example-theme</literal> copy <literal>themes/base/login/login.ftl</literal> to
<literal>themes/example-theme/login</literal> and open it in an editor. After the first line
(&lt;#import ...&gt;) add <literal>&lt;h1&gt;HELLO WORLD!&lt;/h1&gt;</literal> then refresh the page.
</para>
</section>
</section>
@ -222,7 +221,7 @@ import=common/keycloak
<section>
<title>Deploying themes</title>
<para>
Themes can be deployed to Keycloak by copying the theme directory to <literal>../standalone/configuration/themes</literal>
Themes can be deployed to Keycloak by copying the theme directory to <literal>themes</literal>
or it can be deployed as a module. For a single server or during development just copying the theme is fine, but
in a cluster or domain it's recommended to deploy as a module.
</para>
@ -273,8 +272,7 @@ import=common/keycloak
]]></programlisting>
</para>
<para>
If a theme is deployed to <literal>../standalone/configuration/themes</literal> and as a module the first
is used.
If a theme is deployed to <literal>themes</literal> and as a module the first is used.
</para>
</section>