[Laszlo-checkins] r6797 - in openlaszlo/branches/paperpie: . WEB-INF/lps/lfc/compiler WEB-INF/lps/lfc/core WEB-INF/lps/lfc/data WEB-INF/lps/lfc/debugger WEB-INF/lps/lfc/debugger/platform/dhtml WEB-INF/lps/lfc/debugger/platform/swf WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/kernel/swf/dojo WEB-INF/lps/lfc/kernel/swf/dojo/flash6 WEB-INF/lps/lfc/services WEB-INF/lps/lfc/services/platform/dhtml WEB-INF/lps/lfc/services/platform/swf WEB-INF/lps/lfc/views WEB-INF/lps/server/bin WEB-INF/lps/server/src/org/openlaszlo/compiler WEB-INF/lps/server/src/org/openlaszlo/i18n WEB-INF/lps/server/src/org/openlaszlo/sc WEB-INF/lps/server/src/org/openlaszlo/server WEB-INF/lps/server/src/org/openlaszlo/servlets WEB-INF/lps/server/src/org/openlaszlo/servlets/responders WEB-INF/lps/templates demos/amazon demos/calendar demos/lzpix demos/weather docs/component-browser docs/src/developers docs/src/developers/programs docs/src/developers/tutorials laszlo-explorer/basics lps/admin lps/components/base lps/components/extensions lps/components/extensions/test lps/components/incubator lps/components/lz lps/components/utils/replicator lps/includes/source test/compiler_errors test/lfc/data test/lztest
ben@openlaszlo.org
ben at openlaszlo.org
Wed Oct 10 16:17:25 PDT 2007
Author: ben
Date: 2007-10-10 16:17:04 -0700 (Wed, 10 Oct 2007)
New Revision: 6797
Added:
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/ASTVisitor.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java
openlaszlo/branches/paperpie/docs/src/developers/programs/layout-and-design-$19.lzx
Modified:
openlaszlo/branches/paperpie/
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/Class.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzDataset.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzDebug.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzMonitor.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzTrace.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/LzModeManager.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzInputText.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzText.lzs
openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzc.bat
openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzdc.bat
openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzmc.bat
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/FontCompiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ImportCompiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryCompiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Parser.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ToplevelCompiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema_Test.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/i18n/laszlomessages.properties
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/server/LPS.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/LZServlet.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderCompile.java
openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderOBJECT.java
openlaszlo/branches/paperpie/WEB-INF/lps/templates/html-response.xslt
openlaszlo/branches/paperpie/build.properties
openlaszlo/branches/paperpie/demos/amazon/amazon.lzx
openlaszlo/branches/paperpie/demos/calendar/basepanel.lzx
openlaszlo/branches/paperpie/demos/calendar/eventselector.lzx
openlaszlo/branches/paperpie/demos/calendar/infopanel.lzx
openlaszlo/branches/paperpie/demos/lzpix/app.lzx
openlaszlo/branches/paperpie/demos/weather/weather.lzx
openlaszlo/branches/paperpie/docs/component-browser/common.lzx
openlaszlo/branches/paperpie/docs/component-browser/hierarchyview.lzx
openlaszlo/branches/paperpie/docs/src/developers/animation.dbk
openlaszlo/branches/paperpie/docs/src/developers/architecture.dbk
openlaszlo/branches/paperpie/docs/src/developers/browser-integration.dbk
openlaszlo/branches/paperpie/docs/src/developers/classes-powerprogramming.dbk
openlaszlo/branches/paperpie/docs/src/developers/colors.dbk
openlaszlo/branches/paperpie/docs/src/developers/comp-intro.dbk
openlaszlo/branches/paperpie/docs/src/developers/compiler.dbk
openlaszlo/branches/paperpie/docs/src/developers/components-design.dbk
openlaszlo/branches/paperpie/docs/src/developers/constraints.dbk
openlaszlo/branches/paperpie/docs/src/developers/cookies.dbk
openlaszlo/branches/paperpie/docs/src/developers/data-structures.dbk
openlaszlo/branches/paperpie/docs/src/developers/databinding.dbk
openlaszlo/branches/paperpie/docs/src/developers/debugging.dbk
openlaszlo/branches/paperpie/docs/src/developers/delegates.dbk
openlaszlo/branches/paperpie/docs/src/developers/deployers-index.dbk
openlaszlo/branches/paperpie/docs/src/developers/designers.dbk
openlaszlo/branches/paperpie/docs/src/developers/ecmascript-and-lzx.dbk
openlaszlo/branches/paperpie/docs/src/developers/editing-lzx.dbk
openlaszlo/branches/paperpie/docs/src/developers/fonts.dbk
openlaszlo/branches/paperpie/docs/src/developers/initialization-and-instantiation.dbk
openlaszlo/branches/paperpie/docs/src/developers/language-preliminaries.dbk
openlaszlo/branches/paperpie/docs/src/developers/layout-and-design.dbk
openlaszlo/branches/paperpie/docs/src/developers/lzunit.dbk
openlaszlo/branches/paperpie/docs/src/developers/media-resources.dbk
openlaszlo/branches/paperpie/docs/src/developers/methods-events-attributes.dbk
openlaszlo/branches/paperpie/docs/src/developers/performance.dbk
openlaszlo/branches/paperpie/docs/src/developers/persistent_connection.dbk
openlaszlo/branches/paperpie/docs/src/developers/program-development.dbk
openlaszlo/branches/paperpie/docs/src/developers/programs/text-$6.lzx
openlaszlo/branches/paperpie/docs/src/developers/proxied.dbk
openlaszlo/branches/paperpie/docs/src/developers/rpc-javarpc.dbk
openlaszlo/branches/paperpie/docs/src/developers/rpc-soap.dbk
openlaszlo/branches/paperpie/docs/src/developers/rpc-xmlrpc.dbk
openlaszlo/branches/paperpie/docs/src/developers/rpc.dbk
openlaszlo/branches/paperpie/docs/src/developers/structure.dbk
openlaszlo/branches/paperpie/docs/src/developers/survey-chapter.dbk
openlaszlo/branches/paperpie/docs/src/developers/text.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/art_assets.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/calculator.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/data.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/data_app.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/laszlo_basics.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/scripting.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/text.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/views.dbk
openlaszlo/branches/paperpie/docs/src/developers/tutorials/window.dbk
openlaszlo/branches/paperpie/docs/src/developers/video.dbk
openlaszlo/branches/paperpie/docs/src/developers/views.dbk
openlaszlo/branches/paperpie/laszlo-explorer/basics/form.lzx
openlaszlo/branches/paperpie/lps/admin/dev-console.lzx.swf
openlaszlo/branches/paperpie/lps/components/base/basecombobox.lzx
openlaszlo/branches/paperpie/lps/components/base/basedatacombobox.lzx
openlaszlo/branches/paperpie/lps/components/base/basewindow.lzx
openlaszlo/branches/paperpie/lps/components/extensions/drawview.lzx
openlaszlo/branches/paperpie/lps/components/extensions/html.lzx
openlaszlo/branches/paperpie/lps/components/extensions/test/html-swf.jsp
openlaszlo/branches/paperpie/lps/components/extensions/test/html.lzx
openlaszlo/branches/paperpie/lps/components/incubator/roundrect.lzx
openlaszlo/branches/paperpie/lps/components/incubator/textstyle.lzx
openlaszlo/branches/paperpie/lps/components/lz/datacombobox.lzx
openlaszlo/branches/paperpie/lps/components/lz/edittext.lzx
openlaszlo/branches/paperpie/lps/components/lz/gridtext.lzx
openlaszlo/branches/paperpie/lps/components/utils/replicator/replicator.lzx
openlaszlo/branches/paperpie/lps/includes/source/embednew.js
openlaszlo/branches/paperpie/lps/includes/source/flash.js
openlaszlo/branches/paperpie/lps/includes/source/iframemanager.js
openlaszlo/branches/paperpie/lps/includes/source/lzhistory.js
openlaszlo/branches/paperpie/test/compiler_errors/bogus-attribute-error.lzx
openlaszlo/branches/paperpie/test/compiler_errors/redfine-builtin.lzx
openlaszlo/branches/paperpie/test/lfc/data/dollarpathquote.lzx
openlaszlo/branches/paperpie/test/lfc/data/nonpoolingoptimization.lzx
openlaszlo/branches/paperpie/test/lfc/data/stringxml.lzx
openlaszlo/branches/paperpie/test/lfc/data/testdataheaders.lzx
openlaszlo/branches/paperpie/test/lfc/data/testdatapointer.lzx
openlaszlo/branches/paperpie/test/lfc/data/testheaderresponse.lzx
openlaszlo/branches/paperpie/test/lfc/data/testhttpdata.lzx
openlaszlo/branches/paperpie/test/lztest/lztest-view.lzx
Log:
Merged revisions 6505-6796 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk
...............
r6506 | ben | 2007-09-16 14:46:02 -0700 (Sun, 16 Sep 2007) | 1 line
Updating build.properties to 4.1.x.0
...............
r6520 | ptw | 2007-09-19 09:56:48 -0700 (Wed, 19 Sep 2007) | 13 lines
Change 20070918-ptw-k by ptw at dueling-banjos.local on 2007-09-18 18:21:53 EDT
in /Users/ptw/OpenLaszlo/ringding
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Tweak output of Debug.bugReport
Details:
Use Debug.inspect, not inspectInternal so the 'hotlink' markup is hidden.
Tests:
IWFM
...............
r6521 | lou | 2007-09-19 10:13:30 -0700 (Wed, 19 Sep 2007) | 24 lines
Change 20070919-lou-isO2ST by lou at lou-laptop on 2007-09-19 05:45:28 AST
in /home/lou/src/svn/openlaszlo/trunk/docs/src/developers
for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src/developers
Summary: fix LPP-4529
New Features: spell-checked file
Bugs Fixed:
Technical Reviewer: Benjamin Shine
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6522 | lou | 2007-09-19 10:20:19 -0700 (Wed, 19 Sep 2007) | 24 lines
Change 20070919-lou-idaGli by lou at lou-laptop on 2007-09-19 07:07:29 AST
in /home/lou/src/svn/openlaszlo/trunk/docs/src/developers
for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src/developers
Summary: fix LPP-3826
New Features:
Bugs Fixed: LPP-3826 changes that made sense, and corrected many spelling errors
Technical Reviewer: Benjamine Shine
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6529 | dda | 2007-09-19 13:26:31 -0700 (Wed, 19 Sep 2007) | 46 lines
Change 20070919-dda-f by dda at freddie.local on 2007-09-19 13:41:48 EDT
in /Users/dda/laszlo/src/svn/openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc
for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc
Summary: generatePredictableTemps option for script compiler
New Features:
added new option generatePredictableTemps that allows for direct comparison
of compiler outputs.
Bugs Fixed:
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The new option, is specified to the compiler like this:
--option generatePredictableTemps=true
Note that this option is *not* the default, nor is it recommended for anyone
that is not doing side-by-side tests of the compiler. When used, it may
in fact *break* functionality. It provides some capabilities to assist
in internal testing, and specifically for testing the refactoring work.
When this is option is set, variables that normally use a UUID-like naming (for uniqueness between runs)
are changed to have predictable names, that is names that will be identical each time
the compiler is rerun. Such predictable names (like "$lzsc$1", "$lzsc$2", etc.) will
collide with the same names used in other compilations that appear in the same applications,
which may cause problems at runtime. This option uses a simple increment to generate
names. Seeding the random number generator with a fixed value, like 0, would also work
but the output will appear more obfuscated.
The intention is that this option can be used when making an architectural or 'cleanup'
change to the compiler that is not intended to change any behavior. When this change
is done, a suitably complete test input can be fed to the old and new compiler, both
with the generatePredictableTemps option, and comparisons of outputs can be made directly.
Tests:
...............
r6531 | max | 2007-09-19 15:32:07 -0700 (Wed, 19 Sep 2007) | 28 lines
Change 20070919-maxcarlson-Z by maxcarlson at plastik on 2007-09-19 09:23:44 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix history for swf7
New Features:
Bugs Fixed: LPP-4746 - Javascript errors when using the history mechanism in swf7
Technical Reviewer: promanik
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzHistory.as - Fix braino - use correct callJS() API.
embednew.js - Add 'loaded' property that is set to true when applications are loaded. Use loaded property to decide when apps are ready to receive events.
lzhistory.js - Add explicit scope for all methods, properties in Lz.history.set()
Tests: http://localhost:8080/trunk/test/history/history.lzx?lzr=swf7 no longer warns
...............
r6533 | lou | 2007-09-19 17:11:42 -0700 (Wed, 19 Sep 2007) | 24 lines
Change 20070919-lou-If2BNY by lou at lou-laptop on 2007-09-19 15:27:06 AST
in /home/lou/src/svn/openlaszlo/trunk/docs/src/developers
for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src/developers
Summary: spell check dguide
New Features:
Bugs Fixed: LPP-4754
Technical Reviewer: Benjamin Shine
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details: These are the files that actually had spelling errors
Tests:
...............
r6539 | lou | 2007-09-20 03:17:33 -0700 (Thu, 20 Sep 2007) | 24 lines
Change 20070919-lou-Ccvkux by lou at lou-laptop on 2007-09-19 20:26:11 AST
in /home/lou/src/svn/openlaszlo/trunk/WEB-INF/lps/lfc/views
for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc/views
Summary: fix comment in source for addProxyPolicy
New Features:
Bugs Fixed: LPP-1552: doc for LzView.addProxyPolicy is wrong
Technical Reviewer: (pending)
QA Reviewer: Phil
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
...............
r6548 | dda | 2007-09-21 10:54:15 -0700 (Fri, 21 Sep 2007) | 67 lines
Change 20070919-dda-V by dda at freddie.local on 2007-09-19 17:35:41 EDT
in /Users/dda/laszlo/src/svn/openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc
for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc
Summary: script compiler refactoring
New Features:
No externally visible changes. A rearrangement of source code to allow for better
sharing between modules, and separation of most of the platform independent parts of the compiler.
This more easily allows various future work (e.g. SWF9) to proceed in parallel with
general maintenance changes.
Bugs Fixed:
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Added a new class CommonGenerator that is the base class of
JavascriptGenerator and CodeGenerator. Methods from the two
subclasses that are textually the same, or can be easily coerced
to be the same are now only in CommonGenerator.
Data members and internal classes that are identical are
also now in the base class.
To get even greater sharing, many methods (like virtually all the
visit* methods) that had signature changes in JavascriptGenerator
(that is, they return 'SimpleNode' rather than void), have changed
across the board to return SimpleNode. That is, these functions return
the possibly modified node that is visited. In the CodeGenerator class, this
concept is generally not used, so even though this class plays by the
same rules, return values from such methods are ultimately ignored.
But this gives a lot more code sharing and many more functions could be moved
to CommonGenerator.
Likewise, methods that visit expressions that used to be declared
returning boolean in CodeGenerator now must return SimpleNode.
The backwards-seeming translation is that 'true' corresponds to null,
and false corresponds to the existing node. Doing it this way
gets the maximum code sharing, it clearly reflects the way that
the code was originally transformed after splitting.
CommonGenerator also implements a new interface: ASTVisitor, which is
the union of all the visit* methods (returning a SimpleNode, of
course). This allows methods in CommonGenerator (esp. visitStatement)
to freely call any other visit* method, whether or not it is actually
defined in CommonGenerator.
Most of these changes listed above are almost mechanical using the
indicated strategy; only occasionally were small (equivalent) coding
changes introduced, and then only if a method was otherwise identical.
More elaborate code sharing is possible, and was attempted, but
such changes tended to inhibit overall readability and maintainability.
Tests:
built all files in lps/includes/lfc with the previous compiler (without
these changes) using the flags "--option generatePredictableTemps=true".
built the same files with the new compiler (with these changes).
All *.js files compare exactly, all *.lzl files were disassembled,
and the output from that compares exactly.
...............
r6550 | lou | 2007-09-21 12:11:51 -0700 (Fri, 21 Sep 2007) | 24 lines
Change 20070920-lou-pl9JDK by lou at lou-laptop on 2007-09-20 07:30:05 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: spell check tutorials
New Features:
Bugs Fixed: LPP-4761 spell check tutorial portion of the dguide
Technical Reviewer: Benjamin Shine
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6559 | bargull | 2007-09-23 01:14:57 -0700 (Sun, 23 Sep 2007) | 28 lines
Change 20070922-bargull-0 by bargull at dell--p4--2-53 on 2007-09-22 22:15:29
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: basewindow must include basecomponent
New Features:
Bugs Fixed:
LPP-4758 "basewindow must include basecomponent"
Technical Reviewer: max
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Applications which use solely basewindow do not compile without this change.
Just added the include-tag for basecomponent.lzx in basewindow.lzx
Tests:
see testcase at LPP-4758
...............
r6568 | ben | 2007-09-24 11:59:55 -0700 (Mon, 24 Sep 2007) | 44 lines
Change 20070923-ben-l by ben at slim.local on 2007-09-23 15:15:48 PDT
in /Users/ben/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add iPhone-specific hints to lzt=html wrapper to make iPhone apps look nice
New Features: apps are not zoomable or scalable with two-finger scaling on the iPhone
Bugs Fixed:
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
As described in http://weblog.openlaszlo.org/archives/2007/07/our-first-iphone-app/
OpenLaszlo apps can look pretty decent on the iPhone just by adding a single
line to the html wrapper.
To see it in action, check out and run...
http://svn.openlaszlo.org/labs/newsmatch/
with and without this patch applied, with lzt=html. index.html,
in that directory, has links to the apps with the correct
query args, lzr=dhtml&lzt=html.
Without this patch, the app is scaled down to too small on the iPhone,
and the user can zoom and pan. With this patch, it appears at a good
size and is not zoomable. However, it is still pannable; I'm not sure
how to stop that.
This meta tag should be ignored by all other browsers. It is
a very small download cost.
Release Notes:
This change makes it possible to get apps to look right
on the iPhone without hand-editing wrappers.
Details:
Tests:
(see above, with newsmatch-labs)
...............
r6582 | jcrowley | 2007-09-25 00:19:25 -0700 (Tue, 25 Sep 2007) | 44 lines
Change 20070920-jcrowley-8 by jcrowley at doctormanhattan.mshome.net on 2007-09-20 21:06:57 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk-two
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Update data tests to include dataloaders, remove
<datasource>, and more
New Features:
Bugs Fixed: LPP-4677 - Update data tests to include dataloaders,
remove <datasource>, and more
Technical Reviewer: henry
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: This provides fixes for existing tests
and adds a couple other tests for new
dataprovider components. I'm working
on more tests for these, but this is
what I have so far.
You *might* get an error or failure with
clientcachebreaker, but it doesn't fail
consistently. I believe this is due to
the nature of the test. I think it fails
for me maybe once out of every five runs.
There were no tests of datasource that
I could find. (It was mentioned but
never instantiated anywhere.) So that
part of the bug is kind of N/A.
More extensive tests hopefully
forthcoming. I'll file a separate bug
for extending the testing.
Tests: Run all tests in test/lfc/data/
...............
r6587 | ptw | 2007-09-25 09:36:15 -0700 (Tue, 25 Sep 2007) | 19 lines
Change 20070925-ptw-7 by ptw at dueling-banjos.local on 2007-09-25 09:38:45 EDT
in /Users/ptw/OpenLaszlo/ringding
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix merge error in r6548
Bugs Fixed:
LPP-4786 'Script compiler needs refactoring before SWF9 work can begin'
Technical Reviewer: dda at ddanderson.com (Message-Id: <C4801539-C2A3-403E-968B-1059AD82FA4C at ddanderson.com>)
QA Reviewer: jcrowley (pending)
Details:
Assertion left in common path that is supposed to only be in subclass.
Tests:
ant clean build will now build without assertion
...............
r6589 | ptw | 2007-09-25 12:53:25 -0700 (Tue, 25 Sep 2007) | 26 lines
Change 20070925-ptw-2 by ptw at dueling-banjos.local on 2007-09-25 11:56:09 EDT
in /Users/ptw/OpenLaszlo/ringding-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix SWF constraint lossage in r6548
Bugs Fixed:
LPP-4786 'Script compiler needs refactoring before SWF9 work can begin'
Technical Reviewer: dda at ddanderson.com (Message-Id: <24816C7A-777A-4188-9872-A5313BFD19F6 at ddanderson.com>)
QA Reviewer: hminsky (pending)
Doc Reviewer: (pending)
Details:
The remodularization tripped up the SWF Generator because it was
analyzing the constraint body _after_ it had been optimized to
inline the setAttribute call. Move the dependency analyzer to the
top of translateFunctionInternal, as is done in Javascript
Generator.
Tests:
Enabling ReferenceGenerator.debugConstraints shows that
constraints are actually being processed. smokecheck.lzx passes
in SWF now, and the SWF debugger window shows up again.
...............
r6595 | max | 2007-09-25 15:04:25 -0700 (Tue, 25 Sep 2007) | 26 lines
Change 20070925-maxcarlson-7 by maxcarlson at plastik on 2007-09-25 13:55:11 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix xoffset and yoffset
New Features:
Bugs Fixed: LPP-4778 - "LzView#setX(..)" and "LzView#setY(..)" optimization breaks xoffset / yoffset
Technical Reviewer: promanik
QA Reviewer: bargull
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: lztest-view.lzx - add test for x/yoffset and one with rotation.
LaszloView.lzs - Add correct initial values for _x, _y, _width, _height. Add argument to setX/setY() to override cached values. setRotation/setXOffset/setYOffset() call setX/setY() with force set to true.
Tests: Run updated lztest-view.lzx with and without the changes to LaszloView.lzs. You should see the test fail without the LaszloView changes. Tested in swf7/8/dhtml.
...............
r6602 | max | 2007-09-25 17:22:21 -0700 (Tue, 25 Sep 2007) | 24 lines
Change 20070925-maxcarlson-g by maxcarlson at plastik on 2007-09-25 15:42:07 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix stretches
New Features:
Bugs Fixed: LPP-4778 - "LzView#setX(..)" and "LzView#setY(..)" optimization breaks xoffset / yoffset
Technical Reviewer: promanik
QA Reviewer: andrebargull at aol.com
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Shouldn't have set defaults for _x/y/width/height.
Tests: http://localhost:8080/trunk/examples/components/style_example.lzx runs correctly
...............
r6604 | max | 2007-09-25 19:10:53 -0700 (Tue, 25 Sep 2007) | 24 lines
Change 20070925-maxcarlson-d by maxcarlson at plastik on 2007-09-25 16:15:32 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix explicit replicator
New Features:
Bugs Fixed: LPP-4664 - test/explicit-replicators/replicator.lzx visually deletes last two items when the second-to-last item is clicked and ...
Technical Reviewer: hminsky
QA Reviewer: andrebargull at aol.com
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Per abargull and hminsky's suggestions, changed this._pointer.p to this.dataset for clarity, added destroy() to prevent memory leaks, _updateChildren() deals with a single node correctly, createChildren() calls super.createChildren(), __adjustVisibleClones() uses this.container instead of this.parent to lock/unlock layouts.
Tests: See LPP-4664.
...............
r6608 | lou | 2007-09-26 02:38:21 -0700 (Wed, 26 Sep 2007) | 24 lines
Change 20070921-lou-l9Z4aa by lou at lou-laptop on 2007-09-21 14:17:20 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: correct minor doc issues
New Features:
Bugs Fixed: LPP-4762, fix minor issues (mostly typos) reported by user
Technical Reviewer: Ben Shine
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6609 | lou | 2007-09-26 02:39:27 -0700 (Wed, 26 Sep 2007) | 25 lines
Change 20070925-lou-PdNB5U by lou at lou-laptop on 2007-09-25 10:31:35 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Update to performance chapter of dguide
New Features:
Bugs Fixed: LPP-1048: IDs vs names
Technical Reviewer: Ben Shine
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests: Added the information from the JIRA bug. I pretty much
copied the text as is (I don't know JavaScript).
...............
r6612 | lou | 2007-09-26 04:46:33 -0700 (Wed, 26 Sep 2007) | 25 lines
Change 20070926-lou-YHeW1d by lou at lou-laptop on 2007-09-26 05:49:05 AST
in /home/lou/src/svn/openlaszlo/trunk/docs/src/developers
for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src/developers
Summary: LPP-4762: minor doc changes based on user input
New Features: This file should have gotten checked in with change
20070921-lou-l9Z4aa; I left it out by mistake.
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6623 | lou | 2007-09-26 14:47:35 -0700 (Wed, 26 Sep 2007) | 24 lines
Change 20070926-lou-FCWTJO by lou at lou-laptop on 2007-09-26 12:53:34 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: check the dguide for correct descriptions of whitespace
New Features:
Bugs Fixed: LPP-984 check the data and solo chapters for correct descriptions of whitespace and trimwhitespace
Technical Reviewer: Ben Shine
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6630 | max | 2007-09-26 18:41:06 -0700 (Wed, 26 Sep 2007) | 26 lines
Change 20070925-maxcarlson-3 by maxcarlson at plastik on 2007-09-25 17:03:02 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Make drawviews resize.
New Features:
Bugs Fixed: LPP-3905 - Changes on width/height must be propagated down to the HTML-canvas in DHTML
Technical Reviewer: promanik
QA Reviewer: andrebargull at aol.com
Doc Reviewer: (pending)
Documentation: Drawviews now resize when the width or height are changed. In DHTML, the drawview will be cleared so it must be redrawn whenever the oncanvas event is sent.
Release Notes:
Details: drawview.lzx - In _buildcanvas(), if the canvas exists it is resized and the oncontext event is sent because it will be cleared. For IE, the canvas must be completely destroyed and rebuilt. setWidth() and setHeight() call _buildcanvas() whenever a valid height and width are set.
roundrect.lzx - Clear cached color state when oncontext is sent to ensure canvas state is reset properly.
Tests: http://localhost:8080/trunk/lps/components/incubator/test/test-roundrectbutton.lzx?lzr=dhtml now resizes beyond 100 pixels in IE and firefox.
...............
r6631 | max | 2007-09-26 18:43:06 -0700 (Wed, 26 Sep 2007) | 24 lines
Change 20070925-maxcarlson-m by maxcarlson at plastik on 2007-09-25 17:31:46 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: text inside a combobox should not resize
New Features:
Bugs Fixed: LPP-4787 - text inside a combobox should not resize
Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Set text resize to false. False used to be the default in 3.x.
Tests: See LPP-4787.
...............
r6637 | jcrowley | 2007-09-26 21:20:51 -0700 (Wed, 26 Sep 2007) | 59 lines
Change 20070926-jcrowley-r by jcrowley at doctormanhattan.mshome.net on 2007-09-26 05:45:59 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk-a
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: maxlength doesn't work for LzText (NOTE: also fixed
for inputtext)
New Features:
Bugs Fixed: LPP-2208 - maxlength doesn't work for LzText
Technical Reviewer: pbr
QA Reviewer: max
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Added a check for maxlength to setText() functions
in both LzText and LzInputText. Also fixed it for
initial text construction. If maxlength is set,
text will not exceed the length, even with setText().
(Before this, it would catch it with inputtext,
but only when one entered text into the box.
setText() would ignore it.)
Tests: Run the following:
<canvas width="500" height="500">
<simplelayout axis="y"/>
<text id="tx1" text="This text shouldn't be truncated."/>
<text id="tx2" text="This text should be truncated after 12 characters." maxlength="12"/>
<inputtext id="tx3" text="Type something here fdafda." maxlength="20" width="300"
bgcolor="0xDDFFDD"/>
<button
onclick="tx1.setText('This text is pretty long, but it should be fine.')">
Click here to set the first text element using setText()
</button>
<button
onclick="tx2.setText('This text is much longer than the allowed limit of twelve characters.')">
Click here to set the second text element using setText()
</button>
<button
onclick="tx3.setText('This text is much longer than the allowed limit of twenty characters.')">
Click here to set the inputtext using setText()
</button>
</canvas>
This also passes smokecheck, and actually clears up
a failure in the lztest-text test.
...............
r6640 | ptw | 2007-09-27 05:20:32 -0700 (Thu, 27 Sep 2007) | 16 lines
Change 20070926-ptw-p by ptw at dueling-banjos.local on 2007-09-26 17:30:12 EDT
in /Users/ptw/OpenLaszlo/ringding
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Declare clonenumber
Bugs Fixed:
LPP-4793 'Using clonenumber emits warning when using replicator'
Technical Reviewer: hminsky (pending)
QA Reviewer: pablo (Message-ID: <Pine.OSX.4.64.0709261631480.11512 at pkang-mac.local>)
Tests:
Bug test case no longer gives a warning
...............
r6643 | lou | 2007-09-27 10:59:50 -0700 (Thu, 27 Sep 2007) | 24 lines
Change 20070927-lou-v6tk4a by lou at lou-laptop on 2007-09-27 13:59:34 AST
in /home/lou/src/svn/openlaszlo/trunk/docs/src/developers/programs
for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src/developers/programs
Summary:
New Features:
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
...............
r6644 | lou | 2007-09-27 11:01:43 -0700 (Thu, 27 Sep 2007) | 24 lines
Change 20070927-lou-3dtDKq by lou at lou-laptop on 2007-09-27 14:01:01 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary:
New Features:
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
...............
r6645 | pbr | 2007-09-27 13:15:21 -0700 (Thu, 27 Sep 2007) | 30 lines
Change 20070926-Philip-4 by Philip at Philip-DC on 2007-09-26 20:26:00 EDT
in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: DHTML: onkeyup/onkeydown sent twice
New Features:
Bugs Fixed: LPP-4267
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
There are two code paths that are generating onkeyup/onkeydown events in dhtml (The details are in LPP-4267). I modified LzInputTextSprite.js to not generate onkeyup/onkeydown. It still generates onchange though. The path that generates onkeyup/onkeydown is in LzKeys, the same as swf.
Tests:
See LPP-4267. With this change, a single keyup/keydown is generated for each key click/release.
smokecheck.lzx
Files:
M WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070926-Philip-4.tar
...............
r6649 | jcrowley | 2007-09-27 15:30:49 -0700 (Thu, 27 Sep 2007) | 29 lines
Change 20070920-jcrowley-Y by jcrowley at doctormanhattan.mshome.net on 2007-09-20 21:28:58 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Introduction->Form example does not work correctly
New Features:
Bugs Fixed: LPP-4763 - Introduction->Form example does not work correctly
Technical Reviewer: ben
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: A quick fix to prevent objects behind a view from
being clickable.
Tests: Run laszlo-explorer -> laszlo-in-ten -> introduction ->
form. Enter your name, select a new name, click
the submit button. Click around in the box. Note
that the objects behind this view that were still
clickable when the view was visible are no longer
so.
...............
r6650 | jcrowley | 2007-09-27 15:34:07 -0700 (Thu, 27 Sep 2007) | 26 lines
Change 20070921-jcrowley-P by jcrowley at doctormanhattan.mshome.net on 2007-09-21 18:37:01 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Calendar: Event info bar clipped at left of canvas
New Features:
Bugs Fixed: LPP-4692 - Calendar: Event info bar clipped at
left of canvas
Technical Reviewer: pbr
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Something was clipping when it shouldn't have been.
Tests: Run Calendar demo in DHTML and Flash; click on an
event on Sunday; notice that the event info bar is
no longer clipped on the left.
...............
r6651 | jcrowley | 2007-09-27 15:52:59 -0700 (Thu, 27 Sep 2007) | 33 lines
Change 20070926-jcrowley-K by jcrowley at doctormanhattan.mshome.net on 2007-09-26 04:47:38 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk-a
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Local datasets do not work in datacomboboxes;
datacombobox getText() missing
New Features:
Bugs Fixed: LPP-3811 - Local datasets do not work in datacomboboxes
LPP-4468 - datacombobox getText() missing
Technical Reviewer: pbr
QA Reviewer: ben
Doc Reviewer:
Documentation:
Release Notes:
Details: Andre Bargull - LPP-3811. Implemented his change
to basedatacombobox. (This was still pending review;
ignore pending changeset 20070814-jcrowley-n.)
Chris Bartak - LPP-4468. Implemented his change
to add getText() to datacombobox.
Tests: For LPP-3811:
[Removed this code due to a complaint from SVN about line
ending styles being inconsistent.]
...............
r6652 | dda | 2007-09-27 15:53:32 -0700 (Thu, 27 Sep 2007) | 201 lines
Change 20070921-dda-l by dda at freddie.local on 2007-09-21 17:52:38 EDT
in /Users/dda/laszlo/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix script compiler switch stack mixup in default label
New Features:
Bugs Fixed: LPP-3023
Technical Reviewer: ptw
QA Reviewer: henry
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The problem is in the script compiler, specifically for the SW7/8 code generator.
When creating a jump table (a series of comparisons to jump to the case labels),
each jump action leaves a value at the top of the stack that must be popped as the
first action of the case label. However, default was handled differently.
The extra value was popped first and the jump to the default label is made,
so the default label did not pop as its first action.
Here's the problem. When case labels are joined with the default label like this:
case 10:
case 11:
default:
// do something...
the code generator attempts to share the code, but the stack levels are mismatched.
One solution is to force the default label to be the last and insert the extra pop
for the case labels only:
case 10:
case 11:
pop stack
// fall through
default:
I opted for a simpler solution, to guarantee that stack levels are always the same.
During the jump table, we avoid popping the stack before the default jump. We must
take care that if there is no default label, the stack is popped before the jump table
completes and we jump to the end of the switch code block.
With this approach, we now always emit a pop as the first action of a default
label, like every other case label. This allows case labels to be easily
joined whether or not they represent the default case.
I don't believe there is any performance impact: we are doing the same number of pops
at runtime (well, one extra that is needed to fix the buggy situation), and the
overall code size should be the same.
Tests:
Ran test listed in LPP-3023 and made sure it is now correct, both with debug and no debug.
Enhanced the app to test a number of other corner cases for default labels and verified
the output, again with/without debug. App included here:
<canvas>
<class name="switcher" extends="text">
<method name="testSwitch" args="val">
var result = "none";
switch (val) {
case 1:
result = "case 1";
break;
case 2:
case 3:
// if you uncomment the true below both 2 and 3 work
// true;
default:
// if you remove the default: above 2 and 3 also work
result = "default";
break;
}
this.setText(this.name + ": " + result);
</method>
<method name="testSwitchDefaultBreak" args="val">
var result = "none";
switch (val) {
case 1:
result = "case 1";
break;
case 2:
case 3:
// if you uncomment the true below both 2 and 3 work
// true;
default:
break;
}
this.setText(this.name + ": " + result);
</method>
<method name="testSwitchDefaultNoBreak" args="val">
var result = "none";
switch (val) {
case 1:
result = "case 1";
break;
case 2:
case 3:
// if you uncomment the true below both 2 and 3 work
// true;
default:
}
this.setText(this.name + ": " + result);
</method>
<method name="testSwitchNoDefault" args="val">
var result = "none";
switch (val) {
case 1:
result = "case 1";
break;
case 2:
case 3:
// if you uncomment the true below both 2 and 3 work
// true;
}
this.setText(this.name + ": " + result);
</method>
</class>
<simplelayout />
<switcher name="switch1" />
<switcher name="switch2" />
<switcher name="switch3" />
<switcher name="switch4" />
<switcher name="switch11" />
<switcher name="switch21" />
<switcher name="switch31" />
<switcher name="switch41" />
<switcher name="switch12" />
<switcher name="switch22" />
<switcher name="switch32" />
<switcher name="switch42" />
<switcher name="switch13" />
<switcher name="switch23" />
<switcher name="switch33" />
<switcher name="switch43" />
<text name="switch5">
<method name="otherSwitch" args="val">
var result = "none";
switch (val) {
case 1:
result = "case 1";
break;
case 2:
case 3:
// if you uncomment the true below both 2 and 3 work
// true;
default:
// if you remove the default: above 2 and 3 also work
result = "default";
break;
}
this.setText(this.name + ": " + result);
</method>
</text>
<text name="switch6">
<method name="nonSwitch" args="val">
var result = "none";
if (val == 1) {
result = "case 1";
} else {
result = "default";
}
this.setText(this.name + ": " + result);
</method>
</text>
<text name="switch7">
</text>
<script>
// the first case works
switch1.testSwitch(1);
// the default case works;
switch2.testSwitch(5);
// using 2 or 3 appears to work but breaks all method calls
switch3.testSwitch(2);
// none of these locally defined calls work
switch4.testSwitch(1);
switch11.testSwitchDefaultBreak(1);
switch21.testSwitchDefaultBreak(5);
switch31.testSwitchDefaultBreak(2);
switch41.testSwitchDefaultBreak(1);
switch12.testSwitchDefaultNoBreak(1);
switch22.testSwitchDefaultNoBreak(5);
switch32.testSwitchDefaultNoBreak(2);
switch42.testSwitchDefaultNoBreak(1);
switch13.testSwitchNoDefault(1);
switch23.testSwitchNoDefault(5);
switch33.testSwitchNoDefault(2);
switch43.testSwitchNoDefault(1);
switch5.otherSwitch(1);
switch6.nonSwitch(1);
switch7.setText(this.name + ": " + "test");
</script>
</canvas>
...............
r6654 | jcrowley | 2007-09-27 16:06:22 -0700 (Thu, 27 Sep 2007) | 44 lines
Change 20070927-jcrowley-v by jcrowley at doctormanhattan.mshome.net on 2007-09-27 19:04:11 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk-a
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: [repackaging to be checked into trunk; this was sent out from legals as
20070814-jcrowley-S, and was approved by Ben] datagrid: If the columns are
not updatable, it's impossible to select a row.
New Features:
Bugs Fixed: LPP-4201 - datagrid: If the columns are not updatable, it's impossible to
select a row.
Technical Reviewer: bshine
QA Reviewer: max
Doc Reviewer:
Documentation:
Release Notes:
Details: Ben and I weren't _entirely_ sure what this one meant, but I'm
pretty sure I figured it out. I made it so that one can
select the text in a given row, without the row having to be
editable. All you have to do is specify selectable="true" on
the gridtext element, as with any other text element.
Tests: Run the following example:
<canvas width="800" height="400" bgcolor="0xEAEAEA">
<dataset name="contactsData" request="true" type="http" src="http:contactsdata.xml"/>
<grid name="foo" datapath="contactsData:/*" sizetoheader="false" selectable="true">
<gridtext editable="false" width="50" datapath="position()" sortable="false">
No.
</gridtext>
<gridtext editable="false" selectable="true" datapath="@firstname">First</gridtext>
<gridtext editable="false" selectable="true" datapath="@lastname">Last</gridtext>
<gridtext editable="false" datapath="@displayname">Full Name</gridtext>
</grid>
</canvas>
Note that you can now select the text in the row.
...............
r6655 | pbr | 2007-09-27 16:14:14 -0700 (Thu, 27 Sep 2007) | 45 lines
Change 20070926-Philip-0 by Philip at Philip-DC on 2007-09-26 13:49:59 EDT
in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix reference to hasNoDelegates in LzModeManager
New Features:
Bugs Fixed: LPP-4389, LPP-2564
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
This bug is already fixed because hasNoDelegates has been removed.
However, it is still referenced in LzModeManager.lzs. I changed the reference to getDelegateCount() as recommended in LPP-4389.
Tests:
This test continues to work properly. Double clicking will produce a debug message.
<canvas height="500" debug="true" >
<view width="40" height="40" bgcolor="0xEAEAEA" clickable="true" >
<handler name="oninit" >
var del = new LzDelegate( this, "handleDblClick", this, "ondblclick" );
del.unregisterFrom( this.ondblclick );
del.register( this, "ondblclick" );
</handler>
<method name="handleDblClick" >
Debug.write( "handleDblClick" );
</method>
</view>
</canvas>
Files:
M WEB-INF/lps/lfc/services/LzModeManager.lzs
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070926-Philip-0.tar
...............
r6664 | hqm | 2007-09-28 07:37:40 -0700 (Fri, 28 Sep 2007) | 24 lines
Change 20070928-hqm-2 by hqm at IBM-2E06404CB67 on 2007-09-28 10:36:46 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk/demos/weather
for http://svn.openlaszlo.org/openlaszlo/trunk/demos/weather
Summary: uncomment weather canvas size
New Features:
Bugs Fixed:LPP-4782
Technical Reviewer: josh
QA Reviewer: amy
Doc Reviewer:
Documentation:
Release Notes:
Details:
Tests:
...............
r6670 | lou | 2007-09-28 11:14:47 -0700 (Fri, 28 Sep 2007) | 24 lines
Change 20070928-lou-m1pLMm by lou at lou-laptop on 2007-09-28 14:10:42 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: change type for stretches from Boolean to String
New Features:
Bugs Fixed:LPP-4193
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer:
Documentation:
Release Notes:
Details: also enclosed in quotes width, height, and both
Tests:
...............
r6676 | jcrowley | 2007-09-28 13:26:36 -0700 (Fri, 28 Sep 2007) | 36 lines
Change 20070928-jcrowley-u by jcrowley at doctormanhattan.mshome.net on 2007-09-28 16:24:50 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk-a
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: [repackaging for trunk - this was approved by Phil]
DHTML calendar demo wigs out on opening Event Info
New Features:
Bugs Fixed: LPP-4175 - DHTML calendar demo wigs out on opening
Event Info
Technical Reviewer: pbr
QA Reviewer: max
Doc Reviewer:
Documentation:
Release Notes:
Details: I found a larger bug with this one, which was auto-
assigned to Tucker. It's LPP-4499. The issue here is
really that calling LzFocus.setFocus() on something
off-canvas in DHTML will slide the canvas over so that
the focused item is visible. I worked around it in
this case by moving it into an onstop event for one
of the animators called by the same method, to ensure
it didn't get called until after the object was fully
on-screen.
Tests: Run modified Calendar versus unmodified in DHTML; note
the modified version doesn't slide over all crazy-like
when the info panel is opened by clicking the 'i' on
a selected event tag.
...............
r6683 | max | 2007-09-28 15:02:38 -0700 (Fri, 28 Sep 2007) | 33 lines
Change 20070928-maxcarlson-r by maxcarlson at plastik on 2007-09-28 13:30:10 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: One more time: Hand marge r6661 from wafflecone to trunk
New Features:
Bugs Fixed:
Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzHistory.as - Use correct syntax for LzBrowser.callJS(). Clear out old __lzloading code. Initialize persistence and add explicit callback to Lz.history in receiveHistory().
LzHistory.js - Clear out old __lzloading code.
LaszloCanvas.lzs - Rely on browser history event callbacks to initialize history state instead of explicit call at canvas init time.
embednew.js - Clean up extra window.onload event, comments. Set Lz.loaded to true when load is finished. Use anonymous function in _callMethodSWF() to prevent overwrites.
lzhistory.js - Store and reset the document title in IE to keep the window title from changing. Make init code more specific to each browser. Use Lz.callMethod() to set the history state instead of calling dojo.flash.comm. Don't set top.location.hash to '#0' in IE - use '#' instead. Add __receivedhistory() callback to receive history from Flash.
flash.js - Ensure callback methods are executed in the proper scope for flash < 8.
Tests: http://localhost:8080/trunk/test/history/history.lzx in dhtml, swf7 and 8 in Firefox mac, IE 6/7 and Safari 2.
...............
r6684 | max | 2007-09-28 15:25:28 -0700 (Fri, 28 Sep 2007) | 44 lines
Recorded merge of revisions 6661 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
........
r6661 | max | 2007-09-27 22:30:20 -0700 (Thu, 27 Sep 2007) | 38 lines
Change 20070927-maxcarlson-6 by maxcarlson at plastik on 2007-09-27 18:44:35 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: UPDATED: Fix history in swf7/8 and dhtml
New Features:
Bugs Fixed: LPP-4746 - Javascript errors when using the history mechanism in swf7, LPP-4731 - reloading browser page causes history to trigger "back" action
Technical Reviewer: promanik
QA Reviewer: lhenrywilkins at laszlosystems.com
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzSprite.js - Do callback to _ready when canvas initializes.
LzHistory.as - Use correct syntax for LzBrowser.callJS(). Clear out old __lzloading code.
LzBrowser.as - Reset __jscallback to null when there is no callback.
LzHistory.js - Clear out old __lzloading code.
LaszloCanvas.lzs - Rely on browser history event callbacks to initialize history state instead of explicit call at canvas init time.
embednew.js - Hand merge changes related to onloaded from trunk.
lzhistory.js - Store and reset the document title in IE to keep the window title from changing.
flash.js - Ensure callback methods are executed in the proper scope for flash < 8.
Tests: http://localhost:8080/trunk/test/history/history.lzx in dhtml, swf7 and 8 in Firefox mac, IE 6/7 and Safari 2. Also tested webtop and verified that both bugs are fixed in future/lzmail/main.lzx - I used r11 of uicontroller.lzx to bring back the history functionality.
........
...............
r6687 | hqm | 2007-09-28 17:17:41 -0700 (Fri, 28 Sep 2007) | 34 lines
Change 20070928-hqm-4 by hqm at IBM-2E06404CB67 on 2007-09-28 20:15:33 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: disable compiler warning for duplicate resource name
New Features:
Bugs Fixed: LPP-4615
Technical Reviewer: ptw
QA Reviewer: pkang
Doc Reviewer:
Documentation:
Release Notes:
Details:
remove the warning for duplicated resource, for now.
There are a couple of proposals for adding a flag to resource
declaration which permits overrides explicitly.
This patch is just a temporary solution for now.
Tests:
test/compiler_errors/duplicate-resource.lzx
...............
r6707 | hqm | 2007-10-01 14:14:24 -0700 (Mon, 01 Oct 2007) | 34 lines
Change 20071001-hqm-0 by hqm at IBM-2E06404CB67 on 2007-10-01 13:24:07 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: allow dhtml as default runtime
New Features:
Bugs Fixed: LPP-3705
Technical Reviewer: pbr
QA Reviewer: ptw
Doc Reviewer: jrs
Documentation:
Release Notes:
Details:
Assign default runtime from one place (LPS.java), and assume runtime default if no 'lzr'
query arg is supplied in RESPONDERObject.java for lzt=object requests
Tests:
restart tomcat, and see if apps come up as DHTML by default with no lzr arg, and with lzt=html queries
...............
r6715 | max | 2007-10-02 16:03:03 -0700 (Tue, 02 Oct 2007) | 43 lines
ehange 20071002-maxcarlson-a by maxcarlson at plastik on 2007-10-02 11:15:45 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix html tag
New Features:
Bugs Fixed: LPP-4784 - OL4.0.5, <html> tag and SWF : http://www.openlaszlo.org/lps4/lps/components/extensions/test/html-swf.jsp NOT WOKING
Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: DojoExternalInterface.as - Better debugging info, make sure resultsChecker function is named, clear out _root._callbackID when done looking for results.
Library.lzs - Add default values for _root._currenthistory and _root._callbackID to prevent exceptions in IE.
LzHistory.as - Use _root._currenthistory to communicate current history state in swf7 to prevent concurrency issues calling into/out of flash simultaneously.
LaszloCanvas.lzs - Set canvas id passed in to init arguments.
test/html.lzx - Use w3.org as default URL to prevent runtime exceptions - openlaszlo.org fails to run some javascript when laoded in an iframe.
html-swf.js - Update to new wrapper format.
html.lzx - Pass in canvas id for callbacks. Add support for sendToBack(). Always update position when iframeid is set.
embednew.js - Pass id into flashargs to set canvas.id.
lzhistory.js - Watch _currenthistory for history state changes for swf7 in _checklocationhash(). __setFlash() only sets history state if _callbackID is null. Otherwise it waits 10ms.
iframemanager.js - Reorder init(). Add support for sendToBack().
dev-console.lzx.swf - Rebuild with default values for _root._currenthistory and _root. _callbackID to prevent exceptions in IE.
Tests: http://localhost:8080/trunk-clean/lps/components/extensions/test/html-swf.jsp and http://localhost:8080/trunk-clean/lps/components/extensions/test/html.zlx run in swf7, swf8 and dhtml. http://localhost:8080/trunk-clean/test/history/history.lzx passes in swf7, swf8 and dhtml. Tested under IE 6, 7 and Firefox 2 OS X.
...............
r6726 | hqm | 2007-10-04 15:49:36 -0700 (Thu, 04 Oct 2007) | 41 lines
Change 20071004-hqm-2 by hqm at IBM-2E06404CB67 on 2007-10-04 18:43:58 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: replace jing validator with something better
New Features:
Bugs Fixed: LPP-4644
and other bugs too numerous to mention
Technical Reviewer: ptw
QA Reviewer: pbr
Doc Reviewer:
Documentation:
Release Notes:
Details:
removed JING RNG parser and validator, and all code in ViewSchema which uses it.
All validation is done from the lps/schema/lfc.lzx file now,
all validity checks done in updateschema or during compilation by
NodeModel and friends.
The "validate" flag is deprecated (we should warn for that I guess),
and can be removed at some point.
Tests:
compiled demos, examples/components, smokecheck, webtop lzmail app
ant runlzunit
tested test cases in test/compiler_errors
...............
r6727 | hqm | 2007-10-04 15:59:29 -0700 (Thu, 04 Oct 2007) | 1 line
forgot this with 6726
...............
r6729 | max | 2007-10-04 16:51:40 -0700 (Thu, 04 Oct 2007) | 34 lines
Change 20071004-maxcarlson-x by maxcarlson at plastik on 2007-10-04 12:49:38 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix Mode manager and LzText/Inputtext modality
New Features:
Bugs Fixed: LPP-3948 - LzModeManager and selectable LzText (real problem comes with edittext)
Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzTextSprite.js - Expose and set selectable attribute.
LzInputTextSprite.js - Don't become editable when selectable != true.
LzModeManager.lzs - Ensure mView.passModeEvent() exists before calling it.
LzInputText.lzs - Register for LzModeManager.onmode event. Ensure inputtext doesn't become selectable if it isn't inside the view that has modality applied.
LzText.lzs - Set selectable attribute in setSelectable().
edittext.lzx - Add support setSelection(), applyData(), updateData() and getValue().
Tests: See LPP-3948. Testcase passes in flash and DHTML.
...............
r6731 | hqm | 2007-10-04 17:11:31 -0700 (Thu, 04 Oct 2007) | 27 lines
Change 20071004-hqm-8 by hqm at IBM-2E06404CB67 on 2007-10-04 19:22:03 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: fix a couple of warnings that now show up in dmoes
New Features:
Bugs Fixed:
Technical Reviewer: pbr
QA Reviewer: jsundman
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
These views should not have been named "frame", as it aliases an attribute of view.
Changed name of view to "myframe"
Tests:
...............
r6736 | pbr | 2007-10-05 12:51:02 -0700 (Fri, 05 Oct 2007) | 48 lines
Also see LPP-1636
Change 20071005-Philip-6 by Philip at Philip-DC on 2007-10-05 13:42:37 EDT
in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Pass arguments intact to Windows scripts
New Features:
Bugs Fixed: LPP-4843
Technical Reviewer: ptw
QA Reviewer: hqm
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Arguments were not being transferred intact to java. The old scripts
used %1,%2,... to refer to arguments. However, Windows thinks that
--runtime=swf7 is two argument, "--runtime" and "swf7". The only fix
I found is to pass the arguments intact using %*.
Tests:
lzc,lzdc,lzmc pass arguments the same way. Tested on lzc. From the
windows command prompt:
- lzc --runtime=swf8 testfile.lzx
This command should product a file pbr113.lzr=swf8.swf
- lzc "--runtime=swf8" testfile.lzx
This should work the same as the first case. This makes sure that
people that are already escaping the argument can continue to do so.
Files:
M WEB-INF/lps/server/bin/lzc.bat
M WEB-INF/lps/server/bin/lzdc.bat
M WEB-INF/lps/server/bin/lzmc.bat
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20071005-Philip-6.tar
...............
r6740 | lou | 2007-10-06 07:38:01 -0700 (Sat, 06 Oct 2007) | 24 lines
Change 20071003-lou-c4MZCf by lou at lou-laptop on 2007-10-03 11:19:29 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Differential debugging SWF and DHTML
New Features:
Bugs Fixed: LPP-4824
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details: Added section 4.1 Differential debugging SWF and DHTML to the data tutorial.
Tests:
...............
r6741 | lou | 2007-10-06 07:39:16 -0700 (Sat, 06 Oct 2007) | 20 lines
Change 20071003-lou-pXqghd by lou at lou-laptop on 2007-10-03 10:03:33 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Added Debug.bugReport() description
New Features:
Bugs Fixed: LPP-4798
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Details: Add section 1.6 Generating a bug report to the Debugging chapter.
Tests:
...............
r6742 | lou | 2007-10-06 07:45:37 -0700 (Sat, 06 Oct 2007) | 24 lines
Change 20070928-lou-msVzZQ by lou at lou-laptop on 2007-09-28 13:31:10 AST
in /home/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary:
New Features: replace references to Deployer's Guide to Administrator's Guide
Bugs Fixed: LPP-4819 dguide: references to Deployer's Guide shoud be Administrator's guide
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6743 | lou | 2007-10-06 07:52:15 -0700 (Sat, 06 Oct 2007) | 24 lines
Change 20070928-lou-lvSbjV by lou at lou-laptop on 2007-09-28 14:05:16 AST
in /home/lou/src/svn/openlaszlo/trunk/docs/src
for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src
Summary: Function.apply and Function.call now listed as supported
New Features: change table so that Function.apply and Function.call are now supported
Bugs Fixed: LPP-4338
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6747 | lou | 2007-10-07 12:15:53 -0700 (Sun, 07 Oct 2007) | 25 lines
Change 20071007-lou-A by lou at loumac.local on 2007-10-07 14:56:08 AST
in /Users/lou/src/svn/openlaszlo/trunk/docs
for http://svn.openlaszlo.org/openlaszlo/trunk/docs
Summary: fix typos in language preliminaries chapter of dguide
New Features:
Bugs Fixed: LPP-4847
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: OpenLaszlo entirely case-sensitive. -> OpenLaszlo is entirely case-sensitive.
Fix 2 broken xrefs (these show up as ??? in the html file)
Tests:
...............
r6749 | lou | 2007-10-07 15:53:03 -0700 (Sun, 07 Oct 2007) | 24 lines
Change 20071007-lou-8 by lou at loumac.local on 2007-10-07 17:54:39 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add Firebug array note to the debugging chapter of the dguide
New Features: Also changed references to FireFox and FireBug to Firefox and Firebug
Bugs Fixed: LPP-4846: explain arrays in Firebug debugger
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6760 | jcrowley | 2007-10-08 13:45:40 -0700 (Mon, 08 Oct 2007) | 30 lines
Change 20071008-jcrowley-W by jcrowley at doctormanhattan.mshome.net on 2007-10-08 13:56:28 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk-b
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Components hierarchy browser should link to the right page in
the reference
New Features:
Bugs Fixed: LPP-4555 - Components hierarchy browser should link to the
right page in the reference
Technical Reviewer: pbr
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Fixed the links, many were outdated and the request
mechanism was kind of broken.
Tests: Run the components hierarchy; note that clicking all the
links in the modified version takes you to the appropriate
pages, whereas the links in an unmodified version will
result in 404 errors or simply taking you to the refguide
index.
...............
r6761 | lou | 2007-10-08 14:47:08 -0700 (Mon, 08 Oct 2007) | 24 lines
Change 20071008-lou-j by lou at loumac.local on 2007-10-08 11:45:31 AST
in /Users/lou/src/svn/openlaszlo/trunk/docs/src
for http://svn.openlaszlo.org/openlaszlo/trunk/docs/src
Summary: Add section 4. Component auto-include to Designing Custom Components chapter of the dguide
New Features:
Bugs Fixed: LPP-1083: setting up component auto-include
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: John Sundman
Documentation:
Release Notes:
Details:
Tests:
...............
r6769 | jcrowley | 2007-10-09 09:37:23 -0700 (Tue, 09 Oct 2007) | 153 lines
Change 20071009-jcrowley-z by jcrowley at doctormanhattan.mshome.net on 2007-10-09 12:34:27 EDT
in /Users/jcrowley/src/svn/openlaszlo/trunk-f
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: (Already approved by Phil; am integrating into a different
local branch before checking in.) long comobox does not
render properly on firefox 2.0
New Features:
Bugs Fixed: LPP-4192 - long comobox does not render properly on
firefox 2.0
Technical Reviewer: pbr
QA Reviewer: henry
Doc Reviewer:
Documentation:
Release Notes:
Details: This one wasn't really that much of a bug, since
you can set limits on the list size and give it
a scrollbar if you have to clip it, but I thought
there should still be some kind of check to make
sure it's not longer than the canvas. I added
attribute 'sizetocanvas', default true, to set
the number of visible elements in an expanded
list to fit the list on the canvas. In the likely
rare event one wants to let the list spill off the
canvas, they can always set sizetocanvas to false.
Tests: Run:
<canvas>
<combobox id="serviceCombo"
width="130"
defaulttext="choose one..." editable="false" enabled="true">
<textlistitem datapath="services:/services/service" text="$path{'@name'}"
value="$path{'@value'}"/>
</combobox>
<dataset name="services">
<services>
<service name="adamsboswe" value="adamsboswe"/>
<service name="323iactive" value="323iactive"/>
<service name="aecom" value="aecom"/>
<service name="1stomni" value="1stomni"/>
<service name="acisol" value="acisol"/>
<service name="ares" value="ares"/>
<service name="180solutio" value="180solutio"/>
<service name="ameris" value="ameris"/>
<service name="11below" value="11below"/>
<service name="advcommerc" value="advcommerc"/>
<service name="alloy" value="alloy"/>
<service name="abnerherrm" value="abnerherrm"/>
<service name="active" value="active"/>
<service name="activewind" value="activewind"/>
<service name="aei" value="aei"/>
<service name="adelante" value="adelante"/>
<service name="3spn" value="3spn"/>
<service name="ampere" value="ampere"/>
<service name="abundant" value="abundant"/>
<service name="advantage" value="advantage"/>
<service name="aethionsi" value="aethionsi"/>
<service name="altrec" value="altrec"/>
<service name="arin" value="arin"/>
<service name="aplia" value="aplia"/>
<service name="ailiant" value="ailiant"/>
<service name="about" value="about"/>
<service name="amerisec" value="amerisec"/>
<service name="alorica" value="alorica"/>
<service name="americasho" value="americasho"/>
<service name="americanap" value="americanap"/>
<service name="anomaly" value="anomaly"/>
<service name="anyware" value="anyware"/>
<service name="aloricaden" value="aloricaden"/>
<service name="appdiscove" value="appdiscove"/>
<service name="alpaul" value="alpaul"/>
<service name="advpersonn" value="advpersonn"/>
<service name="accesscomm" value="accesscomm"/>
<service name="absclothin" value="absclothin"/>
<service name="ainet" value="ainet"/>
<service name="aismedia" value="aismedia"/>
<service name="americom" value="americom"/>
<service name="accessline" value="accessline"/>
<service name="altntech" value="altntech"/>
<service name="apex" value="apex"/>
<service name="adinfuse" value="adinfuse"/>
<service name="actsgroup" value="actsgroup"/>
<service name="alliance" value="alliance"/>
<service name="alphazeta" value="alphazeta"/>
<service name="akamai" value="akamai"/>
<service name="aitcc" value="aitcc"/>
<service name="accellion" value="accellion"/>
<service name="accor" value="accor"/>
<service name="agile" value="agile"/>
<service name="alta" value="alta"/>
<service name="apptrix" value="apptrix"/>
<service name="arcap" value="arcap"/>
<service name="addante" value="addante"/>
<service name="3amlabs" value="3amlabs"/>
<service name="altadisusa" value="altadisusa"/>
<service name="amgen" value="amgen"/>
<service name="SJC-Lab" value="SJC-Lab"/>
<service name="accel" value="accel"/>
<service name="americanto" value="americanto"/>
<service name="apple" value="apple"/>
<service name="aci" value="aci"/>
<service name="accipiter" value="accipiter"/>
<service name="adpinvest" value="adpinvest"/>
<service name="acsonline" value="acsonline"/>
<service name="1ix" value="1ix"/>
<service name="aas" value="aas"/>
<service name="altoh" value="altoh"/>
<service name="adaptivepa" value="adaptivepa"/>
<service name="abs" value="abs"/>
<service name="aim2game" value="aim2game"/>
<service name="areatech" value="areatech"/>
<service name="appiq" value="appiq"/>
<service name="advancedac" value="advancedac"/>
<service name="1stfinanci" value="1stfinanci"/>
<service name="aig" value="aig"/>
<service name="800one" value="800one"/>
<service name="aptela" value="aptela"/>
<service name="activegrou" value="activegrou"/>
<service name="apress" value="apress"/>
<service name="3eco" value="3eco"/>
<service name="allrecipes" value="allrecipes"/>
<service name="amselect" value="amselect"/>
<service name="alpine" value="alpine"/>
<service name="argis" value="argis"/>
<service name="3dblinds" value="3dblinds"/>
<service name="ardennes" value="ardennes"/>
<service name="003realty" value="003realty"/>
<service name="amgenuk" value="amgenuk"/>
<service name="adaptec" value="adaptec"/>
<service name="aonwarrant" value="aonwarrant"/>
<service name="adpark" value="adpark"/>
<service name="apartment" value="apartment"/>
<service name="arenaone" value="arenaone"/>
<service name="adchemy" value="adchemy"/>
<service name="2wire" value="2wire"/>
<service name="advancecab" value="advancecab"/>
</services>
</dataset>
</canvas>
In both modified and unmodified branches. Note that in unmodified,
it spills off into forever. In modified, it stops just before, and
there's a scrollbar. (If one explicitly sets the number of visible
elements, it'll override this.)
...............
r6779 | ptw | 2007-10-10 05:29:01 -0700 (Wed, 10 Oct 2007) | 27 lines
Change 20071009-ptw-M by ptw at dueling-banjos.local on 2007-10-09 18:28:50 EDT
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Re-enable Monitor messages
Bugs Fixed:
LPP-4855 'Debug.monitor does not appear to be working'
Technical Reviewer: max (pending)
QA Reviewer: sosullivan (pending)
Details:
LzDebug: Add MONITOR and TRACE as valid message levels
kernel.*: If message type does not have a valid level, always
print it.
LzMonitor, LzTrace: Give constructors a name.
Tests:
lzx> Debug.monitor(canvas, 'version')
lzx> canvas.version=888
MONITOR @simple.lzx#1: [845525.00] Debug.doEval: #canvas.version: '4.1.x.0' -> 888
888
...............
r6782 | hqm | 2007-10-10 05:59:30 -0700 (Wed, 10 Oct 2007) | 26 lines
Change 20071010-hqm-4 by hqm at IBM-2E06404CB67 on 2007-10-10 08:57:32 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: remove debugging info that got included by mistake in r6726
New Features:
Bugs Fixed:
Technical Reviewer: hqm
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Debug.info statements are adding noise to the output, should be
conditionalized to some high level
Tests:
...............
r6783 | max | 2007-10-10 08:50:36 -0700 (Wed, 10 Oct 2007) | 24 lines
Change 20071009-maxcarlson-B by maxcarlson at plastik on 2007-10-09 15:20:56 PDT
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add stub methods for view.getNextSelection() and getPrevSelection() for documentation
New Features:
Bugs Fixed: LPP-2041 - getNextSelection() and getPrevSelection() not documented in LzView reference page
Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Add stub methods and documentation for getNextSelection() and getPrevSelection().
Tests: Tabbing and selection in http://localhost:8080/trunk/examples/components/style_example.lzx?lzr=dhtml and http://localhost:8080/trunk/examples/components/style_example.lzx work as before.
...............
r6785 | ptw | 2007-10-10 09:43:37 -0700 (Wed, 10 Oct 2007) | 20 lines
Change 20071001-ptw-m by ptw at dueling-banjos.local on 2007-10-01 19:55:05 EDT
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Remove old .make trampolines
Bugs Fixed:
LPP-4181 'Remove vestigial .make methods from built-ins'
Technical Reviewer: hminsky (Message-ID: <8c61fad60710100555y17b972e9j1d2fb8f0e74a2eee at mail.gmail.com>)
QA Reviewer: promanik (Message-Id: <20071010131315.AEC3497209 at hemicuda.laszlosystems.com>)
Details:
We decided we don't need to rewrite all new calls to .make calls,
so these old trampolines can be removed.
Tests:
smokecheck in SWF and DHTML, calendar, amazon
...............
r6789 | hqm | 2007-10-10 11:20:57 -0700 (Wed, 10 Oct 2007) | 27 lines
Change 20071010-hqm-0 by hqm at IBM-2E06404CB67 on 2007-10-10 14:18:54 EDT
in /cygdrive/c/users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: comment out diagnostic info in lzpix app
New Features:
Bugs Fixed: LPP-4779
Technical Reviewer: jcrowley
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The inittimer and lps version widgets are commented out. if someone needs them
they should conditionally put instantiate them for internal releases, per tucker's suggestion
Tests:
...............
Property changes on: openlaszlo/branches/paperpie
___________________________________________________________________
Name: svnmerge-integrated
- /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497 /openlaszlo/trunk:1-6504
+ /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497 /openlaszlo/trunk:1-6796
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/Class.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/Class.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/Class.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -136,8 +136,9 @@
/**
* Instance initialize method
*
- * Called by Instance.make as the last operation on a new instance of a class.
- * Arguments are the arguments that were passed to make.
+ * Called by Instance constructor as the last operation on a new
+ * instance of a class. Arguments are the arguments that were passed
+ * to make.
*
* Can be overridden in subclasses, but must call superclass initialze
* if so.
@@ -175,43 +176,7 @@
}
-/**
- * Default Instance factory
- *
- * Make a new instance of a class.
- *
- * @access private
- *
- * @devnote This is just for coherence with the Class interface.
- * Normally new instances will be created by `new _class_`.
- */
-Instance.make = function make () {
- // Should not be called in the new world...
- if ($debug) {
- Debug.info("`%w.%s` is deprecated. Use `new %w` instead.", this, arguments.callee, this);
- }
- {
- #pragma "passThrough=true"
- if (arguments.length > 0) {
- // We have to work hard to break a conventional constructor into a
- // constructor and initializer when there are args, because
- // Javascript does not support apply of new.
- var constructor = this;
- function xtor () { this.constructor = constructor; };
- xtor.prototype = constructor.prototype;
- var o = new xtor();
- constructor.apply(o, arguments);
- return o;
- }
- return new this();
- }
-};
-
if ($debug) {
- Instance.make._dbg_typename = 'Instance static function';
-};
-
-if ($debug) {
Instance.prototype.addProperty('validateClassStructure', function validateClassStructure () {
// Verifies that superclass links for nextMethod are correct
var prototype = this.constructor.prototype;
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/LzRuntime.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/compiler/LzRuntime.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -10,98 +10,6 @@
*/
/**
- * Trampoline for 'conventional' constructors
- * @access private
- */
-Function.prototype.make = function () {
- #pragma "passThrough=true"
- if (arguments.length > 0) {
- // We have to work too hard to break a conventional constructor
- // into a constructor and initializer when there are args, because
- // Javascript does not support apply of new.
- function xtor () {};
- xtor.prototype = this.prototype;
- var o = new xtor;
- this.apply(o, arguments);
- return o;
- } else {
- return new this;
- }
-}
-
-// Object, Array, and Function constructors can be called as functions
-
-/**
- * @access private
- */
-Object.make = Object;
-
-/**
- * @access private
- */
-Array.make = Array;
-
-/**
- * @access private
- */
-Function.make = Function;
-
-// The String, Boolean, Number, and Date constructors when called as
-// functions, convert rather than constructing, so we have to handle
-// them specifically. We wouldn't have to if you could say `new
-// this.apply(this, arguments)` but Javascript doesn't permit that...
-
-/**
- * @access private
- */
-String.make = function (value) {
- switch (arguments.length) {
- case 0:
- value = "";
- }
- #pragma "passThrough=true"
- return new String(value);
-}
-/**
- * @access private
- */
-Boolean.make = function (value) {
- #pragma "passThrough=true"
- return new Boolean(value);
-}
-/**
- * @access private
- */
-Number.make = function (value) {
- switch (arguments.length) {
- case 0:
- value = +0;
- }
- #pragma "passThrough=true"
- return new Number(value);
-}
-/**
- * @access private
- */
-Date.make = function (year, month, date, hours, minutes, seconds, ms) {
- switch (arguments.length) {
- case 2:
- date = 1;
- case 3:
- hours = 0;
- case 4:
- minutes = 0;
- case 5:
- seconds = 0;
- case 6:
- ms = 0;
- }
- #pragma "passThrough=true"
- return new Date(year, month, date, hours, minutes, seconds, ms);
-}
-
-
-/**
* DHTML/SWF compatibility
*
* @todo 2006-04-07 ptw Remove when _root is eradicated from .lzs
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/core/LzNode.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -274,6 +274,8 @@
* changes.
*/
DeclareEvent(prototype, 'ondata' );
+/** If replicated, the index of this clone */
+var clonenumber = null;
DeclareEvent(prototype, 'onclonenumber' );
DeclareEvent(prototype, 'ondestroy' );
@@ -1042,7 +1044,7 @@
// TODO: [2005-03-24 ptw] Remove this if we ever enable
// warnings in the LFC as this will be redundant
if ($debug) {
- if ((! x) || (! (x.make instanceof Function))) { Debug.error('Class for tag %s has not been defined yet', e.name); }
+ if ((! x) || (! (x instanceof Function))) { Debug.error('Class for tag %s has not been defined yet', e.name); }
}
// TODO: [2005-04-20 ptw] Don't know what this means, preserved
// for posterity:
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzDataset.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzDataset.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -580,12 +580,12 @@
var proxied_p = canvas.proxied;
// check if this datasource has a "proxied" attribute which overrides canvas switch
if (this.proxied != null && this.proxied != "inherit") {
- proxied_p = (this.proxied == "true"); // coerce to boolean
+ proxied_p = (this.proxied == true); // coerce to boolean
}
// Check if the dataset has a "proxied" attribute which overrides dataset's value
if (this.proxied != null && this.proxied != "inherit") {
- proxied_p = (this.proxied == "true");
+ proxied_p = (this.proxied == true);
}
return proxied_p;
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -255,7 +255,6 @@
dreq.xmldata = content;
dreq.responseheaders = headers;
dreq.rawdata = dreq.loader.getResponse();
-
dreq.onstatus.sendEvent( dreq );
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzDebug.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzDebug.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzDebug.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -49,7 +49,7 @@
/**
* Possible values of Debug.messageLevel (q.v.)
*/
-Debug.messageLevels = {ALL: 0, DEBUG: 1, INFO: 2, WARNING: 3, ERROR: 4, NONE: 5};
+Debug.messageLevels = {ALL: 0, MONITOR: 1, TRACE: 2, DEBUG: 3, INFO: 4, WARNING: 5, ERROR: 6, NONE: 7};
/**
* Debug messages are enabled/disabled by the
@@ -454,10 +454,52 @@
});
for (var i = 0; i < keys.length; i++) {
var obj = inspected[keys[i]];
- Debug.format("\n%s\n", Debug.inspectInternal(obj));
+ Debug.format("\n");
+ // Thus copy/paste will not get the 'hotlink' markup
+ Debug.inspect(obj);
+ Debug.format("\n");
}
}
Debug.format("\n---END OF BUG REPORT---\n");
-}
+};
+/**
+ * Fills two arrays with the object's own properties. If the object has a
+ * 'length' property (i.e., might be intended as an Array), numeric
+ * names that fall between 0 and the value of length are added to the
+ * `indices` array, otherwise they are added to the `names` array. If
+ * either array is null, those properties will be omitted altogether.
+ * @param obj:Object the object to examine
+ * @param names:Array the array to append names to
+ * @param indices:Array the array to append indices to
+ * @param limit:Number don't accumulate more than this many properties
+ * (used to limit computation on large objects), default Infinity
+ */
+Debug.objectOwnProperties = function (obj, names, indices, limit) {
+ if (!limit) { limit = Infinity; };
+ var alen = (('length' in obj) && (! isNaN(obj.length)) && (obj.length >= 0)) ? obj.length : false;
+ var hopp = 'hasOwnProperty' in obj;
+ var proto = (('__proto__' in obj) ? obj.__proto__ :
+ (('constructor' in obj) ? obj.constructor.prototype : false));
+ for (var key in obj) {
+ if ((! hopp) ||
+ obj.hasOwnProperty(key) ||
+ // Heuristic to find getter slots (there is no way to ask if a
+ // property is a getter)
+ (proto && (obj[key] !== proto[key]))) {
+ if ((alen != false) && (! isNaN(key)) && (0 <= key) && (key < alen)) {
+ if (indices) {
+ // Ensure indices are numbers, not strings
+ indices.push(Number(key));
+ if (--limit == 0) { return; }
+ }
+ } else {
+ if (names) {
+ names.push(key);
+ if (--limit == 0) { return; }
+ }
+ }
+ }
+ }
+};
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzMonitor.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzMonitor.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzMonitor.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -16,7 +16,7 @@
*
* @access private
*/
-var LzMonitor = function(file, line, message) {
+function LzMonitor (file, line, message) {
// super.apply(arguments);
LzSourceMessage.apply(this, arguments);
};
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzTrace.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzTrace.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/LzTrace.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -16,7 +16,7 @@
* A Trace is a warning with the tag 'TRACE'
* @access private
*/
-var LzTrace = function(file, line, message) {
+function LzTrace (file, line, message) {
// super.apply(arguments);
LzSourceMessage.apply(this, arguments);
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/dhtml/kernel.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -231,7 +231,9 @@
var msg = xtor.format.apply(xtor, [null, null].concat(Array.prototype.slice.call(arguments, 1)));
{
var mls = this.messageLevels;
- if (mls[xtor.prototype.type] >= mls[this.messageLevel]) {
+ var t = xtor.prototype.type;
+ // Default to printing any 'unknown' types
+ if ((t in mls) ? (mls[t] >= mls[this.messageLevel]) : true) {
this.freshLine();
this.__write(msg);
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/debugger/platform/swf/kernel.as 2007-10-10 23:17:04 UTC (rev 6797)
@@ -118,7 +118,9 @@
var msg = xtor.format.apply(xtor, [null, null].concat(Array.prototype.slice.call(arguments, 1)));
{
var mls = this.messageLevels;
- if (mls[xtor.prototype.type] >= mls[this.messageLevel]) {
+ var t = xtor.prototype.type;
+ // Default to printing any 'unknown' types
+ if ((t in mls) ? (mls[t] >= mls[this.messageLevel]) : true) {
this.freshLine();
this.__write(msg);
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -76,6 +76,7 @@
this.__LZinputclickdiv.className = 'lzclickdiv';
this.__LZinputclickdiv.owner = this;
this.__LZinputclickdiv.onmouseover = function () {
+ if (this.owner.selectable != true) return;
LzInputTextSprite.prototype.__setglobalclickable(false);
this.owner.__show();
}
@@ -253,7 +254,7 @@
//Debug.info('__textEvent', eventname, keycode);
if (this.owner) {
- this.owner.inputtextevent(eventname, keycode);
+ // Generate the event. onkeyup/onkeydown sent by LzKeys.js
if (eventname == 'onkeydown' || eventname == 'onkeyup') {
var v = this.__LzInputDiv.value;
if (v != this.text) {
@@ -261,6 +262,9 @@
this.owner.inputtextevent('onchange', v);
}
}
+ else {
+ this.owner.inputtextevent(eventname, keycode);
+ }
}
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -53,6 +53,7 @@
LzTextSprite.prototype.__wpadding = 4;
LzTextSprite.prototype.__hpadding = 4;
LzTextSprite.prototype.__sizecacheupperbound = 1000;
+LzTextSprite.prototype.selectable = true;
LzTextSprite.prototype.setFontSize = function (fsize) {
if (fsize == null || fsize < 0) return;
@@ -340,6 +341,7 @@
}
LzTextSprite.prototype.setSelectable = function (s) {
+ this.selectable = s;
//Debug.write('setSelectable', s, this.__LZdiv.style);
if (s) {
this.__LZdiv.onselectstart = null;
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -1,5 +1,5 @@
//* A_LZ_COPYRIGHT_BEGIN ******************************************************
-//* Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. *
+//* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
//* Use is subject to license terms. *
//* A_LZ_COPYRIGHT_END ********************************************************
@@ -9,3 +9,7 @@
} else {
#include "kernel/swf/dojo/flash6/DojoExternalInterface.as"
}
+
+// required for GetVariable to not fail in IE/ActiveX
+_root._currenthistory = null;
+_root._callbackID = null;
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as 2007-10-10 23:17:04 UTC (rev 6797)
@@ -93,7 +93,7 @@
_root._returnResult = undefined;
fscommand("call", methodName);
- //getURL("javascript:alert('FLASH:call " + methodName + "')");
+ //Debug.write("call", methodName, resultsCallback);
// immediately return if the caller is not waiting for return results
if(resultsCallback == undefined || resultsCallback == null){
@@ -101,10 +101,12 @@
}
// check at regular intervals for return results
- var resultsChecker = function(){
+ var resultsChecker = function resultsChecker(){
if((typeof _root._returnResult != "undefined")&&
(_root._returnResult != "undefined")){
clearInterval(_root._callbackID);
+ _root._callbackID = null;
+ //Debug.write('resultsChecker clear', _root._callbackID);
resultsCallback.call(null, _root._returnResult);
}
};
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/LzModeManager.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/LzModeManager.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/LzModeManager.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -146,7 +146,7 @@
if (view && view.childOf( mView ) ){
break;
} else if (mView) {
- dosend = mView.passModeEvent( eventStr , view );
+ dosend = mView.passModeEvent ? mView.passModeEvent( eventStr , view ) : null;
}
}
@@ -155,7 +155,7 @@
if ( eventStr == "onclick" ){
if ( this.__LZlastclick == view &&
('ondblclick' in view && view.ondblclick) &&
- !view.ondblclick.hasNoDelegates &&
+ (view.ondblclick.getDelegateCount() > 0) &&
(getTimer() - this.__LZlastClickTime)< view.DOUBLE_CLICK_TIME ){
//this is a double-click
eventStr = "ondblclick";
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -37,7 +37,6 @@
LzHistory.setHistory = function(s) {
//Debug.write('setHistory', s);
Lz.history.set(s);
- this.__lzloading = true;
}
/**
@@ -54,12 +53,6 @@
LzHistory.__lzhistq = [];
/** @access private */
LzHistory.__lzcurrstate = {};
-/** @access private */
-LzHistory.__lzloading = false;
-/** @access private */
-LzHistory.__lzloadcache = {};
-/** @access private */
-LzHistory.__loadcacheused = false;
DeclareEvent(LzHistory, 'onoffset' );
@@ -81,23 +74,6 @@
//Debug.write('restoring state ', global[o.c], o.c, o.n, o.v);
global[o.c].setAttribute(o.n, o.v);
}
-
-
- // copy values cached during load
- if (this.__loadcacheused) {
- var out = this.__lzhistq[this.offset];
- if (out == null) out = {};
- var u;
- for (u in this.__lzloadcache) {
- //Debug.write('restoring', o, this.__lzloadcache[u]);
- out[u] = this.__lzloadcache[u];
- }
- this.__lzhistq[this.offset] = out;
- this.__lzloadcache = {};
- this.__loadcacheused = false;
- }
-
- this.__lzloading = false;
}
/**
@@ -137,16 +113,9 @@
LzHistory.save = function(who, prop, val) {
// strip off __ so keys can be listed
if (val == null) val = global[who][prop];
- if (this.__lzloading) {
- //Debug.write('caching');
- // cache values until load finishes
- this.__lzloadcache[who] = {c: who, n: prop, v: val};
- this.__loadcacheused = true;
- } else {
- //Debug.write('set state of ',u,' to ', this.__lzcurrstate);
- this.__lzcurrstate[who] = {c: who, n: prop, v: val};
- this.__lzdirty = true;
- }
+ //Debug.write('set state of ',u,' to ', this.__lzcurrstate);
+ this.__lzcurrstate[who] = {c: who, n: prop, v: val};
+ this.__lzdirty = true;
}
/**
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-10-10 23:17:04 UTC (rev 6797)
@@ -37,8 +37,7 @@
LzHistory.__setHistory = function(s) {
//Debug.write('__setHistory', s);
LzBrowser._jsreset();
- LzBrowser.callJS('Lz.history.set("' + s + '")', false);
- this.__lzloading = true;
+ LzBrowser.callJS('Lz.history.set', null, s);
}
/**
@@ -58,50 +57,40 @@
LzHistory.__lzhistq = [];
/** @access private */
LzHistory.__lzcurrstate = {};
-/** @access private */
-LzHistory.__lzloading = false;
-/** @access private */
-LzHistory.__lzloadcache = {};
-/** @access private */
-LzHistory.__loadcacheused = false;
DeclareEvent(LzHistory, 'onoffset' );
-
/**
* @access private
*/
LzHistory.receiveHistory = function(o){
- //Debug.write('onhistory ', o, this.__lzhistq);
+ if (this.persist && ! this._persistso) {
+ this.__initPersist();
+ }
+ var l = this.__lzhistq.length;
o *= 1;
- if (! o) o = 0;
- if (o > this.__lzhistq.length - 1) o = this.__lzhistq.length;
- this.offset = o;
- if (this.onoffset.ready) this.onoffset.sendEvent(o);
-
+ if (! o) {
+ o = 0;
+ } else if (o > l - 1) {
+ o = l;
+ }
+
var h = this.__lzhistq[o];
for (var u in h) {
- var o = h[u];
- //Debug.write('restoring state ', global[o.c], o.c, o.n, o.v);
- global[o.c].setAttribute(o.n, o.v);
+ var obj = h[u];
+ //Debug.write('restoring state ', global[obj], obj, obj.n, obj.v);
+ global[u].setAttribute(obj.n, obj.v);
}
-
-
- // copy values cached during load
- if (this.__loadcacheused) {
- var out = this.__lzhistq[this.offset];
- if (out == null) out = {};
- var u;
- for (u in this.__lzloadcache) {
- //Debug.write('restoring', o, this.__lzloadcache[u]);
- out[u] = this.__lzloadcache[u];
- }
- this.__lzhistq[this.offset] = out;
- this.__lzloadcache = {};
- this.__loadcacheused = false;
+
+ this.offset = o;
+ //Debug.write('onhistory ', o, this.__lzhistq);
+ if (this.onoffset.ready) this.onoffset.sendEvent(o);
+ if ($swf7) {
+ _root._currenthistory = o + '';
+ } else {
+ LzBrowser.callJS('Lz.history.__receivedhistory', false, o + '');
}
-
- this.__lzloading = false;
+ return true;
}
/**
@@ -197,16 +186,9 @@
}
// strip off __ so keys can be listed
if (val == null) val = global[who][prop];
- if (this.__lzloading) {
- //Debug.write('caching');
- // cache values until load finishes
- this.__lzloadcache[who] = {c: who, n: prop, v: val};
- this.__loadcacheused = true;
- } else {
- this.__lzcurrstate[who] = {c: who, n: prop, v: val};
- this.__lzdirty = true;
- //Debug.write('set state of ',who,' to ', this.__lzcurrstate);
- }
+ this.__lzcurrstate[who] = {n: prop, v: val};
+ this.__lzdirty = true;
+ //Debug.write('set state of ',who,' to ', this.__lzcurrstate);
}
/**
@@ -224,7 +206,7 @@
if (this.persist) {
if (! this._persistso) {
- this._persistso = this.getPersist('historystate');
+ this.__initPersist();
}
//Debug.write('_persistso: ', this._persistso);
this._persistso.data[this.offset] = this.__lzcurrstate;
@@ -268,12 +250,6 @@
this.move(-1);
}
-/** get history from local object
- * @access private
- */
-LzHistory.__restorehistory = function() {
- this.receiveHistory(this.offset);
-}
/** @access private */
LzHistory.__initPersist = function() {
if (this.persist) {
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -203,6 +203,7 @@
LzPlatform.initCanvas(this);
+ this.id = LzBrowser.getInitArg('id')
}
/**
@@ -499,10 +500,6 @@
this.init();
this.sprite.init(true);
- if ($dhtml) {
- } else {
- LzHistory.__restorehistory();
- }
if (this.oninit.ready) this.oninit.sendEvent( this );
if (this.datapath && this.datapath.__LZApplyDataOnInit) {
this.datapath.__LZApplyDataOnInit();
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LaszloView.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -44,8 +44,8 @@
*
* @initarg public Boolean clip: A boolean indicating that the view is masked
* if true, the view applies setClip(true) to itself
- * @initarg public Boolean stretches: A string specifying whether or not the view
- * should stretch its contents. Values are <code>width</code>, <code>height</code> or <code>both</code>.
+ * @initarg public String stretches: A string specifying whether or not the view
+ * should stretch its contents. Values are <code>"width"</code>, <code>"height"</code> or <code>"both"</code>.
* When stretching, the coordinate system of the contents is modified
* so that the whole view will fit in the given dimensions.
* If <code>stretches</code> is applied, <code>clip</code> would not be necessary.
@@ -1287,8 +1287,8 @@
* Sets the <attribute>x</attribute> position of the view to the given value.
* @param Number v: The new value for <attribute>x</attribute>.
*/
-function setX ( v ){
- if (this._x != v) {
+function setX ( v, force ){
+ if (force || this._x != v) {
this._x = v;
this.x = v;
if ( this.__LZhasoffset ){
@@ -1314,8 +1314,8 @@
* Sets the <attribute>y</attribute> position for the view to the given value.
* @param Number v: The new value for <attribute>y</attribute>.
*/
-function setY ( v ){
- if (this._y != v) {
+function setY ( v, force ){
+ if (force || this._y != v) {
this._y = v;
this.y = v;
if ( this.__LZhasoffset ){
@@ -1353,8 +1353,8 @@
if (this.onrotation.ready) this.onrotation.sendEvent( v );
if ( this.__LZhasoffset ){
- this.setX( this.x );
- this.setY( this.y );
+ this.setX( this.x, true );
+ this.setY( this.y, true );
}
if (this.immediateparent.__LZcheckwidth)
@@ -1396,8 +1396,8 @@
function setXOffset ( o ){
this.__LZhasoffset = o != 0;
this.xoffset = o;
- this.setX( this.x );
- this.setY( this.y );
+ this.setX( this.x, true );
+ this.setY( this.y, true );
if (this.onxoffset.ready) this.onxoffset.sendEvent( o );
}
@@ -1408,8 +1408,8 @@
function setYOffset ( o ){
this.__LZhasoffset = o != 0;
this.yoffset = o;
- this.setX( this.x );
- this.setY( this.y );
+ this.setX( this.x, true );
+ this.setY( this.y, true );
if (this.onyoffset.ready) this.onyoffset.sendEvent( o );
}
@@ -2529,7 +2529,7 @@
* loaded
*
* @param Function f: A function that takes a URL as a string and returns one
- * of "server", "none", or null meaning respectively that the request should be
+ * of true, false, or null meaning respectively that the request should be
* proxied by the LPS server; made directly to the URL; or should be passed to
* the next policy function in the list. The default policy function returns
* the value of canvas.proxied
@@ -2582,5 +2582,19 @@
Debug.warn('The %s runtime does not support %s', lzr, msg);
}
+/**
+ * LzView.getNextSelection
+ * Override to specify the next view to be focused
+ * @access public
+ */
+function getNextSelection() {
+}
+/**
+ * LzView.getPrevSelection
+ * Override to specify the previous view to be focused
+ * @access public
+ */
+function getPrevSelection() {
+}
} // End of LzView
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzInputText.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzInputText.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzInputText.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -67,50 +67,6 @@
* <tagname>inputtext</tagname> view can keep up with typing speed even
* at large sizes or on a slow computer.</p>
*
- * <p>A program can request an optimized <tagname>inputtext</tagname> by
- * setting the <attribute>resizable</attribute> attribute to
- * <code>false</code>, and supplying recognizable
- * <attribute>width</attribute> and <attribute>height</attribute>
- * dimension attributes. A recognizable dimension attribute is an
- * attribute that is defined as a numeric literal, such as
- * <code>width="100"</code>, or that is defined as a simple
- * <code>$once</code> expression that adds or subtracts a numeric literal
- * to the <attribute>width</attribute> or <attribute>height</attribute>
- * attribute of the view's parent, its parent's parent, or so on. This
- * final optimization allows the optimization to apply to
- * <tagname>inputtext</tagname> tags within a class definition, as in the
- * second example below.</p>
- *
- * <example title="Optimized inputtext"><programlisting>
- * <canvas height="20">
- * <inputtext resizable="false" width="150" height="20">
- * This text is editable.
- * </inputtext>
- * </canvas>
- * </programlisting></example>
- *
- * <example title="Component with optimized inputtext"><programlisting>
- * <canvas height="20">
- * <class name="mytext" width="150" height="20" bgcolor="gray">
- * <attribute name="text" type="text"/>
- * <inputtext resizable="false" text="${parent.text}" bgcolor="white"
- * x="1" y="1"
- * width="$once{parent.width-2}" height="$once{parent.height-2}"/>
- * </class>
- * <mytext>This text is editable.</mytext>
- * </canvas>
- * </programlisting></example>
- *
- * <p>The compiler can also infer the values of the
- * <attribute>width</attribute> and <attribute>height</attribute>
- * attributes if they are not supplied. If supplied, the value of the
- * <attribute>font</attribute> must be a constant string in order for the
- * text field to be optimized. If supplied, the value of the
- * <attribute>fontsize</attribute> must be a constant in order to
- * for the text field to be optimized. Generally these can be omitted and
- * the inputtext will inherit the parent's font size and style by
- * default.</p>
- *
* @shortdesc The basic input-text element.
* @lzxname inputtext
*/
@@ -149,6 +105,8 @@
"onfocus" );
this._onblurDel = new LzDelegate( this , "_gotBlurEvent" , this,
"onblur" );
+ this._modemanagerDel = new LzDelegate( this, "_modechanged", LzModeManager,
+ "onmode" );
}
/**
@@ -247,6 +205,9 @@
function setText ( t ){
// force to a string
t += '';
+ if (this.maxlength != null && t.length > this.maxlength){
+ t = t.substring(0, this.maxlength);
+ }
this.sprite.setText(t);
this.text = t;
// [todo 2006-06 hqm] when should we send onwidth and onheight events?
@@ -271,4 +232,61 @@
return [ self, "text" ];
}
+/**
+ * this attribute control the LzText::selectable attribute trough its setter
+ * @access private
+ */
+var _allowselectable=true;
+
+/**
+ * cache true value of selectable
+ * @access private
+ */
+var _selectable;
+
+/**
+ * Catch all LzModeManager events
+ * @access private
+ */
+function _modechanged(modalview) {
+ // !modalview = "LzModeManager release a view" => so allowselectable
+ if ( !modalview ) {
+ this._setallowselectable(true);
+ } else {
+ // LzModeManager make modalview as modal
+ // (modalview.nodeLevel > this.nodeLevel) = "This cannot be a child of the setted modal view"
+ // so not allowselectable
+ if ( modalview.nodeLevel > this.nodeLevel ) {
+ this._setallowselectable( false );
+ } else {
+ // is this a child of the setted modal view
+ var parentSeeking = this;
+
+ do {
+ parentSeeking = parentSeeking.parent;
+ } while ( parentSeeking != canvas && parentSeeking != modalview );
+
+ this._setallowselectable(parentSeeking != canvas);
+ }
+ }
+}
+
+/**
+ * update the selectable status based on cached value
+ * @access private
+ */
+function _setallowselectable(value) {
+ this._allowselectable = value;
+ this.setSelectable( this._selectable );
+}
+
+/**
+ * @access private
+ */
+function setSelectable(value) {
+ this._selectable = value;
+ // depending on allowselectable : the setted value or false !
+ super.setSelectable( this._allowselectable ? value : false );
+}
+
} // End of LzInputText
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzText.lzs
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzText.lzs 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/lfc/views/LzText.lzs 2007-10-10 23:17:04 UTC (rev 6797)
@@ -199,8 +199,15 @@
this.resize = ('resize' in args) ? (args.resize == true) : this.resize;
this.setResize(this.resize);
+
+ if ('maxlength' in args && args.maxlength != null) {
+ this.setMaxLength(args.maxlength);
+ }
this.text = (!('text' in args) || args.text == null) ? "" : args.text;
+ if(this.maxlength != null && this.text.length > this.maxlength){
+ this.text = this.text.substring(0, this.maxlength);
+ }
this.setMultiline( this.multiline );
@@ -243,10 +250,6 @@
// Default the scrollheight to the visible height.
this.scrollheight = this.height;
- if ('maxlength' in args && args.maxlength != null) {
- this.setMaxLength(args.maxlength);
- }
-
if ('pattern' in args && args.pattern != null) {
this.setPattern(args.pattern);
}
@@ -663,6 +666,9 @@
t += '';
if (force != true && t == this.text) return;
if (this.visible) this.sprite.setVisible(this.visible);
+ if (this.maxlength != null && t.length > this.maxlength){
+ t = t.substring(0, this.maxlength);
+ }
this.sprite.setText(t);
this.text = t;
@@ -784,9 +790,8 @@
* @param Boolean isSel: true if the text may be selected by the user
*/
function setSelectable ( isSel ){
+ this.selectable = isSel;
this.sprite.setSelectable(isSel);
- //this.__LZtextclip.selectable = isSel;
-
}
/**
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzc.bat
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzc.bat 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzc.bat 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
REM lzc.bat - Bash script to run laszlo compiler.
REM
REM * R_LZ_COPYRIGHT_BEGIN ***************************************************
-REM * Copyright 2001-2005 Laszlo Systems, Inc. All Rights Reserved. *
+REM * Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
REM * Use is subject to license terms. *
REM * R_LZ_COPYRIGHT_END *****************************************************
@@ -11,5 +11,5 @@
set CLASSPATH_SAVE=%CLASSPATH%
set CLASSPATH=%LZCP%
-%JAVA_HOME%\bin\java %JAVA_OPTS% -DLPS_HOME="%LPS_HOME%" org.openlaszlo.compiler.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
+"%JAVA_HOME%\bin\java" %JAVA_OPTS% -DLPS_HOME="%LPS_HOME%" org.openlaszlo.compiler.Main %*
set CLASSPATH=%CLASSPATH_SAVE%
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzdc.bat
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzdc.bat 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzdc.bat 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
REM lzc.bat - Bash script to run laszlo compiler.
REM
REM * R_LZ_COPYRIGHT_BEGIN ***************************************************
-REM * Copyright 2001-2005 Laszlo Systems, Inc. All Rights Reserved. *
+REM * Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
REM * Use is subject to license terms. *
REM * R_LZ_COPYRIGHT_END *****************************************************
@@ -11,5 +11,5 @@
set CLASSPATH_SAVE=%CLASSPATH%
set CLASSPATH=%LZCP%
-%JAVA_HOME%\bin\java %JAVA_OPTS% -DLPS_HOME="%LPS_HOME%" org.openlaszlo.xml.internal.Main %1 %2 %3 %4 %5 %6 %7 %8 %9 %a%
+"%JAVA_HOME%\bin\java" %JAVA_OPTS% -DLPS_HOME="%LPS_HOME%" org.openlaszlo.xml.internal.Main %* %a%
set CLASSPATH=%CLASSPATH_SAVE%
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzmc.bat
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzmc.bat 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/bin/lzmc.bat 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
REM lzc.bat - Bash script to run laszlo compiler.
REM
REM * R_LZ_COPYRIGHT_BEGIN ***************************************************
-REM * Copyright 2001-2005 Laszlo Systems, Inc. All Rights Reserved. *
+REM * Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
REM * Use is subject to license terms. *
REM * R_LZ_COPYRIGHT_END *****************************************************
@@ -11,5 +11,5 @@
set CLASSPATH_SAVE=%CLASSPATH%
set CLASSPATH=%LZCP%
-%JAVA_HOME%\bin\java %JAVA_OPTS% -DLPS_HOME="%LPS_HOME%" org.openlaszlo.media.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
+"%JAVA_HOME%\bin\java" %JAVA_OPTS% -DLPS_HOME="%LPS_HOME%" org.openlaszlo.media.Main %*
set CLASSPATH=%CLASSPATH_SAVE%
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Canvas.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -102,14 +102,6 @@
// Default to proxied deployment
private boolean mProxied = true;
-
- /** Width of the root output text object (Flash 5 limits us to
- * setting this at compile time) */
- private int mMaxTextWidth = 0;
-
- /** Height of the root output text object (Flash 5 limits us to
- * setting this at compile time) */
- private int mMaxTextHeight = 0;
/** FontInfo for the canvas. */
private FontInfo mFontInfo = null;
@@ -268,28 +260,6 @@
mHeightString = h;
}
-
- /** @return maxTextWidth */
- public int getMaxTextWidth() {
- return mMaxTextWidth;
- }
-
- /** @param h */
- public void setMaxTextWidth(int h) {
- mMaxTextWidth = h;
- }
-
- /** @return maxTextHeight */
- public int getMaxTextHeight() {
- return mMaxTextHeight;
- }
-
- /** @param h */
- public void setMaxTextHeight(int h) {
- mMaxTextHeight = h;
- }
-
-
/** @return Background color */
public int getBGColor() {
return mBGColor;
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -170,8 +170,7 @@
for (Iterator iter = getLibraries(element).iterator();
iter.hasNext(); ) {
File file = (File) iter.next();
- Element library = LibraryCompiler.resolveLibraryElement(
- file, mEnv, visited, false);
+ Element library = LibraryCompiler.resolveLibraryElement(file, mEnv, visited);
if (library != null) {
collectObjectProperties(library, model, visited);
}
@@ -316,29 +315,6 @@
canvas.setFontInfo(new FontInfo(font, fontsize, fontstyle));
- // The width of the "root" Flash output text resource. Since
- // it's fixed at compile time, this gives the developer a way
- // to specify it. Defaults to canvas width if not specified.
- String maxtextwidth = elt.getAttributeValue("maxtextwidth");
- if (maxtextwidth != null) {
- try {
- canvas.setMaxTextWidth(Integer.parseInt(maxtextwidth));
- } catch (NumberFormatException e) {
- throw new CompilationError(elt, "maxtextwidth", e);
- }
- }
-
- // The height of the "root" Flash output text resource. Since
- // it's fixed at compile time, this gives the developer a way
- // to specify it. Defaults to canvas height if not specified.
- String maxtextheight = elt.getAttributeValue("maxtextheight");
- if (maxtextheight != null) {
- try {
- canvas.setMaxTextHeight(Integer.parseInt(maxtextheight));
- } catch (NumberFormatException e) {
- throw new CompilationError(elt, "maxtextheight", e);
- }
- }
}
private void collectObjectProperties(Element element, NodeModel model,
@@ -350,7 +326,7 @@
model.addPropertyElement(child);
} else if (LibraryCompiler.isElement(child)) {
Element libraryElement = LibraryCompiler.resolveLibraryElement(
- child, mEnv, visited, false);
+ child, mEnv, visited);
if (libraryElement != null) {
collectObjectProperties(libraryElement, model, visited);
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -76,7 +76,8 @@
String classname = elt.getAttributeValue("name");
String superclass = elt.getAttributeValue("extends");
- if (classname == null || !ScriptCompiler.isIdentifier(classname)) {
+ if (classname == null ||
+ (schema.enforceValidIdentifier && !ScriptCompiler.isIdentifier(classname))) {
CompilationError cerr = new CompilationError(
/* (non-Javadoc)
* @i18n.test
@@ -105,7 +106,9 @@
}
ClassModel superclassinfo = schema.getClassModel(superclass);
+
if (superclassinfo == null) {
+
throw new CompilationError(
/* (non-Javadoc)
* @i18n.test
@@ -125,20 +128,22 @@
if (o instanceof Element) {
Element child = (Element) o;
// Is this an element named ATTRIBUTE which is a
- // direct child of a CLASS tag?
+ // direct child of this CLASS or INTERFACE tag?
if (child.getName().equals("attribute")) {
- String attrName;
- try {
- attrName = requireIdentifierAttributeValue(child, "name");
- } catch (MissingAttributeException e) {
- throw new CompilationError(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="'name' is a required attribute of <" + p[0] + "> and must be a valid identifier"
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ClassCompiler.class.getName(),"051018-131", new Object[] {child.getName()})
-, child);
+ String attrName = child.getAttributeValue("name");
+ if (schema.enforceValidIdentifier) {
+ try {
+ attrName = requireIdentifierAttributeValue(child, "name");
+ } catch (MissingAttributeException e) {
+ throw new CompilationError(
+ /* (non-Javadoc)
+ * @i18n.test
+ * @org-mes="'name' is a required attribute of <" + p[0] + "> and must be a valid identifier"
+ */
+ org.openlaszlo.i18n.LaszloMessages.getMessage(
+ ClassCompiler.class.getName(),"051018-131", new Object[] {child.getName()})
+ , child);
+ }
}
String attrTypeName = child.getAttributeValue("type");
@@ -159,6 +164,7 @@
attrType = schema.getTypeForName(attrTypeName);
}
+
if (attrType == null) {
throw new CompilationError(
/* (non-Javadoc)
@@ -181,12 +187,14 @@
}
attributeDefs.add(attrSpec);
} else if (child.getName().equals("event")) {
- String attrName;
- try {
- attrName = requireIdentifierAttributeValue(child, "name");
- } catch (MissingAttributeException e) {
- throw new CompilationError(
- "'name' is a required attribute of <" + child.getName() + "> and must be a valid identifier", child);
+ String attrName = child.getAttributeValue("name");
+ if (schema.enforceValidIdentifier) {
+ try {
+ attrName = requireIdentifierAttributeValue(child, "name");
+ } catch (MissingAttributeException e) {
+ throw new CompilationError(
+ "'name' is a required attribute of <" + child.getName() + "> and must be a valid identifier", child);
+ }
}
ViewSchema.Type attrType = ViewSchema.EVENT_HANDLER_TYPE;
@@ -195,7 +203,7 @@
attributeDefs.add(attrSpec);
} else if (child.getName().equals("doc")) {
// Ignore documentation nodes
- }
+ }
}
}
@@ -204,21 +212,24 @@
}
public void compile(Element elt) {
- String className;
- try {
- className = requireIdentifierAttributeValue(elt, "name");
- } catch (MissingAttributeException e) {
- throw new CompilationError(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="'name' is a required attribute of <" + p[0] + "> and must be a valid identifier"
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ClassCompiler.class.getName(),"051018-193", new Object[] {elt.getName()})
-, elt);
+ String className = elt.getAttributeValue("name");
+ ViewSchema schema = mEnv.getSchema();
+ if (schema.enforceValidIdentifier) {
+ try {
+ className = requireIdentifierAttributeValue(elt, "name");
+ } catch (MissingAttributeException e) {
+ throw new CompilationError(
+ /* (non-Javadoc)
+ * @i18n.test
+ * @org-mes="'name' is a required attribute of <" + p[0] + "> and must be a valid identifier"
+ */
+ org.openlaszlo.i18n.LaszloMessages.getMessage(
+ ClassCompiler.class.getName(),"051018-193", new Object[] {elt.getName()})
+ , elt);
+ }
}
- ViewSchema schema = mEnv.getSchema();
+
ClassModel classModel = schema.getClassModel(className);
String linedir = CompilerUtils.sourceLocationDirective(elt, true);
@@ -237,9 +248,9 @@
viewMap.put("name", ScriptCompiler.quote(className));
// TODO: [2007-01-29 ptw] Someday write out real Javascript classes
-// String superclass = XMLUtils.getAttributeValue(elt, "extends", DEFAULT_SUPERCLASS_NAME);
-// org.openlaszlo.sc.ScriptClass scriptClass =
-// new org.openlaszlo.sc.ScriptClass(className, superclass, (Map)viewMap.get("attrs"));
+ // String superclass = XMLUtils.getAttributeValue(elt, "extends", DEFAULT_SUPERCLASS_NAME);
+ // org.openlaszlo.sc.ScriptClass scriptClass =
+ // new org.openlaszlo.sc.ScriptClass(className, superclass, (Map)viewMap.get("attrs"));
// Construct a Javascript statement from the initobj map
String initobj;
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -17,6 +17,9 @@
protected final Element definition;
protected NodeModel nodeModel;
+ /** Set of tags that can legally be nested in this element */
+ protected Set mCanContainTags = new HashSet();
+
/* If superclass is a predefined system class, just store its name. */
protected String superclassName = null;
protected boolean hasInputText = false;
@@ -110,8 +113,12 @@
}
ClassModel getSuperclassModel() {
- return superclass;
+ return superclass;
}
+
+ String getClassName () {
+ return this.className;
+ }
String getSuperclassName() {
if (superclassName != null) {
@@ -309,6 +316,17 @@
setChildrenClassRootDepth(child, childDepth);
}
}
+
+
+ /** Add an entry to the table of legally containable tags for a
+ * given tag */
+ public void addContainsElement (String childtag) {
+ mCanContainTags.add(childtag);
+ }
+
+ public Set getContainsSet () {
+ return mCanContainTags;
+ }
}
/**
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -36,9 +36,6 @@
public static final String PROFILE_PROPERTY = "profile";
public static final String LINK_PROPERTY = "link";
- public static final String VALIDATE_PROPERTY = "validate";
- // e_validate is defined if a user explicitly defined validate attribute
- public static final String VALIDATE_EXPLICIT_PROPERTY = "e_validate";
public static final String CSSFILE_PROPERTY = "cssfile";
// Log all debug.write messages back to the server
public static final String LOGDEBUG_PROPERTY = "logdebug";
@@ -129,7 +126,7 @@
private static int mDefaultTextWidth = 100;
/** Default SWF version to compile to */
- private String mDefaultRuntime = LPS.getProperty("compiler.runtime.default", "swf7");
+ private String mDefaultRuntime = LPS.getRuntimeDefault();
/** Constructs an instance.
* @param properties compilation properties
@@ -638,4 +635,28 @@
throw new CompilationError(elt, e);
}
}
+
+ public boolean warnIfCannotContain(Element parentTag, Element childTag) {
+ if (!mSchema.canContainElement(parentTag.getName(), childTag.getName())) {
+ this.warn(
+ // TODO [2006-08-22 hqm] i18n this
+ "The tag '" + childTag.getName() +
+ "' cannot be used as a child of " + parentTag.getName(),
+ parentTag);
+ return false;
+ } else {
+ return true;
+ }
+
+ }
+
+ /** Check if all children are allowed to be contained in this tags */
+ public void checkValidChildContainment(Element element) {
+ for (Iterator iter = element.getChildren().iterator();
+ iter.hasNext(); ) {
+ Element child = (Element) iter.next();
+ this.warnIfCannotContain(element, child);
+ }
+ }
+
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -308,11 +308,6 @@
env.setProperty(CompilationEnvironment.BACKTRACE_PROPERTY, backtrace);
}
- String validate = props.getProperty(CompilationEnvironment.VALIDATE_PROPERTY,
- LPS.getProperty("compiler.validate", "true"));
- if (validate != null) {
- env.setProperty(CompilationEnvironment.VALIDATE_PROPERTY, validate);
- }
String profile = props.getProperty(CompilationEnvironment.PROFILE_PROPERTY);
if (profile != null) {
@@ -364,9 +359,9 @@
mLogger.debug("Making a writer...");
- // Initialize the schema from the base RELAX file
+ // Initialize the schema from the base LFC interface file
try {
- env.getSchema().loadSchema();
+ env.getSchema().loadSchema(env);
} catch (org.jdom.JDOMException e) {
throw new ChainedException(e);
}
@@ -376,20 +371,6 @@
// files to have already been imported.
if (! linking) { externalLibraries = env.getImportedLibraryFiles(); }
Compiler.updateRootSchema(root, env, schema, externalLibraries);
- if (SchemaLogger.isDebugEnabled()) {
- org.jdom.output.XMLOutputter xmloutputter =
- new org.jdom.output.XMLOutputter();
- try {
- SchemaLogger.debug(xmloutputter.outputString(schema.getSchemaDOM()));
- } catch (org.jdom.JDOMException e) {
- throw new ChainedException(e);
- }
- }
-
- if (env.getBooleanProperty(CompilationEnvironment.VALIDATE_PROPERTY)) {
- Parser.validate(doc, file.getPath(), env);
- }
-
Properties nprops = (Properties) env.getProperties().clone();
Map compileTimeConstants = new HashMap();
compileTimeConstants.put("$debug", new Boolean(
@@ -653,8 +634,7 @@
static void importLibrary(File file, CompilationEnvironment env) {
Element root = LibraryCompiler.resolveLibraryElement(
- file, env, env.getImportedLibraryFiles(),
- env.getBooleanProperty(CompilationEnvironment.VALIDATE_PROPERTY));
+ file, env, env.getImportedLibraryFiles());
if (root != null) {
compileElement(root, env);
}
@@ -664,7 +644,7 @@
ViewSchema schema, Set visited)
{
Element root = LibraryCompiler.resolveLibraryElement(
- file, env, visited, false);
+ file, env, visited);
if (root != null) {
Compiler.updateSchema(root, env, schema, visited);
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/FontCompiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/FontCompiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/FontCompiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -45,6 +45,9 @@
if (src != null) {
compileFont(name, element);
}
+ // Check if children are valid tags to be contained
+ mEnv.checkValidChildContainment(element);
+
for (Iterator iter = element.getChildren("face", element.getNamespace()).iterator();
iter.hasNext(); ) {
compileFont(name, (Element) iter.next());
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ImportCompiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ImportCompiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ImportCompiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -51,8 +51,7 @@
String stage = XMLUtils.requireAttributeValue(element, "stage");
Element module = LibraryCompiler.resolveLibraryElement(
- element, mEnv, mEnv.getImportedLibraryFiles(),
- mEnv.getBooleanProperty(mEnv.VALIDATE_PROPERTY));
+ element, mEnv, mEnv.getImportedLibraryFiles());
if (module != null) {
// check for conflict in the value of the "proxied"
// attribute declared on the <import> tag vs the
@@ -124,7 +123,7 @@
}
void updateSchema(Element element, ViewSchema schema, Set visited) {
- element = LibraryCompiler.resolveLibraryElement(element, mEnv, visited, false);
+ element = LibraryCompiler.resolveLibraryElement(element, mEnv, visited);
if (element != null) {
super.updateSchema(element, schema, visited);
}
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryCompiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryCompiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryCompiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -39,8 +39,7 @@
*/
static Element resolveLibraryElement(File file,
CompilationEnvironment env,
- Set visited,
- boolean validate)
+ Set visited)
{
try {
File key = file.getCanonicalFile();
@@ -72,8 +71,6 @@
}
Document doc = env.getParser().parse(file, env);
- if (validate)
- Parser.validate(doc, file.getPath(), env);
Element root = doc.getRootElement();
mLogger.debug("" + file + ": " + root + " attributes: " + root.getAttributes());
// Look for and add any includes from a binary library
@@ -106,29 +103,27 @@
*/
static Element resolveLibraryElement(Element element,
CompilationEnvironment env,
- Set visited,
- boolean validate)
+ Set visited)
{
String href = element.getAttributeValue(HREF_ANAME);
if (href == null) {
return element;
}
File file = env.resolveReference(element, HREF_ANAME, true);
- return resolveLibraryElement(file, env, visited, validate);
+ return resolveLibraryElement(file, env, visited);
}
public void compile(Element element) throws CompilationError
{
element = resolveLibraryElement(
- element, mEnv, mEnv.getImportedLibraryFiles(),
- mEnv.getBooleanProperty(mEnv.VALIDATE_PROPERTY));
+ element, mEnv, mEnv.getImportedLibraryFiles());
if (element != null) {
super.compile(element);
}
}
void updateSchema(Element element, ViewSchema schema, Set visited) {
- element = resolveLibraryElement(element, mEnv, visited, false);
+ element = resolveLibraryElement(element, mEnv, visited);
if (element != null) {
super.updateSchema(element, schema, visited);
// TODO [hqm 2005-02-09] can we compare any 'proxied' attribute here
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -98,17 +98,7 @@
}
}
- private void exportAttributes() {
- // Write out the validate attribute of the source library, but only if
- // it was explicitly defined by the user
- String property = CompilationEnvironment.VALIDATE_PROPERTY;
- String e_property = CompilationEnvironment.VALIDATE_EXPLICIT_PROPERTY;
- String validate = mEnv.getProperty(property, null);
- String e_validate = mEnv.getProperty(e_property, null);
- if (e_validate != null && validate != null) {
- out.println("<attribute name='" + property + "' value='" + validate + "' />");
- }
- }
+ private void exportAttributes() {}
private void exportResources() {
for (Iterator i = resourceMap.entrySet().iterator(); i.hasNext(); ) {
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -403,6 +403,14 @@
this.parentClassModel = getParentClassModel();
}
+ ViewSchema.Type getAttributeTypeInfoFromParent(
+ Element elt, String attrname)
+ throws UnknownAttributeException
+ {
+ Element parent = elt.getParentElement();
+ return schema.getAttributeType(parent, attrname);
+ }
+
// Should only be called on a <class> definition element.
ViewSchema.Type getAttributeTypeInfoFromSuperclass(
Element classDefElement, String attrname)
@@ -614,14 +622,23 @@
}
}
- // Special case, if we are compiling a "class" tag,
- // then get the type of attributes from the
- // superclass.
+
Schema.Type type;
try {
if (className.equals("class")) {
+ // Special case, if we are compiling a "class"
+ // tag, then get the type of attributes from the
+ // superclass.
type = getAttributeTypeInfoFromSuperclass(element, name);
- } else {
+ } else if (className.equals("state")) {
+ // Special case for "state", it can have any attribute
+ // which belongs to the parent.
+ try {
+ type = schema.getAttributeType(element, name);
+ } catch (UnknownAttributeException e) {
+ type = getAttributeTypeInfoFromParent(element, name);
+ }
+ } else {
// NOTE [2007-06-14 ptw]: Querying the classModel
// directly will NOT work, because the schema
// method has some special kludges in it for canvas
@@ -707,10 +724,7 @@
ComparisonMap references, ComparisonMap paths,
ComparisonMap styles) {
if (cattr.type == cattr.ATTRIBUTE) {
- // Ignore warnings for 'validate'
- // FIXME [2007-08-31 pbr]: LPP-4620.
- if (attrs.containsKey(name, caseSensitive) &&
- !"validate".equalsIgnoreCase(name)) {
+ if (attrs.containsKey(name, caseSensitive)) {
env.warn(
/* (non-Javadoc)
* @i18n.test
@@ -866,12 +880,44 @@
return (child.getName().equals("datapath"));
}
+ void checkChildNameConflict(Element child, CompilationEnvironment env) {
+ String attrName = child.getAttributeValue("name");
+ if (attrName != null) {
+ ViewSchema.Type attrType = null;
+ try {
+ attrType = schema.getAttributeType(element, attrName);
+ } catch (UnknownAttributeException e) {
+
+ }
+ if (attrType != null) {
+ // TODO [2007-09-26 hqm] i18n this
+ env.warn(
+ "Child tag '" + child.getName() +
+ "' with attribute '"+attrName +
+ "' conflicts with attribute named '"+attrName+"' of type '" + attrType +
+ "' on parent tag '"+element.getName()+"'.",
+ element);
+ }
+ }
+ }
+
+
+
void addChildren(CompilationEnvironment env) {
// Encode the children
for (Iterator iter = element.getChildren().iterator(); iter.hasNext(); ) {
ElementWithLocationInfo child = (ElementWithLocationInfo) iter.next();
+ if (!schema.canContainElement(element.getName(), child.getName())) {
+ env.warn(
+ // TODO [2007-09-26 hqm] i18n this
+ "The tag '" + child.getName() +
+ "' cannot be used as a child of " + element.getName(),
+ element);
+ }
+
try {
if (child.getName().equals("data")) {
+ checkChildNameConflict(child, env);
// literal data
addLiteralDataElement(child);
} else if (isPropertyElement(child)) {
@@ -881,9 +927,11 @@
} else if (schema.isDocElement(child)) {
; // ignore doc nodes.
} else if (isDatapathElement(child)) {
+ checkChildNameConflict(child, env);
NodeModel dpnode = elementAsModel(child, schema, env);
this.datapath = dpnode;
} else {
+ checkChildNameConflict(child, env);
NodeModel childModel = elementAsModel(child, schema, env);
children.add(childModel);
totalSubnodes += childModel.totalSubnodes();
@@ -1250,7 +1298,7 @@
if (when.equals(WHEN_IMMEDIATELY)) {
value = ScriptCompiler.quote(value);
}
- } else if (type == ViewSchema.EXPRESSION_TYPE) {
+ } else if ((type == ViewSchema.EXPRESSION_TYPE) || (type == ViewSchema.BOOLEAN_TYPE)) {
// No change currently, possibly analyze expressions
// and default non-constant to when="once" in the
// future
@@ -1258,6 +1306,14 @@
// change "inherit" to null and pass true/false through as expression
if ("inherit".equals(value)) {
value = "null";
+ } else if ("true".equals(value)) {
+ value = "true";
+ } else if ("false".equals(value)) {
+ value = "false";
+ } else {
+ // TODO [hqm 2007-0] i8nalize this message
+ env.warn("attribute '"+name+"' must have the value 'true', 'false', or 'inherit'",
+ element);
}
} else if (type == ViewSchema.NUMBER_TYPE) {
// No change currently, possibly analyze expressions
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Parser.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Parser.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/Parser.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -159,7 +159,7 @@
/** Reads an XML document and adds source location information to
* the elements. */
- protected Document read(File file)
+ public Document read(File file)
throws JDOMException, IOException
{
// See if we've already read the file. This is an
@@ -616,142 +616,6 @@
* serialization of the schema. */
private static LRUMap mSchemaCache = new LRUMap(1);
- /** Validates an XML file against the Laszlo schema. Errors are
- * thrown as the text of a CompilationError.
- *
- * @param doc DOM of the source code to be validated
- * @param pathname pathname of the source file, for error reporting
- * @param env the compilation environment
- * @throws CompilationError if a validation error occurs
- */
- public static void validate(Document doc, String pathname,
- final CompilationEnvironment env)
- {
- final CompilationErrorHandler errorHandler = env.getErrorHandler();
- final ViewSchema viewschema = env.getSchema();
-
- if (mPreValidationLogger.isDebugEnabled()) {
- org.jdom.output.XMLOutputter debugOutputter =
- new org.jdom.output.XMLOutputter();
- mPreValidationLogger.debug("Pathname: " + pathname);
- mPreValidationLogger.debug(debugOutputter.outputString(doc));
- }
- try {
- org.iso_relax.verifier.Schema schema;
-
- // Look up a cached version of the compiled verifier for this env
- Verifier verifier = env.getCachedVerifier();
-
- if (verifier == null) {
- // System.err.println("env verifier cache miss: " + pathname);
-
- // Look up schema XML signature in common pool of compiled verifiers
- Object value;
- String schemaXMLstring = new XMLOutputter().outputString(viewschema.getSchemaDOM());
- String key = schemaXMLstring;
-
- synchronized (mSchemaCache) {
- schema = (org.iso_relax.verifier.Schema) mSchemaCache.get(key);
- }
-
- if (schema == null) {
- StringReader schemaXMLSource = new StringReader(schemaXMLstring);
- InputSource schemaInputSource = new InputSource(schemaXMLSource);
-
- // System.err.println("validator pool cache miss: " + pathname + " " + key.length());
- long st = System.currentTimeMillis();
-
- VerifierFactory factory = VerifierFactory.newInstance(
- "http://relaxng.org/ns/structure/1.0");
- schema = factory.compileSchema(schemaInputSource);
- long elapsed = System.currentTimeMillis() - st;
- mLogger.debug("compileSchema took "+elapsed+"ms");
-
-
- synchronized (mSchemaCache) {
- mSchemaCache.put(key, schema);
- }
- } else {
- // System.err.println("validator pool cache hit: " + pathname + " " + key.length());
- }
-
- // Cache this in CompilationEnvironment
- verifier = schema.newVerifier();
- env.setCachedVerifier(verifier);
- } else {
- // System.err.println("env verifier cache hit: " + pathname);
- }
-
- VerifierHandler handler = verifier.getVerifierHandler();
-
- verifier.setErrorHandler(
- new org.xml.sax.ErrorHandler() {
- protected void reportError(org.xml.sax.SAXParseException e)
- {
- String msg = e.getMessage();
- msg = StringUtils.replace(msg, " from namespace \"" + sNamespace.getURI() + "\"", "");
- CompilationError cerr = new CompilationError(msg);
- cerr.initPathname(e.getPublicId());
- cerr.setLineNumber(e.getLineNumber());
- cerr.setColumnNumber(e.getColumnNumber());
- if (msg.endsWith("not allowed in this context"))
- cerr.setSolution("Check whether it is spelled correctly, and whether a class with this name exists.");
- // TODO [2003-3-17 hqm]: find and add more
- // solution message here]
- env.warn(cerr);
- }
- public void fatalError(org.xml.sax.SAXParseException e) {
- reportError(e);
- }
- public void error(org.xml.sax.SAXParseException e) {
- reportError(e);
- }
- public void warning(org.xml.sax.SAXParseException e) {
- reportError(e);
- }
- }
- );
-
- /* Walk the DOM tree out as SAX events, as best we can. We
- * can't just use org.jdom.output.SAXOutputter because it
- * doesn't know how to convert the source location info from
- * our custom Elements into SAX Events.
- */
-
- SourceLocatorSAXOutputter outputter =
- new SourceLocatorSAXOutputter();
-
- /* Sets our validator (event handler) to be the handler
- * for the SAX Outputter */
- outputter.setContentHandler(handler);
- /* Feed the the source file DOM, via the SAX event
- * generator, to the validator. */
- outputter.output(doc);
-
- } catch (VerifierConfigurationException e) {
- throw new ChainedException(e);
- } catch (JDOMException e) {
- throw new ChainedException(e);
- } catch (StackOverflowError e) {
- env.warn(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="The validator had a fatal error, but proceeding with compilation"
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- Parser.class.getName(),"051018-648")
-, doc.getRootElement());
- } catch (SAXException e) {
- String solution = SolutionMessages.findSolution(e.getMessage(), SolutionMessages.PARSER);
- CompilationError err = new CompilationError(e, solution);
- err.setFileBase(errorHandler.fileBase);
- err.initPathname(pathname);
- throw err;
- } catch (IOException e) {
- throw new ChainedException(e);
- }
- }
-
void saveStartLocation (Element elt,
String pathname,
String messagePathname,
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ResourceCompiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -114,18 +114,23 @@
, element);
Set resourceNames = mEnv.getResourceNames();
- if (resourceNames.contains(name)) {
+ if (false) {
+ if (resourceNames.contains(name)) {
mEnv.warn(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="The resource name '" + p[0] + "' has already been defined"
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ResourceCompiler.class.getName(),"051018-124", new Object[] {name})
-, element);
+ /* (non-Javadoc)
+ * @i18n.test
+ * @org-mes="The resource name '" + p[0] + "' has already been defined"
+ */
+ org.openlaszlo.i18n.LaszloMessages.getMessage(
+ ResourceCompiler.class.getName(),"051018-124", new Object[] {name})
+ , element);
+ }
}
resourceNames.add(name);
+ // Check if children are valid tags to be contained
+ mEnv.checkValidChildContainment(element);
+
// N.B.: Resources are always imported into the main
// program for the Flash target, hence the use of
// getResourceGenerator below
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -101,13 +101,6 @@
public static final int DEFAULT_SIZE = 8;
- /** Width of the "root" text output object. Defaults to canvas width. */
- private int mMaxTextWidth = 0;
-
- /** Height of the "root" text output object. Defaults to canvas height. */
- private int mMaxTextHeight = 0;
-
-
/** Logger for jgenerator */
/**
* Initializes a SWFWriter with an OutputStream to which a new SWF
@@ -281,18 +274,6 @@
mWidth = canvas.getWidth();
mHeight = canvas.getHeight();
- mMaxTextWidth = canvas.getMaxTextWidth();
- // If zero, default to canvas width
- if (mMaxTextWidth == 0) {
- mMaxTextWidth = mWidth;
- }
-
- mMaxTextHeight = canvas.getMaxTextHeight();
- // If zero, default to canvas height
- if (mMaxTextHeight == 0) {
- mMaxTextHeight = mHeight;
- }
-
// Get default font info
FontInfo fontInfo = canvas.getFontInfo();
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ToplevelCompiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ToplevelCompiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ToplevelCompiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -38,6 +38,9 @@
}
public void compile(Element element) {
+ // Check if children are valid tags to be contained
+ mEnv.checkValidChildContainment(element);
+
for (Iterator iter = element.getChildren().iterator();
iter.hasNext(); ) {
Element child = (Element) iter.next();
@@ -54,15 +57,12 @@
* look for elements named "class", find the "name" and "extends"
* attributes, and enter them in the ViewSchema.
*
- * Also check for the "validate" attribute, to optionally disable validator.
- *
* @param visited {canonical filenames} for libraries whose
* schemas have been visited; used to prevent recursive
* processing.
*
*/
void updateSchema(Element element, ViewSchema schema, Set visited) {
- setValidateProperty(element, mEnv);
Iterator iterator = element.getChildren().iterator();
while (iterator.hasNext()) {
Element child = (Element) iterator.next();
@@ -72,46 +72,6 @@
}
}
-
- /**
- * Look for the "validate" attribute on canvas or at top level of imported libraries
- *
- * We look these places for the validate attribute:
- * <li> canvas (root) element
- * <li> direct child atttribute of canvas
- * @param root source code document root
- * @param env the CompilationEnvironment
- */
- void setValidateProperty(Element root , CompilationEnvironment env) {
- String validate = CompilationEnvironment.VALIDATE_PROPERTY;
- String e_validate = CompilationEnvironment.VALIDATE_EXPLICIT_PROPERTY;
- // Look for canvas attribute
- if (root.getAttributeValue(validate) != null) {
- // Record that the user explicitly defined validate
- env.setProperty(e_validate, true);
- if ("false".equals(root.getAttributeValue("validate"))) {
- env.setProperty(validate, false);
- } else {
- env.setProperty(validate, true);
- }
- }
-
- // Look for direct canvas children <attribute name="validate" value="false">
- for (Iterator iter = root.getChildren().iterator();
- iter.hasNext(); ) {
- Element child = (Element) iter.next();
- if (child.getName().equals("attribute")
- && validate.equals(child.getAttributeValue("name"))) {
- // Record that the user explicitly defined validate
- env.setProperty(e_validate, true);
- if ("false".equals(child.getAttributeValue("value"))) {
- env.setProperty(validate, false);
- }
- }
- }
- }
-
-
/** This also collects "attribute", "method", and HTML element
* names, but that's okay since none of them has an autoinclude
* entry.
@@ -129,7 +89,7 @@
if (compiler instanceof LibraryCompiler || compiler instanceof ImportCompiler) {
libStart = new LinkedHashSet(libsVisited.keySet());
libFound = new LinkedHashSet(libStart);
- library = LibraryCompiler.resolveLibraryElement(element, env, libFound, false);
+ library = LibraryCompiler.resolveLibraryElement(element, env, libFound);
if (library == element) {
// Not an external library
library = null;
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -28,11 +28,11 @@
private static final Set sInputTextElements = new HashSet();
private static final Set sHTMLContentElements = new HashSet();
- /** The location of the base Laszlo RELAXNG schema */
+ /** The location of the Laszlo LFC bootstrap interface declarations file */
private final String SCHEMA_PATH = LPS.HOME() + File.separator +
"WEB-INF" + File.separator +
"lps" + File.separator +
- "schema" + File.separator + "lzx.rng";
+ "schema" + File.separator + "lfc.lzx";
private Document schemaDOM = null;
@@ -54,8 +54,19 @@
*/
private final Map mClassMap = new HashMap();
+ /**
+ * If true, requires class names to be valid javascript identifiers.
+ * We disable this when defining LZX builtin tags such as "import"
+ * which are reserved javascript tokens.
+ */
+ public boolean enforceValidIdentifier = false;
+
/** Type of script expressions. */
public static final Type EXPRESSION_TYPE = newType("expression");
+
+ /** 'boolean' is compiled the same as an expression type */
+ public static final Type BOOLEAN_TYPE = newType("boolean");
+
public static final Type REFERENCE_TYPE = newType("reference");
/** Type of event handler bodies. */
public static final Type EVENT_HANDLER_TYPE = newType("script");
@@ -76,34 +87,6 @@
sHTMLContentElements.add("text");
sInputTextElements.add("inputtext");
- // Define mapping from RNG Schema types to LPS types
- sRNGtoLPSTypeMap.put("ID", ID_TYPE);
- sRNGtoLPSTypeMap.put("anyURI", STRING_TYPE);
- sRNGtoLPSTypeMap.put("booleanOrNull", EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("boolean", EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("booleanLiteral", EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("inheritableBooleanLiteral", INHERITABLE_BOOLEAN_TYPE);
- sRNGtoLPSTypeMap.put("color", COLOR_TYPE);
- sRNGtoLPSTypeMap.put("colorLiteral", COLOR_TYPE);
- sRNGtoLPSTypeMap.put("css", CSS_TYPE);
- sRNGtoLPSTypeMap.put("double", NUMBER_TYPE);
- sRNGtoLPSTypeMap.put("enumeration", STRING_TYPE);
- sRNGtoLPSTypeMap.put("expression", EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("float", NUMBER_TYPE);
- sRNGtoLPSTypeMap.put("integer", NUMBER_TYPE);
- sRNGtoLPSTypeMap.put("number", NUMBER_TYPE);
- sRNGtoLPSTypeMap.put("numberLiteral", NUMBER_TYPE);
- sRNGtoLPSTypeMap.put("numberExpression", NUMBER_EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("propertyPath", STRING_TYPE);
- sRNGtoLPSTypeMap.put("reference", REFERENCE_TYPE);
- sRNGtoLPSTypeMap.put("script", EVENT_HANDLER_TYPE);
- sRNGtoLPSTypeMap.put("size", SIZE_EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("sizeLiteral", SIZE_EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("sizeExpression", SIZE_EXPRESSION_TYPE);
- sRNGtoLPSTypeMap.put("string", STRING_TYPE);
- sRNGtoLPSTypeMap.put("token", TOKEN_TYPE);
- sRNGtoLPSTypeMap.put("opacity", NUMBER_TYPE);
-
// from http://www.w3.org/TR/REC-html40/interact/scripts.html
String[] mouseEventAttributes = {
"onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover",
@@ -256,151 +239,8 @@
}
/**
- * Add in the XML to the Schema class definition MYCLASS,
- * to add this list of attribute declarations.
- *
- * @param sourceElement the user's LZX source file element that holds class LZX definition
- * @param classname the class we are defining
- * @param classDef the RNG class declaration
- * @param attributeDefs list of AttributeSpec attribute info to add to the Schema
- *
- * This is confusing because we are modifying the RNG XML tree,
- * not the actual lzx source code tree. So it is confusing to see
- * JDOM Elements floating around and not be able to tell whether
- * they pertain to the LZX source or the RNG tree. Only
- * <i>sourceElement</i> is from the lzx source, we have it here so
- * we can identify the source file and line # in case of an error.
- */
- void addAttributeDefs (Element sourceElement, String classname,
- Element classDef, List attributeDefs)
- {
- /*
- <element>
- CHILDREN
- </element>
-
- ==>
-
- <element>
- NEWATTRS
- CHILDREN
- </element>
- */
- if (!attributeDefs.isEmpty()) {
- Namespace ns = classDef.getNamespace();
- List attrList = new ArrayList();
- for (Iterator iter = attributeDefs.iterator(); iter.hasNext();) {
- AttributeSpec attr = (AttributeSpec) iter.next();
-
- // If this attribute does not already occur someplace
- // in an ancestor, then let's add it to the schema, so
- // that the validation phase will know about it.
- //
- // We don't want to splice this attribute into the
- // schema if it already is present in an ancestor,
- // because that causes a fatal error ("duplicate
- // attribute") when parsing the schema.
-
- //System.out.println("getClassAttribute( "+ classname+", "+attr.name+ ") = " + classInheritsAttribute(classname, attr.name));
- if (getClassAttribute(classname, attr.name) == null) {
- // Splice some XML into the Schema element
- Element newAttr = new Element("attribute", ns);
- newAttr.setAttribute("name", attr.name);
- /* Datatype needs to be a ref to a laszlo type
- definition, so we generate this RELAX XML for
- the attribute:
-
- <optional>
- <attribute name="rotation" a:defaultValue="0">
- <ref name="numberExpression"/>
- </attribute>
- </optional>
-
- except for the base RELAX type 'string', for
- which there is no ref, we generate this:
-
- <optional>
- <attribute name="foo">
- <data type="string"/>
- </attribute>
- </optional>
- */
- String attrTypeName = attr.type.toString();
- Element datatype;
- if (attrTypeName.equals("string") || attrTypeName.equals("boolean")) {
- datatype = new Element("data", ns);
- datatype.setAttribute("type", attrTypeName);
- } else {
- datatype = new Element("ref", ns);
- datatype.setAttribute("name", attrTypeName);
- }
- // assemble the <attribute> node
- newAttr.addContent(datatype);
- // Wrap it in an <optional>
- Element optional = new Element("optional", ns);
- optional.addContent(newAttr);
- // If it's an <attribute name="text" type="text">, add this
- // instead:
- // <ref name="textAttributes"/>
- if (attr.contentType != attr.NO_CONTENT) {
- optional = new Element("ref", ns);
- if (attr.contentType == attr.TEXT_CONTENT) {
- optional.setAttribute("name", "textContent");
- } else if (attr.contentType == attr.HTML_CONTENT) {
- optional.setAttribute("name", "htmlContent");
- } else {
- throw new RuntimeException("unknown content type");
- }
- }
- attrList.add(optional);
- } else {
- // Check that the overriding type is the same as the superclass' type
- Type parentType = getAttributeType(classname, attr.name);
-
- if (parentType != attr.type) {
-throw new CompilationError(sourceElement, attr.name, new Throwable(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="In class '" + p[0] + "' attribute '" + p[1] + "' with type '" + p[2] + "' is overriding superclass attribute with same name but different type: " + p[3]
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ViewSchema.class.getName(),"051018-364", new Object[] {classname, attr.name, attr.type.toString(), parentType.toString()})
- ));
- }
- }
-
- // Update the in-memory attribute type table
- setAttributeType(sourceElement, classname, attr.name, attr);
- }
-
- if (!attrList.isEmpty()) {
- // Now splice the attribute list to the start of the class declaration node
- // Remove the original children of the class node
- List children = new ArrayList();
- for (Iterator iter = classDef.getChildren().iterator(); iter.hasNext();) {
- Element child = (Element) iter.next();
- children.add(child);
- // The only way to detach the child from the
- // parent is to use the iterator.remove() method
- // otherwise you get a ConcurrentModificationException
- iter.remove();
- }
- // Add in attributes
- classDef.setContent(attrList);
- // Then add back the old children
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- Element child = (Element) iter.next();
- classDef.addContent(child);
- }
- }
- }
- }
-
- /**
* Add a new element to the attribute type map.
*
- * Modifies the in-core schema DOM tree as well, to clone the superclass node.
- *
* @param elt the element to add to the map
* @param superclassName an element to inherit attribute to type info from. May be null.
* @param attributeDefs list of attribute name/type defs
@@ -451,240 +291,83 @@
info.supportsTextAttribute = superclass.supportsTextAttribute;
-
- // Modify the RELAX schema DOM to add this element. We find the superclass and
- // clone it, and modify its tag name.
-
- /*
- Say we are defining a new class "myclass extends somesuperclass":
-
- We look for some XML in the Schema which defines the
- "somesuperclass" class, which will look like
- <element name="somesuperclass"> .... </element>
- or else
- <element>
- <choice>
- <name>...</name>.
- <name>somesuperclass</name>
- </choice>
- </element>
-
- We then need to clone the superclass node, change its name
- to "myclass", and replace the original superclass node with
- a CHOICE of
- <choice>
- <..orginal superclass node..>
- <..our new class node..>
- </choice>
-
- This involves detach()'ing the superclass node, cloning it,
- and then making the new choice node and adding it back into
- the parent.
- */
-
- // Find the superclass definition
- Element superclassDef = findSchemaClassDef(superclassName, schemaDOM.getRootElement());
- if (superclassDef == null) {
- throw new CompilationError(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="No definition for superclass " + p[0] + " found in the schema"
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ViewSchema.class.getName(),"051018-491", new Object[] {superclassName})
-);
- }
-
- Namespace ns = superclassDef.getNamespace();
- // Clone the superclass's schema definition
- Element myclassDef = (Element) superclassDef.clone();
-
- // Update the map of classnames to defining Elements
- classElementTable.put(className, myclassDef);
-
- // Add in the attribute declarations
- addAttributeDefs(elt, className, myclassDef, attributeDefs);
- // Change "name" attritbute (if there is one) to className.
- // If there's no "name" attribute, we look for the CHOICE
- // child node that has NAME children and remove it.
-
- // Change the name to our new classname
- Attribute nameAttr = myclassDef.getAttribute("name");
- if (nameAttr == null) {
- // OK, it's not of the form <element name="classname">, so
- // it is of the form <element>
- // <choice><name>classname</name></choice>...</element>.
- //
- // We need to remove the "choice" child and add a "name"
- // attribute
-
- // +++ We don't necessarily want to remove the first
- // 'choice' node, we want to remove the one which has
- // 'name' children.
-
- for (Iterator iter = myclassDef.getChildren("choice", ns).iterator(); iter.hasNext();) {
- Element choice = (Element) iter.next();
- List names = choice.getChildren("name", ns);
- if (!names.isEmpty()) {
- // it contains one or more <name> elements, so
- // remove this whole 'choice' node from its parent
- iter.remove();
- break;
- }
+ // Loop over containsElements tags, adding to containment table in classmodel
+ Iterator iterator = elt.getChildren().iterator();
+ while (iterator.hasNext()) {
+ Element child = (Element) iterator.next();
+ if (child.getName().equals("containsElements")) {
+ // look for <element>tagname</element>
+ Iterator iter1 = child.getChildren().iterator();
+ while (iter1.hasNext()) {
+ Element etag = (Element) iter1.next();
+ if (etag.getName().equals("element")) {
+ String tagname = etag.getText();
+ info.addContainsElement(tagname);
+ } else {
+ throw new CompilationError(
+ "containsElement block must only contain <element> tags", etag);
+ }
+ }
}
}
- myclassDef.setAttribute("name", className);
-
- /* Now detach the superclass node and put in it's place
- <choice>
- <SUPERCLASSNODE>
- <MYNEWCLASSNODE>
- </choice>
- */
-
- Element parent = superclassDef.getParentElement();
- if (parent.getName().equals("choice"))
- parent.addContent(myclassDef);
- else {
- superclassDef.detach();
- Element newChoice = new Element("choice", ns);
- newChoice.addContent(superclassDef);
- newChoice.addContent(myclassDef);
- parent.addContent(newChoice);
- }
-
- /*
- if (definition != null) {
- // Look through the definition for children who are or
- // have text elements, and set info.hasInputText
- // accordingly
- info.hasInputText = info.hasInputText || (new Object() {
- boolean isOrHasChildren(Element elt) {
- if (isInputText(elt.getName()) || hasInputText(elt.getName())) {
- return true;
- }
- for (Iterator iter = elt.getChildren().iterator(); iter.hasNext(); ) {
- Element child = (Element) iter.getNext();
- return isOrHasChildren(child);
- }
- }
- }).isOrHasChildren(definition);
-
- }*/
- /* <class ...>
- <view>
- <text/>
- </view>
- </class>
- */
+ // Add in the attribute declarations
+ addAttributeDefs(elt, className, attributeDefs);
}
/**
- Walk the Schema DOM looking for an element which defines CLASSNAME.
- <p>
- This
- can actually occur in the schema as either
- <pre>
- <element name="classname">
- or
- <element> <choice> ... ... <name>classname</name> </choice>
- </pre>
+ * Add this list of attribute name/type info to the in-core model of the class definitions.
+ *
+ * @param sourceElement the user's LZX source file element that holds class LZX definition
+ * @param classname the class we are defining
+ * @param attributeDefs list of AttributeSpec attribute info to add to the Schema
+ *
+ */
+ void addAttributeDefs (Element sourceElement, String classname, List attributeDefs)
+ {
+ if (!attributeDefs.isEmpty()) {
+ for (Iterator iter = attributeDefs.iterator(); iter.hasNext();) {
+ AttributeSpec attr = (AttributeSpec) iter.next();
- <p>
- Uses the classElementTable to speed up the lookup.
- */
-
- Element findSchemaClassDef (String classname, Element elt) {
+ // If this attribute does not already occur someplace
+ // in an ancestor, then let's add it to the schema.
+ //
+ // While we're here, we need to check that we aren't
+ // redefining an attribute of a parent class with a
+ // different type.
- // Check the index
- Element classdef = (Element) classElementTable.get(classname);
- if (classdef != null) {
- return classdef;
- }
+ if (getClassAttribute(classname, attr.name) == null) {
+ // Splice some XML into the Schema element
+ String attrTypeName = attr.type.toString();
+ } else {
+ // Check that the overriding type is the same as the superclass' type
+ Type parentType = getAttributeType(classname, attr.name);
- if (elt.getName().equals("element")) {
- Namespace ns = elt.getNamespace();
- // Is this an element named "classname"?
- String name = elt.getAttributeValue("name");
- if (name != null && name.equals(classname)) {
- // cache this
- classElementTable.put(classname, elt);
- return elt;
- } else if (name == null) {
- // This is a structure of the form
- // <element><choice><name>xxxx</name>...? Look for
- // immediate "choice" child, and look in its "name"
- // children
- for (Iterator iter = elt.getChildren("choice", ns).iterator(); iter.hasNext();) {
- Element choice = (Element) iter.next();
- for (Iterator iter2 = choice.getChildren("name", ns).iterator(); iter2.hasNext();) {
- Element child = (Element) iter2.next();
- if (child.getTextTrim().equals(classname)) {
- classElementTable.put(classname, elt);
- return elt;
- }
+ if (parentType != attr.type) {
+ throw new CompilationError(sourceElement, attr.name, new Throwable(
+ /* (non-Javadoc)
+ * @i18n.test
+ * @org-mes="In class '" + p[0] + "' attribute '" + p[1] + "' with type '" + p[2] + "' is overriding superclass attribute with same name but different type: " + p[3]
+ */
+ org.openlaszlo.i18n.LaszloMessages.getMessage(
+ ViewSchema.class.getName(),"051018-364", new Object[] {classname, attr.name, attr.type.toString(), parentType.toString()})
+ ));
}
}
- }
- }
- // class def not found here; descend the tree to search for it
- for (Iterator iter = elt.getChildren().iterator(); iter.hasNext(); ) {
- Element child = (Element) iter.next();
- Element result = findSchemaClassDef(classname, child);
- if (result != null) {
- return result;
+ // Update the in-memory attribute type table
+ setAttributeType(sourceElement, classname, attr.name, attr);
}
}
-
- return (Element) null;
}
public Type getTypeForName(String name) {
if (name.equals("text") ||
name.equals("html"))
name = "string";
- if (sRNGtoLPSTypeMap.containsKey(name))
- return (Type) sRNGtoLPSTypeMap.get(name);
return super.getTypeForName(name);
}
- /** Maps definition name to list of DOM Elements in the parsed RNG schema DOM */
- private final Map referenceTable = new HashMap();
- /** List of all <ELEMENT> tags in the schema DOM. */
- private final List schemaElementTable = new ArrayList();
-
- /** Table which maps class names to their definitions in the
- * schema DOM, used by findSchemaClassDef() */
- private final Map classElementTable = new HashMap();
-
-
- /** Construct a table of <definition> elements from the RNG schema, to make
- * efficient lookup possible when following <ref> tags.
- */
- private void buildReferenceTable (Element elt) {
- // If it's a <define name="xxx"> add an entry in the referenceTable
- String eltname = elt.getName();
- if (eltname.equals("define")) {
- String name = elt.getAttributeValue("name");
- List elts = (List) referenceTable.get(name);
- if (elts == null) {
- elts = new ArrayList();
- referenceTable.put(name, elts);
- }
- elts.add(elt);
- //System.err.println("[adding ref "+name+" " + elt.getAttribute("name")+"]");
- } else if (eltname.equals("element")) {
- schemaElementTable.add(elt);
- }
-
- for (Iterator iter = elt.getChildren().iterator(); iter.hasNext(); ) {
- Element child = (Element) iter.next();
- buildReferenceTable(child);
- }
- }
-
/** Adds a ClassModel entry into the class table for CLASSNAME. */
private void makeNewStaticClass (String classname) {
ClassModel info = new ClassModel(classname, this);
@@ -695,280 +378,16 @@
if (mClassMap.get(classname) == null) {
mClassMap.put(classname, info);
} else {
- // <font> seems to come out twice when we parse the
- // schema, so this check doesn't really work.
-
- // throw new CompilationError("makeNewStaticClass: duplicate definition for " + classname);
+ throw new CompilationError("makeNewStaticClass: duplicate definition for static class " + classname);
}
-
}
- /**
- Walks the schema DOM searching for all <element> tags. For each named <element>, parse out the
- attribute declarations for it and add them to the in-core attribute-type table.
- <p>
- Definitions of elements can actually occur in the schema as either
- <pre>
- <element name="classname">
- or
- <element> <choice> ... ... <name>classname</name> </choice>
- </pre>
- <p>
-
- In the second case above, where a set of element names is declared, we
- set the attribute types once for each element (class) name.
-
- <p>
-
- The reason we need this method is that when a user defines a new class
- which has one or more attributes, we need to learn if each attribute has
- been declared by a superclass. That info is available for user-defined
- classes, in the mClassMap table, but it's not present for 'primitive'
- system types that are implicitly built into the base schema RNG file. So
- here's where we parse that info from the base schema.
-
- <p>
-
- The algorithm is as follows: buildReferenceTable() is called once at
- schema load time to initialize a table of <definition> elements by name,
- for efficient following of <ref> tags.
-
- <p>
-
- Make a pass descending from root:
- <ul>
- <li>When you get to an <element>, set that to the current class name, and keep adding attributes
- as you find them, following references. When you hit a "element", change class name.
- <p>
- <li>Mark elements as having been visited to avoid re-traversing them.
- </ul>
- */
-
- public void parseSchemaAttributes () {
- for (Iterator eltIter = schemaElementTable.iterator(); eltIter.hasNext();) {
- Element elt = (Element) eltIter.next();
-
- // We are starting on a known element tag; what class names does it define?
- List classnames = new ArrayList();
- Namespace ns = elt.getNamespace();
- String name = elt.getAttributeValue("name");
- // Is this tag of the form <element name="foo"> or
- // <element><choice><name>foo</name><name>bar</name>... ?
- if (name != null) {
- classnames.add(name);
- //System.err.println("parseSchemaAttributes("+name+")");
- makeNewStaticClass(name);
- } else if (name == null) {
- // This is a structure of the form
- // <element><choice><name>xxxx</name>...? Look for
- // immediate "choice" child, and look in it's "name"
- // children
- for (Iterator iter = elt.getChildren("choice", ns).iterator(); iter.hasNext();) {
- Element choice = (Element) iter.next();
- for (Iterator iter2 = choice.getChildren("name", ns).iterator(); iter2.hasNext();) {
- Element child = (Element) iter2.next();
- name = child.getTextTrim();
- // Add this name to the list of classnames that this element defines
- classnames.add(name);
- //System.err.println("parseSchemaAttributes("+name+")");
- makeNewStaticClass(name);
- }
- }
- }
- // OK we're defining some named element, lets follow the
- // tree down to the next element
- if (!classnames.isEmpty()) {
- //System.out.println("calling parseSchemaAttributes:: "+classnames);
- // Now descend the tree looking for <attribute> tags, and following <refs>
- for (Iterator iter = elt.getChildren().iterator(); iter.hasNext(); ) {
- Element child = (Element) iter.next();
- parseSchemaAttributes(child, classnames);
- }
- }
- }
- }
-
- /**
- This descends the schema DOM collecting <attribute> declaration
- info, but stops the descent wherever another <element> tag is
- found.
-
- <ref> tags are followed via the referenceTable map.
- */
-
- public void parseSchemaAttributes (Element elt, List classnames) {
- // Stop if we get to an <element>
- if (elt.getName().equals("element")) {
- return;
- } else if (elt.getName().equals("attribute")) {
- String attrName = elt.getAttributeValue("name");
- if (attrName == null) {
- //throw new RuntimeException("parsing choice attribute names in the schema is unimplemented");
- // There is actually one unnamed attribute, the "anyName" attribute for datacontent.
- } else {
- //System.err.print("parsing attribute "+classnames+"."+attrName);
-
- String rngTypeName;
-
- /*
- We will see one of these three types of attribute elements:
-
- <attribute name="width" a:defaultValue="800">
- <ref name="size"/>
- </attribute>
-
- <attribute name="title" a:defaultValue="Laszlo Presentation Server">
- <a:documentation>The string that is used in the browser window.</a:documentation>
- <data type="string" datatypeLibrary=""/>
- </attribute>
-
- <attribute name="fontstyle" a:defaultValue="">
- <a:documentation>The default font style for views in this application.</a:documentation>
- <choice>
- <value>bold</value>
- <value>italic</value>
- <value>bold italic</value>
- <value>plain</value>
- <value/>
- </choice>
- </attribute>
-
- // or this degenerate case from menuitem
- <attribute name="type">
- <value>separator</value>
- </attribute>
- */
- Namespace ns = elt.getNamespace();
-
- Element ref = elt.getChild("ref", ns);
- if (ref != null) {
- rngTypeName = ref.getAttributeValue("name");
- } else {
- Element data = elt.getChild("data", ns);
- if (data != null) {
- rngTypeName = data.getAttributeValue("type");
- } else {
- // If it's a <choice> or <value>, then it's a token
- rngTypeName = "token";
- }
- }
-
- // Set the attribute type
- Type attrType = (Type) sRNGtoLPSTypeMap.get(rngTypeName);
-
- if (attrType == null) {
- throw new RuntimeException(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="error parsing RNG schema: unknown attribute type name " + p[0] + " for attribute " + p[1]
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ViewSchema.class.getName(),"051018-864", new Object[] {rngTypeName, attrName})
- );
- }
-
- AttributeSpec attrspec = new AttributeSpec(attrName, attrType, null, null);
- //System.err.println(" ==> "+attrType);
-
- // Define this attribute on all classnames it applies to
- Iterator citer = classnames.iterator();
- while (citer.hasNext()) {
- String cname = (String) citer.next();
- //System.err.println("adding attribute type from schema: elt(class) "+cname+": "+attrName);
-
- // TODO: [2003-02-04 hqm] There is a special case
- // for <splash> elements; the schema contains a
- // special <view> declaration which differs from
- // the normal one, in that "x" and "y" attributes
- // are numeric constants rather than expressions.
-
- // To deal with this, we check if this element has
- // a parent of <splash> and if so we just discard
- // the attribute info. SplashCompiler will have a
- // special case to quote values for x and y
- // attributes.
-
- boolean ignore = false;
- // search up the parents for a "splash" element
- if (cname.equals("view")) {
- Element p = elt;
- while (p != null) {
- p = p.getParentElement();
- if (p == null) {
- break;
- }
- if ((p.getName().equals("element")) && ("splash".equals(p.getAttributeValue("name")))) {
- ignore = true;
- break;
- }
- }
- }
-
- // Look up the ClassModel in the class info table
- ClassModel classModel = getClassModel(cname);
- if (classModel == null) {
- throw new RuntimeException(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="parseSchemaAttributes: undefined class: " + p[0]
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ViewSchema.class.getName(),"051018-914", new Object[] {cname})
-);
- }
- if (ignore) {
- //System.err.println("ignoring splash child attribute "+attrName+" "+attrType);
- } else {
- classModel.attributeSpecs.put(attrName, attrspec);
- }
- }
- }
- } else if (elt.getName().equals("ref")) {
- // follow references
- String refName = elt.getAttributeValue("name");
- // The list of all elements that define this reference. A
- // reference can be split over several different elements
- // in the schema. See "viewContentElements" for example.
- List refElements = (List) referenceTable.get(refName);
- if (refElements == null || refElements.isEmpty()) {
- throw new RuntimeException(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="error parsing schema: could not find definition for reference " + p[0] + " on elt" + p[1]
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ViewSchema.class.getName(),"051018-938", new Object[] {refName, elt})
-);
- }
- Iterator riter = refElements.iterator();
- while (riter.hasNext()) {
- Element ref = (Element) riter.next();
- if (ref == null) {
- throw new RuntimeException(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="error parsing schema: could not find definition for reference " + p[0] + " on elt" + p[1]
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- ViewSchema.class.getName(),"051018-938", new Object[] {refName, elt})
-);
- }
- parseSchemaAttributes(ref, classnames);
- }
- }
-
- // Descend the tree
- for (Iterator iter = elt.getChildren().iterator(); iter.hasNext(); ) {
- Element child = (Element) iter.next();
- parseSchemaAttributes(child, classnames);
- }
- }
-
static Type getAttributeType(String attrName) {
return (Type) sAttributeTypes.get(attrName);
}
-
+
+
/**
* Returns a value representing the type of an attribute within an
* XML element. Unknown attributes have Expression type.
@@ -1051,7 +470,7 @@
return lzx;
}
- public void loadSchema() throws JDOMException, IOException {
+ public void loadSchema(CompilationEnvironment env) throws JDOMException, IOException {
String schemaPath = SCHEMA_PATH;
// Load the schema if it hasn't been.
// Reload it if it's been touched, to make it easier for developers.
@@ -1061,24 +480,70 @@
// race condition --- although since this doesn't happen in
// production code, this isn't critical
sCachedSchemaLastModified = new File(schemaPath).lastModified();
- // Without this, parsing fails when LPS is installed
- // in a directory with a space in the name.
- String schemaURI = "file:///" + schemaPath;
- sCachedSchemaDOM = new SAXBuilder().build(schemaURI);
+ sCachedSchemaDOM = new Parser().read(new File(schemaPath));
}
+
+ // This is the base class from which all classes derive unless otherwise
+ // specified. It has no attributes.
+ makeNewStaticClass("Instance");
+
schemaDOM = (Document) sCachedSchemaDOM.clone();
- buildReferenceTable(schemaDOM.getRootElement());
- // Parse out the attribute types of built-in defs
- parseSchemaAttributes();
+ Element docroot = schemaDOM.getRootElement();
+ ToplevelCompiler ec = (ToplevelCompiler) Compiler.getElementCompiler(docroot, env);
+ Set visited = new HashSet();
+ ec.updateSchema(docroot, this, visited);
+ /** From here on, user-defined classes must not use reserved javascript identifiers */
+ this.enforceValidIdentifier = true;
}
- public Document getSchemaDOM() throws JDOMException, IOException {
- if (schemaDOM == null) {
- loadSchema();
+
+
+ /** Check if a child element can legally be contained in a parent element.
+ This works with the class hierarchy as follows:
+
+ + Look up the ClassModel corresponding to the parentTag
+
+ + Check the containsElements table to see if child tag is in there
+
+ + If not, look up the ClassModel of the child tag, and follow up the chain
+ checking if that name is present in the table
+
+
+ + If not, ascend up the parent classmodel, and call canContainElement recursively
+
+ */
+ public boolean canContainElement (String parentTag, String childTag) {
+ // Get list of legally nestable tags
+ ClassModel parent = getClassModel(parentTag);
+
+ // TODO [hqm 2007-09]: CHECK FOR NULL HERE
+
+ Set tagset = parent.getContainsSet();
+ if (tagset.contains(childTag)) {
+ return true;
}
- return schemaDOM;
+ // check all superclasses of the childTag
+ ClassModel childclass = getClassModel(childTag);
+
+ // TODO [hqm 2007-09]: CHECK FOR NULL HERE
+
+ while (childclass != null) {
+ String superclassname = childclass.getSuperclassName();
+ if (tagset.contains(superclassname)) {
+ return true;
+ }
+ childclass = childclass.getSuperclassModel();
+ }
+
+ String parentSuperclassname = parent.getSuperclassName();
+ if (parentSuperclassname != null) {
+ return canContainElement(parentSuperclassname, childTag);
+ }
+
+ return false;
}
+
/** @return true if this element is an input text field */
boolean isInputTextElement(Element e) {
String classname = e.getName();
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema_Test.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema_Test.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema_Test.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
@@ -81,7 +81,7 @@
ViewSchema schema = new ViewSchema();
try {
- schema.loadSchema();
+ schema.loadSchema(new CompilationEnvironment());
} catch (JDOMException e) {
throw new RuntimeException(e.getMessage());
} catch (IOException e) {
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/i18n/laszlomessages.properties
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/i18n/laszlomessages.properties 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/i18n/laszlomessages.properties 2007-10-10 23:17:04 UTC (rev 6797)
@@ -66,9 +66,9 @@
org.openlaszlo.compiler.ClassCompiler.051018-77=The classname attribute, \"name\" must be a valid identifier for a class definition
org.openlaszlo.compiler.ClassCompiler.051018-89=The value for the 'extends' attribute on a class definition must be a valid identifier
org.openlaszlo.compiler.ClassCompiler.051018-106=undefined superclass {0} for class {1}
-org.openlaszlo.compiler.ClassCompiler.051018-131='name'' is a required attribute of <{0}> and must be a valid identifier
+org.openlaszlo.compiler.ClassCompiler.051018-131='name' is a required attribute of <{0}> and must be a valid identifier
org.openlaszlo.compiler.ClassCompiler.051018-160=In class {0} type ''{1}'', declared for attribute ''{2}'' is not a known data type.
-org.openlaszlo.compiler.ClassCompiler.051018-193='name'' is a required attribute of <{0}> and must be a valid identifier
+org.openlaszlo.compiler.ClassCompiler.051018-193='name' is a required attribute of <{0}> and must be a valid identifier
org.openlaszlo.compiler.ClassModel.051018-196=The class has a {0} attribute
org.openlaszlo.compiler.ClassModel.051018-205=The instance has a {0} attribute
org.openlaszlo.compiler.ClassModel.051018-214=An element within the instance has a {0} attribute
@@ -123,7 +123,7 @@
org.openlaszlo.compiler.NodeModel.051018-846={0} is deprecated. This method will be compiled as <method name=''{1}'' instead. Please update your sources.
org.openlaszlo.compiler.NodeModel.051018-922=an attribute or method named ''{0}'' already is defined on {1}
org.openlaszlo.compiler.NodeModel.051018-956=value is null in {0}
-org.openlaszlo.compiler.NodeModel.051018-1157='name'' is a required attribute of <{0}> and must be a valid identifier
+org.openlaszlo.compiler.NodeModel.051018-1157='name' is a required attribute of <{0}> and must be a valid identifier
org.openlaszlo.compiler.NodeModel.051018-1211=unknown attribute type: {0}
org.openlaszlo.compiler.NodeModel.051018-1227=In element ''{0}'' attribute ''{1}'' with type ''{2}'' is overriding parent class attribute with same name but different type: {3}
org.openlaszlo.compiler.NodeModel.051018-1388=Both the class and the instance or subclass define the {0}{1}
Copied: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/ASTVisitor.java (from rev 6789, openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/ASTVisitor.java)
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -76,23 +76,9 @@
// return instrsOut;
// }
-public class CodeGenerator implements Translator {
- Compiler.OptionMap options;
- InstructionCollector collector;
- String runtime;
- TranslationContext context;
+public class CodeGenerator extends CommonGenerator implements Translator {
- public Compiler.OptionMap getOptions() {
- return options;
- }
-
- public TranslationContext getContext() {
- return context;
- }
-
- public void setOptions(Compiler.OptionMap options) {
- this.options = options;
- this.runtime = ((String)options.get(Compiler.RUNTIME)).intern();
+ protected void setRuntime(String runtime) {
assert org.openlaszlo.compiler.Compiler.SWF_RUNTIMES.contains(runtime) : "unknown runtime " + runtime;
Instructions.setRuntime(runtime);
}
@@ -105,10 +91,6 @@
return program;
}
- public InstructionCollector getCollector() {
- return collector;
- }
-
public String newLabel(SimpleNode node) {
return newLabel(node, null);
}
@@ -117,41 +99,6 @@
return collector.newLabel((name != null ? name + ":" : "") + node.filename + ":" + node.beginLine);
}
- // Options that don't affect code generation. This is used to decide
- // what it's okay to cache across LFC build versions. It's okay if
- // it's too small.
- static Set NonCodeGenerationOptions = new HashSet();
- static {
- NonCodeGenerationOptions.add(Compiler.CACHE_COMPILES);
- NonCodeGenerationOptions.add(Compiler.INSTR_STATS);
- NonCodeGenerationOptions.add(Compiler.PRINT_COMPILER_OPTIONS);
- NonCodeGenerationOptions.add(Compiler.PRINT_CONSTRAINTS);
- NonCodeGenerationOptions.add(Compiler.PROFILE_COMPILER);
- NonCodeGenerationOptions.add(Compiler.PROGRESS);
- NonCodeGenerationOptions.add(Compiler.RESOLVER);
- // These affect the default settings for the options above, but
- // do not themselves make a difference.
- NonCodeGenerationOptions.add(Compiler.DEBUG);
- }
-
- static class LessHalfAssedHashMap extends HashMap {
- LessHalfAssedHashMap() {
- super();
- }
-
- Object get(int key) {
- return get(new Integer(key));
- }
-
- Object put(int key, Object value) {
- return put (new Integer(key), value);
- }
-
- Object put(int key, int value) {
- return put (new Integer(key), new Integer(value));
- }
- }
-
static LessHalfAssedHashMap XfixInstrs = new LessHalfAssedHashMap();
static {
XfixInstrs.put(ParserConstants.INCR, Instructions.Increment);
@@ -377,29 +324,6 @@
}
}
-// TODO: [2006-01-17 ptw] Remove some day
-// public java.lang.reflect.Method getVisitor(SimpleNode node, Class[] signature) {
-// // trim the module name, and the initial "AST"
-// String name;
-// if (node instanceof ASTIdentifier) {
-// name = "Identifier";
-// } else {
-// name = node.getClass().getName();
-// name = name.substring(name.lastIndexOf(".")+4, name.length());
-// }
-// name = "visit" + name;
-// try {
-// return getClass().getMethod(name, signature);
-// } catch (NoSuchMethodException e) {
-// // java.lang.reflect.Method[] methods = getClass().getMethods();
-// System.err.println(e.toString());
-// // for (int i = 0; i < methods.length; i++) {
-// // System.err.println(methods[i].toString());
-// // }
-// return null;
-// }
-// }
-
void translateInternal(SimpleNode program, String cpass, boolean top) {
assert program instanceof ASTProgram;
this.context = new TranslationContext(ASTProgram.class, null);
@@ -430,38 +354,18 @@
prevStatLine = statLine;
}
- Boolean evaluateCompileTimeConditional(SimpleNode node) {
- Object value = null;
- if (node instanceof ASTIdentifier) {
- String name = ((ASTIdentifier)node).getName();
- Map constants = (Map)options.get(Compiler.COMPILE_TIME_CONSTANTS);
- if (constants != null) {
- if (constants.containsKey(name)) {
- value = constants.get(name);
-// if (value != null) {
-// System.err.print( (new Compiler.ParseTreePrinter()).visit(node) + ": " + value + "(" + value.getClass() + ")");
-// }
- }
- }
- }
-// if (value != null) {
-// System.err.println(" => " + value + "(" + value.getClass() + ")");
-// }
- return (Boolean)value;
+ public SimpleNode visitProgram(SimpleNode node, SimpleNode[] directives, String cpass) {
+ return visitProgram(node, directives, cpass, false);
}
- public void visitProgram(SimpleNode node, SimpleNode[] directives, String cpass) {
- visitProgram(node, directives, cpass, false);
- }
-
- public void visitProgram(SimpleNode node, SimpleNode[] directives, String cpass, boolean top) {
+ public SimpleNode visitProgram(SimpleNode node, SimpleNode[] directives, String cpass, boolean top) {
// cpass is "b"oth, 1, or 2
assert "b".equals(cpass) || "1".equals(cpass) || "2".equals(cpass) : "bad pass: " + cpass;
if ("b".equals(cpass)) {
visitProgram(node, directives, "1", top);
// Everything is done in one pass for now.
// visitProgram(node, directives, "2", top);
- return;
+ return node;
}
if ("1".equals(cpass) && top &&
// Here this means 'compiling the LFC' we only want to emit
@@ -520,7 +424,7 @@
throw new UnimplementedError("unimplemented: #include", directive);
}
String userfname = (String)((ASTLiteral)directive.get(0)).getValue();
- compileInclude(userfname, cpass);
+ translateInclude(userfname, cpass);
continue;
} else if (directive instanceof ASTPragmaDirective) {
visitPragmaDirective(directive, directive.getChildren());
@@ -545,121 +449,27 @@
}
}
showStats(node);
+ return node;
}
- static class ParseResult {
- SimpleNode parse;
- boolean hasIncludes;
-
- ParseResult(SimpleNode parse, boolean hasIncludes) {
- this.parse = parse;
- this.hasIncludes = hasIncludes;
- }
-
- public boolean equals(Object o) {
- if (o != null && o instanceof ParseResult) {
- ParseResult pr = (ParseResult)o;
- return parse.equals(pr.parse) && hasIncludes == pr.hasIncludes;
- }
- return false;
- }
+ public SimpleNode visitTryStatement(SimpleNode node, SimpleNode[] children) {
+ throw new CompilerImplementationError("cannot handle try statement " + node, node);
}
- static java.util.regex.Pattern includePattern =
- java.util.regex.Pattern.compile(".*#\\s*include\\s*\".*", java.util.regex.Pattern.DOTALL);
-
- ParseResult parseFile(File file, String userfname, String source) {
- if (Compiler.CachedParses == null) {
- Compiler.CachedParses = new ScriptCompilerCache();
- }
- String sourceKey = file.getAbsolutePath();
- String sourceChecksum = "" + file.lastModified(); // source;
- ParseResult entry = (ParseResult)Compiler.CachedParses.get(sourceKey, sourceChecksum);
- if ((entry == null) || options.getBoolean(Compiler.VALIDATE_CACHES)) {
- boolean hasIncludes = includePattern.matcher(source).matches();
- if (options.getBoolean(Compiler.PROGRESS)) {
- // Even though code generation is re-run
- // for every file, just print this for
- // files that are re-parsed, to indicate
- // what's being changed.
- System.err.println("Compiling " + userfname + "...");
- }
- SimpleNode program = (new Compiler.Parser()).parse(source);
- // Always cache the parse tree, since this
- // helps even when the compilation is only one
- // once. This is because each pass processes
- // the #include again.
- ParseResult realentry = new ParseResult(program, hasIncludes);
- Compiler.CachedParses.put(sourceKey, sourceChecksum, realentry);
- if ((entry != null) && options.getBoolean(Compiler.VALIDATE_CACHES)) {
- if (! realentry.equals(entry)) {
- System.err.println("Bad parse cache for " + sourceKey + ": " + entry + " != " + realentry);
- }
- }
- entry = realentry;
- }
- return entry;
+ public SimpleNode visitThrowStatement(SimpleNode node, SimpleNode[] children) {
+ throw new CompilerImplementationError("cannot handle throw statement " + node, node);
}
- private String mapToString(Map map) {
- StringBuffer result = new StringBuffer();
- result.append("{");
- TreeMap sorted = new TreeMap(map);
- for (Iterator i = sorted.keySet().iterator(); i.hasNext(); ) {
- Object key = i.next();
- result.append(key);
- result.append(": ");
- result.append(sorted.get(key));
- if (i.hasNext()) {
- result.append(", ");
- }
- }
- result.append("}");
- return result.toString();
- }
+ SimpleNode translateInclude(String userfname, String cpass) {
- String getCodeGenerationOptionsKey(List ignore) {
- Map options = new HashMap(this.options);
- options.keySet().removeAll(NonCodeGenerationOptions);
- if (ignore != null) {
- options.keySet().removeAll(ignore);
- }
- return mapToString(options);
- }
-
- void compileInclude(String userfname, String cpass) {
if (Compiler.CachedInstructions == null) {
Compiler.CachedInstructions = new ScriptCompilerCache();
}
- String fname = userfname;
- File file;
- String source;
+
+ File file = includeNameToFile(userfname);
+ String source = includeFileToSourceString(file, userfname);
+
try {
- if (options.containsKey(Compiler.RESOLVER)) {
- fname = ((lzsc.Resolver)options.get(Compiler.RESOLVER)).resolve(userfname);
- }
- file = new File(new File(fname).getCanonicalPath());
- FileInputStream stream = new FileInputStream(file);
- try {
- int n = stream.available();
- byte[] b = new byte[n];
- stream.read(b);
- source = "#file " + userfname + "\n#line 1\n" + new String(b, "UTF-8");
- }
- finally {
- stream.close();
- }
- }
- catch (FileNotFoundException e) {
- throw new CompilerError("error reading include: " + e);
- }
- catch (UnsupportedEncodingException e) {
- throw new CompilerError("error reading include: " + e);
- }
- catch (IOException e) {
- throw new CompilerError("error reading include: " + e);
- }
- try {
String optionsKey =
getCodeGenerationOptionsKey(Collections.singletonList(
// The constant pool isn't cached, so it doesn't affect code
@@ -710,192 +520,10 @@
System.err.println("while compiling " + file.getAbsolutePath());
throw e;
}
+ return null; // dummy return is ultimately ignored
}
- public void visitPragmaDirective(SimpleNode node, SimpleNode[] children) {
- String key = (String)((ASTLiteral)children[0]).getValue();
- String value = "true";
- int equals = key.indexOf('=');
- if (equals > 0) {
- value = key.substring(equals + 1);
- key = key.substring(0, equals);
- }
- if ("false".equalsIgnoreCase(value) ||
- "true".equalsIgnoreCase(value)) {
- options.putBoolean(key, value);
- } else {
- options.put(key, value);
- }
- }
-
- // Flatten nested StatementList structures
- private List flatten(SimpleNode[] src) {
- List dst = new ArrayList();
- for (int i = 0; i < src.length; i++) {
- SimpleNode node = src[i];
- if (node instanceof ASTStatementList) {
- dst.addAll(flatten(node.getChildren()));
- } else {
- dst.add(node);
- }
- }
- return dst;
- }
-
- void visitClassDefinition(SimpleNode node, SimpleNode[] children) {
- ASTIdentifier classortrait = (ASTIdentifier)children[0];
- ASTIdentifier classname = (ASTIdentifier)children[1];
- String classnameString = classname.getName();
- SimpleNode superclass = children[2];
- SimpleNode traits = children[3];
- SimpleNode traitsandsuper;
- if (traits instanceof ASTEmptyExpression) {
- if (superclass instanceof ASTEmptyExpression) {
- traitsandsuper = new ASTLiteral(null);
- } else {
- traitsandsuper = superclass;
- }
- } else {
- traitsandsuper = new ASTArrayLiteral(0);
- traitsandsuper.setChildren(traits.getChildren());
- if (! (superclass instanceof ASTEmptyExpression)) {
- traitsandsuper.set(traitsandsuper.size(), superclass);
- }
- }
-
- SimpleNode[] dirs = (SimpleNode [])(Arrays.asList(children).subList(4, children.length).toArray(new SimpleNode[0]));
- List props = new ArrayList();
- List classProps = new ArrayList();
- List stmts = new ArrayList();
- translateClassDirectivesBlock(dirs, classnameString, props, classProps, stmts);
-
- SimpleNode instanceProperties;
- if (props.isEmpty()) {
- instanceProperties = new ASTLiteral(null);
- } else {
- instanceProperties = new ASTObjectLiteral(0);
- instanceProperties.setChildren((SimpleNode[])(props.toArray(new SimpleNode[0])));
- }
- SimpleNode classProperties;
- if (classProps.isEmpty()) {
- classProperties = new ASTLiteral(null);
- } else {
- classProperties = new ASTObjectLiteral(0);
- classProperties.setChildren((SimpleNode[])(classProps.toArray(new SimpleNode[0])));
- }
-
- Map map = new HashMap();
- String xtor = "class".equals(classortrait.getName())?"Class":"Trait";
- map.put("_1", classname);
- map.put("_2", traitsandsuper);
- map.put("_3", instanceProperties);
- map.put("_4", classProperties);
- SimpleNode newNode = (new Compiler.Parser()).substitute(xtor + ".make(" +
- ScriptCompiler.quote(classnameString) +
- ", _2, _3, _4);",
- map);
- SimpleNode varNode = new ASTVariableDeclaration(0);
- varNode.set(0, classname);
- varNode.set(1, newNode);
- SimpleNode replNode = varNode;
-
- if (! stmts.isEmpty()) {
- SimpleNode statements = new ASTStatementList(0);
- statements.setChildren((SimpleNode[])(stmts.toArray(new SimpleNode[0])));
- map.put("_5", statements);
- SimpleNode stmtNode = (new Compiler.Parser()).substitute("(function () { with(_1) with(_1.prototype) { _5 }})()",
- map);
- replNode = new ASTStatementList(0);
- replNode.set(0, varNode);
- replNode.set(1, stmtNode);
- }
- visitStatement(replNode);
- }
-
- public void translateClassDirectivesBlock(SimpleNode[] dirs, String classnameString, List props, List classProps, List stmts) {
- dirs = (SimpleNode[])(flatten(dirs).toArray(new SimpleNode[0]));
-
- // Scope #pragma directives to block
- Compiler.OptionMap savedOptions = options;
- try {
- options = options.copy();
- for (int i = 0; i < dirs.length; i++) {
- SimpleNode n = dirs[i];
- List p = props;
- if (n instanceof ASTClassProperty) {
- n = n.get(0);
- p = classProps;
- }
- if (n instanceof ASTFunctionDeclaration) {
- SimpleNode[] c = n.getChildren();
- assert c.length == 3;
- p.add(c[0]);
- SimpleNode funexpr = new ASTFunctionExpression(0);
- funexpr.setBeginLocation(n.filename, n.beginLine, n.beginColumn);
- funexpr.setChildren(c);
- p.add(funexpr);
- } else if (n instanceof ASTVariableStatement) {
- SimpleNode [] c = n.getChildren();
- for (int j = 0, len = c.length; j < len; j++) {
- SimpleNode v = c[j];
- assert v instanceof ASTVariableDeclaration : v.getClass();
- p.add(v.get(0));
- if (v.getChildren().length > 1) {
- p.add(v.get(1));
- } else {
- p.add(new ASTLiteral(null));
- }
- }
- } else if (n instanceof ASTClassDirectiveBlock) {
- translateClassDirectivesBlock(n.getChildren(), classnameString, props, classProps, stmts);
- } else if (n instanceof ASTClassIfDirective) {
- Boolean value = evaluateCompileTimeConditional(n.get(0));
- if (value == null) {
- stmts.add(n);
- } else if (value.booleanValue()) {
- SimpleNode clause = n.get(1);
- translateClassDirectivesBlock(clause.getChildren(), classnameString, props, classProps, stmts);
- } else if (n.size() > 2) {
- SimpleNode clause = n.get(2);
- translateClassDirectivesBlock(clause.getChildren(), classnameString, props, classProps, stmts);
- }
- } else if (n instanceof ASTPragmaDirective) {
- visitPragmaDirective(n, n.getChildren());
- } else {
- stmts.add(n);
- }
- }
- }
- finally {
- options = savedOptions;
- }
- }
-
- public void visitStatementList(SimpleNode node, SimpleNode[] stmts) {
- int i = 0;
- // ensure dynamic extent of #pragma in a block
- Compiler.OptionMap prevOptions = options;
- Compiler.OptionMap newOptions = options.copy();
- // TODO: [2003-04-15 ptw] bind context slot macro
- try {
- options = newOptions;
- while (i < stmts.length) {
- SimpleNode stmt = stmts[i];
- visitStatement(stmt);
- i += 1;
- }
- }
- finally {
- options = prevOptions;
- }
- }
-
- // for function prefix/suffix parsing
- public void visitDirectiveBlock(SimpleNode node, SimpleNode[] children) {
- visitStatementList(node, children);
- }
-
- public void visitFunctionDeclaration(SimpleNode node, SimpleNode[] ast) {
+ public SimpleNode visitFunctionDeclaration(SimpleNode node, SimpleNode[] ast) {
// Inner functions are handled by translateFunction
if (ASTProgram.class.equals(context.type)) {
assert (! options.getBoolean(Compiler.CONSTRAINT_FUNCTION));
@@ -912,167 +540,14 @@
collector.emit(Instructions.LABEL.make(block));
}
}
+ return node;
}
//
// Statements
//
- public void visitStatement(SimpleNode node) {
- visitStatement(node, node.getChildren());
- }
-
- public void visitStatement(SimpleNode node, SimpleNode[] children) {
- /* This function, unlike the other statement visitors, can be
- applied to any statement node, so it dispatches based on the
- node's class. */
- assert context instanceof TranslationContext;
- showStats(node);
-// TODO: [2006-01-17 ptw] Remove some day
-// java.lang.reflect.Method fn =
-// getVisitor(node,
-// new Class[] { SimpleNode.class, SimpleNode[].class });
-// // Expression visitors have a different signature
-// if (fn == null) {
-// visitExpression(node, false);
-// return;
-// }
-// try {
-// if ("visitStatement".equals(fn.getName())) {
-// // an empty statement, introduced by an extra ";", has no children
-// if (children.length > 0) {
-// System.err.println("visiting: " + node + " -> " + children[0] + ", " + children[0].getChildren());
-// fn.invoke(this, new Object[] {children[0], children[0].getChildren()});
-// return;
-// }
-// } else {
-// fn.invoke(this, new Object[] {node, children});
-// }
-// }
-// catch (IllegalAccessException e) {
-// assert false : e.toString();
-// }
-// catch (IllegalArgumentException e) {
-// assert false : e.toString();
-// }
-// catch (java.lang.reflect.InvocationTargetException e) {
-// System.err.println(e.getTargetException());
-// e.printStackTrace(System.err);
-// }
-// assert false : "can't happen";
-
- // Are we doing OO programming yet?
- if (node instanceof ASTPragmaDirective) {
- visitPragmaDirective(node, children);
- return;
- }
- if (node instanceof ASTClassDefinition) {
- visitClassDefinition(node, children);
- return;
- }
- if (node instanceof ASTStatementList) {
- visitStatementList(node, children);
- return;
- }
- if (node instanceof ASTDirectiveBlock) {
- visitDirectiveBlock(node, children);
- return;
- }
- if (node instanceof ASTFunctionDeclaration) {
- visitFunctionDeclaration(node, children);
- return;
- }
- if (node instanceof ASTStatement) {
- // an empty statement, introduced by an extra ";", has no children
- if (children.length > 0) {
- visitStatement(children[0], children[0].getChildren());
- }
- return;
- }
- if (node instanceof ASTLabeledStatement) {
- visitLabeledStatement(node, children);
- return;
- }
- if (node instanceof ASTVariableDeclaration) {
- visitVariableDeclaration(node, children);
- return;
- }
- if (node instanceof ASTVariableStatement) {
- visitVariableStatement(node, children);
- return;
- }
- if (node instanceof ASTIfStatement) {
- visitIfStatement(node, children);
- return;
- }
- if (node instanceof ASTIfDirective) {
- visitIfDirective(node, children);
- return;
- }
- if (node instanceof ASTWhileStatement) {
- visitWhileStatement(node, children);
- return;
- }
- if (node instanceof ASTDoWhileStatement) {
- visitDoWhileStatement(node, children);
- return;
- }
- if (node instanceof ASTForStatement) {
- visitForStatement(node, children);
- return;
- }
- if (node instanceof ASTForVarStatement) {
- visitForVarStatement(node, children);
- return;
- }
- if (node instanceof ASTForInStatement) {
- visitForInStatement(node, children);
- return;
- }
- if (node instanceof ASTForVarInStatement) {
- visitForVarInStatement(node, children);
- return;
- }
- if (node instanceof ASTContinueStatement) {
- visitContinueStatement(node, children);
- return;
- }
- if (node instanceof ASTBreakStatement) {
- visitBreakStatement(node, children);
- return;
- }
- if (node instanceof ASTReturnStatement) {
- visitReturnStatement(node, children);
- return;
- }
- if (node instanceof ASTWithStatement) {
- visitWithStatement(node, children);
- return;
- }
- if (node instanceof ASTSwitchStatement) {
- visitSwitchStatement(node, children);
- return;
- }
- // Not a statement, must be an expression
- visitExpression(node, false);
- return;
- }
-
- public void visitLabeledStatement(SimpleNode node, SimpleNode[] children) {
- ASTIdentifier name = (ASTIdentifier)children[0];
- SimpleNode stmt = children[1];
- // TODO: [2003-04-15 ptw] bind context slot macro
- try {
- context = new TranslationContext(ASTLabeledStatement.class, context, name.getName());
- // TODO: [2002 ows] throw semantic error for duplicate label
- visitStatement(stmt);
- }
- finally {
- context = context.parent;
- }
- }
-
- public void visitVariableDeclaration(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitVariableDeclaration(SimpleNode node, SimpleNode[] children) {
ASTIdentifier id = (ASTIdentifier)children[0];
if (children.length > 1) {
SimpleNode initValue = children[1];
@@ -1084,16 +559,10 @@
Reference ref = translateReference(id).preset();
ref.declare();
}
+ return node;
}
- public void visitVariableStatement(SimpleNode node, SimpleNode[] children) {
- for (int i = 0, len = children.length; i < len; i++) {
- SimpleNode child = children[i];
- visitStatement(child);
- }
- }
-
- public void visitIfStatement(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitIfStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode test = children[0];
SimpleNode a = children[1];
SimpleNode b = (children.length > 2) ? children[2] : null;
@@ -1121,14 +590,11 @@
new Integer(0)};
translateControlStructure(node, code);
}
+ return node;
}
// for function prefix/suffix parsing
- public void visitIfDirective(SimpleNode node, SimpleNode[] children) {
- visitIfStatement(node, children);
- }
-
- public void visitWhileStatement(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitWhileStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode test = children[0];
SimpleNode body = children[1];
// TODO: [2003-04-15 ptw] bind context slot macro
@@ -1145,13 +611,14 @@
Instructions.BRANCH.make(continueLabel),
Instructions.LABEL.make(breakLabel)};
translateControlStructure(node, code);
+ return node;
}
finally {
context = context.parent;
}
}
- public void visitDoWhileStatement(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitDoWhileStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode body = children[0];
SimpleNode test = children[1];
// TODO: [2003-04-15 ptw] bind context slot macro
@@ -1167,21 +634,22 @@
Instructions.BranchIfTrue.make(continueLabel),
Instructions.LABEL.make(breakLabel)};
translateControlStructure(node, code);
+ return node;
}
finally {
context = context.parent;
}
}
- public void visitForStatement(SimpleNode node, SimpleNode[] children) {
- translateForStatement(node, children);
+ public SimpleNode visitForStatement(SimpleNode node, SimpleNode[] children) {
+ return translateForStatement(node, children);
}
- public void visitForVarStatement(SimpleNode node, SimpleNode[] children) {
- translateForStatement(node, children);
+ public SimpleNode visitForVarStatement(SimpleNode node, SimpleNode[] children) {
+ return translateForStatement(node, children);
}
- void translateForStatement(SimpleNode node, SimpleNode[] children) {
+ SimpleNode translateForStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode init = children[0];
SimpleNode test = children[1];
SimpleNode step = children[2];
@@ -1207,6 +675,7 @@
Instructions.BRANCH.make(0),
Instructions.LABEL.make(breakLabel)};
translateControlStructure(node, code);
+ return node;
}
finally {
context = context.parent;
@@ -1214,25 +683,14 @@
}
}
- public void visitForInStatement(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitForInStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode var = children[0];
SimpleNode obj = children[1];
SimpleNode body = children[2];
translateForInStatement(node, var, Instructions.SetVariable, obj, body);
+ return node;
}
- public void visitForVarInStatement(SimpleNode node, SimpleNode[] children) {
- SimpleNode var = children[0];
- // SimpleNode _ = children[1];
- SimpleNode obj = children[2];
- SimpleNode body = children[3];
- if (options.getBoolean(Compiler.ACTIVATION_OBJECT)) {
- translateForInStatement(node, var, Instructions.SetVariable, obj, body);
- return;
- }
- translateForInStatement(node, var, Instructions.VarEquals, obj, body);
- }
-
// This works because keys are always strings, and enumerate pushes
// a null before all the keys
public void unwindEnumeration(SimpleNode node) {
@@ -1244,7 +702,7 @@
collector.emit(Instructions.BranchIfTrue.make(label));
}
- void translateForInStatement(SimpleNode node, SimpleNode var,
+ SimpleNode translateForInStatement(SimpleNode node, SimpleNode var,
Instruction varset, SimpleNode obj,
SimpleNode body) {
// TODO: [2003-04-15 ptw] bind context slot macro
@@ -1275,13 +733,14 @@
Instructions.BRANCH.make(continueLabel),
Instructions.LABEL.make(breakLabel)};
translateControlStructure(node, moreCode);
+ return node;
}
finally {
context = context.parent;
}
}
- void translateAbruptCompletion(SimpleNode node, String type, ASTIdentifier label) {
+ SimpleNode translateAbruptCompletion(SimpleNode node, String type, ASTIdentifier label) {
TranslationContext targetContext =
context.findLabeledContext(label != null ? label.getName() : null);
if (targetContext == null) {
@@ -1305,19 +764,10 @@
targetContext.emitBreakPreamble(node, this);
}
collector.emit(Instructions.BRANCH.make(targetLabel));
+ return node;
}
- public void visitContinueStatement(SimpleNode node, SimpleNode[] children) {
- SimpleNode label = children.length > 0 ? children[0] : null;
- translateAbruptCompletion(node, "continue", (ASTIdentifier)label);
- }
-
- public void visitBreakStatement(SimpleNode node, SimpleNode[] children) {
- SimpleNode label = children.length > 0 ? children[0] : null;
- translateAbruptCompletion(node, "break", (ASTIdentifier)label);
- }
-
- public void visitReturnStatement(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitReturnStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode value = children[0];
TranslationContext c = context;
while ((! c.isFunctionBoundary())) {
@@ -1333,19 +783,20 @@
} else {
collector.emit(Instructions.RETURN);
}
+ return node;
}
- public void visitWithStatement(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitWithStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode expr = children[0];
SimpleNode stmt = children[1];
Object[] code = {new ForValue(expr),
Instructions.WITH.make(new Integer(0)),
stmt,
new Integer(0)};
- translateControlStructure(node, code);
+ return translateControlStructure(node, code);
}
- public void visitSwitchStatement(SimpleNode node, SimpleNode[] children) {
+ public SimpleNode visitSwitchStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode expr = children[0];
LinkedHashMap tests = new LinkedHashMap();
LinkedHashMap targets = new LinkedHashMap();
@@ -1388,16 +839,20 @@
collector.emit(Instructions.EQUALS);
collector.emit(Instructions.BranchIfTrue.make(l));
}
- collector.emit(Instructions.POP);
- collector.emit(Instructions.BRANCH.make((defaultLabel != null) ? defaultLabel : finalLabel));
+ if (defaultLabel != null) {
+ collector.emit(Instructions.BRANCH.make(defaultLabel));
+ }
+ else {
+ collector.emit(Instructions.POP);
+ collector.emit(Instructions.BRANCH.make(finalLabel));
+ }
String nextLabel = null;
for (Iterator i = targets.keySet().iterator(); i.hasNext(); ) {
String l = (String)i.next();
SimpleNode stmt = (SimpleNode)targets.get(l);
collector.emit(Instructions.LABEL.make(l));
- if (! l.equals(defaultLabel)) {
- collector.emit(Instructions.POP);
- } else {
+ collector.emit(Instructions.POP);
+ if (l.equals(defaultLabel)) {
defaultLabel = null;
}
if (nextLabel != null) {
@@ -1411,19 +866,21 @@
collector.emit(Instructions.BRANCH.make(nextLabel));
}
}
- // Handle fall-though in last clause
- if (nextLabel != null) {
- collector.emit(Instructions.LABEL.make(nextLabel));
- }
// Handle empty default as last clause
if (defaultLabel != null) {
collector.emit(Instructions.LABEL.make(defaultLabel));
+ collector.emit(Instructions.POP);
}
+ // Handle fall-though in last clause
+ if (nextLabel != null) {
+ collector.emit(Instructions.LABEL.make(nextLabel));
+ }
collector.emit(Instructions.LABEL.make(finalLabel));
}
finally {
context = context.parent;
}
+ return node;
}
static class LabelMap {
@@ -1476,7 +933,7 @@
// - Other nodes are compiled as statements
// - all other instructions are emitted as is
// Ensure context targets are not ambiguous
- void translateControlStructure(SimpleNode node, Object[] seq) {
+ SimpleNode translateControlStructure(SimpleNode node, Object[] seq) {
for (Iterator i = context.targets.values().iterator(); i.hasNext(); ) {
Object v = i.next();
assert (! (v instanceof Integer)) : "Ambiguous context target " + v;
@@ -1499,6 +956,7 @@
visitStatement(n, n.getChildren());
}
}
+ return node;
}
//
@@ -1517,162 +975,53 @@
name.endsWith("Reference");
}
- public boolean visitExpression(SimpleNode node) {
+ public SimpleNode visitExpression(SimpleNode node) {
return visitExpression(node, true);
}
/* This function, unlike the other expression visitors, can be
applied to any expression node, so it dispatches based on the
node's class. */
- public boolean visitExpression(SimpleNode node, boolean isReferenced) {
- assert isExpressionType(node) : "" + node + " is not an expression";
-// TODO: [2006-01-17 ptw] Remove some day
-// java.lang.reflect.Method fn =
-// getVisitor(node,
-// new Class[] { SimpleNode.class, boolean.class, SimpleNode[].class });
-// assert fn != null : "missing visitor for " + node;
-// showStats(node);
-// if (fn != null) {
-// try {
-// boolean suppressed =
-// ((Boolean)fn.invoke(this,
-// new Object[] {node,
-// Boolean.valueOf(isReferenced),
-// node.getChildren()})).booleanValue();
-// if ((! isReferenced) && (! suppressed)) {
-// collector.emit(Instructions.POP);
-// suppressed = true;
-// }
-// return suppressed;
-// }
-// catch (IllegalAccessException e) {
-// assert false : e.toString();
-// }
-// catch (IllegalArgumentException e) {
-// assert false : e.toString();
-// }
-// catch (java.lang.reflect.InvocationTargetException e) {
-// System.err.println(e.getTargetException());
-// e.printStackTrace(System.err);
-// }
-// assert false : "can't happen";
-// return true;
-// } else {
-// throw new CompilerImplementationError("unknown expression " + node, node);
-// }
+ public SimpleNode visitExpression(SimpleNode node, boolean isReferenced) {
+ assert isExpressionType(node) : "" + node + ": " + (new Compiler.ParseTreePrinter()).visit(node) + " is not an expression";
- // Are we doing OO programming yet?
- SimpleNode[] children = node.getChildren();
- boolean suppressed = (! isReferenced);
-// TODO: [2006-01-17 ptw] Remove some day
-// if (node instanceof ASTExpression) {
-// suppressed = visitExpression(node, isReferenced, children);
-// }
- if (node instanceof ASTIdentifier) {
- suppressed = visitIdentifier(node, isReferenced, children);
+ if (this.debugVisit) {
+ System.err.println("visitExpression: " + node.getClass());
}
- else if (node instanceof ASTLiteral) {
- suppressed = visitLiteral(node, isReferenced, children);
- }
- else if (node instanceof ASTExpressionList) {
- suppressed = visitExpressionList(node, isReferenced, children);
- }
- else if (node instanceof ASTEmptyExpression) {
- suppressed = visitEmptyExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTThisReference) {
- suppressed = visitThisReference(node, isReferenced, children);
- }
- else if (node instanceof ASTArrayLiteral) {
- suppressed = visitArrayLiteral(node, isReferenced, children);
- }
- else if (node instanceof ASTObjectLiteral) {
- suppressed = visitObjectLiteral(node, isReferenced, children);
- }
- else if (node instanceof ASTFunctionExpression) {
- suppressed = visitFunctionExpression(node, isReferenced, children);
- }
-// TODO: [2006-01-17 ptw] Remove some day
-// else if (node instanceof ASTCallParameters) {
-// suppressed = visitCallParameters(node, isReferenced, children);
-// }
- else if (node instanceof ASTFunctionCallParameters) {
- suppressed = visitFunctionCallParameters(node, isReferenced, children);
- }
- else if (node instanceof ASTPropertyIdentifierReference) {
- suppressed = visitPropertyIdentifierReference(node, isReferenced, children);
- }
- else if (node instanceof ASTPropertyValueReference) {
- suppressed = visitPropertyValueReference(node, isReferenced, children);
- }
- else if (node instanceof ASTCallExpression) {
- suppressed = visitCallExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTSuperCallExpression) {
- suppressed = visitSuperCallExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTNewExpression) {
- suppressed = visitNewExpression(node, isReferenced, children);
- }
-// TODO: [2006-01-17 ptw] Remove some day
-// else if (node instanceof ASTPrefixExpression) {
-// suppressed = visitPrefixExpression(node, isReferenced, children);
-// }
- else if (node instanceof ASTPostfixExpression) {
- suppressed = visitPostfixExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTUnaryExpression) {
- suppressed = visitUnaryExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTBinaryExpressionSequence) {
- suppressed = visitBinaryExpressionSequence(node, isReferenced, children);
- }
-// TODO: [2006-01-17 ptw] Remove some day
-// else if (node instanceof ASTBinaryExpression) {
-// suppressed = visitBinaryExpression(node, isReferenced, children);
-// }
- else if (node instanceof ASTAndExpressionSequence) {
- suppressed = visitAndExpressionSequence(node, isReferenced, children);
- }
- else if (node instanceof ASTOrExpressionSequence) {
- suppressed = visitOrExpressionSequence(node, isReferenced, children);
- }
- else if (node instanceof ASTConditionalExpression) {
- suppressed = visitConditionalExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTAssignmentExpression) {
- suppressed = visitAssignmentExpression(node, isReferenced, children);
- }
- else {
- throw new CompilerImplementationError("unknown expression " + node, node);
- }
- if ((! isReferenced) && (! suppressed)) {
+
+ SimpleNode newNode = dispatchExpression(node, isReferenced);
+
+ if ((! isReferenced) && (newNode != null)) {
collector.emit(Instructions.POP);
- suppressed = true;
+ newNode = null;
}
- return suppressed;
+ if (this.debugVisit) {
+ if (! newNode.equals(node)) {
+ System.err.println("expression: " + node + " -> " + newNode);
+ }
+ }
+ return newNode;
}
- public boolean visitIdentifier(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitIdentifier(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
// Side-effect free expressions can be suppressed if not referenced
// Following is disabled by default for regression testing.
// TODO: [2003-02-17 ows] enable this
if ((! isReferenced) && options.getBoolean(Compiler.ELIMINATE_DEAD_EXPRESSIONS)) {
- return true;
+ return null;
}
if ("_root".equals(((ASTIdentifier)node).getName()) && (! options.getBoolean(Compiler.ALLOW_ROOT))) {
throw new SemanticError("Illegal variable name: " + node, node);
}
- translateReference(node).get();
- return false;
+ return translateReference(node).get().node;
}
- public boolean visitLiteral(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitLiteral(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
// Side-effect free expressions can be suppressed if not referenced
// Following is disabled by default for regression testing.
// TODO: [2003-02-17 ows] enable this
if ((! isReferenced) && options.getBoolean(Compiler.ELIMINATE_DEAD_EXPRESSIONS)) {
- return true;
+ return null;
}
Object value = translateLiteralNode(node);
if (value instanceof String) {
@@ -1705,14 +1054,14 @@
while (--nChunks > 0) {
collector.emit(Instructions.ADD);
}
- return false;
+ return node;
}
}
collector.push(value);
- return false;
+ return node;
}
- public boolean visitExpressionList(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitExpressionList(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
// all but last expression will not be referenced, so
// visitExpression will pop it. If the list is not referenced,
// then the last will be popped too
@@ -1723,30 +1072,29 @@
return visitExpression(children[len], isReferenced);
}
- public boolean visitEmptyExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitEmptyExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
// Side-effect free expressions can be suppressed if not referenced
if ((! isReferenced)) {
- return true;
+ return null;
}
collector.push(Values.Undefined);
- return false;
+ return node;
}
- public boolean visitThisReference(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitThisReference(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
// Side-effect free expressions can be suppressed if not referenced
if ((! isReferenced)) {
- return true;
+ return null;
}
- translateReference(node).get();
- return false;
+ return translateReference(node).get().node;
}
- public boolean visitArrayLiteral(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitArrayLiteral(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
boolean suppressed = (! isReferenced);
// Wrong evaluation order
int len = 0;
for (int i = children.length - 1; i >= 0; i--) {
- if (! visitExpression(children[i], isReferenced)) {
+ if (visitExpression(children[i], isReferenced) != null) {
len++;
suppressed = false;
}
@@ -1754,11 +1102,13 @@
if (! suppressed) {
collector.push(len);
collector.emit(Instructions.InitArray);
+ return node;
}
- return suppressed;
+ else
+ return null;
}
- public boolean visitObjectLiteral(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitObjectLiteral(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
boolean isKey = true;
for (int i = 0, len = children.length; i < len; i++) {
SimpleNode item = children[i];
@@ -1771,10 +1121,10 @@
}
collector.push(children.length / 2);
collector.emit(Instructions.InitObject);
- return false;
+ return node;
}
- public boolean visitFunctionExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitFunctionExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
Compiler.OptionMap savedOptions = options;
try {
options = options.copy();
@@ -1795,26 +1145,20 @@
finally {
options = savedOptions;
}
- return false;
+ return node;
}
- public boolean visitCallParameters(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitFunctionCallParameters(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
// FIXME: [2002-01-07 ows] This evaluates function call
// parameters in the wrong order.
for (int i = children.length - 1; i >= 0; i--) {
visitExpression(children[i]);
}
collector.push(children.length);
- return false;
+ return node;
}
- // TODO: [2002-01-06 ows] Factor this and the visitCallParameters;
- // why are they both necessary?
- public boolean visitFunctionCallParameters(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- return visitCallParameters(node, isReferenced, children);
- }
-
- public boolean visitPropertyIdentifierReference(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitPropertyIdentifierReference(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
// TODO: [2002-12-12 ows] consolidate with the code in for..in
// TODO: [2002-12-12 ows] find out how this generalizes to a.b.c
// TODO: [2002-12-18 ows] enabling this saves 2K of the LFC, but
@@ -1823,43 +1167,16 @@
if (false && children[0] instanceof ASTIdentifier && children[1] instanceof ASTIdentifier) {
collector.push(((ASTIdentifier)children[0]).getName() + ":" + ((ASTIdentifier)children[1]).getName());
collector.emit(Instructions.GetVariable);
- return false;
+ return node;
}
- translateReference(node).get();
- return false;
+ return translateReference(node).get().node;
}
- public boolean visitPropertyValueReference(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- translateReference(node).get();
- return false;
+ public SimpleNode visitPropertyValueReference(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ return translateReference(node).get().node;
}
- private static SimpleNode parseFragment(String code) {
- if (code.equals("\"\"") || code == null) {
- code = "";
- }
- code =
- "{" +
- "\n#pragma 'warnUndefinedReferences=false'\n" +
- "\n#file CodeGenerator.parseFragment\n#line 0\n" +
- code +
- "}";
- // Extract the statement list from the program
- try {
- return (new Compiler.Parser()).parse(code).get(0);
- } catch (ParseException e) {
- System.err.println("while compiling " + code);
- throw e;
- }
- }
-
- // TODO: [2007-08-20 ptw] Replace with Java 1.5 UUID
- private Random rand = new Random();
- private Integer UUID() {
- return new Integer(rand.nextInt(Integer.MAX_VALUE));
- }
-
- public boolean visitCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode fnexpr = children[0];
SimpleNode[] args = children[1].getChildren();
int arglen = args.length;
@@ -1873,7 +1190,7 @@
// in scope is the global variable.
if ("getTimer".equals(name) && arglen == 0) {
collector.emit(Instructions.GetTimer);
- return false;
+ return node;
}
if (options.getBoolean(Compiler.FLASH_COMPILER_COMPATABILITY)) {
if ("trace".equals(name)) {
@@ -1886,7 +1203,7 @@
collector.push(1);
collector.push("trace");
collector.emit(Instructions.CallFunction);
- return false; // was true for trace instruction?
+ return node; // was true for trace instruction?
} else if (options.get(Compiler.COMPILE_TRACE) == "debug") {
visitExpression(args[0]);
collector.push("_root");
@@ -1895,10 +1212,10 @@
collector.emit(Instructions.GetMember);
collector.push("write");
collector.emit(Instructions.CallMethod);
- return false;
+ return node;
}
// else fall through
- return true;
+ return null;
}
if ("fscommand".equals(name) && arglen == 2) {
assert args[0] instanceof ASTLiteral;
@@ -1907,27 +1224,27 @@
collector.push("FSCommand:" + v);
visitExpression(args[1]);
collector.emit(Instructions.GetURL2.make(0));
- return true;
+ return null;
}
if ("FSCommand2".equals(name)) {
- visitCallParameters(node, isReferenced, args);
+ visitFunctionCallParameters(node, isReferenced, args);
collector.emit(Instructions.FSCommand2);
- return true;
+ return null;
}
if ("removeMovieClip".equals(name) && arglen == 1) {
visitExpression(args[0]);
collector.emit(Instructions.RemoveClip);
- return true; // no return value
+ return null; // no return value
}
if ("ord".equals(name) && arglen ==1) {
visitExpression(args[0]);
collector.emit(Instructions.ORD);
- return false;
+ return node;
}
if ("targetPath".equals(name) && arglen == 1) {
visitExpression(args[0]);
collector.emit(Instructions.TargetPath);
- return false;
+ return node;
}
// TODO: [2002-11-30 ows] The following clause needs to
// swap the arguments. To preserve evaluation order,
@@ -1938,12 +1255,12 @@
if ("getVersion".equals(name) && arglen == 0) {
collector.push("/:$version");
collector.emit(Instructions.GetVariable);
- return false;
+ return node;
}
if ("eval".equals(name) && arglen == 1) {
visitExpression(args[0]);
collector.emit(Instructions.GetVariable);
- return false;
+ return node;
}
}
}
@@ -2025,7 +1342,7 @@
SimpleNode newStmts = new ASTStatementList(0);
newStmts.setChildren((SimpleNode[])newBody.toArray(new SimpleNode[0]));
visitStatement(newStmts);
- return true;
+ return null;
}
}
@@ -2045,7 +1362,7 @@
}
// Okay, it is not going to be transformed. Just do it!
- visitCallParameters(node, isReferenced, args);
+ visitFunctionCallParameters(node, isReferenced, args);
boolean isref = translateReferenceForCall(fnexpr, true, node);
if (isref) {
if (fnexpr instanceof ASTPropertyIdentifierReference ||
@@ -2059,52 +1376,19 @@
collector.push(Values.Undefined);
collector.emit(Instructions.CallMethod);
}
- return false;
+ return node;
}
- public boolean visitSuperCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- SimpleNode fname = children[0];
- SimpleNode callapply = children[1];
- SimpleNode args = children[2];
- String name;
- String ca = null;
- String pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(this, _2)";
- if (fname instanceof ASTEmptyExpression) {
- name = "constructor";
- } else {
- name = ((ASTIdentifier)fname).getName();
- }
- if (callapply instanceof ASTIdentifier) {
- ca = ((ASTIdentifier)callapply).getName();
- }
- // FIXME: [2005-03-09 ptw] (LPP-98 "Compiler source-source
- // transformations should be in separate phase") This should be
- // in a phase before the compiler, so that register analysis
- // sees it. [Or this should be eliminated altogether and we
- // should use swf7's real super call, but that will mean we
- // have to solve the __proto__ vs. super in constructor
- // problem.]
- Map map = new HashMap();
- map.put("_1", new ASTLiteral(name));
- map.put("_2", new Compiler.Splice(args.getChildren()));
- if (ca == null) {
- ;
- } else if ("call".equals(ca)) {
- pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(_2)";
- } else if ("apply".equals(ca)) {
- pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).apply(_2)";
- } else {
- assert false: "Unhandled super call " + ca;
- }
- SimpleNode n = (new Compiler.Parser()).substitute(pattern, map);
+ public SimpleNode visitSuperCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ SimpleNode n = translateSuperCallExpression(node, isReferenced, children);
visitCallExpression(n, isReferenced, n.getChildren());
- return false;
+ return n;
}
- public boolean visitNewExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitNewExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode ref = children[0];
SimpleNode[] args = children[1].getChildren();
- visitCallParameters(node, isReferenced, args);
+ visitFunctionCallParameters(node, isReferenced, args);
boolean isref = translateReferenceForCall(ref, true, node);
if (isref) {
if (ref instanceof ASTPropertyIdentifierReference ||
@@ -2118,22 +1402,22 @@
collector.push(Values.Undefined);
collector.emit(Instructions.NewMethod);
}
- return false;
+ return node;
}
- public boolean visitPrefixExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitPrefixExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode op = children[0];
SimpleNode ref = children[1];
return translateXfixExpression(ref, op, true, isReferenced);
}
- public boolean visitPostfixExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitPostfixExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode ref = children[0];
SimpleNode op = children[1];
return translateXfixExpression(ref, op, false, isReferenced);
}
- boolean translateXfixExpression(SimpleNode refnode, SimpleNode opnode, boolean isPrefix, boolean isReferenced) {
+ SimpleNode translateXfixExpression(SimpleNode refnode, SimpleNode opnode, boolean isPrefix, boolean isReferenced) {
Instruction op = (Instruction)XfixInstrs.get(((ASTOperator)opnode).getOperator());
if (isReferenced) {
if (! isPrefix) {
@@ -2149,17 +1433,17 @@
ref.set();
collector.push(Values.Register(0));
}
- return false;
+ return refnode;
} else {
// Not referenced, no value left on stack
Reference ref = translateReference(refnode, 2).preset().get();
collector.emit(op);
ref.set();
- return true;
+ return null;
}
}
- public boolean visitUnaryExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitUnaryExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
int op = ((ASTOperator)children[0]).getOperator();
// I guess the parser doesn't know the difference
if (ParserConstants.INCR == (op) || ParserConstants.DECR == (op)) {
@@ -2172,7 +1456,7 @@
if (v instanceof Number) {
// This works because swf represents all numbers as doubles
collector.push(new Double((- ((Number)v).doubleValue())));
- return false;
+ return node;
}
}
// special-cased, since this operates on a ref rather than a value
@@ -2183,13 +1467,13 @@
} else {
collector.emit(Instructions.DELETE2);
}
- return false;
+ return node;
}
if (options.getBoolean(Compiler.FLASH_COMPILER_COMPATABILITY) && ParserConstants.MINUS == (op)) {
collector.push(0);
visitExpression(arg);
collector.emit(Instructions.SUBTRACT);
- return false;
+ return node;
}
// special-case typeof(variable) to not emit undefined-variable
// checks so there is a warning-free way to check for undefined
@@ -2211,46 +1495,34 @@
for (int i = 0, len = instrs.length; i < len; i++) {
collector.emit(instrs[i]);
}
- return false;
+ return node;
}
- public boolean visitBinaryExpressionSequence(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitBinaryExpressionSequence(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode a = children[0];
SimpleNode op = children[1];
SimpleNode b = children[2];
return translateBinaryExpression(node, isReferenced, (ASTOperator)op, a, b);
}
- public boolean visitBinaryExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitBinaryExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode op = children[0];
SimpleNode a = children[1];
SimpleNode b = children[2];
return translateBinaryExpression(node, isReferenced, (ASTOperator)op, a, b);
}
- boolean translateBinaryExpression(SimpleNode node, boolean isReferenced, ASTOperator op, SimpleNode a, SimpleNode b) {
+ SimpleNode translateBinaryExpression(SimpleNode node, boolean isReferenced, ASTOperator op, SimpleNode a, SimpleNode b) {
visitExpression(a);
visitExpression(b);
Instruction[] instrs = (Instruction[])BinopInstrs.get(op.getOperator());
for (int i = 0, len = instrs.length; i < len; i++) {
collector.emit(instrs[i]);
}
- return false;
+ return node;
}
- public boolean visitAndExpressionSequence(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- SimpleNode a = children[0];
- SimpleNode b = children[1];
- return translateAndOrExpression(node, true, a, b);
- }
-
- public boolean visitOrExpressionSequence(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- SimpleNode a = children[0];
- SimpleNode b = children[1];
- return translateAndOrExpression(node, false, a, b);
- }
-
- boolean translateAndOrExpression(SimpleNode node, boolean isand, SimpleNode a, SimpleNode b) {
+ SimpleNode translateAndOrExpression(SimpleNode node, boolean isand, SimpleNode a, SimpleNode b) {
visitExpression(a);
collector.emit(Instructions.DUP);
if (isand) {
@@ -2261,10 +1533,10 @@
collector.emit(Instructions.POP);
visitExpression(b);
collector.emit(Instructions.LABEL.make(label));
- return false;
+ return node;
}
- public boolean visitConditionalExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitConditionalExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode test = children[0];
SimpleNode a = children[1];
SimpleNode b = children[2];
@@ -2277,10 +1549,10 @@
collector.emit(Instructions.LABEL.make(l1));
visitExpression(a);
collector.emit(Instructions.LABEL.make(l2));
- return false;
+ return node;
}
- public boolean visitAssignmentExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
+ public SimpleNode visitAssignmentExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode lhs = children[0];
ASTOperator opnode = (ASTOperator)children[1];
SimpleNode rhs = children[2];
@@ -2305,9 +1577,9 @@
if (isReferenced) {
collector.push(Values.Register(0));
// Python version always returned true, but that is clearly wrong
- return false;
+ return node;
}
- return true;
+ return null;
}
// useName => declaration not expression
@@ -2336,16 +1608,6 @@
}
}
- static class DoubleCollator implements Comparator {
- public boolean equals(Object o1, Object o2) {
- return ((Double)o1).equals((Double)o2);
- }
-
- public int compare(Object o1, Object o2) {
- return ((Double)o1).compareTo((Double)o2);
- }
- }
-
// Internal helper function for above
// useName => declaration not expression
SimpleNode translateFunctionInternal(SimpleNode node, boolean useName, SimpleNode[] children) {
@@ -2357,6 +1619,7 @@
String functionName = null;
SimpleNode params;
SimpleNode stmts;
+ SimpleNode depExpr = null;
if (children.length == 3) {
ASTIdentifier functionNameIdentifier = (ASTIdentifier)children[0];
params = children[1];
@@ -2410,6 +1673,34 @@
break;
}
}
+ if (options.getBoolean(Compiler.CONSTRAINT_FUNCTION)) {
+// assert (functionName != null);
+ if (ReferenceCollector.DebugConstraints) {
+ System.err.println("stmts: " + stmts);
+ }
+ // Find dependencies.
+ //
+ // Compute this before any transformations on the function body.
+ //
+ // The job of a constraint function is to compute a value.
+ // The current implementation inlines the call to set the
+ // attribute that the constraint is attached to, within the
+ // constraint function it Walking the statements of
+ // the function will process the expression that computes
+ // the value; it will also process the call to
+ // setAttribute, but ReferenceCollector knows to ignore
+ //
+ ReferenceCollector dependencies = new ReferenceCollector(options.getBoolean(Compiler.COMPUTE_METAREFERENCES));
+ // Only visit original body
+ for (Iterator i = stmtList.iterator(); i.hasNext(); ) {
+ SimpleNode stmt = (SimpleNode)i.next();
+ dependencies.visit(stmt);
+ }
+ depExpr = dependencies.computeReferences(userFunctionName);
+ if (options.getBoolean(Compiler.PRINT_CONSTRAINTS)) {
+ (new Compiler.ParseTreePrinter()).print(depExpr);
+ }
+ }
List prefix = new ArrayList();
List postfix = new ArrayList();
if (options.getBoolean(Compiler.DEBUG_BACKTRACE)) {
@@ -2802,30 +2093,7 @@
}
}
if (options.getBoolean(Compiler.CONSTRAINT_FUNCTION)) {
-// assert (functionName != null);
- if (ReferenceCollector.DebugConstraints) {
- System.err.println("stmts: " + stmts);
- }
- // Find dependencies.
- //
- // The job of a constraint function is to compute a value.
- // The current implementation inlines the call to set the
- // attribute that the constraint is attached to, within the
- // constraint function it Walking the statements of
- // the function will process the expression that computes
- // the value; it will also process the call to
- // setAttribute, but ReferenceCollector knows to ignore
- //
- ReferenceCollector dependencies = new ReferenceCollector(options.getBoolean(Compiler.COMPUTE_METAREFERENCES));
- for (Iterator i = stmtList.iterator(); i.hasNext(); ) {
- SimpleNode stmt = (SimpleNode)i.next();
- dependencies.visit(stmt);
- }
- SimpleNode expr = dependencies.computeReferences(userFunctionName);
- if (options.getBoolean(Compiler.PRINT_CONSTRAINTS)) {
- (new Compiler.ParseTreePrinter()).print(expr);
- }
- return expr;
+ return depExpr;
}
return null;
}
Copied: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java (from rev 6789, openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java)
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -399,6 +399,7 @@
public static String FLASH_COMPILER_COMPATABILITY = "flashCompilerCompatability";
public static String GENERATE_FUNCTION_2 = "generateFunction2";
public static String GENERATE_FUNCTION_2_FOR_LZX = "generateFunction2ForLZX";
+ public static String GENERATE_PREDICTABLE_TEMPS = "generatePredictableTemps";
public static String INCLUDES = "processIncludes";
public static String INSTR_STATS = "instrStats";
public static String LINK = "link";
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -20,24 +20,9 @@
import org.openlaszlo.sc.parser.*;
-public class JavascriptGenerator implements Translator {
- Compiler.OptionMap options = new Compiler.OptionMap();
- StringBuffer collector = new StringBuffer();
- String runtime;
- TranslationContext context = null;
- boolean debugVisit = false;
+public class JavascriptGenerator extends CommonGenerator implements Translator {
- public Compiler.OptionMap getOptions() {
- return options;
- }
-
- public TranslationContext getContext() {
- return context;
- }
-
- public void setOptions(Compiler.OptionMap options) {
- this.options = options;
- this.runtime = ((String)options.get(Compiler.RUNTIME)).intern();
+ protected void setRuntime(String runtiem) {
assert org.openlaszlo.compiler.Compiler.SCRIPT_RUNTIMES.contains(runtime) : "unknown runtime " + runtime;
}
@@ -63,15 +48,7 @@
}
}
- public InstructionCollector getCollector() {
- return null;
- }
-
public String newLabel(SimpleNode node) {
- return newLabel(node, null);
- }
-
- public String newLabel(SimpleNode node, String name) {
throw new CompilerImplementationError("nyi: newLabel");
}
@@ -85,24 +62,6 @@
return prefix + tempNum++;
}
- static class LessHalfAssedHashMap extends HashMap {
- LessHalfAssedHashMap() {
- super();
- }
-
- Object get(int key) {
- return get(new Integer(key));
- }
-
- Object put(int key, Object value) {
- return put (new Integer(key), value);
- }
-
- Object put(int key, int value) {
- return put (new Integer(key), new Integer(value));
- }
- }
-
static LessHalfAssedHashMap XfixInstrs = new LessHalfAssedHashMap();
static {
XfixInstrs.put(ParserConstants.INCR, "+");
@@ -124,25 +83,6 @@
AssignOpTable.put(ParserConstants.RUNSIGNEDSHIFTASSIGN, ">>>");
};
- private static SimpleNode parseFragment(String code) {
- if (code.equals("\"\"") || code == null) {
- code = "";
- }
- code =
- "{" +
- "\n#pragma 'warnUndefinedReferences=false'\n" +
- "\n#file JavascriptGenerator.parseFragment\n#line 0\n" +
- code +
- "}";
- // Extract the statement list from the program
- try {
- return (new Compiler.Parser()).parse(code).get(0);
- } catch (ParseException e) {
- System.err.println("while compiling " + code);
- throw e;
- }
- }
-
// Code to meter a function call. If name is set, uses that,
// otherwise uses arguments.callee._dbg_name. This code must be appended
// to the function prefix or suffix, as appropriate.
@@ -244,24 +184,8 @@
}
}
- Boolean evaluateCompileTimeConditional(SimpleNode node) {
- Object value = null;
- if (node instanceof ASTIdentifier) {
- String name = ((ASTIdentifier)node).getName();
- Map constants = (Map)options.get(Compiler.COMPILE_TIME_CONSTANTS);
- if (constants != null) {
- if (constants.containsKey(name)) {
- value = constants.get(name);
-// if (value != null) {
-// + ": " + value + "(" + value.getClass() + ")");
-// }
- }
- }
- }
-// if (value != null) {
-// System.err.println(" => " + value + "(" + value.getClass() + ")");
-// }
- return (Boolean)value;
+ void showStats(SimpleNode node) {
+ // No implementation to collect stats for Javascript
}
public SimpleNode visitProgram(SimpleNode node, SimpleNode[] directives, String cpass) {
@@ -373,139 +297,20 @@
directives[index] = newDirective;
}
}
+ showStats(node);
return node;
}
- static class ParseResult {
- SimpleNode parse;
- boolean hasIncludes;
-
- ParseResult(SimpleNode parse, boolean hasIncludes) {
- this.parse = parse;
- this.hasIncludes = hasIncludes;
- }
-
- public boolean equals(Object o) {
- if (o != null && o instanceof ParseResult) {
- ParseResult pr = (ParseResult)o;
- return parse.equals(pr.parse) && hasIncludes == pr.hasIncludes;
- }
- return false;
- }
- }
-
- static java.util.regex.Pattern includePattern =
- java.util.regex.Pattern.compile(".*#\\s*include\\s*\".*", java.util.regex.Pattern.DOTALL);
-
- ParseResult parseFile(File file, String userfname, String source) {
- if (Compiler.CachedParses == null) {
- Compiler.CachedParses = new ScriptCompilerCache();
- }
- String sourceKey = file.getAbsolutePath();
- String sourceChecksum = "" + file.lastModified(); // source;
- ParseResult entry = (ParseResult)Compiler.CachedParses.get(sourceKey, sourceChecksum);
- if ((entry == null) || options.getBoolean(Compiler.VALIDATE_CACHES)) {
- boolean hasIncludes = includePattern.matcher(source).matches();
- if (options.getBoolean(Compiler.PROGRESS)) {
- // Even though code generation is re-run
- // for every file, just print this for
- // files that are re-parsed, to indicate
- // what's being changed.
- System.err.println("Compiling " + userfname + "...");
- }
- SimpleNode program = (new Compiler.Parser()).parse(source);
- // Always cache the parse tree, since this
- // helps even when the compilation is only one
- // once. This is because each pass processes
- // the #include again.
- ParseResult realentry = new ParseResult(program, hasIncludes);
- Compiler.CachedParses.put(sourceKey, sourceChecksum, realentry);
- if ((entry != null) && options.getBoolean(Compiler.VALIDATE_CACHES)) {
- if (! realentry.equals(entry)) {
- System.err.println("Bad parse cache for " + sourceKey + ": " + entry + " != " + realentry);
- }
- }
- entry = realentry;
- }
- return entry;
- }
-
- private String mapToString(Map map) {
- StringBuffer result = new StringBuffer();
- result.append("{");
- TreeMap sorted = new TreeMap(map);
- for (Iterator i = sorted.keySet().iterator(); i.hasNext(); ) {
- Object key = i.next();
- result.append(key);
- result.append(": ");
- result.append(sorted.get(key));
- if (i.hasNext()) {
- result.append(", ");
- }
- }
- result.append("}");
- return result.toString();
- }
-
- // Options that don't affect code generation. This is used to decide
- // what it's okay to cache across LFC build versions. It's okay if
- // it's too small.
- static Set NonCodeGenerationOptions = new HashSet();
- static {
- NonCodeGenerationOptions.add(Compiler.CACHE_COMPILES);
- NonCodeGenerationOptions.add(Compiler.INSTR_STATS);
- NonCodeGenerationOptions.add(Compiler.PRINT_COMPILER_OPTIONS);
- NonCodeGenerationOptions.add(Compiler.PRINT_CONSTRAINTS);
- NonCodeGenerationOptions.add(Compiler.PROFILE_COMPILER);
- NonCodeGenerationOptions.add(Compiler.PROGRESS);
- NonCodeGenerationOptions.add(Compiler.RESOLVER);
- // These affect the default settings for the options above, but
- // do not themselves make a difference.
- NonCodeGenerationOptions.add(Compiler.DEBUG);
- }
-
- String getCodeGenerationOptionsKey(List ignore) {
- Map options = new HashMap(this.options);
- options.keySet().removeAll(NonCodeGenerationOptions);
- if (ignore != null) {
- options.keySet().removeAll(ignore);
- }
- return mapToString(options);
- }
-
SimpleNode translateInclude(String userfname, String cpass) {
+
if (Compiler.CachedInstructions == null) {
Compiler.CachedInstructions = new ScriptCompilerCache();
}
- String fname = userfname;
- File file;
- String source;
+
+ File file = includeNameToFile(userfname);
+ String source = includeFileToSourceString(file, userfname);
+
try {
- if (options.containsKey(Compiler.RESOLVER)) {
- fname = ((lzsc.Resolver)options.get(Compiler.RESOLVER)).resolve(userfname);
- }
- file = new File(new File(fname).getCanonicalPath());
- FileInputStream stream = new FileInputStream(file);
- try {
- int n = stream.available();
- byte[] b = new byte[n];
- stream.read(b);
- source = "#file " + userfname + "\n#line 1\n" + new String(b, "UTF-8");
- }
- finally {
- stream.close();
- }
- }
- catch (FileNotFoundException e) {
- throw new CompilerError("error reading include: " + e);
- }
- catch (UnsupportedEncodingException e) {
- throw new CompilerError("error reading include: " + e);
- }
- catch (IOException e) {
- throw new CompilerError("error reading include: " + e);
- }
- try {
String optionsKey =
getCodeGenerationOptionsKey(Collections.singletonList(
// The constant pool isn't cached, so it doesn't affect code
@@ -548,193 +353,6 @@
}
}
- public SimpleNode visitPragmaDirective(SimpleNode node, SimpleNode[] children) {
- String key = (String)((ASTLiteral)children[0]).getValue();
- String value = "true";
- int equals = key.indexOf('=');
- if (equals > 0) {
- value = key.substring(equals + 1);
- key = key.substring(0, equals);
- }
- if ("false".equalsIgnoreCase(value) ||
- "true".equalsIgnoreCase(value)) {
- options.putBoolean(key, value);
- } else {
- options.put(key, value);
- }
- return new ASTEmptyExpression(0);
- }
-
- // Flatten nested StatementList structures
- private List flatten(SimpleNode[] src) {
- List dst = new ArrayList();
- for (int i = 0; i < src.length; i++) {
- SimpleNode node = src[i];
- if (node instanceof ASTStatementList) {
- dst.addAll(flatten(node.getChildren()));
- } else {
- dst.add(node);
- }
- }
- return dst;
- }
-
- public SimpleNode visitClassDefinition(SimpleNode node, SimpleNode[] children) {
-// System.err.println("enter visitClassDefinition: " + (new Compiler.ParseTreePrinter()).visit(node));
- ASTIdentifier classortrait = (ASTIdentifier)children[0];
- ASTIdentifier classname = (ASTIdentifier)children[1];
- String classnameString = classname.getName();
- SimpleNode superclass = children[2];
- SimpleNode traits = children[3];
- SimpleNode traitsandsuper;
- if (traits instanceof ASTEmptyExpression) {
- if (superclass instanceof ASTEmptyExpression) {
- traitsandsuper = new ASTLiteral(null);
- } else {
- traitsandsuper = superclass;
- }
- } else {
- traitsandsuper = new ASTArrayLiteral(0);
- traitsandsuper.setChildren(traits.getChildren());
- if (! (superclass instanceof ASTEmptyExpression)) {
- traitsandsuper.set(traitsandsuper.size(), superclass);
- }
- }
-
- SimpleNode[] dirs = (SimpleNode [])(Arrays.asList(children).subList(4, children.length).toArray(new SimpleNode[0]));
- List props = new ArrayList();
- List classProps = new ArrayList();
- List stmts = new ArrayList();
- translateClassDirectivesBlock(dirs, classnameString, props, classProps, stmts);
-
- SimpleNode instanceProperties;
- if (props.isEmpty()) {
- instanceProperties = new ASTLiteral(null);
- } else {
- instanceProperties = new ASTObjectLiteral(0);
- instanceProperties.setChildren((SimpleNode[])(props.toArray(new SimpleNode[0])));
- }
- SimpleNode classProperties;
- if (classProps.isEmpty()) {
- classProperties = new ASTLiteral(null);
- } else {
- classProperties = new ASTObjectLiteral(0);
- classProperties.setChildren((SimpleNode[])(classProps.toArray(new SimpleNode[0])));
- }
-
- Map map = new HashMap();
- String xtor = "class".equals(classortrait.getName())?"Class":"Trait";
- map.put("_1", classname);
- map.put("_2", traitsandsuper);
- map.put("_3", instanceProperties);
- map.put("_4", classProperties);
- SimpleNode newNode = (new Compiler.Parser()).substitute(xtor + ".make(" +
- ScriptCompiler.quote(classnameString) +
- ", _2, _3, _4);",
- map);
- SimpleNode varNode = new ASTVariableDeclaration(0);
- varNode.set(0, classname);
- varNode.set(1, newNode);
- SimpleNode replNode = varNode;
-
- if (! stmts.isEmpty()) {
- SimpleNode statements = new ASTStatementList(0);
- statements.setChildren((SimpleNode[])(stmts.toArray(new SimpleNode[0])));
- map.put("_5", statements);
- SimpleNode stmtNode = (new Compiler.Parser()).substitute("(function () { with(_1) with(_1.prototype) { _5 }})()",
- map);
- replNode = new ASTStatementList(0);
- replNode.set(0, varNode);
- replNode.set(1, stmtNode);
- }
-// System.err.println("exit visitClassDefinition: " + (new Compiler.ParseTreePrinter()).visit(replNode));
- return visitStatement(replNode);
- }
-
- public void translateClassDirectivesBlock(SimpleNode[] dirs, String classnameString, List props, List classProps, List stmts) {
- dirs = (SimpleNode[])(flatten(dirs).toArray(new SimpleNode[0]));
-
- // Scope #pragma directives to block
- Compiler.OptionMap savedOptions = options;
- try {
- options = options.copy();
- for (int i = 0; i < dirs.length; i++) {
- SimpleNode n = dirs[i];
- List p = props;
- if (n instanceof ASTClassProperty) {
- n = n.get(0);
- p = classProps;
- }
- if (n instanceof ASTFunctionDeclaration) {
- SimpleNode[] c = n.getChildren();
- assert c.length == 3;
- p.add(c[0]);
- SimpleNode funexpr = new ASTFunctionExpression(0);
- funexpr.setBeginLocation(n.filename, n.beginLine, n.beginColumn);
- funexpr.setChildren(c);
- p.add(funexpr);
- } else if (n instanceof ASTVariableStatement) {
- SimpleNode [] c = n.getChildren();
- for (int j = 0, len = c.length; j < len; j++) {
- SimpleNode v = c[j];
- assert v instanceof ASTVariableDeclaration : v.getClass();
- p.add(v.get(0));
- if (v.getChildren().length > 1) {
- p.add(v.get(1));
- } else {
- p.add(new ASTLiteral(null));
- }
- }
- } else if (n instanceof ASTClassDirectiveBlock) {
- translateClassDirectivesBlock(n.getChildren(), classnameString, props, classProps, stmts);
- } else if (n instanceof ASTClassIfDirective) {
- Boolean value = evaluateCompileTimeConditional(n.get(0));
- if (value == null) {
- stmts.add(n);
- } else if (value.booleanValue()) {
- SimpleNode clause = n.get(1);
- translateClassDirectivesBlock(clause.getChildren(), classnameString, props, classProps, stmts);
- } else if (n.size() > 2) {
- SimpleNode clause = n.get(2);
- translateClassDirectivesBlock(clause.getChildren(), classnameString, props, classProps, stmts);
- }
- } else if (n instanceof ASTPragmaDirective) {
- visitPragmaDirective(n, n.getChildren());
- } else {
- stmts.add(n);
- }
- }
- }
- finally {
- options = savedOptions;
- }
- }
-
- public SimpleNode visitStatementList(SimpleNode node, SimpleNode[] stmts) {
- int i = 0;
- // ensure dynamic extent of #pragma in a block
- Compiler.OptionMap prevOptions = options;
- Compiler.OptionMap newOptions = options.copy();
- // TODO: [2003-04-15 ptw] bind context slot macro
- try {
- options = newOptions;
- while (i < stmts.length) {
- SimpleNode stmt = stmts[i];
- stmts[i] = visitStatement(stmt);
- i += 1;
- }
- }
- finally {
- options = prevOptions;
- }
- return node;
- }
-
- // for function prefix/suffix parsing
- public SimpleNode visitDirectiveBlock(SimpleNode node, SimpleNode[] children) {
- return visitStatementList(node, children);
- }
-
public SimpleNode visitFunctionDeclaration(SimpleNode node, SimpleNode[] ast) {
// Inner functions are handled by translateFunction
if (context.findFunctionContext() != null) {
@@ -757,132 +375,6 @@
// Statements
//
- public SimpleNode visitStatement(SimpleNode node) {
- return visitStatement(node, node.getChildren());
- }
-
- public SimpleNode visitStatement(SimpleNode node, SimpleNode[] children) {
- /* This function, unlike the other statement visitors, can be
- applied to any statement node, so it dispatches based on the
- node's class. */
- assert context instanceof TranslationContext;
- SimpleNode newNode = node;
-
- if (this.debugVisit) {
- System.err.println("visitStatement: " + node.getClass());
- }
-
- // Are we doing OO programming yet?
- if (node instanceof ASTPragmaDirective) {
- newNode = visitPragmaDirective(node, children);
- }
- else if (node instanceof ASTClassDefinition) {
- newNode = visitClassDefinition(node, children);
- }
- else if (node instanceof ASTStatementList) {
- newNode = visitStatementList(node, children);
- }
- else if (node instanceof ASTDirectiveBlock) {
- newNode = visitDirectiveBlock(node, children);
- }
- else if (node instanceof ASTFunctionDeclaration) {
- newNode = visitFunctionDeclaration(node, children);
- }
- else if (node instanceof ASTStatement) {
- // an empty statement, introduced by an extra ";", has no children
- if (children.length > 0) {
- children[0] = visitStatement(children[0], children[0].getChildren());
- } else {
- newNode = new ASTEmptyExpression(0);
- }
- }
- else if (node instanceof ASTLabeledStatement) {
- newNode = visitLabeledStatement(node, children);
- }
- else if (node instanceof ASTVariableDeclaration) {
- newNode = visitVariableDeclaration(node, children);
- }
- else if (node instanceof ASTVariableStatement) {
- newNode = visitVariableStatement(node, children);
- }
- else if (node instanceof ASTIfStatement) {
- newNode = visitIfStatement(node, children);
- }
- else if (node instanceof ASTIfDirective) {
- newNode = visitIfDirective(node, children);
- }
- else if (node instanceof ASTWhileStatement) {
- newNode = visitWhileStatement(node, children);
- }
- else if (node instanceof ASTDoWhileStatement) {
- newNode = visitDoWhileStatement(node, children);
- }
- else if (node instanceof ASTForStatement) {
- newNode = visitForStatement(node, children);
- }
- else if (node instanceof ASTForVarStatement) {
- newNode = visitForVarStatement(node, children);
- }
- else if (node instanceof ASTForInStatement) {
- newNode = visitForInStatement(node, children);
- }
- else if (node instanceof ASTForVarInStatement) {
- newNode = visitForVarInStatement(node, children);
- }
- else if (node instanceof ASTContinueStatement) {
- newNode = visitContinueStatement(node, children);
- }
- else if (node instanceof ASTBreakStatement) {
- newNode = visitBreakStatement(node, children);
- }
- else if (node instanceof ASTReturnStatement) {
- newNode = visitReturnStatement(node, children);
- }
- else if (node instanceof ASTWithStatement) {
- newNode = visitWithStatement(node, children);
- }
- else if (node instanceof ASTTryStatement) {
- newNode = visitTryStatement(node, children);
- }
- else if (node instanceof ASTThrowStatement) {
- newNode = visitThrowStatement(node, children);
- }
- else if (node instanceof ASTSwitchStatement) {
- newNode = visitSwitchStatement(node, children);
- }
- else if (node instanceof Compiler.PassThroughNode) {
- newNode = node;
- } else {
- // Not a statement, must be an expression
- newNode = visitExpression(node, false);
- }
- // Check for elided statments
- if (newNode == null) {
- newNode = new ASTEmptyExpression(0);
- }
- if (this.debugVisit) {
- if (! newNode.equals(node)) {
- System.err.println("statement: " + node + " -> " + newNode);
- }
- }
- return newNode;
- }
-
- public SimpleNode visitLabeledStatement(SimpleNode node, SimpleNode[] children) {
- ASTIdentifier name = (ASTIdentifier)children[0];
- SimpleNode stmt = children[1];
- // TODO: [2003-04-15 ptw] bind context slot macro
- try {
- context = new TranslationContext(ASTLabeledStatement.class, context, name.getName());
- // TODO: [2002 ows] throw semantic error for duplicate label
- children[1] = visitStatement(stmt);
- return node;
- }
- finally {
- context = context.parent;
- }
- }
-
public SimpleNode visitVariableDeclaration(SimpleNode node, SimpleNode[] children) {
ASTIdentifier id = (ASTIdentifier)children[0];
boolean scriptElement = options.getBoolean(Compiler.SCRIPT_ELEMENT);
@@ -917,14 +409,6 @@
}
}
- public SimpleNode visitVariableStatement(SimpleNode node, SimpleNode[] children) {
- for (int i = 0, len = children.length; i < len; i++) {
- SimpleNode child = children[i];
- children[i] = visitStatement(child);
- }
- return node;
- }
-
public SimpleNode visitIfStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode test = children[0];
SimpleNode a = children[1];
@@ -952,11 +436,6 @@
return node;
}
- // for function prefix/suffix parsing
- public SimpleNode visitIfDirective(SimpleNode node, SimpleNode[] children) {
- return visitIfStatement(node, children);
- }
-
public SimpleNode visitWhileStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode test = children[0];
SimpleNode body = children[1];
@@ -1037,17 +516,6 @@
}
}
- public SimpleNode visitForVarInStatement(SimpleNode node, SimpleNode[] children) {
- SimpleNode var = children[0];
- // SimpleNode _ = children[1];
- SimpleNode obj = children[2];
- SimpleNode body = children[3];
- if (options.getBoolean(Compiler.ACTIVATION_OBJECT)) {
- return translateForInStatement(node, var, Instructions.SetVariable, obj, body);
- }
- return translateForInStatement(node, var, Instructions.VarEquals, obj, body);
- }
-
// This works because keys are always strings, and enumerate pushes
// a null before all the keys
public void unwindEnumeration(SimpleNode node) {
@@ -1079,16 +547,6 @@
return node;
}
- public SimpleNode visitContinueStatement(SimpleNode node, SimpleNode[] children) {
- SimpleNode label = children.length > 0 ? children[0] : null;
- return translateAbruptCompletion(node, "continue", (ASTIdentifier)label);
- }
-
- public SimpleNode visitBreakStatement(SimpleNode node, SimpleNode[] children) {
- SimpleNode label = children.length > 0 ? children[0] : null;
- return translateAbruptCompletion(node, "break", (ASTIdentifier)label);
- }
-
public SimpleNode visitReturnStatement(SimpleNode node, SimpleNode[] children) {
SimpleNode value = children[0];
children[0] = visitExpression(value);
@@ -1201,83 +659,13 @@
node's class. */
public SimpleNode visitExpression(SimpleNode node, boolean isReferenced) {
assert isExpressionType(node) : "" + node + ": " + (new Compiler.ParseTreePrinter()).visit(node) + " is not an expression";
- SimpleNode newNode = node;
if (this.debugVisit) {
System.err.println("visitExpression: " + node.getClass());
}
- // Are we doing OO programming yet?
- SimpleNode[] children = node.getChildren();
- if (node instanceof ASTIdentifier) {
- newNode = visitIdentifier(node, isReferenced, children);
- }
- else if (node instanceof ASTLiteral) {
- newNode = visitLiteral(node, isReferenced, children);
- }
- else if (node instanceof ASTExpressionList) {
- newNode = visitExpressionList(node, isReferenced, children);
- }
- else if (node instanceof ASTEmptyExpression) {
- newNode = visitEmptyExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTThisReference) {
- newNode = visitThisReference(node, isReferenced, children);
- }
- else if (node instanceof ASTArrayLiteral) {
- newNode = visitArrayLiteral(node, isReferenced, children);
- }
- else if (node instanceof ASTObjectLiteral) {
- newNode = visitObjectLiteral(node, isReferenced, children);
- }
- else if (node instanceof ASTFunctionExpression) {
- newNode = visitFunctionExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTFunctionCallParameters) {
- newNode = visitFunctionCallParameters(node, isReferenced, children);
- }
- else if (node instanceof ASTPropertyIdentifierReference) {
- newNode = visitPropertyIdentifierReference(node, isReferenced, children);
- }
- else if (node instanceof ASTPropertyValueReference) {
- newNode = visitPropertyValueReference(node, isReferenced, children);
- }
- else if (node instanceof ASTCallExpression) {
- newNode = visitCallExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTSuperCallExpression) {
- newNode = visitSuperCallExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTNewExpression) {
- newNode = visitNewExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTPostfixExpression) {
- newNode = visitPostfixExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTUnaryExpression) {
- newNode = visitUnaryExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTBinaryExpressionSequence) {
- newNode = visitBinaryExpressionSequence(node, isReferenced, children);
- }
- else if (node instanceof ASTAndExpressionSequence) {
- newNode = visitAndExpressionSequence(node, isReferenced, children);
- }
- else if (node instanceof ASTOrExpressionSequence) {
- newNode = visitOrExpressionSequence(node, isReferenced, children);
- }
- else if (node instanceof ASTConditionalExpression) {
- newNode = visitConditionalExpression(node, isReferenced, children);
- }
- else if (node instanceof ASTAssignmentExpression) {
- newNode = visitAssignmentExpression(node, isReferenced, children);
- }
- else if (node instanceof Compiler.PassThroughNode) {
- newNode = node;
- }
- else {
- throw new CompilerImplementationError("unknown expression " + node, node);
- }
+ SimpleNode newNode = dispatchExpression(node, isReferenced);
+
if ((! isReferenced) && (newNode == null)) {
newNode = new ASTEmptyExpression(0);
}
@@ -1420,12 +808,6 @@
return node;
}
- // TODO: [2007-08-20 ptw] Replace with Java 1.5 UUID
- private Random rand = new Random();
- private Integer UUID() {
- return new Integer(rand.nextInt(Integer.MAX_VALUE));
- }
-
// Could do inline expansions here, like setAttribute
public SimpleNode visitCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
SimpleNode fnexpr = children[0];
@@ -1530,34 +912,7 @@
}
public SimpleNode visitSuperCallExpression(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- assert children.length == 3;
- SimpleNode fname = children[0];
- SimpleNode callapply = children[1];
- SimpleNode args = children[2];
- String name;
- String ca = null;
- String pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(this, _2)";
- if (fname instanceof ASTEmptyExpression) {
- name = "constructor";
- } else {
- name = ((ASTIdentifier)fname).getName();
- }
- if (callapply instanceof ASTIdentifier) {
- ca = ((ASTIdentifier)callapply).getName();
- }
- Map map = new HashMap();
- map.put("_1", new ASTLiteral(name));
- map.put("_2", new Compiler.Splice(args.getChildren()));
- if (ca == null) {
- ;
- } else if ("call".equals(ca)) {
- pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(_2)";
- } else if ("apply".equals(ca)) {
- pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).apply(_2)";
- } else {
- assert false: "Unhandled super call " + ca;
- }
- SimpleNode n = (new Compiler.Parser()).substitute(pattern, map);
+ SimpleNode n = translateSuperCallExpression(node, isReferenced, children);
return visitExpression(n, isReferenced);
}
@@ -1639,18 +994,6 @@
return node;
}
- public SimpleNode visitAndExpressionSequence(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- SimpleNode a = children[0];
- SimpleNode b = children[1];
- return translateAndOrExpression(node, true, a, b);
- }
-
- public SimpleNode visitOrExpressionSequence(SimpleNode node, boolean isReferenced, SimpleNode[] children) {
- SimpleNode a = children[0];
- SimpleNode b = children[1];
- return translateAndOrExpression(node, false, a, b);
- }
-
SimpleNode translateAndOrExpression(SimpleNode node, boolean isand, SimpleNode a, SimpleNode b) {
SimpleNode[] children = node.getChildren();
children[0] = visitExpression(a);
@@ -1717,16 +1060,6 @@
return node;
}
- static class DoubleCollator implements Comparator {
- public boolean equals(Object o1, Object o2) {
- return ((Double)o1).equals((Double)o2);
- }
-
- public int compare(Object o1, Object o2) {
- return ((Double)o1).compareTo((Double)o2);
- }
- }
-
static java.util.regex.Pattern identifierPattern = java.util.regex.Pattern.compile("[\\w$_]+");
// Internal helper function for above
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/server/LPS.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/server/LPS.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/server/LPS.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -48,6 +48,8 @@
public static String VERSION_FILE = "/org/openlaszlo/server/lps.xml";
+ public static String mDefaultRuntime = "swf8";
+
private static String mBuildID;
private static String mBuildDate;
private static String mVersionID;
@@ -210,7 +212,7 @@
String lfc = "LFC";
String extension = "js";
if (runtime == null) {
- runtime = LPS.getProperty("compiler.runtime.default", "swf7");
+ runtime = getRuntimeDefault();
}
if (runtime.indexOf("swf") == 0) {
@@ -327,31 +329,21 @@
/**
* Set SWF version default.
*/
- public static void setSWFVersionDefault(String swfversion) {
- if (swfversion.equals("swf8")) {
+ public static void setRuntimeDefault(String runtime) {
+ mDefaultRuntime = runtime;
+ if (runtime.equals("swf8")) {
mSWFVersionNumDefault = 8;
mSWFVersionDefault = "swf8";
- } else if (swfversion.equals("swf7")) {
+ } else if (runtime.equals("swf7")) {
mSWFVersionNumDefault = 7;
mSWFVersionDefault = "swf7";
- } else if (swfversion.equals("swf6")) {
- mSWFVersionNumDefault = 6;
- mSWFVersionDefault = "swf6";
- } else if (swfversion.equals("swf5")) {
- mSWFVersionNumDefault = 5;
- mSWFVersionDefault = "swf5";
- } else {
- throw new RuntimeException(
-/* (non-Javadoc)
- * @i18n.test
- * @org-mes="Unknown SWF version: " + p[0]
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(
- LPS.class.getName(),"051019-305", new Object[] {swfversion})
- );
- }
+ }
}
+ public static String getRuntimeDefault() {
+ return LPS.getProperty("compiler.runtime.default", mDefaultRuntime);
+ }
+
/**
* @return swf version number
*/
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/LZServlet.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/LZServlet.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/LZServlet.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
@@ -250,7 +250,7 @@
//------------------------------------------------------------
mProperties = LPS.getProperties();
- LPS.setSWFVersionDefault(LPS.getProperty("compiler.runtime.default", "swf7"));
+ LPS.setRuntimeDefault(LPS.getRuntimeDefault());
// Create responders that create caches (media, data, and compiler)
String[] lzt = { "swf", "media", "data" };
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderCompile.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderCompile.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderCompile.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -408,7 +408,6 @@
* <li> "logdebug"
* <li> "lzbacktrace"
* <li> "profile"
- * <li> "validate"
* <li> "sourcelocators"
* <li> "lzr" (swf version := swf5 | swf6)
* <li> "lzproxied" true|false
@@ -438,14 +437,6 @@
props.setProperty(CompilationEnvironment.LOGDEBUG_PROPERTY, logdebug);
}
- // Look for "validate=boolean" flag, default to true
- props.setProperty(CompilationEnvironment.VALIDATE_PROPERTY,
- LPS.getProperty("compiler.validate", "true"));
- String validate = req.getParameter(CompilationEnvironment.VALIDATE_PROPERTY);
- if (validate != null) {
- props.setProperty(CompilationEnvironment.VALIDATE_PROPERTY, validate);
- }
-
// Look for "debug=true" flag
props.setProperty(CompilationEnvironment.DEBUG_PROPERTY, "false");
String debug = req.getParameter(CompilationEnvironment.DEBUG_PROPERTY);
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderOBJECT.java
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderOBJECT.java 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/server/src/org/openlaszlo/servlets/responders/ResponderOBJECT.java 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
* ****************************************************************************/
/* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* J_LZ_COPYRIGHT_END *********************************************************/
@@ -22,6 +22,7 @@
import org.openlaszlo.utils.FileUtils;
import org.openlaszlo.utils.LZHttpUtils;
import org.openlaszlo.utils.StringUtils;
+import org.openlaszlo.server.LPS;
import org.openlaszlo.compiler.CompilationError;
import org.openlaszlo.utils.ChainedException;
@@ -68,14 +69,9 @@
String runtime = req.getParameter("lzr");
if (runtime == null) {
- throw new ChainedException(
- /* (non-Javadoc)
- * @i18n.test
- * @org-mes="no runtime (lzr) query arg supplied"
- */
- org.openlaszlo.i18n.LaszloMessages.getMessage(Responder.class.getName(), "060211-100")
- );
+ runtime = LPS.getRuntimeDefault();
}
+
input = mCompMgr.getObjectStream(fileName, props);
Modified: openlaszlo/branches/paperpie/WEB-INF/lps/templates/html-response.xslt
===================================================================
--- openlaszlo/branches/paperpie/WEB-INF/lps/templates/html-response.xslt 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/WEB-INF/lps/templates/html-response.xslt 2007-10-10 23:17:04 UTC (rev 6797)
@@ -60,6 +60,8 @@
<html>
<head>
<link rel="SHORTCUT ICON" href="http://www.laszlosystems.com/favicon.ico"/>
+ <!-- this tag helps laszlo apps look good on the iPhone. It prevents user scaling. [bshine] -->
+ <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<title>
<xsl:value-of select="/canvas/@title"/>
</title>
Modified: openlaszlo/branches/paperpie/build.properties
===================================================================
--- openlaszlo/branches/paperpie/build.properties 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/build.properties 2007-10-10 23:17:04 UTC (rev 6797)
@@ -43,10 +43,10 @@
tom.password = laszlo
# Copyrights
-LZ_SRC_COPYRIGHT = Copyright (c) 2001-2006 Laszlo Systems, Inc. \
+LZ_SRC_COPYRIGHT = Copyright (c) 2001-2007 Laszlo Systems, Inc. \
All Rights Reserved. Use is subject to license terms.
-LZ_HTML_COPYRIGHT = © Copyright 2001-2006 <a target="_blank" \
+LZ_HTML_COPYRIGHT = © Copyright 2001-2007 <a target="_blank" \
href="http://www.laszlosystems.com/">Laszlo Systems, Inc.</a> \
All rights reserved. Use is subject to license terms.
@@ -57,7 +57,7 @@
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
LZ_LZX_COPYRIGHT = \ -->\r\n\
-<!-- Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. --> \r\n\
+<!-- Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. --> \r\n\
<!-- Use is subject to license terms. -->\r\n\
<!--
LZ_LZX_VERSION = \ -->\r\n\
Modified: openlaszlo/branches/paperpie/demos/amazon/amazon.lzx
===================================================================
--- openlaszlo/branches/paperpie/demos/amazon/amazon.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/demos/amazon/amazon.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -506,7 +506,7 @@
<view name="dragsmall" visible="false">
<attribute name="dragging" value="false"/>
<view name="img" x="12" y="5" width="50" height="50" clip="true" opacity="0.7"/>
- <view name="frame" resource="dragframe" x="${parent.img.x-12}" y="${parent.img.y-5}"/>
+ <view name="myframe" resource="dragframe" x="${parent.img.x-12}" y="${parent.img.y-5}"/>
<dragstate name="drag"/>
Modified: openlaszlo/branches/paperpie/demos/calendar/basepanel.lzx
===================================================================
--- openlaszlo/branches/paperpie/demos/calendar/basepanel.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/demos/calendar/basepanel.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -5,7 +5,7 @@
<!-- ============================================================== -->
<class name="basepanel" height="100" width="100">
<!-- VIEWS -->
- <view name="frame" width="100%" height="100%">
+ <view name="myframe" width="100%" height="100%">
<view name="top" width="${parent.width}" height="19" >
<view name="l" resource="tpLft" x="-1" y="-1"/>
<view name="m" resource="tpMdl" stretches="width"
@@ -49,7 +49,7 @@
<!-- this is currently unused, but allows for coloriation of panel -->
<method name="transformto" args="tm">
- frame.setColorTransform(tm);
+ myframe.setColorTransform(tm);
</method>
<method name="setWindowTitle" args="s">
@@ -59,7 +59,7 @@
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/branches/paperpie/demos/calendar/eventselector.lzx
===================================================================
--- openlaszlo/branches/paperpie/demos/calendar/eventselector.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/demos/calendar/eventselector.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -4,7 +4,7 @@
<!-- ================================================================= -->
<!-- The event class is a 9 part collection much like a window object -->
<!-- ================================================================= -->
- <class name="eventSelectorbar" clip="true"
+ <class name="eventSelectorbar" clip="false"
y="61"
x="16"
width="${parent.width}" height="$once{calgrid.height}"
Modified: openlaszlo/branches/paperpie/demos/calendar/infopanel.lzx
===================================================================
--- openlaszlo/branches/paperpie/demos/calendar/infopanel.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/demos/calendar/infopanel.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -280,7 +280,7 @@
<animator start="false" name="slideopen1old" attribute="width" to="204"
duration="500" relative="false"/>
<animator start="false" name="slideopen1" attribute="x" to="602" from="830"
- duration="500"/>
+ duration="500" onstop="LzFocus.setFocus(parent.summary.content.title);"/>
<animator start="false" name="slideopen2" attribute="opacity" to="1" from="0"
duration="500" relative="false"/>
@@ -319,7 +319,6 @@
this.setOpacity(1);
this.slideopen1.doStart();
this.slideopen2.doStart();
- LzFocus.setFocus(summary.content.title);
this.opened = true;
</method>
Modified: openlaszlo/branches/paperpie/demos/lzpix/app.lzx
===================================================================
--- openlaszlo/branches/paperpie/demos/lzpix/app.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/demos/lzpix/app.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -4,8 +4,10 @@
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************-->
<canvas width="800" height="600" bgcolor="0xcfcfcf" proxied="true" title="LZPIX"> <!-- bgcolor="0xc0c0c0" -->
- <inittimer/>
- <versioninfo/>
+ <!--
+ <inittimer/>
+ <versioninfo/>
+ -->
<attribute name="anm_multipler" value="1" />
<!-- demo for photo app -->
Modified: openlaszlo/branches/paperpie/demos/weather/weather.lzx
===================================================================
--- openlaszlo/branches/paperpie/demos/weather/weather.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/demos/weather/weather.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -8,8 +8,7 @@
<!-- is subject to license terms. -->
<!--=======================================================================-->
-<!-- <canvas width="240" height="320" bgcolor="#EAEAEA" title="Laszlo Weather"> -->
-<canvas bgcolor="#EAEAEA" title="Laszlo Weather">
+<canvas width="240" height="320" bgcolor="#EAEAEA" title="Laszlo Weather">
<!-- the actual size of the app is: width="240" height="320"
this app is sized larger to appear consistent with other samples -->
<splash/>
Modified: openlaszlo/branches/paperpie/docs/component-browser/common.lzx
===================================================================
--- openlaszlo/branches/paperpie/docs/component-browser/common.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/component-browser/common.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -1,6 +1,6 @@
<library>
- <attribute name="urlprefix" value="../reference/index.html" type="string" />
+ <attribute name="urlprefix" value="../reference/" type="string" />
<attribute name="lfccolor" value="0xDFD498" type="number" />
<attribute name="basecolor" value="0xD1DCF1" type="number" />
<attribute name="lcicolor" value="0xD5E6D2" type="number" />
@@ -68,7 +68,7 @@
<attribute name="textselectedcolor" value="0xFFFFFF" type="number" />
<method event="onclick">
var file = (this.file != '' ? this.file : this.text + '.html');
- var url = canvas.urlprefix + '?' + file;
+ var url = canvas.urlprefix + file;
LzBrowser.loadURL('javascript: var wptr = window.open("' + url + '","laszlo-reference","resizable=1,width=1000,height=700,left=0,top=0,screenX=0,screenY=0,menubar,location,status,scrollbars,toolbar,address"); wptr.focus(); void(0);');
</method>
<method event="onmouseup">
Modified: openlaszlo/branches/paperpie/docs/component-browser/hierarchyview.lzx
===================================================================
--- openlaszlo/branches/paperpie/docs/component-browser/hierarchyview.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/component-browser/hierarchyview.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -63,7 +63,7 @@
onmousedown="setAttribute('fgcolor', classroot.style.textselectedcolor)">
<method event="onclick">
var file = (classroot.file != '' ? classroot.file : classroot.text + '.html');
- var url = canvas.urlprefix + '?' + file;
+ var url = canvas.urlprefix + file;
LzBrowser.loadURL('javascript: var wptr = window.open("' + url + '","test","resizable=1,width=1000,height=700,left=0,top=0,screenX=0,screenY=0,menubar,location,status,scrollbars,toolbar,address"); wptr.focus(); void(0);');
</method>
<method event="onmouseup">
@@ -78,15 +78,15 @@
<view x="1" y="1" width="${parent.width-2}" clip="true"
height="${parent.height-2}" bgcolor="white" >
<scrollbar name="mysc" />
- <linktree x="5" text="node" key="lfc" open="true">
- <linktree text="view" key="lfc" open="true">
- <linktree text="basecomponent" key="base" open="true">
- <linktree text="basevaluecomponent" key="base">
- <linktree text="baseformitem" key="base">
- <linktree text="checkbox" isleaf="true" file="lz-checkbox.html" />
- <linktree text="edittext" isleaf="true" file="lz-edittext.html" />
- <linktree text="basecombobox" key="base">
- <linktree text="combobox" isleaf="true" file="lz-combobox.html" />
+ <linktree x="5" text="node" key="lfc" open="true" file="LzNode.html">
+ <linktree text="view" key="lfc" open="true" file="LzView.html">
+ <linktree text="basecomponent" key="base" open="true" file="lz.basecomponent.html">
+ <linktree text="basevaluecomponent" key="base" file="lz.basevaluecomponent.html">
+ <linktree text="baseformitem" key="base" file="lz.baseformitem.html">
+ <linktree text="checkbox" isleaf="true" file="lz.checkbox.html" />
+ <linktree text="edittext" isleaf="true" file="lz.edittext.html" />
+ <linktree text="basecombobox" key="base" file="lz.basecombobox.html">
+ <linktree text="combobox" isleaf="true" file="lz.combobox.html" />
<linktree text="datepickercombobox" isleaf="true">
<!-- there's no doc for datepickerday -->
<method event="oninit">
@@ -94,37 +94,37 @@
</method>
</linktree>
</linktree>
- <linktree text="basedatacombobox" key="base">
- <linktree text="datacombobox" isleaf="true" file="lz-datacombobox.html" />
+ <linktree text="basedatacombobox" key="base" file="lz.basedatacombobox.html">
+ <linktree text="datacombobox" isleaf="true" file="lz.datacombobox.html" />
</linktree>
- <linktree text="baselist" key="base">
+ <linktree text="baselist" key="base" file="lz.baselist.html">
<linktree text="radiogroup" isleaf="true"
- file="lz-radiogroup.html" />
- <linktree text="basetabslider" key="base">
- <linktree text="tabslider" isleaf="true" />
+ file="lz.radiogroup.html" />
+ <linktree text="basetabslider" key="base" file="lz.basetabslider.html">
+ <linktree text="tabslider" isleaf="true" file="lz.tabslider.html"/>
</linktree>
- <linktree text="list" file="lz-list.html">
- <linktree text="basefloatinglist" file="lz-basefloatinglist.html">
- <linktree text="floatinglist" file="lz-floatinglist.html"
+ <linktree text="list" file="lz.list.html">
+ <linktree text="basefloatinglist" file="lz.basefloatinglist.html">
+ <linktree text="floatinglist" file="lz.floatinglist.html"
isleaf="true" />
- <linktree text="plainfloatinglist" file="lz-plainfloatinglist.html"
+ <linktree text="plainfloatinglist" file="lz.plainfloatinglist.html"
isleaf="true" />
</linktree>
</linktree>
- <linktree text="basetabsbar" key="base">
- <linktree text="tabsbar" file="lz-tabsbar.html"
+ <linktree text="basetabsbar" key="base" file="lz.basetabsbar.html">
+ <linktree text="tabsbar" file="lz.tabsbar.html"
isleaf="true" key="lci" />
</linktree>
</linktree> <!-- baselist -->
</linktree>
- <linktree text="baselistitem" key="base">
- <linktree text="radiobutton" isleaf="true" file="lz-radio.html" />
- <linktree text="basetabelement" key="base">
- <linktree text="tabelement" isleaf="true" />
+ <linktree text="baselistitem" key="base" file="lz.baselistitem.html">
+ <linktree text="radiobutton" isleaf="true" file="lz.radiobutton.html" />
+ <linktree text="basetabelement" key="base" file="lz.basetabelement.html">
+ <linktree text="tabelement" isleaf="true" file="lz.tabelement.html"/>
</linktree>
- <linktree text="listitem" key="lci" file="lz-listitem.html">
- <linktree text="textlistitem" file="lz-textlistitem.html">
- <linktree text="menuitem" file="lz-menuitem.html"
+ <linktree text="listitem" key="lci" file="lz.listitem.html">
+ <linktree text="textlistitem" file="lz.textlistitem.html">
+ <linktree text="menuitem" file="lz.menuitem.html"
isleaf="true" />
<linktree text="datepickerlistitem" isleaf="true">
<!-- there's no doc for datepickerday -->
@@ -134,48 +134,48 @@
</linktree>
</linktree>
</linktree>
- <linktree text="basetab" key="base">
- <linktree text="tab" file="lz-tab.html"
+ <linktree text="basetab" key="base" file="lz.basetab.html">
+ <linktree text="tab" file="lz.tab.html"
isleaf="true" key="lci" />
</linktree>
</linktree>
</linktree>
- <linktree text="basebutton" key="base">
- <linktree text="button" isleaf="true" file="lz-button.html" />
+ <linktree text="basebutton" key="base" file="lz.basebutton.html">
+ <linktree text="button" isleaf="true" file="lz.button.html" />
</linktree>
- <linktree text="basedatepicker" key="base">
- <linktree text="datepicker" isleaf="true" file="lz-datepicker.html" />
+ <linktree text="basedatepicker" key="base" file="lz.basedatepicker.html">
+ <linktree text="datepicker" isleaf="true" file="lz.datepicker.html" />
</linktree>
- <linktree text="basetabs" key="base">
- <linktree text="tabs" isleaf="true" file="lz-tabs.html" />
+ <linktree text="basetabs" key="base" file="lz.basetabs.html">
+ <linktree text="tabs" isleaf="true" file="lz.tabs.html" />
</linktree>
- <linktree text="basetabpane" key="base">
- <linktree text="tabpane" file="lz-tabpane.html"
+ <linktree text="basetabpane" key="base" file="lz.basetabpane.html">
+ <linktree text="tabpane" file="lz.tabpane.html"
isleaf="true" />
</linktree>
- <linktree text="basewindow" key="base">
+ <linktree text="basewindow" key="base" file="lz.basewindow.html">
<linktree text="windowpanel" key="lci" isleaf="true"
- file="lz-windowpanel.html">
- <linktree text="window" isleaf="true" file="lz-window.html" />
- <linktree text="modaldialog" file="lz-modaldialog.html">
- <linktree text="alert" isleaf="true" file="lz-alert.html" />
+ file="lz.windowpanel.html">
+ <linktree text="window" isleaf="true" file="lz.window.html" />
+ <linktree text="modaldialog" file="lz.modaldialog.html">
+ <linktree text="alert" isleaf="true" file="lz.alert.html" />
</linktree>
</linktree>
</linktree>
- <linktree text="basescrollbar" key="base">
- <linktree text="scrollbar" isleaf="true" file="lz-scrollbar.html"/>
+ <linktree text="basescrollbar" key="base" file="lz.basescrollbar.html">
+ <linktree text="scrollbar" isleaf="true" file="lz.scrollbar.html"/>
</linktree>
- <linktree text="basetree" key="base">
- <linktree text="tree" isleaf="true" file="lz-tree.html"/>
+ <linktree text="basetree" key="base" file="lz.basetree.html">
+ <linktree text="tree" isleaf="true" file="lz.tree.html"/>
</linktree>
- <linktree text="menu" file="lz-menu.html" isleaf="true" />
- <linktree text="menubar" file="lz-menubar.html" isleaf="true" />
- <linktree text="menuseparator" file="lz-menuseparator.html" isleaf="true" />
+ <linktree text="menu" file="lz.menu.html" isleaf="true" />
+ <linktree text="menubar" file="lz.menubar.html" isleaf="true" />
+ <linktree text="menuseparator" file="lz.menuseparator.html" isleaf="true" />
</linktree> <!-- basecomponent -->
- <linktree text="baseform" key="base" open="true">
- <linktree text="form" isleaf="true" file="lz-form.html" />
+ <linktree text="baseform" key="base" open="true" file="lz.baseform.html">
+ <linktree text="form" isleaf="true" file="lz.form.html" />
</linktree>
- <linktree text="basedatepickerday" key="base">
+ <linktree text="basedatepickerday" key="base" file="lz.basedatepickerday.html">
<linktree text="datepickerday" isleaf="true">
<!-- there's no doc for datepickerday -->
<method event="oninit">
@@ -183,7 +183,7 @@
</method>
</linktree>
</linktree>
- <linktree text="basedatepickerweek" key="base">
+ <linktree text="basedatepickerweek" key="base" file="lz.basedatepickerweek.html">
<linktree text="datepickerweek" isleaf="true">
<!-- there's no doc for datepickerweek -->
<method event="oninit">
@@ -192,7 +192,7 @@
</linktree>
</linktree>
</linktree> <!-- view -->
- <linktree text="submit" isleaf="true"/>
+ <linktree text="submit" isleaf="true" file="lz.submit.html"/>
</linktree> <!-- node -->
</view>
</class>
Modified: openlaszlo/branches/paperpie/docs/src/developers/animation.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/animation.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/animation.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -253,7 +253,7 @@
<para>The <indexterm><primary>indirect</primary></indexterm><sgmltag class="attribute">indirect</sgmltag> attribute allows you to reverse
the direction in which an animation occurs while still arriving at the
-same result. In the example below, setting the
+same result. In the example below, the
<indexterm><primary>indirect</primary></indexterm><sgmltag class="attribute">indirect</sgmltag> attribute is set to <literal>true</literal>
for the animation on <varname>B23</varname>. This causes the
animation to go to the left, rather than the right, disappearing off
Modified: openlaszlo/branches/paperpie/docs/src/developers/architecture.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/architecture.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/architecture.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -8,7 +8,7 @@
administrative advantages and cost effectiveness of web applications.
</para>
<para>
-OpenLaszlo applications are written in the XML language LZX, which compiles to any of several runtime targets, including, as of OpenLaszlo 4.0, sw7, sw8, and native browswer JavaScript, also sometimes called DHTML or Ajax. Applications compiled to SWF7 or SWF8 run in the Flash 9 player.</para>
+OpenLaszlo applications are written in the XML language LZX, which compiles to any of several runtime targets, including, as of OpenLaszlo 4.0, sw7, sw8, and native browser JavaScript, also sometimes called DHTML or Ajax. Applications compiled to SWF7 or SWF8 run in the Flash 9 player.</para>
<para/><section><title>Deployment Modes</title>
<para>
OpenLaszlo applications can be made available on the web, or <emphasis role="i">deployed</emphasis> in either of two ways:
@@ -17,7 +17,7 @@
<itemizedlist spacing="compact"><listitem><para>Compiles source programs as necessary and sends the resultant file to be executed on the client; and</para></listitem><listitem><para>Proxies interactions between the client and other servers on the Internet, performing data manipulation as necessary</para></listitem></itemizedlist>
</para></listitem><listitem><para><emphasis role="em">SOLO</emphasis> You use the OpenLaszlo compiler to "precompile" programs and make the resulting file (in SWF or JavaScript) available on your sever. When executed on the
client, the application contacts other servers directly, without mediation by the OpenLaszlo Server. This "serverless", or
-<emphasis role="i">Standalone OpenLaszlo Output</emphasis> deployment is caled SOLO.</para></listitem></itemizedlist>
+<emphasis role="i">Standalone OpenLaszlo Output</emphasis> deployment is called SOLO.</para></listitem></itemizedlist>
<figure><title>Applications may be deployed either SOLO or proxied by the OpenLaszlo Server</title><mediaobject><imageobject><imagedata fileref="images/deploy_options.png"/></imageobject></mediaobject></figure>
<para>
Later chapters explain in detail the differences between proxied and SOLO OpenLaszlo applications. In general:
@@ -36,8 +36,8 @@
container. The OpenLaszlo Server may communicate with <glossterm>back end</glossterm>
servers and data sources using a variety of protocols. OpenLaszlo
applications written in LZX are compiled by the OpenLaszlo Server and served either as bytecode
-to a plug in that runs in the client's web browser (such as Flash or J2ME) or as JavaScript (DHTML) that is directly executed by the browser itself. This constitutes
-the <indexterm significance="preferred"><primary>front end</primary></indexterm><glossterm>front end</glossterm>. OpenLaszlo applications run consistently and reliably on a variety of operating systems and device types, including Windows, Pocket PC, Mac OS, Linux, and Solaris, and a variety of mobile and set-top box platformss.
+to a plug-in that runs in the client's web browser (such as Flash or J2ME) or as JavaScript (DHTML) that is directly executed by the browser itself. This constitutes
+the <indexterm significance="preferred"><primary>front end</primary></indexterm><glossterm>front end</glossterm>. OpenLaszlo applications run consistently and reliably on a variety of operating systems and device types, including Windows, Pocket PC, Mac OS, Linux, and Solaris, and a variety of mobile and set-top box platforms.
</para>
<para>
When compiling for execution by the Flashplayer, the OpenLaszlo Server outputs bytecode in the SWF ("shockwave format") file
@@ -48,7 +48,7 @@
When compiled for execution natively in the browser, the OpenLaszlo Server outputs JavaScript. This script is human readable but optimized for size and execution speed, with comments removed, variable names shortened, etc.
</para>
<para>
-In the future, OpenLaszlo may support other run time clients as
+In the future, OpenLaszlo may support other run-time clients as
they become widely available.</para>
<figure><title>OpenLaszlo Compiles to Different Runtimes</title><mediaobject><imageobject><imagedata fileref="images/kernels.png"/></imageobject></mediaobject></figure>
<para>
@@ -196,7 +196,7 @@
<para>
The OpenLaszlo application platform supports the SSL security model. Data transmissions across the Internet can
be encrypted using
-SSL encryption over HTTPS. When compiled for native execution by the browser, the security model is that of whicherver browser is used to execute the application.
+SSL encryption over HTTPS. When compiled for native execution by the browser, the security model is that of whichever browser is used to execute the application.
</para>
<para>
The security model employed by OpenLaszlo applications differs slightly depending on the runtime target. OpenLaszlo applications compiled to swf format execute on the client computer within the secure "sandbox" environment of
@@ -213,7 +213,7 @@
The OpenLaszlo architecture is designed to support multiple device types. Its dynamic layout mechanisms enable simple modifications to such properties as an application's overall
size to be intelligently applied by the platform. This simplifies adapting an application to work on screens and devices of different size.</para>
-<para>All screen visualizations in OpenLaszlo appllications use time-based rather than
+<para>All screen visualizations in OpenLaszlo applications use time-based rather than
frame-based animation, and thus transparently accommodate the
processor speed differences of various device types. An interface
transition specified to take 500 milliseconds will take 500
Modified: openlaszlo/branches/paperpie/docs/src/developers/browser-integration.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/browser-integration.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/browser-integration.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -12,20 +12,20 @@
</para>
<para>OpenLaszlo applications run inside web browsers, and web
- browsers are desiged to render HTML pages. This means that each
+ browsers are designed to render HTML pages. This means that each
compiled OpenLaszlo application has a relationship to the HTML
page that delivers it to the browser. Depending on whether the OL
application was compiled to SWF or to DHTML, the mechanics of
this relationship differ. However, at an abstract level the model
is pretty much the same for all runtimes: an OpenLaszlo
application resides within a web page that is executed by a
- browser; that browser has a "JavaScipt" engine. The OpenLaszlo
+ browser; that browser has a "JavaScript" engine. The OpenLaszlo
application can make requests for the JavaScript engine to
execute, and the surrounding HTML page can include JavaScript
code that makes requests of the OpenLaszlo application.</para>
<para>This chapter discusses the way that OpenLaszlo Applications
relate to the HTML pages in which they're delivered, and ways in
- which the OpenLaszlo appliction and browser JavaScript engine can
+ which the OpenLaszlo application and browser JavaScript engine can
communicate with each other.</para>
<para />
<section>
@@ -36,7 +36,7 @@
pages of the proper structure are generated automatically.
Situations may arise where you may need to customized these
pages or even generate pages from scratch, but in many cases,
- the automaticaly generated page is all you need. Simply press
+ the automatically generated page is all you need. Simply press
the appropriate button, "Server" or "SOLO", and follow the
instructions that are then displayed.</para>
<para />
@@ -44,7 +44,7 @@
<section>
<title>A model of Browser/LZX application interaction</title>
<para>Before going into the actual mechanics, let's take a
- closer look at concepts and teminology.</para>
+ closer look at concepts and terminology.</para>
<para />
<section>
<title>The "wrapper page"</title>
@@ -80,7 +80,7 @@
</primary>
</indexterm>
<methodname>swfEmbed()</methodname>for embedding SWF OL
- applcations into the HTML page; this generates an HTML
+ applications into the HTML page; this generates an HTML
<embed> tag. Similarly, there is an
<indexterm>
<primary>
@@ -120,7 +120,7 @@
<methodname>setCanvasAttribute()</methodname>methods are
used.</para>
<para>This are discussed below.</para>
- <para>Alhough OpenLaszlo applications deployed on the Flash
+ <para>Although OpenLaszlo applications deployed on the Flash
runtime are not dependent on the browser or operating system
for their look or behavior, there are some important
limitations that the browser container places on the
@@ -166,7 +166,7 @@
<title condition="dhtml">Applications Compiled to
DHTML</title>
<para>Applications that are compiled for DHTML run within the
- browser's JavaScript envinronment. They are essentially
+ browser's JavaScript environment. They are essentially
compiled into the DOM of that page.</para>
<para>Each LZX application has exactly one
<indexterm>
@@ -228,7 +228,7 @@
<primary>Lz</primary>
</indexterm>
<classname>Lz</classname>. Note that the letter "L" in this
- class is uppper case. This is not a typo!.</para>
+ class is upper case. This is not a typo!.</para>
<para>Unlike other OpenLaszlo classes which you use to build
LZX applications, the
<indexterm>
@@ -303,7 +303,7 @@
<title>Placing the LZX (SWF) application within an HTML
page</title>
<programlisting><script language="JavaScript"
- type="text/javascript"> lz.swfEmbed({url: '?lzt=swf',
+ type="text/javascript"> Lz.swfEmbed({url: '?lzt=swf',
bgcolor: '#000000', width: '', height: ''});
</script></programlisting>
</example>
@@ -317,7 +317,7 @@
<title>Placing the LZX (DHTML) application within an HTML
page</title>
<programlisting><script language="JavaScript"
- type="text/javascript"> lz.dhtmlEmbed({url: '?lzt=swf',
+ type="text/javascript"> Lz.dhtmlEmbed({url: '?lzt=swf',
bgcolor: '#000000', width: '', height: ''});
</script></programlisting>
</example>
Modified: openlaszlo/branches/paperpie/docs/src/developers/classes-powerprogramming.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/classes-powerprogramming.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/classes-powerprogramming.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -409,7 +409,7 @@
</canvas>
</programlisting><?lzx-edit programs/class-inheritance-$7.lzx></example?>
<para>
-At the risk of belaboring the topic, here's one more example that demostrates that top level instances of a class have no defined classroot. Notice that even though "bar" is a child of "foo", it does not have a defined classroot, because it is a toplevel instance of the bar class. </para>
+At the risk of belaboring the topic, here's one more example that demonstrates that top level instances of a class have no defined classroot. Notice that even though "bar" is a child of "foo", it does not have a defined classroot, because it is a toplevel instance of the bar class. </para>
<example role="live-example">
<title>Classroot and top level instance</title>
@@ -743,7 +743,7 @@
encapsulates. The OpenLaszlo Runtime instantiator is responsible for passing in the
children of this <literal>object</literal> based on the LZX hierarchy. You will
generally set this to null.
- </para></listitem><listitem><para><varname>instcall</varname> is a boolean value that determines
+ </para></listitem><listitem><para><varname>instcall</varname> is a Boolean value that determines
when this object will be instantiated. If false, the instantiation
of this object will be immediate, otherwise, its instantiation
will be synchronized with the rest of the view system. See <xref linkend="initialization-and-instantiation"/>.
@@ -822,7 +822,7 @@
<literal>new lz.view(...)</literal> (<emphasis role="b">not</emphasis> <literal>new view(...)</literal>).
</para>
<note><para>
-In earlier versions of OpenLaszlo, there was an idosyncratic mapping between class names and tag names, and classes in the LFC were handled differently than user devfined classes. For example, the tagname <indexterm><primary>view</primary></indexterm><sgmltag class="element"><view></sgmltag> mapped to JavaScript class LzView. With OpenLaszlo 4.0, the <literal>lz.[tagname]</literal> mapping is universal, and the old mappings are deprecated. </para></note>
+In earlier versions of OpenLaszlo, there was an idiosyncratic mapping between class names and tag names, and classes in the LFC were handled differently than user defined classes. For example, the tagname <indexterm><primary>view</primary></indexterm><sgmltag class="element"><view></sgmltag> mapped to JavaScript class LzView. With OpenLaszlo 4.0, the <literal>lz.[tagname]</literal> mapping is universal, and the old mappings are deprecated. </para></note>
Modified: openlaszlo/branches/paperpie/docs/src/developers/colors.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/colors.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/colors.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -48,7 +48,7 @@
<para/></section><section><title>Hexadecimal Code</title>
<para>
-Some web applications require that RGB be expresssed in hexadecimal (base 16 instead of base 10) values. OpenLaszlo much prefers hex values; for one thing, using hexadecimal values enables the use of stylesheets (see Cascading Style Sheets):
+Some web applications require that RGB be expressed in hexadecimal (base 16 instead of base 10) values. OpenLaszlo much prefers hex values; for one thing, using hexadecimal values enables the use of stylesheets (see Cascading Style Sheets):
</para>
<example role="live-example">
Modified: openlaszlo/branches/paperpie/docs/src/developers/comp-intro.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/comp-intro.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/comp-intro.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -25,7 +25,7 @@
<para>
The simplest way to build an OpenLaszlo application is to use LZ components "out of the box" with their default
behaviors. This chapter includes a few such examples. It also includes a few examples that use concepts that have not yet been introduced.
-Don't worry if you don't understand exactly how they work. The idea here is to get aquainted with the general "feel" of an OpenLaszlo
+Don't worry if you don't understand exactly how they work. The idea here is to get acquainted with the general "feel" of an OpenLaszlo
application that is built mostly from components. The subsequent tutorials present the concepts you'll need in order to create your
own applications.
</para>
@@ -35,7 +35,7 @@
moments to get familiar with the range of components that ship with OpenLaszlo.
</para>
<para>
-The example below shows a miscellaneous collection of components. It's an abreviated version of the sampler
+The example below shows a miscellaneous collection of components. It's an abbreviated version of the sampler
in the <ulink url="../../laszlo-explorer/index.jsp">OpenLaszlo Explorer,</ulink> which contains a visual tour of all the components. The code that implements
these components may look a little intimidating if you have not worked with this kind of language before, but don't be put off.
In fact you may not even want to look at the code yet. Your goal here is to start thinking about the kinds of things you can do in
Modified: openlaszlo/branches/paperpie/docs/src/developers/compiler.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/compiler.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/compiler.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -22,7 +22,7 @@
<para/></section></section><section><title>The Command Line Compiler</title>
<para>
-In OpenLaszlo, 'the compiler' consists (currently) of two phases: 1) 'the view compiler', which compiles LZX to Javascript, and 2) 'the script compiler', which compiles Javascript to the target runtime (SWF7, SWF8 and DHTML). `lzc` invokes both those phases (although you can ask for the intermediate output).
+In OpenLaszlo, 'the compiler' consists (currently) of two phases: 1) 'the view compiler', which compiles LZX to JavaScript, and 2) 'the script compiler', which compiles JavaScript to the target runtime (SWF7, SWF8 and DHTML). `lzc` invokes both those phases (although you can ask for the intermediate output).
</para>
<para>
The Debugger needs an OL server to be able to evaluate forms (it calls the server to compile the form and then loads and runs the result). It will try to talk to OL server (using the url the application was loaded from), so it should 'just work', so long as you are running a server, even if you don't use the server for compiling your application.
@@ -154,7 +154,7 @@
<textobject><textdata fileref="programs/compiler-$2.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>switch tag for condtional compilation</title><programlisting role="lzx-embednew"><filename>compiler-$2.lzx</filename><parameter/><code>
+<?example role="live-example"><title>switch tag for conditional compilation</title><programlisting role="lzx-embednew"><filename>compiler-$2.lzx</filename><parameter/><code>
<canvas height="20">
<switch>
<when runtime="dhtml">
Modified: openlaszlo/branches/paperpie/docs/src/developers/components-design.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/components-design.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/components-design.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -647,4 +647,21 @@
</canvas>
</programlisting><?lzx-edit programs/custom-components-$15.lzx></example?>
-<para/></section></section></chapter>
+<para/></section></section>
+<section>
+<title>Component auto-include</title>
+<para>You can auto-include a component so you can use the new tag anywhere without having to include it.</para>
+<orderedlist>
+<listitem><para>Copy your component somewhere under lps/components. Be sure to explicitly include all auto-included lzx files, for example, if you use simplelayout, be sure to add:</para>
+<para><literal><include href="util/layouts/simplelayout.lzx"/></literal></para>
+<para>Notice how the path is relative to the root of the components directory.</para>
+</listitem>
+<listitem><para>Add the tag name and component path to WEB-INF/lps/misc/lzx-autoincludes.properties. For example, to add an
+image component under base/image.lzx, add this line to the properties file:</para>
+<para><literal>image: base/image.lzx</literal></para>
+<para>Once again, notice how the path is relative to the root of the components directory.</para>
+</listitem>
+<listitem><para>Restart LPS. You should now be able to use the new tag anywhere without having to include it. </para></listitem>
+</orderedlist>
+</section>
+</chapter>
\ No newline at end of file
Modified: openlaszlo/branches/paperpie/docs/src/developers/constraints.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/constraints.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/constraints.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -356,7 +356,7 @@
<para>
How does it work? When you drag
-the red view to change its on y position, it sends an <indexterm><primary>ony event</primary></indexterm><literal>ony</literal> event. The blue view is listening for the
+the red view to change its own y position, it sends an <indexterm><primary>ony event</primary></indexterm><literal>ony</literal> event. The blue view is listening for the
red view's <indexterm><primary>ony event</primary></indexterm><literal>ony</literal> event and responds by updating its own y position. The red view is listening
for the blue view's <indexterm><primary>ony event</primary></indexterm><literal>ony</literal> event; however, it doesn't respond to that event because an event handler only gets
called one time on each event.</para>
@@ -515,7 +515,7 @@
</programlisting>
<para>
in which the value of a parameter is constrained to that returned by a serializing function.
-Upon inspection, we see that he dependencies of </para>
+Upon inspection, we see that the dependencies of </para>
<programlisting>
value="escape(canvas.options.serialize())"
Modified: openlaszlo/branches/paperpie/docs/src/developers/cookies.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/cookies.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/cookies.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -25,7 +25,7 @@
<para>The OpenLaszlo Server proxies client request headers and backend server response
headers. Because clients always talk to the server, only headers in the OpenLaszlo Server domain
will be sent. If a client makes a request to a server that has a different
-domain than the servere, incorrect headers will be forwarded.</para>
+domain than the server, incorrect headers will be forwarded.</para>
<para>For example, assume your OpenLaszlo Server is hosted in the myhost.com domain. If your
application makes a request to a server that lives in myhost.com, then the right
Modified: openlaszlo/branches/paperpie/docs/src/developers/data-structures.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/data-structures.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/data-structures.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -7,8 +7,8 @@
The term <indexterm significance="preferred"><primary>data</primary></indexterm><glossterm>data</glossterm> refers to numbers, characters, or text
in a form that can be displayed or manipulated by
a Laszlo application. The specific form that data takes in a Laszlo application
-is either an XML document (or fragment) or a Javascript object. This chapter
-contains a brief introduction to <indexterm significance="preferred"><primary>XML</primary></indexterm><glossterm>XML</glossterm> and the associated <indexterm significance="preferred"><primary>XPath syntax</primary></indexterm><glossterm>XPath syntax</glossterm>. Javascript objects are
+is either an XML document (or fragment) or a JavaScript object. This chapter
+contains a brief introduction to <indexterm significance="preferred"><primary>XML</primary></indexterm><glossterm>XML</glossterm> and the associated <indexterm significance="preferred"><primary>XPath syntax</primary></indexterm><glossterm>XPath syntax</glossterm>. JavaScript objects are
described in the section on Objects in the <xref linkend="language-preliminaries"/>.
</para>
@@ -96,7 +96,12 @@
KBytes for the combined length of an element's attributes and the
name of the element.</para></listitem></itemizedlist>
<para/><section><title>Whitespace</title>
-<para>Handling of "whitespace" (spaces, tabs, linefeeds and carriage returns) is one of the reasons why XML can be problematic as an unambiguous data interchange format, because applications make different assumptions about how whitespace is to be handled. In OpenLaszlo applications this problem is complicated by the fact that whitespace is handled differently on proxied and SOLO applications.</para>
+<para>Handling of "whitespace" (spaces, tabs, linefeeds and carriage returns) is one of the reasons why XML can be problematic as an unambiguous data interchange format, because applications make different assumptions about how whitespace is to be handled.
+
+<!-- remove the following line, since proxied and SOLO apps are now handeled the same way -->
+<!-- LPP-984 IORIO 26 sep 2007 -->
+<!-- In OpenLaszlo applications this problem is complicated by the fact that whitespace is handled differently on proxied and SOLO applications. -->
+</para>
<para>
In OpenLaszlo applications, the runtime doesn't trim whitespace. Rather, it totally removes text
nodes which have <emphasis role="em">all</emphasis> whitespace. Like, for example</para>
@@ -117,9 +122,13 @@
<para>
The lesson here is that handling whitespace can be tricky and that you should pay careful attention to it if your data does not appear as you expect, especially if the behavior changes between SWF and DHTML implementations of the same program.
</para>
+
<para condition="dhtml">
For apps running in DHTML, in SOLO mode, the web browser's XML parser is
-very picky about the data source. This may result in applications which run when compiled to SWF failing to run when compiled to SWF.
+very picky about the data source. This may result in applications which run when
+<!-- I'm guessing this is a mistake. IORIO 26 sep 2007 -->
+<!-- compiled to SWF failing to run when compiled to SWF. -->
+compiled to SWF failing to run when compiled to DHTML.
</para>
<para>
The server delivering the data must mark the HTTP content type header as
Modified: openlaszlo/branches/paperpie/docs/src/developers/databinding.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/databinding.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/databinding.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -7,7 +7,7 @@
with the <ulink url="../guide/data-tutorial.html" type="laszlo-dguide">tutorials</ulink>.
</para>
<para/><section><title>Preview of databinding</title>
-<para>By "databinding" we mean the automatic association of a value in an XML data structure with an element in the LZX view hierarchy of the application. This chapter explores various aspects of databinding and manipulation in OpenLaszlo applications. Before going into spefici details, we'll start with a conceptual overview of how data is represented in LZX applications, and the APIs for manipulating it.</para>
+<para>By "databinding" we mean the automatic association of a value in an XML data structure with an element in the LZX view hierarchy of the application. This chapter explores various aspects of databinding and manipulation in OpenLaszlo applications. Before going into specific details, we'll start with a conceptual overview of how data is represented in LZX applications, and the APIs for manipulating it.</para>
<para/><section><title>Types of data objects</title>
<para>
A dataset (<indexterm><primary>LzDataset</primary></indexterm><classname>LzDataset</classname>) is two things:</para>
@@ -151,7 +151,7 @@
or a instance of one of its subclasses.
</para>
<para>A dataset is an instantiation of the <indexterm><primary>LzDataset</primary></indexterm><classname>LzDataset</classname> class. An <indexterm><primary>LzDataset</primary></indexterm><classname>LzDataset</classname>
-is a Javascript object that provides a <glossterm>Document Object
+is a JavaScript object that provides a <glossterm>Document Object
Model</glossterm> (DOM) API for accessing, manipulating, and creating
XML elements and attributes in memory. These APIs are discussed in
<xref linkend="databinding"/>. The dataset also has APIs that
@@ -394,10 +394,10 @@
<para/></section><section><title>Dataset Scope</title>
<para>
-If specified on the canvas, datasets are visible to and accesible by the entire application. Datasets can also be local to a class.
+If specified on the canvas, datasets are visible to and accessible by the entire application. Datasets can also be local to a class.
</para>
<itemizedlist spacing="compact"><listitem><para>Datasets will automatically name themselves <literal>localdata</literal> if a name is not specified </para></listitem><listitem><para>Local datapath syntax is
-datapath="local:<emphasis role="i">reference.to.dataset.relative.to.parent</emphasis>:/path" </para></listitem><listitem><para> The name of the dataset can be omitted fromm the datapath if the dataset name is the default 'localdata', e.g. 'local:classroot:/' can be used instead of 'local:classroot.localdata:/' for a dataset named localdata in the classroot</para></listitem></itemizedlist>
+datapath="local:<emphasis role="i">reference.to.dataset.relative.to.parent</emphasis>:/path" </para></listitem><listitem><para> The name of the dataset can be omitted from the datapath if the dataset name is the default 'localdata', e.g. 'local:classroot:/' can be used instead of 'local:classroot.localdata:/' for a dataset named localdata in the classroot</para></listitem></itemizedlist>
<para>
Here is a simple program that illustrates use of local datasets (the file tests/data, a sample XML file is included in this directory also.)
</para>
@@ -1183,7 +1183,7 @@
JavaScript provides easy casting from string to numeric data types. The $path{...} syntax is defined to return a string, which can be used to assign a value to an attribute. You can combine attributes to preform calculations based on strings returned from a $path{...} inquiry on a dataset.
</para>
<para>
-Say, for example that you had a dataset that contained temperatures in Farenheit that you wished to convert to centegrade. You would have to create an intermediate attribute that binds to the (possibly replicated) path constraint and then bind your text field to a calculation on that attribute. Something like:</para>
+Say, for example that you had a dataset that contained temperatures in Fahrenheit that you wished to convert to Centigrade. You would have to create an intermediate attribute that binds to the (possibly replicated) path constraint and then bind your text field to a calculation on that attribute. Something like:</para>
<example role="live-example"><title>calculations on $path{} values</title><programlisting>
<attribute name='intermediate' value="$path{'degf'}" \>
<attribute name='text' value="${Number(intermediate) * 5 / 9}" />
@@ -1268,7 +1268,7 @@
numbers and display it. Then event is sent when the
<indexterm><primary><literal>setXPath()</literal></primary></indexterm><methodname>setXPath()</methodname> method is invoked on the
datapointer. Typically, a problem like this would be easier to program
-using Javascript's built-in arrays, but this version illustrates the
+using JavaScript's built-in arrays, but this version illustrates the
data-driven approach. It also introduces the concept of data
replication, which is explained in more detail later in this
document.</para>
@@ -2739,7 +2739,7 @@
<fixme>
.. Cleanup structure a bit and add nicer intro
-.. There should be a discussion early of LzNodes and LzDatanodes as well as the special 'datapath' attribute of LzNodes that takes an XPath expression and binds the LzDatanodes to LzNodes (and replicates the LzNodes if the XPath matches multipel LzDatanodes). (edb: this is my defn of what Laszlo databinding *is*.)
+.. There should be a discussion early of LzNodes and LzDatanodes as well as the special 'datapath' attribute of LzNodes that takes an XPath expression and binds the LzDatanodes to LzNodes (and replicates the LzNodes if the XPath matches multiple LzDatanodes). (edb: this is my defn of what Laszlo databinding *is*.)
.. move/splice descrition of datasource/dataset with data transport chapter
Modified: openlaszlo/branches/paperpie/docs/src/developers/debugging.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/debugging.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/debugging.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -273,7 +273,20 @@
</canvas>
</programlisting><?lzx-edit programs/debugging-$5.lzx></example?>
<calloutlist><callout arearefs="N10239"><para>The (only) argument to <indexterm><primary><literal>Debug.write()</literal> method</primary></indexterm><methodname>Debug.write()</methodname> is a string, so the value of <literal>canvas.subviews</literal> is not inspectable.</para></callout><callout arearefs="N10243"><para>The second argument to <indexterm><primary><literal>Debug.write()</literal> method</primary></indexterm><methodname>Debug.write()</methodname> is an non-string Object, so it is inspectable.</para></callout></calloutlist>
-<para/></section><section><title>Conditional Compilation of Debugging Code</title>
+<para/></section>
+<section>
+<title>Generating a bug report</title>
+<para>If you encounter a bug that prints a message in the debugger and you believe it is an OpenLaszlo bug, take the following steps to generate a bug report:</para>
+<orderedlist spacing="compact">
+<listitem><para>Enable Backtrace in the developer console</para></listitem>
+<listitem><para>Provoke the error</para></listitem>
+<listitem><para>Click on the debugger message to `inspect` it</para></listitem>
+<listitem><para>Invoke `Debug.bugReport()` in the debugger</para></listitem>
+<listitem><para>Copy and Paste the output into your bug report</para></listitem>
+</orderedlist>
+<para>The Bug Report gives details of the exact build of OpenLaszlo that you are reporting on, the detailed error message, backtrace, and the details of all objects involved.</para>
+</section>
+<section><title>Conditional Compilation of Debugging Code</title>
<para>
Sometimes you may have computations that you need to make only when you're debugging an application. For example, you may include some time stamps in order to measure performance of certain sections of code.
</para>
@@ -320,7 +333,7 @@
By default an object is described by
its properties, a function by its name (if available).</para>
-<para>In addtion to
+<para>In addition to
Debug.write, Debug.warn, Debug.info, Debug.format, there are utilities for determining client environment (Debug.versionInfo() and others)
</para>
<itemizedlist spacing="compact"><listitem><para>
@@ -457,15 +470,21 @@
<para/></section><section><title condition="dhtml">Debugging in DHTML</title>
<para/><section><title>Using the Firebug extension</title>
<para>
- For debugging the DHTML runtime, we recommend the <ulink url="http://getfirebug.com/">FireBug</ulink> extension to FireFox. If Firebug reports an error (with a little tiny red X in the bottom right hand corner of your firefox window) then there is probably a bug in your code or an OpenLaszlo bug. The errors reported by FireBug can be very obscure, but they usually happen when you are dereferencing a null pointer.
+ For debugging the DHTML runtime, we recommend the <ulink url="http://getfirebug.com/">Firebug</ulink> extension to Firefox. If Firebug reports an error (with a little tiny red X in the bottom right hand corner of your Firefox window) then there is probably a bug in your code or an OpenLaszlo bug. The errors reported by Firebug can be very obscure, but they usually happen when you are dereferencing a null pointer.
</para>
<para>
Firebug is more useful if you compile your DHTML application under debug mode (<literal>debug=true</literal>) so that method names show up in firebug stack traces. Dropping down the arrow next to an exception in firebug will show a complete stack trace - often helpful for tracking down the root cause. Please file bugs with a stack trace if possible!
</para>
<para>
When you're compiling to DHTML, you generally use a two-step/two debugger process. It is always a good practice for you to have Firebug, because the OpenLaszlo debugger does not catch _all_ errors (it would be too much overhead to do so). We try to make our code debuggable in Firebug, as much as possible, but there are several limitations:</para>
-<itemizedlist spacing="compact"><listitem><para>Firebug does not know about our class system, so it cannot display our objects as intelligently as our debugger, and </para></listitem><listitem><para>Firebud does not understand OpenLaszlo #file and #line declarations, so it cannot give as accurate error locations as our debugger does. </para></listitem></itemizedlist>
+<itemizedlist spacing="compact"><listitem><para>Firebug does not know about our class system, so it cannot display our objects as intelligently as our debugger, and </para></listitem><listitem><para>Firebug does not understand OpenLaszlo #file and #line declarations, so it cannot give as accurate error locations as our debugger does. </para></listitem></itemizedlist>
+<!-- added not about script running slowly error to fix JIRA-LPP-4846, IORIO 7 oct 2007 -->
+<note><para>If you have Firebug enabled in Firefox, the LZX debugger echos
+all messages to the Firebug console, preserving objects. The Firebug
+debugger will attempt to interpret an object with a `length` field as
+an array and try to print every array element. This may cause a
+'Script Running Slowly' error. Disabling Firebug will prevent that.</para></note>
<para/></section><section><title>The <debug> tag</title>
<para>
In DHTML, the debugger appears as a separate HTML frame, rather than
Modified: openlaszlo/branches/paperpie/docs/src/developers/delegates.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/delegates.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/delegates.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -73,7 +73,7 @@
del.register(sender, event);
</programlisting>
-<para/></section><section><title>Relationship betwen delegates and tag-generated events</title>
+<para/></section><section><title>Relationship between delegates and tag-generated events</title>
<para>
The <indexterm><primary>LzDelegate</primary></indexterm><classname>LzDelegate</classname> class is used to create delegates in script.
Modified: openlaszlo/branches/paperpie/docs/src/developers/deployers-index.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/deployers-index.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/deployers-index.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -7,7 +7,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"-->
<book xmlns:xi="http://www.w3.org/2003/XInclude">
<title>System Administrator's Guide to Deploying OpenLaszlo Applications</title>
- <titleabbrev>Deployer Guide</titleabbrev>
+ <titleabbrev>Administrator's Guide</titleabbrev>
<part id="preface">
<xi:include href="deploy-preface.dbk"/>
</part>
Modified: openlaszlo/branches/paperpie/docs/src/developers/designers.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/designers.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/designers.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -11,7 +11,7 @@
</para>
<para/><section><title>Leaning to Think Laszlorificly</title>
<para>
-With OpenLaszlo technology, web appllication designers are freed from the familiar limitations of static, linear, page-based task flow.
+With OpenLaszlo technology, web application designers are freed from the familiar limitations of static, linear, page-based task flow.
Your visions of dynamic, data-driven, concise and intelligent UI can become a reality. But you may need to change your thinking
a little bit, because things are possible with OpenLaszlo that aren't possible with most other technologies. And while it is not necessary for you to learn to write code in order to be an effective designer on an OpenLaszlo project,
a familiarity with the basic structure and features of the LZX language will help you understand how to approach your task.
@@ -49,7 +49,7 @@
Yet all teams need to spend time dissecting the problem, brainstorming, and arriving
at a unanimous understanding of, and agreement on the solution. </para>
<para>
-These are some time-proven steps in the process: </para>
+These are some time-prooven steps in the process: </para>
<orderedlist spacing="compact"><listitem><para><indexterm significance="preferred"><primary>Wire-frames</primary></indexterm><glossterm>Wire-frames</glossterm>. Wire-frame examples of layouts will help begin the visualization of the pieces as a whole.</para>
These are basic definitions of placement for the UI; often including navigation, branding and content. </listitem><listitem><para><indexterm significance="preferred"><primary>Storyboards</primary></indexterm><glossterm>Storyboards</glossterm>. Once a structure has been defined, storyboards of both general and detailed task flow help to refine and
communicate the vision of interactivity. Storyboards can begin as simple flowcharts and evolve into pictures of each state of each element.
@@ -110,7 +110,7 @@
Fonts
</title>
<para>
-Your options with regard to fonts differ greatly dependin on whether the application will be compiled to SWF or DHTML. In applications compiled to SWF, you have the option to include virtually whatever font you like within the application. Applications that are to be compiled to DHTML, on the other hand, are limited to those fonts that are commonly found in all runtime environments (that is, all supported browsers and operating systems).
+Your options with regard to fonts differ greatly depending on whether the application will be compiled to SWF or DHTML. In applications compiled to SWF, you have the option to include virtually whatever font you like within the application. Applications that are to be compiled to DHTML, on the other hand, are limited to those fonts that are commonly found in all runtime environments (that is, all supported browsers and operating systems).
</para>
<para condition="swf">
OpenLaszlo supports all True Type Format (TTF) fonts. In applications compiled to SWF, embedded fonts ensure that the appearance of type within your application will be
Modified: openlaszlo/branches/paperpie/docs/src/developers/ecmascript-and-lzx.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/ecmascript-and-lzx.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/ecmascript-and-lzx.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -114,11 +114,13 @@
</entry><entry>
<simplelist><member type="vert"><para><literal role="unsupported">EvalError(message)</literal></para></member><member type="vert"><para><literal role="unsupported">new EvalError(message)</literal></para></member><member type="vert"><para><literal role="unsupported">toString()</literal></para></member></simplelist>
</entry></row><row><entry>
- <para><literal role="unsupported">Function</literal></para>
+ <para><literal role="supported">Function</literal></para>
+ </entry>
+ <!-- fix LPP-4338: apply and call are now supported. IORIO 28 sep 2007 -->
+ <entry>
+ <simplelist><member type="vert"><para><literal role="supported">Function.prototype</literal></para></member><member type="vert"><para><literal role="supported">constructor</literal></para></member><member type="vert"><para><literal role="supported">length</literal></para></member></simplelist>
</entry><entry>
- <simplelist><member type="vert"><para><literal role="unsupported">Function.prototype</literal></para></member><member type="vert"><para><literal role="unsupported">constructor</literal></para></member><member type="vert"><para><literal role="unsupported">length</literal></para></member></simplelist>
- </entry><entry>
- <simplelist><member type="vert"><para><literal role="unsupported">Function(...)</literal></para></member><member type="vert"><para><literal role="unsupported">new Function(...)</literal></para></member><member type="vert"><para><literal role="unsupported">apply(this, args[])</literal></para></member><member type="vert"><para><literal role="unsupported">call(this, ...)</literal></para></member><member type="vert"><para><literal role="unsupported">toString()</literal></para></member></simplelist>
+ <simplelist><member type="vert"><para><literal role="supported">Function(...)</literal></para></member><member type="vert"><para><literal role="supported">new Function(...)</literal></para></member><member type="vert"><para><literal role="supported">apply(this, args[])</literal></para></member><member type="vert"><para><literal role="supported">call(this, ...)</literal></para></member><member type="vert"><para><literal role="unsupported">toString()</literal></para></member></simplelist>
</entry></row><row><entry>
<para><literal role="supported">Global</literal></para>
</entry><entry>
Modified: openlaszlo/branches/paperpie/docs/src/developers/editing-lzx.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/editing-lzx.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/editing-lzx.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -306,7 +306,7 @@
with the following remapping</para>
<programlisting>imap ^D <ESC>`[</programlisting>
<para>Now, if you hit control-D in insert mode, you leave
- where tou entered the insert mode.</para>
+ where you entered the insert mode.</para>
<para>Even more useful is the ability to repeat a previous
command without changing the cursor position. Since this is
pretty much always the behavior you want, you can remap ".",
Modified: openlaszlo/branches/paperpie/docs/src/developers/fonts.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/fonts.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/fonts.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -11,7 +11,7 @@
particular size, style, and typeface.
There are several different computer representations for fonts.
The most widely known are Adobe Systems, Inc.'s
- PostScript font definitions and Apple's <ulink url="http://developer.apple.com/fonts/TTRefMan/RM06/Chap6.html">TrueType.</ulink>
+ Postscript font definitions and Apple's <ulink url="http://developer.apple.com/fonts/TTRefMan/RM06/Chap6.html">TrueType.</ulink>
</para>
<anchor id="fonts.pixel-fonts"/>
<para/><section><title>Runtime considerations</title>
@@ -29,7 +29,7 @@
We make every effort to make font metrics in DHTML match those in swf. They may not match exactly but they're very close.
</para>
<para>
-It is virtually impossible to acheive pixel-perfect font
+It is virtually impossible to achieve pixel-perfect font
rendering across all runtimes. However, with minimal changes for
alignment and font names, you can usually make SWF and DHTML versions of your application essentially indistinguishable with regard to appearance of text.
</para>
@@ -68,7 +68,7 @@
you vary their opacity. Here is a summary of the differences:
</para>
-<para/></section><section><title>Summary of diffrences between client and embedded fonts</title>
+<para/></section><section><title>Summary of differences between client and embedded fonts</title>
<para>
<emphasis role="b">Client fonts</emphasis>
</para>
@@ -259,9 +259,9 @@
<para/></section><section><title>Syntax</title>
<para>
-There are two ways to identify which font your application, or any element of it, should to use: the <indexterm><primary>font</primary></indexterm><sgmltag class="attribute">font</sgmltag> attribute on <indexterm><primary>view</primary></indexterm><sgmltag class="element"><view></sgmltag><remark role="fixme">[unknown tag]</remark>
+There are two ways to identify which font your application, or any element of it, should use: the <indexterm><primary>font</primary></indexterm><sgmltag class="attribute">font</sgmltag> attribute on <indexterm><primary>view</primary></indexterm><sgmltag class="element"><view></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: view-->
-s and classes derived from views, ant the <indexterm><primary>font</primary></indexterm><sgmltag class="element"><font></sgmltag>.
+s and classes derived from views, and the <indexterm><primary>font</primary></indexterm><sgmltag class="element"><font></sgmltag>.
</para>
<para/><section><title>The "font" attribute in opening tags</title>
<para>
@@ -431,7 +431,7 @@
</para>
<para/></section><section><title>Comparison to CSS</title>
<para>
- The OpenLaszlo <indexterm><primary>font</primary></indexterm><sgmltag class="attribute">font</sgmltag> attribute is similar to the CSS 'font' and 'font-family' properties: http://www.w3.org/TR/2004/CR-CSS21-20040225/fonts.html#font-family-prop.
+ The OpenLaszlo <indexterm><primary>font</primary></indexterm><sgmltag class="attribute">font</sgmltag> attribute is similar to the CSS 'font' and 'font-family' properties: <ulink url="http://www.w3.org/TR/2004/CR-CSS21-20040225/fonts.html#font-family-prop">here</ulink>.
The remaining differences are:
</para>
<itemizedlist spacing="compact"><listitem><para>LZX specifies the font as an XML attribute. HTML+CSS specifies it is a CSS property.</para></listitem><listitem><para>An OpenLaszlo 'font' can only be a list of font names. This makes it more similar to the CSS 'font-family' than to the CSS 'font', which is a shorthand property that can also accept font size, style, variant, weight, and line-height values.</para></listitem><listitem><para>CSS defines the additional generic font families 'cursive' and 'fantasy' , as well as "system font" names 'caption', 'icon', 'menu', 'message-box', 'small-caption', and 'status-bar'. (Generic family name definitions, below, let the application or library developer define these system names.)</para></listitem><listitem><para>CSS allows multiword font names to be quoted, e.g. "Times New Roman" (where the quotes are part of the value). LZX does not allow this.</para></listitem></itemizedlist>
@@ -1040,7 +1040,7 @@
</para>
<para/></section><section><title condition="swf">Performance considerations</title>
<para>
-Embedded fonts (in applications compiled to SWF) increase the size the size of the application.
+Embedded fonts (in applications compiled to SWF) increase the size of the application.
</para>
<para>When deciding what embedded fonts to use, you may need to take into account how
fonts affect the size, hence download time, of your application. Here are some heuristics to help you
Modified: openlaszlo/branches/paperpie/docs/src/developers/initialization-and-instantiation.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/initialization-and-instantiation.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/initialization-and-instantiation.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -13,7 +13,7 @@
application.</para>
<para>
-This chapter assumes you are familar with classes and objects. In the
+This chapter assumes you are familiar with classes and objects. In the
descriptions below, we distinguish between <indexterm significance="preferred"><primary>creation</primary></indexterm><glossterm>creation</glossterm>, by
which we mean storage for the object is allocated and constant
properties assigned — a process that cannot be customized — and
@@ -63,7 +63,7 @@
When a <glossterm>node</glossterm> is instantiated, its
attributes are the attributes explicitly given in the object, plus any
attributes that the class specifies. Similarly, its children will be
-the childen explicitly given in the object, plus any children that are
+the child en explicitly given in the object, plus any children that are
specified in the class. The class <indexterm><primary><literal>construct()</literal></primary></indexterm><methodname>construct()</methodname> method
is called, with these attributes and the parent view.
</para>
Modified: openlaszlo/branches/paperpie/docs/src/developers/language-preliminaries.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/language-preliminaries.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/language-preliminaries.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -2,8 +2,8 @@
<title>Language Preliminaries</title>
-<para>LZX is an object oriented, tag-based language that uses XML and JavaScript syntax to create the presentation layer
-of rich internet applications. Typically these applications are compiled by the
+<para>LZX is an object-oriented, tag-based language that uses XML and JavaScript syntax to create the presentation layer
+of rich Internet applications. Typically these applications are compiled by the
OpenLaszlo compiler. They may be deployed as standalone files, or they may be
served by the OpenLaszlo Server.
The specification of the language includes both a set of XML tags and a set of JavaScript APIs.</para>
@@ -22,19 +22,19 @@
downloaded as byte code for a target rendering engine.</para>
<para>In the current implementation of the OpenLaszlo platform, LZX programs are compiled in the OpenLaszlo Server and downloaded either as
-Flash movies (.swf files) to be executed in the Flash Player plugged into an Internet browser, or compiled to DHTML which is downloaded to be executed by the browser's JavaScript engine. It's important to understand that the Flash Player is used only as an execution/rendering engine for the generated byte code, and there's
+Flash movies (.swf files) to be executed in the Flash Player plugged into an Internet browser, or compiled to DHTML which is downloaded to be executed by the browser's JavaScript engine. It's important to understand that the Flash Player is used only as an execution/rendering engine for the generated byte code: there's
nothing inherent in LZX that marries it to Flash. In particular, LZX does not employ or rely upon the Flash object model.</para>
<para>Similarly, because LZX programs are compiled by the OpenLaszlo Server the use of JavaScript in LZX programs is subtly
different from its use in traditional web applications in which JavaScript is used to do things like communicate with the browser
-or generate HTML pages. Those functions are basically irrelevant in LZX applications. Thus although the language design is
+or generate HTML pages. Those functions are basically irrelevant in LZX applications. Thus, although the language design is
rather traditional, the programming paradigm is fundamentally new.</para>
-<para>This chapter summarizes the traditional and innovative aspects of LZX. It's an overview, not a tutorial; after reading it you will be better able to decide how to go about learning the language. Depending on your background and experience, you may determine that you need to go learn some more about XML or object oriented programming before addressing LZX. On the other hand, if you find these concepts accessible you may want to jump right in and begin coding, in which case we suggest starting with the <ulink url="../guide/laszlo_basics.html" type="laszlo-dguide">OpenLaszlo Basics</ulink> tutorial.</para>
+<para>This chapter summarizes the traditional and innovative aspects of LZX. It's an overview, not a tutorial; after reading it you will be better able to decide how to go about learning the language. Depending on your background and experience, you may determine that you need to go learn some more about XML or object-oriented programming before addressing LZX. On the other hand, if you find these concepts accessible, you may want to jump right in and begin coding, in which case we suggest starting with the <ulink url="../guide/laszlo_basics.html" type="laszlo-dguide">OpenLaszlo Basics</ulink> tutorial.</para>
<para/><section><title>Overview of Syntax and Semantics</title>
-<para>In LZX, XML tags are used to create JavaScript objects, and Javascript is used inside of LZX programs to
+<para>In LZX, XML tags are used to create JavaScript objects, and JavaScript is used inside of LZX programs to
manipulate objects created by tags. In most cases, anything that can be done with a tag can be accomplished in
JavaScript, and vice versa. However, this equivalence is not universally true, and moreover one technique is
virtually always vastly superior to another in any situation. <emphasis role="em">Learning</emphasis> LZX basically comes down to
@@ -46,7 +46,7 @@
<para>LZX strictly adheres to XML and JavaScript syntax</para>
<note><para>
In earlier releases, LZX did not enforce case sensitivity in JavaScript. Since OpenLaszlo release 3.0 LZX has been a completely
-case sensitive language. See below for a more in depth discussion.
+case-sensitive language. See below for a more in-depth discussion.
</para></note>
<para>The following sections offer a brief refresher on the two kinds of
@@ -93,7 +93,7 @@
</para></note>
<para/></section></section><section id="language-preliminaries.javascript"><title>JavaScript</title>
-<para>JavaScript is a language originally written at Netscape by Brendan Eich for incorporation in the Netscape 2.0 browser. It was instantly successful and widely adopted in other browsers, and to preserve its emerging value as a standard, the European Computer Manufacturer's Association (ECMA) codified the language as ECMAScript and now maintains control of its evolution. Although there may be subtle differences between any implementation of JavaScript and the language formally specified by the standards body, in colloquial usage the terms JavaScript and ECMAScript are often used interchangeably. While perhaps a little more accurate to say that "ECMAScript" refers to the pure language while "JavaScript" means both the language and the associated libraries that are available on most browsers, in this book we follow general usage and use the terms loosely, trusting that it will be clear from the context what we're talking about. The term "script" refers to any (procedural) code written in Javascript.</para>
+<para>JavaScript is a language originally written at Netscape by Brendan Eich for incorporation in the Netscape 2.0 browser. It was instantly successful and widely adopted in other browsers, and to preserve its emerging value as a standard, the European Computer Manufacturer's Association (ECMA) codified the language as ECMAScript and now maintains control of its evolution. Although there may be subtle differences between any implementation of JavaScript and the language formally specified by the standards body, in colloquial usage the terms JavaScript and ECMAScript are often used interchangeably. While perhaps a little more accurate to say that "ECMAScript" refers to the pure language while "JavaScript" means both the language and the associated libraries that are available on most browsers, in this book we follow general usage and use the terms loosely, trusting that it will be clear from the context what we're talking about. The term "script" refers to any (procedural) code written in JavaScript.</para>
<para>LZX incorporates a partial implementation of the <ulink url="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA-262 Edition 3 specification</ulink>.</para>
@@ -103,11 +103,11 @@
<para>Depending on your background, you may find certain aspects of LZX familiar or foreign. For example, if you have experience with Java but not JavaScript, you will need to be aware of key differences in the languages, in particular with regard to data typing, the object model, and the scope or namespace of variables.</para>
-<para>Like other so-called scripting languages such as Perl and Python, Javascript is a loosely-typed language — you can declare a variable without specifying its type. This makes for rapid prototyping and arguably more readable code, but it also makes it possible for data-type errors to go undetected.</para>
+<para>Like other so-called scripting languages such as Perl and Python, JavaScript is a loosely-typed language — you can declare a variable without specifying its type. This makes for rapid prototyping and arguably more readable code, but it also makes it possible for data-type errors to go undetected.</para>
-<para>JavaScript's approach to object-oriented programming lacks the rigor or Java's. There are no packages or interfaces, for example, nor is it possible to finalize classes. Finally, the behavior of local and global variables in JavaScript is sometimes surprising to Java programmers.</para>
+<para>JavaScript's approach to object-oriented programming lacks the rigor of Java's. There are no packages or interfaces, for example, nor is it possible to finalize classes. Finally, the behavior of local and global variables in JavaScript is sometimes surprising to Java programmers.</para>
-<para>Conversely if you are an experienced JavaScript programmer you may have to "unlearn" certain assumptions, in particular with regard to the availability of certain libraries and functions. For example, while the Math library is present in LZX, the the REGXEP library for regular expressions is not. Moreover, LZX has a more complete object oriented programming model than does simple JavaScript. That is, LZX has classes and inheritance.</para>
+<para>Conversely, if you are an experienced JavaScript programmer you may have to "unlearn" certain assumptions, in particular with regard to the availability of certain libraries and functions. For example, while the Math library is present in LZX, the the REGXEP library for regular expressions is not. Moreover, LZX has a more complete object-oriented programming model than does simple JavaScript. That is, LZX has classes and inheritance.</para>
<para>If you have experience with neither Java nor JavaScript you may want to first work through a JavaScript tutorial like the ones available at <ulink url="http://www.w3schools.com/js/default.asp">w3schools.com</ulink> before delving too deeply into LZX.</para>
@@ -146,7 +146,8 @@
<para>and in both cases the background color of <literal>myview</literal> could be accessed by subsequent code as <literal>myview.bgcolor</literal> . The "dot" convention thus provides a convenient way of referring to objects regardless of how they came into existence — that is, whether by declarative tag or procedural code.</para>
<para/></section><section><title>Case Sensitivity</title>
<para>
-OpenLaszlo entirely case-sensitive. This means that whenever you use a variable it must be in the case in which it was defined.
+<!-- fix typo per LPP-4847 IORIO 7 oct 2007 -->
+OpenLaszlo is entirely case-sensitive. This means that whenever you use a variable it must be in the case in which it was defined.
</para>
<para/></section><section><title>Implicit "this" and "with"</title>
@@ -155,7 +156,7 @@
'implicit this' is a term we use to describe the behavior of free
references in LZX methods and handlers. In LZX classes, the object
bound to `this` is implicitly 'in scope' in all methods and handlers,
-as it is in Java (this is _not_ the case in Javascript). We added
+as it is in Java (this is _not_ the case in JavaScript). We added
this feature to LZX because we felt it led to more intuitive and
compact code.
</para>
@@ -211,7 +212,7 @@
`global.attr =`.
</para>
<para>
-`with` is a Javascript primitive that can be used to establish scope. Free variables in the body of a `with` will be looked up first in the object that is the argument (and then in whatever the enclosing scope is). Functions close over their scope when they are defined, so by wrapping `with (_root)` around each global function definition, free references in functions will be looked up in the global context (as opposed to the SWF implementation, where global functions are given a null scope, so when they are called from the idle context, their free references appear unbound).
+`with` is a JavaScript primitive that can be used to establish scope. Free variables in the body of a `with` will be looked up first in the object that is the argument (and then in whatever the enclosing scope is). Functions close over their scope when they are defined, so by wrapping `with (_root)` around each global function definition, free references in functions will be looked up in the global context (as opposed to the SWF implementation, where global functions are given a null scope, so when they are called from the idle context, their free references appear unbound).
</para>
<para/><section><title>"this" in states and animators</title>
<para>
@@ -372,7 +373,7 @@
<para>In JavaScript, the <literal>this</literal> keyword is used to refer to the object through which the function was invoked. </para>
<para/></section><section><title>Handlers</title>
<para>
-A handler is like a method. But whereas a method is invoked by its name, a hander must be associated with a particular event. The handler
+A handler is like a method. But whereas a method is invoked by its name, a handler must be associated with a particular event. The handler
script will be executed when the referenced view receives an event
with this name. For example,</para>
@@ -411,11 +412,11 @@
<para>There are three general categories of methods and handler:</para>
<itemizedlist spacing="compact"><listitem><para> "On init" methods that are invoked when their parent object is created;</para></listitem><listitem><para> handlers that are invoked when their parent object receives a specified event;</para></listitem><listitem><para> named methods that are explicitly invoked by other methods.</para></listitem></itemizedlist>
-<para>Note that you can define a method using conventional Javascript syntax, but in LZX the preferred way to declare a method is with the <indexterm><primary>method</primary></indexterm><sgmltag class="element"><method></sgmltag><remark role="fixme">[unknown tag]</remark>
+<para>Note that you can define a method using conventional JavaScript syntax, but in LZX the preferred way to declare a method is with the <indexterm><primary>method</primary></indexterm><sgmltag class="element"><method></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: method-->
tag.</para>
-<para>Also note that in LZX, unlike many other object oriented systems,
+<para>Also note that in LZX, unlike many other object-oriented systems,
you can override a method in an instance of an object. This topic is
covered in <xref linkend="class-inheritance"/>.</para>
@@ -540,9 +541,9 @@
<para/></section></section><section><title>Data Access, Manipulation, and Binding</title>
<para>LZX is designed to make it easy to write data-driven applications in which the values of data sources define the appearance and actions of the program. It does this through tags and APIs that allow you to get access to data over http, manipulate XML data in memory, and, significantly, bind the data hierarchy to the view hierarchy.</para>
+<!-- fix broken xref per LPP-4847 IORIO 7 oct 2007 -->
+<para>The following paragraphs summarize these key features of the LZX data-handling architecture. <xref linkend="data-structures"/> discusses this subject in depth.</para>
-<para>The following paragraphs summarize these key features of the LZX data-handling architecture. <xref linkend="data"/> discusses this subject in depth.</para>
-
<para/><section><title>Data Access</title>
<para>LZX programs manipulate XML-formatted data, which may be</para>
@@ -568,7 +569,8 @@
<para>where <varname>testdata</varname> refers to a dataset defined earlier in the program.</para>
-<para>If this sounds a little abstract, well, it is. Therefore we'll keep the discussion short here and defer longer explanations to <xref linkend="data"/>; you may also want to examine some of the examples on <ulink url="http://www.laszlosystems.com/demos">http://www.laszlosystems.com/demos</ulink> to get a feel for what can be done when applications are truly data-driven.</para>
+<!-- fix broken xref per LPP-4847 IORIO 7 oct 2007 -->
+<para>If this sounds a little abstract, well, it is. Therefore we'll keep the discussion short here and defer longer explanations to <xref linkend="databinding"/>; you may also want to examine some of the examples on <ulink url="http://www.laszlosystems.com/demos">http://www.laszlosystems.com/demos</ulink> to get a feel for what can be done when applications are truly data-driven.</para>
<para>The key thing to understand is that while other languages and technologies have implemented merge algorithms that may appear similar on the surface, LZX's data binding is novel in the creation of program objects that retain a live connection with the entities of the data source.</para>
@@ -593,7 +595,7 @@
then from the point of view of JavaScript, this would be an lz.bob object.
</para>
<para>
-In earlier versions of LZX (before OpenLaszlo 4), there was an asymmetric mapping between tag and class names, often of the form LzFoo <—> <foo>, as in the correspondance between, say the class name <indexterm><primary>LzView</primary></indexterm><classname>LzView</classname> and the tag name <indexterm><primary>view</primary></indexterm><sgmltag class="element"><view></sgmltag>. (Notice in LzView the mixed case, and the absence of the period between lz and the tag name.) Also there was a distinction between LFC classes and user-created classes. The new lz.foo form is consistent across LFC classes and user-created classes. The old forms will still work, and they appear throughout this documentation and in example code. At some point, however, the old forms will probably be deprecated, and it would be a good practice to adopt the new form in your code.</para>
+In earlier versions of LZX (before OpenLaszlo 4), there was an asymmetric mapping between tag and class names, often of the form LzFoo <—> <foo>, as in the correspondence between, say the class name <indexterm><primary>LzView</primary></indexterm><classname>LzView</classname> and the tag name <indexterm><primary>view</primary></indexterm><sgmltag class="element"><view></sgmltag>. (Notice in LzView the mixed case, and the absence of the period between lz and the tag name.) Also there was a distinction between LFC classes and user-created classes. The new lz.foo form is consistent across LFC classes and user-created classes. The old forms will still work, and they appear throughout this documentation and in example code. At some point, however, the old forms will probably be deprecated, and it would be a good practice to adopt the new form in your code.</para>
<para/></section><section><title>How to Combine Tags and Script</title>
@@ -613,7 +615,7 @@
<para/></section><section><title>What's Meaningful</title>
-<para>Although the admixture of two different sets of language rules in one language does create opportunities for confusion, it's fairly easy to recognize how LZX programs are structured, and what kind of code goes where. There are only a few contexts in which script code can appear in LZX programs. After you learn to recognize these contexts you are unlikely to be confused about what syntax applies. Javascript is used:</para>
+<para>Although the admixture of two different sets of language rules in one language does create opportunities for confusion, it's fairly easy to recognize how LZX programs are structured, and what kind of code goes where. There are only a few contexts in which script code can appear in LZX programs. After you learn to recognize these contexts you are unlikely to be confused about what syntax applies. JavaScript is used:</para>
<itemizedlist spacing="compact"><listitem><para>between an opening and closing <literal><script></literal> and <literal></script></literal> tag;</para></listitem><listitem><para>between an opening and closing <literal><method></literal> and <literal></method></literal> tag;</para></listitem><listitem><para>between an opening and closing <literal><handler></literal> and <literal></handler></literal> tag;</para></listitem><listitem><para>with the double-quoted right hand value of an assignment statement within certain tags, such as <literal>oninit="<replaceable>script expression</replaceable>"</literal> .</para></listitem></itemizedlist>
Modified: openlaszlo/branches/paperpie/docs/src/developers/layout-and-design.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/layout-and-design.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/layout-and-design.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -136,7 +136,21 @@
</view>
</canvas>
</programlisting><?lzx-edit programs/layout-and-design-$3.lzx></example?>
-<para/></section><section><title>Horizontal and Vertical Boxes</title>
+<!-- added the following para and example to fix LPP-1030: IORIO 26 sep 2007 -->
+<para>There may be times when you would like to select between more than one
+layout in which to display your view. Options are a good way to do this
+You then override addSubview in your layout as shown in the code below. To get
+a better idea of what's going on, run the program with the debugger on.</para>
+<example role="live-example">
+ <title>Choosing between layouts</title>
+ <programlisting language="lzx">
+ <textobject><textdata fileref="programs/layout-and-design-$19.lzx"/></textobject>
+ </programlisting>
+</example>
+<?example role="live-example"><title>Choosing between layouts</title><programlisting role="lzx-embednew"><filename>layout-and-design-$19.lzx</filename><parameter/><code>
+
+</programlisting><?lzx-edit programs/layout-and-design-$19.lzx></example?>
+</section><section><title>Horizontal and Vertical Boxes</title>
<para>
In addition to layouts, LZX includes the <indexterm><primary>hbox</primary></indexterm><sgmltag class="element"><hbox></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: hbox-->
Modified: openlaszlo/branches/paperpie/docs/src/developers/lzunit.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/lzunit.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/lzunit.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -454,7 +454,7 @@
<para>Test-driven development demands thoughtful design. In the "waterfall" model, testing is the last phase, so programmers stumble through the implementation phase, not certain that the code will fulfill the requirements <emphasis role="i">because it is untested</emphasis>. In test-first development, the programmer must be accurate and specific about what the code is meant to accomplish, and design a test for that before going further.</para>
-<para>The strongest chessplayers play their best moves at the end of the game. The players who study the opening find that they drift into fearful territory, while the players proficient at endgames grow in confidence. Those endgame-savvy chessplayers are like "test-infected" developers who worked on the <emphasis role="i">last phase first</emphasis>: they always know where they're headed.</para>
+<para>The strongest chess players play their best moves at the end of the game. The players who study the opening find that they drift into fearful territory, while the players proficient at endgames grow in confidence. Those endgame-savvy chess players are like "test-infected" developers who worked on the <emphasis role="i">last phase first</emphasis>: they always know where they're headed.</para>
<para>A similar analogy: A well-trained chess student should be coached to play moves that are foolish at the start -- as practice for difficult situations in the future. Beck instructs that at the start of the TDD cycle to write a test that <emphasis role="i">fails</emphasis>. Red in the opening, green in the endgame.</para></section>
@@ -507,7 +507,7 @@
<section id="lzunit.count"><title>Counting Infinitely</title>
-<para>In test-driven development, we devise a successful test case first, and then we fail it (because we wrote the test first). We want the first button click to change "stop" to "go", and the second click to "stop". The easiest solution, I think, is to give the button a "go" attribute which is a boolean, where its initial state is "false".</para>
+<para>In test-driven development, we devise a successful test case first, and then we fail it (because we wrote the test first). We want the first button click to change "stop" to "go", and the second click to "stop". The easiest solution, I think, is to give the button a "go" attribute which is a Boolean, where its initial state is "false".</para>
<para>Sometimes I think I most often revisit the OpenLaszlo developers' guide <xref linkend="methods-events-attributes">methods, events, and attributes</xref>. This attribute is a simple one, though: we'll instantiate an instance of the button class, and assign it an attribute named "go", of the type boolean, with two values: "go" or "stop" according to the boolean expression "true" or "false".</para>
Modified: openlaszlo/branches/paperpie/docs/src/developers/media-resources.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/media-resources.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/media-resources.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -782,7 +782,7 @@
the Compiler Media Cache settings only affect the speed of
the OpenLaszlo compiler. The settings for the Media Cache
can affect server performance. See
- <ulink url="../deploy/" type="">The Deployer's
+ <ulink url="../deploy/" type="">The Administrator's
Guide</ulink>for details.</para>
<para>The example below provides a text input area for you
to type in urls that you'd like to test. To run the
Modified: openlaszlo/branches/paperpie/docs/src/developers/methods-events-attributes.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/methods-events-attributes.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/methods-events-attributes.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -7,7 +7,7 @@
In LZX, the concepts of methods, events, handlers and attributes are related to each other in a braid-like way. In this chapter we'll show you how they weave together.
</para>
<para>
-Attributes, events, methods and handlers are all properties of classes that define how instances of the class behave. Attributes represent the state of the instance. Events are signifiers that communicate with the rest of the application when something about the instance changes. Methods are blocks of Javascript that are executed when the method is invoked by name. Handlers are a special kind of method, each specifically tied to an event.
+Attributes, events, methods and handlers are all properties of classes that define how instances of the class behave. Attributes represent the state of the instance. Events are signifiers that communicate with the rest of the application when something about the instance changes. Methods are blocks of JavaScript that are executed when the method is invoked by name. Handlers are a special kind of method, each specifically tied to an event.
</para>
<para>
When an event occurs, any handler associated with that event gets called. Events may have any number of handlers, and handlers can be used to glue events from one instance to methods in another.
@@ -38,7 +38,7 @@
<para>
A <indexterm><primary>method</primary></indexterm><sgmltag class="element"><method></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: method-->
- is an 'action', expressed in Javascript you can perform on an instance. You can call it from any script.
+ is an 'action', expressed in JavaScript you can perform on an instance. You can call it from any script.
</para>
<para>
Methods may be defined inside any <indexterm><primary>node</primary></indexterm><sgmltag class="element"><node></sgmltag><remark role="fixme">[unknown tag]</remark>
@@ -206,7 +206,7 @@
tag.
</para>
<para>
-In addition to the events that you define, there are also events that are built into the LFC but which are not associated with any attribute. Examples includ <indexterm><primary>onclick</primary></indexterm><sgmltag class="attribute">onclick</sgmltag> and <indexterm><primary>onfocus</primary></indexterm><sgmltag class="attribute">onfocus</sgmltag>.
+In addition to the events that you define, there are also events that are built into the LFC but which are not associated with any attribute. Examples include <indexterm><primary>onclick</primary></indexterm><sgmltag class="attribute">onclick</sgmltag> and <indexterm><primary>onfocus</primary></indexterm><sgmltag class="attribute">onfocus</sgmltag>.
</para>
<para>
Unlike events in similar systems, OpenLaszlo's events are point-to-point, meaning that there is no general broadcast mechanism for events, and events do not trickle up or down the instance hierarchy. Declaring an event that no handler (or delegate) is listening for has no effect. This allows objects to publish many more events than they actually need to create at runtime; this allows you flexibility in prototyping.
@@ -266,7 +266,7 @@
</para>
<para/></section></section><section><title>Event Handlers</title>
<para>
-An event handler is the code that is executed when an event is recieved. An event can have zero or more handlers.
+An event handler is the code that is executed when an event is received. An event can have zero or more handlers.
</para>
<para>
There are two syntaxes that you can use to define handlers:</para>
@@ -388,7 +388,7 @@
</programlisting><?lzx-edit programs/methods-events-attributes-$7.lzx></example?>
<para/></section><section><title>Handlers that call methods</title>
<para>
-A handler may include javascript code to be executed when the associated event occurs, or it may reference a method that contains the code to be executed. To reference another method, use the <indexterm><primary>method</primary></indexterm><sgmltag class="attribute">method</sgmltag> attribute of the <indexterm><primary>handler</primary></indexterm><sgmltag class="element"><handler></sgmltag> tag.</para>
+A handler may include JavaScript code to be executed when the associated event occurs, or it may reference a method that contains the code to be executed. To reference another method, use the <indexterm><primary>method</primary></indexterm><sgmltag class="attribute">method</sgmltag> attribute of the <indexterm><primary>handler</primary></indexterm><sgmltag class="element"><handler></sgmltag> tag.</para>
<example role="live-example">
<title>Calling a method from a handler</title>
@@ -709,7 +709,7 @@
</programlisting><?lzx-edit programs/methods-events-attributes-$12.lzx></informalexample?>
<para/></section><section><title>Testing for existence of events in "legacy" code</title>
<para>
-As is explained in <xref linkend="delegates"/>, an event doesn't really exist unless and until there is a delegate registered to recieve it. In code that was written before the <indexterm><primary>event</primary></indexterm><sgmltag class="element"><event></sgmltag> tag became part of the language,
+As is explained in <xref linkend="delegates"/>, an event doesn't really exist unless and until there is a delegate registered to receive it. In code that was written before the <indexterm><primary>event</primary></indexterm><sgmltag class="element"><event></sgmltag> tag became part of the language,
before sending an event it was necessary to test whether the receiving delegate existed; otherwise an error resulted. In order to create your own event, you needed to create an attribute like this:</para>
<programlisting>
<attribute name="onsomeevent" value="null"/>
@@ -762,7 +762,7 @@
</view>
</programlisting>
-<para>Attributes can be an element of a tag or a property of a JavaSctipt
+<para>Attributes can be an element of a tag or a property of a JavaScript
class. Attributes that are properties of t
Attributes are usually declared and set in tags, but they can also
@@ -787,7 +787,7 @@
<example role="live-example">
- <title>Using the atrribute element to set an attribute value</title>
+ <title>Using the attribute element to set an attribute value</title>
<programlisting language="lzx">
<textobject><textdata fileref="programs/methods-events-attributes-$14.lzx"/></textobject>
</programlisting>
Modified: openlaszlo/branches/paperpie/docs/src/developers/performance.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/performance.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/performance.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -176,7 +176,7 @@
<para/></section><section><title>JavaScript Performance</title>
<para>
-Like most programming languages, Javascript often can express the same
+Like most programming languages, JavaScript often can express the same
algorithm in a number of different ways. Below are some tips on
choosing the more efficient of those ways.
</para>
@@ -325,8 +325,64 @@
</script>
</canvas>
</programlisting><?lzx-edit programs/performance-tuning-$3.lzx></example?>
-<para/></section></section><section><title>Arrays</title>
+<para/></section>
+<!-- added following section per LPP-1048, IDs vs Names IORIO 25 sep 2007 -->
+<section><title>Deep path references</title>
<para>
+It's expensive to do a lot of a.b.c.d.e.f references, compared to just
+one global.a reference, especially if the JavaScript code repeats the
+path again and again. Avoid code that repeats paths like "foo.bar.baz.x
+= 1; foo.bar.baz.y = 2;". Scripting languages like JavaScript don't have
+smart optimizing compilers like C++, so if you have a lot of repeated
+references to the same path, it does exactly what you tell it to again
+and again and doesn't optimize the code. So
+it's a good practice to load any deep path references into temporary
+variables if you're going to reference them more than once in the same
+function. Temporary local variables are cheap (it's a stack based VM),
+so it's much better to put something in a local than repeatedly
+dereferencing the same path again and again.</para>
+<para>
+Use short local paths when you can to wire up references between close
+relatives (parent/child/sibling), but it's ok to use global ids (with
+long distinct descriptive names like gFunnyLookingWidget) when you need
+to reference an important widget from elsewhere in the application. It's
+worth using global ids when it makes code less brittle. There's a
+trade-off between making the code that references the widget dependent
+on the relative path, and using global ids for unique important objects,
+but as long as you give the global id a good name, it's ok to use a
+global id since it makes it a lot easier to rearrange the layout of the
+user interface in ways that would break the paths (and then you don't
+have to come up with names for all the uninteresting intermediate
+views).
+</para>
+<para>
+It's worth judiciously using global ids to avoid having to scramble all
+over the program chasing down and patching up relative paths, whenever
+you change the position of a widget in the view hierarchy (which can be
+often, when the GUI is in flux).
+</para>
+<para>
+Don't use global ids in class definitions or sub-objects of classes,
+because all instances of that class will end up trying to use the same
+conflicting id. A good middle ground is to give the top level instance
+of a class a global id if necessary (where the object is instantiated,
+not in the class definition), and have the class declare relative
+shortcuts into deep parts of its internal structure that need to be
+referenced from other parts of the code, by putting attributes on the
+class like
+happycheckbox="$once{this.toppanel.emotioneditor.moodcheckboxes.happyche
+ckbox}". Then objects outside can use the shortcut without knowing the
+internal structure of the class, and objects deeply nested inside the
+class can also go "classroot.happycheckbox" to get the checkbox
+independent of its position in the hierarchy, instead of
+"parent.parent.parent.parent.toppanel.emotioneditor.moodcheckboxes.happy
+checkbox". Then if you rearrange your class's view hierarchy, you only
+have to change the long relative path reference in one place (the $once
+attribute of the class lexically containing the view).
+</para>
+</section>
+</section><section><title>Arrays</title>
+<para>
For an array <literal>A</literal>, <literal>A.push(b)</literal> is more expensive
than <literal>A[A.length] = b</literal>, which in turn is more expensive
than <literal>A[i] = b</literal> (i.e., if you already had the current
@@ -339,7 +395,7 @@
field.
</para>
<para>
-Note that if you do not need to know how many elements are in the array, using an object can be slightly more efficient, because it does not have to maintain the lenght field.
+Note that if you do not need to know how many elements are in the array, using an object can be slightly more efficient, because it does not have to maintain the length field.
</para>
<para>
The example below illustrates the various ways of adding elements to an array.
@@ -476,7 +532,7 @@
</programlisting><?lzx-edit programs/performance-tuning-$4.lzx></example?>
<para/></section><section><title>Loops</title>
<para>
-In older players, <literal>while</literal> loops are slightly more efficient than <literal>for ... in</literal> loops which are slightly more efficent than <literal>for</literal> loops. The difference is not enough that you should contort your code, but if any will work equally well, you should choose accordingly.
+In older players, <literal>while</literal> loops are slightly more efficient than <literal>for ... in</literal> loops which are slightly more efficient than <literal>for</literal> loops. The difference is not enough that you should contort your code, but if any will work equally well, you should choose accordingly.
</para>
<example role="live-example">
@@ -780,7 +836,7 @@
<para>The cost of a function call is about equivalent to three assignment
statements, so modularizing your code using function calls is not
going to create a big performance penalty. Each argument passed to a
-function call is about equvalent to an aditional assignment.</para>
+function call is about equivalent to an additional assignment.</para>
<example role="live-example">
<title>The cost of a function call</title>
@@ -989,11 +1045,11 @@
are central to an algorithm and executed many times) for expressions
that don't vary with the loop index and move them out of the loop.
This is just good standard programming practice, but it may not be
-quite so obvious in an object-oriented language such as Javascript.
+quite so obvious in an object-oriented language such as JavaScript.
</para>
<para>
The example below shows how accessing a deeply nested element of a
-object heirarchy is really a constant expression that can be moved out
+object hierarchy is really a constant expression that can be moved out
of a loop.
</para>
@@ -1164,7 +1220,9 @@
</canvas>
</programlisting><?lzx-edit programs/performance-tuning-$10.lzx></informalexample?>
-<para/></section></section><section><title>Optimizing runtime performance with pooling</title>
+<para/></section>
+</section>
+<section><title>Optimizing runtime performance with pooling</title>
@@ -1312,7 +1370,8 @@
</view>
</canvas>
</programlisting><?lzx-edit programs/performance-tuning-$11.lzx></informalexample?>
-<title>Data optimization checklist</title>
+<!-- Added section tags to fix docbook error IORIO 25 sep 2007 -->
+<section><title>Data optimization checklist</title>
<para>
Data pooling gives you the key tool in optimizing performance issues related to XML data. The philosophy
can be stated simply: </para>
@@ -1361,7 +1420,7 @@
</remark></para>
-<para/></section><section><title>Application Size</title>
+<para/></section></section><section><title>Application Size</title>
<para/><section><title>Measuring Application Size</title>
@@ -1373,7 +1432,7 @@
<para/></section><section><title>Optimizing Application Size</title>
-<para>Changing embedded datasets and resources to requested datasets and resources will reduce the initial download size of the application. If these assets are only used in some execution paths, th this will also reduce the total download size of the application, for use cases that avoid these execution paths.</para>
+<para>Changing embedded datasets and resources to requested datasets and resources will reduce the initial download size of the application. If these assets are only used in some execution paths, this will also reduce the total download size of the application, for use cases that avoid these execution paths.</para>
<para/></section></section><section id="inlined-classes"><title>Inlined Classes</title>
@@ -1452,13 +1511,13 @@
</class>
</library>
</programlisting></example>
-<para/></section><section><title>Managing Memory</title>
+</section><section><title>Managing Memory</title>
<para>
In optimizing the performance of your application, it can be useful to look at the "memory footprint" of your application, and in particular, to see if that footprint grows over time. (The way to determine memory usage by your application depends on the operating system on which it runs and is beyond the scope of this chapter.)
-<para>
+</para><para>
If memory usage for a given application tends to go up over time, you may have a "memory leak." See <xref linkend="debugging"/> for an explanation of how to use the debugger to detect leakage.
</para>
-</para>
+
<para/><section><title>Creating and Destroying Views</title>
<para>
In general, you do not have to worry about the resources consumed by creating views. However,if you have an application that
@@ -1477,7 +1536,7 @@
<para>
Note that
constraints do not consume large amounts of memory.
-<literal>$once</literal> and <literal>$always</literal> are equivalent in memory usage, but clearly <literal>$always</literal> will require more cpu.
+<literal>$once</literal> and <literal>$always</literal> are equivalent in memory usage, but clearly <literal>$always</literal> will require more CPU.
</para>
<para/></section></section><section><title>Hand-tuning constraints and attributes</title>
@@ -1558,9 +1617,9 @@
The second form is much more compact and readable, but the first form uses zero constraints. The call <literal><method event="onwidth" target="thingy"></literal> is nearly a constraint on <literal>thingy.width</literal>, but: in the explicit-update form, one <literal>thingy.onwidth</literal> event can trigger a single call to update which, which will end up doing the repositioning that otherwise would require at least a handful of constraints. Like constraints, method calls are expensive. So, fewer constraints, fewer method calls, faster performance.</para>
<para/></section><section><title>Tuning attribute assignments</title>
<para>
-You may, in some limited circumstances, gain a performance boost by assinging attribute valutes instead of setting them using a setter, (preferably, the <indexterm><primary><literal>setAttribute()</literal></primary></indexterm><methodname>setAttribute()</methodname> method). In general, using <literal>object.setAttribute('attr', value); </literal> to set an attribute is the best way to set attributes, as explained in <xref linkend="methods-events-attributes"/>. </para>
+You may, in some limited circumstances, gain a performance boost by assigning attribute values instead of setting them using a setter, (preferably, the <indexterm><primary><literal>setAttribute()</literal></primary></indexterm><methodname>setAttribute()</methodname> method). In general, using <literal>object.setAttribute('attr', value); </literal> to set an attribute is the best way to set attributes, as explained in <xref linkend="methods-events-attributes"/>. </para>
<para>
-For speed, however, you may sometimes use a direct assignment, as in <literal>object.attr = value;</literal>. When you do this, you need to be aware that no events are generated, and you are giving up the chance for any dependency that refers to <literal>object.attr</literal> to update. Use this technique with caution and only if you are sure that you have handled any dependencies. As we have heard said at Laszlo Systems, it's like overclocking your motherboard. You can do it if you think you know what you're doing, but don't blame us if your machine catches on fire. (Your machine won't literaly catch on fire, of course, but your application may fail spectacularly!)
+For speed, however, you may sometimes use a direct assignment, as in <literal>object.attr = value;</literal>. When you do this, you need to be aware that no events are generated, and you are giving up the chance for any dependency that refers to <literal>object.attr</literal> to update. Use this technique with caution and only if you are sure that you have handled any dependencies. As we have heard said at Laszlo Systems, it's like overclocking your motherboard. You can do it if you think you know what you're doing, but don't blame us if your machine catches on fire. (Your machine won't literally catch on fire, of course, but your application may fail spectacularly!)
</para>
<para/></section></section><section id="performance-tuning.compression"><title>Using compression to reduce size of DHTML downloads</title>
Modified: openlaszlo/branches/paperpie/docs/src/developers/persistent_connection.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/persistent_connection.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/persistent_connection.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -26,7 +26,7 @@
<para>A <indexterm significance="preferred"><primary>persistent connection</primary></indexterm><glossterm>persistent connection</glossterm> is a one-way pipe held by an application from
the OpenLaszlo Server. Because all transactions are done through an HTTP port, it allows an
application to receive asynchronous messages from the server without the need to
-open up a port in the firewall. Maintanance of an application's persistent
+open up a port in the firewall. Maintenance of an application's persistent
connection is done by the <link linkend="persistent_connection.connection-manager"><indexterm significance="preferred"><primary>connection
manager</primary></indexterm><glossterm>connection
manager</glossterm></link>, whose job is to multiplex all incoming data into a connection
@@ -792,7 +792,7 @@
<para>If the authentication was successful, the security server should return
HTTPAuthentication a username, which, in turn, is returned to the OpenLaszlo Server. You can
change the default authenticator with the
-<literal>connection.default.authenticator</literal> property. See the "Deployer's
+<literal>connection.default.authenticator</literal> property. See the "Administrator's
Guide" for more on how to configure your server and <link linkend="persistent_connection.httpauthentication">HTTPAuthentication</link> for what the XML response
format of authentication servers should look like.</para>
Modified: openlaszlo/branches/paperpie/docs/src/developers/program-development.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/program-development.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/program-development.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -25,7 +25,7 @@
repeat steps 2-5 until the program is perfect</para></listitem><listitem><para>
deploy the application</para></listitem></orderedlist>
<para>
-Each of these steps is described in turn below, and explored in greater depth throughout this Guide. But first we'll say a word aobut the Developer's Console, which is the default interface for performing common development activities.</para>
+Each of these steps is described in turn below, and explored in greater depth throughout this Guide. But first we'll say a word about the Developer's Console, which is the default interface for performing common development activities.</para>
<para/><section><title>The Developer's Console</title>
<para>
The Developer's Console is a small OpenLaszlo application for selecting things like the target runtime, the deployment mode (proxied or SOLO) and whether the debugger is included. When you first compile an OpenLaszlo application (as explained below), by default it is returned with the Developer's Console appearing at the bottom of the application.</para>
@@ -103,7 +103,7 @@
</para>
<para>
Internet Explorer uses an ActiveX
-control to display Fash files. It assumes that a local file
+control to display Flash files. It assumes that a local file
trying to access an ActiveX control may very well be a virus, so it
puts up the warning.
</para>
@@ -197,7 +197,7 @@
in the opening tag:</para>
<example role="live-example"><title>invisible canvas</title><programlisting>
-<canvas height="20" width="30>
+<canvas height="20" width="30">
</canvas>
</programlisting></example>
@@ -220,7 +220,7 @@
<!--unknown tag: script-->
tag</title>
-<para>Within LZX applications, you can embed arbitrary Javascript
+<para>Within LZX applications, you can embed arbitrary JavaScript
functions by nesting them in <indexterm><primary>script</primary></indexterm><sgmltag class="element"><script></sgmltag>
constructs. This is helpful for defining (global) functions that will
be used by different classes. The <indexterm><primary>script</primary></indexterm><sgmltag class="element"><script></sgmltag> tag must
Copied: openlaszlo/branches/paperpie/docs/src/developers/programs/layout-and-design-$19.lzx (from rev 6789, openlaszlo/trunk/docs/src/developers/programs/layout-and-design-$19.lzx)
Modified: openlaszlo/branches/paperpie/docs/src/developers/programs/text-$6.lzx
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/programs/text-$6.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/programs/text-$6.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,8 @@
<simplelayout/>
<slider name="down" width="100" value="5000" minvalue="1000" maxvalue="100000"
keystep="1000"/>
- <text text="${'Slider Value is '+parent.down.value+' nicely constrained'}"/>
+<!-- added resize attribute IORIO 21 sep 2007 -->
+ <text resize="false" text="${'Slider Value is '+parent.down.value+' nicely constrained'}"/>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
Modified: openlaszlo/branches/paperpie/docs/src/developers/proxied.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/proxied.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/proxied.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -45,7 +45,7 @@
</para>
<figure><title>Proxied applications use services from provided by the OpenLaszlo Server</title><mediaobject><imageobject><imagedata fileref="images/OLServer_services.png"/></imageobject></mediaobject></figure>
<para>
-In SOLO deployments, the OpenLaszlo server is not used to mediate between the OpenLaszlo client application and other services on the web. Howver, as explained below, it is possible to use other services to proxy between the client application and web resources.
+In SOLO deployments, the OpenLaszlo server is not used to mediate between the OpenLaszlo client application and other services on the web. However, as explained below, it is possible to use other services to proxy between the client application and web resources.
</para>
<figure><title>After they have been deployed, SOLO applications do not contact the OpenLaszlo Server</title><mediaobject><imageobject><imagedata fileref="images/solo_proxies.png"/></imageobject></mediaobject></figure>
<para>
@@ -85,7 +85,7 @@
</para>
<para>
How do you decide whether to target proxied or SOLO deployment? Here is a heuristic:</para>
-<orderedlist spacing="compact"><listitem><para>Do you have the option of installing the OpenLaszlo Server on a deployment server? In particular, is there a Java Application Servere or servlet container available? If not, you must deploy SOLO.</para></listitem><listitem><para>Does your application require services available only in proxied applications? If yes, you must deploy with OpenLaszlo Server.</para></listitem><listitem><para>If your application can be deployed in either manner, which gives the best performance?</para></listitem></orderedlist>
+<orderedlist spacing="compact"><listitem><para>Do you have the option of installing the OpenLaszlo Server on a deployment server? In particular, is there a Java Application Server or servlet container available? If not, you must deploy SOLO.</para></listitem><listitem><para>Does your application require services available only in proxied applications? If yes, you must deploy with OpenLaszlo Server.</para></listitem><listitem><para>If your application can be deployed in either manner, which gives the best performance?</para></listitem></orderedlist>
<para>
Each of these considerations is described briefly below.
</para>
@@ -133,7 +133,7 @@
method and see which gives the faster performance.</para>
<para/><section><title>GZipping DHTML Applications</title>
<para>
-When compiling for DHTML, you should ensure that gzipping is turned on at the server. This is done automatically for DHTML files, but not for DHTML. See the Deployer's Guide for details.
+When compiling for DHTML, you should ensure that gzipping is turned on at the server. This is done automatically for DHTML files, but not for DHTML. See the Administrator's Guide for details.
</para>
<para>
The data transfer size and run-time performance may be bigger or smaller, faster or slower.
@@ -187,10 +187,10 @@
</para>
<para>
The current defaults are:</para>
+<!-- LPP-984: trimwhitespace now defaults to true. IORIO 26 sep 2007 -->
<programlisting>
nsprefix = false (namespace prefixes are stripped)
-trimwhitespace = false (leading and trailing whitespace is preserved in text
-nodes)
+trimwhitespace = true (leading and trailing whitespace is removed from text nodes)
</programlisting>
<para/></section></section></section><section><title>Workflow</title>
<para>
@@ -267,7 +267,7 @@
<para>
Note also that some versions of browsers do not recognize the
crossdomain.xml file when asked to do POST requests, but do recognize it for
-querystrings. If this situation arises, the user will have to upgrade to an accomodating browser in order to make POSTs.
+querystrings. If this situation arises, the user will have to upgrade to an accommodating browser in order to make POSTs.
</para>
<para/></section><section><title condition="dhtml">Restrictions on DHTML</title>
<para>
@@ -645,7 +645,7 @@
</para>
<para/></section><section><title>Example of Rest: Cooqy</title>
<para>
-A great example of this philosophy in action is the Cooqy OpenLaszlo interface to eBay, which lets you browse eBay efficiently over a low-bandwidth dial-up line. The Cooqy server talks to the eBay web API, and boils it down to the essential results to display in the OpenLaszlo client, which downloads XML and images incrementally and starts displaying results immediately. So the client/server protocol between the client and Cooqy is extremely efficient, while the server/server protocol between Cooqy and eBay runs between fast servers over the internet backbone.
+A great example of this philosophy in action is the Cooqy OpenLaszlo interface to eBay, which lets you browse eBay efficiently over a low-bandwidth dial-up line. The Cooqy server talks to the eBay web API, and boils it down to the essential results to display in the OpenLaszlo client, which downloads XML and images incrementally and starts displaying results immediately. So the client/server protocol between the client and Cooqy is extremely efficient, while the server/server protocol between Cooqy and eBay runs between fast servers over the Internet backbone.
</para>
<para>
@@ -669,58 +669,60 @@
</para>
<para>
-You can run the YouTube player here:
+You can run the YouTube player <ulink url="http://www.donhopkins.com/trunk/demos/youtube/youtube.lzx?lzt=swf">here</ulink>.
</para>
-<para>
-http://www.donhopkins.com/trunk/demos/youtube/youtube.lzx?lzt=swf
-</para>
+
+
+
<para>
This is the youtubeplayer component source, and its supporting lzx files:
</para>
<para>
-http://www.donhopkins.com/trunk/demos/youtube/youtubeplayer.lzx?lzt=source
-http://www.donhopkins.com/trunk/demos/youtube/youtube.lzx?lzt=source
-http://www.donhopkins.com/trunk/demos/youtube/videolibraryicon.lzx?lzt=source
-http://www.donhopkins.com/trunk/demos/youtube/videolibrarypopup.lzx?lzt=source
-</para>
+ <itemizedlist>
+ <listitem><para><ulink url="http://www.donhopkins.com/trunk/demos/youtube/youtubeplayer.lzx?lzt=source">youtubeplayer</ulink></para></listitem>
+ <listitem><para><ulink url="http://www.donhopkins.com/trunk/demos/youtube/youtube.lzx?lzt=source">youtube</ulink></para></listitem>
+ <listitem><para><ulink url="http://www.donhopkins.com/trunk/demos/youtube/videolibraryicon.lzx?lzt=source">videolibraryicon</ulink></para></listitem>
+ <listitem><para><ulink url="http://www.donhopkins.com/trunk/demos/youtube/videolibrarypopup.lzx?lzt=source">videolibrarypopup</ulink></para></listitem>
+ </itemizedlist>
-<para>
-Here's the source of the YouTube proxy in Java, as a JSP. We've copied it to another file and added the .txt extension so you can look at the source instead of executing it.
+
+
+
</para>
<para>
-http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp.txt
+Here's the <ulink url="http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp.txt">source</ulink> of the YouTube proxy in Java, as a JSP. We've copied it to another file and added the .txt extension so you can look at the source instead of executing it.
</para>
+
<para>
It performs a ReST call on the YouTube API to perform searches (which only returns the id of the video and the URL of the HTML web page the view the video, but not the actual url of the FLV video file). When the user plays the video, it performs another call to download the web pages of the video, and scrape out the URL of the FLV file from each one.
</para>
<para>
The youtube proxy supports the following functions:
-</para>
-<para>
-videoGetFlvUrl(id)
-http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videoGetFlvUrl&id=SRCux7wefH0
-</para>
+<itemizedlist>
+<listitem><para>
+<ulink url="http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videoGetFlvUrl&id=SRCux7wefH0">videoGetFlvUrl(id)</ulink>
+</para></listitem>
-<para>
-videosListFeatured()
-http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videosListFeatured
-</para>
-<para>
-videosListByTag(tag) // comma separated tags
-http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videosListByTag&tag=kitten,cute
-</para>
+<listitem><para>
+<ulink url="http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videosListFeatured">videosListFeatured()</ulink>
+</para></listitem>
-<para>
-videosListByUser(user)
-http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videosListByUser&user=marccanter
+<listitem><para>
+<ulink url="http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videosListByTag&tag=kitten,cute">videosListByTag(tag) // comma separated tags</ulink>
+</para></listitem>
+
+<listitem><para>
+<ulink url="http://www.DonHopkins.com/trunk/demos/youtube/youtube.jsp?method=videosListByUser&user=marccanter">videosListByUser(user)</ulink>
+</para></listitem>
+</itemizedlist>
</para>
<para/><section><title>Another example of SOLO deployment: LaszloMail</title>
<para>
Modified: openlaszlo/branches/paperpie/docs/src/developers/rpc-javarpc.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/rpc-javarpc.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/rpc-javarpc.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -43,7 +43,7 @@
scope means that the server object will be saved in a session attribute (see
javax.servlet.http.HttpSession). If scope is webapp, the server object is saved
in a web application context (see javax.servlet.ServletContext). For session and
-webapp scopes, client-side remote methods will always invoke the samve saved
+webapp scopes, client-side remote methods will always invoke the same saved
server objects. The objects are saved in a java.util.Map that is placed in an
attribute called "__lzobj". The map key for the object is the
<literal>attributename</literal> of the client-side javarpc object. If scope is none, no
@@ -714,7 +714,7 @@
<textobject><textdata fileref="programs/rpc-javarpc-$10.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>Java to Javascript return</title><programlisting role="lzx-embednew"><filename>rpc-javarpc-$10.lzx</filename><parameter/><code>
+<?example role="live-example"><title>Java to Javacript return</title><programlisting role="lzx-embednew"><filename>rpc-javarpc-$10.lzx</filename><parameter/><code>
<canvas debug="true" height="450" width="800">
<debug x="10" y="130" width="740" height="275" />
Modified: openlaszlo/branches/paperpie/docs/src/developers/rpc-soap.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/rpc-soap.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/rpc-soap.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -4,7 +4,7 @@
<warning><para>
This feature works in proxied applications only. It does not work in SOLO applications.
</para></warning>
-<para>SOAP (Simple Object Access Prototcol) is used to exchange information in a
+<para>SOAP (Simple Object Access Protocol) is used to exchange information in a
distributed environment. A typical scenario involves a SOAP client invoking a
client-side function stub to invoke a SOAP web service operation. The SOAP web
service then returns data —such as stock information or the result to
@@ -256,7 +256,7 @@
<para/></section></section></section><section><title>Document style operation</title>
-<para>Document style operations use XML data(that is, documents) as paramaters. The SOAP
+<para>Document style operations use XML data(that is, documents) as parameters. The SOAP
specification is moving towards document style operations as being the preferred
way of invoking web services. The alternative RPC style posed interoperability
challenges that were difficult to resolve. The WS-I's <ulink url="http://www.ws-i.org/archive/Profiles/Basic/2002-10/basicprofile-1.0-wgd.htm">Basic
@@ -288,7 +288,7 @@
LZX.</para>
<example role="live-example">
- <title>Document sytle SOAP operation</title>
+ <title>Document style SOAP operation</title>
<programlisting language="lzx">
<textobject><textdata fileref="programs/rpc-soap-$5.lzx"/></textobject>
</programlisting>
@@ -539,7 +539,7 @@
<para>RPC style operations behave just like functions in that, instead of
documents, values are passed in as parameters. Parameters can be of simple data
-type (number, boolean), array, or object. The parameter type for the operation
+type (number, Boolean), array, or object. The parameter type for the operation
is described in the WSDL's XML schema.</para>
<example role="live-example">
@@ -548,7 +548,7 @@
<textobject><textdata fileref="programs/rpc-soap-$8.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>Passing simple paramaters in RPC style operation</title><programlisting role="lzx-embednew"><filename>rpc-soap-$8.lzx</filename><parameter/><code>
+<?example role="live-example"><title>Passing simple parameters in RPC style operation</title><programlisting role="lzx-embednew"><filename>rpc-soap-$8.lzx</filename><parameter/><code>
<canvas debug="true" height="400" width="530">
<debug x="10" y="190" width="510" height="200" />
Modified: openlaszlo/branches/paperpie/docs/src/developers/rpc-xmlrpc.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/rpc-xmlrpc.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/rpc-xmlrpc.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -71,7 +71,7 @@
stub that doesn't exist will generate an error or warning. In <xmlrpc>,
function stubs are create based on remotecall declarations. Note that XML-RPC
use dot notation for their operation names. Because that will conflict with the
-view system's notation, it's suggested that remotecalls be explictly named.</para>
+view system's notation, it's suggested that remotecalls be explicitly named.</para>
<example role="live-example">
<title>Creating a function stub</title>
@@ -82,7 +82,7 @@
<?example role="live-example"><title>Creating a function stub</title><programlisting role="lzx-embednew"><filename>rpc-xmlrpc-$2.lzx</filename><parameter/><code>
<canvas debug="true" height="400">
- <!-- this isues one call of the freshmeat XML-RPC API -->
+ <!-- this issues one call of the freshmeat XML-RPC API -->
<!-- Documented here: http://freshmeat.net/faq/view/49/ -->
<debug x="10" y="40" width="450" height="350" />
Modified: openlaszlo/branches/paperpie/docs/src/developers/rpc.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/rpc.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/rpc.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -33,7 +33,7 @@
transport is HTTP and it uses an XML encoded message to invoke remote functions. </para>
<para>
<indexterm><primary>soap</primary></indexterm><sgmltag class="element"><soap></sgmltag> implements the W3C <ulink url="http://www.w3.org/TR/soap12-part0">SOAP
-specification</ulink>. Like <indexterm><primary>xmlrpc</primary></indexterm><sgmltag class="element"><xmlrpc></sgmltag> SOAO also uses XML to send messages over the network. Though HTTP
+specification</ulink>. Like <indexterm><primary>xmlrpc</primary></indexterm><sgmltag class="element"><xmlrpc></sgmltag> SOAP also uses XML to send messages over the network. Though HTTP
is commonly used as its transport, it isn't required. The specification is more
complex than XML-RPC and supports different styles of operations (rpc or
document), overloaded methods, passing header information, and so forth.</para>
@@ -190,7 +190,7 @@
</programlisting></informalexample>
<para>There are several private, undocumented properties in <rpc>. But one
-that implementors of subclasses should be made aware of is the delegate property
+that implementers of subclasses should be made aware of is the delegate property
called _loadDel (note: an underscore prefix in a component variable indicates that it is
private). This delegate must be passed in to any lower-level ORL APIs or must be
called at the end of <indexterm><primary><literal>load()</literal></primary></indexterm><methodname>load()</methodname>, as is done in the xmlrpc.lzx implementation of
@@ -844,7 +844,7 @@
appended as a child of the LzDataElement dataobject.</para>
<example role="live-example">
- <title>Setting a dataobject toa dataset</title>
+ <title>Setting a dataobject to a dataset</title>
<programlisting language="lzx">
<textobject><textdata fileref="programs/rpc-$16.lzx"/></textobject>
</programlisting>
Modified: openlaszlo/branches/paperpie/docs/src/developers/structure.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/structure.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/structure.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -525,7 +525,7 @@
<textobject><textdata fileref="programs/program-structure-$18.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>switch tag for condtional compilation</title><programlisting role="lzx-embednew"><filename>program-structure-$18.lzx</filename><parameter/><code>
+<?example role="live-example"><title>switch tag for conditional compilation</title><programlisting role="lzx-embednew"><filename>program-structure-$18.lzx</filename><parameter/><code>
<canvas>
<switch>
<when runtime="dhtml">
@@ -646,7 +646,7 @@
<para>
In this example, there are two views that provide accessibility information. When the first view is clicked, it uses the scripting API to unsilence the button.
</para>
-<example role="live-example"><title>Specifiying accessibility parameters</title><programlisting>
+<example role="live-example"><title>Specifying accessibility parameters</title><programlisting>
<view aaactive="true" aaname="Activation Button" aadescription="This button allows you to access more information by activating important views." aatabindex="1" onclick="important.setAASilent(false)">
<button id="important" aaactive="true" aaname="Important Information" aadescription="Here is some important information." aatabindex="2" aasilent="true"/>
Modified: openlaszlo/branches/paperpie/docs/src/developers/survey-chapter.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/survey-chapter.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/survey-chapter.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -37,13 +37,13 @@
</para>
<para>
Please note that the methodology that we're using to explain how this application is constructed is not necessarily the best way to
-go about builing an application. It's simply a way of explaining how the application works from the inside out.
+go about building an application. It's simply a way of explaining how the application works from the inside out.
</para>
<para/></section><section><title>Building a Survey Tool</title>
<para/><section><title>Starting with a radiogroup</title>
<para>
-We begin constructing the questionaire at the heart of the survey:
+We begin constructing the questionnaire at the heart of the survey:
</para>
<example role="live-example">
@@ -88,7 +88,7 @@
As discussed above, the <indexterm><primary>form</primary></indexterm><sgmltag class="element"><form></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: form-->
element provides a structure for grouping various related components.
-By handling layout and common funtions, <indexterm><primary>form</primary></indexterm><sgmltag class="element"><form></sgmltag> allows you to concentrate on behavior. In the code below, we've
+By handling layout and common functions, <indexterm><primary>form</primary></indexterm><sgmltag class="element"><form></sgmltag> allows you to concentrate on behavior. In the code below, we've
added a button and associated it with the form's <indexterm><primary><literal>submit()</literal></primary></indexterm><methodname>submit()</methodname>.
</para>
Modified: openlaszlo/branches/paperpie/docs/src/developers/text.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/text.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/text.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -54,7 +54,7 @@
</section>
<section>
<title>Text as attribute and text as object</title>
- <para>LZX is an XML language. By deffinition, in XML, whatever
+ <para>LZX is an XML language. By definition, in XML, whatever
comes between an opening and closing tag is called text. As we
have seen text in this context is implemented as HTML.</para>
<para>In other words, despite being called text, in our
@@ -70,7 +70,7 @@
subclasses, which include all components. For example,</para>
<programlisting><button text="this is a fine kettle of
fish"></programlisting>
- <para>is equvalent to</para>
+ <para>is equivalent to</para>
<programlisting><button> this is a fine kettle of fish
</button></programlisting>
<para>LZX also includes a text object,
@@ -88,7 +88,7 @@
<para>Thus,</para>
<programlisting><text id="sam" text="King Samuel was a fine
hamster"></programlisting>
- <para>is equvalent to</para>
+ <para>is equivalent to</para>
<programlisting><text id="sam"> King Samuel was a fine
hamster </text></programlisting>
<para>In each case we have defined an
@@ -397,7 +397,7 @@
to these functions set the pixel position of the top line
of text relative to the text view bounding box, and should
be less than or equal to zero. When the text is scrolled
- horizontaly or vertically, an
+ horizontally or vertically, an
<indexterm>
<primary>onscrollx event</primary>
</indexterm>
@@ -485,25 +485,25 @@
<para />
<section>
<title>Resizable text fields</title>
+ <!-- changed to reflect the fact that resize is now true by default -->
<para>Take care when using text whose width must be
calculated at run time. Because the compiler does not know
what the text is (and the text field doesn't even know what
- it is until the contraints evaluate), it can't really know
+ it is until the constraints evaluate), it can't really know
at construct time how wide to make itself.</para>
- <para>If you add
- <literal>resize=true</literal>, the field will expand to
- fit the text. In the example below, notice how the last
- concatenation is invisible and the last digit of the
- numeric value from the slider gets cut off.</para>
+ <para>If you set
+ <literal>resize=false</literal>, the field will not expand to
+ fit the text. In the example below, notice how the string is truncated as you move the slider.</para>
+ <!-- added resize attribute in text-$6.lzx, IORIO 21 sep 2007 -->
<example role="live-example">
- <title>Non-resizing text does not concatenate</title>
+ <title>Non-resizing text is truncated</title>
<programlisting language="lzx">
<textobject>
<textdata fileref="programs/text-$6.lzx" />
</textobject>
</programlisting>
</example>
- <?example role="live-example"><title>non-resizing text does not concatentate</title><programlisting role="lzx-embednew"><filename>text-$6.lzx</filename><parameter/><code>
+ <?example role="live-example"><title>non-resizing text does not concatenate</title><programlisting role="lzx-embednew"><filename>text-$6.lzx</filename><parameter/><code>
<canvas height="50" >
<simplelayout/>
<slider name="down" width="100" value="5000" minvalue="1000" maxvalue="100000"
@@ -518,12 +518,9 @@
<text text="${'Slider Value is '+parent.down.value+' nicely constrained'}"/>
</canvas>
</programlisting><?lzx-edit programs/text-$6.lzx></example?>
- <para>The following shows the use of
- <indexterm>
- <primary>resize="true"</primary>
- </indexterm>
- <sgmltag class="attribute">resize="true"</sgmltag>to get
- the desired behavior.</para>
+<para>If you set
+ <literal>resize=true</literal> (the default), the field will expand to
+ fit the text.</para>
<example role="live-example">
<title>Using the 'resize' attribute</title>
<programlisting language="lzx">
@@ -532,7 +529,7 @@
</textobject>
</programlisting>
</example>
- <?example role="live-example"><title>Using the 'resize' attribute</title><programlisting role="lzx-embednew"><filename>text-$7.lzx</filename><parameter/><code>
+ <?example role="live-example"><title>Setting the 'resize' attribute to 'true'</title><programlisting role="lzx-embednew"><filename>text-$7.lzx</filename><parameter/><code>
<canvas height="50">
<simplelayout/>
@@ -540,7 +537,8 @@
keystep="1000"/>
<text resize="true" text="${'Slider Value is '+parent.down.value+' nicely constrained'}"/>
</canvas>
- </code></programlisting><programlisting>
+ </code></programlisting>
+<programlisting>
<canvas height="50">
<simplelayout/>
@@ -622,11 +620,11 @@
<itemizedlist spacing="compact">
<listitem><para>Unlike lz.views, lz.text elements do not
auto-size to fit their contents. Use the resize or
- multiline attributes to acheive this.</para></listitem>
+ multiline attributes to achieve this.</para></listitem>
<listitem><para>Even though lz.text is a subclass of lz.view, you
cannot nest views inside of it.</para></listitem>
<listitem><para>Data-bound text fields will automatically display
- the text theyare bound to.</para></listitem>
+ the text they are bound to.</para></listitem>
</itemizedlist>
</section>
<!-- remove empty para tag LI LPP-4642 9/4/2007-->
@@ -634,7 +632,7 @@
<section id="text.multiline">
<title>Single-line and multiline text</title>
<para>A text field can be either a single line or multiple
- lines. The
+ lines.
<indexterm>
<primary>multiline</primary>
</indexterm>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/art_assets.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/art_assets.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/art_assets.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -29,7 +29,7 @@
<!--unknown tag: view-->
s are the fundamental visible entities, and resources
are externally generated media to be incorporated in applications. Resources are made available by being
-attatched to views. Thus in OpenLaszlo applications you don't "insert an image" into a view;
+attached to views. Thus in OpenLaszlo applications you don't "insert an image" into a view;
instead you insert a view whose <emphasis>resource</emphasis> is an image.
</para>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/calculator.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/calculator.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/calculator.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -1290,7 +1290,7 @@
<para>There is still a lot of code here, a lot of which is repetitive. We can condense it by using classes. For an introduction to classes in LZX, see <xref linkend="classes-tutorial"/></para>
<para/></section></section></section><section id="calculator.perspective"><title>Using Classes to Simplify</title>
-<para>Let's take a look at how we can use classes to simplyfy our code. We'll start by making a class for calculator buttons.</para>
+<para>Let's take a look at how we can use classes to simplify our code. We'll start by making a class for calculator buttons.</para>
<para role="todo"><remark role="todo"><emphasis role="para-label">TODO: </emphasis>
need another intro sentence
</remark></para>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/data.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/data.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/data.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -236,7 +236,8 @@
<para>So far we've been using embedded data; i.e. XML that is written into the document. This is fine for very small amounts of static data, but there are other methods better suited to larger (or dynamic) data.</para>
-<informaltable><tgroup cols="3"><thead><row><entry>How is it included?</entry><entry>When is it loaded?</entry><entry>Syntax</entry></row></thead><tbody><row><entry><link linkend="data-tutorial.embedded">Embedded</link></entry><entry>Compile-time</entry><entry>
+<informaltable><tgroup cols="3"><thead><row><entry>How is it included?</entry>
+<entry>When is it loaded?</entry><entry>Syntax</entry></row></thead><tbody><row><entry><link linkend="data-tutorial.embedded">Embedded</link></entry><entry>Compile-time</entry><entry>
<informalexample role="live-example"><programlisting>
<dataset name="myData">
<myXML>
@@ -340,4 +341,22 @@
<!--unknown tag: datapointer-->
<indexterm><primary>onerror event</primary></indexterm><literal>onerror</literal> and <indexterm><primary>ontimeout event</primary></indexterm><literal>ontimeout</literal> event handlers to capture any problems. </para>
-<para/></section></chapter>
+<para/>
+<section>
+<title>Differential debugging SWF and DHTML</title>
+<para>When you query or manipulate an invalid datapointer, in the past,
+you got back `undefined`. In DHTML, this often led to disaster down
+the road, so the compiler added a warning when you did this, but still returned
+`undefined` for backwards compatibility. In SWF, which is very
+lenient about dealing with undefined values, manipulating an invalid
+datapointer appears to have no ill effects; but the compiler still issues the
+warning, because you may run into trouble if you compile your code
+for DHTML. </para>
+<para>When you define an LZX class whose name is the same as an
+underlying runtime global, in the past, the runtime clobbered the runtime
+global, to allow you to say `new <tagname>` to dynamically create
+instances of your LZX tag. This leads to disaster in any runtime, so
+the runtime no longer clobbers the global and it emits a warning telling you you
+will need to use `lz.<tagname>` to reference the class dynamically.</para>
+</section>
+</section></chapter>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/data_app.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/data_app.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/data_app.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -176,7 +176,7 @@
<para>XPath also supports a one-based index notation to limit the number of nodes retrieved by an expression. You can experiment with the following XPath expressions for the datapath attribute of the list view (comment 1).</para>
-<informaltable><tgroup cols="2"><thead><row><entry>XPath expresssion</entry><entry>Result</entry></row></thead><tbody><row><entry><literal>dset:/phonebook/contact</literal></entry><entry><para>All the contact nodes</para></entry></row><row><entry><literal>dset:/phonebook/contact[1]</literal></entry><entry><para>First contact node only</para></entry></row><row><entry><literal>dset:/phonebook/contact[2-3]</literal></entry><entry><para>Contact nodes 2 to 3</para></entry></row><row><entry><literal>dset:/phonebook/contact[2-]</literal></entry><entry><para>Contact nodes 2 and onwards</para></entry></row><row><entry><literal>dset:/phonebook/contact[-2]</literal></entry><entry><para>Contact nodes up to and including 2</para></entry></row></tbody></tgroup></informaltable>
+<informaltable><tgroup cols="2"><thead><row><entry>XPath expression</entry><entry>Result</entry></row></thead><tbody><row><entry><literal>dset:/phonebook/contact</literal></entry><entry><para>All the contact nodes</para></entry></row><row><entry><literal>dset:/phonebook/contact[1]</literal></entry><entry><para>First contact node only</para></entry></row><row><entry><literal>dset:/phonebook/contact[2-3]</literal></entry><entry><para>Contact nodes 2 to 3</para></entry></row><row><entry><literal>dset:/phonebook/contact[2-]</literal></entry><entry><para>Contact nodes 2 and onwards</para></entry></row><row><entry><literal>dset:/phonebook/contact[-2]</literal></entry><entry><para>Contact nodes up to and including 2</para></entry></row></tbody></tgroup></informaltable>
<para/></section><section><title>Working with external XML documents</title>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/laszlo_basics.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/laszlo_basics.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/laszlo_basics.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -4,7 +4,7 @@
<title>OpenLaszlo Basics</title>
<para role="todo"><remark role="todo"><emphasis role="para-label">TODO: </emphasis>
-explain how tutorials relate to laszlo in ten minutes
+explain how tutorials relate to Laszlo in ten minutes
</remark></para>
<para role="todo"><remark role="todo"><emphasis role="para-label">TODO: </emphasis>
Rename this tutorial
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/scripting.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/scripting.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/scripting.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -86,9 +86,9 @@
</script>
</canvas>
</programlisting><?lzx-edit programs/scripting-tutorial-$2.lzx></example?>
-<para/><section><title>Javascript gotchas</title>
+<para/><section><title>JavaScript gotchas</title>
<para>
-If you've never worked with Javascript before, you may be surprised by some subtle features of the language.
+If you've never worked with JavaScript before, you may be surprised by some subtle features of the language.
For example, consider this slight expansion of the preceding program:</para>
<example role="live-example">
@@ -139,8 +139,8 @@
the line immediately above it, right? What happened is that we concatenated numbers to strings
earlier on (<literal>4 + " plus " + 3</literal>), and that operation converted the numbers to strings.</para>
<para>
-OpenLaszlo documentation is not intended to provide a complete reference for Javascript. Later chapters do explain some
-advanced topics in scripting, but we recommend that you have a Javascript reference handy while writing LZX.
+OpenLaszlo documentation is not intended to provide a complete reference for JavaScript. Later chapters do explain some
+advanced topics in scripting, but we recommend that you have a JavaScript reference handy while writing LZX.
</para>
<para/></section><section><title>XML characters in script</title>
@@ -201,7 +201,7 @@
<textobject><textdata fileref="programs/scripting-tutorial-$7.lzx"/></textobject>
</programlisting>
</example>
-<?example role="live-example"><title>Javascript functions</title><programlisting role="lzx-embednew"><filename>scripting-tutorial-$7.lzx</filename><parameter/><code>
+<?example role="live-example"><title>JavaScript functions</title><programlisting role="lzx-embednew"><filename>scripting-tutorial-$7.lzx</filename><parameter/><code>
<canvas height="200" width="500" debug="true">
<script>
<![CDATA[
@@ -291,7 +291,7 @@
<programlisting> this.parent</programlisting>
-<para>is a reference to an object. In Javascript, the scope is generally global unless you say otherwise. That means
+<para>is a reference to an object. In JavaScript, the scope is generally global unless you say otherwise. That means
that any class or instance methods or variables must be preceded by the keyword <literal>this</literal>. As
for the 'parent' part: Let's start by saying that the lzx viewsystem always assigns each view a variable 'parent'
which points to that view's hierarchical parent. View hierarchies are discussed in detail in <xref linkend="views"/>
@@ -782,7 +782,7 @@
<para/></section><section><title>Using attributes to reduce complexity</title>
<para>Continuing from the same example as above, let's look at ways to reduce the number of arguments being passed.
-Here we put the functionalilty into the button itself:</para>
+Here we put the functionality into the button itself:</para>
<example role="live-example">
<title>More on attributes</title>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/text.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/text.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/text.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -7,7 +7,7 @@
<xref linkend="text"/> and <xref linkend="fonts"/>
explain more advanced topics.</para>
<para>
-Note that the behavior of LZX applications differs between applications compiled for the Flash Player (SWF format) and those compiled for DHTML. Certain APIs are available in only one or the other runtime. We'll call attention to these subjectst in the sections that follow.
+Note that the behavior of LZX applications differs between applications compiled for the Flash Player (SWF format) and those compiled for DHTML. Certain APIs are available in only one or the other runtime. We'll call attention to these subjects in the sections that follow.
</para>
<para/></section><section id="text-tutorial.basics"><title>The <text> tag</title>
@@ -335,7 +335,7 @@
<para>The font TTF files can be located in the current directory or another one and referenced relatively (<literal>src="../fonts/..."</literal>). Otherwise they are included in the LPS webapp directory of the installation under WEB-INF/lps/fonts. timonnsr is a font that comes packaged with the OpenLaszlo Server in this location.</para>
-<para>A truetype file is required for each style of font (e.g. italic, bold, regular), which is how fonts are actually packaged. So the following code will <emphasis role="b">not</emphasis> work:</para>
+<para>A TrueType file is required for each style of font (e.g. italic, bold, regular), which is how fonts are actually packaged. So the following code will <emphasis role="b">not</emphasis> work:</para>
<informalexample role="live-example"><programlisting>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/views.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/views.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/views.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -429,7 +429,7 @@
<para>Now the view stretches across, but if you look at the toolbars you'll notice that they are a little bit taller than the buttons they contain. To make our buttons look the same, we could set an absolute height, but let's make it dependent on one of the buttons:</para>
<example role="live-example">
- <title>Constraining veiw to child's height</title>
+ <title>Constraining view to child's height</title>
<programlistingco>
<areaspec>
<area units="other" otherunits="/canvas[1]/window[1]/view[1]/@height"/>
Modified: openlaszlo/branches/paperpie/docs/src/developers/tutorials/window.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/tutorials/window.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/tutorials/window.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -240,7 +240,7 @@
<para>Since the center view is variable width, we needed to allow it to stretch its resource, by adding the <literal>stretches="width"</literal> attribute to the view. We won't see any results from this right now, but when we move on to resizing the window, the effect will become apparent.</para>
-<para>We also had to set its width to be dependant on the widths of its neigboring two views, and that of its parent. There is no need to specify the widths of <varname>topLeft</varname> or <varname>topRight</varname>, as they shall take on the widths of their resources.</para>
+<para>We also had to set its width to be dependant on the widths of its neighboring two views, and that of its parent. There is no need to specify the widths of <varname>topLeft</varname> or <varname>topRight</varname>, as they shall take on the widths of their resources.</para>
<example role="live-example">
<title>Stretchable widths</title>
Modified: openlaszlo/branches/paperpie/docs/src/developers/video.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/video.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/video.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -178,7 +178,7 @@
<para>
The <indexterm><primary>videoplayer</primary></indexterm><sgmltag class="element"><videoplayer></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: videoplayer-->
- component provides the a graphical represnetation of the essential controls for handling video and audio: play, stop, pause, seek forward, seek in reverse, and control volume.
+ component provides the a graphical representation of the essential controls for handling video and audio: play, stop, pause, seek forward, seek in reverse, and control volume.
</para>
<para role="fixme"><remark role="fixme"><emphasis role="para-label">FIXME: </emphasis>
We'll need to spruce this up, of course, when the real video player gets checked in.
@@ -189,7 +189,7 @@
<para>
An <indexterm><primary>rtmpconnection</primary></indexterm><sgmltag class="element"><rtmpconnection></sgmltag><remark role="fixme">[unknown tag]</remark>
<!--unknown tag: rtmpconnection-->
- represents a connection to an appllication running on an RTMP server, such as the Flash Media Server or Red5, enabling two-way streaming of audio and video. This allows you to broadcast and receive live audio and and or video, as well as recording video from a webcam or audio from a microphone to files on the server. Recorded files may be played back over HTTP (using <indexterm><primary>mediastream</primary></indexterm><sgmltag class="element"><mediastream></sgmltag> and <indexterm><primary>videoview</primary></indexterm><sgmltag class="element"><videoview></sgmltag> classes) or with RTMP to allow seeking within and playback of long files that are impractical to load into memory.
+ represents a connection to an application running on an RTMP server, such as the Flash Media Server or Red5, enabling two-way streaming of audio and video. This allows you to broadcast and receive live audio and and or video, as well as recording video from a webcam or audio from a microphone to files on the server. Recorded files may be played back over HTTP (using <indexterm><primary>mediastream</primary></indexterm><sgmltag class="element"><mediastream></sgmltag> and <indexterm><primary>videoview</primary></indexterm><sgmltag class="element"><videoview></sgmltag> classes) or with RTMP to allow seeking within and playback of long files that are impractical to load into memory.
</para>
<para/><section><title>Automatic connection to the RTMP service</title>
@@ -199,7 +199,7 @@
<rtmpconnection src="rtmp://mysite.com/myapp/" autoconnect="true"/>
<videoview url="myvideo.flv" type="rtmp" autoplay="true"/>
</programlisting></example>
-<para/></section><section><title>Chosing between multiple connections</title>
+<para/></section><section><title>Choosing between multiple connections</title>
<para>
When an application has more than one rtmp connection active, you chose among them by specifying the URL passed to the <indexterm><primary>videoview</primary></indexterm><sgmltag class="element"><videoview></sgmltag>.
</para>
@@ -221,12 +221,12 @@
<para>Here's an illustration of a representative security dialogue the first time the camera is requested:
</para>
-<figure><title>Permission to record dialoge</title><mediaobject><imageobject><imagedata fileref="images/AdobeFlashPlayerSettings1.png"/></imageobject></mediaobject></figure>
+<figure><title>Permission to record dialog</title><mediaobject><imageobject><imagedata fileref="images/AdobeFlashPlayerSettings1.png"/></imageobject></mediaobject></figure>
<para/><section><title>Changing permissions</title>
<para>
You can change the permissions of a running application by using the right-click context menu on the video. Note that the menu may show the name of device <emphasis role="i">drivers</emphasis>, not the actual devices. A typical right-click menu is shown below.
</para>
-<figure><title>Permission to record dialoge</title><mediaobject><imageobject><imagedata fileref="images/AdobeFlashPlayerSettings2.png"/></imageobject></mediaobject></figure>
+<figure><title>Permission to record dialogue</title><mediaobject><imageobject><imagedata fileref="images/AdobeFlashPlayerSettings2.png"/></imageobject></mediaobject></figure>
<para role="todo"><remark role="todo"><emphasis role="para-label">TODO: </emphasis>
Explain record versus broadcast
Explain privacy policy, capturing and allowed attributes.
Modified: openlaszlo/branches/paperpie/docs/src/developers/views.dbk
===================================================================
--- openlaszlo/branches/paperpie/docs/src/developers/views.dbk 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/docs/src/developers/views.dbk 2007-10-10 23:17:04 UTC (rev 6797)
@@ -544,7 +544,7 @@
</programlisting>
</example>
-<?example role="live-example"><title>Simple scaling wtih text</title><programlisting role="lzx-embednew"><filename>views-$14.lzx</filename><parameter/><code>
+<?example role="live-example"><title>Simple scaling with text</title><programlisting role="lzx-embednew"><filename>views-$14.lzx</filename><parameter/><code>
<canvas width="700" height="100">
<font src="helmetb.ttf" name="helmet"/>
<view stretches="both" height="100" bgcolor="red"
@@ -960,7 +960,7 @@
hierarchy" is more correct. (Notice that in the above example,
"dragger" is a node, not a view)</para>
-<para>If you're an experienced javascript programmer you will have seen this pattern before.
+<para>If you're an experienced JavaScript programmer you will have seen this pattern before.
When you see "immediateparent" in JavaScript, think "container".</para>
<para> Similarly, if you've looked at XAML, you may have seen that
Modified: openlaszlo/branches/paperpie/laszlo-explorer/basics/form.lzx
===================================================================
--- openlaszlo/branches/paperpie/laszlo-explorer/basics/form.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/laszlo-explorer/basics/form.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -42,7 +42,7 @@
</form>
<view name="congrats" datapath="echoer:/response"
- bgcolor="0xAAB5C8"
+ bgcolor="0xAAB5C8" clickable="true"
width="100%" height="100%" >
<text text="Congrats!" fontstyle="bold"
y="80" align="center" />
@@ -51,5 +51,8 @@
</view>
</window>
</canvas>
-
-
+<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Use is subject to license terms. *
+* X_LZ_COPYRIGHT_END ****************************************************** -->
+<!-- @LZX_VERSION@ -->
Modified: openlaszlo/branches/paperpie/lps/admin/dev-console.lzx.swf
===================================================================
(Binary files differ)
Modified: openlaszlo/branches/paperpie/lps/components/base/basecombobox.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/base/basecombobox.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/base/basecombobox.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -279,6 +279,16 @@
<handler name="onconstruct">
this.dataoption = owner.dataoption;
</handler>
+ <handler name="oninit">
+ <![CDATA[
+ // Clips to the canvas, so it doesn't spill off down into
+ // forever and subsequently look all goofy.
+ if(this.owner.shownitems == -1){
+ var ih = Math.floor((canvas.height - owner.y) / owner.height);
+ this.setAttribute('shownitems', ih);
+ }
+ ]]>
+ </handler>
<method name="_dokeyup" args="kc"
event="onkeyup">
Modified: openlaszlo/branches/paperpie/lps/components/base/basedatacombobox.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/base/basedatacombobox.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/base/basedatacombobox.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -197,7 +197,7 @@
var t = dp.xpathQuery(this.textdatapath);
// if t is null, use default text (if it exists)
- if( ( t == null || t.length == 0 ) && this.defaulttext && this.defaulttext['length'] > 0 )
+ if( ( t == null || t.length == 0 ) && this.defaulttext['length'] > 0 )
t = this.defaulttext;
if ( this._cbtext && (this.statictext == null) ) {
@@ -215,7 +215,7 @@
if (this.ismenu) {
// Clear the selection
this._selectedIndex = -1;
- if (this._cblist && this._cblist['_selector']) {
+ if (this._cblist['_selector']) {
this._cblist._selector.clearSelection();
}
}
@@ -230,13 +230,12 @@
<!--- @keywords private -->
<method name="_setupcblist" args="force"> <![CDATA[
+ if (this._cblist == null) {
- if (this._cblist == null) {
-
if (this.itemclassname == "") {
this.itemclassname = "basedatacombobox_item";
}
-
+
var icn = this.itemclassname;
var flcn = this.menuclassname;
@@ -244,19 +243,19 @@
if (typeof global[flcn] == "undefined")
Debug.format("basedatacombobox floatinglist class (%w) is undefined", flcn);
}
-
+
var cblist = new global[flcn](this,
- { visible:false,
- attach: this.listattach,
- attachoffset: -2,
+ { visible:false,
+ attach: this.listattach,
+ attachoffset: -2,
itemclassname: icn
});
-
+
// add in a white view to reduce the visual effect of the
// list items appearing as they are created
var tmp = new global[icn](cblist, { name:'item' });
new LzDatapath(tmp, { pooling: true });
-
+
this._cblist = cblist;
// Make sure we deselect if we're acting like a menu
@@ -268,15 +267,24 @@
cblist.setWidth(w);
cblist.setAttachTarget(this);
cblist.setAttribute('shownitems', this.shownitems);
- cblist.item.setDatapath(this.itemdatapath);
+ //local-dataset-modification by senshi
+ var itd = this.itemdatapath;
+ if (itd.indexOf( "local:" ) == 0) {
+ itd = "local:" + "parent.owner." + itd.substring( 6 );
+ if ($debug)
+ Debug.write( "local-dataset-modification:" + itd );
+ }
+
+ cblist.item.setDatapath(itd);
+
cblist.setAttribute('attach', this.listattach);
if (this._selectdel == null) {
this._selectdel = new LzDelegate( this, "_flistselect" );
}
this._selectdel.register(cblist, 'onselect');
}
-
+
if (! this.ismenu) {
// Set the item for _cblist
var item = _getItemAt(this._selectedIndex);
Modified: openlaszlo/branches/paperpie/lps/components/base/basewindow.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/base/basewindow.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/base/basewindow.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -5,6 +5,7 @@
<!-- @LZX_VERSION@ -->
<library>
+<include href="base/basecomponent.lzx" />
<include href="utils/states/dragstate.lzx"/>
<include href="utils/states/resizestatemin.lzx"/>
@@ -109,9 +110,9 @@
<method name="sendInFrontOf" args="v"> <![CDATA[
var wlist = parent.options['windowlist'];
if (this.visible) {
- this._removeFromWindowlist();
- for (var i in wlist) {
+ for (var i=0; i < wlist.length; ++i) {
if (wlist[i]==v) {
+ this._removeFromWindowlist();
wlist.splice(i+1,0,this);
break;
}
@@ -127,9 +128,9 @@
<method name="sendBehind" args="v"> <![CDATA[
var wlist = parent.options['windowlist'];
if (this.visible) {
- this._removeFromWindowlist();
- for (var i in wlist) {
+ for (var i=0; i < wlist.length; ++i) {
if (wlist[i]==v) {
+ this._removeFromWindowlist();
wlist.splice(i,0,this);
break;
}
@@ -246,6 +247,21 @@
<method name="setVisible" args="isVisible"> <![CDATA[
super.setVisible(isVisible);
if (isVisible) {
+ //need to add this window to the parent's windowlist
+ var foundMe = false;
+ var wlist = parent.options["windowlist"];
+ var len = wlist.length;
+ for (var i=0; i < len; ++i) {
+ if (wlist[i] == this){
+ foundMe = true;
+ break;
+ }
+ }
+
+ if (!foundMe) {
+ wlist[len] = this;
+ }
+
this.setAttribute('haswindowfocus', true);
} else {
this._removeFromWindowlist();
Modified: openlaszlo/branches/paperpie/lps/components/extensions/drawview.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/extensions/drawview.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/extensions/drawview.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -287,6 +287,25 @@
if (drawview.prototype.uid == null) {
drawview.prototype.uid = 0;
}
+ this.beginPath();
+
+ if (this.__LZcanvas) {
+ this._lineWidth = null;
+ this._lineCap = null;
+ this._fillStyle = null;
+ this._strokeStyle = null;
+ this._globalAlpha = null;
+ if (Lz.__BrowserDetect.isIE) {
+ LzSprite.prototype.__discardElement(this.__LZcanvas);
+ } else {
+ this.__LZcanvas.setAttribute('width', width);
+ this.__LZcanvas.setAttribute('height', height);
+ this.__canvaswidth = width;
+ this.__canvasheight = height;
+ this.setAttribute('context', this.__LZcanvas.getContext("2d"));
+ return;
+ }
+ }
this.__id = 'canvas-' + drawview.prototype.uid++;
//Debug.write('_buildcanvas', this.__id, width, height);
@@ -298,7 +317,6 @@
this.__canvasheight = height;
var div = this.getMCRef();
div.appendChild(this.__LZcanvas);
- this.beginPath();
if (Lz.__BrowserDetect.isIE) {
// IE can take a while to start up.
@@ -310,13 +328,13 @@
}
function setWidth(w) {
super.setWidth(w);
- if (this['__id'] == null && this.height > 0) {
+ if (this.height > 0) {
this._buildcanvas(w, this.height);
}
}
function setHeight(h) {
super.setHeight(h);
- if (this['__id'] == null && this.width > 0) {
+ if (this.width > 0) {
this._buildcanvas(this.width, h);
}
}
Modified: openlaszlo/branches/paperpie/lps/components/extensions/html.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/extensions/html.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/extensions/html.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -17,7 +17,7 @@
LzBrowser.callJS('Lz.iframemanager.create', function (id) {
Lz.iframemanager.owners[id] = owner;
owner.setiframeid(id);
- }, "", name, appendto);
+ }, canvas.id, name, appendto);
}
,setPosition: function(id, x, y, width, height, v) {
LzBrowser.callJS('Lz.iframemanager.setPosition', false, id, x, y, width, height, v);
@@ -31,6 +31,9 @@
,bringToFront: function(id) {
LzBrowser.callJS('Lz.iframemanager.bringToFront', null, id);
}
+ ,sendToBack: function(id) {
+ LzBrowser.callJS('Lz.iframemanager.sendToBack', null, id);
+ }
,__gotload: function(id) {
if (Lz.iframemanager.owners[id]) Lz.iframemanager.owners[id].__gotload();
}
@@ -109,15 +112,13 @@
var height = this.target.getAttributeRelative("height", canvas) + this.heightoffset;
if (this['iframeid']) {
Lz.iframemanager.setPosition(this.iframeid, x, y, width, height, this.visible);
- } else {
- this.cachepos = true;
}
</method>
<!--- @access private -->
<method name="setiframeid" args="id">
//Debug.write('setiframeid', id, this)
this.iframeid = id;
- if (this['cachepos']) this.__updatepos();
+ this.__updatepos();
if (this['isfront']) this.bringToFront();
if (this['srcset']) Lz.iframemanager.setSrc(id, this.srcset);
this.setAttribute('ready', true);
@@ -128,8 +129,14 @@
this.onload.sendEvent();
</method>
<method name="bringToFront">
+ if (this['isfront'] == true) return;
this.isfront = true;
if (this['iframeid']) Lz.iframemanager.bringToFront(this.iframeid);
</method>
+ <method name="sendToBack">
+ if (this['isfront'] == false) return;
+ this.isfront = false;
+ if (this['iframeid']) Lz.iframemanager.sendToBack(this.iframeid);
+ </method>
</class>
</library>
Modified: openlaszlo/branches/paperpie/lps/components/extensions/test/html-swf.jsp
===================================================================
--- openlaszlo/branches/paperpie/lps/components/extensions/test/html-swf.jsp 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/extensions/test/html-swf.jsp 2007-10-10 23:17:04 UTC (rev 6797)
@@ -47,14 +47,10 @@
border: 0 none;
overflow: hidden;
}
+ body {
+ background-color: #ffffff;
+ }
- body
- {
- height: 100%;
- width: 100%;
- background-color: #ffffff;
- }
-
img { border: 0 none; }
</style></head>
<body><script type="text/javascript">
Modified: openlaszlo/branches/paperpie/lps/components/extensions/test/html.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/extensions/test/html.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/extensions/test/html.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -7,7 +7,7 @@
<class name="browser" extends="window" resizable="true" bgcolor="silver">
<simplelayout axis="x"/>
- <edittext name="txt" text="http://openlaszlo.org/" width="300"/>
+ <edittext name="txt" text="http://w3.org/" width="300"/>
<button>Load
<method event="onclick">
parent.main.setAttribute('src', parent.txt.getText());
Modified: openlaszlo/branches/paperpie/lps/components/incubator/roundrect.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/incubator/roundrect.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/incubator/roundrect.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -168,6 +168,7 @@
<handler name="oncontext">
<![CDATA[
this.drawStructure();
+ this._cache = null;
]]>
</handler>
@@ -193,7 +194,7 @@
,insettop: this.insettop
,insetright: this.insetright
,insetbottom: this.insetbottom
- ,inset: this.inset
+ ,inset: this['inset']
,height: this.height
,width: this.width
};
Modified: openlaszlo/branches/paperpie/lps/components/incubator/textstyle.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/incubator/textstyle.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/incubator/textstyle.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -10,7 +10,7 @@
-->
<class name="textstyle" extends="style">
<attribute name="font" value="arial" type="string" />
- <attribute name="fontsize" value="11" type="number" />
+ <attribute name="fontsize" value="11" />
<attribute name="fontstyle" value="plain" type="string" />
</class>
</library>
Modified: openlaszlo/branches/paperpie/lps/components/lz/datacombobox.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/lz/datacombobox.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/lz/datacombobox.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -32,6 +32,10 @@
<!--- Tell base class about our label view.
@keywords private -->
<attribute name="_cbtext" value="$once{this._text}" />
+
+ <method name="getText">
+ return _text.getText();
+ </method>
<!--- @access private -->
<method name="_showEnabled">
Modified: openlaszlo/branches/paperpie/lps/components/lz/edittext.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/lz/edittext.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/lz/edittext.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -115,6 +115,10 @@
field.setPattern(r);
</method>
+ <method name="setSelection" args="start,end">
+ field.setSelection(start, end);
+ </method>
+
<!--- @keywords private -->
<method name="getFocusRect" >
var fx = this.getAttributeRelative('x',canvas);
@@ -194,10 +198,28 @@
<!--- @keywords private -->
<method name="applyData" args="d">
- this.setText(d);
+ this.field.applyData( d );
</method>
<!--- @keywords private -->
+ <method name="updateData">
+ this.updateText();
+ return this.text;
+ </method>
+
+ <!-- Updates the text property of the component to the text that is
+ entered in its input field. -->
+ <method name="updateText">
+ this.setText( this.field.getText() );
+ </method>
+
+ <!--- Returns string displayed in this component, like getText().
+ @return String: the string displayed. -->
+ <method name="getValue">
+ return this.field.getText();
+ </method>
+
+ <!--- @keywords private -->
<method name="_showEnabled">
if (_enabled) {
this.field.setAttribute('enabled', true);
Modified: openlaszlo/branches/paperpie/lps/components/lz/gridtext.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/lz/gridtext.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/lz/gridtext.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -10,6 +10,10 @@
<!--- type of content's alignment. Default: left
possible values are: left, center, right -->
<attribute name="textalign" type="string" value="left"/>
+ <!--- Whether one is able to select the text. (Only applies
+ if the grid isn't editable, because when it's editable,
+ the text is automatically selectable.) -->
+ <attribute name="selectable" type="boolean" value="false"/>
<!--- @keywords private -->
<attribute name="rowdp" value="" type="string"/>
@@ -71,6 +75,7 @@
<method event="oninit">
<![CDATA[
+ this.setAttribute('selectable', classroot.selectable);
var f = function() {
this.setAttribute("x", this._calcX());
}
Modified: openlaszlo/branches/paperpie/lps/components/utils/replicator/replicator.lzx
===================================================================
--- openlaszlo/branches/paperpie/lps/components/utils/replicator/replicator.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/components/utils/replicator/replicator.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -137,19 +137,29 @@
super.init.apply(this, arguments);
if (this.dataset && this.xpath) {
this._pointer = this.dataset.getPointer();
- this._ondatadel = new LzDelegate(this, '_updateChildren', this._pointer.p, 'onDocumentChange')
+ this._ondatadel = new LzDelegate(this, '_updateChildren', this.dataset, 'onDocumentChange')
this._updateChildren();
}
}
+ function destroy() {
+ if (this['_ondatadel']) this._ondatadel.unregisterAll();
+ this._pointer = null;
+ this.dataset = null;
+ super.destroy.apply(this, arguments);
+ }
+
// @keywords private
- function _updateChildren(c) {
+ function _updateChildren() {
// TODO: use changepackage to do something smarter here
- this.setNodes(this._pointer.xpathQuery(this.xpath))
+ var p = this._pointer.xpathQuery(this.xpath);
+ if (p && ! p['length']) p = [p];
+ this.setNodes(p)
}
// @keywords private
function createChildren (c) {
+ super.createChildren( [] );
this.replicated = c.pop();
//Debug.write( 'replicated', replicated );
@@ -300,7 +310,7 @@
// @keywords private
function __adjustVisibleClones () {
- var p = this.parent;
+ var p = this.container;
for (var l in p.layouts) {
p.layouts[l].lock();
}
Modified: openlaszlo/branches/paperpie/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/paperpie/lps/includes/source/embednew.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/includes/source/embednew.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -87,6 +87,7 @@
if (properties.accessible == 'true') {
queryvals.flashvars += '&accessible=true';
}
+ queryvals.flashvars += '&id=' + properties.id;
var url = queryvals.url + '?' + queryvals.query;
@@ -110,6 +111,7 @@
,getCanvasAttribute: Lz._getCanvasAttributeSWF
,callMethod: Lz._callMethodSWF
,_ready: Lz._ready
+ ,loaded: false
,_sendMouseWheel: Lz._sendMouseWheel
,_setCanvasAttributeDequeue: Lz._setCanvasAttributeDequeue
}
@@ -198,6 +200,7 @@
runtime: 'dhtml'
,_id: properties.id
,_ready: Lz._ready
+ ,loaded: false
,setCanvasAttribute: Lz._setCanvasAttributeDHTML
,getCanvasAttribute: Lz._getCanvasAttributeDHTML
}
@@ -337,7 +340,7 @@
* @param hist:Boolean value - if true, add a history event.
*/
_setCanvasAttributeSWF: function (name, value, hist) {
- if (dojo.flash.ready) {
+ if (this.loaded) {
if (hist) {
Lz.history._store(name, value);
} else {
@@ -386,6 +389,8 @@
}
,/** @access private */
_ready: function (cref) {
+ this.loaded = true;
+ Lz.loaded = true;
if (this._setCanvasAttributeQ) {
this._setCanvasAttributeDequeue();
}
@@ -402,7 +407,7 @@
* @param name:String name of the property to read
*/
_getCanvasAttributeSWF: function (name) {
- if (dojo.flash.ready) {
+ if (this.loaded) {
return dojo.flash.comm.getCanvasAttribute(name);
} else {
alert('Flash is not ready: getCanvasAttribute' + name);
@@ -545,13 +550,13 @@
* @param js:String javascript to call in the form 'foo.bar.methodcall(arg1,arg2,...)'
*/
_callMethodSWF: function (js) {
- if (dojo.flash.ready) {
+ if (this.loaded) {
return dojo.flash.comm.callMethod(js);
} else {
- this._lastjs = function() {
+ var f = function() {
dojo.flash.comm.callMethod(js);
};
- dojo.flash.addLoadedListener(this._lastjs);
+ dojo.flash.addLoadedListener(f);
}
}
,/** @access private */
@@ -564,17 +569,8 @@
}
return root;
}
- /* TODO max: look at this and see if there is a merge conflict,
- from wafflecone. [bshine 2007.09.14] */
,/** @access private */
- _checkHistory: function() {
- window.setInterval('Lz._checklocationhash()', 300)
- }
- /* TODO max: look at this and see if there is a merge conflict,
- from wafflecone. [bshine 2007.09.14] */
- ,/** @access private */
_sendMouseWheel: function(d) {
if (d != null) this.callMethod("LzKeys.__mousewheelEvent(" + d + ")");
}
};
-window.onload = Lz._checkHistory;
Modified: openlaszlo/branches/paperpie/lps/includes/source/flash.js
===================================================================
--- openlaszlo/branches/paperpie/lps/includes/source/flash.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/includes/source/flash.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -1012,17 +1012,19 @@
// the method name has a dot in it, such as "dojo.flash.loaded", we
// eval it so that the method gets run against an instance
var runMe;
+ var scope = window;
if(functionName.indexOf(".") == -1){ // global function
runMe = window[functionName];
}else{
// instance function
runMe = eval(functionName);
+ scope = eval(functionName.substring(0, functionName.lastIndexOf(".")));
}
// make the call and get the results
var results = null;
if(runMe != null){
- results = runMe.apply(null, flashArgs);
+ results = runMe.apply(scope, flashArgs);
}
results += '';
Modified: openlaszlo/branches/paperpie/lps/includes/source/iframemanager.js
===================================================================
--- openlaszlo/branches/paperpie/lps/includes/source/iframemanager.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/includes/source/iframemanager.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -13,27 +13,29 @@
var id = '__lz' + Lz.iframemanager.__highestz++;
Lz.iframemanager.__frames[id] = i;
- Lz.__setAttr(i, 'id', id);
if (name == null) name = '';
if (name != "") Lz.__setAttr(i, 'name', name);
- i.__gotload = Lz.iframemanager.__gotload;
- Lz.__setAttr(i, 'onload', 'Lz.iframemanager.__gotload("' + id + '")');
if (appendto == null || appendto == "undefined") {
appendto = document.body;
}
appendto.appendChild(i);
+ Lz.__setAttr(i, 'id', id);
var iframe = Lz.iframemanager.getFrame(id);
+ Lz.__setAttr(iframe, 'onload', 'Lz.iframemanager.__gotload("' + id + '")');
+ iframe.__gotload = Lz.iframemanager.__gotload;
+ iframe._defaultz = 99900 + Lz.iframemanager.__highestz;
+ iframe.style.zIndex = iframe._defaultz;
if (document.getElementById && !(document.all) ) {
iframe.style.border = '0';
} else if (document.all) {
- Lz.__setAttr(iframe, 'frameborder', '0');
+ Lz.__setAttr(iframe, 'border', '0');
Lz.__setAttr(iframe, 'allowtransparency', 'true');
}
iframe.style.position = 'absolute';
- return id;
+ return id + '';
}
,getFrame: function(id) {
return Lz.iframemanager.__frames[id];
@@ -83,10 +85,18 @@
iframe.style.zIndex = 100000 + Lz.iframemanager.__highestz;
return true;
}
+ ,sendToBack: function(id) {
+ //console.log('sendToBack', id)
+ //Debug.write('bringToFront', id);
+ var iframe = Lz.iframemanager.getFrame(id);
+ if (! iframe) return;
+ iframe.style.zIndex = iframe._defaultz;
+ return true;
+ }
,__gotload: function(id) {
//Debug.write('__gotload', id);
- //console.log('__gotload', id);
var iframe = Lz.iframemanager.getFrame(id);
+ //console.log('__gotload', iframe, iframe.skiponload);
if (! iframe) return;
if (iframe.skiponload) {
iframe.skiponload = false;
@@ -97,7 +107,7 @@
iframe.owner.__gotload();
} else {
//console.log('calling method', 'Lz.iframemanager.__gotload(\'' + id + '\')');
- Lz.callMethod('Lz.iframemanager.__gotload(\'' + id + '\')');
+ Lz[iframe.owner].callMethod('Lz.iframemanager.__gotload(\'' + id + '\')');
}
}
}
Modified: openlaszlo/branches/paperpie/lps/includes/source/lzhistory.js
===================================================================
--- openlaszlo/branches/paperpie/lps/includes/source/lzhistory.js 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/lps/includes/source/lzhistory.js 2007-10-10 23:17:04 UTC (rev 6797)
@@ -9,58 +9,62 @@
Lz.history = {
_currentstate: null
,init: function() {
+ var _this = Lz.history;
+ _this._title = top.document.title;
Lz.__BrowserDetect.init();
- Lz.history._currentstate = Lz.history.get();
+ var currstate = _this.get();
if (Lz.__BrowserDetect.isSafari) {
// must track state ourselves...
- Lz.history._historylength = history.length;
- Lz.history._history = [];
- for (var i = 1; i < Lz.history._historylength; i++) {
- Lz.history._history.push('');
+ _this._historylength = history.length;
+ _this._history = [];
+ for (var i = 1; i < _this._historylength; i++) {
+ _this._history.push('');
}
- Lz.history._history.push(Lz.history._currentstate);
+ _this._history.push(currstate);
var form = document.createElement('form');
form.method = 'get';
document.body.appendChild(form);
- Lz.history._form = form;
+ _this._form = form;
if (! top.document.location.lzaddr) {
top.document.location.lzaddr = {};
}
if (top.document.location.lzaddr.history) {
- Lz.history._history = top.document.location.lzaddr.history.split(',');
+ _this._history = top.document.location.lzaddr.history.split(',');
}
+ if (currstate != '') {
+ _this.set(currstate)
+ }
} else if (Lz.__BrowserDetect.isIE) {
+ var currstate = top.location.hash;
+ if (currstate) currstate = currstate.substring(1);
// use an iframe;
var i = document.createElement('iframe');
Lz.__setAttr(i, 'id', 'lzHistory');
- Lz.__setAttr(i, 'border', '0');
+ Lz.__setAttr(i, 'border', 0);
document.body.appendChild(i);
i.style.position = 'absolute';
i.style.display = 'none';
i.style.left = '-1000px';
- Lz.history._iframe = document.getElementById('lzHistory');
- var doc = Lz.history._iframe.contentWindow.document;
+ _this._iframe = document.getElementById('lzHistory');
+ var doc = _this._iframe.contentDocument || _this._iframe.contentWindow.document;
doc.open();
doc.close();
- if (Lz.history._currentstate != '') doc.location.hash = '#' + Lz.history._currentstate;
+ //alert('currstate ' + currstate);
+ if (currstate != '') {
+ doc.location.hash = '#' + currstate;
+ _this._parse(currstate)
+ }
+ } else {
+ if (currstate != '') {
+ _this._parse(currstate)
+ _this._currentstate = currstate;
+ }
}
- if (Lz.history._currentstate != '') Lz.history._parse(Lz.history._currentstate)
- //alert('init');
+ //alert('init ' + currstate);
setInterval('Lz.history._checklocationhash()', 100)
}
,/** @access private */
- _historyEvent: function (value) {
- if (dojo.flash.ready) {
- //alert(value);
- dojo.flash.comm.receiveHistory(value + '');
- return true;
- } else {
- //alert('dojo.flash is not ready: _historyEvent' + value);
- }
- }
-
- ,/** @access private */
_checklocationhash: function() {
if (dojo.flash && dojo.flash.info && dojo.flash.info.installing) return;
if (Lz.__BrowserDetect.isSafari) {
@@ -84,43 +88,58 @@
if (Lz.__BrowserDetect.isIE) {
if (h != this._currentstate) {
- top.location.hash = '#' + h;
+ top.location.hash = h == '0' ? '' : '#' + h;
this._currentstate = h;
this._parse(h);
}
+ if (top.document.title != this._title) {
+ top.document.title = this._title;
+ }
} else {
this._currentstate = h;
this._parse(h);
}
}
+ if (dojo.flash.obj && Lz.loaded) {
+ var p = dojo.flash.obj.get();
+ if (p) {
+ var cid = p.GetVariable("_callbackID");
+ if (cid != 'null') return;
+ var val = p.GetVariable("_currenthistory");
+ if (val && val != 'null' && val != Lz.history._lasthash) {
+ //alert('val ' + val);
+ Lz.history._lasthash = val;
+ }
+ }
+ }
}
,/** */
set: function(s) {
if (s == null) s = '';
- if (this._currentstate == s) return;
- this._currentstate = s;
+ if (Lz.history._currentstate == s) return;
+ Lz.history._currentstate = s;
var hash = '#' + s;
if (Lz.__BrowserDetect.isIE) {
- top.location.hash = hash;
- var doc = Lz.history._iframe.contentWindow.document;
+ top.location.hash = hash == '#0' ? '' : hash;
+ var doc = Lz.history._iframe.contentDocument || Lz.history._iframe.contentWindow.document;
doc.open();
doc.close();
doc.location.hash = hash;
- this._parse(s + '');
+ Lz.history._parse(s + '');
} else if (Lz.__BrowserDetect.isSafari) {
// can't preserve query strings :(
- this._form.action = hash;
- top.document.location.lzaddr.history = this._history.toString();
- this._skip = true;
- this._history[history.length] = hash;
- this._historylength = history.length + 1;
- this._form.submit()
- this._skip = false;
+ Lz.history._form.action = hash;
+ top.document.location.lzaddr.history = Lz.history._history.toString();
+ Lz.history._skip = true;
+ Lz.history._history[history.length] = hash;
+ Lz.history._historylength = history.length + 1;
+ Lz.history._form.submit()
+ Lz.history._skip = false;
} else {
top.location.hash = hash;
- this._parse(s + '');
+ Lz.history._parse(s + '');
}
return true;
}
@@ -144,12 +163,12 @@
}
,/** @access private */
_parse: function(h) {
+ var _this = Lz.history;
// TODO: send events to all apps
- if (h.length == 0 || h == this._lasthash) return;
- //alert('_parse '+ h);
+ if (h.length == 0 || h == _this._lasthash) return;
if (h.indexOf('_lz') != -1) {
// TODO: use rison
- this._lasthash = h;
+ _this._lasthash = h;
h = h.substring(3);
var a = h.split(',');
for (var j = 0; j < a.length; j++) {
@@ -161,15 +180,15 @@
if (window['canvas']) canvas.setAttribute(name, val);
}
} else {
+ //alert('_parse test' + h + ', ' + _this._lasthash);
//history id
- if (Lz.history._historyEvent(h)) {
- // if successful, don't send again
- this._lasthash = h;
+ if (Lz.loaded && Lz.callMethod && h != Lz.history._lasthash) {
+ _this.__setFlash(h);
}
if (Lz.__dhtmlhistoryready && LzHistory && LzHistory['receiveHistory']) {
- //alert(h);
+ //alert('dhtml ' + h);
LzHistory.receiveHistory(h);
- this._lasthash = h;
+ _this._lasthash = h;
}
}
}
@@ -187,5 +206,23 @@
this.set('_lz' + o);
//window.frames['_lzhist'].location = newurl;
}
+ ,/** @access private called from flash */
+ __receivedhistory: function(h) {
+ Lz.history._lasthash = h + '';
+ //alert('__receivedhistory '+ Lz.history._lasthash);
+ }
+ ,/** @access private called from flash */
+ __setFlash: function(h) {
+ var p = dojo.flash.obj.get();
+ if (p) {
+ var cid = p.GetVariable("_callbackID") + '';
+ if (cid == 'null') {
+ Lz.callMethod("LzHistory.receiveHistory(" + h + ")");
+ } else {
+ setTimeout('Lz.history.__setFlash(' + h + ')', 10);
+ //alert('busy');
+ }
+ }
+ }
};
window.onload = Lz.history.init;
Modified: openlaszlo/branches/paperpie/test/compiler_errors/bogus-attribute-error.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/compiler_errors/bogus-attribute-error.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/compiler_errors/bogus-attribute-error.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
<canvas width="300" height="200" bgcolor="red">
<window title="Window 1" x="10" y="10" width="200" height="200" >
<view>
- <text>This is some
+ <text>This is some
text with a couple
of linebreaks in it.
</text>
@@ -20,8 +20,11 @@
<mywindow bgcolor="yellow" boogaboogah="'bogus_attribute'" fluffy="parrot food">
</mywindow>
+ <view blah="17"/>
+ <method event="oninit" method="_doCheckConfig"/>
+
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
Modified: openlaszlo/branches/paperpie/test/compiler_errors/redfine-builtin.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/compiler_errors/redfine-builtin.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/compiler_errors/redfine-builtin.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -1,6 +1,6 @@
<canvas layout="spacing:10">
- <class name="textfield"/>
+ <class name="text"/>
<edittext>
<method event="onkeyup">
@@ -9,3 +9,7 @@
</edittext>
</canvas>
+<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Use is subject to license terms. *
+* X_LZ_COPYRIGHT_END ****************************************************** -->
Modified: openlaszlo/branches/paperpie/test/lfc/data/dollarpathquote.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lfc/data/dollarpathquote.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lfc/data/dollarpathquote.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -2,7 +2,7 @@
<debug width="500" height="500"/>
<include href="lzunit/lzunit.lzx" />
<dataset name="ds">
- <record a="1"> Some text.</record>
+ <record a="1">Some text.</record>
</dataset>
<script>
Modified: openlaszlo/branches/paperpie/test/lfc/data/nonpoolingoptimization.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lfc/data/nonpoolingoptimization.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lfc/data/nonpoolingoptimization.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -1,6 +1,7 @@
<canvas>
- <include href="redmond" />
+ <!-- <include href="redmond" /> There is no redmond that I can find,
+ so this test doesn't run properly. -->
<dataset name="messages" />
<datapointer name="mptr" xpath="messages:/" />
Modified: openlaszlo/branches/paperpie/test/lfc/data/stringxml.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lfc/data/stringxml.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lfc/data/stringxml.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -8,14 +8,19 @@
//good string
var lzdom = LzDataNode.stringToLzData(
"<foo><bar blah='cr'/></foo>" );
- assertTrue( lzdom instanceof LzDataNode );
+ // Can't do instanceof on LzDataNode, because it's a mixin. LPP-3632
+ //assertTrue( lzdom instanceof LzDataNode );
assertEquals( "foo", lzdom.nodeName );
assertEquals( 1, lzdom.childNodes.length );
assertEquals( 'cr' , lzdom.getFirstChild().attributes.blah );
//error; no root node
var lznot = LzDataNode.stringToLzData(
"<foo/><bar/>" );
- assertNull( lznot );
+ // Commenting this out, for now: It works in DHTML, and
+ // after conferring with Henry, he doesn't think we can
+ // check for XML validity at runtime with the platform
+ // XML parser.
+ //assertNull( lznot );
//error; no plain 'ol string
var lznota = LzDataNode.stringToLzData( "some text" );
assertNull( lznota );
@@ -28,3 +33,7 @@
</TestCase>
</TestSuite>
</canvas>
+<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
+* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Use is subject to license terms. *
+* X_LZ_COPYRIGHT_END ****************************************************** -->
\ No newline at end of file
Modified: openlaszlo/branches/paperpie/test/lfc/data/testdataheaders.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lfc/data/testdataheaders.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lfc/data/testdataheaders.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -19,6 +19,7 @@
values[i] = values[i].split(';')[0];
}
values.sort();
+ // See: LPP-4707.
assertEquals(expected, values);
</method>
<method name="testAcceptEncoding">
Modified: openlaszlo/branches/paperpie/test/lfc/data/testdatapointer.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lfc/data/testdatapointer.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lfc/data/testdatapointer.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -52,7 +52,7 @@
"/row[1]/key[2]/name()" , "key" ,
"/row[2]/key[3]" , null ];
for ( var i = 0; i < mya.length; i+=2 ){
- this.setXPath( mya[i] );
+ this.setXPath( mya[i + 1] );
assert( this.data == mya[ i+ 1], mya[ i ] );
}
@@ -62,7 +62,7 @@
</button>
<button>Anon dataset
- <datapointer name="mydp" xpath="new:/">
+ <datapointer name="mydp" xpath="keys:/">
<method event="onclick" reference="parent">
<![CDATA[
var mya = [ [ "a" , "text1" , { a : 1 , b: "a"} ],
@@ -98,7 +98,7 @@
assert( "text3" == this.getNodeText() , "selectParent" );
this.selectParent( );
- Debug.write( this.Serialize() );
+ Debug.write( this.serialize() );
//delete
//add
@@ -151,7 +151,9 @@
<method name="assert" args="label, result, shouldfail">
if (!result) {
if (shouldfail) return;
- Debug.write(label + ": " + result + " n: " + this.getName() + " o: " + this.getOffset());
+ /* Removing getOffset() -- it doesn't exist, and what I think
+ was intended -- getNodeOffset() -- is deprecated as well. */
+ Debug.write(label + ": " + result + " n: " + this.getNodeName());
//Debug.write(" Warning - result returned false");
}
</method>
Modified: openlaszlo/branches/paperpie/test/lfc/data/testheaderresponse.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lfc/data/testheaderresponse.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lfc/data/testheaderresponse.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -3,7 +3,7 @@
<dataset name="dsheaders" timeout="400000"
src="http:testdata.xml"
- proxied="true"
+ proxied="xlxinherit"
getresponseheaders="true"
onerror="Debug.write('testheaderresponse: dsheaders got onerror')"
ontimeout="Debug.write('testheaderresponse: dsheaders got ontimeout')"
Modified: openlaszlo/branches/paperpie/test/lfc/data/testhttpdata.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lfc/data/testhttpdata.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lfc/data/testhttpdata.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -15,29 +15,29 @@
<debug y="${tests.height}" height="${canvas.height - tests.height}" />
<dataset name="data1" type="http"
querystring="'foo=bar&plop=slop'"
- src="http://localhost:8080/lps/test/lfc/data/httpecho.jsp">
+ src="http:httpecho.jsp">
</dataset>
<dataset name="data2" type="http" queuerequests="true"
- src="http://localhost:8080/lps/test/lfc/data/httpecho.jsp"/>
+ src="http:httpecho.jsp"/>
<dataset name="data3" acceptencodings="true" getresponseheaders="false"
- src="http://localhost:8080/lps/test/lfc/data/httpecho.jsp"/>
+ src="http:httpecho.jsp"/>
<dataset name="data4" cacheable="true" getresponseheaders="false"
- src="http:../../resources/xml/swatch.xml"/>
+ src="http:../../data/swatch.xml"/>
<dataset name="data5" cacheable="true" acceptencodings="true"
- src="http:../../resources/xml/swatch.xml"/>
+ src="http:../../data/swatch.xml"/>
<dataset name="data6" acceptencodings="true"
- src="http://localhost:8080/lps/test/lfc/data/httpecho.jsp"/>
+ src="http:httpecho.jsp"/>
<dataset name="data7" acceptencodings="true" cacheable="true"
- src="file:../../resources/xml/swatch.xml"/>
+ src="file:../../data/swatch.xml"/>
<dataset name="data8"
- src="http://localhost:8080/lps/test/lfc/data/httptimeout.jsp"/>
+ src="http:httptimeout.jsp"/>
<dataset name="data9" src="http:httpredir.jsp"/>
Modified: openlaszlo/branches/paperpie/test/lztest/lztest-view.lzx
===================================================================
--- openlaszlo/branches/paperpie/test/lztest/lztest-view.lzx 2007-10-10 22:33:26 UTC (rev 6796)
+++ openlaszlo/branches/paperpie/test/lztest/lztest-view.lzx 2007-10-10 23:17:04 UTC (rev 6797)
@@ -143,13 +143,12 @@
</view>
-<!-- viewN: rotations, around the center -->
-<!-- leave for later
- <view name="view5" bgcolor="yellow">
+<!-- view14: rotations, around the center -->
+ <view name="view14" bgcolor="yellow">
+ <simplelayout/>
<view name="v1" bgcolor="green" width="20" height="10" xoffset="10" yoffset="5" rotation="45"/>
- <simpleboundslayout name="layout" axis="x"/>
+ <view name="v2" bgcolor="red" width="20" height="10" xoffset="10" yoffset="5"/>
</view>
--->
@@ -180,10 +179,10 @@
// Inspect [x,y,width,height] and compare with the specified view
function loctest(msg,view,exp)
{
- LzTestManager.assertEquals (exp[0], view.x, msg + ": x failure");
- LzTestManager.assertEquals (exp[1], view.y, msg + ": y failure");
- LzTestManager.assertEquals (exp[2], view.width, msg + ": width failure");
- LzTestManager.assertEquals (exp[3], view.height, msg + ": height failure");
+ LzTestManager.assertWithin (exp[0], view.sprite.x, .1, msg + ": x failure");
+ LzTestManager.assertWithin (exp[1], view.sprite.y, .1, msg + ": y failure");
+ LzTestManager.assertWithin (exp[2], view.sprite.width, .1, msg + ": width failure");
+ LzTestManager.assertWithin (exp[3], view.sprite.height, .1, msg + ": height failure");
}
@@ -463,6 +462,10 @@
// Built-into object view14
}
+suite.test14 = function() {
+ if (view14.capabilities.rotation) loctest ('view14', view14.v1, [-3.53553390593274,-10.6066017177982,20,10]);
+ loctest ('view14', view14.v2, [-10,5,20,10]);
+}
/* Leave for last
suite.testN = function() {
var b = view5.v1.getBounds();
@@ -484,6 +487,7 @@
suite.addTest(suite.test11);
suite.addTest(suite.test12);
suite.addTest(suite.test13);
+suite.addTest(suite.test14);
More information about the Laszlo-checkins
mailing list