[prev in list] [next in list] [prev in thread] [next in thread]
List: jboss-cvs-commits
Subject: [jboss-cvs] jboss-portal/forums/src/main/org/jboss/portlet/forums ...
From: Bolesaw Dawidowicz <bdaw () o2 ! pl>
Date: 2005-08-31 21:21:17
Message-ID: E1EAa1F-00088w-Sj () committer01 ! frg ! pub ! inap ! atl ! jboss ! com
[Download RAW message or body]
User: bdaw
Date: 05/08/31 17:21:17
Modified: forums/src/main/org/jboss/portlet/forums Tag:
JBoss_Portal_Branch_2_0 ForumsPortlet.java
Log:
JBPORTAL-354: Delete category with it's content movement.
Revision Changes Path
No revision
No revision
1.22.2.22 +16 -13 \
jboss-portal/forums/src/main/org/jboss/portlet/forums/ForumsPortlet.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ForumsPortlet.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/forums/src/main/org/jboss/portlet/forums/ForumsPortlet.java,v
retrieving revision 1.22.2.21
retrieving revision 1.22.2.22
diff -u -b -r1.22.2.21 -r1.22.2.22
--- ForumsPortlet.java 31 Aug 2005 14:41:52 -0000 1.22.2.21
+++ ForumsPortlet.java 31 Aug 2005 21:21:17 -0000 1.22.2.22
@@ -90,7 +90,7 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.22.2.21 $
+ * @version $Revision: 1.22.2.22 $
*/
public class ForumsPortlet
extends JBossPortlet
@@ -1966,8 +1966,8 @@
Category category = forumsModule.findCategoryByID(catId);
String selectTo = "";
//TODO:Implement Category remove with movement of its forums
- //if (forumsModule.findCategories().size() == 1)
- //{
+ if (forumsModule.findCategories().size() == 1)
+ {
if (forumsModule.findForumsByCategoryID(catId).size() > 0)
{
addErrorMessage(resp, "deletecat", "Must_delete_forums");
@@ -1977,13 +1977,13 @@
{
selectTo = bundle.getString("Nowhere_to_move");
}
- //}
- /*else
+ }
+ else
{
selectTo = "<select name=\"to_id\">"
+ ForumsTools.listCategories(forumsModule.findCategories(), \
catId.intValue()) + "</select>";
- }*/
+ }
resp.setRenderParameter("op", OP_SHOWDELETEFORUM);
resp.setRenderParameter("NAME", category.getTitle());
@@ -2020,17 +2020,21 @@
//TODO:Implement Category remove with movement of its forums
Category fromCategory = forumsModule.findCategoryByID(req
.getParameters().getIntObject("from_id"));
- // Category toCategory = forumsModule.findCategoryByID(req
- // .getParameters().getIntObject("to_id"));
-
+ Category toCategory = forumsModule.findCategoryByID(req
+ .getParameters().getIntObject("to_id"));
+ if (req.getParameters().getIntObject("from_id").equals(req.getParameters().getIntObject("to_id")))
+ {
+ addErrorMessage(resp, "deletecat", \
"cant_move_to_same_category"); + return;
+ }
String[] test1 = new String[]{fromCategory.getTitle()};
- //String[] test2 = new String[]{toCategory.getTitle()};
+ String[] test2 = new String[]{toCategory.getTitle()};
if ((req.hasPermission(test1, "DeleteForumInCategory"))
- /*&& (req.hasPermission(test2, "AddForumInCategory"))*/)
+ && (req.hasPermission(test2, "AddForumInCategory")))
{
DeleteMoveCategoryCommand cmd = new DeleteMoveCategoryCommand(req, \
resp); cmd.source = fromCategory;
- cmd.target = null; //toCategory;
+ cmd.target = toCategory; //null
cmd.module = forumsModule;
Result result = chain.filter(cmd);
ResultType type = result.getType();
@@ -2080,7 +2084,6 @@
"<select name=\"to_id\"><option value=\"-1\">"
+ bundle.getString("Delete_all_posts")
+ "</option>\n" // $s
- //TODO:Forum delete with move of its data is not implemented \
correctly - DeleteMoveForumCommand.java + \
ForumsTools.listForums(forumsModule.findForums(), forumId.intValue()) + \
"</select>");
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic