java/code/src/com/redhat/rhn/frontend/action/channel/manage/RepositoriesAction.java | 22 +++++++--- java/code/src/com/redhat/rhn/manager/rhnset/RhnSetDecl.java | 3 - 2 files changed, 17 insertions(+), 8 deletions(-)
New commits: commit 090e47343ecf987cff5c30bb861cc46d6d8eba3b Author: Shannon Hughes shughes@redhat.com Date: Wed Jun 2 15:08:52 2010 -0400
change from rhnset to sessionset for repo maps
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/RepositoriesAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/RepositoriesAction.java index 36a78c9..cb76c65 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/RepositoriesAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/RepositoriesAction.java @@ -14,7 +14,9 @@ */ package com.redhat.rhn.frontend.action.channel.manage;
+import java.util.HashSet; import java.util.List; +import java.util.Set;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -24,12 +26,12 @@ import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping;
import com.redhat.rhn.domain.channel.ChannelFactory; +import com.redhat.rhn.domain.channel.ContentSource; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.struts.RequestContext; import com.redhat.rhn.frontend.struts.RhnAction; -import com.redhat.rhn.frontend.taglibs.list.helper.ListRhnSetHelper; +import com.redhat.rhn.frontend.taglibs.list.helper.ListSessionSetHelper; import com.redhat.rhn.frontend.taglibs.list.helper.Listable; -import com.redhat.rhn.manager.rhnset.RhnSetDecl;
public class RepositoriesAction extends RhnAction implements Listable { @@ -40,8 +42,18 @@ public class RepositoriesAction extends RhnAction implements Listable { HttpServletRequest request, HttpServletResponse response) {
- ListRhnSetHelper helper = - new ListRhnSetHelper(this, request,RhnSetDecl.REPOSITORY_CHANNEL_MAPS); + ListSessionSetHelper helper = new ListSessionSetHelper(this, request); + + RequestContext context = new RequestContext(request); + if (!context.isSubmitted()) { + List<ContentSource> result = getResult(context); + Set<String> preSelect = new HashSet<String>(); + for (int i = 0; i < result.size(); i++) { + preSelect.add(result.get(i).getId().toString()); + } + helper.preSelect(preSelect); + } + helper.execute(); if(helper.isDispatched()) { //handle the dispatch action (like removing groups etc) @@ -51,7 +63,7 @@ public class RepositoriesAction extends RhnAction implements Listable { return mapping.findForward("default"); }
- public List getResult(RequestContext context) { + public List<ContentSource> getResult(RequestContext context) { User user = context.getLoggedInUser(); return ChannelFactory.lookupContentSources(user.getOrg()); } diff --git a/java/code/src/com/redhat/rhn/manager/rhnset/RhnSetDecl.java b/java/code/src/com/redhat/rhn/manager/rhnset/RhnSetDecl.java index 5dbed76..f2fd4fa 100644 --- a/java/code/src/com/redhat/rhn/manager/rhnset/RhnSetDecl.java +++ b/java/code/src/com/redhat/rhn/manager/rhnset/RhnSetDecl.java @@ -276,9 +276,6 @@ public class RhnSetDecl { public static final RhnSetDecl REMOVE_SYSTEMS_LIST = make( "remove_systems_list", SetCleanup.NOOP);
- public static final RhnSetDecl REPOSITORY_CHANNEL_MAPS = make( - "repository_channel_maps", SetCleanup.NOOP); - public static final RhnSetDecl CHANNEL_SUBSCRIPTION_PERMS = make( "channel_subscription_perms", SetCleanup.NOOP);
spacewalk-commits@lists.fedorahosted.org