svn commit: samba r19406 - in branches/SAMBA_4_0/swat/apps: resource/css samba/utils script

derrell at samba.org derrell at samba.org
Thu Oct 19 01:11:00 GMT 2006


Author: derrell
Date: 2006-10-19 01:10:57 +0000 (Thu, 19 Oct 2006)
New Revision: 19406

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19406

Log:
ldbbrowse: done!

With ldbbrowse, you can issue searches or browse the database in tree format.
To try it, ensure that "make installswat" is done (it's run by "make install"
so you shouldn't have to do anything special).  Run smbd and connect with your
browser to http://localhost:901/apps/samba/utils/ldbbrowse.html

(It looks great in firefox.  There's some problem with the layout in IE.
Maybe if I get really really motivated one of these days, I'll look into that.)

There's lots more that could be done with it, but as an example of using
qooxdoo and JSON-RPC, I think it accomplishes its task.

Enjoy!

Derrell

Added:
   branches/SAMBA_4_0/swat/apps/resource/css/layout-samba.css
   branches/SAMBA_4_0/swat/apps/resource/css/layout-samba_ie.css
   branches/SAMBA_4_0/swat/apps/script/layout-samba.js
Modified:
   branches/SAMBA_4_0/swat/apps/samba/utils/ldbbrowse.html


Changeset:
Added: branches/SAMBA_4_0/swat/apps/resource/css/layout-samba.css
===================================================================
--- branches/SAMBA_4_0/swat/apps/resource/css/layout-samba.css	2006-10-19 00:59:33 UTC (rev 19405)
+++ branches/SAMBA_4_0/swat/apps/resource/css/layout-samba.css	2006-10-19 01:10:57 UTC (rev 19406)
@@ -0,0 +1,116 @@
+body{
+  font-size: 11px;
+  font-family: Arial, "Bitstream Vera Sans", Verdana, sans-serif;
+  margin: 0;
+  padding: 0;
+}
+
+p{
+  margin: 6px 0;
+}
+
+#demoHead,
+#demoFoot{
+  position: absolute;
+  left: 0px;
+  right: 0px;
+  width: 100%;
+  background: #3878cd;
+  padding: 3px 8px;
+  height: 20px;
+  color: white;
+  font-weight: bold;
+  overflow: hidden;
+  z-index: 1000000000;
+}
+
+#demoHead{
+  top: 0px;
+  height: 80px;
+}
+
+#demoHead span{
+  font-weight: normal;
+}
+
+#demoFoot{
+  bottom: 0px;
+}
+
+#demoFoot a{
+  color: white;
+}
+
+#demoFrame{
+  position: absolute;
+  top: 20px;
+  bottom: 20px;
+  right: 0;
+  width: 280px;
+  background: #fff;
+  border-left: 10px solid #3878cd;
+  z-index: 1000000000;
+}
+
+#demoDebug{
+  position: absolute;
+  top: 104px;
+  bottom: 24px;
+  right: 4px;
+  width: 266px;
+  font-size: 10px;
+  font-family: "Bitstream Vera Sans Mono", "Courier New", "Courier", monospace;
+  z-index: 1000000102;
+}
+
+#demoDebug .log-body{
+  overflow: auto;
+  position: absolute;
+  top: 30px;
+  bottom: 0px;
+  width: 266px;
+  padding: 4px;
+}
+
+#demoDebug .log-debug{
+  color: gray;
+  padding-left: 6px;
+}
+
+#demoDebug .log-info{
+  background: #DFEBFD;
+  padding-left: 6px;
+}
+
+#demoDebug .log-warn{
+  background: #F5FAAD;
+  padding-left: 6px;
+}
+
+#demoDebug .log-error{
+  background: #D2623E;
+  color: black;
+  padding-left: 6px;
+}
+
+#demoDebug .log-group{
+  margin-top: 4px;
+  margin-bottom: 1px;
+  text-decoration: underline;
+}
+
+#demoDebug .log-head{
+  padding: 8px 2px 4px;
+}
+
+#demoDebug .log-head button{
+  border: 1px solid #335EA8;
+  margin: 0 2px;
+  font-size: 11px;
+  background: #EBE9ED;
+  font-family: Tahoma, Verdana, sans-serif;
+}
+
+#demoDebug .log-head button{
+  visibility: visible;
+}

Added: branches/SAMBA_4_0/swat/apps/resource/css/layout-samba_ie.css
===================================================================
--- branches/SAMBA_4_0/swat/apps/resource/css/layout-samba_ie.css	2006-10-19 00:59:33 UTC (rev 19405)
+++ branches/SAMBA_4_0/swat/apps/resource/css/layout-samba_ie.css	2006-10-19 01:10:57 UTC (rev 19406)
@@ -0,0 +1,11 @@
+#demoFrame{
+  height: expression(document.body.offsetHeight - 40);
+}
+
+#demoDebug{
+  height: expression(document.body.offsetHeight - 184);
+}
+
+#demoDebug .log-body{
+  height: expression(document.body.offsetHeight - 214);
+}

Modified: branches/SAMBA_4_0/swat/apps/samba/utils/ldbbrowse.html
===================================================================
--- branches/SAMBA_4_0/swat/apps/samba/utils/ldbbrowse.html	2006-10-19 00:59:33 UTC (rev 19405)
+++ branches/SAMBA_4_0/swat/apps/samba/utils/ldbbrowse.html	2006-10-19 01:10:57 UTC (rev 19406)
@@ -1,22 +1,24 @@
 <html>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <title>qooxdoo &raquo; Demo</title>
-  <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
+  <title>ldbbrowse</title>
+  <link type="text/css" rel="stylesheet" href="../../resource/css/layout-samba.css"/>
   <!--[if IE]>
   <link
-   type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
+   type="text/css" rel="stylesheet" href="../../resource/css/layout-samba_ie.css"/>
   <![endif]-->
   <script type="text/javascript" src="../../script/qx.js"></script>
 </head>
 <body>
-  <script type="text/javascript" src="../../script/layout.js"></script>
+  <script type="text/javascript" src="../../script/layout-samba.js"></script>
 
+<div style="position: absolute; background-color: transparent; right:0; top:0; z-index: 1000000001;">
+     <img src="../../../images/logo.png">
+</div>
+<div id="demoHead">
+     ldbbrowse
+</div>
 
-  <div id="demoDescription">
-    <p>
-    A simple LDB browser.
-  </div>
 
 <script type="text/javascript">
 
@@ -24,6 +26,9 @@
 // object
 globals = new Object();
 
+// Name of database to use
+globals.dbFile = "sam.ldb";
+
 // No database is yet open
 globals.dbHandle = null;
         
@@ -66,7 +71,7 @@
     var tabView_ = new qx.ui.pageview.tabview.TabView;
     tabView_.set(
         {
-            top: 40,
+            top: 100,
             left: 20,
             right: 300,
             bottom: 30
@@ -364,7 +369,7 @@
     splitpane.setEdge(0);
 
     // Create a tree row structure for the tree root
-    var trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("sam.ldb");
+    var trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(globals.dbFile);
 
     // Create the tree and set its characteristics
     var tree = new qx.ui.treefullcontrol.Tree(trs);
@@ -690,7 +695,7 @@
         try
         {
             // Database handle
-            globals.dbHandle = rpc.callSync("connect", "sam.ldb");
+            globals.dbHandle = rpc.callSync("connect", globals.dbFile);
         }
         catch (ex)
         {

Added: branches/SAMBA_4_0/swat/apps/script/layout-samba.js
===================================================================
--- branches/SAMBA_4_0/swat/apps/script/layout-samba.js	2006-10-19 00:59:33 UTC (rev 19405)
+++ branches/SAMBA_4_0/swat/apps/script/layout-samba.js	2006-10-19 01:10:57 UTC (rev 19406)
@@ -0,0 +1,15 @@
+(function()
+{
+  document.write('<div id="demoFoot">');
+  document.write('</div>');
+
+  document.write('<div id="demoDebug">');
+  document.write('</div>');
+  
+  document.write('<div id="demoFrame">');
+  document.write('&#160;');
+  document.write('</div>');
+
+  qx.dev.log.Logger.ROOT_LOGGER.removeAllAppenders();
+  qx.dev.log.Logger.ROOT_LOGGER.addAppender(new qx.dev.log.DivAppender("demoDebug"));
+})();



More information about the samba-cvs mailing list