[jboss-svn-commits] JBL Code SVN: r11756 - in labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums: ui/view and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue May 8 13:46:01 EDT 2007


Author: dejp
Date: 2007-05-08 13:46:00 -0400 (Tue, 08 May 2007)
New Revision: 11756

Modified:
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java
Log:
JBFORUMS-212

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2007-05-08 16:47:20 UTC (rev 11755)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2007-05-08 17:46:00 UTC (rev 11756)
@@ -1674,6 +1674,8 @@
             throw new ModuleException("forum must not be null");
          }
 
+         session.save(poster);
+         
          ForumWatch forumWatch = new ForumWatchImpl();
          forumWatch.setPoster(poster);
          forumWatch.setForum(forum);
@@ -1826,6 +1828,8 @@
             throw new ModuleException("topic must not be null");
          }
 
+         session.save(poster);
+         
          TopicWatch topicWatch = new TopicWatchImpl();
          topicWatch.setPoster(poster);
          topicWatch.setTopic(topic);

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	2007-05-08 16:47:20 UTC (rev 11755)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	2007-05-08 17:46:00 UTC (rev 11756)
@@ -63,14 +63,16 @@
             try
             {
                 Collection watched = getWatchedTopics();
-                Set temporaryContainer = new HashSet(watched.size());
-                Iterator it = watched.iterator();
-                while (it.hasNext())
-                {
-                    Topic topic = (Topic)it.next();
-                    temporaryContainer.add(topic);
+                if (watched != null) {
+                    Set temporaryContainer = new HashSet(watched.size());
+                    Iterator it = watched.iterator();
+                    while (it.hasNext())
+                    {
+                        Topic topic = (Topic)it.next();
+                        temporaryContainer.add(topic);
+                    }
+                    topicsLastPosts = BaseController.getForumsModule().findLastPostsOfTopics(temporaryContainer);
                 }
-                topicsLastPosts = BaseController.getForumsModule().findLastPostsOfTopics(temporaryContainer);
             } catch (Exception e)
             {
                 JSFUtil.handleException(e);
@@ -151,25 +153,26 @@
         Collection topics = getWatchedTopics();
         
         // setup dummy pageNavigators for all topics being displayed for topic minipaging
-        for(Iterator itr=topics.iterator();itr.hasNext();)
-        {
-            Topic courTopic = (Topic)itr.next();
-            if(courTopic.getReplies()>0)
+        if (topics != null) {
+            for(Iterator itr=topics.iterator();itr.hasNext();)
             {
-                PageNavigator topicNav = new PageNavigator(courTopic.getReplies()+1,
-                Integer.parseInt(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY)), //this is user's posts per page preference
-                0 //current page of the navigator
-                ) {
-                       protected Collection initializePage() {
+                Topic courTopic = (Topic)itr.next();
+                if(courTopic.getReplies()>0)
+                {
+                   PageNavigator topicNav = new PageNavigator(courTopic.getReplies()+1,
+                   Integer.parseInt(this.userPreferences.getPreference(Constants.POSTS_TOPIC_KEY)), //this is user's posts per page preference
+                   0 //current page of the navigator
+                   ) {
+                        protected Collection initializePage() {
                            return null;
-                       }
+                        }
                        
                    };
-                this.topicNavigator.put(courTopic.getId(),topicNav);
+                   this.topicNavigator.put(courTopic.getId(),topicNav);
+                }
             }
         }
         
-        
     }
 
 }

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java	2007-05-08 16:47:20 UTC (rev 11755)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java	2007-05-08 17:46:00 UTC (rev 11756)
@@ -67,6 +67,7 @@
 import org.jboss.portlet.forums.model.TopicWatch;
 import org.jboss.portlet.forums.model.Watch;
 import org.jboss.portlet.forums.ui.Constants;
+import org.jboss.portlet.forums.ui.PortalUtil;
 
 import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
 import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
@@ -290,7 +291,7 @@
                   User watcher = watch.getPoster().getUser();
                   Object watcherId = watcher.getId();
                   
-                  if (!notifieds.contains(watcherId))
+                  if (!notifieds.contains(watcherId) && !watcherId.equals(PortalUtil.getUserNA().getId()))
                   {
                      
                      boolean securityFlag = true;
@@ -383,7 +384,7 @@
                       
                       User watcher = watch.getPoster().getUser();
                       Object watcherId = watcher.getId();
-                      if (!notifieds.contains(watcherId))
+                      if (!notifieds.contains(watcherId) && !watcherId.equals(PortalUtil.getUserNA().getId()))
                       {
                           boolean securityFlag = true;
                           




More information about the jboss-svn-commits mailing list