Re: Dynamic XUL
Gerald Bauer <[email protected]>
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Sam,
> Is there a way to generate XUL dynamically, like
> with a portlet but XUL
> instead of HTML.
Thanks your asking. Dynamic XUL creation is a great
topic. I also thought about this lately and haven't
settled on a final solution yet. I think the best way
is to try out different approaches and see what works
best.
I have put a luxor-elements package on my todo list.
However, it likely will take a while until I get to
it. You're more than welcome to work it out. The idea
is to create Java classes along the lines of the
Apache Jakarta ECS (Element Construction Set) project
online @ http://jakarta.apache.org/ecs
That is, you use a new set of Java classes to build
the XUL markup in memory as a JDOM tree that you later
can pass along to the Luxor engine.
In the future it might make sense instead of
duplicating the Java XUL classes to use the existing
Java XUL classes in the luxor.core package. For now,
however, I think it's easier to "duplicate" the effort
and possibly later merge the new methods and machinery
into the core.
> I've considered the following:
> 1) That Luxor does this, and I just don't know how,
> possible some magic
> with XulPortlets.
XulPortlets for now only support HTML because they
use the JEditorPane which is a HTML browser. I still
have to work out details for a XUL browser widget.
For a start you might wonna check out the Sahara
(luxor-sandbox) or Luxilla (luxor-browser) source
code.
> 2) That I may have to implement a custom resource
> loader, and reload
> resources before displaying them to refresh.
Again, see the Sahara or Luxilla source code for
inspiration.
> 3) Maybe the template functionality does this?
Maybe I have misunderstood your dynamic XUL
question. If you want to load XUL files remotely lets
say via HTTP GET instead of using the local chrome you
can use whatever server side scripting you like (e.g.
PHP, JSP, Velocity, and so on.) All you need to do is
create a new ChromeResourceLoader.
If you want to use templates for the local chrome,
you currently can use only XSL/T. In the upcoming Beta
9 you also can use Velocity and if I can work it out
Jelly.
> If anyone on the list will explain this to me, I
> would be happy to make
> some example code for others. I know the XUL
> rendering engine that
> Luxor uses is incredibly fast, so I know it's got to
> be possible.
Thanks for your kind words. Luxor currently isn't
optimized for speed so your speed largely depends on
your hardware.
Your contributions are more than welcome.
> I guess what I'm really asking is for some advice
> from someone who knows
> more than I about Luxor about the best way to get
> dynamically generated
> XUL. It's definately a worthwhile feature I would
> think as well, so
> it's probably there, but I'm just not seeing it :)
>
> Thanks in advance for your help,
I hope this answers some of your questions.
- Gerald
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge