combine GWT application from several modules coming from JARs or OSGI bundles

137 views
Skip to first unread message

Alexey Skor

unread,
Jun 2, 2011, 5:00:32 PM6/2/11
to google-we...@googlegroups.com
I need a web UI with pages like "Info", "Support", etc. That's easy. 
In addition, I have some "plugins"  with their own "editors", which need to be shown in the same web UI. 
It's something similar to "Extensions" page shown in Google Chrome: every extension has an "Options" link, which can contain any editor the extension wants.

So, my main application does not know upfront how many "plugins" and editors it has. All it  knows is how to call the plugin's "showEditor()" method.
(this is how it's currently implemented in my Eclipse-based desktop app, which I'm trying to port to web)

I'm wondering if GWT is applicable for this kind of applications. So far looks that GWT applications are "monolithic" and all pages / panels need to be referenced in the common "gwt.xml" file, which means I can't configure the distributive to include only "plugin1 and plugin2" or only "plugin 2 and plugin 3" - I have to always include everything since it's referenced in the common xml file.

Any ideas how to use "modularity" with GWT so that UI panels can come from some "modules/plugins"?


Juan Pablo Gardella

unread,
Jun 2, 2011, 9:06:51 PM6/2/11
to google-we...@googlegroups.com
+1 to who know a manner to resolve this

2011/6/2 Alexey Skor <als...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/cVRCcmdib0s3dlFK.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

DaveC

unread,
Jun 3, 2011, 9:35:28 AM6/3/11
to Google Web Toolkit
If you mean dynamically loading code at runtime, I don't *think* this
is possible - we have a similar app (written originally against GWT
1.6) we have the notion of a plugin - it's a separate GWT module in
it's own project, but is pulled in at compile time... these modules
are pulled in using Gin/Guice so adding another plugin is as simple as
pulling it in using DI... I didn't write this bit but I think thats
how it works.

On Jun 3, 2:06 am, Juan Pablo Gardella <gardellajuanpa...@gmail.com>
wrote:

Alexey Skor

unread,
Jun 3, 2011, 6:45:39 PM6/3/11
to google-we...@googlegroups.com
The main application is compiled together with the plugins. No plugins are installed or updated AFTER the application is compiled. This should make the life easier.
When user clicks a certain link in the main UI, the "core" UI needs to show the editor (some panel) defined in the plugin. 
the "core" application does not have dependencies on the plugins code. plugins are listed in some XML file and the "core" can only invoke getPanel() or something similar on the plugin Class.

This is how it currently works for my Eclipse RCP application. I need to port the same to GWT, if that's possible

vitaly....@googlemail.com

unread,
Jul 10, 2011, 6:49:05 AM7/10/11
to Google Web Toolkit
I see a solution for this case. Main problem of the GWT today is
single compiled js-cache. This cache contains common block (vars +
functions) used by _each_ compiled GWT addon and addons specific
blocks.

Javascript allows to include specific parts of application due include
"part_x.js" mechanism.
If GWT compiler will build js-cache with next logic:

js-root
| vars (global)
| funcs (global)
|
|--- include "addon1.js"
| | vars (addon1)
| | funcs (addon1)
| |
|--- include "addon2.js"
| | vars (addon2)
| | funcs (addon2)
|

Then it will be possible to include/exclude specific addons on fly (by
dynamic includes substitution). Of course that's will work only before
load to client browser. May be will be necessary in some cases to add
small code for control of "onLoad" function.

Alexey Skor

unread,
Jul 12, 2011, 1:41:05 AM7/12/11
to google-we...@googlegroups.com
Vitaly, sorry - I don't really know how GWT works... Is your proposal addressed to GWT developers or users like me?

vitaly....@googlemail.com

unread,
Jul 12, 2011, 12:53:02 PM7/12/11
to Google Web Toolkit


Alexey, I develop application on Vaadin (vaadin.com). It uses GWT for
rendering and I have same problems like you. A modular application
uses plugins or bundles (in term of OGSi in dynamic way. It means If
you use plugin then necessary resourses avilavble only for usage time
(no any static injections in main application). If you try to attach
GWT-widget implemented by plugin to main application then you have two
choises. First one is to compile plugin-widget in static way and store
compiled java-script together with main module (current state of GWT).
In this case will be impossible to add plugins dynamically. Second one
is to add support into GWT compiller like I decribed already (not
implemented by GWT yet). Then you can use precomilled GWT widgets like
OSGi-bundles.
Now I try to add support of this logic in my project and if it will be
successed then I share my results. May be they will be accepted by
google.
Reply all
Reply to author
Forward
0 new messages