[seam-commits] Seam SVN: r8534 - in trunk/examples/wiki: src/etc/META-INF and 3 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jul 29 21:21:14 EDT 2008


Author: christian.bauer at jboss.com
Date: 2008-07-29 21:21:14 -0400 (Tue, 29 Jul 2008)
New Revision: 8534

Modified:
   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/components-test.xml
   trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml
   trunk/examples/wiki/src/etc/WEB-INF/components.xml
   trunk/examples/wiki/src/etc/wiki-dev-ds.xml
   trunk/examples/wiki/src/etc/wiki-test-ds.xml
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/faqBrowser/FaqBrowserDAO.java
   trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
Log:
JBSEAM-3203, fixed FAQ browser root detection query

Modified: trunk/examples/wiki/src/etc/META-INF/components-dev.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/components-dev.xml	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/etc/META-INF/components-dev.xml	2008-07-30 01:21:14 UTC (rev 8534)
@@ -7,6 +7,7 @@
             xmlns:web="http://jboss.com/products/seam/web"
             xmlns:mail="http://jboss.com/products/seam/mail"
             xmlns:transaction="http://jboss.com/products/seam/transaction"
+            xmlns:resteasy="http://jboss.com/products/seam/resteasy"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=
                 "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
@@ -16,6 +17,7 @@
                  http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                  http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                  http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
+                 http://jboss.com/products/seam/resteasy http://jboss.com/products/seam/resteasy-2.1.xsd
                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
 
 
@@ -30,7 +32,7 @@
     </component>
 
     <!-- Mailserver for notification messages -->
-    <mail:mail-session host="localhost" port="25"/>
+    <mail:mail-session host="mail.bluewin.ch" port="25" ssl="false" tls="false"/>
 
     <!-- Maximum size of file uploads -->
     <!-- If you are using MySQL, don't forget their magic stuff:
@@ -41,7 +43,8 @@
     <!-- ############## END OF WIKI USER CONFIGURATION ############## -->
 
     <!-- Running in regular JBoss AS, Seam starts the persistence unit -->
-    <core:init debug="false"/>
+    <core:init debug="false"
+               disabled-interceptors="org.jboss.seam.persistence.ManagedEntityIdentityInterceptor"/>
 
     <!-- Wiki persistence unit, relies on cache manager backend for Hibernate 2nd level cache -->
     <persistence:entity-manager-factory name="wikiEntityManagerFactory"
@@ -62,7 +65,41 @@
             <value>META-INF/testdata/ForumData.dbunit.xml</value>
             <value>META-INF/testdata/KnowledgeBase.dbunit.xml</value>
             <value>META-INF/testdata/FAQData.dbunit.xml</value>
+            <value>META-INF/testdata/Testing.dbunit.xml</value>
         </property>
     </component>
 
+    <resteasy:application-config
+            strip-seam-resource-path="true"
+            resource-path-prefix="/restv1">
+
+        <resteasy:media-type-mappings>
+            <key>xml</key><value>application/xml</value>
+            <key>txt</key><value>text/plain</value>
+        </resteasy:media-type-mappings>
+
+        <resteasy:language-mappings>
+            <key>deutsch</key><value>de-DE</value>
+        </resteasy:language-mappings>
+
+    </resteasy:application-config>
+
+    <!--
+xml : application/xml,
+         html : text/html,
+         txt : text/plain
+
+ en : en-US
+
+
+    <resteasy:application-config
+        scan-providers="false"
+        scan-resources="false"
+        use-builtin-providers="true">
+        <resteasy:resource-class-names>
+            <value>org.jboss.seam.wiki.service.UserResource</value>
+        </resteasy:resource-class-names>
+    </resteasy:application-config>
+    -->
+
 </components>

Modified: trunk/examples/wiki/src/etc/META-INF/components-prod.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/components-prod.xml	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/etc/META-INF/components-prod.xml	2008-07-30 01:21:14 UTC (rev 8534)
@@ -41,7 +41,8 @@
     <!-- ############## END OF WIKI USER CONFIGURATION ############## -->
 
     <!-- Running in regular JBoss AS, Seam starts the persistence unit -->
-    <core:init debug="false"/>
+    <core:init debug="false"
+               disabled-interceptors="org.jboss.seam.persistence.ManagedEntityIdentityInterceptor"/>
 
     <!-- Wiki persistence unit, relies on cache manager backend for Hibernate 2nd level cache -->
     <persistence:entity-manager-factory name="wikiEntityManagerFactory"

Modified: trunk/examples/wiki/src/etc/META-INF/components-test.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/components-test.xml	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/etc/META-INF/components-test.xml	2008-07-30 01:21:14 UTC (rev 8534)
@@ -42,7 +42,10 @@
 
 
     <!-- Running tests in Embeddable JBoss -->
-    <core:init debug="false" jndi-pattern="#{ejbName}/local"/>
+    <core:init debug="false"
+               jndi-pattern="#{ejbName}/local"
+               disabled-interceptors="org.jboss.seam.persistence.ManagedEntityIdentityInterceptor"/>
+
     <transaction:ejb-transaction/>
 
 </components>

Modified: trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml
===================================================================
--- trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/etc/META-INF/persistence-test-war.xml	2008-07-30 01:21:14 UTC (rev 8534)
@@ -7,13 +7,15 @@
 
     <persistence-unit name="wiki" transaction-type="JTA">
         <provider>org.hibernate.ejb.HibernatePersistence</provider>
-        <jta-data-source>java:/wikiTestDatasource</jta-data-source>
+        <jta-data-source>java:/wikiTestDatasourceMysql</jta-data-source>
         <properties>
 
             <!-- MySQL also requires changes to AllTests.tng.xml and wiki-test-ds.xml
+            -->
             <property name="hibernate.dialect" value="org.jboss.seam.wiki.util.WikiMySQL5HibernateDialect"/>
+            <!--
+            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
             -->
-            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
 
             <property name="hibernate.transaction.manager_lookup_class"
                       value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

Modified: trunk/examples/wiki/src/etc/WEB-INF/components.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/components.xml	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/etc/WEB-INF/components.xml	2008-07-30 01:21:14 UTC (rev 8534)
@@ -106,6 +106,7 @@
             <value>default</value>
             <value>sfwkorg</value>
             <value>inrelationto</value>
+            <value>openremote</value>
         </property>
     </component>
 

Modified: trunk/examples/wiki/src/etc/wiki-dev-ds.xml
===================================================================
--- trunk/examples/wiki/src/etc/wiki-dev-ds.xml	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/etc/wiki-dev-ds.xml	2008-07-30 01:21:14 UTC (rev 8534)
@@ -12,11 +12,28 @@
     -->
 
     <local-tx-datasource>
+
         <jndi-name>wikiDatasource</jndi-name>
         <connection-url>jdbc:mysql://localhost/test?characterEncoding=UTF-8</connection-url>
         <driver-class>com.mysql.jdbc.Driver</driver-class>
         <user-name>test</user-name>
         <password></password>
+
+        <min-pool-size>20</min-pool-size>
+
+        <!-- Make sure your MySQL config has that many max_connections!
+             This is the max_threads in default Tomcat server.xml on JBoss AS. -->
+        <max-pool-size>250</max-pool-size>
+
+        <blocking-timeout-millis>5000</blocking-timeout-millis>
+
+        <!-- Needs to be smaller than wait_timeout (which is in seconds) in /etc/my.cnf! -->
+        <idle-timeout-minutes>2</idle-timeout-minutes>
+
+        <!-- These are the secret ingredients that make it stable! A simple check-valid-connection-sql won't be enough! -->
+        <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
+        <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker</valid-connection-checker-class-name>
+
     </local-tx-datasource>
 
 </datasources>

Modified: trunk/examples/wiki/src/etc/wiki-test-ds.xml
===================================================================
--- trunk/examples/wiki/src/etc/wiki-test-ds.xml	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/etc/wiki-test-ds.xml	2008-07-30 01:21:14 UTC (rev 8534)
@@ -6,6 +6,8 @@
 
 <datasources>
 
+    <!--
+    -->
     <local-tx-datasource>
         <jndi-name>wikiTestDatasource</jndi-name>
         <connection-url>jdbc:hsqldb:.</connection-url>
@@ -13,8 +15,7 @@
         <user-name>sa</user-name>
         <password></password>
     </local-tx-datasource>
-
-    <!--
+<!--
     <local-tx-datasource>
         <jndi-name>wikiTestDatasource</jndi-name>
         <connection-url>jdbc:hsqldb:hsql://localhost:9001</connection-url>
@@ -25,14 +26,14 @@
     -->
 
     <!-- MySQL also requires changes to persistence-test.xml and AllTests.tng.xml
+    -->
     <local-tx-datasource>
-        <jndi-name>wikiTestDatasource</jndi-name>
-        <connection-url>jdbc:mysql://localhost/test?characterEncoding=UTF-8</connection-url>
+        <jndi-name>wikiTestDatasourceMysql</jndi-name>
+        <connection-url>jdbc:mysql://localhost/test_1?characterEncoding=UTF-8</connection-url>
         <driver-class>com.mysql.jdbc.Driver</driver-class>
         <user-name>test</user-name>
         <password></password>
     </local-tx-datasource>
-    -->
 
 </datasources>
 

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/faqBrowser/FaqBrowserDAO.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/faqBrowser/FaqBrowserDAO.java	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/faqBrowser/FaqBrowserDAO.java	2008-07-30 01:21:14 UTC (rev 8534)
@@ -7,17 +7,13 @@
 package org.jboss.seam.wiki.plugin.faqBrowser;
 
 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.annotations.AutoCreate;
+import org.jboss.seam.annotations.*;
 import org.jboss.seam.wiki.core.model.WikiDirectory;
 
 import javax.persistence.EntityManager;
-import javax.persistence.EntityNotFoundException;
-import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * @author Christian Bauer
@@ -42,12 +38,20 @@
                 .setParameter("nsLeft", startDir.getNodeInfo().getNsLeft())
                 .setParameter("nsRight", startDir.getNodeInfo().getNsRight());
 
-        try {
-            return (WikiDirectory) query.getSingleResult();
+        List<WikiDirectory> result = query.getResultList();
+
+        if (result.size() == 0) return null;
+
+        // We need to iterate through all found directories, these directories are all the "parents" in the
+        // tree which might have a default document with "faqBrowser" macro. We assume that the "highest level"
+        // directory is the root of the FAQ tree - luckily we have the nested set values to find that one.
+        WikiDirectory highestLevelDirectory = result.get(0);
+        for (WikiDirectory wikiDirectory : result) {
+            if (wikiDirectory.getNodeInfo().getNsLeft() < highestLevelDirectory.getNodeInfo().getNsLeft()) {
+                highestLevelDirectory = wikiDirectory;
+            }
         }
-        catch (EntityNotFoundException ex) {}
-        catch (NoResultException ex) {}
-        return null;
+        return highestLevelDirectory;
     }
 
 }

Modified: trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css	2008-07-29 05:21:23 UTC (rev 8533)
+++ trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css	2008-07-30 01:21:14 UTC (rev 8534)
@@ -339,6 +339,10 @@
 /*    border-bottom: 1px solid #b6b6b6; */
 }
 
+.homepageBox .jiraIssueListEmpty {
+    border: none;
+}
+
 /* -----  Footer styles  ------  */
 
 #footer {




More information about the seam-commits mailing list