[Zope-CVS] CVS: Packages/Moztop/moztop/content - moztop.js:1.27 moztop.xul:1.24 rdfds.js:NONE

Stephan Richter srichter@cbu.edu
Sat, 22 Mar 2003 10:02:37 -0500


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

Modified Files:
	moztop.js moztop.xul 
Removed Files:
	rdfds.js 
Log Message:
Okay, here lands a major rewrite Paul and I were working on:

- Implemented DataSourceManager and refactored SitesManager.

- Datasources are now managed only from the tree directly, no private 
  copy is kept. 

- SitesManager makes now full use of the information found in rsd.xml.


Note: Not everything is working yet, so we need to keep digging:

- Gets wrong datasources for SitesManager

- Cannot add sites due to the problem above

- For some reason the content in Content and Packages is not displayed
  correctly. Some inspection of the RDF is necessary. On the other hand,
  fixing the above problems could fix this one too.


=== Packages/Moztop/moztop/content/moztop.js 1.26 => 1.27 ===
--- Packages/Moztop/moztop/content/moztop.js:1.26	Sat Mar 22 09:27:01 2003
+++ Packages/Moztop/moztop/content/moztop.js	Sat Mar 22 10:02:06 2003
@@ -31,8 +31,7 @@
     initLogManager();
     /* We now have logmanger, let's use it */
     logmanager.addMessage("Initializing Navigation","moztop.js, startProgram");
-    initTaskManager();
-
+    // initTaskManager();
     initSitesManager();
 }
 
@@ -57,144 +56,6 @@
 
 /* Debug function, dumps known datasouces to stdout using dump() */
 function dumpDataSourceManagers () {
-    var s = logmanager.ds.serializeToString();
-    dump("Dumping log messages..........\n" + s);
-
-    var s = sitesmanager.ds.serializeToString();
-    dump("Dumping sites..........\n" + s);
-
-    var s = sitesmanager.commontypesds.serializeToString();
-    dump("Dumping common types..........\n" + s + "\n");
-
-    var s = sitesmanager.sitedatasources[
-	"http://localhost:8380/"].serializeToString();
-    dump("Dumping localhostplone..........\n" + s);
-
-
-}
-
-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#";
-    
-    // XXX: HACK ALARM! There is no way all these attributes are needed for
-    // all datasource managers!
-    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;
+    logmanager.dumpDataSources()
+    sitesmanager.dumpDataSources()
 }
-
-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:folder">' +
-    '<dc:title>Folder</dc:title>' +
-    '<site:styleid>folder</site:styleid>' +
-    '</RDF:Description>' +
-    '' +
-    '<RDF:Description about="urn:moztop:resourcetypes:zptpage">' +
-    '<dc:title>ZPT Page</dc:title>' +
-    '<site:styleid>zptpage</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.23 => 1.24 ===
--- Packages/Moztop/moztop/content/moztop.xul:1.23	Sat Mar 22 09:27:01 2003
+++ Packages/Moztop/moztop/content/moztop.xul	Sat Mar 22 10:02:06 2003
@@ -35,7 +35,7 @@
   <script type="application/x-javascript" src="lib/datasourcemanager.js"/>
   <script type="application/x-javascript" src="lib/logmanager.js"/>
   <script type="application/x-javascript" src="lib/sitesmanager.js"/>
-  <script type="application/x-javascript" src="lib/taskmanager.js"/>
+  <!--script type="application/x-javascript" src="lib/taskmanager.js"/ -->
 
   <commandset id="moztop-commands"/>
 

=== Removed File Packages/Moztop/moztop/content/rdfds.js ===