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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jun 19 13:36:34 EDT 2013


Author: sviluppatorefico
Date: 2013-06-19 13:36:34 -0400 (Wed, 19 Jun 2013)
New Revision: 38360

Added:
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollOptionConverter.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
Removed:
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
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/PollOptionImpl.java
   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/action/EditPost.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/conf/hibernate/hibernate.cfg.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.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-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.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-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
   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/views/moderator/modcp_body.xhtml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
   labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml
Log:
bug fixing on the moderation and polling

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	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/ForumsModuleImpl.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -787,9 +787,9 @@
          if (poster == null)
          {
             poster = createPoster(userId);
+            session.save(poster);
          }
-         session.save(poster);
-
+         session.update(poster);
          TopicImpl topic = new TopicImpl();
          topic.setSubject(subject);
          //topic.setForum(forum);
@@ -1871,9 +1871,13 @@
          {
             throw new ModuleException("forum must not be null");
          }
-
-         session.save(poster);
          
+		 Poster posterOld = this.findPosterByUserId(poster.getUserId()); 
+		 if (posterOld == null) {
+			session.save(poster);
+		 }
+		 session.merge(poster);
+         
          ForumWatch forumWatch = new ForumWatchImpl();
          forumWatch.setPoster(poster);
          forumWatch.setForum(forum);
@@ -2028,7 +2032,11 @@
             throw new ModuleException("topic must not be null");
          }
 
-         session.save(poster);
+		 Poster posterOld = this.findPosterByUserId(poster.getUserId()); 
+		 if (posterOld == null) {
+			session.save(poster);
+		 }
+		 session.merge(poster);
          session.flush(); // Luca Stancapiano - 8 feb 2008 - it is required for clustered versions
          
          TopicWatch topicWatch = new TopicWatchImpl();

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/impl/PollOptionImpl.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -24,56 +24,70 @@
 
 import java.io.Serializable;
 
+import org.hibernate.search.annotations.DocumentId;
+import org.jboss.portlet.forums.model.Poll;
 import org.jboss.portlet.forums.model.PollOption;
 
 /**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw
+ *         Dawidowicz</a>
  * @version $Revision: 878 $
  */
 
-public class PollOptionImpl
-   implements PollOption, Serializable
-{
-   private String question;
-   private int votes = 0;
+public class PollOptionImpl implements PollOption, Serializable {
 
+	@DocumentId
+	private Integer id;
+    private Poll poll;
 
-   public PollOptionImpl()
-   {
-   }
+	private String question;
+	private int votes = 0;
 
-   public PollOptionImpl(String question)
-   {
-      setQuestion(question);
-   }
+	public PollOptionImpl() {
+	}
 
-   /**
+	public PollOptionImpl(Poll poll) {
+		this.poll = (PollImpl)poll;
+	}
+	
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	
+	public Poll getPoll() {
+		return poll;
+	}
+
+	public void setPoll(Poll poll) {
+		this.poll = poll;
+	}
+
+	/**
     */
-   public int getVotes()
-   {
-      return votes;
-   }
+	public int getVotes() {
+		return votes;
+	}
 
-   public void setVotes(int votes)
-   {
-      this.votes = votes;
-   }
+	public void setVotes(int votes) {
+		this.votes = votes;
+	}
 
-   /**
+	/**
     */
-   public String getQuestion()
-   {
-      return question;
-   }
+	public String getQuestion() {
+		return question;
+	}
 
-   public void setQuestion(String question)
-   {
-      this.question = question;
-   }
+	public void setQuestion(String question) {
+		this.question = question;
+	}
 
-   public void incVotes()
-   {
-      votes++;
-   }
+	public void incVotes() {
+		votes++;
+	}
 
 }

Deleted: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -1,245 +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.ui;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletException;
-import javax.portlet.faces.GenericFacesPortlet;
-
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
-import org.apache.commons.fileupload.portlet.PortletFileUpload;
-import org.jboss.portal.portlet.impl.jsr168.PortletRequestParameterMap;
-import org.jboss.portal.portlet.impl.jsr168.api.PortletRequestImpl;
-import org.jboss.portlet.forums.helper.TempFileBinding;
-
-/**
- * @author <a href="mailto:sohil.shah at jboss.com">Sohil Shah</a>
- * @author <a href="mailto:ryszard.kozmik at jboss.com">Ryszard Kozmik</a>
- * @author <a href="mailto:l.stancapiano at sourcesense.com">Luca Stancapiano</a>
- * 
- */
-public class ForumsJSFPortlet extends GenericFacesPortlet {
-
-	/**
-	 * Called by the portlet container to allow the portlet to process an action
-	 * request.
-	 */
-	public void processAction(ActionRequest request, ActionResponse response)
-			throws PortletException, IOException {
-
-		this.setupRenderParameters(request, response);
-
-		try {
-			// parse and setup any attachments if they are sent in
-			if ((request.getContentType() != null)
-					&& request.getContentType().startsWith(
-							"multipart/form-data")) {
-				this.processAttachments(request, response);
-			}
-		} catch (Throwable t) {
-			throw new PortletException(t);
-		}
-		super.processAction(request, response);
-
-	}
-
-	/**
-	 * Not sure why this needs to be done... This method tends to propagate the
-	 * request parameters over to the JSF layer this is a workaround for a bug
-	 * in either portal or MyFacesGenericPortlet...
-	 * 
-	 * @author sshah
-	 * 
-	 */
-	private void setupRenderParameters(ActionRequest request,
-			ActionResponse response) throws PortletException, IOException {
-		String categoryId = ForumUtil.getParameter(request,
-				Constants.p_categoryId);
-		String forumId = ForumUtil.getParameter(request, Constants.p_forumId);
-		String pollTitle = ForumUtil.getParameter(request,
-				Constants.p_poll_title);
-		String option = ForumUtil.getParameter(request, Constants.p_option);
-		String pollDelete = ForumUtil.getParameter(request,
-				Constants.p_poll_delete);
-		String attachment = ForumUtil.getParameter(request,
-				Constants.p_attachment);
-		String topicId = ForumUtil.getParameter(request, Constants.p_topicId);
-		String postId = ForumUtil.getParameter(request, Constants.p_postId);
-		String userId = ForumUtil.getParameter(request, Constants.p_userId);
-		String vote = ForumUtil.getParameter(request, Constants.p_vote);
-		String results = ForumUtil.getParameter(request, Constants.p_results);
-		String page = ForumUtil.getParameter(request, Constants.p_page);
-		String watchId = ForumUtil.getParameter(request, Constants.p_watchId);
-		String viewId = ForumUtil.getParameter(request, Constants.p_viewId);
-		String adminEditCatMode = ForumUtil.getParameter(request,
-				Constants.EDIT_CATEGORY);
-		String adminEditForMode = ForumUtil.getParameter(request,
-				Constants.EDIT_FORUM);
-		String adminAddCatMode = ForumUtil.getParameter(request,
-				Constants.ADD_CATEGORY);
-		String adminAddForMode = ForumUtil.getParameter(request,
-				Constants.ADD_FORUM);
-		String editWatch = ForumUtil
-				.getParameter(request, Constants.EDIT_WATCH);
-		if (categoryId != null && categoryId.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_categoryId, categoryId);
-		}
-		if (forumId != null && forumId.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_forumId, forumId);
-		}
-		if (pollTitle != null && pollTitle.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_poll_title, pollTitle);
-		}
-		if (option != null && option.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_option, option);
-		}
-		if (pollDelete != null && pollDelete.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_poll_delete, pollDelete);
-		}
-		if (attachment != null && attachment.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_attachment, attachment);
-		}
-		if (topicId != null && topicId.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_topicId, topicId);
-		}
-		if (userId != null && userId.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_userId, userId);
-		}
-		if (postId != null && postId.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_postId, postId);
-		}
-		if (vote != null && vote.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_vote, vote);
-		}
-		if (results != null && results.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_results, results);
-		}
-		if (page != null && page.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_page, page);
-		}
-		if (watchId != null && watchId.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_watchId, watchId);
-		}
-		if (viewId != null && viewId.trim().length() > 0) {
-			response.setRenderParameter(Constants.p_viewId, viewId);
-		}
-		if (adminEditCatMode != null && adminEditCatMode.trim().length() > 0) {
-			response.setRenderParameter(Constants.EDIT_CATEGORY,
-					adminEditCatMode);
-		}
-		if (adminEditForMode != null && adminEditForMode.trim().length() > 0) {
-			response.setRenderParameter(Constants.EDIT_FORUM, adminEditForMode);
-		}
-		if (adminAddCatMode != null && adminAddCatMode.trim().length() > 0) {
-			response
-					.setRenderParameter(Constants.ADD_CATEGORY, adminAddCatMode);
-		}
-		if (adminAddForMode != null && adminAddForMode.trim().length() > 0) {
-			response.setRenderParameter(Constants.ADD_FORUM, adminAddForMode);
-		}
-		if (editWatch != null && editWatch.trim().length() > 0) {
-			response.setRenderParameter(Constants.EDIT_WATCH, editWatch);
-		}
-	}
-
-	/**
-     * 
-     *
-     */
-	private void processAttachments(ActionRequest req, ActionResponse response)
-			throws Exception {
-		// We need to have new map to which we collect request parameters from
-		// multipart - we'll inject it little later
-		Map newParams = new HashMap();
-		newParams.putAll(req.getParameterMap());
-
-		DiskFileItemFactory factory = new DiskFileItemFactory();
-		PortletFileUpload upload = new PortletFileUpload(factory);
-
-		// Merge with upload fields
-		for (Iterator i = upload.parseRequest(req).iterator(); i.hasNext();) {
-			FileItem item = (FileItem) i.next();
-			if (item.isFormField()) {
-				// if it's form field just add it to request params map
-				// TODO:Be aware that this adds single value as we won't have
-				// multiply values in new topic form for now...
-				newParams.put(item.getFieldName(), new String[] { item
-						.getString(req.getCharacterEncoding()) });
-
-				// setup the render parameters properly to propagate to the JSF
-				// layer
-				String parameter = item.getFieldName();
-				String value = item.getString(req.getCharacterEncoding());
-				if (value != null && value.trim().length() > 0) {
-					if (parameter.equals(Constants.p_forumId)) {
-						response.setRenderParameter(Constants.p_forumId, value);
-					} else if (parameter.equals(Constants.p_topicId)) {
-						response.setRenderParameter(Constants.p_topicId, value);
-					} else if (parameter.equals(Constants.p_page)) {
-						response.setRenderParameter(Constants.p_page, value);
-					} else if (parameter.equals(Constants.p_postId)) {
-						response.setRenderParameter(Constants.p_postId, value);
-					}
-				}
-
-			} else {
-				// create the proper attachment file for the managed bean and
-				// put it as a ThreadLocal value
-				// the managed bean should pick this up from the thread
-				TempFileBinding file = new TempFileBinding(item
-						.getContentType(), item.get(), item.getName(), String
-						.valueOf(System.currentTimeMillis())
-						+ "_" + item.getSize() // unique fileId for this
-												// collection of files
-				);
-
-				// place it as a ThreadLocal variable
-				PortalUtil.setUploadedAttachment(file);
-			}
-		}
-		// we need to hack the request class and inject newly created Parameters
-		// map using reflection as this are
-		// protected fields
-		try {
-			Class requestClass = PortletRequestImpl.class;
-			Field field = requestClass.getDeclaredField("requestParameterMap");
-			field.setAccessible(true);
-			field.set(req,
-					new PortletRequestParameterMap(newParams, null, null) {
-					});
-
-		} catch (NoSuchFieldException e) {
-			e.printStackTrace();
-		} catch (IllegalAccessException e) {
-			e.printStackTrace();
-		}
-	}
-}

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	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/PortalUtil.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -978,9 +978,9 @@
      * 
      * @return
      */
-    public static PollOption createPollOption()
+    public static PollOption createPollOption(Poll poll)
     {
-        PollOption pollOption = new PollOptionImpl();
+        PollOption pollOption = new PollOptionImpl(poll);
         return pollOption;
     }
 

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/EditPost.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -199,7 +199,7 @@
             for(Iterator itr=this.options.keySet().iterator();itr.hasNext();)
             {
                 String key = (String)itr.next();
-                PollOption pollOption = PortalUtil.createPollOption();
+                PollOption pollOption = PortalUtil.createPollOption(topic.getPoll());
                 pollOption.setQuestion((String)options.get(key));
                 pollOption.setVotes(0);
                 localPollOptions.add(pollOption);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/ModeratorAction.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -221,7 +221,8 @@
                     this.forum.setPostCount(this.forum.getPostCount()-topic.getReplies()-1);
                     this.forum.setTopicCount(this.forum.getTopicCount()-1);
                     
-                    getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+                    getForumsModule().update(forumDest);
+                    getForumsModule().update(this.forum);
                 }
             }
             setInfoBundleMessage("SUCC_TOPIC_MOVED");
@@ -255,6 +256,7 @@
                         {
                             Topic topic = getForumsModule().findTopicById(topicId);
                             topic.setStatus(Constants.TOPIC_LOCKED);
+                            getForumsModule().update(topic);
                         }
                     } catch(Exception e)
                     {
@@ -299,6 +301,7 @@
                         {
                             Topic topic = getForumsModule().findTopicById(topicId);
                             topic.setStatus(Constants.TOPIC_UNLOCKED);
+                            getForumsModule().update(topic);
                         }
                     } catch(Exception e)
                     {

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/NewTopic.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -128,7 +128,7 @@
                for(Iterator itr=this.options.keySet().iterator();itr.hasNext();)
                {
                    String option = (String)itr.next();
-                   PollOption pollOption = PortalUtil.createPollOption();
+                   PollOption pollOption = PortalUtil.createPollOption(poll);
                    pollOption.setQuestion((String)options.get(option));
                    pollOption.setVotes(0);
                    pollOptions.add(pollOption);

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/PollController.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -78,6 +78,7 @@
 	                poll.getVoted().add(poster.getUserId());
 	            }
 	            selectedOption.incVotes();
+	            getForumsModule().update(selectedOption);
 	        }
         }
         catch(Exception e)

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -143,8 +143,6 @@
         
         try {
             
-            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().refresh(this.topic);
-            
             Forum destForum = getForumsModule().findForumById(new Integer(toForumId));
             
             // Creating new topic in destination forum.
@@ -188,8 +186,10 @@
 
             destForum.addTopicSize();
             destForum.setPostCount(destForum.getPostCount()+newTopic.getReplies()+1);
-
-            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+            getForumsModule().update(newTopic);
+            getForumsModule().update(topic);
+            getForumsModule().update(fromForum);
+            getForumsModule().update(destForum);
         } catch (Exception e) {
             e.printStackTrace();
             setWarnBundleMessage("ERR_INTERNAL");
@@ -272,8 +272,6 @@
                 newTopic.addPost(movedPost);
             }
             
-            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().refresh(this.topic);
-            
             Forum fromForum = topic.getForum();
             topic.setReplies(topic.getReplies()-checkboxes.size());
             fromForum.setPostCount(fromForum.getPostCount()-checkboxes.size());
@@ -284,8 +282,11 @@
             
             destForum.addTopicSize();
             destForum.setPostCount(destForum.getPostCount()+newTopic.getReplies()+1);
-            
-            getForumsModule().getHibernate().getSessionFactory().getCurrentSession().flush();
+
+            getForumsModule().update(newTopic);
+            getForumsModule().update(topic);
+            getForumsModule().update(fromForum);
+            getForumsModule().update(destForum);
         } catch (Exception e) {
             e.printStackTrace();
             setWarnBundleMessage("ERR_INTERNAL");

Added: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollOptionConverter.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollOptionConverter.java	                        (rev 0)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollOptionConverter.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -0,0 +1,27 @@
+package org.jboss.portlet.forums.ui.action.converters;
+
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+public class PollOptionConverter implements Converter {
+
+	@Override
+	public Object getAsObject(FacesContext context, UIComponent component,
+			String value) {
+		// TODO Auto-generated method stub
+		return value;
+	}
+
+	@Override
+	public String getAsString(FacesContext context, UIComponent component,
+			Object value) {
+		if (value == null) {
+			return "";
+		}
+		return ((Map.Entry) value).getValue() + "";
+	}
+
+}


Property changes on: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/action/converters/PollOptionConverter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/main/org/jboss/portlet/forums/ui/view/ViewMyForumsBase.java	2013-06-19 17:36:34 UTC (rev 38360)
@@ -43,9 +43,6 @@
 public abstract class ViewMyForumsBase extends BaseController
 {
     
-    //preference related data
-    private PreferenceController userPreferences = null;
-    
     // Map<TopicId,LastPost>
     private Map topicsLastPosts;
     protected Collection watchedTopics;
@@ -102,17 +99,11 @@
     /**
      * @return Returns the userPreferences.
      */
-    public PreferenceController getUserPreferences() 
-    {
-        return userPreferences;
-    }
+    public abstract PreferenceController getUserPreferences();
     /**
      * @param userPreferences The userPreferences to set.
      */
-    public void setUserPreferences(PreferenceController userPreferences) 
-    {
-        this.userPreferences = userPreferences;    
-    }
+    public abstract void setUserPreferences(PreferenceController userPreferences);
     
     // -------- Business logic ----------------------------------------------------------------------------------------------------------------
     
@@ -161,7 +152,7 @@
                 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
+                   Integer.parseInt(getUserPreferences().getPreference(Constants.POSTS_TOPIC_KEY)), //this is user's posts per page preference
                    0 //current page of the navigator
                    ) {
                         protected Collection initializePage() {

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/conf/hibernate/hibernate.cfg.xml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/conf/hibernate/hibernate.cfg.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -34,6 +34,7 @@
       <mapping resource="org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/ForumImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PollImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PosterImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PostImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/TopicImpl.hbm.xml"/>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -26,48 +26,7 @@
             </generator>
         </id>
 
-        <list
-            name="options"
-            table="jbp_forums_poll_option"
-            lazy="true"
-            cascade="all"
-        >
-
-            <key
-                column="jbp_poll_id"
-            >
-            </key>
-
-            <index
-                column="jbp_poll_option_position"
-            />
-
-            <composite-element
-                class="org.jboss.portlet.forums.impl.PollOptionImpl"
-            >
         <property
-            name="votes"
-            type="int"
-            update="true"
-            insert="true"
-            column="jbp_votes"
-            not-null="true"
-        />
-
-        <property
-            name="question"
-            type="java.lang.String"
-            update="true"
-            insert="true"
-            column="jbp_question"
-            not-null="true"
-        />
-
-            </composite-element>
-
-        </list>
-
-        <property
             name="title"
             type="java.lang.String"
             update="true"
@@ -115,6 +74,26 @@
             not-null="true"
         />
 
+        <bag
+            name="options"
+            table="jbp_forums_poll_option"
+            lazy="false"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_poll_option_position asc"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.PollOptionImpl"
+            />
+
+      </bag>
+
         <!--
             To add non XDoclet property mappings, create a file named
                 hibernate-properties-PollImpl.xml

Added: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PollOptionImpl"
+        table="jbp_forums_poll_options"
+    >
+
+        <id
+            name="id"
+            column="jbp_poll_option_position"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PollImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="poll"
+            class="org.jboss.portlet.forums.impl.PollImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poll_id"
+        />
+
+        <property
+            name="votes"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_votes"
+            unique="false"
+        />
+
+        <property
+            name="question"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_question"
+            not-null="true"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PollImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>


Property changes on: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-as5-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/conf/hibernate/hibernate.cfg.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -33,6 +33,7 @@
       <mapping resource="org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/ForumImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PollImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PosterImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PostImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/TopicImpl.hbm.xml"/>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -26,48 +26,7 @@
             </generator>
         </id>
 
-        <list
-            name="options"
-            table="jbp_forums_poll_option"
-            lazy="true"
-            cascade="all"
-        >
-
-            <key
-                column="jbp_poll_id"
-            >
-            </key>
-
-            <index
-                column="jbp_poll_option_position"
-            />
-
-            <composite-element
-                class="org.jboss.portlet.forums.impl.PollOptionImpl"
-            >
         <property
-            name="votes"
-            type="int"
-            update="true"
-            insert="true"
-            column="jbp_votes"
-            not-null="true"
-        />
-
-        <property
-            name="question"
-            type="java.lang.String"
-            update="true"
-            insert="true"
-            column="jbp_question"
-            not-null="true"
-        />
-
-            </composite-element>
-
-        </list>
-
-        <property
             name="title"
             type="java.lang.String"
             update="true"
@@ -115,6 +74,26 @@
             not-null="true"
         />
 
+        <bag
+            name="options"
+            table="jbp_forums_poll_option"
+            lazy="false"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_poll_option_position asc"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.PollOptionImpl"
+            />
+
+      </bag>
+
         <!--
             To add non XDoclet property mappings, create a file named
                 hibernate-properties-PollImpl.xml

Added: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PollOptionImpl"
+        table="jbp_forums_poll_options"
+    >
+
+        <id
+            name="id"
+            column="jbp_poll_option_position"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PollImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="poll"
+            class="org.jboss.portlet.forums.impl.PollImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poll_id"
+        />
+
+        <property
+            name="votes"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_votes"
+            unique="false"
+        />
+
+        <property
+            name="question"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_question"
+            not-null="true"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PollImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>


Property changes on: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-jbp-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/conf/hibernate/hibernate.cfg.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -33,6 +33,7 @@
       <mapping resource="org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/ForumImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PollImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PosterImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PostImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/TopicImpl.hbm.xml"/>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -26,48 +26,7 @@
             </generator>
         </id>
 
-        <list
-            name="options"
-            table="jbp_forums_poll_option"
-            lazy="true"
-            cascade="all"
-        >
-
-            <key
-                column="jbp_poll_id"
-            >
-            </key>
-
-            <index
-                column="jbp_poll_option_position"
-            />
-
-            <composite-element
-                class="org.jboss.portlet.forums.impl.PollOptionImpl"
-            >
         <property
-            name="votes"
-            type="int"
-            update="true"
-            insert="true"
-            column="jbp_votes"
-            not-null="true"
-        />
-
-        <property
-            name="question"
-            type="java.lang.String"
-            update="true"
-            insert="true"
-            column="jbp_question"
-            not-null="true"
-        />
-
-            </composite-element>
-
-        </list>
-
-        <property
             name="title"
             type="java.lang.String"
             update="true"
@@ -115,6 +74,26 @@
             not-null="true"
         />
 
+        <bag
+            name="options"
+            table="jbp_forums_poll_option"
+            lazy="false"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_poll_option_position asc"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.PollOptionImpl"
+            />
+
+      </bag>
+
         <!--
             To add non XDoclet property mappings, create a file named
                 hibernate-properties-PollImpl.xml

Added: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PollOptionImpl"
+        table="jbp_forums_poll_options"
+    >
+
+        <id
+            name="id"
+            column="jbp_poll_option_position"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PollImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="poll"
+            class="org.jboss.portlet.forums.impl.PollImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poll_id"
+        />
+
+        <property
+            name="votes"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_votes"
+            unique="false"
+        />
+
+        <property
+            name="question"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_question"
+            not-null="true"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PollImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>


Property changes on: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-ha-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/conf/hibernate/hibernate.cfg.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -38,6 +38,7 @@
       <mapping resource="org/jboss/portlet/forums/impl/CategoryImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/ForumImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PollImpl.hbm.xml"/>
+      <mapping resource="org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PosterImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/PostImpl.hbm.xml"/>
       <mapping resource="org/jboss/portlet/forums/impl/TopicImpl.hbm.xml"/>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -25,48 +25,7 @@
             </generator>
         </id>
 
-        <list
-            name="options"
-            table="jbp_forums_poll_option"
-            lazy="true"
-            cascade="all"
-        >
-
-            <key
-                column="jbp_poll_id"
-            >
-            </key>
-
-            <index
-                column="jbp_poll_option_position"
-            />
-
-            <composite-element
-                class="org.jboss.portlet.forums.impl.PollOptionImpl"
-            >
         <property
-            name="votes"
-            type="int"
-            update="true"
-            insert="true"
-            column="jbp_votes"
-            not-null="true"
-        />
-
-        <property
-            name="question"
-            type="java.lang.String"
-            update="true"
-            insert="true"
-            column="jbp_question"
-            not-null="true"
-        />
-
-            </composite-element>
-
-        </list>
-
-        <property
             name="title"
             type="java.lang.String"
             update="true"
@@ -114,6 +73,26 @@
             not-null="true"
         />
 
+        <bag
+            name="options"
+            table="jbp_forums_poll_option"
+            lazy="false"
+            inverse="true"
+            cascade="all-delete-orphan"
+            order-by="jbp_poll_option_position asc"
+        >
+
+            <key
+                column="jbp_poll_id"
+            >
+            </key>
+
+            <one-to-many
+                  class="org.jboss.portlet.forums.impl.PollOptionImpl"
+            />
+
+      </bag>
+
         <!--
             To add non XDoclet property mappings, create a file named
                 hibernate-properties-PollImpl.xml

Added: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	                        (rev 0)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping
+>
+    <class
+        name="org.jboss.portlet.forums.impl.PollOptionImpl"
+        table="jbp_forums_poll_options"
+    >
+
+        <id
+            name="id"
+            column="jbp_poll_option_position"
+            type="java.lang.Integer"
+        >
+            <generator class="native">
+              <!--  
+                  To add non XDoclet generator parameters, create a file named 
+                  hibernate-generator-params-PollImpl.xml 
+                  containing the additional parameters and place it in your merge dir. 
+              --> 
+            </generator>
+        </id>
+
+        <many-to-one
+            name="poll"
+            class="org.jboss.portlet.forums.impl.PollImpl"
+            cascade="none"
+            outer-join="auto"
+            update="true"
+            insert="true"
+            column="jbp_poll_id"
+        />
+
+        <property
+            name="votes"
+            type="int"
+            update="true"
+            insert="true"
+            column="jbp_votes"
+            unique="false"
+        />
+
+        <property
+            name="question"
+            type="java.lang.String"
+            update="true"
+            insert="true"
+            column="jbp_question"
+            not-null="true"
+        />
+
+        <!--
+            To add non XDoclet property mappings, create a file named
+                hibernate-properties-PollImpl.xml
+            containing the additional properties and place it in your merge dir.
+        -->
+
+    </class>
+
+</hibernate-mapping>


Property changes on: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-sar/org/jboss/portlet/forums/impl/PollOptionImpl.hbm.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -63,6 +63,10 @@
         <converter-id>pollDurationConverter</converter-id>
         <converter-class>org.jboss.portlet.forums.ui.action.converters.PollDurationConverter</converter-class>
     </converter>
+    <converter>
+        <converter-id>pollOptionConverter</converter-id>
+        <converter-class>org.jboss.portlet.forums.ui.action.converters.PollOptionConverter</converter-class>
+    </converter>
     
     <navigation-rule>		
 		<navigation-case>
@@ -592,7 +596,7 @@
 	    		</map-entry>
 	    		<map-entry>
 	    			<key>summarytopiclimit</key>
-	    			<value>0</value>
+	    			<value>6</value>
 	    		</map-entry>
 	    		<map-entry>
 	    			<key>summarytopicdays</key>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/moderator/modcp_body.xhtml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -327,6 +327,8 @@
         </div>
         </c:if>
         
+        </h:form>
+        
         <hr class="forumdashedHR" />
         
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
@@ -337,8 +339,6 @@
             </tr>
         </table>
         
-        </h:form>
-        
     </forums:isAllowedWhen>
     
     <forums:isAllowedOtherwise>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/myforums/myforums_viewall.xhtml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -23,317 +23,310 @@
  ******************************************************************************/
 -->
 
-<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"
->
+<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">
+	<ui:composition template="/views/common/common.xhtml">
+		<ui:define name="mainContent">
 
-<c:if test="#{myForumsAll.initialized}">
+			<c:if test="#{myForumsAll.initialized}">
 
-<div class="forumtitletext">
-    <h4>${resource.MyForums_title}</h4>
-    <p>${resource.MyForums_info}</p>
-</div>
+				<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">
+				<table width="100%" border="0" cellpadding="0" cellspacing="0"
+					class="forumtablestyle">
 
-    <tr class="header">
-        <td class="forumheaderfirst" colspan="2">${resource.Subscribed_topics_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(myForumsAll.watchedTopics) gt 0}">
-    <c:forEach items="#{myForumsAll.watchedTopics}" var="topicrow" varStatus="status" >
-    <ui:fragment>
-    <c:choose>
-    
-        <c:when test="${topicWatch.topicId ne topicrow.id || topicWatch.editMode eq false}">
-        <ui:fragment>
-        <tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
-            <td class="forumlisticon">
-                <img src="#{forums:folderTypeURL(topicrow,myForumsAll.anonymous)}" 
-                     width="11" height="14"
-                     alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}" />
-            </td>
-            <td>
-                <h3>
-                    <h:commandLink action="viewTopic" value="${topicrow.subject}">
-                        <f:param name="t" value="${topicrow.id}"/>              
-                    </h:commandLink>
-                </h3>
-                
-                <!-- mini post navigator for this topic -->
-                <c:if test="#{myForumsAll.topicNavigator[topicrow.id] ne null &amp;&amp; myForumsAll.topicNavigator[topicrow.id].totalPages gt 1}">
+					<tr class="header">
+						<td class="forumheaderfirst" colspan="2">${resource.Subscribed_topics_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(myForumsAll.watchedTopics) gt 0}">
+						<c:forEach items="#{myForumsAll.watchedTopics}" var="topicrow"
+							varStatus="status">
+							<ui:fragment>
+								<c:choose>
+
+									<c:when
+										test="${topicWatch.topicId ne topicrow.id || topicWatch.editMode eq false}">
+										<ui:fragment>
+											<tr class='${(status.index%2==0)?"evenRow":"oddRow"}'>
+												<td class="forumlisticon"><img
+													src="#{forums:folderTypeURL(topicrow,myForumsAll.anonymous)}"
+													width="11" height="14" alt="${resource.Topic_Moved}"
+													title="${resource.Topic_Moved}" /></td>
+												<h:form>
+													<td>
+														<h3>
+															<h:commandLink action="viewTopic"
+																value="${topicrow.subject}">
+																<f:param name="t" value="${topicrow.id}" />
+															</h:commandLink>
+														</h3> <!-- mini post navigator for this topic --> <c:if
+															test="#{myForumsAll.topicNavigator[topicrow.id] ne null &amp;&amp; myForumsAll.topicNavigator[topicrow.id].totalPages gt 1}">
                     &#160;(&#160;
                     <h:commandLink action="viewTopic" value="${1}">
-                        <f:param name="t" value="#{topicrow.id}"/>
-                        <f:param name="page" value="0"/>
-                    </h:commandLink>
+																<f:param name="t" value="#{topicrow.id}" />
+																<f:param name="page" value="0" />
+															</h:commandLink>
                     &#160;
                     <h:commandLink action="viewTopic" value="${2}">
-                        <f:param name="t" value="#{topicrow.id}"/>
-                        <f:param name="page" value="1"/>
-                    </h:commandLink>
-                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 2}">
+																<f:param name="t" value="#{topicrow.id}" />
+																<f:param name="page" value="1" />
+															</h:commandLink>
+															<c:if
+																test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 2}">
                         &#160;
                         <h:commandLink action="viewTopic" value="{3}">
-                            <f:param name="t" value="#{topicrow.id}"/>
-                            <f:param name="page" value="2"/>
-                        </h:commandLink>
-                    </c:if>
-                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 3}">                        
+																	<f:param name="t" value="#{topicrow.id}" />
+																	<f:param name="page" value="2" />
+																</h:commandLink>
+															</c:if>
+															<c:if
+																test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 3}">                        
                         &#160;&#8230;&#160;
-                        <h:commandLink action="viewTopic" value="${resource.Last_page}">
-                            <f:param name="t" value="#{topicrow.id}"/>
-                            <f:param name="page" value="#{myForumsAll.topicNavigator[topicrow.id].totalPages-1}"/>
-                        </h:commandLink>
-                    </c:if>
+                        <h:commandLink action="viewTopic"
+																	value="${resource.Last_page}">
+																	<f:param name="t" value="#{topicrow.id}" />
+																	<f:param name="page"
+																		value="#{myForumsAll.topicNavigator[topicrow.id].totalPages-1}" />
+																</h:commandLink>
+															</c:if>
                     &#160;)
-                </c:if>
-                <br />
-                ${resource.By}&#160;
-                <c:choose>
-                    
-                    <c:when test="#{myForumsAll.anonymous}">
+                </c:if> <br /> ${resource.By}&#160; <c:choose>
+
+															<c:when test="#{myForumsAll.anonymous}">
                         ${topicrow.poster.user.userName}
                     </c:when>
-                   
-                    <c:otherwise>
-                        <h:commandLink action="viewProfile" value="${topicrow.poster.user.userName}">
-                            <f:param name="uid" value="${topicrow.poster.user.id}"/>
-                        </h:commandLink>
-                    </c:otherwise>
-                                
-                </c:choose>
-            </td>
-            <td class="forumlistlast">
-                <a href="#{forums:postPermlink(myForumsAll.topicsLastPosts[topicrow.id].id)}">
-                    <c:choose>
-                    
-                        <c:when test="#{forums:isLongerThan(myForumsAll.topicsLastPosts[topicrow.id].message.subject,25)}">
+
+															<c:otherwise>
+																<h:commandLink action="viewProfile"
+																	value="${topicrow.poster.user.userName}">
+																	<f:param name="uid" value="${topicrow.poster.user.id}" />
+																</h:commandLink>
+															</c:otherwise>
+
+														</c:choose>
+													</td>
+													<td class="forumlistlast"><a
+														href="#{forums:postPermlink(myForumsAll.topicsLastPosts[topicrow.id].id)}">
+															<c:choose>
+
+																<c:when
+																	test="#{forums:isLongerThan(myForumsAll.topicsLastPosts[topicrow.id].message.subject,25)}">
                             #{forums:subString(myForumsAll.topicsLastPosts[topicrow.id].message.subject,25)}&#8230;
                         </c:when>
-                        
-                        <c:otherwise>
+
+																<c:otherwise>
                             #{myForumsAll.topicsLastPosts[topicrow.id].message.subject}
                         </c:otherwise>
-                        
-                    </c:choose>
-                </a>
-                <br />
-                ${resource.By} 
-                <c:choose>
-                
-                    <c:when test="#{myForumsAll.anonymous}">
+
+															</c:choose>
+													</a> <br /> ${resource.By} <c:choose>
+
+															<c:when test="#{myForumsAll.anonymous}">
                         ${myForumsAll.topicsLastPosts[topicrow.id].poster.user.userName}
                     </c:when>
-                                
-                    <c:otherwise>
-                        <h:commandLink action="viewProfile" value="${myForumsAll.topicsLastPosts[topicrow.id].poster.user.userName}">
-                            <f:param name="uid" value="#{myForumsAll.topicsLastPosts[topicrow.id].poster.user.id}"/>
-                        </h:commandLink>
-                    </c:otherwise>
-                                
-                </c:choose>
-                <br />
-                #{myForumsAll.topicsLastPosts[topicrow.id].createDate}
-            </td>
-            <td class="forumlistopen">
-            <h:form>
-                <input type="hidden" name="t" value="${topicrow.id}"/>
-                <input type="hidden" name="editWatch" value="true"/>
-                <c:choose>
-                
-                    <c:when test="${myForumsAll.topicWatches[topicrow.id].mode eq 0}">
+
+															<c:otherwise>
+																<h:commandLink action="viewProfile"
+																	value="${myForumsAll.topicsLastPosts[topicrow.id].poster.user.userName}">
+																	<f:param name="uid"
+																		value="#{myForumsAll.topicsLastPosts[topicrow.id].poster.user.id}" />
+																</h:commandLink>
+															</c:otherwise>
+
+														</c:choose> <br />
+														#{myForumsAll.topicsLastPosts[topicrow.id].createDate}</td>
+												</h:form>
+												<td class="forumlistopen"><h:form>
+														<input type="hidden" name="t" value="${topicrow.id}" />
+														<input type="hidden" name="editWatch" value="true" />
+														<c:choose>
+
+															<c:when
+																test="${myForumsAll.topicWatches[topicrow.id].mode eq 0}">
                         ${resource.EMAIL_LINKED_NOTIFICATION}
                     </c:when>
-                    
-                    <c:when test="${myForumsAll.topicWatches[topicrow.id].mode eq 1}">
+
+															<c:when
+																test="${myForumsAll.topicWatches[topicrow.id].mode eq 1}">
                         ${resource.EMAIL_EMBEDED_NOTIFICATION}
                     </c:when>
-                    
-                    <c:otherwise>
+
+															<c:otherwise>
                         ${resource.EMAIL_NO_NOTIFICATION}
                     </c:otherwise>
-                    
-                </c:choose>
+
+														</c:choose>
                 &#160;(
                 <h:commandLink action="#{topicWatch.dummyAction}">
-                    <h:outputText value="${resource.Edit}"/>
-                </h:commandLink>
+															<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="#{topicWatch.deActivateWatch}">
-                                <f:param name="t" value="#{topicrow.id}"/>
-                                <img src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
-                                     alt="${resource.Unsubscribe_from_topic}"
-                                     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="#{forums:folderTypeURL(topicrow,myForumsAll.anonymous)}" 
-                     width="11" height="14"
-                     alt="${resource.Topic_Moved}" title="${resource.Topic_Moved}" />
-            </td>
-            <td>
-                <h3>
-                    <h:commandLink action="viewTopic" value="${topicrow.subject}">
-                        <f:param name="t" value="${topicrow.id}"/>            
-                    </h:commandLink>
-                </h3>
-                <!-- mini post navigator for this topic -->
-                <c:if test="#{myForumsAll.topicNavigator[topicrow.id] ne null &amp;&amp; myForumsAll.topicNavigator[topicrow.id].totalPages gt 1}">
+            </h:form></td>
+												<td class="forumlistcentered"><h:form>
+														<div class="actionbuttons">
+															<ul>
+																<li><h:commandLink id="deActivateWatch"
+																		action="#{topicWatch.deActivateWatch}">
+																		<f:param name="t" value="#{topicrow.id}" />
+																		<img
+																			src="#{forums:themeURL('resourceTopicModeDeleteURL')}"
+																			alt="${resource.Unsubscribe_from_topic}"
+																			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="#{forums:folderTypeURL(topicrow,myForumsAll.anonymous)}"
+													width="11" height="14" alt="${resource.Topic_Moved}"
+													title="${resource.Topic_Moved}" /></td>
+												<td>
+													<h3>
+														<h:commandLink action="viewTopic"
+															value="${topicrow.subject}">
+															<f:param name="t" value="${topicrow.id}" />
+														</h:commandLink>
+													</h3> <!-- mini post navigator for this topic --> <c:if
+														test="#{myForumsAll.topicNavigator[topicrow.id] ne null &amp;&amp; myForumsAll.topicNavigator[topicrow.id].totalPages gt 1}">
                     &#160;(&#160;
                     <h:commandLink action="viewTopic" value="${1}">
-                        <f:param name="t" value="#{topicrow.id}"/>
-                        <f:param name="page" value="0"/>
-                    </h:commandLink>
+															<f:param name="t" value="#{topicrow.id}" />
+															<f:param name="page" value="0" />
+														</h:commandLink>
                     &#160;
                     <h:commandLink action="viewTopic" value="${2}">
-                        <f:param name="t" value="#{topicrow.id}"/>
-                        <f:param name="page" value="1"/>
-                    </h:commandLink>
-                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 2}">
+															<f:param name="t" value="#{topicrow.id}" />
+															<f:param name="page" value="1" />
+														</h:commandLink>
+														<c:if
+															test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 2}">
                         &#160;
                         <h:commandLink action="viewTopic" value="${3}">
-                            <f:param name="t" value="#{topicrow.id}"/>
-                            <f:param name="page" value="2"/>
-                        </h:commandLink>
-                    </c:if>
-                    <c:if test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 3}">                        
+																<f:param name="t" value="#{topicrow.id}" />
+																<f:param name="page" value="2" />
+															</h:commandLink>
+														</c:if>
+														<c:if
+															test="#{myForumsAll.topicNavigator[topicrow.id].totalPages gt 3}">                        
                         &#160;&#8230;&#160;
-                        <h:commandLink action="viewTopic" value="${resource.Last_page}">
-                            <f:param name="t" value="#{topicrow.id}"/>
-                            <f:param name="page" value="#{myForumsAll.topicNavigator[topicrow.id].totalPages-1}"/>
-                        </h:commandLink>
-                    </c:if>
+                        <h:commandLink action="viewTopic"
+																value="${resource.Last_page}">
+																<f:param name="t" value="#{topicrow.id}" />
+																<f:param name="page"
+																	value="#{myForumsAll.topicNavigator[topicrow.id].totalPages-1}" />
+															</h:commandLink>
+														</c:if>
                     &#160;)
-                </c:if>
-                <br />
-                ${resource.By}&#160;
-                <c:choose>
-                    
-                    <c:when test="#{myForumsAll.anonymous}">
+                </c:if> <br /> ${resource.By}&#160; <c:choose>
+
+														<c:when test="#{myForumsAll.anonymous}">
                         ${topicrow.poster.user.userName}
                     </c:when>
-                   
-                    <c:otherwise>
-                        <h:commandLink action="viewProfile" value="${topicrow.poster.user.userName}">
-                            <f:param name="uid" value="${topicrow.poster.user.id}"/>
-                        </h:commandLink>
-                    </c:otherwise>
-                                
-                </c:choose>
-            </td>
-            <td colspan="3">
-                <div class="forumfloatright">
-                    <h:form id="notification_${topicrow.id}" >
-                        <input type="hidden" name="t" value="${topicrow.id}" />
-                        <select name="notified_watch_type" id="notified_watch_type">
-                        
-                            <c:choose>
-                                <c:when test="${myForumsAll.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="${myForumsAll.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="${myForumsAll.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="${topicWatch.updateNotificationType}"
-                                         value="${resource.Update}" styleClass="buttonMed" />
-                    </h:form>
-                </div>
-            </td>
-        </tr>
-        </ui:fragment>
-        </c:otherwise>
-    
-    </c:choose>
-    </ui:fragment>
-    </c:forEach>
-    </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:otherwise>
+															<h:commandLink action="viewProfile"
+																value="${topicrow.poster.user.userName}">
+																<f:param name="uid" value="${topicrow.poster.user.id}" />
+															</h:commandLink>
+														</c:otherwise>
 
-</c:if>
+													</c:choose>
+												</td>
+												<td colspan="3">
+													<div class="forumfloatright">
+														<h:form id="notification_${topicrow.id}">
+															<input type="hidden" name="t" value="${topicrow.id}" />
+															<select name="notified_watch_type"
+																id="notified_watch_type">
 
-</ui:define>
-</ui:composition>
+																<c:choose>
+																	<c:when test="${myForumsAll.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="${myForumsAll.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="${myForumsAll.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="${topicWatch.updateNotificationType}"
+																value="${resource.Update}" styleClass="buttonMed" />
+														</h:form>
+													</div>
+												</td>
+											</tr>
+										</ui:fragment>
+									</c:otherwise>
+
+								</c:choose>
+							</ui:fragment>
+						</c:forEach>
+					</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/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_edit_body.xhtml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -625,7 +625,9 @@
         </td>
         <td>
             <h:inputText id="option_${idx.index+1}" name="option_${idx.index+1}"
-                   value="${optionRow}" style="width: 300px;" maxlength="255"/>
+                   value="${optionRow}" style="width: 300px;" maxlength="255">
+                   <f:converter converterId="pollOptionConverter" />
+            </h:inputText>
             &#160;
             <h:commandButton id="UpdateOption_${idx.index+1}" action="#{editPost.updateOption}" value="${resource.Update}"
                              styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -621,7 +621,9 @@
         </td>
         <td>
             <h:inputText id="option_${idx.index+1}" name="option_${idx.index+1}"
-                   value="${optionRow}" style="width: 300px;" maxlength="255"/>
+                   value="${optionRow}" style="width: 300px;" maxlength="255">
+                   <f:converter converterId="pollOptionConverter" />
+            </h:inputText>
             &#160;
             <h:commandButton id="UpdateOption_${idx.index+1}" action="#{newTopic.updateOption}" value="${resource.Update}"
                              styleClass="buttonMed" onclick="selectOption(${idx.index+1});"/>

Modified: labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml
===================================================================
--- labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml	2013-06-19 17:34:33 UTC (rev 38359)
+++ labs/jbossforums/branches/noejbforums130P27/forums/src/resources/portal-forums-war/views/topics/viewtopic_poll_result.xhtml	2013-06-19 17:36:34 UTC (rev 38360)
@@ -30,7 +30,7 @@
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:forums="http://www.jboss.com/products/jbossportal/forums"
       colspan="2">
-
+	<h:form>
 <table cellspacing="0" cellpadding="0" border="0" class="forumPollTable">
 
     <!-- title -->
@@ -84,4 +84,4 @@
     
 </table>
 
-</td>
+</h:form></td>



More information about the jboss-svn-commits mailing list