Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » SWT browser with XForms support(SWT browser can't handle xhtml (Xforms+HTML) - documents)
SWT browser with XForms support [message #528538] Tue, 20 April 2010 20:51 Go to next message
Tobias  is currently offline Tobias Friend
Messages: 4
Registered: April 2010
Junior Member
Hello everyone,

i have a big problem with the integration of XForms in a SWT Browser.


This is the situation:
I'm working on an Eclipse RCP application (Windows 7) with different views.
There is one view, in which a xhtml-document (HTML+Xforms) must be shown.
Building a view with a SWT Browser is not the problem, but the integration of Xforms.


This is what I have tried so far:

-used the Mozilla SWT Browser Plugin (www.eclipsemozilla.org) and xulrunner (org.mozilla.xulrunner.win32.win32.x86_1.8.1)
->didn't work (HTML yes, XForms no)

-tried to 'include' my Firefox - Plugins (with Xforms) by defining a environment variable MOZ_PLUGIN_PATH (got it from http://www.eclipse.org/swt/faq.php)
->didn't work (maybe I did something wrong)

-tried to solve this problem with the help of some XForms engines:

- Apogée ( http://apogee.nuxeo.org/sections/documentation/xforms-develo per-guide)
- Chiba (http://chiba.sourceforge.net/)
-betterForm (http://www.betterform.de/)
-Orbeon Forms (http://www.orbeon.com/)

Apogée is the wrong 'tool' for this problem (IMHO).
The other three 'candidates' are server-side wep-application(running in my tomcat 6.)

The xhtml-document is shown correct in an external standalone Firefox (of course with the Xforms Plugin).
But the server-side web-applications can't parse this document. ->Errors !

It seems that there is something wrong with the xhtml-document.
But I'm not familiar with Xforms (the xhtml-document was not written by me).
So, editing the xhtml-document is out of scope (the document is kind of complex).

Is there a solution to solve this problem ?


Thanks for any help
Re: SWT browser with XForms support [message #528713 is a reply to message #528538] Wed, 21 April 2010 14:47 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

Firstly, you don't need an external plug-in to use a mozilla-based Browser
on non-*ix platforms, see http://www.eclipse.org/swt/faq.php#howusemozilla
and http://www.eclipse.org/swt/faq.php#specifyxulrunner .

One way to verify whether your document's content is valid is to load it in
a stand-alone browser like Firefox. If it loads fine there then it should
load in the Browser control as well.

How are you feeding your xhtml to the Browser, by setText() or setUrl()? If
it's by setText() then you're seeing
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308398 , in which case you'll
need to try writing your content out to a local file and then pointing
setUrl() at it. Alternatively, if you're already using setUrl() and it's
failing, is a special plug-in required for viewing documents with this type?
If so then you can point the Browser at the directory with the native
browser plug-in as described in
http://www.eclipse.org/swt/faq.php#mozillaplugins .

If these suggestions don't help then please follow up with some more info.

Grant


"Tobias" <tt_dipl@hightower-darter.de> wrote in message
news:hql44r$ltj$1@build.eclipse.org...
> Hello everyone,
>
> i have a big problem with the integration of XForms in a SWT Browser.
>
>
> This is the situation:
> I'm working on an Eclipse RCP application (Windows 7) with different
views.
> There is one view, in which a xhtml-document (HTML+Xforms) must be shown.
> Building a view with a SWT Browser is not the problem, but the integration
of Xforms.
>
>
> This is what I have tried so far:
>
> -used the Mozilla SWT Browser Plugin (www.eclipsemozilla.org) and
xulrunner (org.mozilla.xulrunner.win32.win32.x86_1.8.1)
> ->didn't work (HTML yes, XForms no)
>
> -tried to 'include' my Firefox - Plugins (with Xforms) by defining a
environment variable MOZ_PLUGIN_PATH (got it from
http://www.eclipse.org/swt/faq.php)
> ->didn't work (maybe I did something wrong)
>
> -tried to solve this problem with the help of some XForms engines:
>
> - Apog
Re: SWT browser with XForms support [message #528952 is a reply to message #528538] Thu, 22 April 2010 13:46 Go to previous messageGo to next message
Tobias  is currently offline Tobias Friend
Messages: 4
Registered: April 2010
Junior Member

Thank's for your reply.

I' ve checked again the possibility to solve the problem by using the environment variable "MOZ_PLUGIN_PATH".
I think that I've figured out something important:

Firefox extensions (like Xforms) are more different to Firefox Plugins (like a flash-Plugin) than I thought.

Moving the plugins to a new directory and pointing the "MOZ_PLUGIN_PATH" variable to that directory works fine.
I' ve tested it with the flash-Plugin (moved the content from "C:\windows\system32\Macromed\Flash" to my new plugin directory). The SWT-Browser can play flash clips (after setting the MOZ_PLUGIN_PATH variable)

Moving the extensions in the same way, don' t work. They are not found by the browser (stand-alone Firefox and SWT Browser). By the way: I'm using Firefox 3.0.19. There is no Xforms support for Firefox 3.5 and 3.6.
The extensions are stored in:
" C:\User\Username\AppData\Roaming\Mozilla\Firefox\Profiles\xx xxxx.default\extensions\ "

Hm- meanwhile this problem sounds like a problem for a mozilla forum.


Anyway, here is my little program, where I try to open a Xforms - document.
Both (the java-program and xhtml-document) are kept very simple.

java-program:


import java.io.File;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class mozilla {
	public static void main(String[] args) {
		Display display=new Display();
		Shell shell = new Shell(display);
		shell.setText("Hello Mozilla");
		shell.setBounds(100,100,800,800);
		shell.setLayout(new FillLayout());
		File xulpath=new File("D:\\xulrunner");
		//must be set to avoid exception: "[Could not detect registered XULRunner to use]"
		System.setProperty("org.eclipse.swt.browser.XULRunnerPath", xulpath.getAbsolutePath());
		Browser browser=new Browser(shell,SWT.MOZILLA);
		browser.setUrl("file:///d:test.xhtml");
		shell.open();
		while (!shell.isDisposed()){
			if(!display.readAndDispatch()) display.sleep();
		}
		display.dispose();
	}
}



test.xhtml


<xhtml:html xmlns="http://www.w3.org/2002/xforms" xmlns:xf="http://www.w3.org/2002/xforms"
 xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <model>
        <instance>
            <document>
                <title>the default title</title>
            </document>
        </instance>
    </model>
    <xhtml:body style="layout: grid; layout-padding: 10; layout-spacing: 10; layout-cols: 3">
        <label>Example 1</label>
        <input ref="/document/title" style="border:true; align: fill; hgrab: true">
            <label>The title</label>
            <hint>The default value is:</hint>
        </input>
        <trigger id="testButton" style="form-toolkit-style: false;">
            <label>Click here</label>
        </trigger>
    </xhtml:body>
</xhtml:html>



The result should be a label ("Example 1") and a button ("Click here").
But without Xforms support, the SWT-Browser only displays some text ("the default title,Example 1,The title,The default value is: Click here") - no button.
Re: SWT browser with XForms support [message #529594 is a reply to message #528952] Mon, 26 April 2010 13:45 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
If a mozilla extension (not a plug-in) is needed to show this content then
there isn't currently Browser support for this, see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=181008 . Depending on how the
extension is written, it may or may not be usable in xulrunner, since many
extensions that target firefox will reference xpcom types from firefox that
don't exist in xulrunner. Regardless, you can CC yourself to this report to
be notified of future progress on it.

Grant


"Tobias" <tt_dipl@hightower-darter.de> wrote in message
news:hqpjvh$uq9$1@build.eclipse.org...
>
> Thank's for your reply.
>
> I' ve checked again the possibility to solve the problem by using the
environment variable "MOZ_PLUGIN_PATH".
> I think that I've figured out something important:
>
> Firefox extensions (like Xforms) are more different to Firefox Plugins
(like a flash-Plugin) than I thought.
>
> Moving the plugins to a new directory and pointing the "MOZ_PLUGIN_PATH"
variable to that directory works fine.
> I' ve tested it with the flash-Plugin (moved the content from
"C:\windows\system32\Macromed\Flash" to my new plugin directory). The
SWT-Browser can play flash clips (after setting the MOZ_PLUGIN_PATH
variable)
>
> Moving the extensions in the same way, don' t work. They are not found by
the browser (stand-alone Firefox and SWT Browser). By the way: I'm using
Firefox 3.0.19. There is no Xforms support for Firefox 3.5 and 3.6.
> The extensions are stored in:
> " C:\User\Username\AppData\Roaming\Mozilla\Firefox\Profiles\xx
xxxx.default\extensions\ "
>
> Hm- meanwhile this problem sounds like a problem for a mozilla forum.
>
>
> Anyway, here is my little program, where I try to open a Xforms -
document.
> Both (the java-program and xhtml-document) are kept very simple.
>
> java-program:
>
>
>
> import java.io.File;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.browser.Browser;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class mozilla {
> public static void main(String[] args) {
> Display display=new Display();
> Shell shell = new Shell(display);
> shell.setText("Hello Mozilla");
> shell.setBounds(100,100,800,800);
> shell.setLayout(new FillLayout());
> File xulpath=new File("D:\\xulrunner");
> //must be set to avoid exception: "[Could not detect registered XULRunner
to use]"
> System.setProperty("org.eclipse.swt.browser.XULRunnerPath",
xulpath.getAbsolutePath());
> Browser browser=new Browser(shell,SWT.MOZILLA);
> browser.setUrl("file:///d:test.xhtml");
> shell.open();
> while (!shell.isDisposed()){
> if(!display.readAndDispatch()) display.sleep();
> }
> display.dispose();
> }
> }
>
>
>
> test.xhtml
>
>
>
> <xhtml:html xmlns="http://www.w3.org/2002/xforms"
xmlns:xf="http://www.w3.org/2002/xforms"
> xmlns:xhtml="http://www.w3.org/1999/xhtml">
> <model>
> <instance>
> <document>
> <title>the default title</title>
> </document>
> </instance>
> </model>
> <xhtml:body style="layout: grid; layout-padding: 10; layout-spacing:
10; layout-cols: 3">
> <label>Example 1</label>
> <input ref="/document/title" style="border:true; align: fill;
hgrab: true">
> <label>The title</label>
> <hint>The default value is:</hint>
> </input>
> <trigger id="testButton" style="form-toolkit-style: false;">
> <label>Click here</label>
> </trigger>
> </xhtml:body>
> </xhtml:html>
>
>
>
> The result should be a label ("Example 1") and a button ("Click here").
> But without Xforms support, the SWT-Browser only displays some text ("the
default title,Example 1,The title,The default value is: Click here") - no
button.
>
Re: SWT browser with XForms support [message #530751 is a reply to message #528538] Fri, 30 April 2010 17:15 Go to previous messageGo to next message
Tobias  is currently offline Tobias Friend
Messages: 4
Registered: April 2010
Junior Member
Thanks for your help.

Now I'm sure, that I have to use an Xforms engine to solve this problem.
I don't see any other possibilities.


Tobias
Re: SWT browser with XForms support [message #530771 is a reply to message #530751] Fri, 30 April 2010 19:22 Go to previous messageGo to next message
Alain Couthures is currently offline Alain CouthuresFriend
Messages: 3
Registered: July 2009
Junior Member
Did you try to use XSLTForms which is a pure client-side XForms implementation based on XSLT+AJAX and which works fine with every recent browsers ?

-Alain
Re: SWT browser with XForms support [message #531117 is a reply to message #530771] Mon, 03 May 2010 18:41 Go to previous message
Tobias  is currently offline Tobias Friend
Messages: 4
Registered: April 2010
Junior Member
Thanks for this hint.
I will try it , and post the results.

Tobias
Previous Topic:PopUp sub-category
Next Topic:silent failure in revert configuration - does an rcp product need the metadata repo for its initial
Goto Forum:
  


Current Time: Fri Apr 26 21:00:05 GMT 2024

Powered by FUDForum. Page generated in 0.03598 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top