myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r432754 [6/28] - in /myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource: ./ src/ src/animation/ src/collections/ src/compat/ src/crypto/ src/data/ src/data/format/ src/data/provider/ src/debug/ sr...
Date Fri, 18 Aug 2006 22:33:00 GMT
Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Csv.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Csv.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Csv.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Csv.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,112 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.data.format.Csv");
+dojo.require("dojo.lang.assert");
+
+
+dojo.data.format.Csv = new function() {
+
+	// -------------------------------------------------------------------
+	// Public functions
+	// -------------------------------------------------------------------
+	this.getArrayStructureFromCsvFileContents = function(/* string */ csvFileContents) {
+		/**
+		 * Given a string containing CSV records, this method parses
+		 * the string and returns a data structure containing the parsed
+		 * content.  The data structure we return is an array of length
+		 * R, where R is the number of rows (lines) in the CSV data.  The 
+		 * return array contains one sub-array for each CSV line, and each 
+		 * sub-array contains C string values, where C is the number of 
+		 * columns in the CSV data.
+		 * 
+		 * For example, given this CSV string as input:
+		 * <pre>
+		 *   "Title, Year, Producer \n Alien, 1979, Ridley Scott \n Blade Runner, 1982, Ridley Scott"
+		 * </pre>
+		 * We will return this data structure:
+		 * <pre>
+		 *   [["Title", "Year", "Producer"]
+		 *    ["Alien", "1979", "Ridley Scott"],  
+		 *    ["Blade Runner", "1982", "Ridley Scott"]]
+		 * </pre>
+		 */
+		dojo.lang.assertType(csvFileContents, String);
+		
+		var lineEndingCharacters = new RegExp("\r\n|\n|\r");
+		var leadingWhiteSpaceCharacters = new RegExp("^\\s+",'g');
+		var trailingWhiteSpaceCharacters = new RegExp("\\s+$",'g');
+		var doubleQuotes = new RegExp('""','g');
+		var arrayOfOutputRecords = [];
+		
+		var arrayOfInputLines = csvFileContents.split(lineEndingCharacters);
+		for (var i in arrayOfInputLines) {
+			var singleLine = arrayOfInputLines[i];
+			if (singleLine.length > 0) {
+				var listOfFields = singleLine.split(',');
+				var j = 0;
+				while (j < listOfFields.length) {
+					var space_field_space = listOfFields[j];
+					var field_space = space_field_space.replace(leadingWhiteSpaceCharacters, ''); // trim leading whitespace
+					var field = field_space.replace(trailingWhiteSpaceCharacters, ''); // trim trailing whitespace
+					var firstChar = field.charAt(0);
+					var lastChar = field.charAt(field.length - 1);
+					var secondToLastChar = field.charAt(field.length - 2);
+					var thirdToLastChar = field.charAt(field.length - 3);
+					if ((firstChar == '"') && 
+							((lastChar != '"') || 
+							 ((lastChar == '"') && (secondToLastChar == '"') && (thirdToLastChar != '"')) )) {
+						if (j+1 === listOfFields.length) {
+							// alert("The last field in record " + i + " is corrupted:\n" + field);
+							return null;
+						}
+						var nextField = listOfFields[j+1];
+						listOfFields[j] = field_space + ',' + nextField;
+						listOfFields.splice(j+1, 1); // delete element [j+1] from the list
+					} else {
+						if ((firstChar == '"') && (lastChar == '"')) {
+							field = field.slice(1, (field.length - 1)); // trim the " characters off the ends
+							field = field.replace(doubleQuotes, '"');   // replace "" with "
+						}
+						listOfFields[j] = field;
+						j += 1;
+					}
+				}
+				arrayOfOutputRecords.push(listOfFields);
+			}
+		}
+		return arrayOfOutputRecords; // Array
+	};
+
+	this.loadDataProviderFromFileContents = function(/* dojo.data.provider.Base */ dataProvider, /* string */ csvFileContents) {
+		dojo.lang.assertType(dataProvider, dojo.data.provider.Base);
+		dojo.lang.assertType(csvFileContents, String);
+		var arrayOfArrays = this.getArrayStructureFromCsvFileContents(csvFileContents);
+		if (arrayOfArrays) {
+			var arrayOfKeys = arrayOfArrays[0];
+			for (var i = 1; i < arrayOfArrays.length; ++i) {
+				var row = arrayOfArrays[i];
+				var item = dataProvider.getNewItemToLoad();
+				for (var j in row) {
+					var value = row[j];
+					var key = arrayOfKeys[j];
+					item.load(key, value);
+				}
+			}
+		}
+	};
+	
+	this.getCsvStringFromResultSet = function(/* dojo.data.ResultSet */ resultSet) {
+		dojo.unimplemented('dojo.data.format.Csv.getCsvStringFromResultSet');
+		var csvString = null;
+		return csvString; // String
+	};
+	
+}();

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Json.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Json.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Json.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/format/Json.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,103 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.data.format.Json");
+dojo.require("dojo.lang.assert");
+
+dojo.data.format.Json = new function() {
+
+	// -------------------------------------------------------------------
+	// Public functions
+	// -------------------------------------------------------------------
+	this.loadDataProviderFromFileContents = function(/* dojo.data.provider.Base */ dataProvider, /* string */ jsonFileContents) {
+		dojo.lang.assertType(dataProvider, dojo.data.provider.Base);
+		dojo.lang.assertType(jsonFileContents, String);
+		var arrayOfJsonData = eval("(" + jsonFileContents + ")");
+		this.loadDataProviderFromArrayOfJsonData(dataProvider, arrayOfJsonData);
+	};
+	
+	this.loadDataProviderFromArrayOfJsonData = function(/* dojo.data.provider.Base */ dataProvider, /* Array */ arrayOfJsonData) {
+		dojo.lang.assertType(arrayOfJsonData, [Array, "optional"]);
+		if (arrayOfJsonData && (arrayOfJsonData.length > 0)) {
+			var firstRow = arrayOfJsonData[0];
+			dojo.lang.assertType(firstRow, [Array, "pureobject"]);
+			if (dojo.lang.isArray(firstRow)) {
+				_loadDataProviderFromArrayOfArrays(dataProvider, arrayOfJsonData);
+			} else {
+				dojo.lang.assertType(firstRow, "pureobject");
+				_loadDataProviderFromArrayOfObjects(dataProvider, arrayOfJsonData);
+			}
+		}
+	};
+
+	this.getJsonStringFromResultSet = function(/* dojo.data.ResultSet */ resultSet) {
+		dojo.unimplemented('dojo.data.format.Json.getJsonStringFromResultSet');
+		var jsonString = null;
+		return jsonString; // String
+	};
+
+	// -------------------------------------------------------------------
+	// Private functions
+	// -------------------------------------------------------------------
+	function _loadDataProviderFromArrayOfArrays(/* dojo.data.provider.Base */ dataProvider, /* Array */ arrayOfJsonData) {
+		/** 
+		 * Example: 
+		 * var arrayOfJsonStates = [
+		 * 	 [ "abbr",  "population",  "name" ]
+		 * 	 [  "WA",     5894121,      "Washington"    ],
+		 * 	 [  "WV",     1808344,      "West Virginia" ],
+		 * 	 [  "WI",     5453896,      "Wisconsin"     ],
+		 *   [  "WY",      493782,      "Wyoming"       ] ];
+		 * this._loadFromArrayOfArrays(arrayOfJsonStates);
+		 */
+		var arrayOfKeys = arrayOfJsonData[0];
+		for (var i = 1; i < arrayOfJsonData.length; ++i) {
+			var row = arrayOfJsonData[i];
+			var item = dataProvider.getNewItemToLoad();
+			for (var j in row) {
+				var value = row[j];
+				var key = arrayOfKeys[j];
+				item.load(key, value);
+			}
+		}
+	}
+
+	function _loadDataProviderFromArrayOfObjects(/* dojo.data.provider.Base */ dataProvider, /* Array */ arrayOfJsonData) {
+		/** 
+		 * Example: 
+		 * var arrayOfJsonStates = [
+		 * 	 { abbr: "WA", name: "Washington" },
+		 * 	 { abbr: "WV", name: "West Virginia" },
+		 * 	 { abbr: "WI", name: "Wisconsin", song: "On, Wisconsin!" },
+		 * 	 { abbr: "WY", name: "Wyoming", cities: ["Lander", "Cheyenne", "Laramie"] } ];
+		 * this._loadFromArrayOfArrays(arrayOfJsonStates);
+		 */
+		// dojo.debug("_loadDataProviderFromArrayOfObjects");
+		for (var i in arrayOfJsonData) {
+			var row = arrayOfJsonData[i];
+			var item = dataProvider.getNewItemToLoad();
+			for (var key in row) {
+				var value = row[key];
+				if (dojo.lang.isArray(value)) {
+					var arrayOfValues = value;
+					for (var j in arrayOfValues) {
+						value = arrayOfValues[j];
+						item.load(key, value);
+						// dojo.debug("loaded: " + key + " = " + value); 
+					}
+				} else {
+					item.load(key, value);
+				}
+			}
+		}
+	}
+	
+}();
+

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Base.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Base.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Base.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Base.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,183 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.data.provider.Base");
+dojo.require("dojo.lang.assert");
+
+// -------------------------------------------------------------------
+// Constructor
+// -------------------------------------------------------------------
+dojo.data.provider.Base = function() {
+	/**
+	 * summary:
+	 * A Data Provider serves as a connection to some data source,
+	 * like a relational database.  This data provider Base class
+	 * serves as an abstract superclass for other data provider
+	 * classes.
+	 */
+	this._countOfNestedTransactions = 0;
+	this._changesInCurrentTransaction = null;
+};
+
+// -------------------------------------------------------------------
+// Public instance methods
+// -------------------------------------------------------------------
+dojo.data.provider.Base.prototype.beginTransaction = function() {
+	/**
+	 * Marks the beginning of a transaction.
+	 *
+	 * Each time you call beginTransaction() you open a new transaction, 
+	 * which you need to close later using endTransaction().  Transactions
+	 * may be nested, but the beginTransaction and endTransaction calls
+	 * always need to come in pairs.
+	 */
+	if (this._countOfNestedTransactions === 0) {
+		this._changesInCurrentTransaction = [];
+	}
+	this._countOfNestedTransactions += 1;
+};
+
+dojo.data.provider.Base.prototype.endTransaction = function() {
+	/**
+	 * Marks the end of a transaction.
+	 */
+	this._countOfNestedTransactions -= 1;
+	dojo.lang.assert(this._countOfNestedTransactions >= 0);
+
+	if (this._countOfNestedTransactions === 0) {
+		var listOfChangesMade = this._saveChanges();
+		this._changesInCurrentTransaction = null;
+		if (listOfChangesMade.length > 0) {
+			// dojo.debug("endTransaction: " + listOfChangesMade.length + " changes made");
+			this._notifyObserversOfChanges(listOfChangesMade);
+		}
+	}
+};
+
+dojo.data.provider.Base.prototype.getNewItemToLoad = function() {
+	return this._newItem(); // dojo.data.Item
+};
+
+dojo.data.provider.Base.prototype.newItem = function(/* string */ itemName) {
+	/**
+	 * Creates a new item.
+	 */
+	dojo.lang.assertType(itemName, [String, "optional"]);
+	var item = this._newItem();
+	if (itemName) {
+		item.set('name', itemName);
+	}
+	return item; // dojo.data.Item
+};
+
+dojo.data.provider.Base.prototype.newAttribute = function(/* string */ attributeId) {
+	/**
+	 * Creates a new attribute.
+	 */
+	dojo.lang.assertType(attributeId, String); // FIXME: should be optional
+	var attribute = this._newAttribute(attributeId);
+	return attribute; // dojo.data.Attribute
+};
+
+dojo.data.provider.Base.prototype.getAttribute = function(/* string */ attributeId) {
+	dojo.unimplemented('dojo.data.provider.Base');
+	var attribute;
+	return attribute; // dojo.data.Attribute
+};
+
+dojo.data.provider.Base.prototype.getAttributes = function() {
+	dojo.unimplemented('dojo.data.provider.Base');
+	return this._arrayOfAttributes; // Array
+};
+
+dojo.data.provider.Base.prototype.fetchArray = function() {
+	dojo.unimplemented('dojo.data.provider.Base');
+	return []; // Array
+};
+
+dojo.data.provider.Base.prototype.fetchResultSet = function() {
+	dojo.unimplemented('dojo.data.provider.Base');
+	var resultSet;
+	return resultSet; // dojo.data.ResultSet
+};
+
+dojo.data.provider.Base.prototype.noteChange = function(/* dojo.data.Item */ item, /* string or dojo.data.Attribute */ attribute, /* anything */ value) {
+	var change = {item: item, attribute: attribute, value: value};
+	if (this._countOfNestedTransactions === 0) {
+		this.beginTransaction();
+		this._changesInCurrentTransaction.push(change);
+		this.endTransaction();
+	} else {
+		this._changesInCurrentTransaction.push(change);
+	}
+};
+
+dojo.data.provider.Base.prototype.addItemObserver = function(/* dojo.data.Item */ item, /* object */ observer) {
+	/**
+	 * summary: Registers an object as an observer of an item,
+	 * so that the object will be notified when the item changes.
+	 */
+	dojo.lang.assertType(item, dojo.data.Item);
+	item.addObserver(observer);
+};
+
+dojo.data.provider.Base.prototype.removeItemObserver = function(/* dojo.data.Item */ item, /* object */ observer) {
+	/**
+	 * summary: Removes the observer registration for a previously
+	 * registered object.
+	 */ 
+	dojo.lang.assertType(item, dojo.data.Item);
+	item.removeObserver(observer);
+};
+
+// -------------------------------------------------------------------
+// Private instance methods
+// -------------------------------------------------------------------
+dojo.data.provider.Base.prototype._newItem = function() {
+	var item = new dojo.data.Item(this);
+	return item; // dojo.data.Item
+};
+
+dojo.data.provider.Base.prototype._newAttribute = function(/* String */ attributeId) {
+	var attribute = new dojo.data.Attribute(this);
+	return attribute; // dojo.data.Attribute
+};
+
+dojo.data.provider.Base.prototype._saveChanges = function() {
+	var arrayOfChangesMade = this._changesInCurrentTransaction;
+	return arrayOfChangesMade; // Array
+};
+
+dojo.data.provider.Base.prototype._notifyObserversOfChanges = function(/* Array */ arrayOfChanges) {
+	var arrayOfResultSets = this._getResultSets();
+	for (var i in arrayOfChanges) {
+		var change = arrayOfChanges[i];
+		var changedItem = change.item;
+		var arrayOfItemObservers = changedItem.getObservers();
+		for (var j in arrayOfItemObservers) {
+			var observer = arrayOfItemObservers[j];
+			observer.observedObjectHasChanged(changedItem, change);
+		}
+		for (var k in arrayOfResultSets) {
+			var resultSet = arrayOfResultSets[k];
+			var arrayOfResultSetObservers = resultSet.getObservers();
+			for (var m in arrayOfResultSetObservers) {
+				observer = arrayOfResultSetObservers[m];
+				observer.observedObjectHasChanged(resultSet, change);
+			}
+		}
+	}
+};
+
+dojo.data.provider.Base.prototype._getResultSets = function() {
+	dojo.unimplemented('dojo.data.provider.Base');
+	return []; // Array
+};
+

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Delicious.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Delicious.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Delicious.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/Delicious.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,85 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.data.provider.Delicious");
+dojo.require("dojo.data.provider.FlatFile");
+dojo.require("dojo.data.format.Json");
+
+// -------------------------------------------------------------------
+// Constructor
+// -------------------------------------------------------------------
+dojo.data.provider.Delicious = function() {
+	/**
+	 * summary:
+	 * The Delicious Data Provider can be used to take data from
+	 * del.icio.us and make it available as dojo.data.Items
+	 * In order to use the Delicious Data Provider, you need 
+	 * to have loaded a script tag that looks like this:
+	 * <script type="text/javascript" src="http://del.icio.us/feeds/json/gumption?count=8"></script>
+	 */
+	dojo.data.provider.FlatFile.call(this);
+	// Delicious = null;
+	if (Delicious && Delicious.posts) {
+		dojo.data.format.Json.loadDataProviderFromArrayOfJsonData(this, Delicious.posts);
+	} else {
+		// document.write("<script type='text/javascript'>dojo.data.provider.Delicious._fetchComplete()</script>");		
+		/*
+		document.write("<script type='text/javascript'>alert('boo!');</script>");		
+		document.write("<script type='text/javascript'>var foo = 'not dojo'; alert('dojo == ' + foo);</script>");		
+		document.write("<script type='text/javascript'>var foo = fetchComplete; alert('dojo == ' + foo);</script>");		
+		fetchComplete();
+		*/
+		// dojo.debug("Delicious line 29: constructor");
+	}
+	var u = this.registerAttribute('u');
+	var d = this.registerAttribute('d');
+	var t = this.registerAttribute('t');
+	
+	u.load('name', 'Bookmark');
+	d.load('name', 'Description');
+	t.load('name', 'Tags');
+	
+	u.load('type', 'String');
+	d.load('type', 'String');
+	t.load('type', 'String');
+};
+dojo.inherits(dojo.data.provider.Delicious, dojo.data.provider.FlatFile);
+
+/********************************************************************
+ * FIXME: the rest of this is work in progress
+ *
+ 
+dojo.data.provider.Delicious.prototype.getNewItemToLoad = function() {
+	var newItem = this._newItem();
+	this._currentArray.push(newItem);
+	return newItem; // dojo.data.Item
+};
+
+dojo.data.provider.Delicious.prototype.fetchArray = function(query) {
+	if (!query) {	
+		query = "gumption";
+	}
+	this._currentArray = [];
+	alert("Delicious line 60: loadDataProviderFromArrayOfJsonData");
+	alert("Delicious line 61: " + dojo);
+		var sourceUrl = "http://del.icio.us/feeds/json/" + query + "?count=8";
+		document.write("<script type='text/javascript' src='" + sourceUrl + "'></script>");
+		document.write("<script type='text/javascript'>alert('line 63: ' + Delicious.posts[0].u);</script>");		
+		document.write("<script type='text/javascript'>callMe();</script>");		
+	alert("line 66");
+	dojo.data.format.Json.loadDataProviderFromArrayOfJsonData(this, Delicious.posts);
+	return this._currentArray; // Array
+};
+
+callMe = function() {
+	alert("callMe!");
+};
+
+*/

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/FlatFile.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/FlatFile.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/FlatFile.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/FlatFile.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,153 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.data.provider.FlatFile");
+dojo.require("dojo.data.provider.Base");
+dojo.require("dojo.data.Item");
+dojo.require("dojo.data.Attribute");
+dojo.require("dojo.data.ResultSet");
+dojo.require("dojo.data.format.Json");
+dojo.require("dojo.data.format.Csv");
+dojo.require("dojo.lang.assert");
+
+// -------------------------------------------------------------------
+// Constructor
+// -------------------------------------------------------------------
+dojo.data.provider.FlatFile = function(/* keywords */ keywordParameters) {
+	/**
+	 * summary:
+	 * A Json Data Provider knows how to read in simple JSON data
+	 * tables and make their contents accessable as Items.
+	 */
+	dojo.lang.assertType(keywordParameters, ["pureobject", "optional"]);
+	dojo.data.provider.Base.call(this);
+	this._arrayOfItems = [];
+	this._resultSet = null;
+	this._dictionaryOfAttributes = {};
+
+	if (keywordParameters) {
+		var jsonObjects = keywordParameters["jsonObjects"];
+		var jsonString  = keywordParameters["jsonString"];
+		var fileUrl     = keywordParameters["url"];
+		if (jsonObjects) {
+			dojo.data.format.Json.loadDataProviderFromArrayOfJsonData(this, jsonObjects);
+		}
+		if (jsonString) {
+			dojo.data.format.Json.loadDataProviderFromFileContents(this, jsonString);
+		}
+		if (fileUrl) {
+			var arrayOfParts = fileUrl.split('.');
+			var lastPart = arrayOfParts[(arrayOfParts.length - 1)];
+			var formatParser = null;
+			if (lastPart == "json") {
+				formatParser = dojo.data.format.Json;
+			}
+			if (lastPart == "csv") {
+				formatParser = dojo.data.format.Csv;
+			}
+			if (formatParser) {
+				var fileContents = dojo.hostenv.getText(fileUrl);
+				formatParser.loadDataProviderFromFileContents(this, fileContents);
+			} else {
+				dojo.lang.assert(false, "new dojo.data.provider.FlatFile({url: }) was passed a file without a .csv or .json suffix");
+			}
+		}
+	}
+};
+dojo.inherits(dojo.data.provider.FlatFile, dojo.data.provider.Base);
+
+// -------------------------------------------------------------------
+// Public instance methods
+// -------------------------------------------------------------------
+dojo.data.provider.FlatFile.prototype.getProviderCapabilities = function(/* string */ keyword) {
+	dojo.lang.assertType(keyword, [String, "optional"]);
+	if (!this._ourCapabilities) {
+		this._ourCapabilities = {
+			transactions: false,
+			undo: false,
+			login: false,
+			versioning: false,
+			anonymousRead: true,
+			anonymousWrite: false,
+			permissions: false,
+			queries: false,
+			strongTyping: false,
+			datatypes: [String, Date, Number]
+		};
+	}
+	if (keyword) {
+		return this._ourCapabilities[keyword];
+	} else {
+		return this._ourCapabilities;
+	}
+};
+
+dojo.data.provider.FlatFile.prototype.registerAttribute = function(/* string or dojo.data.Attribute */ attributeId) {
+	var registeredAttribute = this.getAttribute(attributeId);
+	if (!registeredAttribute) {
+		var newAttribute = new dojo.data.Attribute(this, attributeId);
+		this._dictionaryOfAttributes[attributeId] = newAttribute;
+		registeredAttribute = newAttribute;
+	}
+	return registeredAttribute; // dojo.data.Attribute
+};
+
+dojo.data.provider.FlatFile.prototype.getAttribute = function(/* string or dojo.data.Attribute */ attributeId) {
+	var attribute = (this._dictionaryOfAttributes[attributeId] || null);
+	return attribute; // dojo.data.Attribute or null
+};
+
+dojo.data.provider.FlatFile.prototype.getAttributes = function() {
+	var arrayOfAttributes = [];
+	for (var key in this._dictionaryOfAttributes) {
+		var attribute = this._dictionaryOfAttributes[key];
+		arrayOfAttributes.push(attribute);
+	}
+	return arrayOfAttributes; // Array
+};
+
+dojo.data.provider.FlatFile.prototype.fetchArray = function(query) {
+	/**
+	 * summary: Returns an Array containing all of the Items.
+	 */ 
+	return this._arrayOfItems; // Array
+};
+
+dojo.data.provider.FlatFile.prototype.fetchResultSet = function(query) {
+	/**
+	 * summary: Returns a ResultSet containing all of the Items.
+	 */ 
+	if (!this._resultSet) {
+		this._resultSet = new dojo.data.ResultSet(this, this.fetchArray(query));
+	}
+	return this._resultSet; // dojo.data.ResultSet
+};
+
+// -------------------------------------------------------------------
+// Private instance methods
+// -------------------------------------------------------------------
+dojo.data.provider.FlatFile.prototype._newItem = function() {
+	var item = new dojo.data.Item(this);
+	this._arrayOfItems.push(item);
+	return item; // dojo.data.Item
+};
+
+dojo.data.provider.FlatFile.prototype._newAttribute = function(/* String */ attributeId) {
+	dojo.lang.assertType(attributeId, String);
+	dojo.lang.assert(this.getAttribute(attributeId) === null);
+	var attribute = new dojo.data.Attribute(this, attributeId);
+	this._dictionaryOfAttributes[attributeId] = attribute;
+	return attribute; // dojo.data.Attribute
+};
+
+dojo.data.provider.Base.prototype._getResultSets = function() {
+	return [this._resultSet]; // Array
+};
+

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/JotSpot.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/JotSpot.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/JotSpot.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/JotSpot.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,27 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.data.provider.JotSpot");
+dojo.require("dojo.data.provider.Base");
+
+// -------------------------------------------------------------------
+// Constructor
+// -------------------------------------------------------------------
+dojo.data.provider.JotSpot = function() {
+	/**
+	 * summary:
+	 * A JotSpot Data Provider knows how to read data from a JotSpot data 
+	 * store and make the contents accessable as dojo.data.Items.
+	 */
+	dojo.unimplemented('dojo.data.provider.JotSpot');
+};
+
+dojo.inherits(dojo.data.provider.JotSpot, dojo.data.provider.Base);
+

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/MySql.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/MySql.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/MySql.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/provider/MySql.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,27 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.data.provider.MySql");
+dojo.require("dojo.data.provider.Base");
+
+// -------------------------------------------------------------------
+// Constructor
+// -------------------------------------------------------------------
+dojo.data.provider.MySql = function() {
+	/**
+	 * summary:
+	 * A MySql Data Provider knows how to connect to a MySQL database
+	 * on a server and and make the content records available as 
+	 * dojo.data.Items.
+	 */
+	dojo.unimplemented('dojo.data.provider.MySql');
+};
+
+dojo.inherits(dojo.data.provider.MySql, dojo.data.provider.Base);

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/to_do.txt
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/to_do.txt?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/to_do.txt (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/data/to_do.txt Fri Aug 18 15:32:37 2006
@@ -0,0 +1,45 @@
+Existing Features
+ * can import data from .json or .csv format files
+ * can import data from del.icio.us
+ * can create and modify data programmatically
+ * can bind data to dojo.widget.Chart
+ * can bind data to dojo.widget.SortableTable
+ * can bind one data set to multiple widgets
+ * notifications: widgets are notified when data changes
+ * notification available per-item or per-resultSet
+ * can create ad-hoc attributes
+ * attributes can be loosely-typed 
+ * attributes can have meta-data like type and display name
+ * half-implemented support for sorting
+ * half-implemented support for export to .json
+ * API for getting data in simple arrays 
+ * API for getting ResultSets with iterators (precursor to support for something like the openrico.org live grid)
+ 
+~~~~~~~~~~~~~~~~~~~~~~~~
+To-Do List
+ * be able to import data from an html <table></table>
+ * think about being able to import data from some type of XML 
+ * think about integration with dojo.undo.Manager
+ * think more about how to represent the notion of different data types
+ * think about what problems we'll run into when we have a MySQL data provider
+ * in TableBindingHack, improve support for data types in the SortableTable binding
+ * deal with ids (including MySQL multi-field keys)
+ * add support for item-references:  employeeItem.set('department', departmentItem);
+ * deal with Attributes as instances of Items, not just subclasses of Items
+ * unit tests for compare/sort code
+ * unit tests for everything
+ * implement item.toString('json') and item.toString('xml')
+ * implement dataProvider.newItem({name: 'foo', age: 26})
+ * deal better with transactions
+ * add support for deleting items
+ * don't send out multiple notifications to the same observer
+ * deal with item versions
+ * prototype a Yahoo data provider -- http://developer.yahoo.net/common/json.html
+ * prototype a data provider that enforces strong typing
+ * prototype a data provider that prevents ad-hoc attributes
+ * prototype a data provider that enforces single-kind item
+ * prototype a data provider that allows for login/authentication
+ * have loosely typed result sets play nicely with widgets that expect strong typing
+ * prototype an example of spreadsheet-style formulas or derivation rules
+ * experiment with some sort of fetch() that returns only a subset of a data provider's items
+

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/date.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/date.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/date.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/date.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,761 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.date");
+
+
+/* Supplementary Date Functions
+ *******************************/
+
+dojo.date.setDayOfYear = function (dateObject, dayofyear) {
+	dateObject.setMonth(0);
+	dateObject.setDate(dayofyear);
+	return dateObject;
+}
+
+dojo.date.getDayOfYear = function (dateObject) {
+	var firstDayOfYear = new Date(dateObject.getFullYear(), 0, 1);
+	return Math.floor((dateObject.getTime() -
+		firstDayOfYear.getTime()) / 86400000);
+}
+
+
+
+
+dojo.date.setWeekOfYear = function (dateObject, week, firstDay) {
+	if (arguments.length == 1) { firstDay = 0; } // Sunday
+	dojo.unimplemented("dojo.date.setWeekOfYear");
+}
+
+dojo.date.getWeekOfYear = function (dateObject, firstDay) {
+	if (arguments.length == 1) { firstDay = 0; } // Sunday
+
+	// work out the first day of the year corresponding to the week
+	var firstDayOfYear = new Date(dateObject.getFullYear(), 0, 1);
+	var day = firstDayOfYear.getDay();
+	firstDayOfYear.setDate(firstDayOfYear.getDate() -
+			day + firstDay - (day > firstDay ? 7 : 0));
+
+	return Math.floor((dateObject.getTime() -
+		firstDayOfYear.getTime()) / 604800000);
+}
+
+
+
+
+dojo.date.setIsoWeekOfYear = function (dateObject, week, firstDay) {
+	if (arguments.length == 1) { firstDay = 1; } // Monday
+	dojo.unimplemented("dojo.date.setIsoWeekOfYear");
+}
+
+dojo.date.getIsoWeekOfYear = function (dateObject, firstDay) {
+	if (arguments.length == 1) { firstDay = 1; } // Monday
+	dojo.unimplemented("dojo.date.getIsoWeekOfYear");
+}
+
+
+
+
+/* ISO 8601 Functions
+ *********************/
+
+dojo.date.setIso8601 = function (dateObject, string){
+	var comps = (string.indexOf("T") == -1) ? string.split(" ") : string.split("T");
+	dojo.date.setIso8601Date(dateObject, comps[0]);
+	if (comps.length == 2) { dojo.date.setIso8601Time(dateObject, comps[1]); }
+	return dateObject;
+}
+
+dojo.date.fromIso8601 = function (string) {
+	return dojo.date.setIso8601(new Date(0, 0), string);
+}
+
+
+
+
+dojo.date.setIso8601Date = function (dateObject, string) {
+	var regexp = "^([0-9]{4})((-?([0-9]{2})(-?([0-9]{2}))?)|" +
+			"(-?([0-9]{3}))|(-?W([0-9]{2})(-?([1-7]))?))?$";
+	var d = string.match(new RegExp(regexp));
+	if(!d) {
+		dojo.debug("invalid date string: " + string);
+		return false;
+	}
+	var year = d[1];
+	var month = d[4];
+	var date = d[6];
+	var dayofyear = d[8];
+	var week = d[10];
+	var dayofweek = (d[12]) ? d[12] : 1;
+
+	dateObject.setYear(year);
+	
+	if (dayofyear) { dojo.date.setDayOfYear(dateObject, Number(dayofyear)); }
+	else if (week) {
+		dateObject.setMonth(0);
+		dateObject.setDate(1);
+		var gd = dateObject.getDay();
+		var day =  (gd) ? gd : 7;
+		var offset = Number(dayofweek) + (7 * Number(week));
+		
+		if (day <= 4) { dateObject.setDate(offset + 1 - day); }
+		else { dateObject.setDate(offset + 8 - day); }
+	} else {
+		if (month) { 
+			dateObject.setDate(1);
+			dateObject.setMonth(month - 1); 
+		}
+		if (date) { dateObject.setDate(date); }
+	}
+	
+	return dateObject;
+}
+
+dojo.date.fromIso8601Date = function (string) {
+	return dojo.date.setIso8601Date(new Date(0, 0), string);
+}
+
+
+
+
+dojo.date.setIso8601Time = function (dateObject, string) {
+	// first strip timezone info from the end
+	var timezone = "Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$";
+	var d = string.match(new RegExp(timezone));
+
+	var offset = 0; // local time if no tz info
+	if (d) {
+		if (d[0] != 'Z') {
+			offset = (Number(d[3]) * 60) + Number(d[5]);
+			offset *= ((d[2] == '-') ? 1 : -1);
+		}
+		offset -= dateObject.getTimezoneOffset();
+		string = string.substr(0, string.length - d[0].length);
+	}
+
+	// then work out the time
+	var regexp = "^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(\.([0-9]+))?)?)?$";
+	var d = string.match(new RegExp(regexp));
+	if(!d) {
+		dojo.debug("invalid time string: " + string);
+		return false;
+	}
+	var hours = d[1];
+	var mins = Number((d[3]) ? d[3] : 0);
+	var secs = (d[5]) ? d[5] : 0;
+	var ms = d[7] ? (Number("0." + d[7]) * 1000) : 0;
+
+	dateObject.setHours(hours);
+	dateObject.setMinutes(mins);
+	dateObject.setSeconds(secs);
+	dateObject.setMilliseconds(ms);
+	
+	return dateObject;
+}
+
+dojo.date.fromIso8601Time = function (string) {
+	return dojo.date.setIso8601Time(new Date(0, 0), string);
+}
+
+
+
+/* Informational Functions
+ **************************/
+
+dojo.date.shortTimezones = ["IDLW", "BET", "HST", "MART", "AKST", "PST", "MST",
+	"CST", "EST", "AST", "NFT", "BST", "FST", "AT", "GMT", "CET", "EET", "MSK",
+	"IRT", "GST", "AFT", "AGTT", "IST", "NPT", "ALMT", "MMT", "JT", "AWST",
+	"JST", "ACST", "AEST", "LHST", "VUT", "NFT", "NZT", "CHAST", "PHOT",
+	"LINT"];
+dojo.date.timezoneOffsets = [-720, -660, -600, -570, -540, -480, -420, -360,
+	-300, -240, -210, -180, -120, -60, 0, 60, 120, 180, 210, 240, 270, 300,
+	330, 345, 360, 390, 420, 480, 540, 570, 600, 630, 660, 690, 720, 765, 780,
+	840];
+/*
+dojo.date.timezones = ["International Date Line West", "Bering Standard Time",
+	"Hawaiian Standard Time", "Marquesas Time", "Alaska Standard Time",
+	"Pacific Standard Time (USA)", "Mountain Standard Time",
+	"Central Standard Time (USA)", "Eastern Standard Time (USA)",
+	"Atlantic Standard Time", "Newfoundland Time", "Brazil Standard Time",
+	"Fernando de Noronha Standard Time (Brazil)", "Azores Time",
+	"Greenwich Mean Time", "Central Europe Time", "Eastern Europe Time",
+	"Moscow Time", "Iran Standard Time", "Gulf Standard Time",
+	"Afghanistan Time", "Aqtobe Time", "Indian Standard Time", "Nepal Time",
+	"Almaty Time", "Myanmar Time", "Java Time",
+	"Australian Western Standard Time", "Japan Standard Time",
+	"Australian Central Standard Time", "Lord Hove Standard Time (Australia)",
+	"Vanuata Time", "Norfolk Time (Australia)", "New Zealand Standard Time",
+	"Chatham Standard Time (New Zealand)", "Phoenix Islands Time (Kribati)",
+	"Line Islands Time (Kribati)"];
+*/
+dojo.date.months = ["January", "February", "March", "April", "May", "June",
+	"July", "August", "September", "October", "November", "December"];
+dojo.date.shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "June",
+	"July", "Aug", "Sep", "Oct", "Nov", "Dec"];
+dojo.date.days = ["Sunday", "Monday", "Tuesday", "Wednesday",
+	"Thursday", "Friday", "Saturday"];
+dojo.date.shortDays = ["Sun", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat"];
+
+
+dojo.date.getDaysInMonth = function (dateObject) {
+	var month = dateObject.getMonth();
+	var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+	if (month == 1 && dojo.date.isLeapYear(dateObject)) { return 29; }
+	else { return days[month]; }
+}
+
+dojo.date.isLeapYear = function (dateObject) {
+	/*
+	 * Leap years are years with an additional day YYYY-02-29, where the year
+	 * number is a multiple of four with the following exception: If a year
+	 * is a multiple of 100, then it is only a leap year if it is also a
+	 * multiple of 400. For example, 1900 was not a leap year, but 2000 is one.
+	 */
+	var year = dateObject.getFullYear();
+	return (year%400 == 0) ? true : (year%100 == 0) ? false : (year%4 == 0) ? true : false;
+}
+
+
+
+dojo.date.getDayName = function (dateObject) {
+	return dojo.date.days[dateObject.getDay()];
+}
+
+dojo.date.getDayShortName = function (dateObject) {
+	return dojo.date.shortDays[dateObject.getDay()];
+}
+
+
+
+
+dojo.date.getMonthName = function (dateObject) {
+	return dojo.date.months[dateObject.getMonth()];
+}
+
+dojo.date.getMonthShortName = function (dateObject) {
+	return dojo.date.shortMonths[dateObject.getMonth()];
+}
+
+
+
+
+dojo.date.getTimezoneName = function (dateObject) {
+	// need to negate timezones to get it right 
+	// i.e UTC+1 is CET winter, but getTimezoneOffset returns -60
+	var timezoneOffset = -(dateObject.getTimezoneOffset());
+	
+	for (var i = 0; i < dojo.date.timezoneOffsets.length; i++) {
+		if (dojo.date.timezoneOffsets[i] == timezoneOffset) {
+			return dojo.date.shortTimezones[i];
+		}
+	}
+	
+	// we don't know so return it formatted as "+HH:MM"
+	function $ (s) { s = String(s); while (s.length < 2) { s = "0" + s; } return s; }
+	return (timezoneOffset < 0 ? "-" : "+") + $(Math.floor(Math.abs(
+		timezoneOffset)/60)) + ":" + $(Math.abs(timezoneOffset)%60);
+}
+
+
+
+
+dojo.date.getOrdinal = function (dateObject) {
+	var date = dateObject.getDate();
+
+	if (date%100 != 11 && date%10 == 1) { return "st"; }
+	else if (date%100 != 12 && date%10 == 2) { return "nd"; }
+	else if (date%100 != 13 && date%10 == 3) { return "rd"; }
+	else { return "th"; }
+}
+
+
+
+/* Date Formatter Functions
+ ***************************/
+
+// POSIX strftime
+// see <http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html>
+dojo.date.format = dojo.date.strftime = function (dateObject, format) {
+
+	// zero pad
+	var padChar = null;
+	function _ (s, n) {
+		s = String(s);
+		n = (n || 2) - s.length;
+		while (n-- > 0) { s = (padChar == null ? "0" : padChar) + s; }
+		return s;
+	}
+	
+	function $ (property) {
+		switch (property) {
+			case "a": // abbreviated weekday name according to the current locale
+				return dojo.date.getDayShortName(dateObject); break;
+
+			case "A": // full weekday name according to the current locale
+				return dojo.date.getDayName(dateObject); break;
+
+			case "b":
+			case "h": // abbreviated month name according to the current locale
+				return dojo.date.getMonthShortName(dateObject); break;
+				
+			case "B": // full month name according to the current locale
+				return dojo.date.getMonthName(dateObject); break;
+				
+			case "c": // preferred date and time representation for the current
+				      // locale
+				return dateObject.toLocaleString(); break;
+
+			case "C": // century number (the year divided by 100 and truncated
+				      // to an integer, range 00 to 99)
+				return _(Math.floor(dateObject.getFullYear()/100)); break;
+				
+			case "d": // day of the month as a decimal number (range 01 to 31)
+				return _(dateObject.getDate()); break;
+				
+			case "D": // same as %m/%d/%y
+				return $("m") + "/" + $("d") + "/" + $("y"); break;
+					
+			case "e": // day of the month as a decimal number, a single digit is
+				      // preceded by a space (range ' 1' to '31')
+				if (padChar == null) { padChar = " "; }
+				return _(dateObject.getDate(), 2); break;
+			
+			case "g": // like %G, but without the century.
+				break;
+			
+			case "G": // The 4-digit year corresponding to the ISO week number
+				      // (see %V).  This has the same format and value as %Y,
+				      // except that if the ISO week number belongs to the
+				      // previous or next year, that year is used instead.
+				break;
+			
+			case "F": // same as %Y-%m-%d
+				return $("Y") + "-" + $("m") + "-" + $("d"); break;
+				
+			case "H": // hour as a decimal number using a 24-hour clock (range
+				      // 00 to 23)
+				return _(dateObject.getHours()); break;
+				
+			case "I": // hour as a decimal number using a 12-hour clock (range
+				      // 01 to 12)
+				return _(dateObject.getHours() % 12 || 12); break;
+				
+			case "j": // day of the year as a decimal number (range 001 to 366)
+				return _(dojo.date.getDayOfYear(dateObject), 3); break;
+				
+			case "m": // month as a decimal number (range 01 to 12)
+				return _(dateObject.getMonth() + 1); break;
+				
+			case "M": // minute as a decimal numbe
+				return _(dateObject.getMinutes()); break;
+			
+			case "n":
+				return "\n"; break;
+
+			case "p": // either `am' or `pm' according to the given time value,
+				      // or the corresponding strings for the current locale
+				return dateObject.getHours() < 12 ? "am" : "pm"; break;
+				
+			case "r": // time in a.m. and p.m. notation
+				return $("I") + ":" + $("M") + ":" + $("S") + " " + $("p"); break;
+				
+			case "R": // time in 24 hour notation
+				return $("H") + ":" + $("M"); break;
+				
+			case "S": // second as a decimal number
+				return _(dateObject.getSeconds()); break;
+
+			case "t":
+				return "\t"; break;
+
+			case "T": // current time, equal to %H:%M:%S
+				return $("H") + ":" + $("M") + ":" + $("S"); break;
+				
+			case "u": // weekday as a decimal number [1,7], with 1 representing
+				      // Monday
+				return String(dateObject.getDay() || 7); break;
+				
+			case "U": // week number of the current year as a decimal number,
+				      // starting with the first Sunday as the first day of the
+				      // first week
+				return _(dojo.date.getWeekOfYear(dateObject)); break;
+
+			case "V": // week number of the year (Monday as the first day of the
+				      // week) as a decimal number [01,53]. If the week containing
+				      // 1 January has four or more days in the new year, then it 
+				      // is considered week 1. Otherwise, it is the last week of 
+				      // the previous year, and the next week is week 1.
+				return _(dojo.date.getIsoWeekOfYear(dateObject)); break;
+				
+			case "W": // week number of the current year as a decimal number,
+				      // starting with the first Monday as the first day of the
+				      // first week
+				return _(dojo.date.getWeekOfYear(dateObject, 1)); break;
+				
+			case "w": // day of the week as a decimal, Sunday being 0
+				return String(dateObject.getDay()); break;
+
+			case "x": // preferred date representation for the current locale
+				      // without the time
+				break;
+
+			case "X": // preferred date representation for the current locale
+				      // without the time
+				break;
+
+			case "y": // year as a decimal number without a century (range 00 to
+				      // 99)
+				return _(dateObject.getFullYear()%100); break;
+				
+			case "Y": // year as a decimal number including the century
+				return String(dateObject.getFullYear()); break;
+			
+			case "z": // time zone or name or abbreviation
+				var timezoneOffset = dateObject.getTimezoneOffset();
+				return (timezoneOffset < 0 ? "-" : "+") + 
+					_(Math.floor(Math.abs(timezoneOffset)/60)) + ":" +
+					_(Math.abs(timezoneOffset)%60); break;
+				
+			case "Z": // time zone or name or abbreviation
+				return dojo.date.getTimezoneName(dateObject); break;
+			
+			case "%":
+				return "%"; break;
+		}
+	}
+
+	// parse the formatting string and construct the resulting string
+	var string = "";
+	var i = 0, index = 0, switchCase;
+	while ((index = format.indexOf("%", i)) != -1) {
+		string += format.substring(i, index++);
+		
+		// inspect modifier flag
+		switch (format.charAt(index++)) {
+			case "_": // Pad a numeric result string with spaces.
+				padChar = " "; break;
+			case "-": // Do not pad a numeric result string.
+				padChar = ""; break;
+			case "0": // Pad a numeric result string with zeros.
+				padChar = "0"; break;
+			case "^": // Convert characters in result string to upper case.
+				switchCase = "upper"; break;
+			case "#": // Swap the case of the result string.
+				switchCase = "swap"; break;
+			default: // no modifer flag so decremenet the index
+				padChar = null; index--; break;
+		}
+
+		// toggle case if a flag is set
+		var property = $(format.charAt(index++));
+		if (switchCase == "upper" ||
+			(switchCase == "swap" && /[a-z]/.test(property))) {
+			property = property.toUpperCase();
+		} else if (switchCase == "swap" && !/[a-z]/.test(property)) {
+			property = property.toLowerCase();
+		}
+		var swicthCase = null;
+		
+		string += property;
+		i = index;
+	}
+	string += format.substring(i);
+	
+	return string;
+}
+
+/* compare and add
+ ******************/
+dojo.date.compareTypes={
+	// 	summary
+	//	bitmask for comparison operations.
+	DATE:1, TIME:2 
+};
+dojo.date.compare=function(/* Date */ dateA, /* Date */ dateB, /* int */ options){
+	//	summary
+	//	Compare two date objects by date, time, or both.
+	var dA=dateA;
+	var dB=dateB||new Date();
+	var now=new Date();
+	var opt=options||(dojo.date.compareTypes.DATE|dojo.date.compareTypes.TIME);
+	var d1=new Date(
+		((opt&dojo.date.compareTypes.DATE)?(dA.getFullYear()):now.getFullYear()), 
+		((opt&dojo.date.compareTypes.DATE)?(dA.getMonth()):now.getMonth()), 
+		((opt&dojo.date.compareTypes.DATE)?(dA.getDate()):now.getDate()), 
+		((opt&dojo.date.compareTypes.TIME)?(dA.getHours()):0), 
+		((opt&dojo.date.compareTypes.TIME)?(dA.getMinutes()):0), 
+		((opt&dojo.date.compareTypes.TIME)?(dA.getSeconds()):0)
+	);
+	var d2=new Date(
+		((opt&dojo.date.compareTypes.DATE)?(dB.getFullYear()):now.getFullYear()), 
+		((opt&dojo.date.compareTypes.DATE)?(dB.getMonth()):now.getMonth()), 
+		((opt&dojo.date.compareTypes.DATE)?(dB.getDate()):now.getDate()), 
+		((opt&dojo.date.compareTypes.TIME)?(dB.getHours()):0), 
+		((opt&dojo.date.compareTypes.TIME)?(dB.getMinutes()):0), 
+		((opt&dojo.date.compareTypes.TIME)?(dB.getSeconds()):0)
+	);
+	if(d1.valueOf()>d2.valueOf()){
+		return 1;	//	int
+	}
+	if(d1.valueOf()<d2.valueOf()){
+		return -1;	//	int
+	}
+	return 0;	//	int
+}
+
+dojo.date.dateParts={ 
+	//	summary
+	//	constants for use in dojo.date.add
+	YEAR:0, MONTH:1, DAY:2, HOUR:3, MINUTE:4, SECOND:5, MILLISECOND:6 
+};
+dojo.date.add=function(/* Date */ d, /* dojo.date.dateParts */ unit, /* int */ amount){
+	var n=(amount)?amount:1;
+	var v;
+	switch(unit){
+		case dojo.date.dateParts.YEAR:{
+			v=new Date(d.getFullYear()+n, d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
+			break;
+		}
+		case dojo.date.dateParts.MONTH:{
+			v=new Date(d.getFullYear(), d.getMonth()+n, d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
+			break;
+		}
+		case dojo.date.dateParts.HOUR:{
+			v=new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours()+n, d.getMinutes(), d.getSeconds(), d.getMilliseconds());
+			break;
+		}
+		case dojo.date.dateParts.MINUTE:{
+			v=new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes()+n, d.getSeconds(), d.getMilliseconds());
+			break;
+		}
+		case dojo.date.dateParts.SECOND:{
+			v=new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()+n, d.getMilliseconds());
+			break;
+		}
+		case dojo.date.dateParts.MILLISECOND:{
+			v=new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()+n);
+			break;
+		}
+		default:{
+			v=new Date(d.getFullYear(), d.getMonth(), d.getDate()+n, d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());
+		}
+	};
+	return v;	//	Date
+};
+
+/* Deprecated
+ *************/
+
+
+dojo.date.toString = function(date, format){
+	dojo.deprecated("dojo.date.toString",
+		"use dojo.date.format instead", "0.4");
+
+	if (format.indexOf("#d") > -1) {
+		format = format.replace(/#dddd/g, dojo.date.getDayOfWeekName(date));
+		format = format.replace(/#ddd/g, dojo.date.getShortDayOfWeekName(date));
+		format = format.replace(/#dd/g, (date.getDate().toString().length==1?"0":"")+date.getDate());
+		format = format.replace(/#d/g, date.getDate());
+	}
+
+	if (format.indexOf("#M") > -1) {
+		format = format.replace(/#MMMM/g, dojo.date.getMonthName(date));
+		format = format.replace(/#MMM/g, dojo.date.getShortMonthName(date));
+		format = format.replace(/#MM/g, ((date.getMonth()+1).toString().length==1?"0":"")+(date.getMonth()+1));
+		format = format.replace(/#M/g, date.getMonth() + 1);
+	}
+
+	if (format.indexOf("#y") > -1) {
+		var fullYear = date.getFullYear().toString();
+		format = format.replace(/#yyyy/g, fullYear);
+		format = format.replace(/#yy/g, fullYear.substring(2));
+		format = format.replace(/#y/g, fullYear.substring(3));
+	}
+
+	// Return if only date needed;
+	if (format.indexOf("#") == -1) {
+		return format;
+	}
+	
+	if (format.indexOf("#h") > -1) {
+		var hours = date.getHours();
+		hours = (hours > 12 ? hours - 12 : (hours == 0) ? 12 : hours);
+		format = format.replace(/#hh/g, (hours.toString().length==1?"0":"")+hours);
+		format = format.replace(/#h/g, hours);
+	}
+	
+	if (format.indexOf("#H") > -1) {
+		format = format.replace(/#HH/g, (date.getHours().toString().length==1?"0":"")+date.getHours());
+		format = format.replace(/#H/g, date.getHours());
+	}
+	
+	if (format.indexOf("#m") > -1) {
+		format = format.replace(/#mm/g, (date.getMinutes().toString().length==1?"0":"")+date.getMinutes());
+		format = format.replace(/#m/g, date.getMinutes());
+	}
+
+	if (format.indexOf("#s") > -1) {
+		format = format.replace(/#ss/g, (date.getSeconds().toString().length==1?"0":"")+date.getSeconds());
+		format = format.replace(/#s/g, date.getSeconds());
+	}
+	
+	if (format.indexOf("#T") > -1) {
+		format = format.replace(/#TT/g, date.getHours() >= 12 ? "PM" : "AM");
+		format = format.replace(/#T/g, date.getHours() >= 12 ? "P" : "A");
+	}
+
+	if (format.indexOf("#t") > -1) {
+		format = format.replace(/#tt/g, date.getHours() >= 12 ? "pm" : "am");
+		format = format.replace(/#t/g, date.getHours() >= 12 ? "p" : "a");
+	}
+					
+	return format;
+	
+}
+
+
+dojo.date.daysInMonth = function (month, year) {
+	dojo.deprecated("daysInMonth(month, year)",
+		"replaced by getDaysInMonth(dateObject)", "0.4");
+	return dojo.date.getDaysInMonth(new Date(year, month, 1));
+}
+
+/**
+ *
+ * Returns a string of the date in the version "January 1, 2004"
+ *
+ * @param date The date object
+ */
+dojo.date.toLongDateString = function(date) {
+	dojo.deprecated("dojo.date.toLongDateString",
+		'use dojo.date.format(date, "%B %e, %Y") instead', "0.4");
+	return dojo.date.format(date, "%B %e, %Y")
+}
+
+/**
+ *
+ * Returns a string of the date in the version "Jan 1, 2004"
+ *
+ * @param date The date object
+ */
+dojo.date.toShortDateString = function(date) {
+	dojo.deprecated("dojo.date.toShortDateString",
+		'use dojo.date.format(date, "%b %e, %Y") instead', "0.4");
+	return dojo.date.format(date, "%b %e, %Y");
+}
+
+/**
+ *
+ * Returns military formatted time
+ *
+ * @param date the date object
+ */
+dojo.date.toMilitaryTimeString = function(date){
+	dojo.deprecated("dojo.date.toMilitaryTimeString",
+		'use dojo.date.format(date, "%T")', "0.4");
+	return dojo.date.format(date, "%T");
+}
+
+/**
+ *
+ * Returns a string of the date relative to the current date.
+ *
+ * @param date The date object
+ *
+ * Example returns:
+ * - "1 minute ago"
+ * - "4 minutes ago"
+ * - "Yesterday"
+ * - "2 days ago"
+ */
+dojo.date.toRelativeString = function(date) {
+	var now = new Date();
+	var diff = (now - date) / 1000;
+	var end = " ago";
+	var future = false;
+	if(diff < 0) {
+		future = true;
+		end = " from now";
+		diff = -diff;
+	}
+
+	if(diff < 60) {
+		diff = Math.round(diff);
+		return diff + " second" + (diff == 1 ? "" : "s") + end;
+	} else if(diff < 3600) {
+		diff = Math.round(diff/60);
+		return diff + " minute" + (diff == 1 ? "" : "s") + end;
+	} else if(diff < 3600*24 && date.getDay() == now.getDay()) {
+		diff = Math.round(diff/3600);
+		return diff + " hour" + (diff == 1 ? "" : "s") + end;
+	} else if(diff < 3600*24*7) {
+		diff = Math.round(diff/(3600*24));
+		if(diff == 1) {
+			return future ? "Tomorrow" : "Yesterday";
+		} else {
+			return diff + " days" + end;
+		}
+	} else {
+		return dojo.date.toShortDateString(date);
+	}
+}
+
+/**
+ * Retrieves the day of the week the Date is set to.
+ *
+ * @return The day of the week
+ */
+dojo.date.getDayOfWeekName = function (date) {
+	dojo.deprecated("dojo.date.getDayOfWeekName",
+		"use dojo.date.getDayName instead", "0.4");
+	return dojo.date.days[date.getDay()];
+}
+
+/**
+ * Retrieves the short day of the week name the Date is set to.
+ *
+ * @return The short day of the week name
+ */
+dojo.date.getShortDayOfWeekName = function (date) {
+	dojo.deprecated("dojo.date.getShortDayOfWeekName",
+		"use dojo.date.getDayShortName instead", "0.4");
+	return dojo.date.shortDays[date.getDay()];
+}
+
+/**
+ * Retrieves the short month name the Date is set to.
+ *
+ * @return The short month name
+ */
+dojo.date.getShortMonthName = function (date) {
+	dojo.deprecated("dojo.date.getShortMonthName",
+		"use dojo.date.getMonthShortName instead", "0.4");
+	return dojo.date.shortMonths[date.getMonth()];
+}
+
+
+/**
+ * Convert a Date to a SQL string, optionally ignoring the HH:MM:SS portion of the Date
+ */
+dojo.date.toSql = function(date, noTime) {
+	return dojo.date.format(date, "%F" + !noTime ? " %T" : "");
+}
+
+/**
+ * Convert a SQL date string to a JavaScript Date object
+ */
+dojo.date.fromSql = function(sqlDate) {
+	var parts = sqlDate.split(/[\- :]/g);
+	while(parts.length < 6) {
+		parts.push(0);
+	}
+	return new Date(parts[0], (parseInt(parts[1],10)-1), parts[2], parts[3], parts[4], parts[5]);
+}
+

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,80 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+/**
+ * Produce a line of debug output. 
+ * Does nothing unless djConfig.isDebug is true.
+ * varargs, joined with ''.
+ * Caller should not supply a trailing "\n".
+ */
+dojo.debug = function(){
+	if (!djConfig.isDebug) { return; }
+	var args = arguments;
+	if(dj_undef("println", dojo.hostenv)){
+		dojo.raise("dojo.debug not available (yet?)");
+	}
+	var isJUM = dj_global["jum"] && !dj_global["jum"].isBrowser;
+	var s = [(isJUM ? "": "DEBUG: ")];
+	for(var i=0;i<args.length;++i){
+		if(!false && args[i] && args[i] instanceof Error){
+			var msg = "[" + args[i].name + ": " + dojo.errorToString(args[i]) +
+				(args[i].fileName ? ", file: " + args[i].fileName : "") +
+				(args[i].lineNumber ? ", line: " + args[i].lineNumber : "") + "]";
+		} else {
+			try {
+				var msg = String(args[i]);
+			} catch(e) {
+				if(dojo.render.html.ie) {
+					var msg = "[ActiveXObject]";
+				} else {
+					var msg = "[unknown]";
+				}
+			}
+		}
+		s.push(msg);
+	}
+	if(isJUM){ // this seems to be the only way to get JUM to "play nice"
+		jum.debug(s.join(" "));
+	}else{
+		dojo.hostenv.println(s.join(" "));
+	}
+}
+
+/**
+ * this is really hacky for now - just 
+ * display the properties of the object
+**/
+
+dojo.debugShallow = function(obj){
+	if (!djConfig.isDebug) { return; }
+	dojo.debug('------------------------------------------------------------');
+	dojo.debug('Object: '+obj);
+	var props = [];
+	for(var prop in obj){
+		try {
+			props.push(prop + ': ' + obj[prop]);
+		} catch(E) {
+			props.push(prop + ': ERROR - ' + E.message);
+		}
+	}
+	props.sort();
+	for(var i = 0; i < props.length; i++) {
+		dojo.debug(props[i]);
+	}
+	dojo.debug('------------------------------------------------------------');
+}
+
+dojo.debugDeep = function(obj){
+	if (!djConfig.isDebug) { return; }
+	if (!dojo.uri || !dojo.uri.dojoUri){ return dojo.debug("You'll need to load dojo.uri.* for deep debugging - sorry!"); }
+	if (!window.open){ return dojo.debug('Deep debugging is only supported in host environments with window.open'); }
+	var win = window.open(dojo.uri.dojoUri("src/debug/deep.html"), '_blank', 'width=600, height=400, resizable=yes, scrollbars=yes, status=yes');
+	win.debugVar = obj;
+}

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/Firebug.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/Firebug.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/Firebug.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/Firebug.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,17 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.provide("dojo.debug.Firebug");
+
+if (console.log) {
+	dojo.hostenv.println=console.log;
+} else {
+	dojo.debug("dojo.debug.Firebug requires Firebug > 0.4");
+}

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/arrow_hide.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/arrow_hide.gif?rev=432754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/arrow_hide.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/arrow_show.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/arrow_show.gif?rev=432754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/arrow_show.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/deep.html
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/deep.html?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/deep.html (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/deep.html Fri Aug 18 15:32:37 2006
@@ -0,0 +1,359 @@
+<html>
+<head>
+<title>Deep Debugger</title>
+<script>
+
+var tableRows = {};
+var tableCels = {};
+var tableObjs = {};
+var tablesBuilt = {};
+var tableShows = {};
+var tableHides = {};
+
+// IE: nodes w/id need to be redeclared or getElementById is b0rked
+var frame = null;
+
+window.onload = function(){
+	// if IE loads this page too quickly (instantly) then 
+	// window.debugVar might not have been set
+	window.setTimeout(startMeUp, 100);
+}
+
+function startMeUp(){
+	frame = document.getElementById('frame');
+	buildTable('root', frame, window.debugVar);
+}
+
+function buildTable(path, parent, obj){
+
+	var keys = [];
+	var vals = [];
+	for(var prop in obj){
+		keys.push(prop);
+		try {
+			vals[prop] = obj[prop];
+		} catch(E) {
+			vals[prop] = 'ERROR: ' + E.message;
+		}
+	}
+	keys.sort(keySorter);
+
+	if (!keys.length){
+
+		var div = document.createElement('div');
+		div.appendChild(document.createTextNode('Object has no properties.'));
+
+		parent.appendChild(div);
+		return;
+	}
+
+
+	var t = document.createElement('table');
+	t.border = "1";
+
+	var tb = document.createElement('tbody');
+	t.appendChild(tb);
+
+
+	for(var i = 0; i < keys.length; i++) {
+		buildTableRow(path+'-'+keys[i], tb, keys[i], vals[keys[i]]);
+	}
+
+	if (path == 'root'){
+		//t.style.width = '90%';
+	}
+	t.style.width = '100%';
+
+	parent.appendChild(t);
+
+	tablesBuilt[path] = true;
+}
+
+function buildTableRow(path, tb, name, value) {
+
+	var simpleType = typeof(value);
+	var createSubrow = (simpleType == 'object');
+	var complexType = simpleType;
+
+	if (simpleType == 'object'){
+		var cls = getConstructorClass(value);
+		if (cls){
+			if (cls == 'Object'){
+			}else if (cls == 'Array'){
+				complexType = 'array';
+			}else{
+				complexType += ' ('+cls+')';
+			}
+		}
+	}
+
+/*var tr1 = document.createElement('tr');
+	var td1 = document.createElement('td');
+	var td2 = document.createElement('td');
+	var td3 = document.createElement('td');
+	var td4 = document.createElement('td');*/
+
+	var row = tb.rows.length;
+	var tr1 = tb.insertRow(row++);
+	var td1 = tr1.insertCell(0);
+	var td2 = tr1.insertCell(1);
+	var td3 = tr1.insertCell(2);
+	var td4 = tr1.insertCell(3);
+	
+	tr1.style.verticalAlign = 'top';
+	td1.style.verticalAlign = 'middle';
+
+	td1.className = 'propPlus';
+	td2.className = 'propName';
+	td3.className = 'propType';
+	td4.className = 'propVal';
+
+	//tr1.appendChild(td1);
+	//tr1.appendChild(td2);
+	//tr1.appendChild(td3);
+	//tr1.appendChild(td4);
+
+	if (createSubrow){
+		var img1 = document.createElement('img');
+		img1.width = 9;
+		img1.height = 9;
+		img1.src = 'arrow_show.gif';
+		var a1 = document.createElement('a');
+		a1.appendChild(img1);
+		a1.href = '#';
+		a1.onclick = function(){ showTableRow(path); return false; };
+
+		var img2 = document.createElement('img');
+		img2.width = 9;
+		img2.height = 9;
+		img2.src = 'arrow_hide.gif';
+		var a2 = document.createElement('a');
+		a2.appendChild(img2);
+		a2.href = '#';
+		a2.onclick = function(){ hideTableRow(path); return false; };
+		a2.style.display = 'none';
+
+		tableShows[path] = a1;
+		tableHides[path] = a2;
+
+		td1.appendChild(a1);
+		td1.appendChild(a2);
+	}else{
+		var img = document.createElement('img');
+		img.width = 9;
+		img.height = 9;
+		img.src = 'spacer.gif';
+
+		td1.appendChild(img);
+	}
+
+	td2.appendChild(document.createTextNode(name));
+	td3.appendChild(document.createTextNode(complexType));
+	td4.appendChild(buildPreBlock(value));
+
+	//tb.appendChild(tr1);
+
+	if (createSubrow){
+		var tr2 = tb.insertRow(row++);
+		var td5 = tr2.insertCell(0);
+		var td6 = tr2.insertCell(1);
+		
+		//var tr2 = document.createElement('tr');
+		//var td5 = document.createElement('td');
+		//var td6 = document.createElement('td');
+
+		td5.innerHTML = '&nbsp;';
+		//td6.innerHTML = '&nbsp;';
+
+		td6.colSpan = '3';
+
+		tr2.appendChild(td5);
+		tr2.appendChild(td6);
+
+		tr2.style.display = 'none';
+
+		tb.appendChild(tr2);
+
+		tableRows[path] = tr2;
+		tableCels[path] = td6;
+		tableObjs[path] = value;
+	}
+}
+
+function showTableRow(path){
+
+	var tr = tableRows[path];
+	var td = tableCels[path];
+	var a1 = tableShows[path];
+	var a2 = tableHides[path];
+
+	if (!tablesBuilt[path]){
+
+		//alert('building table for '+path);
+		buildTable(path, td, tableObjs[path]);
+	}
+
+	tr.style.display = 'table-row';
+
+	a1.style.display = 'none';
+	a2.style.display = 'inline';
+}
+
+function hideTableRow(path){
+
+	var tr = tableRows[path];
+	var a1 = tableShows[path];
+	var a2 = tableHides[path];
+
+	tr.style.display = 'none';
+
+	a1.style.display = 'inline';
+	a2.style.display = 'none';
+}
+
+function buildPreBlock(value){
+
+	//
+	// how many lines ?
+	//
+
+	var s = ''+value;
+	s = s.replace("\r\n", "\n");
+	s = s.replace("\r", "");
+	var lines = s.split("\n");
+
+
+	if (lines.length < 2){
+
+		if (lines[0].length < 60){
+
+			var pre = document.createElement('pre');
+			pre.appendChild(document.createTextNode(s));
+			return pre;
+		}
+	}
+
+
+	//
+	// multiple lines :(
+	//
+
+	var preview = lines[0].substr(0, 60) + ' ...';
+
+	var pre1 = document.createElement('pre');
+	pre1.appendChild(document.createTextNode(preview));
+	pre1.className = 'clicky';
+
+	var pre2 = document.createElement('pre');
+	pre2.appendChild(document.createTextNode(s));
+	pre2.style.display = 'none';
+	pre2.className = 'clicky';
+
+	pre1.onclick = function(){
+		pre1.style.display = 'none';
+		pre2.style.display = 'block';
+	}
+
+	pre2.onclick = function(){
+		pre1.style.display = 'block';
+		pre2.style.display = 'none';
+	}
+
+	var pre = document.createElement('div');
+
+	pre.appendChild(pre1);
+	pre.appendChild(pre2);
+
+	return pre;
+}
+
+function getConstructorClass(obj){
+
+	if (!obj.constructor || !obj.constructor.toString) return;
+
+	var m = obj.constructor.toString().match(/function\s*(\w+)/);
+
+	if (m && m.length == 2) return m[1];
+
+	return null;
+}
+
+function keySorter(a, b){
+
+	if (a == parseInt(a) && b == parseInt(b)){
+
+		return (parseInt(a) > parseInt(b)) ? 1 : ((parseInt(a) < parseInt(b)) ? -1 : 0);
+	}
+
+	// sort by lowercase string
+
+	var a2 = String(a).toLowerCase();
+	var b2 = String(b).toLowerCase();
+
+	return (a2 > b2) ? 1 : ((a2 < b2) ? -1 : 0);
+}
+
+</script>
+<style>
+
+body {
+	font-family: arial, helvetica, sans-serif;
+}
+
+table {
+	border-width: 0px;
+	border-spacing: 1px;
+	border-collapse: separate;
+}
+
+td {
+	border-width: 0px;
+	padding: 2px;
+}
+
+img {
+	border: 0;
+}
+
+pre {
+	margin: 0;
+	padding: 0;
+	white-space: -moz-pre-wrap;  /* Mozilla, supported since 1999 */
+	white-space: -pre-wrap;      /* Opera 4 - 6 */
+	white-space: -o-pre-wrap;    /* Opera 7 */
+	white-space: pre-wrap;       /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
+	word-wrap: break-word;       /* IE 5.5+ */
+}
+
+pre.clicky {
+	cursor: hand;
+	cursor: pointer;
+}
+
+td.propPlus {
+	width: 9px;
+	background-color: #ddd;
+}
+
+td.propName {
+	background-color: #ddd;
+}
+
+td.propType {
+	background-color: #ddd;
+}
+
+td.propVal {
+	background-color: #ddd;
+}
+
+</style>
+</head>
+<body>
+
+<h2>Javascript Object Browser</h2>
+
+<div id="frame"></div>
+
+</body>
+</html>
\ No newline at end of file

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/spacer.gif
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/spacer.gif?rev=432754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/debug/spacer.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/dnd/DragAndDrop.js
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/dnd/DragAndDrop.js?rev=432754&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/dnd/DragAndDrop.js (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/dojo/resource/src/dnd/DragAndDrop.js Fri Aug 18 15:32:37 2006
@@ -0,0 +1,175 @@
+/*
+	Copyright (c) 2004-2006, The Dojo Foundation
+	All Rights Reserved.
+
+	Licensed under the Academic Free License version 2.1 or above OR the
+	modified BSD license. For more information on Dojo licensing, see:
+
+		http://dojotoolkit.org/community/licensing.shtml
+*/
+
+dojo.require("dojo.lang");
+dojo.provide("dojo.dnd.DragSource");
+dojo.provide("dojo.dnd.DropTarget");
+dojo.provide("dojo.dnd.DragObject");
+dojo.provide("dojo.dnd.DragAndDrop");
+
+dojo.dnd.DragSource = function(){
+	var dm = dojo.dnd.dragManager;
+	if(dm["registerDragSource"]){ // side-effect prevention
+		dm.registerDragSource(this);
+	}
+}
+
+dojo.lang.extend(dojo.dnd.DragSource, {
+	type: "",
+
+	onDragEnd: function(){
+	},
+
+	onDragStart: function(){
+	},
+
+	/*
+	 * This function gets called when the DOM element was 
+	 * selected for dragging by the HtmlDragAndDropManager.
+	 */
+	onSelected: function(){
+	},
+
+	unregister: function(){
+		dojo.dnd.dragManager.unregisterDragSource(this);
+	},
+
+	reregister: function(){
+		dojo.dnd.dragManager.registerDragSource(this);
+	}
+});
+
+dojo.dnd.DragObject = function(){
+	var dm = dojo.dnd.dragManager;
+	if(dm["registerDragObject"]){ // side-effect prevention
+		dm.registerDragObject(this);
+	}
+}
+
+dojo.lang.extend(dojo.dnd.DragObject, {
+	type: "",
+
+	onDragStart: function(){
+		// gets called directly after being created by the DragSource
+		// default action is to clone self as icon
+	},
+
+	onDragMove: function(){
+		// this changes the UI for the drag icon
+		//	"it moves itself"
+	},
+
+	onDragOver: function(){
+	},
+
+	onDragOut: function(){
+	},
+
+	onDragEnd: function(){
+	},
+
+	// normal aliases
+	onDragLeave: this.onDragOut,
+	onDragEnter: this.onDragOver,
+
+	// non-camel aliases
+	ondragout: this.onDragOut,
+	ondragover: this.onDragOver
+});
+
+dojo.dnd.DropTarget = function(){
+	if (this.constructor == dojo.dnd.DropTarget) { return; } // need to be subclassed
+	this.acceptedTypes = [];
+	dojo.dnd.dragManager.registerDropTarget(this);
+}
+
+dojo.lang.extend(dojo.dnd.DropTarget, {
+
+	acceptsType: function(type){
+		if(!dojo.lang.inArray(this.acceptedTypes, "*")){ // wildcard
+			if(!dojo.lang.inArray(this.acceptedTypes, type)) { return false; }
+		}
+		return true;
+	},
+
+	accepts: function(dragObjects){
+		if(!dojo.lang.inArray(this.acceptedTypes, "*")){ // wildcard
+			for (var i = 0; i < dragObjects.length; i++) {
+				if (!dojo.lang.inArray(this.acceptedTypes,
+					dragObjects[i].type)) { return false; }
+			}
+		}
+		return true;
+	},
+
+	onDragOver: function(){
+	},
+
+	onDragOut: function(){
+	},
+
+	onDragMove: function(){
+	},
+
+	onDropStart: function(){
+	},
+
+	onDrop: function(){
+	},
+
+	onDropEnd: function(){
+	}
+});
+
+// NOTE: this interface is defined here for the convenience of the DragManager
+// implementor. It is expected that in most cases it will be satisfied by
+// extending a native event (DOM event in HTML and SVG).
+dojo.dnd.DragEvent = function(){
+	this.dragSource = null;
+	this.dragObject = null;
+	this.target = null;
+	this.eventStatus = "success";
+	//
+	// can be one of:
+	//	[	"dropSuccess", "dropFailure", "dragMove",
+	//		"dragStart", "dragEnter", "dragLeave"]
+	//
+}
+
+dojo.dnd.DragManager = function(){
+	/*
+	 *	The DragManager handles listening for low-level events and dispatching
+	 *	them to higher-level primitives like drag sources and drop targets. In
+	 *	order to do this, it must keep a list of the items.
+	 */
+}
+
+dojo.lang.extend(dojo.dnd.DragManager, {
+	selectedSources: [],
+	dragObjects: [],
+	dragSources: [],
+	registerDragSource: function(){},
+	dropTargets: [],
+	registerDropTarget: function(){},
+	lastDragTarget: null,
+	currentDragTarget: null,
+	onKeyDown: function(){},
+	onMouseOut: function(){},
+	onMouseMove: function(){},
+	onMouseUp: function(){}
+});
+
+// NOTE: despite the existance of the DragManager class, there will be a
+// singleton drag manager provided by the renderer-specific D&D support code.
+// It is therefore sane for us to assign instance variables to the DragManager
+// prototype
+
+// The renderer-specific file will define the following object:
+// dojo.dnd.dragManager = null;



Mime
View raw message