client/tools rel-eng/packages
by Jan Pazdziora
client/tools/osad/osad.spec | 5 ++++-
rel-eng/packages/osad | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit f8fbd444cd087e561a934671639b64c94fe4d22e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 11:08:28 2010 +0200
Automatic commit of package [osad] release [5.9.34-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 5f09511..dc4901d 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.33
+Version: 5.9.34
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -247,6 +247,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
# $Id$
%changelog
+* Tue May 04 2010 Jan Pazdziora 5.9.34-1
+- 575555 - address corecmd_exec_sbin deprecation warning.
+
* Tue May 04 2010 Jan Pazdziora 5.9.33-1
- 580047 - address AVCs about sqlnet.log when the database is down.
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index 0775396..a1dc89a 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.9.33-1 client/tools/osad/
+5.9.34-1 client/tools/osad/
13 years, 12 months
client/tools
by Jan Pazdziora
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te | 1 -
1 file changed, 1 deletion(-)
New commits:
commit ffa0917cee789470fd79ee7153e3768faea6efed
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 10:57:17 2010 +0200
575555 - remove corecmd_exec_sbin as we already have corecmd_exec_bin there.
Addressing
osa-dispatcher.te:34: Warning: corecmd_exec_sbin() has been deprecated, please use corecmd_exec_bin() instead.
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
index fc620f5..3cb9c6b 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
@@ -31,7 +31,6 @@ libs_use_shared_libs(osa_dispatcher_t)
miscfiles_read_localization(osa_dispatcher_t)
corecmd_exec_bin(osa_dispatcher_t)
-corecmd_exec_sbin(osa_dispatcher_t)
kernel_read_system_state(osa_dispatcher_t)
13 years, 12 months
Changes to 'refs/tags/osad-5.9.33-1'
by Jan Pazdziora
Tag 'osad-5.9.33-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-05-04 08:22 +0000
Tagging package [osad] version [5.9.33-1] in directory [client/tools/osad/].
Changes since spacewalk-backend-1.1.11-1:
Jan Pazdziora (5):
580047 - configure osa-dispatcher to put sqlnet.log to /var/log/rhn/oracle/osa-dispatcher.
580047 - label /var/log/rhn/oracle/osa-dispatcher as osa_dispatcher_log_t, so that osa-dispatcher can create sqlnet.logs there.
Silence semanage upon package upgrade.
No need to be extra verbose.
Automatic commit of package [osad] release [5.9.33-1].
Miroslav Suchý (1):
569946 - normalize solaris "x86" value to rhn known value
Partha Aji (2):
More changes to properly handle selection javascript magic
Updated the list tag to deal with parent vs child filtering
---
client/tools/osad/Makefile.defs | 6
client/tools/osad/Makefile.osad | 4
client/tools/osad/logrotate/osa-dispatcher | 14 +
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable | 6
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc | 1
client/tools/osad/osad.spec | 15 +
client/tools/osad/prog.init | 5
client/tools/osad/sysconfig/Makefile | 9 +
client/tools/osad/sysconfig/osa-dispatcher | 4
client/tools/osad/tns-admin-osa-dispatcher/Makefile | 10 +
client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora | 3
client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora | 1
client/tools/rhnpush/solaris2mpm.py | 2
java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java | 13 +
java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java | 76 ++++++++--
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java | 22 +-
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java | 60 ++++++-
java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java | 51 ++++--
java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java | 14 +
java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld | 22 ++
java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp | 7
rel-eng/packages/osad | 2
web/html/javascript/check_all.js | 49 +++++-
23 files changed, 320 insertions(+), 76 deletions(-)
---
13 years, 12 months
client/tools rel-eng/packages
by Jan Pazdziora
client/tools/osad/osad.spec | 5 ++++-
rel-eng/packages/osad | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit ec7628914b39627969dca1146eccb96c58f71ed8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 10:22:14 2010 +0200
Automatic commit of package [osad] release [5.9.33-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 141c22e..5f09511 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.32
+Version: 5.9.33
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -247,6 +247,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
# $Id$
%changelog
+* Tue May 04 2010 Jan Pazdziora 5.9.33-1
+- 580047 - address AVCs about sqlnet.log when the database is down.
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.32-1
- do not start osad by default
- require python-haslib only in RHEL5
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index 3373d11..0775396 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.9.32-1 client/tools/osad/
+5.9.33-1 client/tools/osad/
13 years, 12 months
4 commits - client/tools
by Jan Pazdziora
client/tools/osad/Makefile.defs | 6 ++--
client/tools/osad/Makefile.osad | 4 +-
client/tools/osad/logrotate/osa-dispatcher | 14 +++++++---
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable | 6 ++--
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc | 1
client/tools/osad/osad.spec | 10 +++++--
client/tools/osad/prog.init | 5 +++
client/tools/osad/sysconfig/Makefile | 9 ++++++
client/tools/osad/sysconfig/osa-dispatcher | 4 ++
client/tools/osad/tns-admin-osa-dispatcher/Makefile | 10 +++++++
client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora | 3 ++
client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora | 1
12 files changed, 62 insertions(+), 11 deletions(-)
New commits:
commit f0dbdc76ff853e1e57896999c9d9fa3db4c3c5c1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 09:47:47 2010 +0200
No need to be extra verbose.
This addresses the warning
Warning! /etc/rhn/tns_admin/osa-dispatcher/tnsnames.ora refers to a symbolic link, not following last component.
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
index b444e21..7628576 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
@@ -12,6 +12,6 @@ for selinuxvariant in mls strict targeted
| grep '^osa_dispatcher_upstream_notif_server_port_t\b.*\btcp\b.*\b1290\b' > /dev/null \
|| /usr/sbin/semanage port -a -t osa_dispatcher_upstream_notif_server_port_t -p tcp 1290
-rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
+rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 2935260..141c22e 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -168,7 +168,7 @@ fi
%posttrans -n osa-dispatcher-selinux
#this may be safely remove when BZ 505066 is fixed
if /usr/sbin/selinuxenabled ; then
- rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
+ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
fi
@@ -188,7 +188,7 @@ if [ $1 -eq 0 ]; then
done
fi
-rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
+rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
%endif
commit d3875dda3c49529843ec9a890359cf636f71040a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 09:46:09 2010 +0200
Silence semanage upon package upgrade.
We do not issue the semanage port -a if the port is already there, which
addresses the warning
/usr/sbin/semanage: Port tcp/1290 already defined
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
index dc2a01c..b444e21 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
@@ -8,7 +8,9 @@ for selinuxvariant in mls strict targeted
/usr/share/selinux/${selinuxvariant}/osa-dispatcher.pp || :
done
-/usr/sbin/semanage port -a -t osa_dispatcher_upstream_notif_server_port_t -p tcp 1290 || :
+/usr/sbin/semanage port -l \
+ | grep '^osa_dispatcher_upstream_notif_server_port_t\b.*\btcp\b.*\b1290\b' > /dev/null \
+ || /usr/sbin/semanage port -a -t osa_dispatcher_upstream_notif_server_port_t -p tcp 1290
rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
commit d9c9529015b0ae3705046cc318e238fd415484d6
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 08:52:39 2010 +0200
580047 - label /var/log/rhn/oracle/osa-dispatcher as osa_dispatcher_log_t, so that osa-dispatcher can create sqlnet.logs there.
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc
index 303ec7d..503b076 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc
@@ -1,3 +1,4 @@
/usr/sbin/osa-dispatcher gen_context(system_u:object_r:osa_dispatcher_exec_t,s0)
/var/log/rhn/osa-dispatcher\.log gen_context(system_u:object_r:osa_dispatcher_log_t,s0)
+/var/log/rhn/oracle/osa-dispatcher gen_context(system_u:object_r:osa_dispatcher_log_t,s0)
/var/run/osa-dispatcher\.pid gen_context(system_u:object_r:osa_dispatcher_var_run_t,s0)
commit 72755b7518ecde99364eb8726fca0d39f6b1fbb2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon May 3 17:05:33 2010 +0200
580047 - configure osa-dispatcher to put sqlnet.log to /var/log/rhn/oracle/osa-dispatcher.
diff --git a/client/tools/osad/Makefile.defs b/client/tools/osad/Makefile.defs
index 48605b7..5adc1c1 100644
--- a/client/tools/osad/Makefile.defs
+++ b/client/tools/osad/Makefile.defs
@@ -35,11 +35,13 @@ INSTALL_DEST ?= $(ROOT)/$(SUBDIR)
DIRS += $(addprefix $(PREFIX), \
$(sort $(EXTRA_DIRS)) $(INSTALL_DEST))
-all :: $(INSTALL_FILES)
+all :: $(INSTALL_FILES) $(INSTALL_LINKS)
-install :: all $(DIRS) $(INSTALL_FILES)
+install :: all $(DIRS) $(INSTALL_FILES) $(INSTALL_LINKS)
@$(foreach f,$(INSTALL_FILES), \
$(INSTALL_DATA) $(f) $(PREFIX)$(INSTALL_DEST)/$(f) ; )
+ @$(foreach f,$(INSTALL_LINKS), \
+ ln -s `echo $(f)` $(PREFIX)$(INSTALL_DEST)/$(f) ; )
$(DIRS):
$(INSTALL_DIR) $@
diff --git a/client/tools/osad/Makefile.osad b/client/tools/osad/Makefile.osad
index 2dcded3..f8424cd 100644
--- a/client/tools/osad/Makefile.osad
+++ b/client/tools/osad/Makefile.osad
@@ -7,11 +7,11 @@ VERSION = $(shell echo `awk '{ print $$1 }' version`)
RELEASE = $(shell echo `awk '{ print $$2 }' version`)
CODE_DIRS = src
-CONF_DIRS = rhn-conf osad-conf logrotate
+CONF_DIRS = rhn-conf osad-conf logrotate sysconfig tns-admin-osa-dispatcher
# We look for config files in "well known" locations (rhn-conf,
# httpd-conf, logrotate)
-EXTRA_DIRS = /var/log/rhn $(BINDIR) $(SBINDIR) $(INITDIR)
+EXTRA_DIRS = /var/log/rhn /var/log/rhn/oracle /var/log/rhn/oracle/osa-dispatcher $(BINDIR) $(SBINDIR) $(INITDIR)
BINDIR = /usr/bin
SBINDIR = /usr/sbin
INITDIR = /etc/rc.d/init.d
diff --git a/client/tools/osad/logrotate/osa-dispatcher b/client/tools/osad/logrotate/osa-dispatcher
index 2dac67e..d0b8be4 100644
--- a/client/tools/osad/logrotate/osa-dispatcher
+++ b/client/tools/osad/logrotate/osa-dispatcher
@@ -1,6 +1,4 @@
-# logrotation file for Red Hat Network Server
-#
-# $Id$
+# logrotation file for RHN Satellite's osa-dispatcher
/var/log/rhn/osa-dispatcher.log {
weekly
@@ -11,3 +9,13 @@
missingok
size 100M
}
+
+/var/log/rhn/oracle/osa-dispatcher/sqlnet.ora {
+ weekly
+ rotate 5
+ copytruncate
+ compress
+ notifempty
+ missingok
+ size 100M
+}
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 6834e7e..2935260 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -220,9 +220,15 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
%{rhnroot}/osad/osa_dispatcher.py*
%{rhnroot}/osad/dispatcher_client.py*
%{rhnroot}/osad/rhn_log.py*
+%config(noreplace) %{_sysconfdir}/sysconfig/osa-dispatcher
%config(noreplace) %{_sysconfdir}/logrotate.d/osa-dispatcher
%config %{_sysconfdir}/rhn/default/rhn_osa-dispatcher.conf
+%config %{_sysconfdir}/rhn/tns_admin/osa-dispatcher
+%config(noreplace) %{_sysconfdir}/rhn/tns_admin/osa-dispatcher/tnsnames.ora
+%config(noreplace) %{_sysconfdir}/rhn/tns_admin/osa-dispatcher/sqlnet.ora
%attr(755,root,root) %{_initrddir}/osa-dispatcher
+%attr(770,root,apache) %dir %{_var}/log/rhn/oracle
+%attr(770,root,root) %dir %{_var}/log/rhn/oracle/osa-dispatcher
%doc LICENSE
%doc PYTHON-LICENSES.txt
diff --git a/client/tools/osad/prog.init b/client/tools/osad/prog.init
index a214e2c..58db558 100755
--- a/client/tools/osad/prog.init
+++ b/client/tools/osad/prog.init
@@ -20,6 +20,11 @@
# Source networking configuration.
. /etc/sysconfig/network
+# Source prog-specific configuration
+if [ -f /etc/sysconfig/@@PROG@@ ]; then
+ . /etc/sysconfig/@@PROG@@
+fi
+
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
diff --git a/client/tools/osad/sysconfig/Makefile b/client/tools/osad/sysconfig/Makefile
new file mode 100644
index 0000000..5badc70
--- /dev/null
+++ b/client/tools/osad/sysconfig/Makefile
@@ -0,0 +1,9 @@
+# Makefile for installation of the RHN server configuration files
+
+# what is the backend top dir
+TOP = ..
+
+INSTALL_FILES = osa-dispatcher
+INSTALL_DEST = /etc/sysconfig
+
+include $(TOP)/Makefile.defs
diff --git a/client/tools/osad/sysconfig/osa-dispatcher b/client/tools/osad/sysconfig/osa-dispatcher
new file mode 100644
index 0000000..4347d64
--- /dev/null
+++ b/client/tools/osad/sysconfig/osa-dispatcher
@@ -0,0 +1,4 @@
+
+TNS_ADMIN=/etc/rhn/tns_admin/osa-dispatcher
+export TNS_ADMIN
+
diff --git a/client/tools/osad/tns-admin-osa-dispatcher/Makefile b/client/tools/osad/tns-admin-osa-dispatcher/Makefile
new file mode 100644
index 0000000..d88544b
--- /dev/null
+++ b/client/tools/osad/tns-admin-osa-dispatcher/Makefile
@@ -0,0 +1,10 @@
+# Makefile for installation of the RHN server configuration files
+
+# what is the backend top dir
+TOP = ..
+
+INSTALL_FILES = sqlnet.ora
+INSTALL_LINKS = tnsnames.ora
+INSTALL_DEST = /etc/rhn/tns_admin/osa-dispatcher
+
+include $(TOP)/Makefile.defs
diff --git a/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora b/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
new file mode 100644
index 0000000..13206ad
--- /dev/null
+++ b/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
@@ -0,0 +1,3 @@
+
+log_directory_client = /var/log/rhn/oracle/osa-dispatcher
+
diff --git a/client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora b/client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora
new file mode 100644
index 0000000..7c467fe
--- /dev/null
+++ b/client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora
@@ -0,0 +1 @@
+/etc/tnsnames.ora
13 years, 12 months
java/code
by Partha Aji
java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java | 20 +++++++--
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java | 22 ++++++----
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java | 22 +++++++++-
java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld | 11 ++++-
java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp | 4 +
5 files changed, 65 insertions(+), 14 deletions(-)
New commits:
commit aa08c95f9340b930c7f0c52bfb6a403b97708af8
Author: Partha Aji <paji(a)redhat.com>
Date: Mon May 3 18:47:21 2010 -0400
Updated the list tag to deal with parent vs child filtering
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
index d5a7676..90ce809 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
@@ -62,6 +62,9 @@ public class DataSetManipulator {
private int unfilteredDataSize;
private boolean parentIsAnElement;
+ private boolean searchParent;
+ private boolean searchChild;
+
private String defaultSortAttribute;
private static final String IMG_FIRST = "/img/list-allbackward.gif";
private static final String IMG_FIRST_UNFOCUSED =
@@ -90,9 +93,15 @@ public class DataSetManipulator {
* @param parentIsElement true of the parent value
* in the list should be considered as an element
* this is useful for tree like data
+ * @param doSearchParent true if we want to search the parent value
+ * in the list when filtering.
+ * @param doSearchChild true if we want to search the child value
+ * in the list when filtering.
*/
public DataSetManipulator(int pageSizeIn, List datasetIn,
- HttpServletRequest requestIn, String listNameIn, boolean parentIsElement) {
+ HttpServletRequest requestIn, String listNameIn,
+ boolean parentIsElement, boolean doSearchParent,
+ boolean doSearchChild) {
pageSize = pageSizeIn;
dataset = datasetIn;
request = requestIn;
@@ -100,6 +109,8 @@ public class DataSetManipulator {
totalDataSetSize = dataset.size();
unfilteredDataSize = dataset.size();
parentIsAnElement = parentIsElement;
+ searchParent = doSearchParent;
+ searchChild = doSearchChild;
}
private List expand(List data) {
@@ -109,9 +120,9 @@ public class DataSetManipulator {
if (obj instanceof Expandable) {
Expandable ex = (Expandable) obj;
List children = ex.expand();
- if (filter != null) {
+ if (searchChild && filter != null) {
expanded.addAll(ListFilterHelper.filter(children,
- filter, filterBy, filterValue));
+ filter, filterBy, filterValue, searchParent, searchChild));
}
else {
expanded.addAll(children);
@@ -410,7 +421,8 @@ public class DataSetManipulator {
filterClass.setAttribute("value", f.getClass().getCanonicalName());
ListTagUtil.write(context, filterClass.render());
- dataset = ListFilterHelper.filter(dataset, f, filterBy, filterValue);
+ dataset = ListFilterHelper.filter(dataset, f, filterBy, filterValue,
+ searchParent, searchChild);
totalDataSetSize = dataset.size();
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
index 8c2d41a..6efb977 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
@@ -39,10 +39,14 @@ public class ListFilterHelper {
* @param filter the filter to use
* @param filterBy which value to filter by in the bean
* @param filterValue the value to filter on
+ * @param searchParent true if we want to search the parent value
+ * in the list when filtering.
+ * @param searchChild true if we want to search the child value
+ * in the list when filtering.
* @return the filtered list
*/
public static List filter(List dataSet, ListFilter filter, String filterBy,
- String filterValue) {
+ String filterValue, boolean searchParent, boolean searchChild) {
String tmp = null;
try {
tmp = URLDecoder.decode(filterBy, "UTF-8");
@@ -74,14 +78,18 @@ public class ListFilterHelper {
Expandable parent = null;
for (Object object : dataSet) {
if (object instanceof Expandable) {
- parent = (Expandable) object;
- for (Object child : parent.expand()) {
- if (filter.filter(child, filterBy, filterValue)) {
- filteredData.add(parent);
- break;
+ if (searchParent && filter.filter(object, filterBy, filterValue)) {
+ filteredData.add(object);
+ }
+ if (searchChild) {
+ parent = (Expandable) object;
+ for (Object child : parent.expand()) {
+ if (filter.filter(child, filterBy, filterValue)) {
+ filteredData.add(parent);
+ break;
+ }
}
}
-
}
else if (filter.filter(object, filterBy, filterValue)) {
filteredData.add(object);
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
index 6c5a265..670d50c 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
@@ -84,7 +84,25 @@ public class ListTag extends BodyTagSupport {
private String title;
private boolean sortable;
private boolean parentIsElement;
+ private boolean searchParent = true;
+ private boolean searchChild;
+
+ /**
+ * @param searchParentIn The searchParent to set.
+ */
+ public void setSearchparent(String searchParentIn) {
+ searchParent = ListTagUtil.toBoolean(searchParentIn);
+ }
+
+
+ /**
+ * @param searchChildIn The searchChild to set.
+ */
+ public void setSearchchild(String searchChildIn) {
+ searchChild = ListTagUtil.toBoolean(searchChildIn);
+ }
+
/**
* method to let the list tag know
* that atleast one of its columns
@@ -587,7 +605,7 @@ public class ListTag extends BodyTagSupport {
setPageSize();
manip = new DataSetManipulator(pageSize, pageData,
(HttpServletRequest) pageContext.getRequest(),
- getUniqueName(), isParentAnElement());
+ getUniqueName(), isParentAnElement(), searchParent, searchChild);
int retval = BodyTagSupport.EVAL_BODY_INCLUDE;
emitId();
@@ -678,6 +696,8 @@ public class ListTag extends BodyTagSupport {
title = null;
sortable = false;
parentIsElement = true;
+ searchParent = true;
+ searchChild = false;
super.release();
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
index 16abb68..d4b31a2 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
@@ -91,7 +91,16 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
-
+ <attribute>
+ <name>searchparent</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>searchchild</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
<attribute>
<name>reflink</name>
<required>false</required>
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index 1c4fa92..7ac9b2f 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -23,6 +23,8 @@
<rl:list
emptykey="nosystems.message"
parentiselement = "false"
+ searchparent="true"
+ searchchild="false"
>
<rl:rowrenderer name="ExpandableRowRenderer" />
@@ -44,7 +46,7 @@
<!-- Name Column -->
- <rl:column headerkey="systemlist.jsp.system" filterattr="id">
+ <rl:column headerkey="systemlist.jsp.system" filterattr="key">
<rl:expandable rendericon="true">${current.key} <em>(${rl:countChildren(current)} systems)</em> </rl:expandable>
<rl:non-expandable rendericon="true">${current.id}</rl:non-expandable>
13 years, 12 months
java/code web/html
by Partha Aji
java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java | 13 ++
java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java | 58 ++++++++--
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java | 40 ++++--
java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java | 51 ++++++--
java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java | 14 +-
java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld | 13 ++
java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp | 3
web/html/javascript/check_all.js | 49 ++++++--
8 files changed, 190 insertions(+), 51 deletions(-)
New commits:
commit 52415e8c5f658e744d23ea2d13c24180cb5be4e8
Author: Partha Aji <paji(a)redhat.com>
Date: Mon May 3 18:17:23 2010 -0400
More changes to properly handle selection javascript magic
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java b/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java
index 08fcd7a..d743e2c 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java
@@ -36,4 +36,17 @@ public class RhnListTagFunctions {
public static boolean isExpandable(Object current) {
return current instanceof Expandable;
}
+
+ /**
+ * Quick check to see if the passed in object is expandable.
+ *
+ * @param current The object to be checked
+ * @return true if the current object is expandable
+ */
+ public static int getChildrenCount(Object current) {
+ if (!isExpandable(current)) {
+ return 0;
+ }
+ return ((Expandable)current).expand().size();
+ }
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
index cb7c1f7..d5a7676 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
@@ -15,6 +15,7 @@
package com.redhat.rhn.frontend.taglibs.list;
+import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.util.DynamicComparator;
import com.redhat.rhn.common.util.MethodUtil;
import com.redhat.rhn.common.util.StringUtil;
@@ -59,6 +60,7 @@ public class DataSetManipulator {
private int alphaPosition = -1;
private boolean ascending = true;
private int unfilteredDataSize;
+ private boolean parentIsAnElement;
private String defaultSortAttribute;
private static final String IMG_FIRST = "/img/list-allbackward.gif";
@@ -85,15 +87,19 @@ public class DataSetManipulator {
* @param datasetIn dataset to be displayed
* @param requestIn HttpServletRequest of the caller
* @param listNameIn name of the list
+ * @param parentIsElement true of the parent value
+ * in the list should be considered as an element
+ * this is useful for tree like data
*/
public DataSetManipulator(int pageSizeIn, List datasetIn,
- HttpServletRequest requestIn, String listNameIn) {
+ HttpServletRequest requestIn, String listNameIn, boolean parentIsElement) {
pageSize = pageSizeIn;
dataset = datasetIn;
request = requestIn;
uniqueName = listNameIn;
totalDataSetSize = dataset.size();
unfilteredDataSize = dataset.size();
+ parentIsAnElement = parentIsElement;
}
private List expand(List data) {
@@ -163,7 +169,7 @@ public class DataSetManipulator {
* Returns the starting element index for a page (1 based)
* @return int
*/
- public int getPageStartIndex() {
+ private int getPageStartIndex() {
//no data ==> no start index...
if (getTotalDataSetSize() == 0) {
return 0;
@@ -174,30 +180,64 @@ public class DataSetManipulator {
if (startOffset < 0) {
startOffset = 0;
}
- return startOffset + 1;
+ List parentList = dataset.subList(0, startOffset);
+ List data = expand(parentList);
+ int ret = data.size() + 1;
+
+ if (!parentIsAnElement) {
+ ret = ret - parentList.size();
+ }
+ return ret;
}
/**
* Returns the ending element index for a page (1 based)
* @return int
*/
- public int getPageEndIndex() {
+ private int getPageEndIndex() {
int startOffset = getCurrentPageNumber() * pageSize;
if (startOffset < 0) {
startOffset = 0;
}
+
int endOffset = startOffset + pageSize;
if (endOffset > dataset.size()) {
endOffset = dataset.size();
}
- return endOffset;
+ List parentList = dataset.subList(0, endOffset);
+ List data = expand(parentList);
+
+ if (!parentIsAnElement) {
+ return data.size() - parentList.size();
+ }
+
+ return data.size();
+ }
+
+ private int getExpandedDataSize() {
+ if (!parentIsAnElement) {
+ return expand(dataset).size() - dataset.size();
+ }
+ return expand(dataset).size();
}
/**
+ * Returns the pagination message (1 - 2 of 3 for example)
+ * @return the pagination message
+ */
+ public String getPaginationMessage() {
+ LocalizationService ls = LocalizationService.getInstance();
+ return ls.getMessage("message.range", getPageStartIndex(),
+ getPageEndIndex(), getExpandedDataSize());
+
+ }
+
+
+ /**
* Determines the current page number based on URL params
* @return current page number
*/
- public int getCurrentPageNumber() {
+ private int getCurrentPageNumber() {
if (AlphaBarHelper.getInstance().isSelected(uniqueName, request)) {
int pos = findAlphaPosition();
@@ -240,6 +280,12 @@ public class DataSetManipulator {
}
/**
+ * Binds information pertaining to pagination to the request
+ */
+ public void bindPaginationInfo() {
+ request.setAttribute("pageNum", String.valueOf(getCurrentPageNumber()));
+ }
+ /**
* Returns the pagination param (|<, <, >, >|) that was selected
* returns null if no pagination action was selected.
* @param request the http servlet request
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
index 8488e2a..6c5a265 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
@@ -83,6 +83,7 @@ public class ListTag extends BodyTagSupport {
private String refLinkKeyArg0;
private String title;
private boolean sortable;
+ private boolean parentIsElement;
/**
* method to let the list tag know
@@ -478,8 +479,7 @@ public class ListTag extends BodyTagSupport {
startTable();
HttpServletRequest request = (HttpServletRequest) pageContext
.getRequest();
- request.setAttribute("pageNum", String.valueOf(manip
- .getCurrentPageNumber()));
+ manip.bindPaginationInfo();
request.setAttribute("dataSize", String
.valueOf(pageData.size() + 1));
ListTagUtil.setCurrentCommand(pageContext, getUniqueName(),
@@ -586,7 +586,8 @@ public class ListTag extends BodyTagSupport {
setupPageData();
setPageSize();
manip = new DataSetManipulator(pageSize, pageData,
- (HttpServletRequest) pageContext.getRequest(), getUniqueName());
+ (HttpServletRequest) pageContext.getRequest(),
+ getUniqueName(), isParentAnElement());
int retval = BodyTagSupport.EVAL_BODY_INCLUDE;
emitId();
@@ -676,7 +677,7 @@ public class ListTag extends BodyTagSupport {
decoratorName = null;
title = null;
sortable = false;
-
+ parentIsElement = true;
super.release();
}
@@ -788,13 +789,7 @@ public class ListTag extends BodyTagSupport {
ListTagUtil.write(pageContext,
"<td valign=\"middle\" class=\"list-infotext\">");
if (!isEmpty() && !hidePageNums) {
- Object[] range = new Integer[3];
- range[0] = new Integer(manip.getPageStartIndex());
- range[1] = new Integer(manip.getPageEndIndex());
- range[2] = new Integer(manip.getTotalDataSetSize());
- LocalizationService ls = LocalizationService.getInstance();
- String msg = ls.getMessage("message.range", range);
- ListTagUtil.write(pageContext, msg);
+ ListTagUtil.write(pageContext, manip.getPaginationMessage());
}
if (!manip.isListEmpty()) {
@@ -919,12 +914,29 @@ public class ListTag extends BodyTagSupport {
* @param value true or false
*/
public void setHidepagenums(String value) {
- if (value.equals("true") || value.equals("True")) {
- hidePageNums = true;
- }
+ hidePageNums = ListTagUtil.toBoolean(value);
}
/**
+ * if set to true, the parent in a tree setup will
+ * be considered as an element by itself
+ * @param value true or false
+ */
+ public void setParentiselement(String value) {
+ parentIsElement = ListTagUtil.toBoolean(value);
+ }
+
+ /**
+ * if set to true, the parent in a tree setup will
+ * be considered as an element by itself
+ * @return true if the parent itself is an element
+ */
+ public boolean isParentAnElement() {
+ return parentIsElement;
+ }
+
+
+ /**
*
* @return CSS ID for <table>
*/
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
index 7cb860d..ac05db5 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
@@ -34,7 +34,8 @@ public class SelectableColumnTag extends TagSupport {
private static final long serialVersionUID = 2749189931275777440L;
private static final String CHECKBOX_CLICKED_SCRIPT =
- "process_checkbox_clicked(this,'%s', this.form.%s, %s, %s, '%s')";
+ "process_checkbox_clicked(this,'%s', this.form.%s, %s, %s, '%s', %s)";
+ private static final String CHECK_ALL_SCRIPT = "process_check_all('%s', %s, %s, %s)";
private String valueExpr;
private String selectExpr;
private String disabledExpr;
@@ -188,19 +189,14 @@ public class SelectableColumnTag extends TagSupport {
ListTagUtil.write(pageContext, " name=\"");
ListTagUtil.write(pageContext, makeSelectAllCheckboxName());
ListTagUtil.write(pageContext, "\" ");
- ListTagUtil.write(pageContext, "onclick=\"");
- ListTagUtil.write(pageContext, "process_check_all(");
- ListTagUtil.write(pageContext, "'");
-
- if (rhnSet != null) {
- ListTagUtil.write(pageContext, rhnSet);
- }
- ListTagUtil.write(pageContext, "', ");
- ListTagUtil.write(pageContext, "this.form." +
- ListTagUtil.makeSelectedItemsName(listName));
- ListTagUtil.write(pageContext, ", this.checked)");
-
- ListTagUtil.write(pageContext, "\" />");
+ ListTagUtil.write(pageContext, "onclick=\"");
+ String script = String.format(CHECK_ALL_SCRIPT,
+ StringUtils.defaultString(rhnSet),
+ "this.form." + ListTagUtil.
+ makeSelectedItemsName(listName), "this.checked",
+ getIgnorableParentIds());
+ ListTagUtil.write(pageContext, script);
+ ListTagUtil.write(pageContext, "\" />");
}
private void renderCheckbox() throws JspException {
render(valueExpr);
@@ -249,6 +245,8 @@ public class SelectableColumnTag extends TagSupport {
String childIds = "[]";
String memberIds = "[]";
String parentId = "";
+ ListTag parentTag = (ListTag)
+ BodyTagSupport.findAncestorWithClass(this, ListTag.class);
if (RhnListTagFunctions.isExpandable(current)) {
childIds = getChildIds(current);
@@ -261,7 +259,8 @@ public class SelectableColumnTag extends TagSupport {
ListTagUtil.write(pageContext, " onclick=\"");
ListTagUtil.write(pageContext, String.format(CHECKBOX_CLICKED_SCRIPT,
rhnSet, makeSelectAllCheckboxName(),
- childIds, memberIds, parentId));
+ childIds, memberIds, parentId,
+ parentTag.isParentAnElement()));
ListTagUtil.write(pageContext, "\" ");
}
}
@@ -362,5 +361,27 @@ public class SelectableColumnTag extends TagSupport {
ListTag parent = (ListTag)
BodyTagSupport.findAncestorWithClass(this, ListTag.class);
return parent.getParentObject();
+ }
+
+ private String getIgnorableParentIds() {
+ ListTag parent = (ListTag)
+ BodyTagSupport.findAncestorWithClass(this, ListTag.class);
+ if (!parent.isParentAnElement()) {
+ StringBuilder buf = new StringBuilder();
+ for (Object current : parent.getPageData()) {
+ if (RhnListTagFunctions.isExpandable(current)) {
+ if (buf.length() > 0) {
+ buf.append(",");
+ }
+ buf.append("'");
+ buf.append(makeCheckboxId(ListTagHelper.getObjectId(current)));
+ buf.append("'");
+ }
+ }
+ buf.insert(0, "[");
+ buf.append("]");
+ return buf.toString();
+ }
+ return "[]";
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
index 3198608..fa413b9 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
@@ -33,7 +33,7 @@ public class ExpansionDecorator extends BaseListDecorator {
"style=\"cursor: pointer;\">Hide All</a>";
private static final String NEW_VAR_SCRIPT = "<script type=\"text/javascript\">var " +
- "rowHash%s = new Array();</script>";
+ "rowHash%s = new Array();</script>";
private static final String LOAD_SCRIPT = "<script type=\"text/javascript\">" +
"onLoadStuff(%s, '%s', rowHash%s);</script>";
@@ -44,8 +44,16 @@ public class ExpansionDecorator extends BaseListDecorator {
@Override
public void beforeList() throws JspException {
ListTagUtil.write(pageContext, String.format(NEW_VAR_SCRIPT, listName));
- ListTagUtil.write(pageContext, String.format(SHOW_ALL_SCRIPT, listName, listName));
-
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void beforeTopPagination() throws JspException {
+ ListTagUtil.write(pageContext, String.format(SHOW_ALL_SCRIPT,
+ listName, listName));
}
/**
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
index bc6ec20..16abb68 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
@@ -86,6 +86,12 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
+ <attribute>
+ <name>parentiselement</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+
<attribute>
<name>reflink</name>
<required>false</required>
@@ -311,5 +317,10 @@
<name>expandable</name>
<function-class>com.redhat.rhn.frontend.taglibs.RhnListTagFunctions</function-class>
<function-signature>boolean isExpandable(java.lang.Object)</function-signature>
- </function>
+ </function>
+ <function>
+ <name>countChildren</name>
+ <function-class>com.redhat.rhn.frontend.taglibs.RhnListTagFunctions</function-class>
+ <function-signature>int getChildrenCount(java.lang.Object)</function-signature>
+ </function>
</taglib>
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index 50addb4..1c4fa92 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -22,6 +22,7 @@
<rl:listset name="DupesListSet" legend="system">
<rl:list
emptykey="nosystems.message"
+ parentiselement = "false"
>
<rl:rowrenderer name="ExpandableRowRenderer" />
@@ -44,7 +45,7 @@
<!-- Name Column -->
<rl:column headerkey="systemlist.jsp.system" filterattr="id">
- <rl:expandable rendericon="true">${current.key}</rl:expandable>
+ <rl:expandable rendericon="true">${current.key} <em>(${rl:countChildren(current)} systems)</em> </rl:expandable>
<rl:non-expandable rendericon="true">${current.id}</rl:non-expandable>
</rl:column>
diff --git a/web/html/javascript/check_all.js b/web/html/javascript/check_all.js
index b5331b1..b422c0a 100644
--- a/web/html/javascript/check_all.js
+++ b/web/html/javascript/check_all.js
@@ -25,13 +25,37 @@ function check_all_on_page(form, set_label) {
}
var flag = eval("document.forms['" + form_name + "'].checkall.checked");
var cboxes = eval("document.forms['" + form_name + "'].items_selected");
- process_check_all(set_label, cboxes, flag);
+ process_check_all(set_label, cboxes, flag, []);
}
-function process_check_all(set_label, cboxes, flag) {
- update_server_set("ids", set_label, flag, process_group(set_label, cboxes, flag));
+function process_check_all(set_label, cboxes, flag, ignorables_ids) {
+ var boxes = process_group(set_label, cboxes, flag);
+ var ignorables = ids_to_elements(ignorables_ids);
+ var includes = new Array();
+ for (var i = 0; i < boxes.length; i++) {
+ var include = true;
+ for (var j = 0; j < ignorables.length; j++) {
+ if (ignorables[j].value == boxes[i]) {
+ include = false;
+ break;
+ }
+ }
+ if (include) {
+ includes.push(boxes[i]);
+ }
+ }
+ update_server_set("ids", set_label, flag, includes);
+}
+
+function ids_to_elements(elem_ids) {
+ var elements = new Array();
+ for (var i = 0; i < elem_ids.length; i++) {
+ elements.push(document.getElementById(elem_ids[i]));
+ }
+ return elements;
}
+
function process_group(set_label, cboxes, flag) {
var i;
var changed = new Array();
@@ -62,7 +86,7 @@ function checkbox_clicked(thebox, set_label) {
form_name = thebox.form.id;
}
var checkall = eval("document.forms['" + form_name + "'].checkall");
- process_checkbox_clicked(thebox, set_label, checkall, [], [],"");
+ process_checkbox_clicked(thebox, set_label, checkall, [], [],"", true);
}
@@ -79,9 +103,16 @@ function checkbox_clicked(thebox, set_label) {
* parent_id - if this is a child node then list the parent_id or [] otherwise
**/
-function process_checkbox_clicked(thebox, set_label, checkall, children, members, parent_id ) {
+function process_checkbox_clicked(thebox, set_label, checkall, children, members, parent_id, parentIsElement) {
var a = new Array();
- a.push(thebox.value);
+ if (parent_id == '') {
+ if(parentIsElement) {
+ a.push(thebox.value);
+ }
+ }
+ else {
+ a.push(thebox.value);
+ }
var checkboxes = new Array();
for (var i = 0; i < children.length; i++) {
@@ -95,11 +126,7 @@ function process_checkbox_clicked(thebox, set_label, checkall, children, members
if (parent_id) {
var parentBox = document.getElementById(parent_id);
- var boxes = new Array();
- for (var i = 0; i < members.length; i++) {
- var checkbox = document.getElementById(members[i]);
- boxes.push(checkbox);
- }
+ var boxes = ids_to_elements(members) ;
process_single_checkbox(boxes, parentBox);
}
var form_name = thebox.form.name;
13 years, 12 months
client/tools
by Miroslav Suchý
client/tools/rhnpush/solaris2mpm.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit d71dab20e42b8794c037d89578a9170597bf7095
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon May 3 13:55:43 2010 +0200
569946 - normalize solaris "x86" value to rhn known value
diff --git a/client/tools/rhnpush/solaris2mpm.py b/client/tools/rhnpush/solaris2mpm.py
index 77b4cef..18df915 100644
--- a/client/tools/rhnpush/solaris2mpm.py
+++ b/client/tools/rhnpush/solaris2mpm.py
@@ -968,7 +968,7 @@ def _normalize_arch(arch):
arch = "sparc"
# fix the arch label
- if arch in ("intel", "i86pc", "i386.i86pc", "i386 i386.i86pc"):
+ if arch in ("intel", "i86pc", "i386.i86pc", "i386 i386.i86pc", "x86"):
arch = "i386"
elif re.match(".*sun4.*", arch, re.IGNORECASE):
13 years, 12 months