Hi Eduard,
On 06/28/11 05:45 PM, Eduard Moraru wrote:
After googling around on this topic, it seems that there is no clean way of doing this. The initial community-accepted way I managed to find was using javascript (Browser.execute(String)) to retrieve your data, store it in window.status and then, a BrowserStatusText listener would get that value from the status text. An example is here: http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/QueryDOMnodevalue.htm On the other hand, by checking the Eclipse/SWT API, it seems that Browser.evaluate(String) also got implemented along the way and, compared to execute(String), it actually returns the value of the executed JavaScript so you can use it directly. Documentation here: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fbrowser%2FBrowser.html So, to sum it up, use JS to document.getElementById(...) for each field in the form and use their names+values to build the request performed by your Finish button.
I'm afraid this is not possible. Imagine you do have completely unknown template to you and you need your new page wizard to support it. You don't know at all what id you should use and how many of them to get all the template forms values. For example let's have a template for book type with a fields: "Book name", "Author name" and "publication". Id's of those fields in my particular case are: Book store.BookClass_0_name, Book store.BookClass_0_author, Book store.BookClass_0_publication how the template wizard author should know this? So IMHO this way is not possible or at least not in this way...
P.S.: Can you post a screenshot of the wizard page containing the template's form?
It's small, so I hope nobody will be angry for attaching this directly. This is a second page of the wizard creating page for Book with name "Matka" (Mother in English), author's name is "Karel Capek" and publication date is set to "1929" -- but this is completely untrue, just my example, the first real publication was in 1938. BTW: Karel Capek is listed from the dynamic list of authors, which is a result of SPARQ query on top of Jena's DB. Code which shall be also open-source once we get green from the customer legal department... "FOUND BOOK NAME" and "FOUND AUTHOR NAME" together with "<set property operation aborted!>" are just debug messages from template .vm code where I'm using some of our semantics marcos (also to be open-sourced) -- this all is about semantic XWiki book store demo example... I'm creating pages for authors and books using author and book template. Once you add author page all the semantics props are set so you get it listed automatically inside the book template code in author name dynamic SPARQ list...
Now I just need to make sure page template creation is really working even from XEclipse (this thread is all about)...
Thanks! Karel
On Tue, Jun 28, 2011 at 2:56 PM, Karel Gardas<[email protected]>wrote:Hi Eduard, On 06/15/11 06:59 PM, Eduard Moraru wrote:Hi Karel, On 06/15/2011 01:54 PM, Karel Gardas wrote:Hello Sergiu, thanks a lot for you hint, when I renamed xwiki-enterprise-web-3.1-SNAPSHOT to simple xwiki, then after clicking on<save and view> button I got to normal login screen and when I loginthe page is really created.If you look at my first reply (with initial suggestions), you`ll see that I suggested that the actual Save action when completing the creation of a page should be performed by your wizard`s Finish button (sending a HTTP request with all the parameters set), otherwise you mix up the user by having 2 sets of buttons (XWiki`s and the wizard`s).I remember well your initial recommendation. Thanks for it! The way of using SWT browser directly was just rather a proof-of-concept of the idea of having browser embedded inside the wizard. Now, the situation is a little bit different. I do have: - small http client code which logs into xwiki server if needed and access the newly created page - strip all not needed information from the newly created page and leave just a form to fill the template data - show such page in the browser embedded inside the wizard window and allow user to fill the form. That's what working. Now I would like to press Finish button get the filled form from SWT browser (somehow!) and POST it to the xwiki server to save the page with entered data. The problem is that if I use getText() method on SWT browser it does not return page with filled data and I don't see any other API which should support this. So my question now is : do you have any idea how to get filled form page from the browser back into my code? Thanks a lot! Karel _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
<<attachment: wizard.png>>
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

