[jboss-svn-commits] JBL Code SVN: r10930 - in labs/jbossforums/branches/forums101P26/forums/src: main/org/jboss/portlet/forums/impl and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Apr 12 13:20:26 EDT 2007


Author: unibrew
Date: 2007-04-12 13:20:26 -0400 (Thu, 12 Apr 2007)
New Revision: 10930

Added:
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml
Modified:
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java
   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/ForumsJSFPortlet.java
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java
   labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
   labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml
Log:
[JBFORUMS-205] EditAllForumsSubscribtionView for MyForums done. Additionally, small fixes for other things around MyForumsViews.

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java	2007-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ForumsModule.java	2007-04-12 17:20:26 UTC (rev 10930)
@@ -542,7 +542,7 @@
 
    List findForumWatchByUser(User user) throws ModuleException;
 
-   List findForumWatchedByUserFetchForumWatches(User user) throws ModuleException;
+   List findForumWatchedByUser(User user) throws ModuleException;
    
    List findTopicWatchedByUser(User user) throws ModuleException;
    
@@ -569,6 +569,8 @@
     */
    ForumWatch findForumWatchById(Integer forumWatchID) throws ModuleException;
 
+   Map findForumWatches(User user) throws ModuleException;
+   
    /**
     * 
     * @param user

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-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2007-04-12 17:20:26 UTC (rev 10930)
@@ -1552,7 +1552,7 @@
       }
    }
    
-   public List findForumWatchedByUserFetchForumWatches(User user) throws ModuleException
+   public List findForumWatchedByUser(User user) throws ModuleException
    {
       try
       {
@@ -1652,7 +1652,7 @@
       }
       catch (HibernateException e)
       {
-         String message = "Cannot find topic watched";
+         String message = "Cannot find topic watches";
          log.error(message, e);
          throw new ModuleException(message, e);
       }
@@ -1723,6 +1723,42 @@
       }
    }
    
+   /**
+    * 
+    * This method returns Map<Integer,ForumWatch> pairs where Integer
+    * key is watched forum id.
+    * 
+    * @param user
+    * @return 
+    * @throws ModuleException
+    */
+   public Map findForumWatches(User user) throws ModuleException
+   {
+      try
+      {
+         Session session = getSession();
+         Query query = session.createQuery("select fw.forum.id , fw " +
+                                           "from ForumWatchImpl fw " +
+                                           "where fw.poster.userId = :userId ");
+         query.setString("userId", user.getId().toString());
+         List results = query.list();
+         HashMap map = new HashMap(results.size());
+         Iterator it = results.iterator();
+         while (it.hasNext())
+         {
+            Object[] element = (Object[]) it.next();
+            map.put(element[0], element[1]);
+         }
+         return map;
+      }
+      catch (HibernateException e)
+      {
+         String message = "Cannot find forum watches";
+         log.error(message, e);
+         throw new ModuleException(message, e);
+      }
+   }
+   
    public ForumWatch findForumWatchByUserAndForum(User user,int forumId) throws ModuleException
    {
       try

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java	2007-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java	2007-04-12 17:20:26 UTC (rev 10930)
@@ -212,6 +212,9 @@
         TEMP_VIEW_ID_TO_NAME.put("ma","/views/myforums/myforums_viewall.jsf");
         TEMP_VIEW_NAME_TO_ID.put("/views/myforums/myforums_viewall.jsf","ma");
         
+        TEMP_VIEW_ID_TO_NAME.put("me","/views/myforums/myforums_editforums.jsf");
+        TEMP_VIEW_NAME_TO_ID.put("/views/myforums/myforums_editforums.jsf","me");
+        
         VIEW_ID_TO_NAME = Collections.unmodifiableSortedMap(TEMP_VIEW_ID_TO_NAME);
         VIEW_NAME_TO_ID = Collections.unmodifiableSortedMap(TEMP_VIEW_NAME_TO_ID);
 

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java	2007-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/action/ForumWatchController.java	2007-04-12 17:20:26 UTC (rev 10930)
@@ -27,9 +27,8 @@
 import org.jboss.portlet.forums.ui.*;
 
 import org.jboss.portlet.forums.model.Forum;
-import org.jboss.portlet.forums.impl.ForumImpl;
 import org.jboss.portlet.forums.model.ForumWatch;
-import org.jboss.portlet.forums.impl.ForumWatchImpl;
+import org.jboss.portlet.forums.model.TopicWatch;
 
 /**
  * This controller is used for activating/deactivating/managing forum watches
@@ -37,16 +36,20 @@
  * Created on Jul 7, 2006
  *
  * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
+ * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
  */
 public class ForumWatchController extends ActionController 
 {
     //ui data supporting the AddForumWatch widget
     private Collection allForums = null;
-    private int selectedForum = 0;
-    private int watchMode = 0;
+    private int selectedForum = -1;
+    private int watchMode = -1;
     
     //ui data supporting the update/unwatch widget
     private Collection forumWatches = null;
+    
+    // flag informing UI that notification edit mode is turned on
+    private boolean editMode;
         
     /**
      * @return Returns the allForums.
@@ -114,6 +117,22 @@
     
     /**
      * 
+     */
+    public boolean isEditMode ()
+    {
+        return this.editMode;
+    }
+    
+    /**
+     * 
+     */
+    public void setEditMode (boolean editMode)
+    {
+        this.editMode = editMode;
+    }
+    
+    /**
+     * 
      *
      */
     public boolean isWatchAvailable()
@@ -143,7 +162,32 @@
 	        this.allForums = this.getForumsModule().findForums();
 	        
 	        //populate the already setup form watches
-	        this.reloadWatches();	        	        
+	        this.reloadWatches();
+            
+            try
+            {
+                String f = JSFUtil.getRequestParameter(Constants.p_forumId);
+                if (f!=null && f.trim().length()>0) {
+                    selectedForum = Integer.parseInt(f);
+                } 
+            } catch (NumberFormatException e)
+            {
+                JSFUtil.handleException(e);
+            }
+            
+            try
+            {
+                String edit = JSFUtil.getRequestParameter(Constants.EDIT_WATCH);
+                if (edit!=null && edit.trim().length()>0) {
+                    editMode = Boolean.parseBoolean(edit);
+                } else {
+                    editMode = false;
+                }
+            } catch (NumberFormatException e)
+            {
+                JSFUtil.handleException(e);
+                editMode = false;
+            }
         }
         catch(Exception e)
         {
@@ -231,6 +275,45 @@
     
     /**
      * 
+     */
+    public String updateNotificationType()
+    {
+        String navState = null;
+        
+        try
+        {
+            String wt = JSFUtil.getRequestParameter(Constants.p_notified_watch_type);
+            if (wt!=null && wt.trim().length()>0) {
+                watchMode = Integer.parseInt(wt);
+            } else {
+                watchMode = -1;
+            }
+        } catch (NumberFormatException e)
+        {
+            JSFUtil.handleException(e);
+            watchMode = -1;
+        }
+        
+        if (watchMode==-1 || selectedForum==-1)
+        {
+            return navState;
+        }
+        
+        try
+        {
+            ForumWatch forumWatch = getForumsModule().findForumWatchByUserAndForum(PortalUtil.getUser(),this.selectedForum);
+            forumWatch.setMode(watchMode);
+            navState="success";
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        selectedForum=-1;
+        return navState;
+    }
+    
+    /**
+     * 
      *
      */
     public String updateWatch()
@@ -272,4 +355,12 @@
         this.forumWatches = this.getForumsModule().
         findForumWatchByUser(PortalUtil.getUser());
     }
+    
+    /**
+     * 
+     */
+    public String dummyAction()
+    {
+        return null;
+    }
 }

Added: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java	                        (rev 0)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsEditAllForums.java	2007-04-12 17:20:26 UTC (rev 10930)
@@ -0,0 +1,271 @@
+package org.jboss.portlet.forums.ui.view;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.portlet.forums.model.Forum;
+import org.jboss.portlet.forums.model.Post;
+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.JSFUtil;
+import org.jboss.portlet.forums.ui.PortalUtil;
+import org.jboss.portlet.forums.ui.ThemeHelper;
+
+public class ViewMyForumsEditAllForums extends BaseController
+{
+
+    // Map<ForumId,LastPost>
+    private Map forumsLastPosts;
+    private Map forumImageDescriptions;
+    private Map forumImages;
+    private Map forumWatches;
+    private Collection watchedForums;
+    
+    private Watch watch;
+    private int forumId;
+    
+    /**
+     * 
+     */
+    public Map getForumImageDescriptions()
+    {
+        if(this.forumImageDescriptions==null)
+        {
+            this.forumImageDescriptions = new HashMap();
+        }
+        return this.forumImageDescriptions;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumImageDescriptions(Map forumImageDescriptions)
+    {
+        this.forumImageDescriptions = forumImageDescriptions;
+    }
+    
+    /**
+     * 
+     */
+    public Map getForumImages()
+    {
+        if(this.forumImages==null)
+        {
+            this.forumImages = new HashMap();
+        }
+        return forumImages;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumImages(Map forumImages)
+    {
+        this.forumImages = forumImages;
+    }
+    
+    /**
+     * 
+     */
+    public Map getForumsLastPosts()
+    {
+        if (forumsLastPosts==null)
+        {
+            try
+            {
+                forumsLastPosts = BaseController.getForumsModule().findLastPostsOfForums();
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return forumsLastPosts;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumsLastPosts(Map forumsLastPosts)
+    {
+        this.forumsLastPosts = forumsLastPosts;
+    }
+    
+    /**
+     * 
+     */
+    public Map getForumWatches()
+    {
+        return forumWatches;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumWatches(Map forumWatches)
+    {
+        this.forumWatches = forumWatches;
+    }
+    
+    /**
+     * 
+     */
+    public Collection getWatchedForums()
+    {
+        if (watchedForums==null)
+        {
+            try
+            {
+                watchedForums = BaseController.getForumsModule().findForumWatchedByUser(PortalUtil.getUser());
+            } catch (Exception e)
+            {
+                JSFUtil.handleException(e);
+            }
+        }
+        return watchedForums;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatchedForums(Collection watchedForums)
+    {
+        this.watchedForums = watchedForums;
+    }
+    
+    /**
+     * 
+     */
+    public Watch getWatch ()
+    {
+        return this.watch;
+    }
+    
+    /**
+     * 
+     */
+    public void setWatch (Watch watch)
+    {
+        this.watch = watch;
+    }
+    
+    /**
+     * 
+     */
+    public int getForumId()
+    {
+        return this.forumId;
+    }
+    
+    /**
+     * 
+     */
+    public void setForumId (int forumId)
+    {
+        this.forumId = forumId;
+    }
+    
+// -------- Business logic ----------------------------------------------------------------------------------------------------------------
+    
+    /**
+     * 
+     */
+    public ViewMyForumsEditAllForums ()
+    {
+        super();
+    }
+    
+    /**
+     * 
+     */
+    public boolean isInitialized()
+    {
+        boolean initialized = false;
+        try
+        {
+            this.execute();
+            initialized = true;
+        }
+        catch(Exception e)
+        {
+            JSFUtil.handleException(e);
+        }
+        return initialized;
+    }
+    
+    /**
+     * 
+     */
+    public void execute () throws Exception {
+        
+        Collection forums = getWatchedForums();
+        
+        try
+        {
+            this.forumWatches = getForumsModule().findForumWatches(PortalUtil.getUser());
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+            setForumWatches(new HashMap(0));
+        }
+        
+        Date userLastLogin = PortalUtil.getUserLastLoginDate(); 
+        
+        for (Iterator iter = forums.iterator(); iter.hasNext();)
+        {
+            Forum currentForum = (Forum) iter.next();
+        
+            // setup folderLook based on whats specified in the theme
+            String folderImage = ThemeHelper.getInstance().getResourceForumURL();
+            String folderAlt = "No_new_posts"; //bundle key
+            if (this.forumsLastPosts!=null && this.forumsLastPosts.containsKey(currentForum.getId()))
+            {
+                Post lastPost = (Post)this.forumsLastPosts.get(currentForum.getId());
+                Date lastPostDate = lastPost.getCreateDate();
+                if (lastPostDate!=null && userLastLogin!=null && lastPostDate.compareTo(userLastLogin)>0)
+                {
+                    folderAlt = "New_posts"; //bundle key
+                    folderImage = ThemeHelper.getInstance().getResourceForumNewURL();
+                }
+            }
+            if (currentForum.getStatus() == Constants.FORUM_LOCKED)
+            {
+               folderImage = ThemeHelper.getInstance().getResourceForumLockedURL();
+               folderAlt = "Forum_locked"; //bundle key
+            }              
+            this.getForumImages().put(currentForum.getId(),folderImage);
+            this.getForumImageDescriptions().put(currentForum.getId(),folderAlt);
+        }
+        
+        try {
+            String t = JSFUtil.getRequestParameter(Constants.p_forumId);
+            if (t!=null && t.trim().length()>0) {
+                forumId = Integer.parseInt(t);
+            } else {
+                forumId = -1;
+            }
+            if (forumId != -1)
+            {
+                watch = getForumsModule().findForumWatchByUserAndForum(PortalUtil.getUser(),forumId);
+            }
+        } catch (Exception e)
+        {
+            JSFUtil.handleException(e);
+            forumId=-1;
+            watch=null;
+        }
+    }
+    
+    /**
+     * 
+     */
+    public String dummyAction()
+    {
+        return "success";
+    }
+
+
+}

Modified: labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java	2007-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsMain.java	2007-04-12 17:20:26 UTC (rev 10930)
@@ -64,17 +64,6 @@
                 }
                 watchedTopics = BaseController.getForumsModule().
                                 findTopicWatchedByUser(PortalUtil.getUser(),lastLoginDate);
-                /*
-                watchedTopics = new LinkedList();
-                Iterator it = topics.iterator();
-                while (it.hasNext())
-                {
-                    Topic topic = (Topic)it.next();
-                    if (topic.getLastPostDate().compareTo(lastLoginDate)>0)
-                    {
-                        watchedTopics.add(topic);
-                    }
-                }*/
             } catch (Exception e)
             {
                 JSFUtil.handleException(e);
@@ -100,7 +89,7 @@
         {
             try
             {
-                watchedForums = BaseController.getForumsModule().findForumWatchedByUserFetchForumWatches(PortalUtil.getUser());
+                watchedForums = BaseController.getForumsModule().findForumWatchedByUser(PortalUtil.getUser());
             } catch (Exception e)
             {
                 JSFUtil.handleException(e);

Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties	2007-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/classes/ResourceJSF.properties	2007-04-12 17:20:26 UTC (rev 10930)
@@ -2020,6 +2020,8 @@
 Subscribed_forums_info=Subscribed Forums
 NoNewPosts=There are no new posts to your subscribed threads.
 ViewAllSubscribed=View All Subscribed Topics
+EditAllSubscribed=Edit Subscribed Forums Notifications
+NotSubscribingToAnyForum=You are not subscribing to any forum.
 Notification=Notification
 
 

Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2007-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2007-04-12 17:20:26 UTC (rev 10930)
@@ -108,6 +108,10 @@
                  <key>myForumsAll</key>
                  <value>/views/myforums/myforums_viewall.jsf</value>
                 </map-entry>
+                <map-entry>
+                 <key>myForumsEdit</key>
+                 <value>/views/myforums/myforums_editforums.jsf</value>
+                </map-entry>
              </map-entries>                
 	    </managed-property>	    	    
 	</managed-bean>		
@@ -524,7 +528,14 @@
                 <from-outcome>updateWatch</from-outcome>
                 <to-view-id>/views/watches/forumWatch.xhtml</to-view-id>
             </navigation-case>
-     </navigation-rule>     
+     </navigation-rule>
+     <navigation-rule>
+        <from-view-id>/views/myforums/myforums_editforums.xhtml</from-view-id>    
+        <navigation-case>
+            <from-outcome>success</from-outcome>
+            <to-view-id>/views/myforums/myforums_editforums.xhtml</to-view-id>
+        </navigation-case>
+     </navigation-rule>
      
      <!-- myforums controller -->
      <managed-bean>
@@ -547,4 +558,9 @@
             <value>#{prefController}</value>
         </managed-property>
      </managed-bean>
+     <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>
 </faces-config>

Added: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml	                        (rev 0)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_editforums.xhtml	2007-04-12 17:20:26 UTC (rev 10930)
@@ -0,0 +1,278 @@
+<!--
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.
+*/
+-->
+
+<div  xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:c="http://java.sun.com/jstl/core"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:f="http://java.sun.com/jsf/core"
+      xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
+      class="forumscontainer"
+>
+
+<ui:composition template="/views/common/common.xhtml">
+<ui:define name="mainContent">
+
+<c:if test="#{myForumsEdit.initialized}">
+
+<div class="forumtitletext">
+    <h4>${resource.MyForums_title}</h4>
+    <p>${resource.MyForums_info}</p>
+</div>
+
+<table width="100%"  border="0" cellpadding="0" cellspacing="0" class="forumtablestyle">
+
+    <tr class="header">
+        <td class="forumheaderfirst" colspan="2">${resource.Subscribed_forums_info}</td>
+        <td class="forumheaderopen">${resource.Last_Post}</td>
+        <td class="forumheaderopen">${resource.Notification}</td>
+        <td class="forumheadercentered">${resource.Delete}</td>
+    </tr>
+    
+    <c:if test="${forums:collectionSize(myForumsEdit.watchedForums) gt 0}">
+    <c:forEach items="#{myForumsEdit.watchedForums}" var="forumrow" varStatus="status" >
+    <ui:fragment>
+    <c:choose>
+    
+        <c:when test="${forumWatch.selectedForum ne forumrow.id || forumWatch.editMode eq false}">
+        <ui:fragment>
+        <tr>
+            <td class="forumlisticon">
+            <img src="#{myForumsEdit.forumImages[forumrow.id]}" width="11" height="14"
+                 alt="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" 
+                 title="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" />
+            </td>
+            <td>
+                <h3>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="${forumrow.id}"/>
+                        <h:outputText value="${forumrow.name}"/>                   
+                    </h:outputLink>
+                </h3>
+                ${forumrow.description}
+            </td>
+            <td class="forumlistlast">
+            
+            <c:choose>
+
+                <c:when test="#{myForumsEdit.forumsLastPosts[forumrow.id]!=null}">
+                
+                    <a href="#{forums:postPermlink(myForumsEdit.forumsLastPosts[forumrow.id].id)}">
+                        <c:choose>
+                        
+                            <c:when test="#{forums:isLongerThan(myForumsEdit.forumsLastPosts[forumrow.id].message.subject,25)}">
+                                #{forums:subString(myForumsEdit.forumsLastPosts[forumrow.id].message.subject,25)}&#8230;
+                            </c:when>
+                            
+                            <c:otherwise>
+                                #{myForumsEdit.forumsLastPosts[forumrow.id].message.subject}
+                            </c:otherwise>
+                            
+                        </c:choose>
+                    </a>
+                    <br />
+                    ${resource.By} 
+                    <c:choose>
+                    
+                        <c:when test="#{myForumsEdit.anonymous}">
+                            ${myForumsEdit.forumsLastPosts[forumrow.id].poster.user.userName}
+                        </c:when>
+                                    
+                        <c:otherwise>
+                            <h:outputLink value="#{forums:outputLink(shared.links['profile'],true)}">
+                                <f:param name="uid" value="#{myForumsEdit.forumsLastPosts[forumrow.id].poster.user.id}"/>
+                                <h:outputText value="${myForumsEdit.forumsLastPosts[forumrow.id].poster.user.userName}"/>
+                            </h:outputLink>
+                        </c:otherwise>
+                                    
+                    </c:choose>
+                    <br />
+                    #{myForumsEdit.forumsLastPosts[forumrow.id].createDate}
+                    
+                </c:when>
+                
+                <c:otherwise>
+                    #{resource.No_Posts}
+                </c:otherwise>
+            
+            </c:choose>
+            </td>
+            <td class="forumlistopen">
+            <h:form>
+                <input type="hidden" name="f" value="${forumrow.id}"/>
+                <input type="hidden" name="editWatch" value="true"/>
+                <c:choose>
+                
+                    <c:when test="${myForumsEdit.forumWatches[forumrow.id].mode eq 0}">
+                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                    </c:when>
+                    
+                    <c:when test="${myForumsEdit.forumWatches[forumrow.id].mode eq 1}">
+                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                    </c:when>
+                    
+                    <c:otherwise>
+                        ${resource.EMAIL_NO_NOTIFICATION}
+                    </c:otherwise>
+                    
+                </c:choose>
+                &#160;(
+                <h:commandLink action="#{forumWatch.dummyAction}">
+                    <h:outputText value="${resource.Edit}"/>
+                </h:commandLink>
+                )
+            </h:form>
+            </td>
+            <td class="forumlistcentered">
+            <h:form>
+                <div class="actionbuttons">
+                    <ul>
+                        <li>
+                            <h:commandLink id="deActivateWatch" action="#{forumWatch.deActivateWatch}">
+                                <f:param name="f" value="#{forumrow.id}"/>
+                                <img src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
+                                     alt="${resource.Unsubscribe_from_forum}"
+                                     name="unSubscribe"
+                                     border="0"
+                                     id="unSubscribe" />
+                            </h:commandLink>
+                        </li>
+                    </ul>
+                </div>
+            </h:form>
+            </td>
+        </tr>
+        </ui:fragment>
+        </c:when>
+        
+        <c:otherwise>
+        <ui:fragment>
+        <tr class="editRow">
+            <td class="forumlisticon">
+                <img src="#{myForumsEdit.forumImages[forumrow.id]}" width="11" height="14"
+                     alt="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" 
+                     title="#{resource[myForumsEdit.forumImageDescriptions[forumrow.id]]}" />
+            </td>
+            <td>
+                <h3>
+                    <h:outputLink value="#{forums:outputLink(shared.links['forum'],true)}">
+                        <f:param name="f" value="${forumrow.id}"/>
+                        <h:outputText value="${forumrow.name}"/>                   
+                    </h:outputLink>
+                </h3>
+                ${forumrow.description}
+            </td>
+            <td colspan="3">
+                <div class="forumfloatright">
+                    <h:form id="notification_${forumrow.id}" >
+                        <input type="hidden" name="f" value="${forumrow.id}" />
+                        <select name="notified_watch_type" id="notified_watch_type">
+                        
+                            <c:choose>
+                                <c:when test="${myForumsEdit.watch.mode eq 0}">
+                                    <option value="0" selected="selected" >
+                                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                                    </option>
+                                 </c:when>
+                                 <c:otherwise>
+                                    <option value="0">
+                                        ${resource.EMAIL_LINKED_NOTIFICATION}
+                                    </option>
+                                 </c:otherwise>
+                             </c:choose>
+                                
+                            <c:choose>
+                                <c:when test="${myForumsEdit.watch.mode eq 1}">
+                                    <option value="1" selected="selected" >
+                                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                                    </option>
+                                </c:when>
+                                <c:otherwise>
+                                    <option value="1">
+                                        ${resource.EMAIL_EMBEDED_NOTIFICATION}
+                                    </option>
+                                </c:otherwise>
+                            </c:choose>
+                            
+                            <c:choose>
+                                <c:when test="${myForumsEdit.watch.mode eq 2}">
+                                    <option value="2" selected="selected" >
+                                        ${resource.EMAIL_NO_NOTIFICATION}
+                                    </option>
+                                </c:when>
+                                <c:otherwise>
+                                    <option value="2">
+                                        ${resource.EMAIL_NO_NOTIFICATION}
+                                    </option>
+                                </c:otherwise>
+                            </c:choose>
+                            
+                        </select>
+                        <h:commandButton action="${forumWatch.updateNotificationType}"
+                                         value="${resource.Update}" styleClass="buttonMed" />
+                    </h:form>
+                </div>
+            </td>
+        </tr>
+        </ui:fragment>
+        </c:otherwise>
+    
+    </c:choose>
+    </ui:fragment>
+    </c:forEach>
+    </c:if>
+    
+    <c:if test="${forums:collectionSize(myForumsEdit.watchedForums) eq 0}">
+        <tr>
+            <td class="nonewpostRow" colspan="6">
+                ${resource.NotSubscribingToAnyForum}
+            </td>
+        </tr>
+    </c:if>
+    
+</table>
+
+<div class="forumlegend">
+    <hr class="forumdashedHR" />
+    <ul>
+        <li>
+            <img src="${forums:themeURL('resourceForumNewURL')}" alt="${resource.New_posts}" width="11" height="14" />
+            ${resource.New_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumURL')}" alt="${resource.No_new_posts}" width="11" height="14" />
+            ${resource.No_new_posts}
+        </li>
+        <li>
+            <img src="${forums:themeURL('resourceForumLockedURL')}" alt="${resource.Forum_is_locked}" width="11" height="14" />
+            ${resource.Forum_is_locked}
+        </li>
+    </ul>
+</div>
+
+</c:if>
+
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file

Modified: labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml
===================================================================
--- labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml	2007-04-12 16:00:43 UTC (rev 10929)
+++ labs/jbossforums/branches/forums101P26/forums/src/resources/portal-forums-war/views/myforums/myforums_main.xhtml	2007-04-12 17:20:26 UTC (rev 10930)
@@ -186,9 +186,6 @@
             <h:outputLink value="#{forums:outputLink(shared.links['myForumsAll'],true)}">
                ${resource.ViewAllSubscribed}
             </h:outputLink>
-            <a href="#">
-
-            </a>
         </td>
     </tr>
     <tr>
@@ -290,6 +287,18 @@
     </tr>
     </forums:isAllowed>
     </c:forEach>
+    
+    <tr>
+        <td class="footerrow" colspan="6">
+            <h:outputLink value="#{forums:outputLink(shared.links['myForumsEdit'],true)}">
+               ${resource.EditAllSubscribed}
+            </h:outputLink>
+        </td>
+    </tr>
+    <tr>
+        <td class="spacerRow" colspan="6"><img src="#{forums:themeURL('resourceSpacerURL')}" /></td>
+    </tr>
+    
 </table>
 
 <div class="forumlegend">




More information about the jboss-svn-commits mailing list