[jboss-svn-commits] JBL Code SVN: r5348 - in labs/jbossforums/trunk/forums/src: main/org/jboss/portlet/forums/ui resources/portal-forums-war/views/topics
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jul 28 17:49:25 EDT 2006
Author: sohil.shah at jboss.com
Date: 2006-07-28 17:49:25 -0400 (Fri, 28 Jul 2006)
New Revision: 5348
Modified:
labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
Log:
bug with post navigation when running in portal environment is fixed - http://jira.jboss.com/jira/browse/JBFORUMS-100
Modified: labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java
===================================================================
--- labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2006-07-28 20:45:47 UTC (rev 5347)
+++ labs/jbossforums/trunk/forums/src/main/org/jboss/portlet/forums/ui/ForumsJSFPortlet.java 2006-07-28 21:49:25 UTC (rev 5348)
@@ -64,7 +64,7 @@
//parse and setup any attachments if they are sent in
if ((request.getContentType() != null) && request.getContentType().startsWith("multipart/form-data"))
{
- this.processAttachments(request);
+ this.processAttachments(request,response);
}
super.processAction(request,response);
@@ -218,7 +218,7 @@
*
*
*/
- private void processAttachments(ActionRequest req) throws Exception
+ private void processAttachments(ActionRequest req,ActionResponse response) throws Exception
{
DiskFileItemFactory factory = new DiskFileItemFactory();
PortletFileUpload upload = new PortletFileUpload(factory);
@@ -232,6 +232,30 @@
//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...
req.getParameterMap().put(item.getFieldName(), new String[]{item.getString()});
+
+ //setup the render parameters properly to propagate to the JSF layer
+ String parameter = item.getFieldName();
+ String value = item.getString();
+ 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
{
Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml 2006-07-28 20:45:47 UTC (rev 5347)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_new_body.xhtml 2006-07-28 21:49:25 UTC (rev 5348)
@@ -286,8 +286,7 @@
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
- <h:form id="post" enctype="multipart/form-data">
- <!--h:form id="post"-->
+ <h:form id="post" enctype="multipart/form-data">
<!-- keeps the forum where this topic is being created in context, this is a control parameter -->
<input type="hidden" name="f" value="#{newTopic.forumId}"/>
Modified: labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml
===================================================================
--- labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml 2006-07-28 20:45:47 UTC (rev 5347)
+++ labs/jbossforums/trunk/forums/src/resources/portal-forums-war/views/topics/posting_reply_body.xhtml 2006-07-28 21:49:25 UTC (rev 5348)
@@ -287,7 +287,6 @@
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
<h:form id="post" enctype="multipart/form-data">
- <!--h:form id="post"-->
<!-- keeps the forum where this topic is being created in context, this is a control parameter -->
<input type="hidden" name="f" value="#{replyTopic.forumId}"/>
<input type="hidden" name="t" value="#{replyTopic.topicId}"/>
More information about the jboss-svn-commits
mailing list