Update of
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms
In directory
james.mmbase.org:/tmp/cvs-serv12896/java/com/finalist/cmsc/community/forms
Modified Files:
PreferenceAction.java UserAddAction.java
UserAddInitAction.java
Log Message:
CMSC-944,Create overview screen for Community Preferences , change i18n files
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms
See also: http://www.mmbase.org/jira/browse/CMSC-944
Index: PreferenceAction.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms/PreferenceAction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- PreferenceAction.java 1 Aug 2008 07:20:18 -0000 1.9
+++ PreferenceAction.java 4 Aug 2008 07:34:54 -0000 1.10
@@ -1,7 +1,6 @@
package com.finalist.cmsc.community.forms;
import java.util.List;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -109,6 +108,7 @@
request.setAttribute("results", preferences);
request.setAttribute("isList", "true");
request.setAttribute("page", pagingHolder.getPage());
+ request.setAttribute("forward",
mapping.findForward("list").getPath()+"/page="+pagingHolder.getPage());
return mapping.findForward(FORWARD_SUCCESS);
}
}
Index: UserAddAction.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms/UserAddAction.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- UserAddAction.java 24 Jul 2008 09:05:18 -0000 1.7
+++ UserAddAction.java 4 Aug 2008 07:34:54 -0000 1.8
@@ -10,6 +10,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
@@ -114,8 +115,15 @@
ActionForward ret;
String newsletterId = (String)
httpServletRequest.getSession().getAttribute("newsletterId");
if (StringUtils.isNotBlank(tmpForward)) {
+ if(tmpForward.equals("communitypreference")) {
+ String path = (String)
httpServletRequest.getSession().getAttribute("path");
+ path =
path.substring(0,path.indexOf("page")-1)+"&"+path.substring(path.indexOf("page"));
+ ret = new ActionForward(path);
+ }
+ else {
ret = new
ActionForward("/editors/newsletter/NewsletterPublicationSubscriberSearch.do?newsletterId="
+
httpServletRequest.getSession().getAttribute("newsletterId"));
+ }
ret.setRedirect(true);
} else {
ret = actionMapping.findForward(SUCCESS);
@@ -130,11 +138,11 @@
if ("newslettersubscribers".equals(tmpForward)) {
ActionForward ret = new
ActionForward(actionMapping.findForward("newslettersubscribers").getPath() +
"?newsletterId="
+
httpServletRequest.getSession().getAttribute("newsletterId"));
-
httpServletRequest.getSession().removeAttribute("forward");
-
httpServletRequest.getSession().removeAttribute("newsletterId");
+ clearSession(httpServletRequest.getSession());
ret.setRedirect(true);
return ret;
- } else if ("newslettersubscription".equals(tmpForward))
{
+ }
+ else if ("newslettersubscription".equals(tmpForward)) {
ActionForward ret;
if (((UserForm)
actionForm).getAction().equalsIgnoreCase(UserForm.ACTION_ADD)) {
ret = new
ActionForward(actionMapping.findForward("newslettersubscription").getPath() +
"?newsletterId="
@@ -145,8 +153,15 @@
+
httpServletRequest.getSession().getAttribute("newsletterId"));
}
-
httpServletRequest.getSession().removeAttribute("forward");
-
httpServletRequest.getSession().removeAttribute("newsletterId");
+ clearSession(httpServletRequest.getSession());
+ ret.setRedirect(true);
+ return ret;
+ }
+ else if(tmpForward.equals("communitypreference")) {
+ String path = (String)
httpServletRequest.getSession().getAttribute("path");
+ path =
path.substring(0,path.indexOf("page")-1)+"&"+path.substring(path.indexOf("page"));
+ ActionForward ret = new ActionForward(path);
+ clearSession(httpServletRequest.getSession());
ret.setRedirect(true);
return ret;
}
@@ -154,4 +169,10 @@
removeFromSession(httpServletRequest, actionForm);
return actionMapping.findForward(SUCCESS);
}
+
+ private void clearSession(HttpSession session){
+ session.removeAttribute("forward");
+ session.removeAttribute("newsletterId");
+ session.removeAttribute("path");
+ }
}
Index: UserAddInitAction.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Modules/community/src/java/com/finalist/cmsc/community/forms/UserAddInitAction.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- UserAddInitAction.java 28 Jul 2008 15:01:53 -0000 1.7
+++ UserAddInitAction.java 4 Aug 2008 07:34:54 -0000 1.8
@@ -70,6 +70,10 @@
if (StringUtils.isNotBlank(request.getParameter("forward"))) {
request.getSession().setAttribute("newsletterId",
request.getParameter("newsletterId"));
request.getSession().setAttribute("forward",
request.getParameter("forward"));
+ //community preference return back
+ if(request.getParameter("path") != null) {
+ request.getSession().setAttribute("path",
request.getParameter("path"));
+ }
}
return actionMapping.findForward(SUCCESS);
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs