[Zope-CVS] CVS: Packages/MoZTop/moztop/content/zopetop/StatusBar - StatusBarOverlay.xul:1.4 TaskManager.js:1.2 TasksOverlay.xul:1.3 TransactionsOverlay.xul:1.3

Stephan Richter srichter@cbu.edu
Thu, 9 Jan 2003 01:18:57 -0500


Update of /cvs-repository/Packages/MoZTop/moztop/content/zopetop/StatusBar
In directory cvs.zope.org:/tmp/cvs-serv2024/content/StatusBar

Modified Files:
	StatusBarOverlay.xul TaskManager.js TasksOverlay.xul 
	TransactionsOverlay.xul 
Log Message:
Checkpoint: I got adding Tasks to a RDF source going again; deleting does
not work though.



=== Packages/MoZTop/moztop/content/zopetop/StatusBar/StatusBarOverlay.xul 1.3 => 1.4 ===
--- Packages/MoZTop/moztop/content/zopetop/StatusBar/StatusBarOverlay.xul:1.3	Wed Jan  8 19:45:20 2003
+++ Packages/MoZTop/moztop/content/zopetop/StatusBar/StatusBarOverlay.xul	Thu Jan  9 01:18:54 2003
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 
-<?xul-overlay href="chrome://moztop/content/StatusBar/TasksOverlay.xul"?>
+<!--?xul-overlay href="chrome://moztop/content/StatusBar/TasksOverlay.xul"?-->
 <?xul-overlay href="chrome://moztop/content/StatusBar/TransactionsOverlay.xul"?>
 
 <overlay id="StatusBarOverlay"
@@ -50,15 +50,37 @@
                       -moz-border-top-colors: #000000 #DFE2E6 #D0D7DD;
                       "
                 flex="1">
-      <tabpanel id="mailtab"
-                orient="vertical"
-		height="100"
-                flex="1">
-        <tree id="tasks"/>
-      </tabpanel>
-      <tabpanel id="newstab">
-        <box id="transactions"/>
+      <tabpanel id="mailtab" orient="vertical" flex="1">
+<tree id="tasks-tree" flex="1" 
+      datasources="rdf:null"
+      flags="dont-build-content"
+      containment="http://www.zope.org/rdf/task#child">
+  <treecols>
+    <treecol id="id" label="Id" flex="1" style="text-align: right"/>
+    <treecol id="name" label="Name" primary="true" flex="8" />
+    <splitter/>
+    <treecol id="descr" label="Description" flex="16" />
+    <splitter/>
+    <treecol id="status" label="Status" flex="3" />
+  </treecols>
+
+    <template>
+      <rule>
+        <treechildren flex="1">
+          <treeitem uri="rdf:*">
+            <treerow>
+              <treecell label="rdf:http://www.zope.org/rdf/task#id"/>
+              <treecell label="rdf:http://www.zope.org/rdf/task#name"/>
+              <treecell label="rdf:http://www.zope.org/rdf/task#descr"/>
+              <treecell label="rdf:http://www.zope.org/rdf/task#status"/>
+            </treerow>
+          </treeitem>
+        </treechildren>
+      </rule>
+    </template>
+</tree>
       </tabpanel>
+      <tabpanel id="transactions-panel" />
     </tabpanels>
   </tabbox>
 </overlay>


=== Packages/MoZTop/moztop/content/zopetop/StatusBar/TaskManager.js 1.1 => 1.2 ===
--- Packages/MoZTop/moztop/content/zopetop/StatusBar/TaskManager.js:1.1	Wed Jan  8 14:01:49 2003
+++ Packages/MoZTop/moztop/content/zopetop/StatusBar/TaskManager.js	Thu Jan  9 01:18:54 2003
@@ -8,54 +8,68 @@
   .classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"]
   .createInstance(Components.interfaces.nsIRDFDataSource);
 
+
 function initTaskList() {
+    var tree = document.getElementById("tasks-tree");
+    tree.database.AddDataSource(DS);
+    tree.setAttribute("ref", "urn:tasks:data");
     addTask('init', 'Initial Task', 'done');
-
-    // Add the datasource to the outliner
-    var outliner = document.getElementById("TaskList");
-    outliner.database.AddDataSource(DS);
-    outliner.setAttribute("ref", "urn:tasks:root");
 }
 
 // This will remember the index of the last child we've added
 var taskCount = 0;
 
-function addTask(name, description, status) {
-    // Add a new child urn:tasks:1.x beneath urn:tasks:1.
-    DS.Assert(RDF.GetResource("urn:tasks:" + taskCount),
-              RDF.GetResource("http://home.netscape.com/NC-rdf#taskid"),
+function addTask(name, descr, status) {
+    DS.Assert(RDF.GetResource("urn:tasks:task" + taskCount),
+              RDF.GetResource("http://www.zope.org/rdf/task#id"),
               RDF.GetLiteral(taskCount),
               true);
-      
-    DS.Assert(RDF.GetResource("urn:tasks:" + taskCount),
-              RDF.GetResource("http://home.netscape.com/NC-rdf#name"),
+
+    DS.Assert(RDF.GetResource("urn:tasks:task" + taskCount),
+              RDF.GetResource("http://www.zope.org/rdf/task#name"),
               RDF.GetLiteral(name),
               true);
 
-    DS.Assert(RDF.GetResource("urn:tasks:" + taskCount),
-              RDF.GetResource("http://home.netscape.com/NC-rdf#descr"),
-              RDF.GetLiteral(description),
+    DS.Assert(RDF.GetResource("urn:tasks:task" + taskCount),
+              RDF.GetResource("http://www.zope.org/rdf/task#descr"),
+              RDF.GetLiteral(descr),
               true);
 
-    DS.Assert(RDF.GetResource("urn:tasks:" + taskCount),
-              RDF.GetResource("http://home.netscape.com/NC-rdf#status"),
+    DS.Assert(RDF.GetResource("urn:tasks:task" + taskCount),
+              RDF.GetResource("http://www.zope.org/rdf/task#status"),
               RDF.GetLiteral(status),
               true);
 
-    DS.Assert(RDF.GetResource("urn:tasks:root"),
-              RDF.GetResource("http://home.netscape.com/NC-rdf#child"),
-              RDF.GetResource("urn:tasks:" + taskCount),
+    DS.Assert(RDF.GetResource("urn:tasks:data"),
+              RDF.GetResource("http://www.zope.org/rdf/task#child"),
+              RDF.GetResource("urn:tasks:task" + taskCount),
               true);
 
+    // Write it all out.
     ++taskCount;
 }
 
 function deleteTask(taskid) {
-    DS.Unassert(RDF.GetResource("urn:tasks:root"),
-                RDF.GetResource("http://home.netscape.com/NC-rdf#child"),
-                RDF.GetResource("urn:tasks:" + taskid),
+    DS.Unassert(RDF.GetResource("urn:tasks:data"),
+                RDF.GetResource("http://www.zope.org/rdf/task#child"),
+                RDF.GetResource("urn:tasks:task" + taskid),
                 true);
+    DS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource).Flush();
+    alert(11);
+}
 
+function deleteSelectedTask() {
+    var tree = document.getElementById("tasks-tree");
+    var start = new Object();
+    var end = new Object();
+    var numRanges = tree.view.selection.getRangeCount();
+
+    for (var t=0; t<numRanges; t++){
+      tree.view.selection.getRangeAt(t,start,end);
+      for (var v=start.value; v<=end.value; v++){
+        alert("Item "+v+" is selected.");
+      }
+    }
 }
 
 function deleteLatestTask() {


=== Packages/MoZTop/moztop/content/zopetop/StatusBar/TasksOverlay.xul 1.2 => 1.3 ===
--- Packages/MoZTop/moztop/content/zopetop/StatusBar/TasksOverlay.xul:1.2	Wed Jan  8 19:45:20 2003
+++ Packages/MoZTop/moztop/content/zopetop/StatusBar/TasksOverlay.xul	Thu Jan  9 01:18:54 2003
@@ -3,9 +3,12 @@
 <overlay id="TasksOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-<tree id="tasks" flex="1" 
-      datasources="chrome://moztop/content/Data/tasks.rdf"
-      ref="urn:tasks:data">
+<!--"chrome://moztop/content/Data/tasks.rdf"-->
+<!-- ref="urn:tasks:data" -->
+<tree id="tasks-tree" flex="1" 
+      datasources="rdf:null"
+      flags="dont-build-content"
+      containment="http://www.zope.org/rdf/task#child">
   <treecols>
     <treecol id="id" label="Id" flex="1" style="text-align: right"/>
     <treecol id="name" label="Name" primary="true" flex="8" />


=== Packages/MoZTop/moztop/content/zopetop/StatusBar/TransactionsOverlay.xul 1.2 => 1.3 ===
--- Packages/MoZTop/moztop/content/zopetop/StatusBar/TransactionsOverlay.xul:1.2	Wed Jan  8 19:45:20 2003
+++ Packages/MoZTop/moztop/content/zopetop/StatusBar/TransactionsOverlay.xul	Thu Jan  9 01:18:54 2003
@@ -3,9 +3,9 @@
 <overlay id="TransactionsOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-  <box id="transactions" orient="vertical" flex="1">
+<tabpanel id="transactions-panel" orient="vertical" flex="1">
 
-  <tree id="transactions" flex="1" 
+  <tree id="transactions" height="100" flex="1" 
         datasources="chrome://moztop/content/Data/transactions.rdf"
         ref="urn:tasks:data">
     <treecols>
@@ -41,6 +41,6 @@
     <button label="Retrieve" />
   </box>
 
-  </box>
+</tabpanel>
 
 </overlay>