summaryrefslogtreecommitdiff
path: root/webapps/swat/source/class
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-01-31 17:57:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:29 -0500
commit0a4617bd9f972d04643d695e99f1bb49d6207ba3 (patch)
treecc2a7bc8069982a724cbadde0555a6ac536b7733 /webapps/swat/source/class
parent18732ba952c576c890e2fa79f9e164ae51dd320a (diff)
downloadsamba-0a4617bd9f972d04643d695e99f1bb49d6207ba3.tar.gz
samba-0a4617bd9f972d04643d695e99f1bb49d6207ba3.tar.bz2
samba-0a4617bd9f972d04643d695e99f1bb49d6207ba3.zip
r21095: Expose all naming contexts
(This used to be commit d25e828dbe479347894b197c94199c5540ac34e5)
Diffstat (limited to 'webapps/swat/source/class')
-rw-r--r--webapps/swat/source/class/swat/module/ldbbrowse/Fsm.js4
-rw-r--r--webapps/swat/source/class/swat/module/ldbbrowse/Gui.js72
2 files changed, 53 insertions, 23 deletions
diff --git a/webapps/swat/source/class/swat/module/ldbbrowse/Fsm.js b/webapps/swat/source/class/swat/module/ldbbrowse/Fsm.js
index 6d436f4aa7..b28a3eb168 100644
--- a/webapps/swat/source/class/swat/module/ldbbrowse/Fsm.js
+++ b/webapps/swat/source/class/swat/module/ldbbrowse/Fsm.js
@@ -78,7 +78,7 @@ qx.Proto.buildFsm = function(module)
"events" :
{
- // If the search button is activated, issue a seacrh request
+ // If the search button is activated, issue a search request
"execute" :
{
"search" :
@@ -200,7 +200,7 @@ qx.Proto.buildFsm = function(module)
if (parent == tree)
{
// ... then we want the defaultNamingContext, ...
- attributes = [ "defaultNamingContext" ];
+ attributes = [ "defaultNamingContext", "namingContexts" ];
// ... and we want only base scope
scope = "base";
diff --git a/webapps/swat/source/class/swat/module/ldbbrowse/Gui.js b/webapps/swat/source/class/swat/module/ldbbrowse/Gui.js
index 3f9cda0053..38f8314bb4 100644
--- a/webapps/swat/source/class/swat/module/ldbbrowse/Gui.js
+++ b/webapps/swat/source/class/swat/module/ldbbrowse/Gui.js
@@ -510,33 +510,63 @@ qx.Proto._displayTreeOpenResults = function(module, rpcRequest)
return;
}
- for (var i = 0; i < result.length; i++)
- {
- var name;
-
- child = result[i];
+ // base object, add naming contexts to the root
+ if ((result.length == 1) &&
+ ((result[0]["dn"] == "") ||
+ (result[0]["dn"].toLowerCase() == "cn=rootdse"))) {
+
+ defnc = result[0]["defaultNamingContext"];
+
+ // Build a tree row for the defaultNamingContext
+ if (defnc) {
+ trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(defnc);
+ // This row is a "folder" (it can have children)
+ t = new qx.ui.treefullcontrol.TreeFolder(trs);
+ t.setAlwaysShowPlusMinusSymbol(true);
+
+ // Add this row to its parent
+ parent.add(t);
+ }
- // Determine name for new tree row. If first level, use entire
- // DN. Otherwise, strip off first additional component.
- if (attributes == "defaultNamingContext")
- {
- name = child["defaultNamingContext"];
+ var ncs = result[0]["namingContexts"];
+
+ // If it's multi-valued (type is an array) we have other naming contexts to show
+ if (typeof(ncs) == "object") {
+
+ for (var i = 0; i < ncs.length; i++) {
+ if (ncs[i] != defnc) { //skip default naming context
+ trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(ncs[i]);
+ // This row is a "folder" (it can have children)
+ t = new qx.ui.treefullcontrol.TreeFolder(trs);
+ t.setAlwaysShowPlusMinusSymbol(true);
+
+ // Add this row to its parent
+ parent.add(t);
+ }
+ }
}
- else
+ }
+ else {
+
+ for (var i = 0; i < result.length; i++)
{
- //FIXME: must check for escapes, as ',' is also a valid value, not only a separator
+ var name;
+
+ child = result[i];
+
name = child["dn"].split(",")[0];
+
+ // Build a standard tree row
+ trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(name);
+
+ // This row is a "folder" (it can have children)
+ t = new qx.ui.treefullcontrol.TreeFolder(trs);
+ t.setAlwaysShowPlusMinusSymbol(true);
+
+ // Add this row to its parent
+ parent.add(t);
}
- // Build a standard tree row
- trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(name);
-
- // This row is a "folder" (it can have children)
- t = new qx.ui.treefullcontrol.TreeFolder(trs);
- t.setAlwaysShowPlusMinusSymbol(true);
-
- // Add this row to its parent
- parent.add(t);
}
};