java/code/src/com/redhat/rhn/frontend/action/systems/WorkWithGroupAction.java | 67
++++++++++
java/code/webapp/WEB-INF/pages/common/fragments/groups/header.jspf | 2
java/code/webapp/WEB-INF/pages/common/fragments/systems/group_listdisplay.jspf | 2
java/code/webapp/WEB-INF/struts-config.xml | 7 +
web/html/network/systems/ssm/work_with_group.pxt | 4
web/include/network/components/system_groups/sgdc_header.pxi | 3
web/modules/sniglets/Sniglets/ListView/SystemGroupList.pm | 2
web/modules/sniglets/Sniglets/ServerGroup.pm | 12 -
8 files changed, 78 insertions(+), 21 deletions(-)
New commits:
commit 4323890085731fa44b8f68c3ee2713583365be2e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 19 15:49:42 2013 +0100
updated references to new java WorkWithGroup page
and removed old pxt page
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/groups/header.jspf
b/java/code/webapp/WEB-INF/pages/common/fragments/groups/header.jspf
index 89e305a..df5d63c 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/groups/header.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/groups/header.jspf
@@ -8,7 +8,7 @@
<div class="spacewalk-toolbar-h1">
<div class="spacewalk-toolbar">
<span class="spacewalk-toolbar">
- <a
href="/network/systems/ssm/work_with_group.pxt?sgid=${systemgroup.id}&pxt_trap=rhn:work_with_group_cb">
+ <a href="/rhn/systems/WorkWithGroup.do?sgid=${systemgroup.id}">
<rhn:icon type="header-system-groups" title="<bean:message
key='toolbar.work.with.group' />" />
<bean:message key="toolbar.work.with.group"/>
</a>
diff --git
a/java/code/webapp/WEB-INF/pages/common/fragments/systems/group_listdisplay.jspf
b/java/code/webapp/WEB-INF/pages/common/fragments/systems/group_listdisplay.jspf
index 9493d3b..b2debd3 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/systems/group_listdisplay.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/systems/group_listdisplay.jspf
@@ -86,7 +86,7 @@
headerclass="center">
- <c:out value="<a class=\"link-button\"
href=\"/network/systems/ssm/work_with_group.pxt?sgid=${current.id}&pxt_trap=rhn:work_with_group_cb\">
+ <c:out value="<a
class=\"link-button\"
href=\"/rhn/systems/WorkWithGroup.do?sgid=${current.id}\">
${rhn:localize('grouplist.jsp.use')}</a>"
escapeXml="false" />
</rl:column>
diff --git a/web/html/network/systems/ssm/work_with_group.pxt
b/web/html/network/systems/ssm/work_with_group.pxt
deleted file mode 100644
index 4527eb1..0000000
--- a/web/html/network/systems/ssm/work_with_group.pxt
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<pxt-passthrough>
- <pxt-use class="Sniglets::ServerGroup" />
-</pxt-passthrough>
diff --git a/web/include/network/components/system_groups/sgdc_header.pxi
b/web/include/network/components/system_groups/sgdc_header.pxi
index ec12f46..7ccd6c2 100644
--- a/web/include/network/components/system_groups/sgdc_header.pxi
+++ b/web/include/network/components/system_groups/sgdc_header.pxi
@@ -10,7 +10,7 @@
icon="header-system-groups"
alt="system group"
help-url="s1-sm-systems.jsp#s2-sm-system-group-list"
-
misc-url="/network/systems/ssm/work_with_group.pxt?sgid={formvar:sgid}&pxt_trap=rhn:work_with_group_cb"
+ misc-url="/rhn/systems/WorkWithGroup.do?sgid={formvar:sgid}"
misc-alt="work with group"
misc-icon="header-system-groups"
misc-text="work with group"
@@ -19,7 +19,6 @@
deletion-acl="user_role(system_group_admin)">
<rhn-server-group-name />
</rhn-toolbar>
-
<rhn-navi-nav prefix="system_group_details" depth="0"
file="/nav/system_group_detail.xml" style="contentnav" />
</pxt-formvar>
diff --git a/web/modules/sniglets/Sniglets/ListView/SystemGroupList.pm
b/web/modules/sniglets/Sniglets/ListView/SystemGroupList.pm
index bfdaa6a..1ca9309 100644
--- a/web/modules/sniglets/Sniglets/ListView/SystemGroupList.pm
+++ b/web/modules/sniglets/Sniglets/ListView/SystemGroupList.pm
@@ -90,7 +90,7 @@ sub row_callback {
$row->{MONITORING_ICON} =
PXT::HTML->link("/network/systems/groups/probe_list.pxt?sgid=" .
$row->{ID}, $image);
}
- my $use_group_btn =
PXT::HTML->link(sprintf("/network/systems/ssm/work_with_group.pxt?sgid=%d&pxt_trap=rhn:work_with_group_cb",
$row->{ID}),
+ my $use_group_btn =
PXT::HTML->link(sprintf("/rhn/systems/WorkWithGroup.do?sgid=%d",
$row->{ID}),
'<img src="/img/button-use_group.gif" border="0"
valign="middle" alt="Work with '
.$row->{GROUP_NAME}.' Group" title="Work with '
.$row->{GROUP_NAME}.' Group" />');
diff --git a/web/modules/sniglets/Sniglets/ServerGroup.pm
b/web/modules/sniglets/Sniglets/ServerGroup.pm
index c7d8294..5517355 100644
--- a/web/modules/sniglets/Sniglets/ServerGroup.pm
+++ b/web/modules/sniglets/Sniglets/ServerGroup.pm
@@ -47,8 +47,6 @@ sub register_callbacks {
$pxt->register_callback('rhn:server_group_delete_cb' =>
\&delete_server_group_cb);
$pxt->register_callback('rhn:alter_system_group_membership_cb' =>
\&alter_system_group_membership_cb);
-
- $pxt->register_callback('rhn:work_with_group_cb' =>
\&work_with_group_cb );
}
sub system_group_status_interface {
@@ -387,14 +385,4 @@ sub admin_server_group_edit_cb {
}
-sub work_with_group_cb {
- my $pxt = shift;
-
- PXT::Debug->log(7, "working with group " .
$pxt->param('sgid'));
-
- RHN::Set->copy_from_group($pxt->user->id, "system_list",
$pxt->param('sgid'));
-
- $pxt->redirect("/rhn/systems/ssm/ListSystems.do");
-}
-
1;
commit fad9b57b373fdcb81457c40251871fe13223f0ac
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 19 15:44:46 2013 +0100
work_with_group.pxt rewritten to java
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/WorkWithGroupAction.java
b/java/code/src/com/redhat/rhn/frontend/action/systems/WorkWithGroupAction.java
new file mode 100644
index 0000000..0cf4b8c
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/WorkWithGroupAction.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2013 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ *
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.frontend.action.systems;
+
+import com.redhat.rhn.domain.rhnset.RhnSet;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.domain.server.ManagedServerGroup;
+import com.redhat.rhn.frontend.dto.SystemOverview;
+import com.redhat.rhn.frontend.struts.RequestContext;
+import com.redhat.rhn.frontend.struts.RhnAction;
+import com.redhat.rhn.frontend.struts.RhnHelper;
+import com.redhat.rhn.manager.rhnset.RhnSetDecl;
+import com.redhat.rhn.manager.rhnset.RhnSetManager;
+import com.redhat.rhn.manager.system.SystemManager;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+import java.util.Iterator;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * WorkWithGroup
+ * @version 1
+ */
+public class WorkWithGroupAction extends RhnAction {
+
+ /** {@inheritDoc} */
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm formIn,
+ HttpServletRequest request,
+ HttpServletResponse response) {
+
+ RequestContext requestContext = new RequestContext(request);
+ ManagedServerGroup serverGroup = requestContext.lookupAndBindServerGroup();
+ User user = requestContext.getLoggedInUser();
+
+ RhnSet systemSet = RhnSetDecl.SYSTEMS.create(user);
+
+ Iterator systems = SystemManager.systemsInGroup(serverGroup.getId(), null)
+ .iterator();
+ while (systems.hasNext()) { //for every system in a group
+ Long id = ((SystemOverview)systems.next()).getId();
+ systemSet.addElement(id);
+ }
+
+ RhnSetManager.store(systemSet);
+
+ //response.sendRedirect("/rhn/systems/ssm/ListSystems.do");
+ return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
+ }
+}
diff --git a/java/code/webapp/WEB-INF/struts-config.xml
b/java/code/webapp/WEB-INF/struts-config.xml
index 80d0023..0ace144 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -3054,6 +3054,13 @@
path="/WEB-INF/pages/systems/systemsearch.jsp"/>
</action>
+ <action path="/systems/WorkWithGroup"
+ scope="request"
+
type="com.redhat.rhn.frontend.action.systems.WorkWithGroupAction">
+ <forward name="default"
+ path="/systems/ssm/ListSystems.do"
redirect="true" />
+ </action>
+
<action path="/systems/details/audit/ListScap"
scope="request"
input="/WEB-INF/pages/systems/details/audit/listscap.jsp"