[Zope-CVS] CVS: Packages/Moztop/moztop/content/lib - datasourcemanager.js:1.3 sitesmanager.js:1.3
Stephan Richter
srichter@cbu.edu
Thu, 20 Mar 2003 14:31:21 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/lib
In directory cvs.zope.org:/tmp/cvs-serv31381/moztop/content/lib
Modified Files:
datasourcemanager.js sitesmanager.js
Log Message:
fixing site discovery and site adding.
=== Packages/Moztop/moztop/content/lib/datasourcemanager.js 1.2 => 1.3 ===
--- Packages/Moztop/moztop/content/lib/datasourcemanager.js:1.2 Thu Mar 20 11:51:53 2003
+++ Packages/Moztop/moztop/content/lib/datasourcemanager.js Thu Mar 20 14:30:50 2003
@@ -1,53 +1,69 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-
-function DataSourceManager () {
-
- /* A prototype to manage the sites database and datasources */
-
- /* The constructor is responsible for .... */
-
- this.dcns = "http://www.purl.org/dc/1.1#";
- this.oscomrdfns = "http://www.oscom.org/rdf#";
- this.ncns ="http://home.netscape.com/NC-rdf#";
-
- this.titleprop = this.dcns + "title";
- this.descriptionprop = this.dcns + "description";
- this.resourcetypeprop = this.oscomrdfns + "resourcetypes";
- this.urlprop = this.oscomrdfns + "url";
- this.contentsurlprop = this.oscomrdfns + "contentsurl";
- this.sitetypeprop = this.oscomrdfns + "sitetype";
- this.styleidprop = this.oscomrdfns + "styleid";
- this.subitemsprop = this.ncns + "subitems";
- this.elementid = 'navigation-tree';
- this.sourceurlprop = this.oscomrdfns + "sourceurl";
- this.saveurlprop = this.oscomrdfns + "saveurl";
- this.previewurlprop = this.oscomrdfns + "previewurl";
+/*****************************************************************************
+*
+* Copyright (c) 2002, 2003 Zope Corporation and Contributors.
+* All Rights Reserved.
+*
+* This software is subject to the provisions of the Zope Public License,
+* Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+* WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+* FOR A PARTICULAR PURPOSE.
+*
+******************************************************************************
+The Data Source Manager handles all navigation tree related data sources and
+makes sure they are uptodate.
+
+
+$Id$
+
+******************************************************************************/
+
+function DataSourceManager() {
+ /* A prototype to manage the sites database and datasources
+
+ The constructor is responsible for .... */
+
+ this.dcns = "http://www.purl.org/dc/1.1#";
+ this.oscomrdfns = "http://www.oscom.org/rdf#";
+ this.ncns ="http://home.netscape.com/NC-rdf#";
+
+ this.titleprop = this.dcns + "title";
+ this.descriptionprop = this.dcns + "description";
+ this.resourcetypeprop = this.oscomrdfns + "resourcetypes";
+ this.urlprop = this.oscomrdfns + "url";
+ this.contentsurlprop = this.oscomrdfns + "contentsurl";
+ this.sitetypeprop = this.oscomrdfns + "sitetype";
+ this.styleidprop = this.oscomrdfns + "styleid";
+ this.subitemsprop = this.ncns + "subitems";
+ this.elementid = 'navigation-tree';
+ this.sourceurlprop = this.oscomrdfns + "sourceurl";
+ this.saveurlprop = this.oscomrdfns + "saveurl";
+ this.previewurlprop = this.oscomrdfns + "previewurl";
- var twingleurl = getProfileDirURL() + 'twingle';
-
- // Create some default datasources
- this.datasources = new Array();
-
- /* These next lines will go away after switching to the array */
- this.sitesds = new RDFDataSource(twingleurl + "/sites.rdf",null);
- this.oscomtypesds = new RDFDataSource(twingleurl + "/oscomtypes.rdf",null);
- this.localsiteds = new RDFDataSource(twingleurl + "/localsite.rdf",null);
-
-
- /* Attach these (potentially empty) datasources */
- var tree=document.getElementById(this.elementid);
- tree.database.AddDataSource(this.sitesds.getRawDataSource());
- tree.database.AddDataSource(this.oscomtypesds.getRawDataSource());
- tree.database.AddDataSource(this.localsiteds.getRawDataSource());
- tree.builder.rebuild();
+ var moztopurl = getProfileDirURL() + 'moztop';
- dump("\nfinished add datasources and rebuilding tree");
+ // Create some default datasources
+ this.datasources = new Array();
+
+ /* These next lines will go away after switching to the array */
+ this.sitesds = new RDFDataSource(twingleurl + "/sites.rdf",null);
+ this.oscomtypesds = new RDFDataSource(twingleurl + "/oscomtypes.rdf",null);
+ this.localsiteds = new RDFDataSource(twingleurl + "/localsite.rdf",null);
+
+
+ /* Attach these (potentially empty) datasources */
+ var tree=document.getElementById(this.elementid);
+ tree.database.AddDataSource(this.sitesds.getRawDataSource());
+ tree.database.AddDataSource(this.oscomtypesds.getRawDataSource());
+ tree.database.AddDataSource(this.localsiteds.getRawDataSource());
+ tree.builder.rebuild();
+
+ dump("\nfinished add datasources and rebuilding tree");
}
-DataSourceManager.prototype.initializeProfileDir =
-function ()
-{
+DataSourceManager.prototype.initializeProfileDir = function() {
/* If this is a first-time install, setup a directory in the
Mozilla profile directory with the right RDF files, etc. */
return true;
@@ -56,33 +72,26 @@
-DataSourceManager.prototype.initializeDataSources =
-function ()
-{
- /* Called during startup to find needed datasources,
- fetch RDF, and build tree */
+DataSourceManager.prototype.initializeDataSources = function() {
+ /* Called during startup to find needed datasources, fetch RDF, and build
+ tree */
return true;
}
-DataSourceManager.prototype.addDataSource =
-function (title, rdfurl)
-{
+DataSourceManager.prototype.addDataSource = function(title, rdfurl) {
/* Create a new */
return true;
}
-DataSourceManager.prototype.openDataSource =
-function (rdfurl)
-{
+DataSourceManager.prototype.openDataSource = function (rdfurl) {
/* Used during Moztop launch */
return true;
}
-DataSourceManager.prototype.removeDataSource = function (rdfurl)
-{
+DataSourceManager.prototype.removeDataSource = function(rdfurl) {
/* */
return true;
}
=== Packages/Moztop/moztop/content/lib/sitesmanager.js 1.2 => 1.3 ===
--- Packages/Moztop/moztop/content/lib/sitesmanager.js:1.2 Thu Mar 20 11:30:22 2003
+++ Packages/Moztop/moztop/content/lib/sitesmanager.js Thu Mar 20 14:30:50 2003
@@ -87,7 +87,8 @@
rootnode.addTarget(this.subitemsprop,subitems);
this.ds.save();
- logmanager.addMessage("Initialized moztop.rdf","navigation.js, initNavigation",
+ logmanager.addMessage("Initialized moztop.rdf",
+ "navigation.js, initNavigation",
this.ds.serializeToString());
return;
@@ -139,7 +140,6 @@
function serializeResponse(e) {
/* Local anonymous function for handling the async data */
if (p.statusText) {
- dump("\nhere\n");
/* If p.ds is empty, we'll have to attach and rebuild */
var needsReload = false;
@@ -161,7 +161,7 @@
p.ds.serializeToString());
/* XXX: don't rebuild tree if you don't have to */
- var tree=document.getElementById("navigationtree");
+ var tree = document.getElementById("navigationtree");
tree.database.AddDataSource(p.ds.getRawDataSource());
tree.builder.rebuild();
}