java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
| 18 ++
java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKSScheduleAction.java
| 26 +++
java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKickstartableSystemsAction.java
| 68 ++++++++++
java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
| 24 +++
java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
| 9 -
java/code/webapp/WEB-INF/pages/kickstart/ssm/kickstartablesystems.jsp
| 23 +++
java/code/webapp/WEB-INF/struts-config.xml
| 22 +++
7 files changed, 186 insertions(+), 4 deletions(-)
New commits:
commit ec47b3f86f2b9bfded604eab6a5b96e70e2ad7b3
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Jun 30 18:22:20 2009 -0400
508980 - Initial cut of the SSM kickstart work
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index 3b335d3..2ce6af8 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -36,6 +36,24 @@ ORDER BY UPPER(NVL(S.name, '(none)')), S.id
<elaborator name="system_overview" />
</mode>
+<!-- system_feature(ftr_kickstart); not is_solaris() -->
+<mode name="ssm_kickstartable"
class="com.redhat.rhn.frontend.dto.SystemOverview">
+ <query params="user_id">
+SELECT S.id,
+ S.name
+ FROM rhnServer S
+ inner join rhnSet ST on S.id = ST.element
+ inner join rhnUserServerPerms USP on USP.server_id = S.id
+ WHERE USP.user_id = :user_id
+ AND ST.user_id = :user_id
+ AND ST.label = 'system_list'
+ AND EXISTS(SELECT 1 FROM rhnServerFeaturesView SFV WHERE SFV.server_id = ST.element
AND SFV.label = 'ftr_kickstart')
+ AND USP.server_id = S.id
+ORDER BY UPPER(NVL(S.NAME, '(none)')), S.ID
+ </query>
+ <elaborator name="system_overview" />
+</mode>
+
<mode name="ssm_remote_commandable">
<query params="user_id">
diff --git
a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKSScheduleAction.java
b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKSScheduleAction.java
new file mode 100644
index 0000000..46937df
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKSScheduleAction.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2009 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.kickstart.ssm;
+
+import com.redhat.rhn.frontend.struts.RhnAction;
+
+
+/**
+ * ScheduleKickstartAction
+ * @version $Rev$
+ */
+public class SsmKSScheduleAction extends RhnAction {
+
+}
diff --git
a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKickstartableSystemsAction.java
b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKickstartableSystemsAction.java
new file mode 100644
index 0000000..6c6d9d0
--- /dev/null
+++
b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ssm/SsmKickstartableSystemsAction.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2009 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.kickstart.ssm;
+
+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.struts.RhnHelper;
+import com.redhat.rhn.frontend.taglibs.list.helper.ListHelper;
+import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
+import com.redhat.rhn.manager.kickstart.KickstartManager;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+/**
+ * SsmKickstartableSystemsAction
+ * @version $Rev$
+ */
+public class SsmKickstartableSystemsAction extends RhnAction implements Listable {
+
+ /**
+ * ${@inheritDoc}
+ */
+ public ActionForward execute(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) throws Exception {
+ ListHelper helper = new ListHelper(this, request);
+ helper.setDataSetName(getDataSetName());
+ helper.execute();
+ return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
+ }
+
+ /**
+ * ${@inheritDoc}
+ */
+ public String getDataSetName() {
+ return "pageList";
+ }
+
+
+ /**
+ * ${@inheritDoc}
+ */
+ public List getResult(RequestContext context) {
+ User user = context.getLoggedInUser();
+ return KickstartManager.getInstance().kickstartableSystemsInSsm(user);
+ }
+
+}
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
index 255769c..8a0f0da 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java
@@ -15,12 +15,21 @@
package com.redhat.rhn.manager.kickstart;
import com.redhat.rhn.common.conf.Config;
+import com.redhat.rhn.common.db.datasource.DataResult;
+import com.redhat.rhn.common.db.datasource.ModeFactory;
+import com.redhat.rhn.common.db.datasource.SelectMode;
import com.redhat.rhn.common.util.download.DownloadException;
import com.redhat.rhn.common.util.download.DownloadUtils;
import com.redhat.rhn.common.validator.ValidatorException;
import com.redhat.rhn.domain.kickstart.KickstartData;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.dto.SystemOverview;
import com.redhat.rhn.manager.BaseManager;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
/**
*
* KickstartManager
@@ -81,5 +90,18 @@ public class KickstartManager extends BaseManager {
ValidatorException.raiseException("kickstart.jsp.error.template_generation",
KickstartUrlHelper.getFileDowloadPageUrl(ksdata));
}
- }
+ }
+
+ /**
+ * returns a list of systems in SSM
+ * that are kickstartable
+ * @param user the user for access info
+ * @return the list of kickstartable systems
+ */
+ public DataResult<SystemOverview> kickstartableSystemsInSsm(User user) {
+ SelectMode m = ModeFactory.getMode("System_queries",
"ssm_kickstartable");
+ Map params = new HashMap();
+ params.put("user_id", user.getId());
+ return makeDataResult(params, Collections.EMPTY_MAP, null, m);
+ }
}
diff --git
a/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
b/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
index 87fc451..23c68e4 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf
@@ -50,6 +50,7 @@
<%@ include file="monitoring_status_systems.jspf" %>
</c:if>
+ <c:if test = "${empty noErrata}">
<!-- errata Column -->
<rl:column sortable="false"
bound="false"
@@ -65,7 +66,8 @@
</c:otherwise>
</c:choose>
</rl:column>
-
+ </c:if>
+ <c:if test = "${empty noPackages}">
<!-- Packages Column -->
<rl:column sortable="false"
bound="false"
@@ -82,7 +84,7 @@
</c:otherwise>
</c:choose>
</rl:column>
-
+ </c:if>
<!-- Name Channel Column -->
<rl:column sortable="true"
@@ -112,8 +114,9 @@
</rl:list>
+ <c:if test = "${empty noCsv}">
<rl:csv dataset="pageList"
name="systemList"
exportColumns="name,id,securityErrata,bugErrata,enhancementErrata,outdatedPackages,lastCheckin,entitlement"/>
-
+ </c:if>
<rhn:submitted/>
diff --git a/java/code/webapp/WEB-INF/pages/kickstart/ssm/kickstartablesystems.jsp
b/java/code/webapp/WEB-INF/pages/kickstart/ssm/kickstartablesystems.jsp
new file mode 100644
index 0000000..9aa54a2
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/kickstart/ssm/kickstartablesystems.jsp
@@ -0,0 +1,23 @@
+<%@ taglib
uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib
uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%>
+<%@ taglib
uri="http://jakarta.apache.org/struts/tags-html"
prefix="html" %>
+<%@ taglib
uri="http://jakarta.apache.org/struts/tags-bean"
prefix="bean" %>
+<%@ taglib
uri="http://rhn.redhat.com/tags/list" prefix="rl"
%>
+<html:xhtml/>
+<html>
+<head>
+ <meta name="page-decorator" content="none" />
+</head>
+<body>
+ <%@ include file="/WEB-INF/pages/common/fragments/ssm/header.jspf"
%>
+<c:set var="noUpdates" value="true"/>
+<c:set var="notSelectable" value="true"/>
+<c:set var="noMonitoring" value="true"/>
+<c:set var="noErrata" value="true"/>
+<c:set var="noPackages" value="true"/>
+
+<rl:listset name="systemListSet" legend="system">
+ <%@ include
file="/WEB-INF/pages/common/fragments/systems/system_listdisplay.jspf" %>
+</rl:listset>
+</body>
+</html>
\ No newline at end of file
diff --git a/java/code/webapp/WEB-INF/pages/kickstart/ssm/schedule.jsp
b/java/code/webapp/WEB-INF/pages/kickstart/ssm/schedule.jsp
new file mode 100644
index 0000000..e69de29
diff --git a/java/code/webapp/WEB-INF/struts-config.xml
b/java/code/webapp/WEB-INF/struts-config.xml
index 6baa745..cec2db1 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -4603,6 +4603,28 @@
<forward name="deleted" path="/profiles/List.do"
redirect="true" />
</action>
+ <!-- Kickstart Pages SSM -->
+ <action path="/ssm/kickstart/KickstartableSystems"
+ scope="request"
+ input="/WEB-INF/pages/kickstart/ssm/kickstartablesystems.jsp"
+
type="com.redhat.rhn.frontend.action.kickstart.ssm.SsmKickstartableSystemsAction"
+ className="com.redhat.rhn.frontend.struts.RhnActionMapping">
+ <set-property property="acls"
value="org_entitlement(rhn_provisioning); user_role(config_admin)"/>
+ <forward name="default"
+
path="/WEB-INF/pages/kickstart/ssm/kickstartablesystems.jsp"/>
+ <forward name="success"
+ path="/ssm/kickstart/Schedule.do"/>
+ </action>
+ <action path="/ssm/kickstart/Schedule"
+ scope="request"
+ input="/WEB-INF/pages/kickstart/ssm/schedule.jsp"
+
type="com.redhat.rhn.frontend.action.kickstart.ssm.SsmKSScheduleAction"
+ className="com.redhat.rhn.frontend.struts.RhnActionMapping">
+ <set-property property="acls"
value="org_entitlement(rhn_provisioning); user_role(config_admin)"/>
+ <forward name="default"
+ path="/WEB-INF/pages/kickstart/ssm/schedule.jsp"/>
+ </action>
+
<!-- Kickstart Pages -->
<action path="/kickstart/Kickstarts"