[Zope-CVS] CVS: Packages/Moztop/moztop/content - menuentryOverlay.xul:1.2 moztop.js:1.17 moztop.xul:1.11

Paul Everitt paul@zope.com
Sat, 15 Feb 2003 06:02:31 -0500


Update of /cvs-repository/Packages/Moztop/moztop/content
In directory cvs.zope.org:/tmp/cvs-serv19080

Modified Files:
	menuentryOverlay.xul moztop.js moztop.xul 
Log Message:
Rewrite finished.

=== Packages/Moztop/moztop/content/menuentryOverlay.xul 1.1 => 1.2 ===
--- Packages/Moztop/moztop/content/menuentryOverlay.xul:1.1	Wed Jan 15 23:11:20 2003
+++ Packages/Moztop/moztop/content/menuentryOverlay.xul	Sat Feb 15 06:02:00 2003
@@ -7,12 +7,13 @@
 
 function runMoztop() {
   window.openDialog('chrome://moztop/content/', '_blank', 'chrome,dialog=no');
+  return;
 }
 	
 </script>
 
 <menupopup id="taskPopup">
-  <menuitem label="Moztop 0.1 (Zope 3 IDE)" oncommand="runMoztop();" />
+  <menuitem label="Moztop" oncommand="runMoztop();" />
   <menuseparator/>
 </menupopup>
 


=== Packages/Moztop/moztop/content/moztop.js 1.16 => 1.17 ===
--- Packages/Moztop/moztop/content/moztop.js:1.16	Thu Jan 30 14:01:28 2003
+++ Packages/Moztop/moztop/content/moztop.js	Sat Feb 15 06:02:00 2003
@@ -19,16 +19,20 @@
 
 ******************************************************************************/
 
-// Setup the two client-side RDF datasources
-var sitesds = null;
-var typesds = null;
-
-var logmanager = null;   // Assigned a LogManager later
+/* Setup the global RDFDataSources objects and initialize later */
+var sitesmanager = null;
+var logmanager = null;
 
 /* Function that is executed when Moztop is started. */
 function startProgram() {
   initTaskList();
+  /* We now have logmanger, let's use it */
+  logmanager.addMessage("Initializing Explorer","moztop.js, startProgram","");
   initExplorer();
+//   var m = sitesmanager.moztopds.serializeToString();
+//   dump("\n" + m);
+//   logmanager.addMessage("Sites datastore serialized",
+// 			"moztop.js, startProgram",m);
 }
 
 /* Function that is executed when Moztop is started. */
@@ -49,4 +53,147 @@
           'For more information see http://www.zope.org/')
 }
 
+
+/* Debug function, dumps known datasouces to stdout using dump() */
+function dumpDataSourceManagers () {
+    var s = logmanager.ds.serializeToString();
+    dump("\nDumping log messages..........\n" + s + "\n");
+
+    var s = sitesmanager.ds.serializeToString();
+    dump("\nDumping sites..........\n" + s + "\n");
+
+    var s = sitesmanager.commontypesds.serializeToString();
+    dump("\nDumping common types..........\n" + s + "\n");
+
+    var s = sitesmanager.sitedatasources["http://localhost:8080/Plone/"].serializeToString();
+    dump("\nDumping localhostplone..........\n" + s + "\n");
+
+
+}
+
+function DataSourceManager () {
+  /* A superclass for the various datasources */
+
+  this.dcns = "http://www.purl.org/dc/1.1#";
+  this.zoperdfns = "http://www.zope.org/rdf#";
+  this.ncns ="http://home.netscape.com/NC-rdf#";
+
+  this.titleprop = this.dcns + "title";
+  this.descriptionprop = this.dcns + "description";
+  this.resourcetypeprop = this.zoperdfns + "resourcetype";
+  this.urlprop = this.zoperdfns + "url";
+  this.usernameprop = this.zoperdfns + "username";
+  this.passwordprop = this.zoperdfns + "password";
+  this.styleidprop = this.zoperdfns + "styleid";
+  this.subitemsprop = this.ncns + "subitems";
+
+  this.profileurl = this.getProfileDirURL();
+  this.elementid = null;
+}
+
+DataSourceManager.prototype.getProfileDirURL=
+  function ()
+{
+
+  // First get the directory service and query interface it to
+  // nsIProperties
+  var dirService = Components.
+      classes['@mozilla.org/file/directory_service;1'].
+      getService(Components.interfaces.nsIProperties);
+
+  // Next get the "ProfD" property of type nsIFile from the directory
+  // service, FYI this constant is defined in
+  // mozilla/xpcom/io/nsAppDirectoryServiceDefs.h
+
+  const NS_APP_USER_PROFILE_50_DIR = "ProfD";
+  profileDir = dirService.get(NS_APP_USER_PROFILE_50_DIR,
+	Components.interfaces.nsIFile);
+
+  // Now that we have it we can show it's path. See nsIFile for the
+  // other things you that can be done with profileDir
+
+	var io_service =
+	Components.classes["@mozilla.org/network/io-service;1"].
+	getService(Components.interfaces.nsIIOService);
+   
+  var url = io_service.newFileURI(profileDir)
+     .QueryInterface(Components.interfaces.nsIFileURL);
+   
+  return url.spec;
+}
+
+
+DataSourceManager.prototype.getSelectedResource=
+  function ()
+{
+    /* For all trees, this returns a selected resource */
+    var tree = document.getElementById(this.elementid);
+    var index = tree.view.selection.currentIndex;
+
+    if (index == -1) return false;
+    var rdf = tree.view.getItemAtIndex(index).resource;
+
+    /* Now grab this ds and return a RDFNode */
+    
+    return this.ds.getNode(rdf.Value);
+}
+
+
+DataSourceManager.prototype.sendServerMessage=
+  function ()
+{
+  return;
+}
+
+
+DataSourceManager.prototype.reloadElementDataSources=
+  function ()
+{
+  return;
+}
+
+
+DataSourceManager.prototype.dumpDataSources=
+  function ()
+{
+  return;
+}
+
+
+DataSourceManager.prototype.viewDataSources=
+  function ()
+{
+  return;
+}
+
+const commontypes_data = '<?xml version="1.0"?>' +
+    '<RDF:RDF xmlns:dc="http://www.purl.org/dc/1.1#"' +
+    '         xmlns:site="http://www.zope.org/rdf#"' +
+    '         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">' +
+    '<RDF:Description about="urn:moztop:resourcetypes:site">' +
+    '<dc:title>Site</dc:title>' +
+    '<site:styleid>site</site:styleid>' +
+    '</RDF:Description>' +
+    '' +
+    '<RDF:Description about="urn:moztop:resourcetypes:configurations">' +
+    '<dc:title>Configurations</dc:title>' +
+    '<site:styleid>configurations</site:styleid>' +
+    '</RDF:Description>' +
+    '' +
+    '<RDF:Description about="urn:moztop:resourcetypes:content">' +
+    '<dc:title>Content</dc:title>' +
+    '<site:styleid>Content</site:styleid>' +
+    '</RDF:Description>' +
+    '' +
+    '<RDF:Description about="urn:moztop:resourcetypes:packages">' +
+    '<dc:title>Packages</dc:title>' +
+    '<site:styleid>packages</site:styleid>' +
+    '</RDF:Description>' +
+    '' +
+    '<RDF:Description about="urn:moztop:resourcetypes:package">' +
+    '<dc:title>Package</dc:title>' +
+    '<site:styleid>package</site:styleid>' +
+    '</RDF:Description>' +
+    '' +
+    '</RDF:RDF>';
 


=== Packages/Moztop/moztop/content/moztop.xul 1.10 => 1.11 ===
--- Packages/Moztop/moztop/content/moztop.xul:1.10	Fri Feb  7 06:34:02 2003
+++ Packages/Moztop/moztop/content/moztop.xul	Sat Feb 15 06:02:00 2003
@@ -3,12 +3,11 @@
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://moztop/skin" type="text/css"?>
 
-<?xul-overlay href="chrome://moztop/content/Menu/KeySetOverlay.xul"?>
 <?xul-overlay href="chrome://moztop/content/Menu/MenuOverlay.xul"?>
 <?xul-overlay href="chrome://moztop/content/Menu/ToolBarOverlay.xul"?>
-
+<?xul-overlay href="chrome://moztop/content/Menu/KeySetOverlay.xul"?>
 <?xul-overlay href="chrome://moztop/content/Explorer/ExplorerOverlay.xul"?>
-<?xul-overlay href="chrome://moztop/content/Main/MainOverlay.xul"?>
+<?xul-overlay href="chrome://moztop/content/Content/ContentOverlay.xul"?>
 <?xul-overlay href="chrome://moztop/content/StatusBar/StatusBarOverlay.xul"?>
 
 <!DOCTYPE window [
@@ -16,8 +15,9 @@
 %moztopDTD;
 ]>
 
+
 <window
-   title      = "Moztop for Zope 3"
+   title      = "Moztop"
    id         = "moztop-main-window"
    xmlns      = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:html = "http://www.w3.org/1999/xhtml"
@@ -25,44 +25,38 @@
    height     = "600"
    orient     = "vertical"
    persist    = "screenX screenY width height sizemode"
-   onload     = "startProgram();"
-   onclose    = "return closeProgram();">
+   onload     = "startProgram()">
 
-  <script type="application/x-javascript" src="setup.js"/>
   <script type="application/x-javascript" src="rdfds.js"/>
   <script type="application/x-javascript" src="global.js"/>
   <script type="application/x-javascript" src="moztop.js"/>
   <script type="application/x-javascript" src="StatusBar/TaskManager.js"/>
 
-  <keyset id="menu-keyset"/>
-
-  <commandset id="maincommands"> 
+  <commandset id="maincommands">
     <command id="menu-file-close:command" oncommand="closeProgram();"/> 
     <command id="menu-help-zope3:command" oncommand="showZope3();"/> 
     <command id="menu-help-about:command" oncommand="showAbout();"/> 
-    <command id="menu-view-reload:command" 
-             oncommand="BrowserReload()"/> 
-  </commandset> 
- 
+    <command id="menu-view-reload:command" oncommand="BrowserReload()"/>
+    <command id="menu-debug-dump:command" oncommand="dumpDataSourceManagers();"/> 
+   </commandset> 
+
   <box>
     <toolbox flex="100%">
       <menubar id="moztop-menubar"/>
       <toolbar id="moztop-toolbar"/>
     </toolbox>
-    <image src="chrome://moztop/skin/moztop.png" height="50" />
   </box>
 
-  <box orient="horizontal" flex="10">
+  <box orient="horizontal" flex="1">
     <vbox id="explorer" flex="1"/>
-    <splitter collapse="before">
-      <spacer flex="1"/><grippy/><spacer flex="1"/>
-    </splitter>
-    <box id="main-content" flex="6"/>
+    <splitter collapse="before"/>
+    <box id="main-content" flex="2"/>
   </box>
 
   <splitter collapse="after">
     <spacer flex="1"/><grippy/><spacer flex="1"/>
   </splitter>
 
-  <tabbox id="statusbar" flex="1"/>
+  <tabbox id="statusbar"/>
+
 </window>