[jboss-svn-commits] JBL Code SVN: r11761 - in labs/jbossforums/branches/forums101P22/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:48:35 EDT 2007


Author: dejp
Date: 2007-05-08 13:48:35 -0400 (Tue, 08 May 2007)
New Revision: 11761

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

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2007-05-08 17:48:08 UTC (rev 11760)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2007-05-08 17:48:35 UTC (rev 11761)
@@ -1667,6 +1667,8 @@
          {
             throw new ModuleException("forum must not be null");
          }
+         
+         session.save(poster);
 
          ForumWatch forumWatch = new ForumWatchImpl();
          forumWatch.setPoster(poster);
@@ -1819,6 +1821,8 @@
          {
             throw new ModuleException("topic must not be null");
          }
+         
+         session.save(poster);
 
          TopicWatch topicWatch = new TopicWatchImpl();
          topicWatch.setPoster(poster);

Modified: labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	2007-05-08 17:48:08 UTC (rev 11760)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	2007-05-08 17:48:35 UTC (rev 11761)
@@ -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
-                ) {
+                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/forums101P22/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java
===================================================================
--- labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java	2007-05-08 17:48:08 UTC (rev 11760)
+++ labs/jbossforums/branches/forums101P22/forums/src/main/org/jboss/portlet/forums/util/NotificationEngine.java	2007-05-08 17:48:35 UTC (rev 11761)
@@ -65,6 +65,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;
@@ -282,7 +283,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;
@@ -375,7 +376,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