Author: jsundman
Date: 2007-11-08 16:54:29 -0800 (Thu, 08 Nov 2007)
New Revision: 7195
Modified:
openlaszlo/trunk/docs/src/developers/data-overview.dbk
openlaszlo/trunk/docs/src/developers/dataprovider.dbk
openlaszlo/trunk/docs/src/developers/dynamic-databinding.dbk
openlaszlo/trunk/docs/src/developers/index.dbk
openlaszlo/trunk/docs/src/developers/static-databinding.dbk
openlaszlo/trunk/docs/src/developers/two-way-databinding.dbk
Log:
checkpointing some data-chapter biz
Modified: openlaszlo/trunk/docs/src/developers/data-overview.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/data-overview.dbk 2007-11-08
17:30:15 UTC (rev 7194)
+++ openlaszlo/trunk/docs/src/developers/data-overview.dbk 2007-11-09
00:54:29 UTC (rev 7195)
@@ -1,3 +1,13 @@
+<example role="live-example">
+ <title>Runtime constraintes with applyConstraint</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="programs/constraints-$1.lzx"/></textobject>
+ </programlisting>
+</example>
+
+<para>
+</para>
+
<chapter id="data-overview">
<title>Introduction to Data and Data-Driven Applications</title>
<para>
Modified: openlaszlo/trunk/docs/src/developers/dataprovider.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/dataprovider.dbk 2007-11-08
17:30:15 UTC (rev 7194)
+++ openlaszlo/trunk/docs/src/developers/dataprovider.dbk 2007-11-09
00:54:29 UTC (rev 7195)
@@ -1,3 +1,4 @@
+
<chapter id="dataprovider">
<title>Under the hood: The dataprovider</title>
<para>
@@ -3,6 +4,7 @@
Summary: This is an advanced topic for people who want to develop alternative
protocols. It's used by Laszlo Webtop, for example.
</para>
+<section><title>Introduction to dataprovider</title>
<para>
-A DataProvider specifies the transport mechanism and policies for
communicating data requests from the client to the server. For example,
dataproviders may batch requests, whitelist/blacklist URIs.
+A DataProvider specifies the transport mechanism and policies for
communicating data requests from the client to the server. For example,
dataproviders may batch requests, establish whitelists and blacklists of URIs
etc.
</para>
<para>
@@ -12,11 +14,10 @@
<para>
It provides a way for datasets to use data protocols other than HTTP.
Enhancements provided by the dataprovider specification will allow clients to
set differing data request policies--currently only supported through a server
proxy like LPS--like security (e.g., blacklisting and whitelisting of URIs) and
transport mechanims (e.g., batching of HTTP requests)
</para>
+</section>
+
+<section><title>The <dataprovider> tag</title>
<para>
-Outline:
-
-Will cover these attributes:
-
dataprovider --The dataprovider which will handle the dataset's request.
multirequest -- True if multiple sequential requests can be made without
override previous requests. Default is false for backward compatibility.
@@ -24,15 +25,20 @@
datarequest -- The current datarequest instance to be used by the dataset to
call the dataprovider with. Other methods like setQueryParam() and setSrc() set
properties of dataRequest.
datarequestclass'' The default datarequest class to be used by the dataset.
-
-New dataset methods:
-
-** ''doRequest( DataRequest )'' behaves the same way as the previous doRequest
except a DataRequest instance may be passed in. If passed in, the dataRequest
param is used to call into the dataprovider, otherwise the dataset's
dataRequest instance is used.
-
-** ''handleResponse( DataRequest )'' the callback handler for doRequest().
-
-Data Request Sequence
-
+</para>
+</section>
+<section><title>New dataset methods</title>
+<para>
+''doRequest( DataRequest )'' behaves the same way as the previous doRequest
except a DataRequest instance may be passed in. If passed in, the dataRequest
param is used to call into the dataprovider, otherwise the dataset's
dataRequest instance is used.
+</para>
+<para>
+''handleResponse( DataRequest )'' the callback handler for doRequest().
+</para>
+</section>
+<section><title>
+The Data Request Sequence </title>
+<para>
The request life cycle begins with the dataset.doRequest() method. In
doRequest(), a DataRequest instance is generated to call into the dataprovider
with. Before the dataprovider is invoked, the DataRequest is filled in with
enough data for the dataprovider to handle the request. In turn, the
dataprovider sets a data callback on the DataRequest instance and then, using
request information provided by the DataRequest, makes a server data request.
When the server responds, the callback handler of the DataRequest instance is
invoked, which then calls the calling dataset's handleResponse method.
</para>
+</section>
</chapter>
Modified: openlaszlo/trunk/docs/src/developers/dynamic-databinding.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/dynamic-databinding.dbk
2007-11-08 17:30:15 UTC (rev 7194)
+++ openlaszlo/trunk/docs/src/developers/dynamic-databinding.dbk
2007-11-09 00:54:29 UTC (rev 7195)
@@ -1,3 +1,12 @@
+<example role="live-example">
+ <title>Runtime constraintes with applyConstraint</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="programs/constraints-$1.lzx"/></textobject>
+ </programlisting>
+</example>
+<para>
+</para>
+
<chapter id="dynamic-databinding">
<title>Dynamic Databinding</title>
<para>
@@ -7,17 +16,30 @@
Summary: The procedural (DOM) APIs for working with datasets allow you to
build and manipulate datasets at runtime using DOM conventions. There are three
kinds of objects: the absract class LzDataNode, and LzDataElement and
LzTextNode which are derived from it. We look at the attributes and methods on
each of these classes, and then look at short examples that show how to use
them to create and manipulate dataset objects. In this chapter we do NOT
illustrate databinding, since that requires use of datapointers; that's in the
next chapter. Here we just show how to build and manipulate data structures.
</para>
<para>
-Outline:
+
Introduction and Philosphy of the DOM APIs
-The LzDataNode object
+<section>
+<title>The LzDataNode object</title>
+<para>
+</para>
-- attributes
-- methods
-The LzDataElement object
+</section>
+
+<section>
+<title>The LzDataElement object</title>
+<para>
+</para>
-- attributes
-- methods
+</section>
+<section>
The LzDataText object
+<para>
+</para>
-- attributes
-- methods
-</para>
+</section>
+
</chapter>
Modified: openlaszlo/trunk/docs/src/developers/index.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/index.dbk 2007-11-08 17:30:15 UTC
(rev 7194)
+++ openlaszlo/trunk/docs/src/developers/index.dbk 2007-11-09 00:54:29 UTC
(rev 7195)
@@ -76,6 +76,9 @@
<xi:include href="data-structures.dbk"/>
<xi:include href="databinding.dbk"/>
<xi:include href="tutorials/data_app.dbk"/>
+ <xi:include href="static-databinding.dbk"/>
+ <xi:include href="data-patterns-and-best-practices.dbk"/>
+ <xi:include href="dataprovider.dbk"/>
</part>
<part id="developers.media">
Modified: openlaszlo/trunk/docs/src/developers/static-databinding.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/static-databinding.dbk 2007-11-08
17:30:15 UTC (rev 7194)
+++ openlaszlo/trunk/docs/src/developers/static-databinding.dbk 2007-11-09
00:54:29 UTC (rev 7195)
@@ -1,5 +1,6 @@
<chapter id="static-databinding">
-<title>Static Databinding with tag APIs</title>
+
+<section><title>Static Databinding with tag APIs</title></section>
<para>
Summary: In this chapter we explain how to instantiate global and local
datasets, populate them with "canned" data or from a remote source, and bind
their contents to views using datapaths. Datapointers are explained as a way to
position a logical cursor in a dataset.
</para>
@@ -9,38 +10,63 @@
<para>
This chapter uses mostly small examples, reusing many from the current
documentation. There will be many more examples, in order to illustrate most or
all of the attributes and methods on <dataset>, <datapath> and
<datapointer>
</para>
-<para>
-Outline:
-Declaring data using <dataset>
+<section><title>Creating Static Datasets</title>
+ <para>
+ Declaring data using <dataset>
-- Creating Dataset relationships at compile time
---Global datasets and class ("local") datasets
-- The "src" attribute; inline data versus retreived data
---Literal Data (the <data> tag)
---When and how datasets are updated (autorequest, doRequest())
----Dataset events: onerror, ondata, ontimeout
----Data rules
----- handling white space
----- namespaces
+ </para>
+</section>
-Databinding Introduction
----Data Binding with XPath
----Data Binding and Attributes
----Concatenating Attributes
-Conditional logic with Paths
-Binding data to objects
--- binding nodes using datapaths
--- binding attributes using $path
+<section><title>Dataset events</title>
+ <para>Dataset events: onerror, ondata, ontimeout</para>
-Changing a Datapath
---Setting the XPath Using a String
+ <section><title>Data rules</title></section>
+ <section><title>handling white space</title></section>
+ <section><title>Namespaces</title></section>
-Updating datasets
--- the updateData() method
+</section>
-Moving through data with datapointers
--- A datapointer is an object that represents a pointer to a node in an
LzDataset. The datapointer can be repositioned using either:
------ cursor movements calls such as selectNext(),
------ running an XPath request via setXPath()
+<section><title>Introduction to Databinding</title></section>
+
+<section><title>Data Binding with XPath</title>
+ <section>
+ Conditional logic with Paths
+ Binding data to objects
+ -- binding nodes using datapaths
+ -- binding attributes using $path
+ ---Concatenating Attributes
+ </section>
+ <section>
+ Changing a Datapath
+ --Setting the XPath Using a String
+
+ Updating datasets
+ -- the updateData() method
+ </section>
+</section>
+
+<section>
+
+<title>Moving through data with datapointers</title>
+<para>
+An object's datapath may be changed at run-time.
+
+The datapath must be declared in the LZX code.
+ datapath is a subclass of LzDatapointer.
+ LzDatapointer is capable of moving to a different location in
the XML e.g.
+ Use selectNext(), selectPrev() etc., to move around the
dataset.
+ Use setXPath() with a new string XPath to re-bind to a new
location.
+ Use setPointer() to bind to a specific LzDataElement.
</para>
+ <para>
+ A datapointer is an object that represents a pointer to a node in an
LzDataset. The datapointer can be repositioned using either:
+ ----- cursor movements calls such as selectNext(),
+ ----- running an XPath request via setXPath()
+ </para>
+</section>
</chapter>
Modified: openlaszlo/trunk/docs/src/developers/two-way-databinding.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/two-way-databinding.dbk
2007-11-08 17:30:15 UTC (rev 7194)
+++ openlaszlo/trunk/docs/src/developers/two-way-databinding.dbk
2007-11-09 00:54:29 UTC (rev 7195)
@@ -1,3 +1,18 @@
+<example role="live-example">
+ <title>Runtime constraintes with applyConstraint</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="programs/constraints-$1.lzx"/></textobject>
+ </programlisting>
+</example>
+<example role="live-example">
+ <title>Runtime constraintes with applyConstraint</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="programs/constraints-$1.lzx"/></textobject>
+ </programlisting>
+</example>
+<para>
+</para>
+
<chapter id="two-way-databinding">
<title>Two-way databinding</title>
<para>
@@ -10,6 +25,16 @@
(2) hopefully, give enough explanation and examples such that people can mix
and match between the two approaches without getting hopelessly confused.
</para>
<para>
+
+ If the data changes, the data-bound object will update.
+ Sometimes, with input controls, you need to bind back into the
data.
+ To trigger two-way databinding:
+ Call datapath.updateData().
+ Optionally, define an updateData() method at the root of
the control.
+ This method is called automatically.
+ Returns the value to put back into the data.
+</para>
+<para>
Outline:
A comparison of datapath/datapointer APIs and DOM APIs
-- How to do equivalent action using either technique
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins