From b7f4d52de12a1904ee44e4ae128caad8935f924f Mon Sep 17 00:00:00 2001 From: Marc Savy Date: Thu, 25 Feb 2016 09:48:44 +0000 Subject: [PATCH] Update docs for change of themes and providers directories to reflect 1.9.x refactoring. --- .../reference/en/en-US/modules/providers.xml | 22 +++++++-------- .../reference/en/en-US/modules/themes.xml | 28 +++++++++---------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/docbook/auth-server-docs/reference/en/en-US/modules/providers.xml b/docbook/auth-server-docs/reference/en/en-US/modules/providers.xml index 3f55b70adc..44bd5dc219 100755 --- a/docbook/auth-server-docs/reference/en/en-US/modules/providers.xml +++ b/docbook/auth-server-docs/reference/en/en-US/modules/providers.xml @@ -99,19 +99,19 @@ public class MyEventListenerProvider implements EventListenerProvider { contain the full name of your ProviderFactory implementation: - +
Show info from you SPI implementation in Keycloak admin console 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. - - To show info from your provider it is enough to implement - org.keycloak.provider.ServerInfoAwareProviderFactory interface in your ProviderFactory. + + To show info from your provider it is enough to implement + org.keycloak.provider.ServerInfoAwareProviderFactory interface in your ProviderFactory. Example implementation for MyEventListenerProviderFactory from previous example: events; private int max; - + ... @Override @@ -144,9 +144,9 @@ public class MyEventListenerProviderFactory implements EventListenerProviderFact } ]]> - + -
+
@@ -199,7 +199,7 @@ public class MyEventListenerProviderFactory implements EventListenerProviderFact Register a provider using file-system To register your provider simply copy the JAR including the ProviderFactory and Provider classes and the - provider configuration file to standalone/configuration/providers. + provider configuration file to server's root providers directory. You can also define multiple provider class-path if you want to create isolated class-loaders. To do this diff --git a/docbook/auth-server-docs/reference/en/en-US/modules/themes.xml b/docbook/auth-server-docs/reference/en/en-US/modules/themes.xml index dfef70ccff..c161f55af5 100755 --- a/docbook/auth-server-docs/reference/en/en-US/modules/themes.xml +++ b/docbook/auth-server-docs/reference/en/en-US/modules/themes.xml @@ -65,8 +65,9 @@
Default themes - Keycloak comes bundled with default themes in standalone/configuration/themes. 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 themes directory. + You should not edit the bundled themes directly. Instead create a new theme that extends a + bundled theme.
@@ -101,26 +102,25 @@ "cacheTemplates": false, "cacheThemes": false, "folder": { - "dir": "${jboss.server.config.dir}/themes" + "dir": "${jboss.home.dir}/themes" } }, ]]> Remember to re-enable caching in production as it will significantly impact performance.
- To create a new theme create a directory for the theme in .../standalone/configuration/themes. + To create a new theme create a directory for the theme in the server's root themes. The name of the directory should be the name of the theme. For example to create a theme called example-theme - create the directory .../standalone/configuration/themes/example-theme. Inside the theme + create the directory themes/example-theme. 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 example-theme theme create the directory - .../standalone/configuration/themes/example-theme/login. + themes/example-theme/login. For each type create a file theme.properties 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 .../standalone/configuration/themes/example-theme/login/theme.properties with the - following contents: + file themes/example-theme/login/theme.properties with following contents: [Freemarker Templates in order to generate HTML. These templates are defined in .ftl 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 - example-theme copy ../standalone/configuration/themes/base/login/login.ftl - to ../standalone/configuration/themes/example-theme/login and open it in an editor. After - the first line (<#import ...>) add <h1>HELLO WORLD!</h1> then refresh - the page. + example-theme copy themes/base/login/login.ftl to + themes/example-theme/login and open it in an editor. After the first line + (<#import ...>) add <h1>HELLO WORLD!</h1> then refresh the page.
@@ -222,7 +221,7 @@ import=common/keycloak
Deploying themes - Themes can be deployed to Keycloak by copying the theme directory to ../standalone/configuration/themes + Themes can be deployed to Keycloak by copying the theme directory to themes 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. @@ -273,8 +272,7 @@ import=common/keycloak ]]> - If a theme is deployed to ../standalone/configuration/themes and as a module the first - is used. + If a theme is deployed to themes and as a module the first is used.