OK, I think I understand. Yes, you can write a Pivot app that will
dynamically load WTKX files. This would not be terribly difficult to
do. For example, if you had a URL instance, you could write:
WTKXSerializer wtkxSerializer = new WTKXSerializer();
Component component = (Component)wtkxSerializer.readObject
(url.openStream());
You would probably want to do this in a Task so it doesn't bog down
the UI thread while loading the content. You could then add the
component to a TabPane or wherever it made sense in your UI.
The WTKX files could even by dynamically generated on the server, if
that made sense for your application.
G
On Sep 25, 2009, at 9:52 AM, Sandro Martini wrote:
Hi Greg,
I'll try to clarify ... tell me for other infos.
I'd like to verify what I've seen yesterday, if it's possible to do
also with Pivot.
A Pivot Application that works like a Web Browser:
it has a fixed user interface (menu, toolbar, etc, like in standard
Web Browsers), and an area (could be the content inside a tab, with
the ability to open 1 .. n different Tabs) where to load dynamic
content.
The dynamic content comes from WTKX files, so i have to generate GUI
reading WTKX files as currently we do, Ok. These WTKX files could be
loaded from local (inside jars, or form a path, or from a URL, maybe
remote), and inside could contain a scripting part, again as
currently, Ok.
Note that in the case of WTKX loaded from remote (via HTTP/S) I should
verify if the new is not already in cache (reading timestamps from
HTTP header), and if newer load it otherwise reload the current
(already in memory) if possible.
What I don't know if it's possible to do in Pivot is that I should be
able to load other WTKX files (or reload the same if needed) depending
on user interactions, like in Web Browser for example clicking on a
link cause loading another page. And in this case all the user
interface (and related resources and scripts) should be automatically
destroyed, and the new constructed ... if possible reusing the cache.
And all without memory leak ...
In this way I'd have elements and behavior defined in WTKX files, and
using Pivot to handle all this.
Without recompiling code but only changing WTKX files and related
scripts.
Is it possible or something has to be modified / added ?
This flow is typical of applications generated from massive conversion
tools, and also generic frameworks that give expert users some
configuration utilities, so maybe it's outside Pivot domain, but I
think could be an interesting field to explore.
In any case, this could be a great Tutorial or Demo ...
Thanks,
Sandro