java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigSystemTag.java |
149 ----------
java/code/src/com/redhat/rhn/frontend/configuration/tags/test/ConfigSystemTagTest.java |
114 -------
java/code/src/com/redhat/rhn/frontend/taglibs/rhn-config-management.tld |
36 --
java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/deployglobal.jspf |
3
java/code/webapp/WEB-INF/pages/configuration/files/comparedeployed.jsp |
2
java/code/webapp/WEB-INF/pages/configuration/sdc/viewdiffresult.jsp |
13
6 files changed, 9 insertions(+), 308 deletions(-)
New commits:
commit 5f63b61621012d1b09a53597abcec92190eb597f
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Tue Dec 17 15:52:49 2013 +0100
delete ConfigSystemTag as these things are easily handled in jsp
diff --git a/java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigSystemTag.java
b/java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigSystemTag.java
deleted file mode 100644
index f0759ee..0000000
--- a/java/code/src/com/redhat/rhn/frontend/configuration/tags/ConfigSystemTag.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * Copyright (c) 2009--2010 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.configuration.tags;
-
-import org.apache.commons.lang.StringEscapeUtils;
-
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.BodyTagSupport;
-import javax.servlet.jsp.tagext.TagSupport;
-
-/**
- * ConfigSystemTag
- * @version $Rev$
- */
-public class ConfigSystemTag extends TagSupport {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1582063245840138731L;
-
- public static final String SYSTEM_ALT_KEY = "system.common.systemAlt";
- public static final String SYSTEM_LIST_ICON =
"/img/rhn-listicon-system.gif";
- public static final String SYSTEM_HEADER_ICON =
"/img/rhn-icon-system.gif";
- public static final String SYSTEM_URL =
- "/rhn/systems/details/configuration/Overview.do";
-
- /**
- * <cfg:system id="" name="" nolink="">
- */
- private String id;
- private String name;
- private boolean nolink;
-
- /**
- * {@inheritDoc}
- */
- public int doEndTag() throws JspException {
- if (nolink || id == null) {
- writeIcon();
- ConfigTagHelper.write(StringEscapeUtils.escapeXml(name), pageContext);
- }
- else {
- String url = makeConfigSystemUrl(id);
- ConfigTagHelper.write("<a href=\"" + url +
"\">", pageContext);
- writeIcon();
- ConfigTagHelper.write(StringEscapeUtils.escapeXml(name) +
"</a>", pageContext);
- }
- return BodyTagSupport.SKIP_BODY;
- }
-
- /**
- * {@inheritDoc}
- */
- public void release() {
- id = null;
- name = null;
- nolink = false;
- super.release();
- }
-
-
- /**
- * @param val the id to set
- */
- public void setId(String val) {
- this.id = val;
- }
-
-
- /**
- * @param isNoLink the nolink to set
- */
- public void setNolink(String isNoLink) {
- this.nolink = Boolean.TRUE.toString().equalsIgnoreCase(isNoLink);
- }
-
-
- /**
- * @param value the name to set
- */
- public void setName(String value) {
- this.name = value;
- }
-
- private void writeIcon() throws JspException {
- ConfigTagHelper.writeIcon(SYSTEM_LIST_ICON, SYSTEM_ALT_KEY, pageContext);
- }
-
- /**
- * Returns the URL to reach the SDC\ConfigOverview page for a system.
- * This method may also be used with the el expression
- * ${config:systemUrl('id')}
- * This method is public static because
- * EL functions defined in a TLD file,
- * need to be public static methods.. systemConfig file
- * @param id the SID of the system in question
- * @return the URL to reach the cfg-overview page in the SDC
- */
- public static String makeConfigSystemUrl(String id) {
- return SYSTEM_URL + "?sid=" + id;
- }
-
- /**
- * Returns the Header icon image path for a system
- * This method is public static because
- * EL functions defined in a TLD file,
- * need to be public static methods..
- * @return the image path
- */
- public static final String getHeaderIconFor() {
- return SYSTEM_HEADER_ICON;
- }
-
- /**
- * Returns the List icon image path for a system
- * This method is public static because
- * EL functions defined in a TLD file,
- * need to be public static methods..
- * @return the image path
- */
- public static final String getListIconFor() {
- return SYSTEM_LIST_ICON;
- }
-
-
- /**
- * Returns the Header alt key for a system
- * This method is public static because
- * EL functions defined in a TLD file,
- * need to be public static methods..
- * @return the alt key
- */
- public static final String getAltKeyFor() {
- return SYSTEM_ALT_KEY;
- }
-}
diff --git
a/java/code/src/com/redhat/rhn/frontend/configuration/tags/test/ConfigSystemTagTest.java
b/java/code/src/com/redhat/rhn/frontend/configuration/tags/test/ConfigSystemTagTest.java
deleted file mode 100644
index 9833931..0000000
---
a/java/code/src/com/redhat/rhn/frontend/configuration/tags/test/ConfigSystemTagTest.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * Copyright (c) 2009--2010 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.configuration.tags.test;
-
-import com.redhat.rhn.common.localization.LocalizationService;
-import com.redhat.rhn.frontend.configuration.tags.ConfigSystemTag;
-import com.redhat.rhn.testing.RhnBaseTestCase;
-import com.redhat.rhn.testing.RhnMockHttpServletRequest;
-import com.redhat.rhn.testing.RhnMockJspWriter;
-import com.redhat.rhn.testing.TagTestUtils;
-
-import com.mockobjects.helpers.TagTestHelper;
-
-import java.net.URL;
-
-import javax.servlet.jsp.tagext.Tag;
-
-/**
- * ConfigSystemTagTest
- * @version $Rev$
- */
-public class ConfigSystemTagTest extends RhnBaseTestCase {
- /**
- * Called once per test method.
- * @throws Exception if an error occurs during setup.
- */
- protected void setUp() throws Exception {
- super.setUp();
- ConfigSystemTag tag = new ConfigSystemTag();
- RhnMockHttpServletRequest request = new RhnMockHttpServletRequest();
- TagTestHelper tth = TagTestUtils.setupTagTest(tag,
- new URL("http://localhost"),
- request);
- tag.setPageContext(tth.getPageContext());
- }
-
- /** Test tag output for files
- */
- public void testSystem() throws Exception {
-
- String alt = ConfigSystemTag.SYSTEM_ALT_KEY;
- String imgName = ConfigSystemTag.SYSTEM_LIST_ICON;
-
- execTest(0, "bar", false, alt, imgName);
- }
-
- public void execTest(int id, String name, boolean nolink,
- String altKey, String imgName) throws Exception {
- ConfigSystemTag tag = new ConfigSystemTag();
- RhnMockHttpServletRequest request = new RhnMockHttpServletRequest();
- TagTestHelper tth = TagTestUtils.setupTagTest(tag,
- new URL("http://localhost"),
- request);
- tag.setPageContext(tth.getPageContext());
- if (id >= 0) {
- tag.setId(String.valueOf(id));
- }
-
- tag.setName(name);
- tag.setNolink(String.valueOf(nolink));
-
- // ok let's test the tag
- tth.assertDoStartTag(Tag.SKIP_BODY);
- tth.assertDoEndTag(Tag.SKIP_BODY);
-
- RhnMockJspWriter rout = (RhnMockJspWriter) tth.getPageContext().getOut();
-
- assertTrue(rout.toString().indexOf(name) > -1);
- assertFalse(rout.toString().indexOf("alt =\"\"") > -1);
- LocalizationService service = LocalizationService.getInstance();
- String alt = service.getMessage(altKey);
- assertTrue(rout.toString().indexOf(alt) > -1);
- assertTrue(rout.toString().indexOf(imgName) > -1);
- if (!nolink && id >= 0) {
- String url = "<a href=\"" + ConfigSystemTag.SYSTEM_URL +
"?sid=" + id;
- assertTrue(rout.toString().startsWith(url));
- }
- else {
- assertFalse(rout.toString().startsWith("<a href"));
- }
-
- }
-
- public void testFunctions() {
- checkFunctions(ConfigSystemTag.SYSTEM_HEADER_ICON,
- ConfigSystemTag.SYSTEM_ALT_KEY,
- "system");
- //also checking case sensititvity
- checkFunctions(ConfigSystemTag.SYSTEM_HEADER_ICON,
- ConfigSystemTag.SYSTEM_ALT_KEY,
- "sYsTem");
-
- String url = ConfigSystemTag.makeConfigSystemUrl("" + 1);
- assertTrue(url.indexOf("sid=1") > -1);
- assertTrue(url.startsWith(ConfigSystemTag.SYSTEM_URL));
- }
-
- private void checkFunctions(String icon, String altKey, String type) {
- assertEquals(altKey, ConfigSystemTag.getAltKeyFor());
- assertEquals(icon, ConfigSystemTag.getHeaderIconFor());
- }
-}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-config-management.tld
b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-config-management.tld
index e291ddf..7522689 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-config-management.tld
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-config-management.tld
@@ -63,26 +63,6 @@
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
- <tag>
- <name>system</name>
-
<tag-class>com.redhat.rhn.frontend.configuration.tags.ConfigSystemTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>name</name>
- <required>true</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- <attribute>
- <name>nolink</name>
- <required>false</required>
- <rtexprvalue>true</rtexprvalue>
- </attribute>
- </tag>
<function>
<name>channelUrl</name>
@@ -138,21 +118,5 @@
<name>fileAlt</name>
<function-class>com.redhat.rhn.frontend.configuration.tags.ConfigFileTag</function-class>
<function-signature>java.lang.String
getAltKeyFor(java.lang.String)</function-signature>
- </function>
-
- <function>
- <name>systemHeaderIcon</name>
-
<function-class>com.redhat.rhn.frontend.configuration.tags.ConfigSystemTag</function-class>
- <function-signature>java.lang.String
getHeaderIconFor()</function-signature>
</function>
- <function>
- <name>systemListIcon</name>
-
<function-class>com.redhat.rhn.frontend.configuration.tags.ConfigSystemTag</function-class>
- <function-signature>java.lang.String
getListIconFor()</function-signature>
- </function>
- <function>
- <name>systemAlt</name>
-
<function-class>com.redhat.rhn.frontend.configuration.tags.ConfigSystemTag</function-class>
- <function-signature>java.lang.String getAltKeyFor()</function-signature>
- </function>
</taglib>
diff --git
a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/deployglobal.jspf
b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/deployglobal.jspf
index 55ca49f..718f538 100644
---
a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/deployglobal.jspf
+++
b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/files/deployglobal.jspf
@@ -3,6 +3,7 @@
<%@ taglib
uri="http://struts.apache.org/tags-bean" prefix="bean"
%>
<%@ taglib
uri="http://struts.apache.org/tags-html" prefix="html"
%>
<%@ taglib
uri="http://rhn.redhat.com/tags/config-managment"
prefix="cfg" %>
+<%@ taglib
uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
<c:set var="beanarg" scope="request">
<cfg:channel id="${channel.id}"
@@ -25,7 +26,7 @@
<rhn:listdisplay filterBy="system.common.systemName"
set="${requestScope.set}">
<rhn:set value="${current.id}" disabled="${not
current.selectable}"/>
<rhn:column header="globaldeploy.jsp.systemName-header">
- <cfg:system id="${current.id}" name="${current.name}"
/><c:if test="${not current.deployable}">*</c:if>
+ <a
href="/rhn/systems/details/configuration/Overview.do?sid=${current.id}"><rhn:icon
type="header-system" /> ${fn:escapeXml(current.name)} </a><c:if
test="${not current.deployable}">*</c:if>
</rhn:column>
<rhn:column header="globaldeploy.jsp.overridden-header">
diff --git a/java/code/webapp/WEB-INF/pages/configuration/files/comparedeployed.jsp
b/java/code/webapp/WEB-INF/pages/configuration/files/comparedeployed.jsp
index d76fe77..b44bb85 100644
--- a/java/code/webapp/WEB-INF/pages/configuration/files/comparedeployed.jsp
+++ b/java/code/webapp/WEB-INF/pages/configuration/files/comparedeployed.jsp
@@ -29,7 +29,7 @@
<rhn:set value="${current.id}"/>
<rhn:column header="system.common.systemName">
- <cfg:system id="${current.id}" name="${current.name}" />
+ <a
href="/rhn/systems/details/configuration/Overview.do?sid=${current.id}"><rhn:icon
type="header-system" /> ${fn:escapeXml(current.name)} </a>
</rhn:column>
<rhn:column header="comparedeployed.jsp.deployed">
diff --git a/java/code/webapp/WEB-INF/pages/configuration/sdc/viewdiffresult.jsp
b/java/code/webapp/WEB-INF/pages/configuration/sdc/viewdiffresult.jsp
index 4af2a56..bb2e818 100644
--- a/java/code/webapp/WEB-INF/pages/configuration/sdc/viewdiffresult.jsp
+++ b/java/code/webapp/WEB-INF/pages/configuration/sdc/viewdiffresult.jsp
@@ -4,14 +4,16 @@
<%@ taglib
uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%>
<%@ taglib
uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"
%>
<%@ taglib
uri="http://struts.apache.org/tags-bean" prefix="bean"
%>
+<%@ taglib
uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
<head>
<meta name="name" value="sdc.config.jsp.header" />
</head>
<body>
<c:set var="revisionBean"
value="${requestScope.revisionBean}"/>
<%@ include
file="/WEB-INF/pages/common/fragments/systems/system-header.jspf" %>
-<h2><img class="h2-image"
src="${cfg:systemHeaderIcon()}"/>
-<bean:message key="sdc.config.header.diff_result"/></h2>
+<rhn:toolbar base="h2" icon="header-configuration">
+<bean:message key="sdc.config.header.diff_result"/>
+</rhn:toolbar>
<p>
<c:set var="path"
@@ -42,10 +44,7 @@
type = "${channel.configChannelType.label}"
/></strong></c:set>
-<c:set var="systemValue"><strong><cfg:system
- name = "${requestScope.system.name}"
- id = "${requestScope.system.id}"
- /></strong></c:set>
+<c:set var="systemValue"><strong><a
href="/rhn/systems/details/configuration/Overview.do?sid=${current.id}"><rhn:icon
type="header-system" /> ${fn:escapeXml(current.name)}
</a></strong></c:set>
<table class="details">
@@ -79,4 +78,4 @@
</tr>
</table>
</p>
-</body>
\ No newline at end of file
+</body>