You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/08/09 16:50:22 UTC

svn commit: r1371236 - in /pivot/site/trunk/deploy/assets-for-tests: README.txt frame.bxml

Author: smartini
Date: Thu Aug  9 14:50:21 2012
New Revision: 1371236

URL: http://svn.apache.org/viewvc?rev=1371236&view=rev
Log:
update some bxml file (and related txt), now fully working

Modified:
    pivot/site/trunk/deploy/assets-for-tests/README.txt
    pivot/site/trunk/deploy/assets-for-tests/frame.bxml

Modified: pivot/site/trunk/deploy/assets-for-tests/README.txt
URL: http://svn.apache.org/viewvc/pivot/site/trunk/deploy/assets-for-tests/README.txt?rev=1371236&r1=1371235&r2=1371236&view=diff
==============================================================================
--- pivot/site/trunk/deploy/assets-for-tests/README.txt (original)
+++ pivot/site/trunk/deploy/assets-for-tests/README.txt Thu Aug  9 14:50:21 2012
@@ -1 +1 @@
-
This folder contains some files copied by hand, to be able to make some loading test from Client applications.

bxml (and related) resources are here to simulate bxml files (dynamically) generated at server side.

The full URL for this folder (live, from the production web site) is:
http://pivot.apache.org/assets-for-tests

Note on loading bxml files, but from remote (for example see JavascriptConsoleTest, under the tests subproject):
secondary bxml files (included by others) could not be found
loading in the usual (relative) way, so to handle safely even those cases by convention I use a variable
(accessible or defined directly in JavaScript inside bxml files) called resourcesBaseURL
but it's not possible to test if undefined (like in standard JavaScript inside browsers), so must be defined
(at least as an empty string, or a good base URL terminated by /).
\ No newline at end of file
+
This folder contains some files copied by hand, to be able to make some loading test from Client applications.

bxml (and related) resources are here to simulate bxml files (dynamically) generated at server side.

The full URL for this folder (live, from the production web site) is:
http://pivot.apache.org/assets-for-tests

As a minimal sample for loading bxml files, see JavascriptConsoleTest, under the tests subproject.
Note that to load from remote secondary bxml files (included by main bxml files loaded by the application),
it's better to define a variable (accessible or defined directly in JavaScript inside bxml files) 
for example called resourcesBaseURL where to store its base folder (but in URL format).
If defined in JavaScript it's not possible to test if it's undefined (like in standard JavaScript inside browsers),
so it must always be defined (at least as an empty string, or a good base URL terminated by /).
Or define in Java and for example then put in bxmlSerializer namespace.

Important: 
remember that to load a remote file it's necessary to use the (more generic) version of the loader method
(usually done in the application Java Main Class, or in an utility one) that takes an URL (maybe even to load a local file),
and not only the filename ...

Note that to let secondary bxml files see/use variables (defined in Java or in JavaScript),
you have to put them in bxmlSerializer namespace, as done in the example (both cases).
\ No newline at end of file

Modified: pivot/site/trunk/deploy/assets-for-tests/frame.bxml
URL: http://svn.apache.org/viewvc/pivot/site/trunk/deploy/assets-for-tests/frame.bxml?rev=1371236&r1=1371235&r2=1371236&view=diff
==============================================================================
--- pivot/site/trunk/deploy/assets-for-tests/frame.bxml (original)
+++ pivot/site/trunk/deploy/assets-for-tests/frame.bxml Thu Aug  9 14:50:21 2012
@@ -90,7 +90,8 @@ limitations under the License.
                         // Alert.alert("resourcesBaseURL = " + resourcesBaseURL, frame);  // debug
 						// new, for remote loading of this file (included by another):
 						// note thate this version requires the variable resourcesBaseURL defined, at least an empty string ...
-                        palette = application.load(resourcesBaseURL + "palette.bxml");
+                        // palette = application.load(resourcesBaseURL + "palette.bxml");  // original version, but ok only for (local) filenames ...
+						palette = application.loadWindowFromURL(resourcesBaseURL + "palette.bxml", null);  // new version, using URL for the file to load ...
                         palette.setLocation(frame.getX() + frame.getWidth() + 20, frame.getY() + 20);
                     }