[jboss-svn-commits] JBL Code SVN: r34907 - in labs/jbossforums/branches/noejbforums130P27: authz-jaae-plugin/src/main/org/jboss/forums/security and 12 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Aug 26 12:06:12 EDT 2010


Author: sviluppatorefico
Date: 2010-08-26 12:06:11 -0400 (Thu, 26 Aug 2010)
New Revision: 34907

Removed:
   labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml
Modified:
   labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/build.xml
   labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java
   labs/jbossforums/branches/noejbforums130P27/cache-plugin/build.xml
   labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java
   labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java
   labs/jbossforums/branches/noejbforums130P27/forums/build.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/application.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/web.xml
   labs/jbossforums/branches/noejbforums130P27/tools/etc/buildfragments/libraries.ent
Log:
merged with the last updates and bug fixings from the ejb version branch

Modified: labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/build.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/build.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/build.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -71,7 +71,8 @@
 			<path refid="sun.jsf.classpath"/>			
 			<path refid="jbportal.classpath"/>				        
 			<path refid="jboss-jaae-engine.classpath"/>
-			<path refid="jakarta-commons-jexl.classpath"/>						
+			<path refid="jakarta-commons-jexl.classpath"/>		
+			<path refid="jboss.j2ee.classpath"/>						
 		</path>
 
       <!-- Configure modules -->
@@ -181,11 +182,13 @@
          </jar>     
 	     <!-- Luca Stancapiano - 5 feb 2008 - this plugin is also inside new clustered 
 	          versions of JBossForums as libraries -->
-         <jar jarfile="${forums.lib}/jboss-forums-ha.ear">
-	    <fileset dir="${forums.root}/resources/portal-forums-ha-ear" includes="**/*"/>
+	     <mkdir dir="${forums.lib}/ha/"/>
+         <jar jarfile="${forums.lib}/ha/jboss-forums.ear">
+            <fileset dir="${forums.root}/resources/portal-forums-ha-ear" includes="**/*"/>
          </jar>
-         <jar jarfile="${forums.lib}/jboss-forums-ha-jbp.ear">
-	    <fileset dir="${forums.root}/resources/portal-forums-ha-jbp-ear" includes="**/*"/>
+  	     <mkdir dir="${forums.lib}/ha-jbp/"/>
+         <jar jarfile="${forums.lib}/ha-jbp/jboss-forums.ear">
+	        <fileset dir="${forums.root}/resources/portal-forums-ha-jbp-ear" includes="**/*"/>
          </jar>
    	     <!-- end patch 5 feb 2008 -->
       

Modified: labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/authz-jaae-plugin/src/main/org/jboss/forums/security/JBossPortalUtil.java	2010-08-26 16:06:11 UTC (rev 34907)
@@ -27,6 +27,9 @@
 import java.util.Set;
 
 import javax.naming.InitialContext;
+import javax.transaction.NotSupportedException;
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
 
 import org.jboss.portal.identity.MembershipModule;
 import org.jboss.portal.identity.RoleModule;
@@ -108,25 +111,50 @@
      */
     public static void populateRoles(User user) throws Exception
     {        
-        InitialContext context = new InitialContext();
+    	InitialContext initialContext = new InitialContext();
                 
         //perform this operation in the context of a JTA Transaction
+		UserTransaction ut = (UserTransaction) initialContext
+		.lookup("/UserTransaction");
         if(user!=null && user.getIdentity()!=null)
         {            
             UserModule userModule = JBossPortalUtil.getUserModule();
-            
-            //grab the roles for this user
-            String username = user.getIdentity().getUserName();            
-            org.jboss.portal.identity.User portalUser = userModule.findUserByUserName(username);
-            Set roles = getMembershipModule().getRoles(portalUser);
-            if(!Util.isEmpty(roles))
-            {
-                for(Iterator itr=roles.iterator();itr.hasNext();)
+            try {
+               ut.begin();         
+               //grab the roles for this user
+               String username = user.getIdentity().getUserName();            
+               org.jboss.portal.identity.User portalUser = userModule.findUserByUserName(username);
+               Set roles = getMembershipModule().getRoles(portalUser);
+               if(!Util.isEmpty(roles))
+               {
+                   for(Iterator itr=roles.iterator();itr.hasNext();)
+                   {
+                       String roleName = ((org.jboss.portal.identity.Role)itr.next()).getName();
+                       Role role = new Role(roleName,roleName);
+                       user.getRoles().add(role);
+                   }
+               }
+               ut.commit();
+            } catch (NotSupportedException e) {         
+                //grab the roles for this user
+                String username = user.getIdentity().getUserName();            
+                org.jboss.portal.identity.User portalUser = userModule.findUserByUserName(username);
+                Set roles = getMembershipModule().getRoles(portalUser);
+                if(!Util.isEmpty(roles))
                 {
-                    String roleName = ((org.jboss.portal.identity.Role)itr.next()).getName();
-                    Role role = new Role(roleName,roleName);
-                    user.getRoles().add(role);
+                    for(Iterator itr=roles.iterator();itr.hasNext();)
+                    {
+                        String roleName = ((org.jboss.portal.identity.Role)itr.next()).getName();
+                        Role role = new Role(roleName,roleName);
+                        user.getRoles().add(role);
+                    }
                 }
+            } catch (Exception e) {
+ 			   try {
+ 			      ut.rollback();
+ 			   } catch (SystemException se) {
+ 				  se.printStackTrace();
+ 			   }
             }
         }                
     }

Modified: labs/jbossforums/branches/noejbforums130P27/cache-plugin/build.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/cache-plugin/build.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/cache-plugin/build.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -68,7 +68,8 @@
       <!-- Configure thirdparty libraries -->
       <call target="configure-libraries"/>
 		<path id="library.classpath">	        
-			<path refid="jboss.cache.classpath"/>				        
+			<path refid="jboss.cache.classpath"/>			        
+			<path refid="jbportal.classpath"/>			        
 			<path refid="jgroups.classpath"/>
 			<path refid="jboss.system.classpath"/>					
 			<path refid="jboss.hibernate.classpath"/>						
@@ -156,11 +157,12 @@
       </jar>    
               
          <!-- Luca Stancapiano - 30 gen 2008 - I added theese six 
-              rows to achieve complete create for jboss-forums-ha.ear -->
+              rows to achieve complete create for ha/jboss-forums.ear -->
          <copy todir="${forums.root}/resources/portal-forums-ha-ear">
 		<fileset dir="${build.lib}" includes="portal-forums-cache-plugin.sar"/>
          </copy>
-         <jar jarfile="${forums.lib}/jboss-forums-ha.ear">
+ 	    <mkdir dir="${forums.lib}/ha/"/>
+        <jar jarfile="${forums.lib}/ha/jboss-forums.ear">
 		<fileset dir="${forums.root}/resources/portal-forums-ha-ear" includes="**/*"/>
          </jar>
       

Deleted: labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/AbstractJBossService.java	2010-08-26 16:06:11 UTC (rev 34907)
@@ -1,86 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
- * contributors as indicated by the @authors tag. See the                     *
- * copyright.txt in the distribution for a full listing of                    *
- * individual contributors.                                                   *
- *                                                                            *
- * This is free software; you can redistribute it and/or modify it            *
- * under the terms of the GNU Lesser General Public License as                *
- * published by the Free Software Foundation; either version 2.1 of           *
- * the License, or (at your option) any later version.                        *
- *                                                                            *
- * This software is distributed in the hope that it will be useful,           *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
- * Lesser General Public License for more details.                            *
- *                                                                            *
- * You should have received a copy of the GNU Lesser General Public           *
- * License along with this software; if not, write to the Free                *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
- ******************************************************************************/
-package org.jboss.portlet.forums.util.cache;
-
-import org.jboss.logging.Logger;
-import org.jboss.system.ServiceMBeanSupport;
-
-/**
- * JBoss service integration helper.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @author <a href="mailto:jedim at vige.it">Luca Stancapiano</a>
- * @version $Revision: 8784 $
- */
-public class AbstractJBossService extends ServiceMBeanSupport
-{
-
-   public AbstractJBossService()
-   {
-   }
-
-   public AbstractJBossService(final Class type)
-   {
-      super(type);
-   }
-
-   public AbstractJBossService(final String category)
-   {
-      super(category);
-   }
-
-   public AbstractJBossService(final Logger log)
-   {
-      super(log);
-   }
-
-   public final int getState()
-   {
-      return super.getState();
-   }
-
-   public final String getStateString()
-   {
-      return super.getStateString();
-   }
-
-   public final void create() throws Exception
-   {
-      super.create();
-   }
-
-   public final void start() throws Exception
-   {
-      super.start();
-   }
-
-   public final void stop()
-   {
-      super.stop();
-   }
-
-   public final void destroy()
-   {
-      super.destroy();
-   }
-}

Modified: labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JBossTreeCacheProvider.java	2010-08-26 16:06:11 UTC (rev 34907)
@@ -25,6 +25,7 @@
 import javax.management.ObjectName;
 
 import org.jboss.cache.TreeCache;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
 
 /**
  * @author <a href="mailto:julien at jboss.org">Julien Viet</a>

Modified: labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/cache-plugin/src/main/org/jboss/portlet/forums/util/cache/JMXTreeCacheProvider.java	2010-08-26 16:06:11 UTC (rev 34907)
@@ -56,7 +56,7 @@
    {
       try
       {
-         String objectNameAsString = properties.getProperty("hibernate.cache.object_name");
+         String objectNameAsString = properties.getProperty("cache.object_name");
          log.debug("Uses tree cache provider with object name " + objectNameAsString);
 
          //

Modified: labs/jbossforums/branches/noejbforums130P27/forums/build.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/build.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/build.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -250,7 +250,8 @@
 			<fileset dir="${facelets.lib}" includes="jsf-facelets.jar,jsf-example.jar"/>
 			<fileset dir="${jakarta.commons.lib}" includes="commons-beanutils.jar,commons-codec.jar,commons-collections.jar,commons-digester-1.7-brew.jar"/>
 			<fileset dir="${sun.portlet.lib}" includes="jsf-portlet.jar" />
-      	    <fileset dir="${jbportal.lib}" includes="portletbridge-api.jar,portletbridge-impl.jar" />
+  	        <fileset dir="${portlet.lib}" includes="portlet-api.jar" />
+  	        <fileset dir="${jbportal.lib}" includes="portletbridge-api.jar,portletbridge-impl.jar,portal-jems-lib.jar,portal-common-lib.jar,portal-identity-lib.jar" />
 	  </copy>
 	  <jar jarfile="${build.lib}/jboss-forums.ear">
 			<fileset dir="${build.resources}/portal-forums-ear" includes="**/*"/>
@@ -281,7 +282,8 @@
 			<fileset dir="${facelets.lib}" includes="jsf-facelets.jar,jsf-example.jar"/>
 			<fileset dir="${jakarta.commons.lib}" includes="commons-beanutils.jar,commons-codec.jar,commons-collections.jar,commons-digester-1.7-brew.jar"/>
 			<fileset dir="${sun.portlet.lib}" includes="jsf-portlet.jar" />
-  	    <fileset dir="${jbportal.lib}" includes="portletbridge-api.jar,portletbridge-impl.jar" />
+	        <fileset dir="${portlet.lib}" includes="portlet-api.jar" />
+	        <fileset dir="${jbportal.lib}" includes="portletbridge-api.jar,portletbridge-impl.jar,portal-jems-lib.jar,portal-common-lib.jar,portal-identity-lib.jar" />
 	  </copy>
 	  <jar jarfile="${build.lib}/jboss-forums-ha.ear">
 			<fileset dir="${build.resources}/portal-forums-ha-ear" includes="**/*"/>
@@ -294,7 +296,8 @@
 			<fileset dir="${facelets.lib}" includes="jsf-facelets.jar,jsf-example.jar"/>
 			<fileset dir="${jakarta.commons.lib}" includes="commons-beanutils.jar,commons-codec.jar,commons-collections.jar,commons-digester-1.7-brew.jar"/>
 			<fileset dir="${sun.portlet.lib}" includes="jsf-portlet.jar" />
-  	    <fileset dir="${jbportal.lib}" includes="portletbridge-api.jar,portletbridge-impl.jar" />
+	        <fileset dir="${portlet.lib}" includes="portlet-api.jar" />
+	        <fileset dir="${jbportal.lib}" includes="portletbridge-api.jar,portletbridge-impl.jar,portal-jems-lib.jar,portal-common-lib.jar,portal-identity-lib.jar" />
 	  </copy>
 	  <jar jarfile="${build.lib}/jboss-forums-ha-jbp.ear">
 			<fileset dir="${build.resources}/portal-forums-ha-jbp-ear" includes="**/*"/>
@@ -304,8 +307,10 @@
 	<target name="explode" depends="init">
 		<explode file="${build.lib}/jboss-forums.ear" todir="${build.resources}" />
 		<!-- Luca Stancapiano - 8 feb 2008 - exploded ha modules -->
-		<explode file="${build.lib}/jboss-forums-ha.ear" todir="${build.resources}" />
-		<explode file="${build.lib}/jboss-forums-ha-jbp.ear" todir="${build.resources}" />
+   	    <mkdir dir="${build.resources}/ha/"/>
+		<explode file="${build.lib}/ha/jboss-forums.ear" todir="${build.resources}/ha" />
+   	    <mkdir dir="${build.resources}/ha-jbp/"/>
+		<explode file="${build.lib}/ha-jbp/jboss-forums.ear" todir="${build.resources}/ha-jbp" />
 	</target>
 
    <!-- ================================================================== -->
@@ -372,12 +377,13 @@
 		   <fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums-ha.sar,portal-forums-authz-plugin.sar"/>
 		   <fileset dir="${jbportal.root}/../facelets/lib" includes="jsf-facelets.jar,el-api.jar,el-ri.jar"/>
 	   </copy>
-	   <jar jarfile="${build.lib}/jboss-forums-ha.ear">
+ 	  <mkdir dir="${build.lib}/ha/"/>
+	  <jar jarfile="${build.lib}/ha/jboss-forums.ear">
 		   <fileset dir="${build.resources}/portal-forums-ha-ear" includes="**/*"/>
 	   </jar>
 		   
 		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
-		<copy file="${build.lib}/jboss-forums.ear" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+	    <copy file="${build.lib}/ha/jboss-forums.ear" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
 	</target>
 
    <!--
@@ -386,18 +392,19 @@
    <target name="deploy-ha-jbp" description="Deploy ha jbp." depends="output">
 		   
 	   <!-- TEMPORARILY COPIED HERE, NEEDS TO BE REDONE -->
-	   <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha.ear -->
+	   <!-- Luca Stancapiano - 8 feb 2008 - portal-forums-ha-jbp.ear -->
 	   <copy todir="${build.resources}/portal-forums-ha-jbp-ear">
 		   <fileset dir="${jakarta.lucene.root}/lib" includes="lucene.jar"/>
 		   <fileset dir="${build.lib}" includes="portal-forums.war,portal-forums-ui.jar,portal-forums-ha-jbp.sar,portal-forums-authz-plugin.sar"/>
 		   <fileset dir="${jbportal.root}/../facelets/lib" includes="jsf-facelets.jar,el-api.jar,el-ri.jar"/>
 	   </copy>
-	   <jar jarfile="${build.lib}/jboss-forums-ha-jbp.ear">
+ 	  <mkdir dir="${forums.lib}/ha-jbp/"/>
+	  <jar jarfile="${build.lib}/ha-jbp/jboss-forums.ear">
 		   <fileset dir="${build.resources}/portal-forums-ha-jbp-ear" includes="**/*"/>
 	   </jar>
 		   
 		<require file="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
-		<copy file="${build.lib}/jboss-forums.ear" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
+	    <copy file="${build.lib}/ha-jbp/jboss-forums.ear" todir="${jboss.home}/server/${portal.deploy.dir}/deploy"/>
 	</target>
 
    <!--

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2010-08-26 16:06:11 UTC (rev 34907)
@@ -2063,7 +2063,12 @@
    }
    
    protected Session getSession () {
-       Session session = factory.getCurrentSession();
+       Session session = null;
+       try {
+    	   session = factory.getCurrentSession();
+       } catch (HibernateException ex) {
+    	   session = factory.openSession();
+       }
 	   /*System.out.println ("CATEGORY");
 	   Map cacheEntries = null;
 	   org.hibernate.stat.SecondLevelCacheStatistics stats = factory.getStatistics()

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java	2010-08-26 16:06:11 UTC (rev 34907)
@@ -40,6 +40,7 @@
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
+import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.portlet.PortletPreferences;
@@ -48,6 +49,9 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.servlet.http.HttpServletRequest;
+import javax.transaction.NotSupportedException;
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
 
 import org.apache.log4j.Logger;
 import org.jboss.portal.core.modules.ModuleConstants;
@@ -705,9 +709,27 @@
                 .getExternalContext().getRemoteUser();
         if (userName != null && userName.trim().length() > 0)
         {
-            UserModule userModule = (UserModule) new InitialContext()
+        	Context initialContext = new InitialContext();
+			UserTransaction ut = (UserTransaction) initialContext
+			.lookup("/UserTransaction");
+        	try {
+ 			   ut.begin();
+               UserModule userModule = (UserModule) new InitialContext()
                     .lookup(ModuleConstants.USERMODULE_JNDINAME);
-            user = userModule.findUserByUserName(userName);
+               user = userModule.findUserByUserName(userName);
+               ut.commit();
+		    } catch (NotSupportedException e) {
+	           UserModule userModule = (UserModule) new InitialContext()
+                   .lookup(ModuleConstants.USERMODULE_JNDINAME);
+               user = userModule.findUserByUserName(userName);
+		    } catch (Exception e) {
+			   log.error("Cannot load the user", e);
+			   try {
+			      ut.rollback();
+			   } catch (SystemException se) {
+				  se.printStackTrace();
+			   }
+            }
         }
         return user;
     }
@@ -808,15 +830,33 @@
         
         String guestUserName = BaseController.getForumsModule().getGuestUserName();
         
+        UserTransaction ut = null;
         try
-        {                                
+        {                     
+           Context initialContext = new InitialContext();
+ 		   ut = (UserTransaction) initialContext
+ 			.lookup("/UserTransaction");
+ 		   ut.begin();                                        
            userModule = (UserModule)new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME);
            user = userModule.findUserByUserName(guestUserName);
+           ut.commit();
+        } 
+        catch (NotSupportedException e) {                                        
+           userModule = (UserModule)new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME);
+           user = userModule.findUserByUserName(guestUserName);
         }
         catch (NoSuchUserException e)
         {
             user = userModule.createUser(guestUserName, "Guest user account!");
-        }
+            ut.commit();
+        } catch (Exception e) {
+ 		   log.error("Cannot load setup script", e);
+ 		   try {
+ 		      ut.rollback();
+ 		   } catch (SystemException se) {
+ 			  se.printStackTrace();
+ 		   }
+         }
         
         Long userId = (Long) user.getId();
         poster = BaseController.getForumsModule().findPosterByUserId(

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/application.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/application.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/application.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -42,7 +42,19 @@
    <module>
 	   <java>portletbridge-impl.jar</java>
    </module>
+   <module>	   
+       <java>portal-jems-lib.jar</java>
+   </module>
    <module>
+	   <java>portal-common-lib.jar</java>
+   </module>
+   <module>
+	   <java>portal-identity-lib.jar</java>
+   </module>
+   <module>
+	   <java>portlet-api.jar</java>
+   </module>
+   <module>
       <web>
          <web-uri>portal-forums.war</web-uri>
          <!--context-root>/forums</context-root-->

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ear/META-INF/jboss-app.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jboss-app>
+<!-- 
    <loader-repository> 
          forums.jboss.com:loader=jboss-forums-sar 
       <loader-repository-config>
          java2ParentDelegation=false
       </loader-repository-config> 
    </loader-repository>
+ -->
    <module>
 	   <java>portal-forums-ui.jar</java>
    </module>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/application.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -28,7 +28,19 @@
    <module>
 	   <java>portletbridge-impl.jar</java>
    </module>
+   <module>	   
+       <java>portal-jems-lib.jar</java>
+   </module>
    <module>
+	   <java>portal-common-lib.jar</java>
+   </module>
+   <module>
+	   <java>portal-identity-lib.jar</java>
+   </module>
+   <module>
+	   <java>portlet-api.jar</java>
+   </module>
+   <module>
       <web>
          <web-uri>portal-forums.war</web-uri>
          <!--context-root>/forums</context-root-->

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/jboss-app.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jboss-app>
+<!-- 
    <loader-repository> 
          forums.jboss.com:loader=jboss-forums-ha-sar 
       <loader-repository-config>
          java2ParentDelegation=false
       </loader-repository-config> 
    </loader-repository>
+ -->
    <module>
 	   <java>portal-forums-ui.jar</java>
    </module>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-ear/META-INF/security-config.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -23,9 +23,12 @@
 <policy>
 	<application-policy name="forums">       
        <authentication>
-<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">             <module-option name="unauthenticatedIdentity">guest</module-option>
+<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">             
+    <module-option name="unauthenticatedIdentity">guest</module-option>
 	<module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
 	<module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+            <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule</module-option>
+            <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule</module-option>
 	<module-option name="additionalRole">Authenticated</module-option>
 	<module-option name="password-stacking">useFirstPass</module-option>
 </login-module>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/application.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -29,6 +29,18 @@
 	   <java>portletbridge-impl.jar</java>
    </module>
    <module>
+	   <java>portal-jems-lib.jar</java>
+   </module>
+   <module>
+	   <java>portal-common-lib.jar</java>
+   </module>
+   <module>
+	   <java>portal-identity-lib.jar</java>
+   </module>
+   <module>
+	   <java>portlet-api.jar</java>
+   </module>
+   <module>
       <web>
          <web-uri>portal-forums.war</web-uri>
          <!--context-root>/forums</context-root-->

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/jboss-app.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jboss-app>
+<!-- 
    <loader-repository> 
-         forums.jboss.com:loader=jboss-forums-ha-sar 
+         forums.jboss.com:loader=jboss-forums-ha-jbp-sar 
       <loader-repository-config>
          java2ParentDelegation=false
       </loader-repository-config> 
    </loader-repository>
+ -->
    <module>
 	   <java>portal-forums-ui.jar</java>
    </module>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-ear/META-INF/security-config.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -23,9 +23,12 @@
 <policy>
 	<application-policy name="forums">       
        <authentication>
-<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">             <module-option name="unauthenticatedIdentity">guest</module-option>
+<login-module code="org.jboss.portal.identity.auth.IdentityLoginModule" flag="required">             
+    <module-option name="unauthenticatedIdentity">guest</module-option>
 	<module-option name="userModuleJNDIName">java:/portal/UserModule</module-option>
 	<module-option name="roleModuleJNDIName">java:/portal/RoleModule</module-option>
+            <module-option name="userProfileModuleJNDIName">java:/portal/UserProfileModule</module-option>
+            <module-option name="membershipModuleJNDIName">java:/portal/MembershipModule</module-option>
 	<module-option name="additionalRole">Authenticated</module-option>
 	<module-option name="password-stacking">useFirstPass</module-option>
 </login-module>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -16,7 +16,7 @@
       <property name="hibernate.c3p0.idle_test_period">3000</property> 
 
       <property name="cache.provider_class">org.jboss.hibernate.jbc.cacheprovider.JmxBoundTreeCacheProvider</property>
-      <property name="treecache.mbean.object_name">portal:service=TreeCache,type=hibernate</property>
+      <property name="hibernate.treecache.mbean.object_name">portal:service=TreeCache,type=hibernate</property>
          
       <property name="hibernate.cache.use_query_cache">true</property>
       <property name="hibernate.cache.use_second_level_cache">true</property>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -15,7 +15,7 @@
       <property name="hibernate.c3p0.max_statements">50</property> 
       <property name="hibernate.c3p0.idle_test_period">3000</property> 
 
-      <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+      <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
       <property name="hibernate.cache.use_query_cache">true</property>
       <property name="hibernate.cache.use_second_level_cache">true</property>
       <property name="hibernate.generate_statistics">true</property>

Deleted: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-app.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -1,3 +0,0 @@
-<jboss-app>
-   <app-name>forums</app-name>
-</jboss-app>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/jboss-web.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 <jboss-web>
-	<security-domain>java:jaas/forums</security-domain>
+	<security-domain>java:/jaas/forums</security-domain>
 </jboss-web>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/web.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/web.xml	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/web.xml	2010-08-26 16:06:11 UTC (rev 34907)
@@ -1,24 +1,15 @@
-<?xml version="1.0"?>
-<!--
-<!DOCTYPE web-app PUBLIC
-   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-   "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
--->
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
-version="2.4"> 
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <context-param>
-        <param-name>javax.faces.CONFIG_FILES</param-name>
-        <param-value>
-            /WEB-INF/forums-config.xml
-        </param-value>
         <description>
             Comma separated list of URIs of (additional) faces config files.
             (e.g. /WEB-INF/my-config.xml)
             See JSF 1.0 PRD2, 10.3.2
         </description>
+        <param-name>javax.faces.CONFIG_FILES</param-name>
+        <param-value>
+            /WEB-INF/forums-config.xml
+        </param-value>
    </context-param>
 
 <!--    <context-param>
@@ -49,30 +40,30 @@
             It must contain a path to Forums Servlet where Forums are deployed.
         </description>
     </context-param>-->
-    <context-param>
+    <context-param>
+        <description>
+            This parameter is used to create proper links in portal environment.
+            It must contain a path to a portlet window where Forums are deployed.
+        </description>
         <param-name>org.jboss.forums.feeds.URL</param-name>
         <param-value>/portal/portal/default/forums/JBossForumsWindow?action=1</param-value>
-        <description>
-            This parameter is used to create proper links in portal environment.
-            It must contain a path to a portlet window where Forums are deployed.
-        </description>
     </context-param>
-    <context-param>
+    <context-param>
+        <description>
+            This parameter is used to create proper links in portal environment.
+            It must contain a path to a portlet window where Forums are deployed.
+        </description>
         <param-name>org.jboss.forums.feeds.URL_TYPE</param-name>
         <param-value>p</param-value>
-        <description>
-            This parameter is used to create proper links in portal environment.
-            It must contain a path to a portlet window where Forums are deployed.
-        </description>
     </context-param>
 
    <context-param>
-        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
-        <param-value>server</param-value>
         <description>
             State saving method: "client" or "server" (= default)
             See JSF Specification 2.5.2
         </description>
+        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+        <param-value>server</param-value>
     </context-param>   
    
    <!-- facelets integration -->

Modified: labs/jbossforums/branches/noejbforums130P27/tools/etc/buildfragments/libraries.ent
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/tools/etc/buildfragments/libraries.ent	2010-08-26 16:04:22 UTC (rev 34906)
+++ labs/jbossforums/branches/noejbforums130P27/tools/etc/buildfragments/libraries.ent	2010-08-26 16:06:11 UTC (rev 34907)
@@ -184,7 +184,8 @@
 		portal-api-lib.jar,
 		portal-faces-lib.jar,
 		portal-faces-loader-lib.jar,
-		portletbridge-api.jar
+		portletbridge-api.jar,
+		portal-identity-lib.jar
 		"
    />
   </path>



More information about the jboss-svn-commits mailing list