Hi All!

There are some thoughts on the future development of VPE. Would be great to hear any feedback/comments.

The idea is to add to VPE the must have features, like the support of JavaScript and HTML5 and the support of 64-bit JVM on all OS. And get rid of all less important features and the features that do not work very well (i.e. editing - that is why we call it 'viewer').

Why VPE needs significant changes/rewriting?

Because of three things (at least):
How does VPE work now?

VPE has a visual DOM builder and a lot of templates. For every XML/HTML file opened in an editor, WTP automatically creates a W3C DOM tree (source tree). Using templates, the visual DOM builder converts all nodes from the source tree directly into XULRunner DOM tree (visual tree).

So, what is wrong here:
VPV architecrture

My vision is that the main process of the source to visual conversion should looks like this:
W3C source DOM--(by W3C DOM based templates)-->W3C visual DOM->HTTP server->SWT browser widget

The explanation follows.

Why W3C visual DOM by W3C DOM based templates?

Under W3C DOM based templates I mean that these templates will use org.w3c.dom.* interfaces to produce visual DOM. To create W3C templates we should rewrite all our existing VPE XPCOM based templates (~150 Java classes) and many core classes. It is a lot of work, but as a bonus I expect them to simplify significantly.

There are two not so good alternatives:
Why HTTP server?

It is a simple way to know what resources our browser needs and send them on request.

There are two not so good alternatives too:

We are going to open a TCP port, what about security?

No problem here. Java allows to restrict connections to localhost only:
new ServerSocket(8383, 0, InetAddress.getByName("localhost"))
At least the standard Windows firewall does not worry and does not show the “Security alert” pop-up.

How hard to write our own HTTP server? Is not it easier to reuse something like Jetty?

We do not need a complicated server. Just a server which supports GET requests would be enough. Writing of a custom server is the simplest task ever :) Here is an example of a 150 lines HTTP server with support of GET requests, MIME types and response codes.

--
Best Regards,
Yahor Radtsevich