[jboss-svn-commits] JBL Code SVN: r35294 - in labs/jbossforums/branches/noejbforums130P27/forums/src: main/org/jboss/portlet/forums/ui/action and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Sep 25 04:41:51 EDT 2010


Author: sviluppatorefico
Date: 2010-09-25 04:41:51 -0400 (Sat, 25 Sep 2010)
New Revision: 35294

Modified:
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
Log:
fixed the RSS feeds bug.

Now the user preferences can be read by the web applications.

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumUtil.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -159,35 +159,6 @@
         }
     }
     
-    /* Luca Stancapiano start - This method is taken from getPreference
-       method of PortalUtil. The only difference is that this method has
-       to be used also for anonymous users because a preference can to be imported also
-       for a portlet when you are not logged. For example foruminstanceid custom preference
-       must to be seen by an anonymous user to get the right forum instance, otherwise
-       an anonymous user has permission to see an only forum instance
-    */
-    /**
-     * 
-     * @param preferenceKey
-     * @return
-     */
-    public static String getPreference(String preferenceKey)
-    {
-        String preference = null;
-
-        Object o = FacesContext.getCurrentInstance().getExternalContext()
-                .getRequest();
-        if (o instanceof PortletRequest)
-        {
-            PortletRequest request = (PortletRequest) o;
-            PortletPreferences pp = request.getPreferences();
-            preference = pp.getValue(preferenceKey, "");
-        }
-
-        return preference;
-    }
-    // Luca Stancapiano end
-    
     public static boolean isFeedsConfigured()
     {
         ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/AdminController.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -44,6 +44,9 @@
  */
 public class AdminController extends ActionController 
 {
+    //user preference controller
+    private PreferenceController userPreferences = null;
+    
     private static final int up = -15;
     private static final int down = 15;
     
@@ -74,6 +77,22 @@
     private boolean addCategoryMode;
     private boolean addForumMode;
     
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
+    
     //-----ui data-------------------------------------------------------------------------------------------------------------------------
     /**
      * @return Returns the categoryName.
@@ -298,7 +317,7 @@
         	// Luca Stancapiano start
             //get the forumInstanceId where this forum should be added
 	        int forumInstanceId = -1;
-	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
 	        if(cour!=null && cour.trim().length()>0)
 	        {
 	        	forumInstanceId = Integer.parseInt(cour);
@@ -596,7 +615,7 @@
 	         // Luca Stancapiano start
 	         //get the forumInstanceId where this forum should be added
 	        int forumInstanceId = -1;
-	        cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
 	        if(cour!=null && cour.trim().length()>0)
 	        {
 	        	forumInstanceId = Integer.parseInt(cour);
@@ -641,7 +660,7 @@
 	        // Luca Stancapiano start
 	        //get the forumInstanceId where this forum should be added
 	        int forumInstanceId = -1;
-	        cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
 	        if(cour!=null && cour.trim().length()>0)
 	        {
 	        	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/Search.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -33,14 +33,32 @@
 import org.jboss.portlet.forums.search.SearchCriteria;
 import org.jboss.portlet.forums.ui.BaseController;
 import org.jboss.portlet.forums.ui.Constants;
-import org.jboss.portlet.forums.ui.ForumUtil;
 import org.jboss.portlet.forums.ui.JSFUtil;
 
 public class Search extends ActionController {
+	
+    //user preference controller
+    private PreferenceController userPreferences = null;
 
     private static final long serialVersionUID = 1L;
     
     private SearchCriteria searchCriteria = new SearchCriteria();
+    
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
 
     public SearchCriteria getSearchCriteria()
     {
@@ -81,7 +99,7 @@
 	        // Luca Stancapiano start
 	        //get the forumInstanceId where this forum should be added
 	        int forumInstanceId = -1;
-	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
 	        if(cour!=null && cour.trim().length()>0)
 	        {
 	        	forumInstanceId = Integer.parseInt(cour);
@@ -113,7 +131,7 @@
 	        // Luca Stancapiano start
 	        //get the forumInstanceId where this forum should be added
 	        int forumInstanceId = -1;
-	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
 	        if(cour!=null && cour.trim().length()>0)
 	        {
 	        	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewAdminPanel.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -26,8 +26,8 @@
 
 import org.jboss.portlet.forums.ui.BaseController;
 import org.jboss.portlet.forums.ui.Constants;
-import org.jboss.portlet.forums.ui.ForumUtil;
 import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
 
 /**
  * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
@@ -35,7 +35,9 @@
  */
 public class ViewAdminPanel extends BaseController
 {
-
+    //user preference controller
+    private PreferenceController userPreferences = null;
+    
     private List categories = null;
     private List forums = null;
 
@@ -47,7 +49,23 @@
         super();                         
     }
     
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
     /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
+    
+    /**
      * 
      *
      */
@@ -65,7 +83,7 @@
             	// Luca Stancapiano start
             	//get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);
@@ -98,7 +116,7 @@
             	// Luca Stancapiano start
                 //get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewCategory.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -40,6 +40,7 @@
 import org.jboss.portlet.forums.ui.JSFUtil;
 import org.jboss.portlet.forums.ui.PortalUtil;
 import org.jboss.portlet.forums.ui.ThemeHelper;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
 
 //jsf imports
 
@@ -50,6 +51,9 @@
  */
 public class ViewCategory extends BaseController
 { 
+
+    //user preference controller
+    private PreferenceController userPreferences = null;
     
     //business data being generated in this bean by executing ui actions
     //this is data is created such that it can be consumed by the view components
@@ -61,6 +65,22 @@
     private Map forumLastPosts = null;
     private boolean categorySelected = false;
     
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
+    
     //----------------bean configuration supplied by the forums-config.xml---------------------------------------------------------------------------------------------
     
     
@@ -209,7 +229,7 @@
          // Luca Stancapiano start
          //get the forumInstanceId where this forum should be added
 	     int forumInstanceId = -1;
-	     String cou = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	     String cou = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
 	     if(cou!=null && cou.trim().length()>0)
 	     {
 	        forumInstanceId = Integer.parseInt(cou);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewJumpbox.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -26,15 +26,17 @@
 
 import org.jboss.portlet.forums.ui.BaseController;
 import org.jboss.portlet.forums.ui.Constants;
-import org.jboss.portlet.forums.ui.ForumUtil;
 import org.jboss.portlet.forums.ui.JSFUtil;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
 
 /**
  * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
  */
 public class ViewJumpbox extends BaseController
 {
-
+    //user preference controller
+    private PreferenceController userPreferences = null;
+    
     private List categories;
 
     /**
@@ -44,6 +46,22 @@
         super();
     }
     
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
+    
     public List getCategories() 
     {
         if (categories!=null) {
@@ -58,7 +76,7 @@
             	// Luca Stancapiano start
             	//get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsAllSubscribed.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -28,12 +28,14 @@
 import org.jboss.portlet.forums.model.Watch;
 import org.jboss.portlet.forums.ui.BaseController;
 import org.jboss.portlet.forums.ui.Constants;
-import org.jboss.portlet.forums.ui.ForumUtil;
 import org.jboss.portlet.forums.ui.JSFUtil;
 import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
 
 public class ViewMyForumsAllSubscribed extends ViewMyForumsBase
 {
+    //user preference controller
+    private PreferenceController userPreferences = null;
     
     private int topicId;
     private Watch watch;
@@ -60,7 +62,23 @@
         }
     }
     
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
     /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
+    
+    /**
      * 
      */
     public Watch getWatch()
@@ -104,7 +122,7 @@
             	// Luca Stancapiano start
                 //get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);
@@ -132,7 +150,7 @@
             	// Luca Stancapiano start
                 //get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -33,14 +33,16 @@
 import org.jboss.portlet.forums.model.Watch;
 import org.jboss.portlet.forums.ui.BaseController;
 import org.jboss.portlet.forums.ui.Constants;
-import org.jboss.portlet.forums.ui.ForumUtil;
 import org.jboss.portlet.forums.ui.JSFUtil;
 import org.jboss.portlet.forums.ui.PortalUtil;
 import org.jboss.portlet.forums.ui.ThemeHelper;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
 
 public class ViewMyForumsEditAllForums extends BaseController
 {
-
+    //user preference controller
+    private PreferenceController userPreferences = null;
+    
     // Map<ForumId,LastPost>
     private Map forumsLastPosts;
     private Map forumImageDescriptions;
@@ -51,7 +53,23 @@
     private Watch watch;
     private int forumId;
     
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
     /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
+    
+    /**
      * 
      */
     public Map getForumImageDescriptions()
@@ -102,7 +120,7 @@
             {
             	//get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);
@@ -155,7 +173,7 @@
             	// Luca Stancapiano start
                 //get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);
@@ -251,7 +269,7 @@
         	// Luca Stancapiano start
             //get the forumInstanceId where this forum should be added
 	        int forumInstanceId = -1;
-	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
 	        if(cour!=null && cour.trim().length()>0)
 	        {
 	        	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -32,13 +32,15 @@
 import org.jboss.portlet.forums.model.Post;
 import org.jboss.portlet.forums.ui.BaseController;
 import org.jboss.portlet.forums.ui.Constants;
-import org.jboss.portlet.forums.ui.ForumUtil;
 import org.jboss.portlet.forums.ui.JSFUtil;
 import org.jboss.portlet.forums.ui.PortalUtil;
 import org.jboss.portlet.forums.ui.ThemeHelper;
+import org.jboss.portlet.forums.ui.action.PreferenceController;
 
 public class ViewMyForumsMain extends ViewMyForumsBase
 {
+    //user preference controller
+    private PreferenceController userPreferences = null;
     
     // Map<ForumId,LastPost>
     private Map forumsLastPosts;
@@ -48,7 +50,23 @@
     private Map forumImageDescriptions;
     private Map forumImages;
     
+    //------------user preferences-------------------------------------------------------------------------------------------------------------  
+    /**
+     * @return Returns the userPreferences.
+     */
+    public PreferenceController getUserPreferences() 
+    {
+        return userPreferences;
+    }
+    /**
+     * @param userPreferences The userPreferences to set.
+     */
+    public void setUserPreferences(PreferenceController userPreferences) 
+    {
+        this.userPreferences = userPreferences;    
+    }    
     
+    
     /**
      * 
      */
@@ -65,7 +83,7 @@
             	// Luca Stancapiano start
                 //get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);
@@ -102,7 +120,7 @@
             	// Luca Stancapiano start
                 //get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);
@@ -162,7 +180,7 @@
             	// Luca Stancapiano start
             	//get the forumInstanceId where this forum should be added
     	        int forumInstanceId = -1;
-    	        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+    	        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
     	        if(cour!=null && cour.trim().length()>0)
     	        {
     	        	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewSummary.java	2010-09-25 08:41:51 UTC (rev 35294)
@@ -29,7 +29,6 @@
 
 import org.jboss.portlet.forums.ui.BaseController;
 import org.jboss.portlet.forums.ui.Constants;
-import org.jboss.portlet.forums.ui.ForumUtil;
 import org.jboss.portlet.forums.ui.JSFUtil;
 import org.jboss.portlet.forums.ui.action.PreferenceController;
 
@@ -169,7 +168,7 @@
         // Luca Stancapiano start
         //get the forumInstanceId where this forum should be added
         int forumInstanceId = -1;
-        String cour = ForumUtil.getPreference(Constants.FORUM_INSTANCE_ID);
+        String cour = userPreferences.getPreference(Constants.FORUM_INSTANCE_ID);
         if(cour!=null && cour.trim().length()>0)
         {
         	forumInstanceId = Integer.parseInt(cour);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2010-09-25 08:27:16 UTC (rev 35293)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2010-09-25 08:41:51 UTC (rev 35294)
@@ -247,7 +247,13 @@
 	<managed-bean>
 	    <managed-bean-name>category</managed-bean-name>
 	    <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewCategory</managed-bean-class>
-	    <managed-bean-scope>request</managed-bean-scope>	    
+	    <managed-bean-scope>request</managed-bean-scope>	 	    	    
+	    <!-- user preferences -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	       
     </managed-bean>
     
     <!-- configuration for ViewForum -->
@@ -421,7 +427,13 @@
 	 <managed-bean>
 	  	<managed-bean-name>jumpbox</managed-bean-name>
 	  	<managed-bean-class>org.jboss.portlet.forums.ui.view.ViewJumpbox</managed-bean-class>
-	  	<managed-bean-scope>request</managed-bean-scope>
+	  	<managed-bean-scope>request</managed-bean-scope>	    	    
+	    <!-- user preferences -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	    
 	 </managed-bean>
 	 
 	 <!-- managedBean for the viewProfile usecase -->
@@ -504,13 +516,25 @@
 	 <managed-bean>
 	  	<managed-bean-name>adminPanel</managed-bean-name>
 	  	<managed-bean-class>org.jboss.portlet.forums.ui.view.ViewAdminPanel</managed-bean-class>
-	  	<managed-bean-scope>request</managed-bean-scope>
+	  	<managed-bean-scope>request</managed-bean-scope>	    	    
+	    <!-- user preferences -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	    
 	 </managed-bean>
 	 <!-- managedBean for the adminController usecase -->
 	 <managed-bean>
 	  	<managed-bean-name>adminController</managed-bean-name>
 	  	<managed-bean-class>org.jboss.portlet.forums.ui.action.AdminController</managed-bean-class>
-	  	<managed-bean-scope>request</managed-bean-scope>
+	  	<managed-bean-scope>request</managed-bean-scope>	    	    
+	    <!-- user preferences -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	    
 	 </managed-bean>
 	<navigation-rule>
         <from-view-id>/views/admin/deleteCategory.xhtml</from-view-id>	
@@ -559,30 +583,10 @@
 	    	<map-entries>
 	    		<key-class>java.lang.String</key-class>
 	    		<map-entry>
-	    			<key>notifyreply</key>
-	    			<value>true</value>
+	    			<key>foruminstanceid</key>
+	    			<value>1</value>
 	    		</map-entry>
 	    		<map-entry>
-	    			<key>allowhtml</key>
-	    			<value>true</value>
-	    		</map-entry>
-	    		<map-entry>
-	    			<key>postorder</key>
-	    			<value>ascending</value>
-	    		</map-entry>
-	    		<map-entry>
-	    			<key>dateformat</key>
-	    			<value>EEE MMM d, yyy</value>
-	    		</map-entry>
-	    		<map-entry>
-	    			<key>alwaysaddsignature</key>
-	    			<value>false</value>
-	    		</map-entry>
-	    		<map-entry>
-	    			<key>signature</key>
-	    			<value>null_value</value>
-	    		</map-entry>
-	    		<map-entry>
 	    			<key>summarymode</key>
 	    			<value>0</value>
 	    		</map-entry>
@@ -606,6 +610,30 @@
 	    			<key>postspertopic</key>
 	    			<value>15</value>
 	    		</map-entry>
+	    		<map-entry>
+	    			<key>notifyreply</key>
+	    			<value>true</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>allowhtml</key>
+	    			<value>true</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>postorder</key>
+	    			<value>ascending</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>dateformat</key>
+	    			<value>EEE MMM d, yyyy HH:mm aaa</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>alwaysaddsignature</key>
+	    			<value>false</value>
+	    		</map-entry>
+	    		<map-entry>
+	    			<key>signature</key>
+	    			<value>null_value</value>
+	    		</map-entry>
 	    	</map-entries>
 	    </managed-property> 
 	 </managed-bean>
@@ -704,7 +732,13 @@
      <managed-bean>
         <managed-bean-name>myForumsEdit</managed-bean-name>
         <managed-bean-class>org.jboss.portlet.forums.ui.view.ViewMyForumsEditAllForums</managed-bean-class>
-        <managed-bean-scope>request</managed-bean-scope>
+        <managed-bean-scope>request</managed-bean-scope>	    	    
+	    <!-- user preferences -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	    
      </managed-bean>
      <navigation-rule>
         <from-view-id>/views/myforums/myforums_editforums.xhtml</from-view-id>    
@@ -717,7 +751,13 @@
      <managed-bean>
         <managed-bean-name>search</managed-bean-name>
         <managed-bean-class>org.jboss.portlet.forums.ui.action.Search</managed-bean-class>
-        <managed-bean-scope>session</managed-bean-scope>
+        <managed-bean-scope>session</managed-bean-scope>	    	    
+	    <!-- user preferences -->
+	    <managed-property>
+            <property-name>userPreferences</property-name>
+            <property-class>org.jboss.portlet.forums.ui.action.PreferenceController</property-class>
+            <value>#{prefController}</value>
+        </managed-property>	    
      </managed-bean>
      <managed-bean>
         <managed-bean-name>viewSearch</managed-bean-name>



More information about the jboss-svn-commits mailing list