keycloak-uncached

Details

diff --git a/distribution/appliance-dist/assembly.xml b/distribution/appliance-dist/assembly.xml
index 172942c..9776742 100755
--- a/distribution/appliance-dist/assembly.xml
+++ b/distribution/appliance-dist/assembly.xml
@@ -36,7 +36,7 @@
             <outputDirectory>keycloak/standalone/deployments</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>${project.build.directory}/unpacked/examples/themes</directory>
+            <directory>${project.build.directory}/unpacked/themes</directory>
             <outputDirectory>keycloak/standalone/configuration/themes</outputDirectory>
         </fileSet>
         <fileSet>
diff --git a/distribution/appliance-dist/pom.xml b/distribution/appliance-dist/pom.xml
index c5c4b19..fe5e22c 100755
--- a/distribution/appliance-dist/pom.xml
+++ b/distribution/appliance-dist/pom.xml
@@ -70,6 +70,13 @@
                                 </artifactItem>
                                 <artifactItem>
                                     <groupId>org.keycloak</groupId>
+                                    <artifactId>keycloak-example-themes-dist</artifactId>
+                                    <version>${project.version}</version>
+                                    <type>zip</type>
+                                    <outputDirectory>${project.build.directory}/unpacked</outputDirectory>
+                                </artifactItem>
+                                <artifactItem>
+                                    <groupId>org.keycloak</groupId>
                                     <artifactId>keycloak-wildfly-adapter-dist</artifactId>
                                     <version>${project.version}</version>
                                     <type>zip</type>
diff --git a/distribution/examples-docs-zip/build.xml b/distribution/examples-docs-zip/build.xml
index 545451c..9357a30 100755
--- a/distribution/examples-docs-zip/build.xml
+++ b/distribution/examples-docs-zip/build.xml
@@ -25,8 +25,5 @@
         <move file="target/examples/unconfigured-demo/customer-app/src/main/webapp/WEB-INF/web.xml.unconfigured" tofile="target/examples/unconfigured-demo/customer-app/src/main/webapp/WEB-INF/web.xml"/>
         <move file="target/examples/unconfigured-demo/product-app/src/main/webapp/WEB-INF/web.xml.unconfigured" tofile="target/examples/unconfigured-demo/product-app/src/main/webapp/WEB-INF/web.xml"/>
         <move file="target/examples/unconfigured-demo/database-service/src/main/webapp/WEB-INF/web.xml.unconfigured" tofile="target/examples/unconfigured-demo/database-service/src/main/webapp/WEB-INF/web.xml"/>
-        <copy todir="target/examples/themes" overwrite="true">
-            <fileset dir="../../examples/themes"/>
-        </copy>
     </target>
 </project>
\ No newline at end of file
diff --git a/distribution/pom.xml b/distribution/pom.xml
index b921e85..a614e43 100755
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -31,6 +31,7 @@
         <module>eap6-adapter-zip</module>
         <module>wildfly-adapter-zip</module>
         <module>examples-docs-zip</module>
+        <module>theme-template-zip</module>
         <module>war-zip</module>
         <module>war-dist</module>
         <module>appliance-dist</module>
diff --git a/distribution/theme-template-zip/assembly.xml b/distribution/theme-template-zip/assembly.xml
new file mode 100755
index 0000000..e0ff9e1
--- /dev/null
+++ b/distribution/theme-template-zip/assembly.xml
@@ -0,0 +1,20 @@
+<assembly>
+    <id>war-dist</id>
+
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <fileSets>
+        <fileSet>
+            <directory>target/themes</directory>
+            <outputDirectory>themes</outputDirectory>
+            <excludes>
+                <exclude>**/.svn/**</exclude>
+                <exclude>**/target/**</exclude>
+                <exclude>**/*.iml</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git a/distribution/theme-template-zip/build.xml b/distribution/theme-template-zip/build.xml
new file mode 100755
index 0000000..793f4d6
--- /dev/null
+++ b/distribution/theme-template-zip/build.xml
@@ -0,0 +1,39 @@
+<project name="example-dist" basedir="." default="all">
+
+    <target name="all">
+        <delete dir="target/themes"/>
+        <copy todir="target/themes/login/template" overwrite="true">
+            <fileset dir="../../forms/common-themes/src/main/resources/theme/login/base">
+            </fileset>
+        </copy>
+        <copy todir="target/themes/login/template" overwrite="true">
+            <fileset dir="../../forms/common-themes/src/main/resources/theme/login/patternfly">
+            </fileset>
+        </copy>
+        <copy tofile="target/themes/login/template/theme.properties" file="../../forms/common-themes/src/main/resources/theme/login/patternfly/theme.properties" overwrite="true">
+           <filterchain>
+               <linecontains negate="true">
+                   <contains value="parent"/>
+               </linecontains>
+           </filterchain>
+        </copy>
+        <copy todir="target/themes/account/template" overwrite="true">
+            <fileset dir="../../forms/common-themes/src/main/resources/theme/account/base">
+            </fileset>
+        </copy>
+        <copy todir="target/themes/account/template" overwrite="true">
+            <fileset dir="../../forms/common-themes/src/main/resources/theme/account/patternfly">
+            </fileset>
+        </copy>
+        <copy tofile="target/themes/account/template/theme.properties" file="../../forms/common-themes/src/main/resources/theme/account/patternfly/theme.properties" overwrite="true">
+            <filterchain>
+                <linecontains negate="true">
+                    <contains value="parent"/>
+                </linecontains>
+            </filterchain>
+        </copy>
+        <copy todir="target/themes" overwrite="true">
+            <fileset dir="../../examples/themes"/>
+        </copy>
+    </target>
+</project>
\ No newline at end of file
diff --git a/distribution/theme-template-zip/pom.xml b/distribution/theme-template-zip/pom.xml
new file mode 100755
index 0000000..478dd30
--- /dev/null
+++ b/distribution/theme-template-zip/pom.xml
@@ -0,0 +1,84 @@
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>keycloak-parent</artifactId>
+        <groupId>org.keycloak</groupId>
+        <version>1.0-alpha-2-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>keycloak-example-themes-dist</artifactId>
+    <packaging>pom</packaging>
+    <name>Keycloak Example Themes</name>
+    <description/>
+
+    <dependencies>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.7</version>
+                <inherited>false</inherited>
+                <executions>
+                    <execution>
+                        <id>build-example</id>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <phase>compile</phase>
+                        <configuration>
+                            <target>
+                                <ant antfile="build.xml" inheritRefs="true">
+                                    <target name="all"/>
+                                </ant>
+                            </target>
+                        </configuration>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>ant-contrib</groupId>
+                        <artifactId>ant-contrib</artifactId>
+                        <version>1.0b3</version>
+                        <exclusions>
+                            <exclusion>
+                                <groupId>ant</groupId>
+                                <artifactId>ant</artifactId>
+                            </exclusion>
+                        </exclusions>
+                    </dependency>
+                </dependencies>
+
+
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>2.4</version>
+                <executions>
+                    <execution>
+                        <id>assemble</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>assembly.xml</descriptor>
+                            </descriptors>
+                            <outputDirectory>
+                                target
+                            </outputDirectory>
+                            <workDirectory>
+                                target/assembly/work
+                            </workDirectory>
+                            <appendAssemblyId>false</appendAssemblyId>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/distribution/war-dist/assembly.xml b/distribution/war-dist/assembly.xml
index c237f5a..e9c96a9 100755
--- a/distribution/war-dist/assembly.xml
+++ b/distribution/war-dist/assembly.xml
@@ -23,6 +23,14 @@
             </includes>
             <outputDirectory>adapters</outputDirectory>
         </dependencySet>
+        <dependencySet>
+            <unpack>false</unpack>
+            <useTransitiveDependencies>false</useTransitiveDependencies>
+            <includes>
+                <include>org.keycloak:keycloak-example-themes-dist:zip</include>
+            </includes>
+            <outputDirectory>examples</outputDirectory>
+        </dependencySet>
     </dependencySets>
     <!--
     <moduleSets>
diff --git a/distribution/war-dist/pom.xml b/distribution/war-dist/pom.xml
index 94bb70d..05ce322 100755
--- a/distribution/war-dist/pom.xml
+++ b/distribution/war-dist/pom.xml
@@ -31,6 +31,12 @@
             <version>${project.version}</version>
             <type>zip</type>
         </dependency>
+        <dependency>
+            <groupId>org.keycloak</groupId>
+            <artifactId>keycloak-example-themes-dist</artifactId>
+            <version>${project.version}</version>
+            <type>zip</type>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
diff --git a/docbook/reference/en/en-US/modules/themes.xml b/docbook/reference/en/en-US/modules/themes.xml
old mode 100644
new mode 100755
index 4d36919..73e63a4
--- a/docbook/reference/en/en-US/modules/themes.xml
+++ b/docbook/reference/en/en-US/modules/themes.xml
@@ -19,10 +19,10 @@
     <section>
         <title>Creating a theme</title>
         <para>
-            There are two types of themes in Keycloak, login and account. Login themes are used to customize the
+            There are two types of themes in Keycloak, <literal>login</literal> and <literal>account</literal>. Login themes are used to customize the
             login forms, while account themes are used to customize account management. A theme consists of:
             <itemizedlist>
-                <listitem><para>FreeMarker templates</para></listitem>
+                <listitem><para><ulink url="http://freemarker.org">FreeMarker</ulink> templates</para></listitem>
                 <listitem><para>Stylesheets</para></listitem>
                 <listitem><para>Scripts</para></listitem>
                 <listitem><para>Images</para></listitem>
@@ -97,23 +97,35 @@
             <programlisting>username=Your Username</programlisting>
         </section>
         <section>
-            <title>Templates</title>
+            <title>Modifying HTML</title>
             <para>
-                For advanced use-cases where you need to modify the html structure it is also possible to override
-                one or more of the templates. For example to override the login page create <literal>login.ftl</literal>
-                inside your theme folder. The base templates all use <literal>template.ftl</literal> to create the
-                basic structure of the page.
+                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.
+            </para>
+        </section>
+        <section>
+            <title>Full Example Templates</title>
+            <para>
+                Keycloak comes bundled with some default themes which you cannot view or modify.  The distribution
+                also contains full example templates which you can edit directly if you're running the Keycloak appliance
+                distro, or which you can install, if you're using the WAR distro.  The name of these full example themes
+                is <literal>template</literal> and they contain a complex example for generating all pages related
+                to login, error displaying, oauth grant pages, and user account management.
             </para>
             <para>
-                The base templates are a good reference if you need to create your own templates, they can be
-                found inside <literal>forms/common-themes/src/main/resources/theme</literal> on GitHub or in the source
-                download.
+                For the Keycloak Appliance Distro, these theme files are in the directories
+                <literal>${appliance-distro}/keycloak/standalone/configuration/themes/login/template</literal>
+                and <literal>${appliance-distro}/keycloak/standalone/configuration/themes/account/template</literal>.
+                For the WAR distro, there is a zip file in the examples directory called <literal>keycloak-example-themes-dist.zip</literal>
+                which you will need to unzip in the <literal>standalone/configuration</literal> or <literal>domain/configuration</literal>
+                directory if the JBoss or Wildfly instance you have deployed Keycloak server to.
             </para>
         </section>
     </section>
 
     <section>
-        <title>SPI</title>
+        <title>SPIs</title>
         <para>
             For full control of login forms and account management Keycloak provides a number of SPIs.
         </para>