[seam-commits] Seam SVN: r7806 - in trunk/examples/wiki: src/etc and 30 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Apr 3 07:17:42 EDT 2008


Author: christian.bauer at jboss.com
Date: 2008-04-03 07:17:41 -0400 (Thu, 03 Apr 2008)
New Revision: 7806

Added:
   trunk/examples/wiki/src/etc/META-INF/seam-deployment.properties
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheManager.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheProvider.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/PageFragmentCache.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPageFragmentCacheRenderer.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersFeedPreferenceValueTemplate.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java
Removed:
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/feed/FeedConnectorPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/jira/JiraConnectorPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/CorePreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirMenu/DirMenuPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirToc/DirTocPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/docPager/DocPagerPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/flash/FlashPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/jiraIssueList/JiraIssueListPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/lastmodified/LastModifiedDocumentsPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferencesSupport.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferencesSupport.java
Modified:
   trunk/examples/wiki/README.txt
   trunk/examples/wiki/build.xml
   trunk/examples/wiki/src/etc/META-INF/components-dev.xml
   trunk/examples/wiki/src/etc/META-INF/components-prod.xml
   trunk/examples/wiki/src/etc/META-INF/persistence-dev-war.xml
   trunk/examples/wiki/src/etc/META-INF/persistence-prod-war.xml
   trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml
   trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml
   trunk/examples/wiki/src/etc/WEB-INF/pages.xml
   trunk/examples/wiki/src/etc/ehcache.xml
   trunk/examples/wiki/src/etc/i18n/messages_en.properties
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/UserManagementPreferences.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Feed.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/FeedEntry.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/LinkProtocol.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/UserProfile.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDocument.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/preferences/WikiPreferenceValue.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/Converters.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiTextEditor.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferences.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferenceRegistry.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiUtil.java
   trunk/examples/wiki/view/docEdit_d.xhtml
   trunk/examples/wiki/view/includes/commentForm.xhtml
   trunk/examples/wiki/view/plugins/faqBrowser/faqQuestionForm.xhtml
   trunk/examples/wiki/view/plugins/forumReplies/replyForm.xhtml
   trunk/examples/wiki/view/plugins/forumTopics/topicForm.xhtml
Log:
JBSEAM-2729, JBSEAM-2728, JBSEAM-2723

Modified: trunk/examples/wiki/README.txt
===================================================================
--- trunk/examples/wiki/README.txt	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/README.txt	2008-04-03 11:17:41 UTC (rev 7806)
@@ -43,7 +43,7 @@
   with this application. Follow the steps outlined above (edit build.properties, call
   'ant upgradehibernate') or copy them manually.
 
-- Install MySQL 5.x
+- Install MySQL 5.x and start it
 
 - Obtain the correct JDBC driver for your MySQL version and copy it into server/default/lib/ of JBoss AS
 
@@ -67,3 +67,45 @@
 NOTE: The Lucene index directory for full-text searching is named "lacewikiIndex" and located in the
 current directory. This is the current directory from which you started the application server! If you want
 to change this setting, unpack the WAR and change the META-INF/persistence.xml configuration file.
+
+
+INSTALLATION WITH UNICODE SUPPORT ON MYSQL
+==========================================================================================
+
+If you want to use any non-latin characters, create the MySQL database you want to use (or
+drop and recreate the default 'test' database) with the following options:
+
+      CREATE DATABASE test CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+Your database should at least have the 'character_set_database' variable set to 'utf8':
+
+  mysql> show variables like '%character%';
+  +--------------------------+------------------------------------------------------------+
+  | Variable_name            | Value                                                      |
+  +--------------------------+------------------------------------------------------------+
+  | character_set_client     | latin1                                                     |
+  | character_set_connection | latin1                                                     |
+  | character_set_database   | utf8                                                       |
+  | character_set_filesystem | binary                                                     |
+  | character_set_results    | latin1                                                     |
+  | character_set_server     | latin1                                                     |
+  | character_set_system     | utf8                                                       |
+  | character_sets_dir       | /usr/local/mysql-5.0.45-osx10.4-i686/share/mysql/charsets/ |
+  +--------------------------+------------------------------------------------------------+
+
+If you keep the default latin1 encoding, exceptions will be thrown by the application as
+soon as you try to store any non-latin character.
+
+Note that due to URL rewriting rules, stored wiki items (documents, uploaded files) MUST have
+at least 3 latin-1 characters in their name! The application will prompt you with a validation
+error message when you forget that limitation and enter only non-latin-1 characters in a form.
+
+The wiki search engine passes search terms as request parameters in the URI. If you require
+unicode support for search terms, you need to set an option in Tomcat to enable the correct
+decoding of URL-encoded request parameter values to UTF-8. To do that, edit
+  ${JBOSS_HOME}/server/(default)/deploy/jboss-web.deployer/server.xml
+and add
+  URIEncoding="UTF-8"
+to the <connector> declaration.
+
+

Modified: trunk/examples/wiki/build.xml
===================================================================
--- trunk/examples/wiki/build.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/build.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -280,6 +280,7 @@
         <copy todir="${exploded.war.dir}/WEB-INF/classes/META-INF">
             <fileset dir="${src.etc.dir}/META-INF">
                 <include name="*.taglib.xml"/>
+                <include name="*.properties"/>
             </fileset>
         </copy>
         <copy tofile="${exploded.war.dir}/WEB-INF/classes/META-INF/persistence.xml"

Modified: trunk/examples/wiki/src/etc/META-INF/components-dev.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/components-dev.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/META-INF/components-dev.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -39,11 +39,35 @@
 
     <!-- ############## END OF WIKI USER CONFIGURATION ############## -->
 
-
     <!-- Running in regular JBoss AS, Seam starts the persistence unit -->
     <core:init debug="false"/>
-    <persistence:entity-manager-factory name="wikiEntityManagerFactory" persistence-unit-name="wiki"/>
 
+    <!-- Wiki persistence unit, relies on cache manager backend for Hibernate 2nd level cache -->
+    <persistence:entity-manager-factory name="wikiEntityManagerFactory"
+                                        persistence-unit-name="wiki"
+                                        startupDepends="ehCacheManager"/>
+
+    <!-- Wiki page fragment cache, relies on cache manager backend -->
+    <component name="pageFragmentCache"
+               class="org.jboss.seam.wiki.core.cache.PageFragmentCache"
+               startup="true" startupDepends="ehCacheManager"
+               scope="APPLICATION"/>
+
+    <!-- Wiki cache manager backend -->
+    <component name="ehCacheManager"
+               class="org.jboss.seam.wiki.core.cache.EHCacheManager"
+               startup="true"
+               scope="APPLICATION"/>
+
+    <!-- Base path for links includes port number -->
+    <factory name="basePath" scope="CONVERSATION"  auto-create="true"
+             value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName
+                     }:#{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath}"/>
+
+    <factory name="themePathGetRequest" scope="CONVERSATION"  auto-create="true"
+             value="#{servletContexts.request.scheme}://#{servletContexts.request.serverName
+                     }:#{servletContexts.request.serverPort}#{servletContexts.request.contextPath}/themes/#{preferences.get('Wiki').themeName}"/>
+
     <!-- Some DBUnit datasets we use in unit testing - let's also use them in dev mode when the app is deployed -->
     <component name="dbunitImporter" class="org.jboss.seam.wiki.util.DBUnitImporter" scope="APPLICATION" auto-create="true">
         <property name="database">mysql</property>
@@ -61,13 +85,4 @@
         </property>
     </component>
 
-    <!-- Base path for links includes port number -->
-    <factory name="basePath" scope="CONVERSATION"  auto-create="true"
-             value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName
-                     }:#{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath}"/>
-
-    <factory name="themePathGetRequest" scope="CONVERSATION"  auto-create="true"
-             value="#{servletContexts.request.scheme}://#{servletContexts.request.serverName
-                     }:#{servletContexts.request.serverPort}#{servletContexts.request.contextPath}/themes/#{preferences.get('Wiki').themeName}"/>
-
 </components>

Modified: trunk/examples/wiki/src/etc/META-INF/components-prod.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/components-prod.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/META-INF/components-prod.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -39,11 +39,26 @@
 
     <!-- ############## END OF WIKI USER CONFIGURATION ############## -->
 
-
     <!-- Running in regular JBoss AS, Seam starts the persistence unit -->
     <core:init debug="false"/>
-    <persistence:entity-manager-factory name="wikiEntityManagerFactory" persistence-unit-name="wiki"/>
 
+    <!-- Wiki persistence unit, relies on cache manager backend for Hibernate 2nd level cache -->
+    <persistence:entity-manager-factory name="wikiEntityManagerFactory"
+                                        persistence-unit-name="wiki"
+                                        startupDepends="ehCacheManager"/>
+
+    <!-- Wiki page fragment cache, relies on cache manager backend -->
+    <component name="pageFragmentCache"
+               class="org.jboss.seam.wiki.core.cache.PageFragmentCache"
+               startup="true" startupDepends="ehCacheManager"
+               scope="APPLICATION"/>
+
+    <!-- Wiki cache manager backend -->
+    <component name="ehCacheManager"
+               class="org.jboss.seam.wiki.core.cache.EHCacheManager"
+               startup="true"
+               scope="APPLICATION"/>
+
     <!-- Base path for links includes port number -->
     <factory name="basePath" scope="CONVERSATION"  auto-create="true"
              value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName

Modified: trunk/examples/wiki/src/etc/META-INF/persistence-dev-war.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/persistence-dev-war.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/META-INF/persistence-dev-war.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -9,7 +9,7 @@
         <provider>org.hibernate.ejb.HibernatePersistence</provider>
         <jta-data-source>java:/wikiDatasource</jta-data-source>
         <properties>
-            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+            <property name="hibernate.dialect" value="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
             <property name="hibernate.transaction.manager_lookup_class"
                       value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
 
@@ -39,8 +39,8 @@
             <property name="hibernate.generate_statistics" value="true"/>
             <property name="hibernate.session_factory_name" value="SessionFactories/lacewikiSF"/>
 
-            <!-- Enable EHCache and register the JMX monitoring MBean -->
-            <property name="hibernate.cache.provider_class" value="org.jboss.seam.wiki.util.MonitoringEHCacheProvider"/>
+            <!-- Enable EHCache -->
+            <property name="hibernate.cache.provider_class" value="org.jboss.seam.wiki.core.cache.EHCacheProvider"/>
             <property name="hibernate.cache.use_query_cache" value="true"/>
             <property name="hibernate.cache.use_second_level_cache" value="true"/>
 

Modified: trunk/examples/wiki/src/etc/META-INF/persistence-prod-war.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/persistence-prod-war.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/META-INF/persistence-prod-war.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -9,7 +9,7 @@
         <provider>org.hibernate.ejb.HibernatePersistence</provider>
         <jta-data-source>java:/wikiDatasource</jta-data-source>
         <properties>
-            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+            <property name="hibernate.dialect" value="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
             <property name="hibernate.transaction.manager_lookup_class"
                       value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
 
@@ -34,8 +34,8 @@
             <property name="hibernate.generate_statistics" value="true"/>
             <property name="hibernate.session_factory_name" value="SessionFactories/lacewikiSF"/>
 
-            <!-- Enable EHCache and register the JMX monitoring MBean -->
-            <property name="hibernate.cache.provider_class" value="org.jboss.seam.wiki.util.MonitoringEHCacheProvider"/>
+            <!-- Enable EHCache -->
+            <property name="hibernate.cache.provider_class" value="org.jboss.seam.wiki.core.cache.EHCacheProvider"/>
             <property name="hibernate.cache.use_query_cache" value="true"/>
             <property name="hibernate.cache.use_second_level_cache" value="true"/>
 

Modified: trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -11,7 +11,7 @@
         <properties>
 
             <!-- MySQL also requires changes to AllTests.tng.xml and wiki-test-ds.xml
-            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+            <property name="hibernate.dialect" value="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
             -->
             <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
 
@@ -50,10 +50,6 @@
                       value="org.jboss.seam.wiki.core.nestedset.listener.NestedSetPostInsertEventListener"/>
             <property name="hibernate.ejb.event.post-delete"
                       value="org.jboss.seam.wiki.core.nestedset.listener.NestedSetPostDeleteEventListener"/>
-            <!--
-            <property name="hibernate.ejb.event.flush-entity"
-                      value="org.jboss.seam.wiki.core.nestedset.NestedSetFlushEntityEventListener"/>
-              -->
 
         </properties>
 

Added: trunk/examples/wiki/src/etc/META-INF/seam-deployment.properties
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/seam-deployment.properties	                        (rev 0)
+++ trunk/examples/wiki/src/etc/META-INF/seam-deployment.properties	2008-04-03 11:17:41 UTC (rev 7806)
@@ -0,0 +1 @@
+org.jboss.seam.deployment.annotationTypes=org.jboss.seam.wiki.preferences.annotations.Preferences
\ No newline at end of file

Modified: trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/WEB-INF/faces-config.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,8 +1,5 @@
 <?xml version='1.0' encoding='UTF-8'?>
-<faces-config version="1.2"
-   xmlns="http://java.sun.com/xml/ns/javaee"
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
 
     <application>
         <locale-config>
@@ -13,8 +10,22 @@
 
     <!-- Needed because WikiFormattedTextHandler instantiates these, asking the JSF infrastructure -->
     <component>
-    	<component-type>org.jboss.seam.wiki.core.ui.UIPlugin</component-type>
-    	<component-class>org.jboss.seam.wiki.core.ui.UIPlugin</component-class>
+        <component-type>org.jboss.seam.wiki.core.ui.UIPlugin</component-type>
+        <component-class>org.jboss.seam.wiki.core.ui.UIPlugin</component-class>
     </component>
 
+    <!-- Custom renderer implementation for s:cache page fragment caching -->
+    <render-kit>
+        <render-kit-id>HTML_BASIC</render-kit-id>
+        <renderer>
+            <component-family>org.jboss.seam.ui.Cache</component-family>
+            <renderer-type>
+                org.jboss.seam.ui.CacheRenderer
+            </renderer-type>
+            <renderer-class>
+                org.jboss.seam.wiki.core.ui.WikiPageFragmentCacheRenderer
+            </renderer-class>
+        </renderer>
+    </render-kit>
+
 </faces-config>

Modified: trunk/examples/wiki/src/etc/WEB-INF/pages.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/pages.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/WEB-INF/pages.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -380,7 +380,10 @@
         <end-conversation/>
         <http-error error-code="400">
             <message severity="ERROR">
-                #{messages['lacewiki.msg.FatalError']} (#{wikiInit.adminContact})
+                #{messages['lacewiki.msg.FatalError']} (#{wikiInit.adminContact}):
+                '#{org.jboss.seam.handledException.class.name},
+                #{org.jboss.seam.handledException.message}
+                in #{org.jboss.seam.handledException.stackTrace[0].className}@#{org.jboss.seam.handledException.stackTrace[0].lineNumber}'
             </message>
         </http-error>
     </exception>

Modified: trunk/examples/wiki/src/etc/ehcache.xml
===================================================================
--- trunk/examples/wiki/src/etc/ehcache.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/ehcache.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -82,9 +82,6 @@
             timeToIdleSeconds="120"
             timeToLiveSeconds="120"
             overflowToDisk="false"
-            maxElementsOnDisk="10000000"
-            diskPersistent="false"
-            diskExpiryThreadIntervalSeconds="120"
             memoryStoreEvictionPolicy="LRU"
             />
 
@@ -94,13 +91,11 @@
            overflowToDisk="false"
            timeToIdleSeconds="300"
            timeToLiveSeconds="600"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="org.hibernate.cache.UpdateTimestampsCache"
            maxElementsInMemory="1000"
            eternal="true"
-           diskPersistent="false"
            overflowToDisk="false"/>
 
     <cache name="WikiPreference"
@@ -109,7 +104,6 @@
            overflowToDisk="false"
            timeToIdleSeconds="1000"
            timeToLiveSeconds="6000"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="WikiLinkProtocol"
@@ -118,7 +112,6 @@
            overflowToDisk="false"
            timeToIdleSeconds="86400"
            timeToLiveSeconds="259200"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="WikiFeed"
@@ -127,7 +120,6 @@
            overflowToDisk="false"
            timeToIdleSeconds="86400"
            timeToLiveSeconds="259200"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="WikiFeedEntry"
@@ -136,7 +128,6 @@
            timeToIdleSeconds="86400"
            timeToLiveSeconds="259200"
            overflowToDisk="false"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="WikiFeedEntryCollection"
@@ -145,7 +136,6 @@
            overflowToDisk="false"
            timeToIdleSeconds="86400"
            timeToLiveSeconds="259200"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="WikiUser"
@@ -154,7 +144,6 @@
            overflowToDisk="false"
            timeToIdleSeconds="10000"
            timeToLiveSeconds="60000"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="WikiRole"
@@ -163,7 +152,6 @@
            overflowToDisk="false"
            timeToIdleSeconds="10000"
            timeToLiveSeconds="60000"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
     <cache name="WikiUserRoleCollection"
@@ -172,7 +160,14 @@
            overflowToDisk="false"
            timeToIdleSeconds="10000"
            timeToLiveSeconds="60000"
-           diskPersistent="false"
            memoryStoreEvictionPolicy="LRU"/>
 
+    <cache name="WikiPageFragmentCache"
+           maxElementsInMemory="500"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="1000"
+           timeToLiveSeconds="6000"
+           memoryStoreEvictionPolicy="LRU"/>
+
 </ehcache>
\ No newline at end of file

Modified: trunk/examples/wiki/src/etc/i18n/messages_en.properties
===================================================================
--- trunk/examples/wiki/src/etc/i18n/messages_en.properties	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/etc/i18n/messages_en.properties	2008-04-03 11:17:41 UTC (rev 7806)
@@ -672,7 +672,7 @@
 lacewiki.msg.ImportOk=Created file '{0}' in current directory.
 lacewiki.msg.OptimisticLockError=Someone modified the same record while you were editing it. Your workspace has been closed.
 lacewiki.msg.AccessDenied=Access Denied
-lacewiki.msg.FatalError=Request failed, please check the application log or contact the administrator!
+lacewiki.msg.FatalError=Request failed, please check the application log or contact the administrator
 lacewiki.msg.Trash.Emptied=All items in the trash have been permanently deleted.
 lacewiki.msg.AutomaticallyGeneratedFeed=Aggregated Feed
 

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/feed/FeedConnectorPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/feed/FeedConnectorPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/feed/FeedConnectorPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.connectors.feed;
-
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-import org.jboss.seam.annotations.Name;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Christian Bauer
- */
- at Name("feedConnectorPreferencesSupport")
-public class FeedConnectorPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(FeedConnectorPreferences.class) );
-        }};
-    }
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/jira/JiraConnectorPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/jira/JiraConnectorPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/connectors/jira/JiraConnectorPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.connectors.jira;
-
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-import org.jboss.seam.annotations.Name;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Christian Bauer
- */
- at Name("jiraConnectorPreferencesSupport")
-public class JiraConnectorPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(JiraConnectorPreferences.class) );
-        }};
-    }
-}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/DocumentHome.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -45,7 +45,7 @@
     private WikiDocument historicalCopy;
     private Boolean minorRevision;
     private String formContent;
-    Set<WikiFile> linkTargets;
+    private Set<WikiFile> linkTargets;
     private boolean enabledPreview = false;
     private boolean pushOnFeeds = false;
     private boolean pushOnSiteFeed = false;
@@ -333,7 +333,7 @@
     /* -------------------------- Public Features ------------------------------ */
 
     // TODO: We need to duplicate this here, otherwise it will only validated on persist(): http://jira.jboss.com/jira/browse/JBSEAM-2671
-    @Length(min = 0, max = 32768)
+    @Length(min = 0, max = 32767)
     public String getFormContent() {
         // Load the document content and resolve links
         if (formContent == null) syncInstanceToFormContent(getParentNode());

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/CorePreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/CorePreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/CorePreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,22 +0,0 @@
-package org.jboss.seam.wiki.core.action.prefs;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-
-import java.util.HashSet;
-import java.util.Set;
-
- at Name("corePreferencesSupport")
-public class CorePreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(WikiPreferences.class) );
-            add( createPreferenceEntity(UserManagementPreferences.class) );
-            add( createPreferenceEntity(DocumentEditorPreferences.class) );
-            add( createPreferenceEntity(CommentsPreferences.class) );
-        }};
-    }
-
-}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/UserManagementPreferences.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/UserManagementPreferences.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/prefs/UserManagementPreferences.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -58,7 +58,7 @@
         visibility = PreferenceVisibility.SYSTEM,
         editorIncludeName = "AdaptiveTextInput"
     )
-    @Length(min = 0, max = 1024)
+    @Length(min = 0, max = 1023)
     private String homepageDefaultContent;
 
     public String getActivationCodeSalt() {

Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheManager.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheManager.java	                        (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheManager.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.wiki.core.cache;
+
+import org.jboss.seam.annotations.*;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.log.LogProvider;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.management.ManagementService;
+
+import javax.management.MBeanServer;
+import java.lang.management.ManagementFactory;
+
+/**
+ * Seam-managed EHCache backend, starts and stops one CacheManager per application.
+ *
+ * @author Christian Bauer
+ */
+ at BypassInterceptors
+public class EHCacheManager {
+
+    private static final LogProvider log = Logging.getLogProvider(EHCacheManager.class);
+
+    private CacheManager manager;
+    private boolean registerMonitoring = true;
+
+    public boolean isRegisterMonitoring() {
+        return registerMonitoring;
+    }
+
+    public void setRegisterMonitoring(boolean registerMonitoring) {
+        this.registerMonitoring = registerMonitoring;
+    }
+
+    @Create
+    public void initCacheManager() {
+        log.info("initalizing EHCacheManager from /ehcache.xml");
+        manager = CacheManager.create();
+
+        if (isRegisterMonitoring()) {
+            // Register statistics MBean of EHCache on the current MBean server
+            log.info("registering EHCache monitoring MBean");
+            MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
+            ManagementService.registerMBeans(manager, mBeanServer, false, false, false, true);
+        }
+    }
+
+    @Destroy
+    public void shutdownCacheManager() {
+        log.info("shutting down EHCacheManager");
+        manager.shutdown();
+        manager = null;
+    }
+
+    @Unwrap
+    public CacheManager getCacheManager() {
+        return manager;
+    }
+
+    public static CacheManager instance() {
+        if (!Contexts.isApplicationContextActive()) {
+            throw new IllegalStateException("No active application scope");
+        }
+        return (CacheManager)Component.getInstance("ehCacheManager");
+    }
+}

Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheProvider.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheProvider.java	                        (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/EHCacheProvider.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.wiki.core.cache;
+
+import org.hibernate.cache.*;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Properties;
+
+import net.sf.ehcache.CacheManager;
+
+/**
+ * Cache provider for Hibernate that utilizes Seam-managed EHCache backend.
+ *
+ * @author Christian Bauer
+ */
+public class EHCacheProvider implements CacheProvider {
+
+    private static final Log log = LogFactory.getLog(EHCacheProvider.class);
+
+    protected CacheManager getCacheManager() {
+        return EHCacheManager.instance();
+    }
+
+    public void start(Properties properties) throws CacheException {
+        // NOOP, started by EHCacheManager Seam component
+    }
+
+    public void stop() {
+        // NOOP, destroyed by EHCacheManager Seam component
+    }
+
+    public Cache buildCache(String name, Properties properties) throws CacheException {
+	    try {
+            net.sf.ehcache.Cache cache = getCacheManager().getCache(name);
+            if (cache == null) {
+                log.warn("Could not find configuration [" + name + "]; using defaults.");
+                getCacheManager().addCache(name);
+                cache = getCacheManager().getCache(name);
+                log.debug("started EHCache region: " + name);
+            }
+            return new EhCache(cache);
+	    }
+        catch (net.sf.ehcache.CacheException e) {
+            throw new CacheException(e);
+        }
+    }
+
+    public long nextTimestamp() {
+        return Timestamper.next();
+    }
+
+    public boolean isMinimalPutsEnabledByDefault() {
+        return false;
+    }
+}

Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/PageFragmentCache.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/PageFragmentCache.java	                        (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/cache/PageFragmentCache.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.wiki.core.cache;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+
+import java.io.Serializable;
+
+/**
+ * Override Seam built-in pojoCache component with EHCache implementation.
+ *
+ * @author Christian Bauer
+ */
+
+ at BypassInterceptors
+public class PageFragmentCache {
+
+    private static final LogProvider log = Logging.getLogProvider(PageFragmentCache.class);
+
+    public static final String CACHE_REGION_NAME = "WikiPageFragmentCache";
+
+    // This is threadsafe
+    Cache cache;
+
+    @Create
+    public void start() throws Exception {
+
+        log.info("starting wiki page fragment cache region");
+        try {
+            CacheManager manager = EHCacheManager.instance();
+
+            cache = EHCacheManager.instance().getCache(CACHE_REGION_NAME);
+            if (cache == null) {
+                log.warn("Could not find configuration [" + CACHE_REGION_NAME + "]; using defaults.");
+                manager.addCache(CACHE_REGION_NAME);
+                cache = manager.getCache(CACHE_REGION_NAME);
+                log.debug("started EHCache region: " + CACHE_REGION_NAME);
+            }
+
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    public void put(Serializable key, String content) {
+        cache.put(new Element(key, content));
+    }
+
+    public String get(Serializable key) {
+        Element result = cache.get(key);
+        return result != null ? (String)result.getValue() : null;
+    }
+
+    public void remove(Serializable key) {
+        cache.remove(key);
+    }
+
+    public static PageFragmentCache instance() {
+        if (!Contexts.isApplicationContextActive()) {
+            throw new IllegalStateException("No active application scope");
+        }
+        return (PageFragmentCache) Component.getInstance(PageFragmentCache.class, ScopeType.APPLICATION);
+    }
+
+}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -46,71 +46,6 @@
         <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
     </database-object>
 
-    <!--
-    <database-object>
-        <create>
-            alter table FEED_FEEDENTRY drop constraint FK_FEED_FEEDENTRY_FEED_ID;
-            alter table FEED_FEEDENTRY add constraint FK_FEED_FEEDENTRY_FEED_ID foreign key (FEED_ID) references FEED on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table FEED_FEEDENTRY drop constraint FK_FEED_FEEDENTRY_FEEDENTRY_ID;
-            alter table FEED_FEEDENTRY add constraint FK_FEED_FEEDENTRY_FEEDENTRY_ID foreign key (FEEDENTRY_ID) references FEEDENTRY on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table WIKI_DIRECTORY drop constraint FK_WIKI_DIRECTORY_DEFAULT_FILE_ID;
-            alter table WIKI_DIRECTORY add constraint FK_WIKI_DIRECTORY_DEFAULT_FILE_ID foreign key (DEFAULT_FILE_ID) references WIKI_FILE on delete set null;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USERS drop constraint FK_USER_MEMBER_HOME_WIKI_DIRECTORY_ID;
-            alter table USERS add constraint FK_USER_MEMBER_HOME_WIKI_DIRECTORY_ID foreign key (MEMBER_HOME_WIKI_DIRECTORY_ID) references WIKI_DIRECTORY on delete set null;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USER_ROLE drop constraint USER_ROLE_USER_ID;
-            alter table USER_ROLE add constraint USER_ROLE_USER_ID foreign key (USER_ID) references USERS on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USER_ROLE drop constraint USER_ROLE_ROLE_ID;
-            alter table USER_ROLE add constraint USER_ROLE_ROLE_ID foreign key (ROLE_ID) references ROLES on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USERS drop constraint FK_USER_USER_PROFILE_ID;
-            alter table USERS add constraint FK_USER_USER_PROFILE_ID foreign key (USER_PROFILE_ID) references USER_PROFILE on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.HSQLDialect"/>
-    </database-object>
--->
-
     <!-- ############################### MySQL ############################### -->
 
 
@@ -119,14 +54,14 @@
             alter table WIKI_TAG drop foreign key FK_WIKI_TAG_FILE_ID;
         </create>
         <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
     <database-object>
         <create>
             alter table WIKI_TAG add constraint FK_WIKI_TAG_FILE_ID foreign key (FILE_ID) references WIKI_FILE(NODE_ID) on delete cascade;
         </create>
         <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -134,14 +69,14 @@
             alter table WIKI_FILE_LINK drop foreign key FK_SOURCE_WIKI_FILE_ID;
         </create>
         <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
     <database-object>
         <create>
             alter table WIKI_FILE_LINK add constraint FK_SOURCE_WIKI_FILE_ID foreign key (SOURCE_WIKI_FILE_ID) references WIKI_FILE(NODE_ID) on delete cascade;
         </create>
         <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -149,128 +84,24 @@
             alter table WIKI_FILE_LINK drop foreign key FK_TARGET_WIKI_FILE_ID;
         </create>
         <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
     <database-object>
         <create>
             alter table WIKI_FILE_LINK add constraint FK_TARGET_WIKI_FILE_ID foreign key (TARGET_WIKI_FILE_ID) references WIKI_FILE(NODE_ID) on delete cascade;
         </create>
         <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
-    <!--
     <database-object>
         <create>
-            alter table FEED_FEEDENTRY drop foreign key FK_FEED_FEEDENTRY_FEED_ID;
-        </create><drop/><dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-    <database-object>
-        <create>
-            alter table FEED_FEEDENTRY
-                add constraint FK_FEED_FEEDENTRY_FEED_ID foreign key (FEED_ID) references FEED (FEED_ID) on delete cascade;
-        </create><drop/><dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table FEED_FEEDENTRY drop foreign key FK_FEED_FEEDENTRY_FEEDENTRY_ID;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-    <database-object>
-        <create>
-            alter table FEED_FEEDENTRY
-                add constraint FK_FEED_FEEDENTRY_FEEDENTRY_ID foreign key (FEEDENTRY_ID) references FEEDENTRY (FEEDENTRY_ID) on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table WIKI_DIRECTORY drop foreign key FK_WIKI_DIRECTORY_DEFAULT_FILE_ID;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-    <database-object>
-        <create>
-            alter table WIKI_DIRECTORY add constraint FK_WIKI_DIRECTORY_DEFAULT_FILE_ID foreign key (DEFAULT_FILE_ID) references WIKI_FILE(NODE_ID) on delete set null;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USERS drop foreign key FK_USER_MEMBER_HOME_WIKI_DIRECTORY_ID;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-    <database-object>
-        <create>
-            alter table USERS add constraint FK_USER_MEMBER_HOME_WIKI_DIRECTORY_ID foreign key (MEMBER_HOME_WIKI_DIRECTORY_ID) references WIKI_DIRECTORY(NODE_ID) on delete set null;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USER_ROLE drop foreign key USER_ROLE_USER_ID;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-    <database-object>
-        <create>
-            alter table USER_ROLE add constraint USER_ROLE_USER_ID foreign key (USER_ID) references USERS (USER_ID) on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USER_ROLE drop foreign key USER_ROLE_ROLE_ID;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-    <database-object>
-        <create>
-            alter table USER_ROLE add constraint USER_ROLE_ROLE_ID foreign key (ROLE_ID) references ROLES (ROLE_ID) on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-
-    <database-object>
-        <create>
-            alter table USERS drop foreign key FK_USER_USER_PROFILE_ID;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
-    <database-object>
-        <create>
-            alter table USERS add constraint FK_USER_USER_PROFILE_ID foreign key (USER_PROFILE_ID) references USER_PROFILE (USER_PROFILE_ID) on delete cascade;
-        </create>
-        <drop/>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
-    </database-object>
--->
-    <database-object>
-        <create>
             create index IDX_PREFERENCE_ENTITY_NAME on PREFERENCE (ENTITY_NAME)
         </create>
         <drop>
             drop index IDX_PREFERENCE_ENTITY_NAME
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -280,7 +111,7 @@
         <drop>
             drop index IDX_PREFERENCE_ENTITY_PROPERTY_NAME
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -290,7 +121,7 @@
         <drop>
             drop index IDX_WIKI_NODE_RATING
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -300,7 +131,7 @@
         <drop>
             drop index IDX_WIKI_NODE_READ_ACCESS_LEVEL
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -310,7 +141,7 @@
         <drop>
             drop index IDX_WIKI_NODE_CREATED_ON
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -320,7 +151,7 @@
         <drop>
             drop index IDX_WIKI_DIRECTORY_NS_LEFT
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -330,7 +161,7 @@
         <drop>
             drop index IDX_WIKI_DIRECTORY_NS_RIGHT
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -340,7 +171,7 @@
         <drop>
             drop index IDX_WIKI_DIRECTORY_NS_THREAD
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -350,7 +181,7 @@
         <drop>
             drop index IDX_WIKI_COMMENT_NS_LEFT
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -360,7 +191,7 @@
         <drop>
             drop index IDX_WIKI_COMMENT_NS_RIGHT
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -370,7 +201,7 @@
         <drop>
             drop index IDX_WIKI_COMMENT_NS_THREAD
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
     <database-object>
@@ -380,7 +211,7 @@
         <drop>
             drop index IDX_WIKI_DOCUMENT_HEADER_MACROS
         </drop>
-        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
+        <dialect-scope name="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
     </database-object>
 
 </hibernate-mapping>

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Feed.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Feed.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Feed.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -23,16 +23,16 @@
     @Column(name = "FEED_ID")
     private Long id;
 
-    @Column(name = "FEED_LINK", nullable = false, length = 1024)
+    @Column(name = "FEED_LINK", nullable = false, length = 1023)
     private String link;
 
-    @Column(name = "TITLE", nullable = false, length = 1024)
+    @Column(name = "TITLE", nullable = false, length = 1023)
     private String title;
 
-    @Column(name = "DESCRIPTION", nullable = true, length = 1024)
+    @Column(name = "DESCRIPTION", nullable = true, length = 1023)
     private String description;
 
-    @Column(name = "AUTHOR", nullable = false, length = 1024)
+    @Column(name = "AUTHOR", nullable = false, length = 1023)
     private String author;
 
     @Column(name = "PUBLISHED_ON", nullable = false, updatable = false)

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/FeedEntry.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/FeedEntry.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/FeedEntry.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -32,11 +32,11 @@
     protected int version = 0;
 
     @Column(name = "LINK", nullable = false)
-    @Length(min = 3, max = 1024)
+    @Length(min = 3, max = 1023)
     private String link;
 
     @Column(name = "TITLE", nullable = false)
-    @Length(min = 3, max = 1024)
+    @Length(min = 3, max = 1023)
     private String title;
 
     @Transient
@@ -60,7 +60,7 @@
     private String descriptionType;
 
     @Column(name = "DESCRIPTION_VALUE", nullable = false)
-    @Length(min = 1, max = 32768)
+    @Length(min = 1, max = 32767)
     private String descriptionValue;
 
     public FeedEntry() {}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/HistoricalWikiFile.hbm.xml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -25,7 +25,7 @@
         <property name="lastModifiedByUsername" column="LAST_MODIFIED_BY_USERNAME" not-null="false"/>
 
         <!-- Optional WikiFile subclass properties -->
-        <property name="content" column="CONTENT" length="32768"/>
+        <property name="content" column="CONTENT" length="32767"/>
 
     </class>
 

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/LinkProtocol.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/LinkProtocol.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/LinkProtocol.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -34,7 +34,7 @@
     private String prefix;
 
     @Column(name = "LINK", nullable = false)
-    @Length(min = 3, max = 1000)
+    @Length(min = 3, max = 1023)
     private String link;
 
     public LinkProtocol() {}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/UserProfile.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/UserProfile.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/UserProfile.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -28,11 +28,11 @@
     @Column(name = "CREATED_ON", nullable = false, updatable = false)
     private Date createdOn = new Date();
 
-    @Length(min = 0, max = 1000)
+    @Length(min = 0, max = 1023)
     @Column(name = "BIO", nullable = true)
     private String bio;
 
-    @Length(min = 0, max = 1000)
+    @Length(min = 0, max = 1023)
     @Column(name = "WEBSITE", nullable = true)
     private String website;
 
@@ -40,11 +40,11 @@
     @Column(name = "LOCATION", nullable = true)
     private String location;
 
-    @Length(min = 0, max = 1000)
+    @Length(min = 0, max = 1023)
     @Column(name = "OCCUPATION", nullable = true)
     private String occupation;
 
-    @Length(min = 0, max = 1000)
+    @Length(min = 0, max = 1023)
     @Column(name = "SIGNATURE", nullable = true)
     private String signature;
 

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiComment.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -16,7 +16,6 @@
 @Entity
 @Table(name = "WIKI_COMMENT")
 @org.hibernate.annotations.ForeignKey(name = "FK_WIKI_COMMENT_NODE_ID")
-//TODO: @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE)
 
 @org.hibernate.search.annotations.Indexed
 @Searchable(description = "Comments")
@@ -43,11 +42,11 @@
     private String fromUserEmail;
 
     @Column(name = "FROM_USER_HOMEPAGE", nullable = true)
-    @Length(min = 0, max = 1000)
+    @Length(min = 0, max = 1023)
     private String fromUserHomepage;
 
     @Column(name = "CONTENT", nullable = false)
-    @Length(min = 1, max = 32768)
+    @Length(min = 1, max = 32767)
     @Basic(fetch = FetchType.LAZY) // Lazy loaded through bytecode instrumentation
     @org.hibernate.search.annotations.Field(index = org.hibernate.search.annotations.Index.TOKENIZED)
     private String content;

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDocument.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDocument.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/model/WikiDocument.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -31,24 +31,24 @@
     private boolean enableCommentsOnFeeds = true;
 
     @Column(name = "HEADER", nullable = true)
-    @Length(min = 0, max = 4000)
+    @Length(min = 0, max = 1023)
     private String header;
-    @Column(name = "HEADER_MACROS", nullable = true, length = 4000)
+    @Column(name = "HEADER_MACROS", nullable = true, length = 1023)
     private String headerMacrosString;
 
     @Column(name = "CONTENT", nullable = false)
-    @Length(min = 0, max = 32768)
+    @Length(min = 0, max = 32767)
     @Basic(fetch = FetchType.LAZY) // Lazy loaded through bytecode instrumentation
     @org.hibernate.search.annotations.Field(index = org.hibernate.search.annotations.Index.TOKENIZED)
     @Searchable(description = "Content")
     private String content;
-    @Column(name = "CONTENT_MACROS", nullable = true, length = 4000)
+    @Column(name = "CONTENT_MACROS", nullable = true, length = 1023)
     private String contentMacrosString;
 
     @Column(name = "FOOTER", nullable = true)
-    @Length(min = 0, max = 4000)
+    @Length(min = 0, max = 1023)
     private String footer;
-    @Column(name = "FOOTER_MACROS", nullable = true, length = 4000)
+    @Column(name = "FOOTER_MACROS", nullable = true, length = 1023)
     private String footerMacrosString;
 
     public WikiDocument() {

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/preferences/WikiPreferenceValue.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/preferences/WikiPreferenceValue.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/preferences/WikiPreferenceValue.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -54,7 +54,7 @@
             @Column( name="DOUBLE_VALUE"),
             @Column( name="TIMESTAMP_VALUE"),
             @Column( name="BOOLEAN_VALUE"),
-            @Column( name="STRING_VALUE", length = 1024)
+            @Column( name="STRING_VALUE", length = 1023)
         }
 	)
     private Object value;

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/Converters.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/Converters.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/Converters.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -10,7 +10,6 @@
 import org.jboss.seam.ScopeType;
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
 import org.jboss.seam.wiki.core.model.Role;
 import org.jboss.seam.wiki.core.search.metamodel.SearchRegistry;
 import org.jboss.seam.wiki.core.search.metamodel.SearchableEntity;
@@ -101,66 +100,4 @@
         }
     }
 
-
-    @Name("treeNodeAdapter")
-    public static class TreeNodeAdapter {
-
-        /* TODO: Fixme or deleteme
-        @Factory(value = "writableDirectoryTree", scope = ScopeType.CONVERSATION, autoCreate = true)
-        public TreeNode loadWritableDirectoryTree() {
-            Directory wikiroot = (Directory) Component.getInstance("restrictedWikiRoot");
-            return new WikiTreeNode(wikiroot, true);
-        }
-        @Factory(value = "readableDirectoryTree", scope = ScopeType.CONVERSATION, autoCreate = true)
-        public TreeNode loadReadableDirectoryTree() {
-            Directory wikiroot = (Directory) Component.getInstance("restrictedWikiRoot");
-            return new WikiTreeNode(wikiroot, false);
-        }
-        class WikiTreeNode implements TreeNode {
-            boolean onlyWritableChildren;
-            private Node wikiNode;
-            private Map<Object, TreeNode> childrenMap = new LinkedHashMap<Object,TreeNode>();
-
-            public WikiTreeNode(Node wikiNode, boolean onlyWritableChildren) {
-                if (wikiNode != null) {
-                    this.wikiNode = wikiNode;
-                    this.onlyWritableChildren = onlyWritableChildren;
-                    for (Node childNode : wikiNode.getChildren()) {
-                        if (!WikiUtil.isDirectory(childNode)) continue;
-                        if (onlyWritableChildren && !Identity.instance().hasPermission("Node", "edit", childNode)) continue;
-                        childrenMap.put(childNode.getId(), new WikiTreeNode(childNode, onlyWritableChildren));
-                    }
-                }
-            }
-            public Object getData() { return wikiNode; }
-            public void setData(Object node) { this.wikiNode = (Node)node; }
-
-            public boolean isLeaf() {
-                return childrenMap.size() == 0;
-            }
-            public Iterator getChildren() {
-                return childrenMap.entrySet().iterator();
-            }
-            public TreeNode getChild(Object identifier) {
-                return childrenMap.get( identifier );
-            }
-            public void addChild(Object identifier, TreeNode treeNode) {
-                childrenMap.put(identifier, treeNode);
-            }
-            public void removeChild(Object identifier) {
-                // Immutable
-            }
-
-            public TreeNode getParent() {
-                return new WikiTreeNode(wikiNode.getParent(), onlyWritableChildren);
-            }
-
-            public void setParent(TreeNode treeNode) {
-                // Immutable
-            }
-        }
-        */
-
-    }
-
 }

Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPageFragmentCacheRenderer.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPageFragmentCacheRenderer.java	                        (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPageFragmentCacheRenderer.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.wiki.core.ui;
+
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.ui.component.UICache;
+import org.jboss.seam.ui.util.cdk.RendererBase;
+import org.jboss.seam.wiki.core.cache.PageFragmentCache;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Serializable;
+
+/**
+ * Implementation of <tt>&lt;s:cache&gt;</tt> renderer based on EHCache.
+ *
+ * @author Christian Bauer
+ */
+public class WikiPageFragmentCacheRenderer extends RendererBase {
+
+    private static final LogProvider log = Logging.getLogProvider(UICache.class);
+
+    @Override
+    protected Class getComponentClass() {
+        return UICache.class;
+    }
+
+    @Override
+    protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+        UICache cache = (UICache) component;
+        if (cache.isEnabled()) {
+            String key = cache.getKey();
+            String cachedContent = getFromCache(key);
+            if (cachedContent == null) {
+                log.debug("rendering from scratch: " + key);
+                StringWriter stringWriter = new StringWriter();
+                ResponseWriter cachingResponseWriter = writer.cloneWithWriter(stringWriter);
+                context.setResponseWriter(cachingResponseWriter);
+                renderChildren(context, component);
+                context.setResponseWriter(writer);
+                String output = stringWriter.getBuffer().toString();
+                writer.write(output);
+                putInCache(key, output);
+            } else {
+                log.debug("rendering from cache: " + key);
+                writer.write(cachedContent);
+            }
+        } else {
+            log.debug("cached rendering is disabled for: " + cache.getKey());
+            renderChildren(context, component);
+        }
+    }
+
+
+    @Override
+    public boolean getRendersChildren() {
+        return true;
+    }
+
+    public static void putInCache(Serializable key, String content) {
+        PageFragmentCache.instance().put(key, content);
+    }
+
+    public static String getFromCache(Serializable key) {
+        return PageFragmentCache.instance().get(key);
+    }
+
+}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiSecurityEvents.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -15,6 +15,8 @@
 import javax.faces.application.FacesMessage;
 
 /**
+ * Overrides the "login failed" message and turns it into a WARN (we don't want INFO here).
+ *
  * @author Christian Bauer
  */
 @Name("org.jboss.seam.security.facesSecurityEvents")

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiTextEditor.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiTextEditor.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiTextEditor.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,27 +1,24 @@
 package org.jboss.seam.wiki.core.ui;
 
-import org.jboss.seam.annotations.remoting.WebRemote;
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.ScopeType;
 import org.jboss.seam.faces.FacesMessages;
 import org.jboss.seam.ui.validator.FormattedTextValidator;
 
-import java.util.Map;
-import java.util.HashMap;
 import java.io.Serializable;
 
 import javax.faces.validator.ValidatorException;
 import javax.faces.application.FacesMessage;
 
 /**
- * Store UI status of wiki text editor.
+ * Utility class bound to Wiki text editor UI.
  * <p>
  *
  * @author Christian Bauer
  */
 @Name("wikiTextEditor")
- at Scope(ScopeType.CONVERSATION) // TODO: Should be PAGE but doesn't work with Seam remoting!
+ at Scope(ScopeType.CONVERSATION)
 public class WikiTextEditor implements Serializable {
 
     public void validate(String textEditorId, String value) {

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,28 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.blogdirectory;
-
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.annotations.Name;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Christian Bauer
- */
- at Name("blogPreferencesSupport")
-public class BlogPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(BlogPreferences.class) );
-        }};
-    }
-
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirMenu/DirMenuPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirMenu/DirMenuPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirMenu/DirMenuPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,48 +0,0 @@
-package org.jboss.seam.wiki.plugin.dirMenu;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-
-import java.util.HashSet;
-import java.util.Set;
-
- at Name("dirMenuPreferencesSupport")
-public class DirMenuPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(DirMenuPreferences.class) );
-        }};
-    }
-
-/* TODO: Too complicated for now...
-
-    @Name("dirMenuQualityPreferenceValueTemplate")
-    @Scope(ScopeType.CONVERSATION)
-    public static class DirMenuQualityTemplate implements PreferenceValueTemplate {
-
-        public List<String> getTemplateValues() {
-            return Collections.emptyList();
-        }
-
-        public String getConverterComponentName() {
-            return "dirMenuQualityConverter";
-        }
-    }
-
-    @Name("dirMenuQualityConverter")
-    @org.jboss.seam.annotations.faces.Converter
-    public static class DirMenuQualityConverter implements Converter, Serializable {
-
-        public Object getAsObject(javax.faces.context.FacesContext facesContext, UIComponent uiComponent, String s) {
-            return s != null ? DirMenuQuality.valueOf(s) : null;
-        }
-
-        public String getAsString(javax.faces.context.FacesContext facesContext, UIComponent uiComponent, Object o) {
-            return o instanceof DirMenuQuality ? ((DirMenuQuality)o).name() : null;
-        }
-
-    }
-    */
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirToc/DirTocPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirToc/DirTocPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/dirToc/DirTocPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.dirToc;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * @author Christian Bauer
- */
- at Name("dirTocPreferencesSupport")
-public class DirTocPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(DirTocPreferences.class) );
-        }};
-    }
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/docPager/DocPagerPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/docPager/DocPagerPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/docPager/DocPagerPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,28 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.docPager;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Christian Bauer
- */
- at Name("docPagerPreferencesSupport")
-public class DocPagerPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(DocPagerPreferences.class) );
-        }};
-    }
-
-}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferences.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferences.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferences.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -34,7 +34,7 @@
         visibility = {PreferenceVisibility.INSTANCE},
         editorIncludeName = "AdaptiveTextInput"
     )
-    @Length(min = 0, max = 4000)
+    @Length(min = 0, max = 4096)
     private String urls;
 
     @PreferenceProperty(

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedAggregator/FeedAggregatorPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.feedAggregator;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Christian Bauer
- */
- at Name("feedAggregatorPreferencesSupport")
-public class FeedAggregatorPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(FeedAggregatorPreferences.class) );
-        }};
-    }
-}

Copied: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersFeedPreferenceValueTemplate.java (from rev 7541, trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersPreferencesSupport.java)
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersFeedPreferenceValueTemplate.java	                        (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersFeedPreferenceValueTemplate.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.wiki.plugin.feedTeasers;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.wiki.core.feeds.FeedDAO;
+import org.jboss.seam.wiki.core.model.Feed;
+import org.jboss.seam.wiki.preferences.PreferenceValueTemplate;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author Christian Bauer
+ */
+ at Name("feedTeasersFeedPreferenceValueTemplate")
+ at Scope(ScopeType.CONVERSATION)
+public class FeedTeasersFeedPreferenceValueTemplate implements PreferenceValueTemplate, Serializable {
+
+    @In
+    FeedDAO feedDAO;
+
+    List<String> feedIdentifiers;
+
+    public List<String> getTemplateValues() {
+        if (feedIdentifiers == null) {
+            List<Feed> feeds = feedDAO.findAllFeeds();
+            for (Feed feed : feeds) {
+                feedIdentifiers.add(feed.getId().toString());
+            }
+        }
+        return feedIdentifiers;
+    }
+
+}


Property changes on: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersFeedPreferenceValueTemplate.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/feedTeasers/FeedTeasersPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.feedTeasers;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.wiki.core.feeds.FeedDAO;
-import org.jboss.seam.wiki.core.model.Feed;
-import org.jboss.seam.wiki.preferences.PreferenceValueTemplate;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.io.Serializable;
-
-/**
- * @author Christian Bauer
- */
- at Name("feedTeasersPreferencesSupport")
-public class FeedTeasersPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(FeedTeasersPreferences.class) );
-        }};
-    }
-
-    @Name("feedTeasersFeedPreferenceValueTemplate")
-    @Scope(ScopeType.CONVERSATION)
-    public static class FeedTeasersFeedTemplate implements PreferenceValueTemplate, Serializable {
-
-        @In
-        FeedDAO feedDAO;
-
-        List<String> feedIdentifiers;
-
-        public List<String> getTemplateValues() {
-            if (feedIdentifiers == null) {
-                List<Feed> feeds = feedDAO.findAllFeeds();
-                for (Feed feed : feeds) {
-                    feedIdentifiers.add(feed.getId().toString());
-                }
-            }
-            return feedIdentifiers;
-        }
-
-    }
-
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/flash/FlashPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/flash/FlashPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/flash/FlashPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,19 +0,0 @@
-package org.jboss.seam.wiki.plugin.flash;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-
-import java.util.Set;
-import java.util.HashSet;
-
- at Name("flashPreferencesSupport")
-public class FlashPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(FlashPreferences.class) );
-        }};
-    }
-
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/forum/ForumPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,28 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.forum;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * @author Christian Bauer
- */
- at Name("forumPreferencesSupport")
-public class ForumPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(ForumPreferences.class) );
-            add( createPreferenceEntity(ForumTopPostersPreferences.class) );
-        }};
-    }
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/jiraIssueList/JiraIssueListPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/jiraIssueList/JiraIssueListPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/jiraIssueList/JiraIssueListPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.jiraIssueList;
-
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-import org.jboss.seam.annotations.Name;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author Christian Bauer
- */
- at Name("jiraIssueListPreferencesSupport")
-public class JiraIssueListPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(JiraIssueListPreferences.class) );
-        }};
-    }
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/lastmodified/LastModifiedDocumentsPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/lastmodified/LastModifiedDocumentsPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/lastmodified/LastModifiedDocumentsPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,19 +0,0 @@
-package org.jboss.seam.wiki.plugin.lastmodified;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-
-import java.util.HashSet;
-import java.util.Set;
-
- at Name("lastModifiedDocumentsPreferencesSupport")
-public class LastModifiedDocumentsPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(LastModifiedDocumentsPreferences.class) );
-        }};
-    }
-
-}

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/plugin/tags/TagsPreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.plugin.tags;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.wiki.preferences.metamodel.PreferenceEntity;
-import org.jboss.seam.wiki.preferences.metamodel.PreferencesSupport;
-
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * @author Christian Bauer
- */
- at Name("tagsPreferencesSupport")
-public class TagsPreferencesSupport extends PreferencesSupport {
-
-    public Set<PreferenceEntity> getPreferenceEntities() {
-        return new HashSet<PreferenceEntity>() {{
-            add( createPreferenceEntity(TagsPreferences.class) );
-        }};
-    }
-}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferenceRegistry.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferenceRegistry.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferenceRegistry.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,13 +1,10 @@
 package org.jboss.seam.wiki.preferences.metamodel;
 
 import org.jboss.seam.ScopeType;
-import org.jboss.seam.wiki.preferences.PreferenceVisibility;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.*;
 import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.core.Events;
 import org.jboss.seam.log.Log;
+import org.jboss.seam.wiki.preferences.PreferenceVisibility;
 
 import java.util.*;
 
@@ -18,6 +15,12 @@
     @Logger
     static Log log;
 
+    @In(
+        value="#{deploymentStrategy.annotatedClasses['org.jboss.seam.wiki.preferences.annotations.Preferences']}",
+        required = false
+    )
+    Set<Class> preferencesClasses;
+
     Set<PreferenceEntity> preferenceEntities = new HashSet<PreferenceEntity>();
     Map<String, PreferenceEntity> preferenceEntitiesByName = new HashMap<String, PreferenceEntity>();
 
@@ -26,36 +29,33 @@
     Set<PreferenceEntity> preferenceEntitiesInstance = new HashSet<PreferenceEntity>();
 
     @Observer("Wiki.started")
-    public void scanForPreferencesSupportComponents() {
-
+    public void create() {
         log.debug("initializing preferences registry");
 
-        // Fire an event and let all listeners add themself into the given collection
-        Set<PreferencesSupport> preferencesSupportComponents = new HashSet<PreferencesSupport>();
-        Events.instance().raiseEvent("Preferences.addPreferencesSupport", preferencesSupportComponents);
+        if (preferencesClasses == null)
+            throw new RuntimeException("Add @Preferences annotation to META-INF/seam-deployment.properties");
 
-        log.debug("found preferences support components: " + preferencesSupportComponents.size());
+        for (Class preferencesClass : preferencesClasses) {
+            PreferenceEntity preferenceEntity = new PreferenceEntity(preferencesClass);
 
-        for (PreferencesSupport component : preferencesSupportComponents) {
+            log.debug("adding '" + preferenceEntity.getEntityName() + "', " + preferenceEntity);
 
-            for (PreferenceEntity preferenceEntity : component.getPreferenceEntities()) {
-                log.debug("adding '" + preferenceEntity.getEntityName() + "', " + preferenceEntity);
+            if (preferenceEntitiesByName.containsKey(preferenceEntity.getEntityName())) {
+                throw new RuntimeException("Duplicate preference entity name: " + preferenceEntity.getEntityName());
+            }
 
-                if (preferenceEntitiesByName.containsKey(preferenceEntity.getEntityName())) {
-                    throw new RuntimeException("Duplicate preference entity name: " + preferenceEntity.getEntityName());
-                }
+            preferenceEntities.add(preferenceEntity);
+            preferenceEntitiesByName.put(preferenceEntity.getEntityName(), preferenceEntity);
 
-                preferenceEntities.add(preferenceEntity);
-                preferenceEntitiesByName.put(preferenceEntity.getEntityName(), preferenceEntity);
+            if (preferenceEntity.isSystemPropertiesVisible())
+                preferenceEntitiesSystem.add(preferenceEntity);
+            if (preferenceEntity.isUserPropertiesVisible())
+                preferenceEntitiesUser.add(preferenceEntity);
+            if (preferenceEntity.isInstancePropertiesVisible())
+                preferenceEntitiesInstance.add(preferenceEntity);
+        }
 
-                if (preferenceEntity.isSystemPropertiesVisible())
-                    preferenceEntitiesSystem.add(preferenceEntity);
-                if (preferenceEntity.isUserPropertiesVisible())
-                    preferenceEntitiesUser.add(preferenceEntity);
-                if (preferenceEntity.isInstancePropertiesVisible())
-                    preferenceEntitiesInstance.add(preferenceEntity);
-            }
-        }
+
     }
 
     public Set<PreferenceEntity> getPreferenceEntities() {

Deleted: trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferencesSupport.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferencesSupport.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/preferences/metamodel/PreferencesSupport.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.wiki.preferences.metamodel;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Scope;
-
-import java.util.Set;
-
- at Scope(ScopeType.APPLICATION)
-public abstract class PreferencesSupport {
-
-    @Observer("Preferences.addPreferencesSupport")
-    public void add(Set<PreferencesSupport> preferencesSupportComponents) {
-        preferencesSupportComponents.add(this);
-    }
-
-    public abstract Set<PreferenceEntity> getPreferenceEntities();
-
-    public PreferenceEntity createPreferenceEntity(Class preferenceEntityClass) {
-        return new PreferenceEntity(preferenceEntityClass);
-    }
-
-
-}
\ No newline at end of file

Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java	                        (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.wiki.util;
+
+import org.hibernate.dialect.MySQL5InnoDBDialect;
+
+import java.sql.Types;
+
+/**
+ * Fix the broken Hibernate defaults for MySQL databases with UTF-8 encoding.
+ *
+ * @author Christian Bauer
+ */
+public class WikiMySQL5HibernateDialect extends MySQL5InnoDBDialect {
+
+	protected void registerVarcharTypes() {
+		registerColumnType( Types.VARCHAR, "longtext" );
+		registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
+
+        // It's pretty safe to assume that anything with more than 1024 characters (minus length byte) should probably be
+        // a TEXT, not a VARCHAR which would have the "maximum row size" limit of 65KB.
+        // I mean, where is the limit? If you have 20 of these VARCHAR fields on a table, and your character set is
+        // UTF8, you are over the limit. Less than 20 or so should be OK. Just another fine example of how MySQL
+        // protects its users from seeing its ugly internal implementation details.
+        registerColumnType( Types.VARCHAR, 1023, "varchar($l)" );
+	}
+}

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiUtil.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiUtil.java	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiUtil.java	2008-04-03 11:17:41 UTC (rev 7806)
@@ -10,6 +10,7 @@
 import org.jboss.seam.security.Identity;
 import org.jboss.seam.wiki.core.action.prefs.WikiPreferences;
 import org.jboss.seam.wiki.core.model.*;
+import org.jboss.seam.wiki.core.engine.WikiMacro;
 import org.jboss.seam.wiki.preferences.Preferences;
 
 import javax.faces.context.FacesContext;
@@ -292,7 +293,8 @@
     }
 
     public static String formatDate(Date date) {
-        SimpleDateFormat fmt = new SimpleDateFormat("MMM dd, yyyy hh:mm aaa");
+        // TODO: Exceptional date formatting here...
+        SimpleDateFormat fmt = new SimpleDateFormat("MMM dd, yyyy HH:mm");
         return fmt.format(date);
     }
 
@@ -335,4 +337,12 @@
         return msgId.toString();
     }
 
+    public static String macroCacheKey(WikiDocument currentDocument, WikiMacro macro) {
+        Hash hash = (Hash)Component.getInstance(Hash.class);
+
+        StringBuilder builder = new StringBuilder();
+        builder.append(currentDocument.getId()).append(macro.hashCode()).append(macro.getParams().hashCode());
+        return macro.getName() + "-" + hash.hash(builder.toString());
+    }
+
 }

Modified: trunk/examples/wiki/view/docEdit_d.xhtml
===================================================================
--- trunk/examples/wiki/view/docEdit_d.xhtml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/view/docEdit_d.xhtml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -180,7 +180,7 @@
                                 <ui:param name="textEditorColumns" value="#{preferences.get('DocEditor').regularEditAreaColumns}"/>
                                 <ui:param name="textEditorRows" value="#{preferences.get('DocEditor').regularEditAreaRows}"/>
                                 <ui:param name="valueBinding" value="#{documentHome.formContent}"/>
-                                <ui:param name="valueMaxLength" value="32768"/>
+                                <ui:param name="valueMaxLength" value="32767"/>
                                 <ui:param name="valueRequired" value="true"/>
                             </ui:include>
 

Modified: trunk/examples/wiki/view/includes/commentForm.xhtml
===================================================================
--- trunk/examples/wiki/view/includes/commentForm.xhtml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/view/includes/commentForm.xhtml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -87,7 +87,7 @@
                         <ui:param name="namingContainer" value="commentForm"/>
                         <ui:param name="label" value="#{messages['lacewiki.label.commentForm.Comment']}"/>
                         <ui:param name="valueBinding" value="#{commentHome.instance.content}"/>
-                        <ui:param name="valueMaxLength" value="32768"/>
+                        <ui:param name="valueMaxLength" value="32767"/>
                         <ui:param name="valueRequired" value="true"/>
                         <ui:param name="textEditorColumns" value="#{commentHome.instance.ownedByRegularUser ? '60' : '48'}"/>
                         <ui:param name="textEditorRows" value="10"/>

Modified: trunk/examples/wiki/view/plugins/faqBrowser/faqQuestionForm.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/faqBrowser/faqQuestionForm.xhtml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/view/plugins/faqBrowser/faqQuestionForm.xhtml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -33,7 +33,7 @@
                     <ui:param name="namingContainer" value="faqBrowserPlugin\\\\:faqQuestionForm"/>
                     <ui:param name="label" value="#{messages['faqBrowser.label.QuestionText']}"/>
                     <ui:param name="valueBinding" value="#{faqQuestionHome.formContent}"/>
-                    <ui:param name="valueMaxLength" value="32768"/>
+                    <ui:param name="valueMaxLength" value="32767"/>
                     <ui:param name="valueRequired" value="true"/>
                     <ui:param name="textEditorColumns" value="60"/>
                     <ui:param name="textEditorRows" value="20"/>

Modified: trunk/examples/wiki/view/plugins/forumReplies/replyForm.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/forumReplies/replyForm.xhtml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/view/plugins/forumReplies/replyForm.xhtml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -80,7 +80,7 @@
                             <ui:param name="namingContainer" value="forumRepliesPlugin\\\\:replyForm"/>
                             <ui:param name="label" value="#{messages['forum.label.replyForm.Message']}"/>
                             <ui:param name="valueBinding" value="#{replyHome.instance.content}"/>
-                            <ui:param name="valueMaxLength" value="32768"/>
+                            <ui:param name="valueMaxLength" value="32767"/>
                             <ui:param name="valueRequired" value="true"/>
                             <ui:param name="textEditorColumns" value="#{replyHome.instance.ownedByRegularUser ? '65' : '55'}"/>
                             <ui:param name="textEditorRows" value="20"/>

Modified: trunk/examples/wiki/view/plugins/forumTopics/topicForm.xhtml
===================================================================
--- trunk/examples/wiki/view/plugins/forumTopics/topicForm.xhtml	2008-04-03 09:16:30 UTC (rev 7805)
+++ trunk/examples/wiki/view/plugins/forumTopics/topicForm.xhtml	2008-04-03 11:17:41 UTC (rev 7806)
@@ -34,7 +34,7 @@
                             <ui:param name="namingContainer" value="forumTopicsPlugin\\\\:topicForm"/>
                             <ui:param name="label" value="#{messages['forum.label.Message']}"/>
                             <ui:param name="valueBinding" value="#{topicHome.formContent}"/>
-                            <ui:param name="valueMaxLength" value="32768"/>
+                            <ui:param name="valueMaxLength" value="32767"/>
                             <ui:param name="valueRequired" value="true"/>
                             <ui:param name="textEditorColumns" value="60"/>
                             <ui:param name="textEditorRows" value="20"/>




More information about the seam-commits mailing list