incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r451723 [1/3] - in /incubator/xap/trunk: WebContent/examples/dataBinding/ src/xap/data/ src/xap/data/bridge/ src/xap/data/controller/ src/xap/data/datasource/ src/xap/taghandling/ src/xap/xml/
Date Sun, 01 Oct 2006 07:23:50 GMT
Author: mturyn
Date: Sun Oct  1 00:23:49 2006
New Revision: 451723

URL: http://svn.apache.org/viewvc?view=rev&rev=451723
Log:
Iterator and (massive amounts of) supporting classes, with addition to plugin.xml for the bridge.  See 

<server>/xap/examples/dataBinding/javascriptDatasource.html
<server>/xap/examples/dataBinding/javascriptDatasource.xal

for an example of an iterator in use, for now with basically a demo data source that's just a wrapper for JavaScript scripts.

Added:
    incubator/xap/trunk/src/xap/data/DataPlugin.js
    incubator/xap/trunk/src/xap/data/bridge/IteratorBridge.js
    incubator/xap/trunk/src/xap/data/bridge/XmlDataTokens.js
    incubator/xap/trunk/src/xap/data/controller/BindingResolver.js
    incubator/xap/trunk/src/xap/data/controller/ContextFrame.java
    incubator/xap/trunk/src/xap/data/controller/ContextFrame.js
    incubator/xap/trunk/src/xap/data/controller/ContextStack.js
    incubator/xap/trunk/src/xap/data/controller/DataControllerException.js
    incubator/xap/trunk/src/xap/data/controller/ElementLocation.js
    incubator/xap/trunk/src/xap/data/controller/Iterator.js
    incubator/xap/trunk/src/xap/data/controller/IteratorContainerImpl.js
    incubator/xap/trunk/src/xap/data/controller/XmlLocation.js
    incubator/xap/trunk/src/xap/data/datasource/AbstractDataSet.js
    incubator/xap/trunk/src/xap/data/datasource/DataSetFactory.js
    incubator/xap/trunk/src/xap/data/datasource/VectorDataSet.js
    incubator/xap/trunk/src/xap/xml/XmlTokens.js
Modified:
    incubator/xap/trunk/WebContent/examples/dataBinding/AnArray.js
    incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html
    incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal
    incubator/xap/trunk/src/xap/data/DataFramework.js
    incubator/xap/trunk/src/xap/data/DataNamespaceHandler.js
    incubator/xap/trunk/src/xap/data/DataServiceImpl.js
    incubator/xap/trunk/src/xap/data/bridge/DataSourceBridge.js
    incubator/xap/trunk/src/xap/data/bridge/JavascriptDataSourceBridge.js
    incubator/xap/trunk/src/xap/data/controller/Binding.js
    incubator/xap/trunk/src/xap/data/datasource/AbstractDataSource.js
    incubator/xap/trunk/src/xap/data/datasource/ArrayDataSet.js
    incubator/xap/trunk/src/xap/data/datasource/JavascriptDataSource.js
    incubator/xap/trunk/src/xap/data/datasource/ObjectDataSource.js
    incubator/xap/trunk/src/xap/taghandling/AbstractTagImpl.js
    incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js
    incubator/xap/trunk/src/xap/taghandling/plugin.xml

Modified: incubator/xap/trunk/WebContent/examples/dataBinding/AnArray.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/AnArray.js?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/AnArray.js (original)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/AnArray.js Sun Oct  1 00:23:49 2006
@@ -3,11 +3,40 @@
 
 AnArray.array = [] ;
 var count = -1 ;
-while (++count <16){
-	AnArray.array[count] = count ;
+while (++count < 8 ){
+	// Will be used to lay out example
+	AnArray.array[count] = count;
 }
 
-AnArray.prototype.twelfth = function(){
-	return "The twelfth slot in this array was filled with: "+AnArray.array[11] ;
+AnArray.computeY= function(anIndex, offset){
+	if(!offset){
+		offset = 0 ;
+	}
+	return ""+(offset+((3+anIndex)*50))+"px" ;
 }
+
+AnArray.prototype.second = function(){
+	return "The second slot in this array will give us: "
+			+AnArray.array[1]+"." ;
+}
+
+AnArray.prototype.theArray = function(){
+	return AnArray.array ;
+}
+
+AnArray.prototype.theVector = function(){
+	var vec = new xap.util.Vector(AnArray.array.length,0) ;
+	for (var ii=0; ii<AnArray.array.length; ++ii){
+		vec.addElement(AnArray.array[ii]) ;
+	}
+	return vec ;
+}
+
+
+					
+							
+
+
+
+
 

Modified: incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html (original)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.html Sun Oct  1 00:23:49 2006
@@ -18,50 +18,44 @@
 
 		<script language="JavaScript" type="text/javascript" src="../../xapcore.js"></script>
 		<script language="JavaScript" type="text/javascript" src="AnArray.js"></script>
-		<script language="JavaScript" type="text/javascript" src="../../src/ResolutionHandler.js"></script>
-		<script language="JavaScript" type="text/javascript" src="../../src/bridges/xap/LabelBridge.js"></script>
-		<script language="JavaScript" type="text/javascript" src="../../src/Xap.js"></script>
-		<script language="JavaScript" type="text/javascript" src="../../src/xap/taghandling/PluginRegistryImpl.js"></script>
-		<script language="JavaScript" type="text/javascript" src="../../src/xap/taghandling/PluginDocumentHandler.js"></script>
 
+<!--  
+Remove debugging in a final check, since debugging's 
+alternate loading method (using <script/> tags) can
+mask forgetting a .require(<className>) in the code:
+-->
 
+    <!--  script language="JavaScript" type="text/javascript">
 
-    <script language="JavaScript" type="text/javascript">
     	Xap._sourceRootDir = "../../" ; 	
 		Xap.addDebuggables(		
-							"xap.data.bridge.DataAttributeConverter",
 							"xap.data.DataFramework",
 							"xap.data.DataServiceFactory",
 							"xap.data.DataServiceImpl",
+							"xap.data.bridge.DataAttributeConverter",
 							"xap.data.bridge.DataFrameworkBridge",
 							"xap.data.bridge.DataSourceBridge",
-							"xap.data.bridge.ObjectDataSourceBridge",
 							"xap.data.bridge.JavascriptDataSourceBridge",							
+							"xap.data.bridge.ObjectDataSourceBridge",
+							"xap.data.controller.ContextFrame",		
+							//"xap.data.controller.Iterator",
+							"xap.data.datasource.AbstractDataSet",
+							"xap.data.datasource.AbstractDataSource",							
+							"xap.data.datasource.ArrayDataSet",
+							"xap.data.datasource.DataSetFactory",						
 							"xap.data.datasource.DataSourceContainerImpl",
 							"xap.data.datasource.DataSourceImpl",
-							"xap.data.datasource.AbstractDataSource",							
-							"xap.data.datasource.JavascriptDataSource",						
-							"xap.session.DeclarativeArgumentParser",
+							"xap.data.datasource.JavascriptDataSource",
+							"xap.resolver.AttributeResolutionHandler",
 							"xap.session.ClientSession",
-							"xap.mco.McoNamespaceHandler",
-							"xap.requestservice.RequestService",
-							"xap.data.DataNamespaceHandler",
-							"xap.xml.NamespaceHandlerManager",
-							"xap.xml.sax.SaxParser",
-							"xap.xml.sax.SaxContentHandler",
-							"xap.taghandling.PluginRegistryImpl",
-							"xap.taghandling.PluginDocumentHandler",
-							"xap.taghandling.AbstractTagImpl",							
-							"xap.xml.dom.Document",
-							"xap.xml.dom.XapElement",
 							"xap.session.DeclarativeArgumentParser",
-							"xap.data.controller.Binding",
-							"xap.data.controller.BindingType",							
-							"xap.data.bridge.BindingBridge",
-							"xap.resolver.AttributeResolutionHandler"																			
+							"xap.taghandling.AbstractTagImpl",							
+							"xap.taghandling.AttributeConverter",
+							"xap.xml.dom.Document"																							
 							) ;
-		Xap._loadDebuggables() ;							
-	</script>							
+		Xap._loadDebuggables() ;
+							
+	</script -->							
 
 	</head>
 

Modified: incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal (original)
+++ incubator/xap/trunk/WebContent/examples/dataBinding/javascriptDatasource.xal Sun Oct  1 00:23:49 2006
@@ -17,8 +17,8 @@
 	<binding 
 		xmlns="http://www.openxal.org/data"
 		dataSource="myDataSource" 
-		select="twelfth()" 
-		id="TWELFTH"
+		select="<currentElement>.second()" 
+		id="SECOND"
 	/>	
 
 
@@ -29,184 +29,146 @@
 		
 			<xal:label 
 				id="topLabel"
-				width="600px" 
+				width="660px" 
 				height="40px"
-				backgroundColor="#b0a0b0"						
+				backgroundColor="#b0a0b0"
+				alignHorizontal="center"						
 				text="Expressions using an object data source:"
 			/>
 		
 			<xal:label 
 				y="50px"
+				x="25px"
 				width="290px" 
 				height="40px"
-				align="center"
-				text="\{bind('binding:TWELFTH')\}"
+				alignHorizontal="center"
+				backgroundColor="#ddddff" 				
+				text="\{bind(binding:SECOND)\}"
 			/>
 		
 			<xal:label 				
 				y="50px"
-				x="310px"			
+				x="330px"			
 				width="290px" 			
 				height="40px"			
 				backgroundColor="#ffdddd"			
 				alignHorizontal="center"			
-				text="{bind(binding:TWELFTH)}"			
+				text="{bind(binding:SECOND)}"			
 				id="testComponent_0" 		
 			/>
 			
-			
-<!--	                                   
-			
-			<xal:label 				
-				y="100px"
-				x="310px"			
-				width="290px" 			
-				height="40px"			
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"			
-				text="{myDataSource.twelfth}"		
-				id="testComponent_1" 		
-			/>                                      
-			
-			
-		
-			
 			<xal:label 
-				y="150px"
-				width="290px" 
+				id="iterStartLabel"
+				y="100px"
+				x="0px"
+				width="660px" 
 				height="40px"
-				align="center"
-				text="\{topLabel\}"
+				backgroundColor="#b0a0b0"
+				alignHorizontal="center"						
+				text="[iteration starts]"
 			/>
-			
-			<xal:label 				
-				y="150px"
-				x="310px"			
-				width="290px" 			
-				height="40px"			
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"			
-				text="{topLabel}"			
-				id="testComponent_2" 		
-			/>
-			
-			
-			<xal:label 
-				y="200px"
-				width="290px" 
-				height="40px"
-				align="center"
-				text="\{topLabel.text\}"
-			/>                                      
-			
-			<xal:label 				
-				y="200px"
-				x="310px"			
-				width="290px" 			
-				height="40px"			
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"			
-				text="{topLabel.text}"		
-				id="testComponent_3" 		
-			/>   
-			
-			<xal:label 
-				y="250px"
-				width="290px" 
-				height="40px"
-				align="center"
-				text="\{&quot;A text message.&quot;\}"
-			/>                                      
-			
-			<xal:label 				
-				y="250px"
-				x="310px"						
-				width="290px" 			
-				height="40px"			
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"				
-				text="{&quot;A text message.&quot;}"		
-				id="testComponent_4" 		
-			/>   		                         
-	
-	
-			<xal:label 
-				y="300px"
-				width="290px" 
-				height="40px"
-				align="center"
-				text="\{3.1416\}"
-			/>                                      
-			
-			<xal:label 				
-				y="300px"	
-				x="310px"					
-				width="290px" 			
-				height="40px"			
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"			
-				text="{3.1416}"		
-				id="testComponent_5" 		
-			/>   
-	
-			<xal:label 
-				y="350px"
-				width="290px" 
-				height="40px"
-				align="center"
-				text="\{false\}"
-			/>                                      
-			
-			<xal:label 				
-				y="350px"
-				x="310px"			
-				width="290px" 			
-				height="40px"
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"			
-				text="{false}"		
-				id="testComponent_6" 		
-			/> 
-	
-			<xal:label 
-				y="400px"
-				width="290px" 
-				height="40px"
-				align="center"
-				text="\{mco:attributeGetter\}"
-			/>                                      
-			
-			<xal:label 				
-				y="400px"	
-				x="310px"					
-				width="290px" 			
-				height="40px"			
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"			
-				text="{mco:attributeGetter}"	
-				id="testComponent_7" 		
-			/>   
-	
-			<xal:label 
-				y="450px"
-				width="290px" 
-				height="40px"
-				align="center"
-				text="\{mco:attributeGetter.getText()\}"
-			/>                                      
-			
-			<xal:label 				
-				y="450px"
-				x="310px"			
-				width="290px" 			
-				height="40px"			
-				backgroundColor="#ffdddd"			
-				alignHorizontal="center"				
-				text="{mco:attributeGetter.getText()}"		
-				id="testComponent_8" 		
-			/> 		
--->
+		
+<!-- Iterator -->
+				<iterator 
+					xmlns="http://www.openxal.org/data" 
+					name="anIterator" 
+					dataSource="myDataSource" 
+					select="theArray()" 
+					type="ONE_WAY"
+				>
+
+					<xal:label 
+						y="{*('AnArray.computeY(<currentElement>)')}"
+						x="25px"			
+						width="290px" 			
+						height="40px"				
+						backgroundColor="#ddddff" 
+						alignHorizontal="center" 
+						text="{*('&quot;Iteration &quot;+<currentCount>+&quot; of   &quot;+<totalCount>+&quot;.&quot;')}"
+					/>
+
+					<xal:label 
+						y="{*('AnArray.computeY(<currentElement>)')}"
+						x="330px"			
+						width="290px" 			
+						height="40px"				
+						backgroundColor="#ffdddd" 
+						alignHorizontal="center" 
+						text="{*('<currentElement>')}"
+					/>
+				</iterator>				
+
+				<xal:label 
+					id="iterStopLabel"
+					width="660px" 
+					height="40px"
+					y="550px"
+					backgroundColor="#b0a0b0"
+					textAlign="center"						
+					text="[iteration ends]"
+				/>	
+				
+				<xal:label 
+					id="iterStartLabel1"
+					width="660px" 
+					height="40px"
+					y="600px"
+					backgroundColor="#b0a0b0"
+					textAlign="center"						
+					text="[iteration begins again]"
+				/>						
+
+				<iterator 
+					xmlns="http://www.openxal.org/data" 
+					name="anIterator" 
+					dataSource="myDataSource" 
+					select="theArray()" 
+					type="ONE_WAY"
+				>
+
+					<xal:label 
+						y="{*('AnArray.computeY(<currentElement>,520)')}"
+						x="25px"			
+						width="290px" 			
+						height="40px"				
+						backgroundColor="#ddffdd" 
+						alignHorizontal="center" 
+						text="{*('&quot;Iteration &quot;+<currentCount>+&quot; of   &quot;+<totalCount>+&quot;.&quot;')}"
+					/>
+
+					<xal:label 
+						y="{*('AnArray.computeY(<currentElement>,520)')}"
+						x="330px"			
+						width="290px" 			
+						height="40px"				
+						backgroundColor="#dddddd" 
+						alignHorizontal="center" 
+						text="{*('<currentElement>')}"
+					/>
+				</iterator>
+
+				<xal:label 
+					id="iterStopLabel1"
+					width="660px" 
+					height="40px"
+					y="1100px"
+					backgroundColor="#b0a0b0"
+					textAlign="center"						
+					text="[second iteration ends]"
+				/>					
+				
 		</freePanel>
+		
+		<!--  Didn't display after freePanel's end...why not?  xal:label 
+			id="iterStopLabel"
+			width="660px" 
+			height="40px"
+			backgroundColor="#b0a0b0"
+			textAlign="center"						
+			text="[iteration ends]"
+		/ -->						
+				
+		
 	</xm:append> 	  		
   	</xm:modifications>
-</xal>
\ No newline at end of file
+</xal>

Modified: incubator/xap/trunk/src/xap/data/DataFramework.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/DataFramework.js?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/DataFramework.js (original)
+++ incubator/xap/trunk/src/xap/data/DataFramework.js Sun Oct  1 00:23:49 2006
@@ -59,8 +59,7 @@
 // placeholders here to avoid follow-on errors.									
 	this._formatterContainer = new xap.data.datasource.DataSourceContainerImpl(sess);
 								// new FormatterContainerImpl(sess);
-	this._iteratorContainer = new xap.data.datasource.DataSourceContainerImpl(sess);
-								// new IteratorContainerImpl(sess);
+	this._iteratorContainer = new xap.data.controller.IteratorContainerImpl(sess);
 		
 		//add the dataSourceContainer to the container of containers
 		//to support doing something like dataSource://myDataSource.do()
@@ -160,7 +159,10 @@
  * @return {Object}
  * @throws DataAccessException, MalformedQueryException,UnsupportedBindingTypeException,DataControllerException 
  */
-xap.data.DataFramework.prototype.relativeBind = function (bindString, select) {
+xap.data.DataFramework.prototype.relativeBind = function(){
+// A usual strategy for dealing with what was an overloaded function in
+// the Java version, made a little easier by the fact that the one-arg
+// version is a degenerate form of the two-arg---has a null bindString.
 	var bindString = null ;
 	var select = null ;
 	if (arguments.length == 2){
@@ -170,7 +172,14 @@
 		select = arguments[0] ;
 	}	
 	/* Binding */
-	var binding = new Binding(this._bindingResolver.getContextStack(), select, bindString, this._session, BindingType.ONE_TIME, null);
+	var binding = new xap.data.controller.Binding(
+								this._bindingResolver.getContextStack(),
+								select,
+								bindString,
+								this._session, 
+								xap.data.controller.BindingType.ONE_TIME, 
+								null
+									);
 	return this.bind(binding);
 };
 
@@ -213,7 +222,7 @@
  *public static final int
  */
 // Implementor of DataService interface: xap.data.DataFramework.DATA_FRAMEWORK_EXCEPTION_TYPE = 10000;
-xap.data.DataFramework.DATA_FRAMEWORK_EXCEPTION_TYPE = 10000;
+xap.data.DataFramework.DATA_FRAMEWORK_EXCEPTION_TYPE = "Data framework exception." ; //10000;
 //ExceptionContext.MAX_RANGE + 100;
 /**
  * Get the formatter container.

Modified: incubator/xap/trunk/src/xap/data/DataNamespaceHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/DataNamespaceHandler.js?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/DataNamespaceHandler.js (original)
+++ incubator/xap/trunk/src/xap/data/DataNamespaceHandler.js Sun Oct  1 00:23:49 2006
@@ -25,6 +25,7 @@
 //Xap.require("xap.xml.NamespaceHandler") ; 
 Xap.require("xap.xml.sax.ParserException");
 Xap.require("xap.xml.sax.SaxParser");
+Xap.require("xap.data.controller.BindingResolver") ;
 /**
  * @class
  * The namespace handler for the http://openxal.apache.org/data namespace. This handler
@@ -143,6 +144,20 @@
 xap.data.DataNamespaceHandler.prototype.pluginLoaded = function (session) {
 	session.getNamespaceHandlerManager().addHandler("http://www.openxal.org/data", this);
 	this._session = session;
+	
+	// Originally in DataPlugin
+	//set the attribute resolver on uiContentHandler() to
+	//out resolver that can recognize bindings
+	/*BindingResolver*/
+	var resolver = new xap.data.controller.BindingResolver(this._session);
+		
+		//also set it on the framework service
+	(xap.data.DataFramework.getDataService(this._session)
+		).setBindingResolver(resolver);
+	
+	
+	
+	
 };
 /**
  * @public

Added: incubator/xap/trunk/src/xap/data/DataPlugin.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/DataPlugin.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/DataPlugin.js (added)
+++ incubator/xap/trunk/src/xap/data/DataPlugin.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,65 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+Xap.provide("xap.data.DataPlugin");
+Xap.require("xap.session.ClientSession");
+Xap.require("xap.data.controller.BindingResolver");
+Xap.require("xap.xml.NamespaceHandlerManager");
+/**
+ * Implements the PluginLifecycleManager interface. This class is associated
+ * with the data plugin. It is the entry point for all data stuff.
+ * 
+ * @author JMargaris
+ *
+ */
+xap.data.DataPlugin = function () {
+};
+
+Xap.setupClassAsSubclassOf("xap.data.DataPlugin", "Object");
+/*private static final String*/
+xap.data.DataPlugin.DATA_NAMESPACE = "http://nexaweb.com/data";
+/**
+ * @public
+ * @return {void}
+ *
+ * @param sess{ClientSession}
+**/
+xap.data.DataPlugin.prototype.pluginLoaded = function (sess) {
+	//create a namespace handler for data and set it
+	//xap.xml.NamespaceHandlerManager.getInstance()
+	sess.getNamespaceHandlerManager().setHandlerForNamespace(
+					xap.data.DataPlugin.DATA_NAMESPACE, 
+					new xap.data.DataNamespaceHandler(sess)
+														);
+		
+		//set the attribute resolver on uiContentHandler() to
+		//out resolver that can recognize bindings
+	/*BindingResolver*/
+	var resolver = new xap.data.controller.BindingResolver(sess);
+		
+		//also set it on the framework service
+	(xap.data.DataFramework.getDataService(sess)).setBindingResolver(resolver);
+};
+/**
+ * @public
+ * @return {void}
+ *
+ * @param sess{ClientSession}
+**/
+xap.data.DataPlugin.prototype.pluginUnloaded = function (sess) {
+		// NO-OP
+};
+

Modified: incubator/xap/trunk/src/xap/data/DataServiceImpl.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/DataServiceImpl.js?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/DataServiceImpl.js (original)
+++ incubator/xap/trunk/src/xap/data/DataServiceImpl.js Sun Oct  1 00:23:49 2006
@@ -49,7 +49,8 @@
 	 
  *public static final int
  */
-xap.data.DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE = 10000;
+//xap.data.DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE = 10000;
+xap.data.DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE = "Data framework exception.";
 //ExceptionContext.MAX_RANGE + 100;
 /**
  * Get the formatter container.

Modified: incubator/xap/trunk/src/xap/data/bridge/DataSourceBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/bridge/DataSourceBridge.js?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/bridge/DataSourceBridge.js (original)
+++ incubator/xap/trunk/src/xap/data/bridge/DataSourceBridge.js Sun Oct  1 00:23:49 2006
@@ -17,7 +17,7 @@
  */
 Xap.provide("xap.data.bridge.DataSourceBridge");
 // Superclass:
-Xap.provide("xap.data.bridge.DataFrameworkBridge");
+Xap.require("xap.data.bridge.DataFrameworkBridge");
 Xap.require("xap.session.ClientEvent"); 
 Xap.require("xap.taghandling.AttributeConversionException");
 //Xap.require("xap.data.DataServiceImpl") ;
@@ -79,7 +79,7 @@
  * @param source{DataSourceImpl}
  */
 xap.data.bridge.DataSourceBridge.prototype.onDataChanged = function (source) {
-	this.fireEvent("onDataChanged", null);
+	this.fireEvent( "onDataChanged", null, null, null) 
 };
 /**
  * Implementation of the AsynchronousDataSourceListener interface,
@@ -95,7 +95,7 @@
 		
 	//TODO document this
 	e.setFailureCause(failureCause);
-	this.fireEvent("onDataRequestFailed", e);
+	this.fireEvent("onDataRequestFailed", e, null, null);
 };
 /**
  * Implementation of the AsynchronousDataSourceListener interface,
@@ -104,7 +104,7 @@
  */
 /*public void*/
 xap.data.bridge.DataSourceBridge.prototype.onDataRequestCompleted = function (source) {
-	this.fireEvent("onDataRequestCompleted", null);
+	this.fireEvent( "onDataRequestCompleted", null, null, null) 
 };
 /**
  * Returns a log appropriate for DataSource bridges.

Added: incubator/xap/trunk/src/xap/data/bridge/IteratorBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/bridge/IteratorBridge.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/bridge/IteratorBridge.js (added)
+++ incubator/xap/trunk/src/xap/data/bridge/IteratorBridge.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,132 @@
+
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+Xap.provide("xap.data.bridge.IteratorBridge");
+Xap.require("xap.taghandling.AttributeConversionException");
+Xap.require("xap.data.controller.BindingType");
+Xap.require("xap.data.controller.Iterator");
+Xap.require("xap.data.datasource.DataSourceImpl");
+Xap.require("xap.data.bridge.XmlDataTokens") ;
+Xap.require("xap.xml.dom.XapElement");
+/**
+ * 
+ * Iterator bridge class.  An iterator is responsible for the following:
+ * 
+ * <ul>
+ * 		<li>
+ * 		If the iterator is top-level,
+ * 		scheduling a data set retrieval from the specified data source.
+ * 		</li>
+ * 		<li>
+ * 		If the iterator is sub-level,
+ * 		retrieving a data set from the data set, using the current iteration
+ * 		context.
+ * 		</li>
+ * 		<li>
+ * 		Placing clones of all child content into the UI at the location
+ * 		where the iterator tag was parsed when the dataset becomes available
+ * 		</li>
+ * 		<li>
+ * 		Cleaning up the data set when the iterator location becomes invalid,
+ * 		possibly cancelling the query if the dataset has not yet become available.
+ * 		</li>
+ * </ul>
+ * 
+ * @author dgennaco
+ * 
+ */
+/**
+ * @constructor
+ **/
+xap.data.bridge.IteratorBridge = function () {
+    xap.data.bridge.DataFrameworkBridge.call(this);
+};
+Xap.setupClassAsSubclassOf("xap.data.bridge.IteratorBridge", "xap.data.bridge.DataFrameworkBridge");
+/**
+ * @public
+ * @return {void}
+ **/
+xap.data.bridge.IteratorBridge.prototype.init = function () {
+	// for brevity's sake:
+    var xmlDataTokens = xap.data.bridge.XmlDataTokens;
+    this.superclass.init.call(this);
+    /*Element*/
+    var element = this.getElement();
+    /*String*/
+    var dataSourceId = element.getAttribute(xmlDataTokens.DATA_SOURCE);
+    /*String*/
+    var select = element.getAttribute(xmlDataTokens.SELECT);
+    /*String*/
+    var bindingTypeString = element.getAttribute(xmlDataTokens.BINDING_TYPE);
+	//try to convert the "type" attribute to a binding type
+	//no binding type is ok, default to ONE_TIME
+    /*BindingType*/
+    var bindingType = xap.data.controller.BindingType.ONE_TIME;
+    if (bindingTypeString != null) {
+        try {
+            bindingType = xap.data.bridge.DataAttributeConverter.toBindingType(bindingTypeString);
+        }
+        catch (e) { //AttributeConversionException
+            this.reportInvalidXmlException(xmlDataTokens.BINDING_TYPE, bindingTypeString, element, e);
+        }
+    }
+    /*xap.data.controller.Iterator*/
+    var i = null;
+    /*DataSource*/
+    var dataSource = null;
+    /*String*/
+    var name = element.getAttribute(xmlDataTokens.NAME);
+    if (name == null) {
+        name = element.getAttribute(xmlDataTokens.ID);
+    }
+    if (dataSourceId != null) {
+        dataSource = this.getDataSourceContainer().getDataSource(dataSourceId);
+    }
+	//if there is a data source, use it
+	if (dataSource != null) {
+	i = new xap.data.controller.Iterator(select, bindingType, element, name, this.getSession());
+	i.iterate(dataSource);
+	}
+	//if the id was blank, we must be relative to parent
+	else if ( dataSourceId == null || dataSourceId.length == 0) {
+	i = new xap.data.controller.Iterator(
+						 select, 
+						 bindingType, 
+						 element, 
+						 name,  
+						 this.getSession()
+						 ) ;    
+
+	// The iterate call will handle parent not found
+	i.iterate() ;
+	}
+	//if the id was not blank but it was not a data source it must
+	//be the name of some parent
+	else {
+	// The iterator will handle parent not found
+	i = new xap.data.controller.Iterator(
+						 select,
+						 bindingType,
+						 element,
+						 name,
+						 this.getSession(),
+						 dataSourceId
+						 ) ;
+	}	
+    
+};
+

Modified: incubator/xap/trunk/src/xap/data/bridge/JavascriptDataSourceBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/bridge/JavascriptDataSourceBridge.js?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/bridge/JavascriptDataSourceBridge.js (original)
+++ incubator/xap/trunk/src/xap/data/bridge/JavascriptDataSourceBridge.js Sun Oct  1 00:23:49 2006
@@ -137,7 +137,7 @@
  * @private
  * @param dataSource{ObjectDataSource}
  */
-/*  My guess is we won't need this, but...
+/*  My guess is we won't need this for now (just ONE_TIME/ONE_WAY, but...
 xap.data.bridge.JavascriptDataSourceBridge.prototype.setRefreshOnPropertyChange = function (dataSource) {
 	var refreshOnPropertyChange = this.getElement().getAttribute(REFRESH_ON_PROPERTY_CHANGE_ATTRIBUTE);
 	if (refreshOnPropertyChange != null) {

Added: incubator/xap/trunk/src/xap/data/bridge/XmlDataTokens.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/bridge/XmlDataTokens.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/bridge/XmlDataTokens.js (added)
+++ incubator/xap/trunk/src/xap/data/bridge/XmlDataTokens.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,78 @@
+
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+Xap.provide("xap.data.bridge.XmlDataTokens") ;
+
+/**
+ * @class
+ * Tokens specific to data that can appear in XML files.
+ * 
+ * @author JMargaris
+ *
+ */
+xap.data.bridge.XmlDataTokens = function () {
+};
+
+/**
+ * Datasource identifier on a bind/iterator
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.DATA_SOURCE = "dataSource";
+
+/**
+ * Binding type definition
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.BINDING_TYPE = "type";
+
+/**
+ * Default value for binding resolver.
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.DEFAULT_VALUE = "defaultValue";
+
+/**
+ * id
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.ID = "id";
+
+/**
+ * Typically the select statement on a bind/iterator
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.SELECT = "select";
+
+/**
+ * Generic class attribute on tags that support user implemented
+ * backing objects.
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.CLASS = "class";
+
+/**
+ * Formatter attribute on binding
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.FORMATTER = "formatter";
+
+/**
+ * Name attribute on iterator
+ * public static final String
+**/
+xap.data.bridge.XmlDataTokens.NAME = "name";
+

Modified: incubator/xap/trunk/src/xap/data/controller/Binding.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/controller/Binding.js?view=diff&rev=451723&r1=451722&r2=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/controller/Binding.js (original)
+++ incubator/xap/trunk/src/xap/data/controller/Binding.js Sun Oct  1 00:23:49 2006
@@ -68,64 +68,78 @@
  */
 xap.data.controller.Binding = function () {
 	// Crude way to fold in two Java constructors into one JS one...
-	var theLog = xap.util.LogFactory.getLog("xap.data.controller.Binding") ;
-    if (arguments.length == 5) {
+	var theLog = xap.util.LogFactory.getLog("xap.data.controller.Binding");
+	if (arguments.length == 5) {
 		theLog.debug("5-arg Binding()");
-        var source = arguments[0];
-        var select = arguments[1];
-        var session = arguments[2];
-        var bindingType = arguments[3];
-        var defaultValue = arguments[4];
-        this._source = source;
-        this._select = select;
-        this._session = session;
-        this._bindingType = bindingType;
-        if (defaultValue != null) {
-            this._defaultValue = defaultValue;
-        }
-        this._currentValue = this._defaultValue;
-    } else if (arguments.length == 6) {
-		theLog.debug("6-arg Binding()");     
-        var contextStack = arguments[0];
-        var select = arguments[1];
-        var name = arguments[2];
-        var session = arguments[3];
-        var bindingType = arguments[4];
-        var defaultValue = arguments[5];
-        this._select = select;
-        this._session = session;
-        this._bindingType = bindingType;
-        if (name != null && name.length() > 0) {
-            this._source = xap.data.DataServiceFactory.getDataService(session).getDataSourceContainer().getDataSource(name);
-            if (this._source == null) {
+		var source = arguments[0];
+		var select = arguments[1];
+		var session = arguments[2];
+		var bindingType = arguments[3];
+		var defaultValue = arguments[4];
+		this._source = source;
+		this._select = select;
+		this._session = session;
+		this._bindingType = bindingType;
+		if (defaultValue != null) {
+			this._defaultValue = defaultValue;
+		}
+		this._currentValue = this._defaultValue;
+	} else {
+		if (arguments.length == 6) {
+			theLog.debug("6-arg Binding()");
+			var contextStack = arguments[0];
+			var select = arguments[1];
+			var name = arguments[2];
+			var session = arguments[3];
+			var bindingType = arguments[4];
+			var defaultValue = arguments[5];
+			this._select = select;
+			this._session = session;
+			this._bindingType = bindingType;
+			if (name != null && name.length() > 0) {
+				this._source = xap.data.DataServiceFactory.getDataService(session).getDataSourceContainer().getDataSource(name);
+				if (this._source == null) {
 			// Find the ancestor iterator context with the
 			// specified name, since there was not data source with
 			// that name
-                this._context = contextStack.getContext(name);
-                if (this._context == null) {
+					this._context = contextStack.getContext(name);
+					if (this._context == null) {
 				//					throw new DataControllerException(DataControllerException.QUICK_BINDING_NAMED_CONTEXT_NOT_FOUND,
 				//							name);
-                    throw new xap.util.Exception("Named context for quick binding not found for '" + name + "'.");
-                }
-                this._source = this._context.getDataSource();
-            }
-        } else {
+						throw new xap.util.Exception("Named context for quick binding not found for '" + name + "'.");
+					}
+					this._source = this._context.getDataSource();
+				}
+			} else {
 		// No name specified, use the current context, this is relative to parent
-            this._context = contextStack.getCurrentContext();
-            if (this._context == null) {
+				this._context = contextStack.getCurrentContext();
+				if (this._context == null) {
 			//			throw new DataControllerException(DataControllerException.RELATIVE_BINDING_WITHOUT_PARENT, select);
-                throw new xap.util.Exception("Attempted a relative binding without a parent: '" + select + "'.");
-            }
-            this._source = this._context.getDataSource();
-        }
-        if (defaultValue != null) {
-            this._defaultValue = defaultValue;
-        }
-        this._currentValue = this._defaultValue;
-        // END: 6-argument (contextStack) version
-    } else {
-        throw new xap.util.Exception("Binding must be created using either" + "five or six parameters; " + arguments.length + " were supplied: [" + arguments.join(",") + "] .");
-    }
+					throw new xap.util.Exception("Attempted a relative binding without a parent: '" + select + "'.");
+				}
+				this._source = this._context.getDataSource();
+			}
+			if (defaultValue != null) {
+				this._defaultValue = defaultValue;
+			}
+			this._currentValue = this._defaultValue;
+		// END: 6-argument (contextStack) version
+		} else {
+			var argString = "[";
+			for (var key in arguments) {
+				if (key == "length") {
+					continue;
+				}
+				if (key != "0") {
+					argString += ", ";
+				}
+				argString += arguments[key];
+			}
+			argString += "]";
+			xap.util.Utils.interrogate(arguments.callee, true);
+			throw new xap.util.Exception("Binding must be created using either" + "five or six parameters, supplied " + arguments.length + ": " + argString + " .");
+		}
+	}
 };
 Xap.setupClassAsSubclassOf("xap.data.controller.Binding", "Object");
 /*private*/
@@ -152,7 +166,7 @@
  * @return {ClientSession} The session.
  */
 xap.data.controller.Binding.prototype.getSession = function () {
-    return this._session;
+	return this._session;
 };
 /**
  * Set the binding type for this binding.
@@ -161,7 +175,7 @@
  */
 /*public*/
 xap.data.controller.Binding.prototype.setBindingType = function (type) {
-    this._bindingType = type;
+	this._bindingType = type;
 };
 /**
  * Resolve the specified attribute.  This will return the current value associated
@@ -186,15 +200,15 @@
 		//of a current iteration. So rather than saving it we just look it up
 		//each time. The timing here is important: this must be called
 		//DURING iteration
-    if (this._bindingType == xap.data.controller.BindingType.ONE_TIME) {
+	if (this._bindingType == xap.data.controller.BindingType.ONE_TIME) {
 			// Reset the current data value to the default value.
 			// Since we are a one time binding, we want the current
 			// data value from the datasource to be retrieved once,
 			// and only the default value should be able to show up
 			// prior to that retrieval.
-        this._currentValue = this._defaultValue;
-    }
-    this.requestData();
+		this._currentValue = this._defaultValue;
+	}
+	this.requestData();
 		
 		// If the binding type is not ONE_TIME or
 		// the binding type -is- ONE_TIME and the data was not
@@ -202,10 +216,10 @@
 		// (indicated by the current value being the default value,
 		// we need to add a bind target so that the data can be set
 		// at a later time 
-    if ((this._bindingType != xap.data.controller.BindingType.ONE_TIME) || ((this._bindingType == xap.data.controller.BindingType.ONE_TIME) && (this._currentValue == this._defaultValue))) {
-        this.addBindTarget(new AttributeValueLocation(e, attributeName));
-    }
-    return this._currentValue;
+	if ((this._bindingType != xap.data.controller.BindingType.ONE_TIME) || ((this._bindingType == xap.data.controller.BindingType.ONE_TIME) && (this._currentValue == this._defaultValue))) {
+		this.addBindTarget(new AttributeValueLocation(e, attributeName));
+	}
+	return this._currentValue;
 };
 /**
  * Resolve the specified text node.  This will return the current value associated
@@ -226,21 +240,21 @@
  */
 /*public*/
 xap.data.controller.Binding.prototype.resolve = function (e, value, index) {
-    /*boolean*/
-    var calledInParseInitialChildren = false;
-    if (index == -1) {
-        index = e.indexOfChild(value);
-        calledInParseInitialChildren = true;
-    }
-    if (this._bindingType == xap.data.controller.Binding.BindingType.ONE_TIME) {
+	/*boolean*/
+	var calledInParseInitialChildren = false;
+	if (index == -1) {
+		index = e.indexOfChild(value);
+		calledInParseInitialChildren = true;
+	}
+	if (this._bindingType == xap.data.controller.Binding.BindingType.ONE_TIME) {
 			// Reset the current data value to the default value.
 			// Since we are a one time binding, we want the current
 			// data value from the datasource to be retrieved once,
 			// and only the default value should be able to show up
 			// prior to that retrieval.
-        this._currentValue = this._defaultValue;
-    }
-    this.requestData();
+		this._currentValue = this._defaultValue;
+	}
+	this.requestData();
 
 		// If the binding type is not ONE_TIME or
 		// the binding type -is- ONE_TIME and the data was not
@@ -248,10 +262,10 @@
 		// (indicated by the current value being the default value,
 		// we need to add a bind target so that the data can be set
 		// at a later time 
-    if ((this._bindingType != xap.data.controller.BindingType.ONE_TIME) || ((this._bindingType == xap.data.controller.BindingType.ONE_TIME) && (this._currentValue == this._defaultValue))) {
-        this.addBindTarget(new TextNodeLocation(e, index, calledInParseInitialChildren));
-    }
-    return this._currentValue;
+	if ((this._bindingType != xap.data.controller.BindingType.ONE_TIME) || ((this._bindingType == xap.data.controller.BindingType.ONE_TIME) && (this._currentValue == this._defaultValue))) {
+		this.addBindTarget(new TextNodeLocation(e, index, calledInParseInitialChildren));
+	}
+	return this._currentValue;
 };
 /**
  * Generic resolve.  This will return the current value from the data source if it
@@ -267,8 +281,8 @@
 xap.data.controller.Binding.prototype.resolve = function () {
 		// This non-location based resolution can only do its best to do an immediate
 		// query for the data to get the most current value and return it.
-    this.requestData();
-    return this._currentValue;
+	this.requestData();
+	return this._currentValue;
 };
 /**
  * Call this method to cause the current value from the data source (or default value) to be
@@ -279,18 +293,18 @@
 xap.data.controller.Binding.prototype.setData = function () {
 //		synchronized (
 //		this._session.getDocumentRegistry().getUiDocument().getDomSynchronizationObject()) {
-    for (var i = 0; i < this._targets.size(); i++) {
-        /* TargetLocation */
-        var target = this._targets.elementAt(i);
-        target.setData(this._currentValue, this._session);
-        if (this._bindingType == xap.data.controller.BindingType.ONE_TIME) {
+	for (var i = 0; i < this._targets.size(); i++) {
+		/* TargetLocation */
+		var target = this._targets.elementAt(i);
+		target.setData(this._currentValue, this._session);
+		if (this._bindingType == xap.data.controller.BindingType.ONE_TIME) {
 				// Dangerous...will we have to recast?---add method
 				// to whatever it actually is, as opposed to
 				// what (in Java) it was to be recast-to?
 				//	((XmlLocation)target).invalidate();
-            target.invalidate();
-        }
-    }
+			target.invalidate();
+		}
+	}
 //		} // end synchronization block
 };
 /**
@@ -300,7 +314,7 @@
  */
 /*public*/
 xap.data.controller.Binding.prototype.setFormatter = function (f) {
-    this._formatter = f;
+	this._formatter = f;
 };
 /*
  * Runs an object through the configured formatter.
@@ -309,39 +323,39 @@
  */
 /*private*/
 xap.data.controller.Binding.prototype.formatObject = function (data) {
-    if (this._formatter != null) {
-        data = this._formatter.format(data);
-    }
-    return data;
+	if (this._formatter != null) {
+		data = this._formatter.format(data);
+	}
+	return data;
 };
 /**
  * @param target{Location}
  **/
 xap.data.controller.Binding.prototype.addBindTarget = function (target) {
-    this._targets.addElement(target);
-    target.setLocationListener(this);
+	this._targets.addElement(target);
+	target.setLocationListener(this);
 };
 /**
  * @param target{Location}
  **/
 xap.data.controller.Binding.prototype.removeBindTarget = function (target) {
-    this._targets.removeElement(target);
+	this._targets.removeElement(target);
 		// if there are no targets left deregister from the data source associated
 		// with this binding.
 		// The data source is responsible for cleaning up one time bindings when
 		// the asynchronous call terminates, so never do that here.
-    if (this._bindingType != xap.data.controller.BindingType.ONE_TIME && this._targets.size() == 0) {
+	if (this._bindingType != xap.data.controller.BindingType.ONE_TIME && this._targets.size() == 0) {
 			// IMPORTANT REVISIT revisit this.the source should probably handle listeners removing themselves while
 			// it is looping through !!!
-        this._source.removeListener(this);
-    }
+		this._source.removeListener(this);
+	}
 };
 /**
  * @public
  * @param location{Location} Binding target's location.<b>
  **/
 xap.data.controller.Binding.prototype.locationInvalidated = function (location) {
-    this.removeBindTarget(location);
+	this.removeBindTarget(location);
 };
 /*
  * @public
@@ -351,25 +365,25 @@
  * QueryCompletionListener INTERFACE METHODS 
  */
 xap.data.controller.Binding.prototype.dataRetrieved = function (query, data, context) {
-    this._currentValue = this._defaultValue;
-    if (data != null) {
-        try {
+	this._currentValue = this._defaultValue;
+	if (data != null) {
+		try {
 // TODO at least get the formatting back in:
 //			this._currentValue = this.getSession().getTypeConversionService().convertToString(formatObject(data));
-			this._currentValue = "" + data ;
-        }
-        catch (dataException) { //DataException
-            this._session.handleException(xap.data.DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE, dataException);
+			this._currentValue = "" + data;
+		}
+		catch (dataException) { //DataException
+			this._session.handleException(xap.data.DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE + ": no data retrieved.", dataException);
 //			}catch ( conversionException ) { //TypeConversionException
 //				this._session.handleException(DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE, conversionException);
-        }
-    }
-    // TODO implement this
-    //this.setDataOnUiUpdateThread();
+		}
+	}
+	// TODO implement this
+	//this.setDataOnUiUpdateThread();
 };
 /*public*/
 xap.data.controller.Binding.prototype.getBindingType = function () {
-    return this._bindingType;
+	return this._bindingType;
 };
 /*
  * END - QueryCompletionListener INTERFACE METHODS 
@@ -386,33 +400,33 @@
 // otherwise, check to see if there are no targets set, which
 // indicates we have not yet initiated ourselves as a ONE_WAY
 // listener with the data source
-    if (this._targets.size() == 0 || this._bindingType == xap.data.controller.BindingType.ONE_TIME) {
+	if (this._targets.size() == 0 || this._bindingType == xap.data.controller.BindingType.ONE_TIME) {
 		// If there are already targets, then we're already waiting on some
 		// data, if we are in one-time mode, we should use this opportunity to
 		// make sure the latest data is the current data.
-        this._source.getData(this._select, this, this._context);
-    }
+		this._source.getData(this._select, this, this._context);
+	}
 };
 /*private*/
 xap.data.controller.Binding.prototype.setDataOnUiUpdateThread = function () {
-    try {
-        /*UiUpdateQueue*/
-        var updateQueue = this.getSession().getUiUpdateQueue();
-        if (this.updateQueue.isUiUpdateThread()) {
-            this.setData();
-        } else {
-            this.updateQueue.invokeLater(this.setData, null);
-        }
-    }
-    catch (e) { //Exception
-        this._session.handleException(xap.data.DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE, new xap.util.Exception(e));
+	throw new xap.util.Exception("setDataOnUiUpdateThread not implemented");
+	try {
+		/*UiUpdateQueue*/
+		var updateQueue = this.getSession().getUiUpdateQueue();
+		if (this.updateQueue.isUiUpdateThread()) {
+			this.setData();
+		} else {
+			this.updateQueue.invokeLater(this.setData, null);
+		}
+	}
+	catch (e) { //Exception
+		this._session.handleException(xap.data.DataServiceImpl.DATA_FRAMEWORK_EXCEPTION_TYPE + ": can't add data to update queue.", new xap.util.Exception(e));
 // TODO:  better exception
 //					new DataControllerException(
 //						DataControllerException.BINDING_SET_SCHEDULE_EXCEPTION,
 //							e));
-    }
+	}
 };
-
 /**
  * This method and isDataRetrievalListener
  * will be used by the data source to determine
@@ -420,12 +434,10 @@
  * Their return values will be NOT'd in
  * the Iterator class's implementation.
  * @return false
-**/ 
-xap.data.controller.Binding.prototype.isDataSetRetrievalListener = function(){
-	return false ;
-}
-
-
+**/
+xap.data.controller.Binding.prototype.isDataSetRetrievalListener = function () {
+	return false;
+};
 /**
  * This method and isDataSetRetrievalListener
  * will be used by the data source to determine
@@ -433,8 +445,8 @@
  * Their return values will be NOT'd in
  * the Iterator class's implementation.
  * @return true
-**/ 
-xap.data.controller.Binding.prototype.isDataRetrievalListener = function(){
-	return true ;
-}
+**/
+xap.data.controller.Binding.prototype.isDataRetrievalListener = function () {
+	return true;
+};
 

Added: incubator/xap/trunk/src/xap/data/controller/BindingResolver.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/controller/BindingResolver.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/controller/BindingResolver.js (added)
+++ incubator/xap/trunk/src/xap/data/controller/BindingResolver.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,210 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required  by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+Xap.provide("xap.data.controller.BindingResolver");
+Xap.require("xap.session.ClientSession");
+Xap.require("xap.data.DataFramework");
+Xap.require("xap.data.DataServiceImpl");
+Xap.require("xap.data.bridge.XmlDataTokens");
+//Xap.require("xap.data.formatter.Formatter") ;
+//Xap.require("xap.util.EscapeSyntaxException") ;
+Xap.require("xap.util.EscapeSyntaxParser") ;
+Xap.require("xap.data.controller.ContextStack") ;
+/**
+ * The binding resolver contains helper methods which allow creation
+ * of binding objects from binding declarations. This class also maintains
+ * the current iteration context stack during iterator processing.
+ * 
+ * @author JMargaris
+ * @author dgennaco
+ */
+/**
+ * Create a new binding resolver.
+ * 
+ * @param sess{ClientSession} the client session
+ */
+xap.data.controller.BindingResolver = function (sess) {
+	this._session = sess;
+};
+/*private static final char*/
+xap.data.controller.BindingResolver.ESCAPE_CHAR = "\\";
+/*private static final char*/
+xap.data.controller.BindingResolver.DELIMITER_CHAR = ";";
+/*private static final char*/
+xap.data.controller.BindingResolver.EQUALS_CHAR = "=";
+/*private static final char[]*/
+xap.data.controller.BindingResolver.ESCAPABLE_CHARACTERS = [xap.data.controller.BindingResolver.ESCAPE_CHAR, xap.data.controller.BindingResolver.DELIMITER_CHAR];
+/**
+ * @private ContextStack
+**/
+xap.data.controller.BindingResolver.prototype._contextStack = new xap.data.controller.ContextStack();
+/**
+ * Get the current context stack.
+ * 
+ * @return the context stack
+ *
+ * @public
+ * @return {ContextStack}
+**/
+xap.data.controller.BindingResolver.prototype.getContextStack = function () {
+	return this._contextStack;
+};
+/**
+ * Set the context stack.
+ * 
+ * @param contextStack the context stack
+ *
+ * @public
+ * @return {void}
+ *
+ * @param contextStack{ContextStack}
+**/
+xap.data.controller.BindingResolver.prototype.setContextStack = function (contextStack) {
+	this._contextStack = contextStack;
+};
+/**
+ * Creates a binding out of a string like:
+ * dataSource=myDataSource; select=/text(); type=ONE_WAY
+ * 
+ * @param value the parameter string
+ * 
+ * @return a newly constructed binding for the specified parameters
+ * 
+ * @throws DataControllerException
+ * @throws EscapeSyntaxException
+ *
+ * @public
+ * @param value{String}
+ * @return {Binding}
+ * @throws EscapeSyntaxException, DataControllerException 
+**/
+xap.data.controller.BindingResolver.prototype.createBindingFromParameterString = function (value) {
+	/*DataService*/
+	var dataService = xap.data.DataFramework.getDataService(this._session);
+	/*Formatter*/
+	var formatter = null;
+	/*BindingType*/
+	var bindType = xap.data.controller.BindingType.ONE_TIME;
+	/*String*/
+	var select = null;
+
+	//boolean
+	var done = false;
+	/*int*/
+	var index = 0;
+	/*StringBuffer*/
+	var curToken = null;
+	/*String*/
+	var parameterName = null;
+	/*String*/
+	var parameterValue = null;
+	/*String*/
+	var dataSource = null;
+	/*String*/
+	var defaultValue = null;
+	/*EscapeSyntaxParser*/
+	var parser = new xap.util.EscapeSyntaxParser(xap.data.controller.BindingResolver.ESCAPABLE_CHARACTERS, xap.data.controller.BindingResolver.ESCAPABLE_CHARACTERS);
+	while (!done) {
+		var curChar = null;
+		/*boolean*/
+		var wasEscapedChar = false;
+		if (index == value.length) {
+			done = true;
+			curChar = xap.data.controller.BindingResolver.DELIMITER_CHAR;
+		} else {
+			curChar = parser.getResolvedCharacter(value, index);
+			if (curToken == null) {
+				curToken = "" ;
+			}
+			if (curChar == xap.util.EscapeSyntaxParser.UNRESOLVED_CHARACTER) {
+					// REGULAR CHARACTER
+				curChar = value.charAt(index);
+				index++;
+			} else {
+					// For escaped character, we need to bump the
+					// index by 2, one for the escape character, and
+					// one for the character itself.
+				index += 2;
+				wasEscapedChar = true;
+			}
+		}
+		if (!wasEscapedChar) {
+			if (curChar == xap.data.controller.BindingResolver.DELIMITER_CHAR) {
+				if (parameterName == null) {
+					if (curToken != null) {
+						parameterName = curToken.toString().trim();
+					}
+				} else {
+					if (curToken != null) {
+						parameterValue = curToken.toString().trim();
+					}
+				}
+				if (xap.data.XmlDataTokens.FORMATTER == parameterName ) {
+					if (parameterValue != null) {
+						formatter = dataService.getFormatterContainer().getFormatter(parameterValue);
+					}
+				} else {
+					if (xap.data.XmlDataTokens.BINDING_TYPE == parameterName ) {
+						if (parameterValue != null) {
+							bindType = xap.data.controller.BindingType.getBindingType(parameterValue);
+							if (bindType == null) {
+								/*String[]*/
+								var args = [parameterName, parameterValue, xap.data.controller.BindingType.ONE_TIME.getTypeId() + " or " + xap.data.controller.BindingType.ONE_WAY.getTypeId()];
+								throw new DataControllerException(DataControllerException.PARAMETERIZED_BINDING_INVALID_ARGUMENT_VALUE, args);
+							}
+						}
+					} else {
+						if (xap.data.XmlDataTokens.SELECT == parameterName ) {
+							select = parameterValue;
+						} else {
+							if (xap.data.XmlDataTokens.DATA_SOURCE == parameterName ) {
+								if (parameterValue != null) {
+									dataSource = parameterValue;
+								}
+							} else {
+								if (xap.data.XmlDataTokens.DEFAULT_VALUE == parameterName ) {
+									defaultValue = parameterValue;
+								}
+							}
+						}
+					}
+				}
+				curToken = null;
+				parameterName = null;
+				parameterValue = null;
+				continue;
+			} else {
+				if (parameterName == null && curChar == this.constructor.EQUALS_CHAR) {
+					parameterName = curToken.toString().trim();
+					curToken = null;
+					continue;
+				}
+			}
+		}
+			
+			// The character wasn't handled as a special character, so it
+			// is part of the token currently in progress.
+		curToken += curChar ;
+	}
+	/*Binding*/
+	var binding = new xap.data.controller.Binding(this.getContextStack(), select, dataSource, this._session, bindType, defaultValue);
+	if (formatter != null) {
+		binding.setFormatter(formatter);
+	}
+	return binding;
+};
+

Added: incubator/xap/trunk/src/xap/data/controller/ContextFrame.java
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/controller/ContextFrame.java?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/controller/ContextFrame.java (added)
+++ incubator/xap/trunk/src/xap/data/controller/ContextFrame.java Sun Oct  1 00:23:49 2006
@@ -0,0 +1,66 @@
+package com.nexaweb.plugin.data.controller;
+
+import com.nexaweb.plugin.data.datasource.DataAccessException;
+import com.nexaweb.plugin.data.datasource.DataSet;
+import com.nexaweb.plugin.data.datasource.DataSource;
+
+/**
+ * A context frame encapsulates the information necessary to 
+ * execute contextual queries against a data source during an
+ * iteration run.
+ * 
+ * @author dgennaco
+ */
+public class ContextFrame implements Context {
+
+	private DataSet _dataSet;
+	private int _index;
+	private String _name;
+
+	/**
+	 * Get the data source associated with this context frame.
+	 * 
+	 * @return the data source
+	 */
+	public DataSource getDataSource() {
+		return _dataSet.getDataSource();
+	}
+	
+	public Object getData() throws DataAccessException {
+		return _dataSet.getData(_index);
+	}
+	
+	public DataSet getDataSet() {
+		return _dataSet;
+	}
+	
+	public int getIndex() {
+		return _index;
+	}
+	/**
+	 * Get the name associated with this context frame.  The
+	 * name may be used to look up ancestor iterator context information
+	 * at any level of a nested iteration run.
+	 * 
+	 * @return the iterator name
+	 */
+	public String getName() {
+		return _name;
+	}
+	
+	/**
+	 * Create a new context frame.
+	 * 
+	 * @param dataSet The data set being iterated over.
+	 * 
+	 * @param index The current index into that data set.
+	 * 
+	 * @param name The name of the iterator.
+	 */
+	public ContextFrame(DataSet dataSet, int index, String name) {
+		_dataSet = dataSet;
+		_index = index;
+		_name = name;
+	}
+
+}

Added: incubator/xap/trunk/src/xap/data/controller/ContextFrame.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/controller/ContextFrame.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/controller/ContextFrame.js (added)
+++ incubator/xap/trunk/src/xap/data/controller/ContextFrame.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,104 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required  by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+ 
+
+//Xap.require("xap.data.datasource.DataAccessException") 
+Xap.require("xap.data.datasource.AbstractDataSet");
+Xap.require("xap.data.datasource.AbstractDataSource");
+/**
+	 * A context frame encapsulates the information necessary to 
+	 * execute contextual queries against a data source during an
+	 * iteration run.
+	 * 
+	 * @author dgennaco
+	 */
+Xap.provide("xap.data.controller.ContextFrame");
+
+/**
+ * Create a new context frame.
+ * 
+ * @param dataSet The data set being iterated over.
+ * 
+ * @param index The current index into that data set.
+ * 
+ * @param name The name of the iterator.
+ */
+xap.data.controller.ContextFrame = function (dataSet, index, name) {
+	this._dataSet = dataSet;
+	this._index = index;
+	this._name = name;
+};
+Xap.setupClassAsSubclassOf("xap.data.controller.ContextFrame", "Object");
+/**
+ * @private DataSet
+ **/
+xap.data.controller.ContextFrame.prototype._dataSet = new Array(0);
+/**
+ * @private int
+ **/
+xap.data.controller.ContextFrame.prototype._index = -1;
+/**
+ * @private String
+ **/
+xap.data.controller.ContextFrame.prototype._name = null;
+/**
+ * Get the data source associated with this context frame.
+ * 
+ * @return the data source
+ *
+ * @public
+ * @return {DataSource}
+ **/
+xap.data.controller.ContextFrame.prototype.getDataSource = function () {
+	return this._dataSet.getDataSource();
+};
+/**
+ * @public
+ * @return {Object}
+ * @throws DataAccessException 
+ **/
+xap.data.controller.ContextFrame.prototype.getData = function () {
+	return this._dataSet.getData(this._index);
+};
+/**
+ * @public
+ * @return {DataSet}
+ **/
+xap.data.controller.ContextFrame.prototype.getDataSet = function () {
+	return this._dataSet;
+};
+/**
+ * @public
+ * @return {int}
+ **/
+xap.data.controller.ContextFrame.prototype.getIndex = function () {
+	return this._index;
+};
+/**
+ * Get the name associated with this context frame.  The
+ * name may be used to look up ancestor iterator context information
+ * at any level of a nested iteration run.
+ * 
+ * @return the iterator name
+ *
+ * @public
+ * @return {String}
+ **/
+xap.data.controller.ContextFrame.prototype.getName = function () {
+	return this._name;
+};
+

Added: incubator/xap/trunk/src/xap/data/controller/ContextStack.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/controller/ContextStack.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/controller/ContextStack.js (added)
+++ incubator/xap/trunk/src/xap/data/controller/ContextStack.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,155 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required  by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+/**
+ * This class is used to keep tabs on a running iterator/iteration
+ * tree.  It allows lookup of named ancestor iterators for the current
+ * iteration (i.e. index) for relative binding and re-iteration against
+ * a data source in a contextual manner.
+ * 
+ * @author dgennaco
+ */
+Xap.provide("xap.data.controller.ContextStack");
+
+//Xap.require("xap.data.datasource.DataAccessException");
+Xap.require("xap.util.Vector");
+
+
+xap.data.controller.ContextStack = function () {
+};
+
+Xap.setupClassAsSubclassOf("xap.data.controller.ContextStack", "Object");
+/**
+ * @private Vector
+**/
+xap.data.controller.ContextStack.prototype._contextStack = new xap.util.Vector(0);
+/**
+ * Push a new context frame to the context stack.
+ * 
+ * @param frame the new context frame.
+ *
+ * @public
+ * @return {void}
+ *
+ * @param frame{ContextFrame}
+**/
+xap.data.controller.ContextStack.prototype.pushContext = function (frame) {
+	this._contextStack.addElement(frame);
+};
+/**
+ * Pop the current context from the context stack.
+ * 
+ * @return the popped context
+ *
+ * @public
+ * @return {ContextFrame}
+**/
+xap.data.controller.ContextStack.prototype.popContext = function () {
+	/*ContextFrame*/
+	var retFrame = this._contextStack.elementAt(this._contextStack.size() - 1);
+	this._contextStack.removeElementAt(this._contextStack.size() - 1);
+	return retFrame;
+};
+/**
+ * Get the context with the associated name (named ancestor iterator)
+ * from the context stack.
+ * 
+ * @param name the iterator name
+ * 
+ * @return the context frame
+ *
+ * @public
+ * @return {ContextFrame}
+ *
+ * @param name{String}
+**/
+xap.data.controller.ContextStack.prototype.getContext = function (name) {
+	if (name == null || name.length() == 0) {
+		return this.getCurrentContext();
+	}
+	for (var i = 0; i < this._contextStack.size(); i++) {
+		/*ContextFrame*/
+		var frame = this._contextStack.elementAt(i);
+		if ( name == frame.getName() ) {
+			return frame;
+		}
+	}
+	return null;
+};
+/**
+ * Get the current context frame from the top of the context stack.
+ * @return the context frame
+ *
+ * @public
+ * @return {ContextFrame}
+**/
+xap.data.controller.ContextStack.prototype.getCurrentContext = function () {
+	if (this._contextStack.size() == 0) {
+		return null;
+	}
+	return this._contextStack.elementAt(this._contextStack.size() - 1);
+};
+/**
+ * Convenience method to the the data set associated with the current
+ * context.
+ * 
+ * @return the data set
+ *
+ * @public
+ * @return {DataSet}
+**/
+xap.data.controller.ContextStack.prototype.getDataSet = function () {
+	return this.getCurrentContext().getDataSet();
+};
+/**
+ * Helper method to get the current index of the current context
+ * frame.
+ * 
+ * @return the index.
+ *
+ * @public
+ * @return {int}
+**/
+xap.data.controller.ContextStack.prototype.getIndex = function () {
+	return this.getCurrentContext().getIndex();
+};
+/**
+ * Convenience method to get the current context object's data object
+ * off the context stack.
+ * 
+ * @return the data object
+ * 
+ * @throws DataAccessException
+ *
+ * @public
+ * @return {Object}
+ * @throws DataAccessException 
+**/
+xap.data.controller.ContextStack.prototype.getData = function () {
+	return this.getCurrentContext().getData();
+};
+/**
+ * @public
+ * @return {Object}
+**/
+xap.data.controller.ContextStack.prototype.clone = function () {
+	/*ContextStack*/
+	var clone = new xap.data.controller.ContextStack();
+	clone._contextStack = this._contextStack.clone();
+	return clone;
+};
+

Added: incubator/xap/trunk/src/xap/data/controller/DataControllerException.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/controller/DataControllerException.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/controller/DataControllerException.js (added)
+++ incubator/xap/trunk/src/xap/data/controller/DataControllerException.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,187 @@
+Xap.require("xap.data.DataException") 
+
+/**
+ * Thrown by binding and iterator controllers when errors occur during data 
+ * rendering.
+ * 
+ * @author dgennaco
+ */
+Xap.provide("xap.data.controller.DataControllerException") ; 
+
+
+	/**
+	 * @see DataException#DataException(String)
+	  *
+ * @public
+ * @return {DataControllerException}
+ *
+ * @param msgId{String}
+**/
+xap.data.controller.DataControllerException.prototype. = function( msgId ) {
+	       super( msgId );
+	}
+
+
+	/**
+	 * @see DataException#DataException(String, String[], Locale)
+	  *
+ * @public
+ * @return {DataControllerException}
+ *
+ * @param msgId{String}
+ * @param args[]{String}
+ * @param locale{Locale  }
+**/
+xap.data.controller.DataControllerException  = function( msgId, args, locale ) {
+		this.superclass.call(this, msgId, args, locale );
+}
+
+
+
+Xap.setupClassAsSubclassOf("xap.data.controller.DataControllerException","Object") ; //"DataException"
+	
+	//-----------------------------------------------------------------------
+	// Constants.
+	//-----------------------------------------------------------------------
+	
+	// An exception occurred in an iterator while looping over a data set
+	// to create the nodes.
+	/*static final String*/
+xap.data.controller.DataControllerException.ITERATOR_LOOP_EXCEPTION =  
+		"iterationLoopException";
+	
+	// An exception ocurred attempting to schedule an iteration after a data
+	// set became available.
+	/*static final String*/
+xap.data.controller.DataControllerException.ITERATOR_SET_SCHEDULE_EXCEPTION =  
+		"iterationScheduleException";
+	
+	// An exception ocurred attempting to schedule an iteration after a data
+	// set became available.
+	/*static final String*/
+xap.data.controller.DataControllerException.BINDING_SET_SCHEDULE_EXCEPTION =  
+		"bindingSetScheduleException";
+	
+	// An iterator was declared with a relative select, but there was 
+	// no parent iterator in the context stack.
+	// {0} iterator element
+	/*static final String*/
+xap.data.controller.DataControllerException.RELATIVE_ITERATOR_WITHOUT_PARENT = 
+		"relativeIteratorWithoutParent";
+	
+	// A bind was declared with a relative select, but there was 
+	// no parent iterator in the context stack.
+	// {0} select
+	/*static final String*/
+xap.data.controller.DataControllerException.RELATIVE_BINDING_WITHOUT_PARENT =  
+		"relativeBindingWithoutParent";
+	
+	// An iterator was declared to be relative to a named ancestor, but the 
+	// ancestor was not found 
+	// no parent iterator in the context stack.
+	// {0} ancestor name
+	// {1} iterator element
+	/*static final String*/
+xap.data.controller.DataControllerException.RELATIVE_ITERATOR_INVALID_PARENT_REFERENCE = 
+		"relativeIteratorRefersToInvalidParent";
+	
+	// A quick binding was defined in the form context?select and the context
+	// could not be found in the data source container or as a named ancestor
+	// iterator
+	// {0} the context
+	/*static final String*/
+xap.data.controller.DataControllerException.QUICK_BINDING_NAMED_CONTEXT_NOT_FOUND =  
+		"quickBindingContextNotFound";
+	
+	/** 
+	 * A parameterized binding was defined as with {0}={1}, valid values
+	 * are {2}.
+	  *static final String*/
+xap.data.controller.DataControllerException.PARAMETERIZED_BINDING_INVALID_ARGUMENT_VALUE = 
+		"parameterizedBindingInvalidArgumentValue";
+	
+   
+	//-----------------------------------------------------------------------
+	// Constructors.
+	//-----------------------------------------------------------------------
+
+
+	
+
+
+	/**
+	 * @see DataException#DataException(String, String)
+	  *
+ * @public
+ * @return {DataControllerException}
+ *
+ * @param msgId{String}
+ * @param msgArgument{String}
+**/
+xap.data.controller.DataControllerException.prototype. = function( msgId, msgArgument) {
+		super( msgId, msgArgument );
+	}
+
+	/**
+	 * @see DataException#DataException(String, Throwable)
+	  *
+ * @public
+ * @return {DataControllerException}
+ *
+ * @param msgId{String}
+ * @param cause{Throwable}
+**/
+xap.data.controller.DataControllerException.prototype. = function( msgId, cause) {
+		super( msgId, cause );
+	}
+
+	/**
+	 * @see DataException#DataException(String, String[])
+	  *
+ * @public
+ * @return {DataControllerException}
+ *
+ * @param msgId{String}
+ * @param args[]{String}
+**/
+xap.data.controller.DataControllerException.prototype. = function( msgId, args[]) {
+		super( msgId, args );
+	}
+
+	/**
+	 * @see DataException#DataException(String, String, Throwable)
+	  *
+ * @public
+ * @return {DataControllerException}
+ *
+ * @param msgId{String}
+ * @param arg{String}
+ * @param cause{Throwable  }
+**/
+xap.data.controller.DataControllerException.prototype. = function( msgId, arg, cause ) {
+		super( msgId, arg, cause );
+	}
+
+	/**
+	 * @see DataException#DataException(String, String[], Throwable)
+	  *
+ * @public
+ * @return {DataControllerException}
+ *
+ * @param msgId{String}
+ * @param args[]{String}
+ * @param cause{Throwable  }
+**/
+xap.data.controller.DataControllerException.prototype. = function( msgId, args[], cause ) {
+		super( msgId, args, cause );
+	}
+
+	/**
+	 * @see DataException#DataException(String, String[], Throwable, Locale)
+	 */
+	public DataControllerException(String msgId, String[] args, Throwable cause, Locale locale) {
+		super(msgId, args, cause, locale);
+	}
+	
+	
+}

Added: incubator/xap/trunk/src/xap/data/controller/ElementLocation.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/data/controller/ElementLocation.js?view=auto&rev=451723
==============================================================================
--- incubator/xap/trunk/src/xap/data/controller/ElementLocation.js (added)
+++ incubator/xap/trunk/src/xap/data/controller/ElementLocation.js Sun Oct  1 00:23:49 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *	  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+Xap.provide("xap.data.controller.ElementLocation");
+Xap.require("xap.data.controller.XmlLocation");
+Xap.require("xap.xml.dom.XapElement");
+/**
+ *  @fileoverview
+ * An element location.
+ * @author dgennaco
+ * Construct a new element location.
+ * @param anElement{XapElement}
+ */
+
+xap.data.controller.ElementLocation = function(anElement) {
+		// Instead of listening to the parent, just
+		// listen to the element for document ownership listeners.
+	xap.data.controller.XmlLocation.call(this,anElement);
+};
+
+
+Xap.setupClassAsSubclassOf("xap.data.controller.ElementLocation", "xap.data.controller.XmlLocation");
+/**
+ * Get the index.
+ * 
+ * @return The index of this element location in its parent's
+ * child list.
+ *
+ * @public
+ * @return {int}
+**/
+xap.data.controller.ElementLocation.prototype.getIndex = function () {
+	return this._element.getParent().indexOfChild(this._element);
+};
+/**
+ * Remove this element location.  This will remove the element
+ * from its parent, and, in turn, from the DOM.
+ *
+ * @public
+ * @return {void}
+**/
+xap.data.controller.ElementLocation.prototype.remove = function () {
+	this._element.getParent().removeChild(this._element);
+	this.superclass.remove.call(this);
+};
+



Mime
View raw message