[xwiki-devs] Load a GWT Application in a Xwiki page
Hi Everyone, Hi Marius, I was wondering when I embed a GWT application, the Mail sample, provided by GWT SDK into Xwiki page like this: <script type="text/javascript" language='javascript' src='js/xwiki/mail/mail.nocache.js'></script> why this GWT application would not appear in the Xwiki page, nothing happened? I have read the http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html <http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html>In "The Bootstrap Sequence" section, it has an example 7. myApp/myApp.nocache.js completes, and the compiled script ( <hashname>.cache.html) begins fetching in a hidden IFRAME (this is non-blocking). 8. <hashname>.cache.html completes. onModuleLoad() is not called yet, as we're still waiting on externalScriptOne.js to complete before the document is considered 'ready'. 9. externalScriptOne.js completes. The document is ready, so onModuleLoad() fires. Why in the Xwiki page, the onModuleLoad() seems does not work? PS: I am willing to contribute to Xwiki, what can I do for you guys? What I can think of is that I have poster presentation at the Graduate Research Forum on November 6, 2009, I will present my work on posters and I print and hand out some flyers about Xwiki to people to give Xwiki a advertise. What do you guys think of. If anything I could help please let me know. Thank you all. -- http://freeleons.spaces.live.com/ Life might lead me where I least expected.However,I have faith I'm exactly where I am meant to be.
Hi, If you are putting it in a syntax2.0 page Are you putting the script call inside of a html macro eg: {{html}} <script type="text/javascript" language='javascript' src='js/xwiki/mail/mail.nocache.js'></script> {{/html}} otherwise XWiki will sanitize it to prevent js injection attacks. When you are viewing the page where the script should be, click view->source see search the name of your script to make sure the reference is there and hasn't been changed. Also Y-Slow is an excellent firebug addon for figuring out what scripts have loaded. Make sure you can access the file at js/xwiki/mail/mail.nocache.js (from the web server) eg. www.yourwiki.com/xwiki/js/wiki/mail/mail.nocache.js XWiki has a nice system for adding java scripts: http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial Thanks Caleb James DeLisle Leon Wang wrote:
Hi Everyone, Hi Marius, I was wondering when I embed a GWT application, the Mail sample, provided by GWT SDK into Xwiki page like this:
<script type="text/javascript" language='javascript' src='js/xwiki/mail/mail.nocache.js'></script>
why this GWT application would not appear in the Xwiki page, nothing happened? I have read the http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html
<http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html>In "The Bootstrap Sequence" section, it has an example 7. myApp/myApp.nocache.js completes, and the compiled script ( <hashname>.cache.html) begins fetching in a hidden IFRAME (this is non-blocking). 8. <hashname>.cache.html completes. onModuleLoad() is not called yet, as we're still waiting on externalScriptOne.js to complete before the document is considered 'ready'. 9. externalScriptOne.js completes. The document is ready, so onModuleLoad() fires.
Why in the Xwiki page, the onModuleLoad() seems does not work?
PS: I am willing to contribute to Xwiki, what can I do for you guys? What I can think of is that I have poster presentation at the Graduate Research Forum on November 6, 2009, I will present my work on posters and I print and hand out some flyers about Xwiki to people to give Xwiki a advertise. What do you guys think of. If anything I could help please let me know.
Thank you all.
Hi Leon, Leon Wang wrote:
Hi Everyone, Hi Marius, I was wondering when I embed a GWT application, the Mail sample, provided by GWT SDK into Xwiki page like this:
<script type="text/javascript" language='javascript' src='js/xwiki/mail/mail.nocache.js'></script>
why this GWT application would not appear in the Xwiki page, nothing happened? I have read the http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html
<http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html>In "The Bootstrap Sequence" section, it has an example 7. myApp/myApp.nocache.js completes, and the compiled script ( <hashname>.cache.html) begins fetching in a hidden IFRAME (this is non-blocking). 8. <hashname>.cache.html completes. onModuleLoad() is not called yet, as we're still waiting on externalScriptOne.js to complete before the document is considered 'ready'. 9. externalScriptOne.js completes. The document is ready, so onModuleLoad() fires.
Why in the Xwiki page, the onModuleLoad() seems does not work?
Here's what I did: 1. Downloaded and unpacked GWT 1.7.0 2. Copied samples/Mail/war/mail directory from GWT to resources/js/xwiki directory in XWiki Enterprise 3. Edited a new page in Wiki mode and wrote this code: {{velocity}}$xwiki.jsfx.use("js/xwiki/mail/mail.nocache.js"){{/velocity}} 4. Saved and viewed the page As a result, part of the GWT mail sample application is visible at the bottom of the page. Unfortunately it was written to work with an empty HTML body: the UI is appended to the HTML body and window scrollbars are disabled.. You can't specify a container (e.g. a DIV with some id) where the UI should be hooked. In order for a GWT application to integrate well in any HTML page its author must let you specify where exactly to hook the UI. Usually the container is specified by its id. In you case, make sure the JavaScript file are loaded. To check this with Firebug you can go either to the HTML tab and inspect the head element or to the Script tab and look in the drop down list of loaded scripts. Hope this helps, Marius
PS: I am willing to contribute to Xwiki, what can I do for you guys? What I can think of is that I have poster presentation at the Graduate Research Forum on November 6, 2009, I will present my work on posters and I print and hand out some flyers about Xwiki to people to give Xwiki a advertise. What do you guys think of. If anything I could help please let me know.
Thank you all.
Hi Leon, On Oct 8, 2009, at 5:15 AM, Leon Wang wrote:
Hi Everyone, Hi Marius, I was wondering when I embed a GWT application, the Mail sample, provided by GWT SDK into Xwiki page like this:
[snip]
PS: I am willing to contribute to Xwiki, what can I do for you guys? What I can think of is that I have poster presentation at the Graduate Research Forum on November 6, 2009, I will present my work on posters and I print and hand out some flyers about Xwiki to people to give Xwiki a advertise. What do you guys think of. If anything I could help please let me know.
This is great thanks! We have a page listing ideas where people can help: http://dev.xwiki.org/xwiki/bin/view/Community/Contributing We are improving this page and the new version which isn't final yet but close is at: http://dev.xwiki.org/xwiki/bin/view/Drafts/XEContribute I suggest you look at this newest version and see if there's anything you'd be interested in. Thanks again -Vincent
participants (4)
-
Caleb James DeLisle -
Leon Wang -
Marius Dumitru Florea -
Vincent Massol