Author: unibrew Date: 2006-07-05 10:21:33 -0400 (Wed, 05 Jul 2006) New Revision: 4915 Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml Log: [JBFORUMS-54] Updating split topic actions. Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java =================================================================== --- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java 2006-07-05 13:58:30 UTC (rev 4914) +++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/action/SplitTopic.java 2006-07-05 14:21:33 UTC (rev 4915) @@ -40,11 +40,12 @@ import org.jboss.portlet.forums.ui.Constants; import org.jboss.portlet.forums.ui.ForumUtil; import org.jboss.portlet.forums.ui.JSFUtil; +import org.jboss.portlet.forums.ui.PortalUtil; /** * SplitTopic is a bean which keeps data and has actions needed to achieve - * spltting topic into two separate topics. - * + * spltting topic into two separate topics. + * * @author <a href="mailto:rys...@jb...">Ryszard Kozmik</a> */ public class SplitTopic extends BaseController { @@ -162,7 +163,7 @@ // Creating new topic in destination forum. Topic newTopic = getForumsModule().createTopic(destForum, - topic.getPoster().getUserId(), + PortalUtil.getUser().getId().toString(), newTopicTitle, topic.getType()); // Getting post id after which the topic must be splitted. @@ -173,10 +174,12 @@ Post tempPost = null; while( it.hasNext() ) { + System.out.println("JESTEM W WHILEu"); tempPost = (Post)it.next(); // searching for post to split after if (tempPost.getId().equals(selectedPostId)) { + System.out.println("JESTEM W IFIE"); break; } } @@ -203,7 +206,7 @@ message = bundle.getString("SUCC_TOPIC_SPLITTED"); FacesContext.getCurrentInstance().addMessage("message", new FacesMessage(FacesMessage.SEVERITY_INFO,message, "moderate")); - return ""; + return "splitted"; } /** @@ -276,7 +279,7 @@ // Creating new topic in selected destination forum. Topic newTopic = getForumsModule().createTopic(destForum, - topic.getPoster().getUserId(), + PortalUtil.getUser().getId().toString(), newTopicTitle, topic.getType()); // Moving all selected posts to new topic. @@ -299,7 +302,7 @@ message = bundle.getString("SUCC_TOPIC_SPLITTED"); FacesContext.getCurrentInstance().addMessage("message", new FacesMessage(FacesMessage.SEVERITY_INFO,message, "moderate")); - return ""; + return "splitted"; } // ---------- Initializing ------------------------------------------------- Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-07-05 13:58:30 UTC (rev 4914) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/WEB-INF/forums-config.xml 2006-07-05 14:21:33 UTC (rev 4915) @@ -305,7 +305,7 @@ <managed-bean> <managed-bean-name>splitTopic</managed-bean-name> <managed-bean-class>org.jboss.portlet.forums.ui.action.SplitTopic</managed-bean-class> - <managed-bean-scope>request</managed-bean-scope> + <managed-bean-scope>session</managed-bean-scope> </managed-bean> <navigation-rule> Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml =================================================================== --- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml 2006-07-05 13:58:30 UTC (rev 4914) +++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/moderator/modcp_split.xhtml 2006-07-05 14:21:33 UTC (rev 4915) @@ -36,6 +36,7 @@ <h:messages layout="table" infoStyle="color:green" warnStyle="color:red"/> <h:form> + <input type="hidden" name="t" value="#{splitTopic.topic.id}"/> <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> <td align="left" class="nav"> @@ -67,7 +68,7 @@ </td> <td class="row2" colspan="2"> <h:inputText class="post" size="35" style="width: 350px" maxlength="60" - name="subject" value="#{splitTopic.newTopicTitle}"/> + value="#{splitTopic.newTopicTitle}"/> </td> </tr> <tr> @@ -203,7 +204,7 @@ <tr> <!-- integrate jumpbox here --> <td align="right" valign="top" nowrap="nowrap"> - <ui:include src="/views/jumpbox.xhtml"/> + <!-- <ui:include src="/views/jumpbox.xhtml"/> --> </td> </tr> </table> |