Hi,
Yesterday, I authored a couple of XBL components just to test how they work. I managed to run my examples and to do the binding by including XBL inline into my XForms document. However, I would like to define XBL components in external files. How can I do that (can you give me a REALLY simple example)? I tried to do the binding in several ways (using <?xbl?> processing instruction, CSS, JavaScript) without success. Regards -Markku Ps. There is a devoted section for "Simple Example" on this Web page but it is still in progress. Maybe the example could be added to that section as well? http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Simple-example -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Markku,
I imagine you should be able to take the XBL components exactly as they are, with each one in a form that is something like: <xbl xmlns:xbl="http://www.w3.org/ns/xbl"> <xbl:binding id="id1" element="element1"> ... </xbl:binding> </xbl:xbl> and place each of them in external files. Then, just XInclude each of the XBL components on the XHTML page you want them to be used, using the following markup: <xi:include xxi:omit-xml-base="true" href="some-file.xbl"/> Does this work for you? ---Philip
|
Thanks for the advise, Philip. I tried using XInclude the way you
suggested but it did not work. Faced two problem with it: 1) Relative URLs (XML base) did not work (Orbeon tried to locate the XBL file from the Java folder) 2) After putting the XBL file to the Java folder I got this error message even though I have declared all XML Namespaces used in my XBL file: Fatal error: The prefix "xbl" for element "xbl:xbl" is not bound. Could you send me a working example, which uses an external XBL file, in order to test it in XForms sandbox. Regards -Markku On 15.7.2009, at 21.34, Philip.Cantin wrote: > > Markku, > > I imagine you should be able to take the XBL components exactly as > they are, > with each one in a form that is something like: > > <xbl xmlns:xbl="http://www.w3.org/ns/xbl"> > <xbl:binding id="id1" element="element1"> > ... > </xbl:binding> > </xbl:xbl> > > > and place each of them in external files. Then, just XInclude each > of the > XBL components on the XHTML page you want them to be used, using the > following markup: > > <xi:include xxi:omit-xml-base="true" href="some-file.xbl"/> > > > Does this work for you? > > > > ---Philip > > > Markku Laine wrote: >> >> Hi, >> >> >> Yesterday, I authored a couple of XBL components just to test how >> they >> work. I managed to run my examples and to do the binding by including >> XBL inline into my XForms document. However, I would like to define >> XBL components in external files. How can I do that (can you give >> me a >> REALLY simple example)? I tried to do the binding in several ways >> (using <?xbl?> processing instruction, CSS, JavaScript) without >> success. >> >> Regards >> >> >> -Markku >> >> Ps. There is a devoted section for "Simple Example" on this Web page >> but it is still in progress. Maybe the example could be added to that >> section as well? >> http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Simple-example >> >> >> -- >> You receive this message as a subscriber of the [hidden email] >> mailing >> list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> > > -- > View this message in context: http://www.nabble.com/Authoring-XBL-Components-tp24493547p24503468.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
In reply to this post by Philip.Cantin
I am using Orbeon Forms version "Orbeon Forms dev-
post-3.7.1.200907090746" for testing XBL components. Regards -Markku On 15.7.2009, at 21.34, Philip.Cantin wrote: > > Markku, > > I imagine you should be able to take the XBL components exactly as > they are, > with each one in a form that is something like: > > <xbl xmlns:xbl="http://www.w3.org/ns/xbl"> > <xbl:binding id="id1" element="element1"> > ... > </xbl:binding> > </xbl:xbl> > > > and place each of them in external files. Then, just XInclude each > of the > XBL components on the XHTML page you want them to be used, using the > following markup: > > <xi:include xxi:omit-xml-base="true" href="some-file.xbl"/> > > > Does this work for you? > > > > ---Philip > > > Markku Laine wrote: >> >> Hi, >> >> >> Yesterday, I authored a couple of XBL components just to test how >> they >> work. I managed to run my examples and to do the binding by including >> XBL inline into my XForms document. However, I would like to define >> XBL components in external files. How can I do that (can you give >> me a >> REALLY simple example)? I tried to do the binding in several ways >> (using <?xbl?> processing instruction, CSS, JavaScript) without >> success. >> >> Regards >> >> >> -Markku >> >> Ps. There is a devoted section for "Simple Example" on this Web page >> but it is still in progress. Maybe the example could be added to that >> section as well? >> http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Simple-example >> >> >> -- >> You receive this message as a subscriber of the [hidden email] >> mailing >> list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> > > -- > View this message in context: http://www.nabble.com/Authoring-XBL-Components-tp24493547p24503468.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
In reply to this post by Markku Laine
Markku,
No problem; I've attached a ZIP file to my reply below, which contains a folder of test files. Just place the folder in your orbeon/WEB-INF/resources/apps folder and run it. What is supposed to happen is when you click the smiley face image, the value of the 'text' element in the 'instance1' instance will be set to "hello." A couple of things to keep in mind which are the key to getting external XBL files to work within Orbeon: 1) There must be an instance present within an <xf:instance> tag in the main XHTML form. 2) When defining and referencing external XBL components, use the "fr" (Form Runner) namespace prefix and be sure to have that namespace defined within your HTML tag. If you have any other questions about the test files, I would be happy to elaborate. It worked fine on my 7-4-2009 nightly build. ---Philip xbl-test.zip
|
Philip,
I am not exactly sure where to put the content (the xbl-test folder) of the unzipped package. First of all, I do not have such a folder (orbeon/WEB-INF/resources/apps) in my OF file structure but I do have the orbeon/WEB-INF/resources folder. Should I create the apps folder into the folder and copy the content of the unzipped package there? Secondly, how to access your XBL test application, what URL should I use? I have only used Orbeon Forms as an XForms engine so I do not have experience on those page-flow.xml files etc. I managed to run my own XBL Web application (enclosed) but the application still tries to locate the XBL file from the /Applications/ eclipse/Eclipse.app/Contents/MacOS/ folder instead from the same folder where the JSP/XHTML file is located. I have placed the files (animals.jsp and animals.xbl) into the orbeon/xforms-jsp/guess-the- number/ folder and the application works fine if I will put the animals.xbl file under the "........./MacOS/" folder. Is there a quick way to fix my test application i.e. how to reference to the animals.xbl file correctly? Thanks for your help! -Markku Ps. Use the following URL in order to run the application: http://localhost:8080/orbeon/xforms-jsp/guess-the-number/animals.jsp Pps. This is the error message I am getting when I try to run my application: "/Applications/eclipse/Eclipse.app/Contents/MacOS/animals.xbl (No such file or directory)" After placing the file there it works. On 16.7.2009, at 18.23, Philip.Cantin wrote: > > Markku, > No problem; I've attached a ZIP file to my reply below, which > contains a > folder of test files. Just place the folder in your > orbeon/WEB-INF/resources/apps folder and run it. > > What is supposed to happen is when you click the smiley face image, > the > value of the 'text' element in the 'instance1' instance will be set to > "hello." > > A couple of things to keep in mind which are the key to getting > external XBL > files to work within Orbeon: > > 1) There must be an instance present within an <xf:instance> tag in > the main > XHTML form. > 2) When defining and referencing external XBL components, use the > "fr" (Form > Runner) namespace prefix and be sure to have that namespace defined > within > your HTML tag. > > > If you have any other questions about the test files, I would be > happy to > elaborate. It worked fine on my 7-4-2009 nightly build. > > > ---Philip > > > http://www.nabble.com/file/p24518544/xbl-test.zip xbl-test.zip > > > > > > > > Markku Laine wrote: >> >> Thanks for the advise, Philip. I tried using XInclude the way you >> suggested but it did not work. Faced two problem with it: >> 1) Relative URLs (XML base) did not work (Orbeon tried to locate the >> XBL file from the Java folder) >> 2) After putting the XBL file to the Java folder I got this error >> message even though I have declared all XML Namespaces used in my XBL >> file: >> Fatal error: The prefix "xbl" for element "xbl:xbl" is not bound. >> >> Could you send me a working example, which uses an external XBL file, >> in order to test it in XForms sandbox. >> >> Regards >> >> >> -Markku >> >> On 15.7.2009, at 21.34, Philip.Cantin wrote: >> >>> >>> Markku, >>> >>> I imagine you should be able to take the XBL components exactly as >>> they are, >>> with each one in a form that is something like: >>> >>> <xbl xmlns:xbl="http://www.w3.org/ns/xbl"> >>> <xbl:binding id="id1" element="element1"> >>> ... >>> </xbl:binding> >>> </xbl:xbl> >>> >>> >>> and place each of them in external files. Then, just XInclude each >>> of the >>> XBL components on the XHTML page you want them to be used, using the >>> following markup: >>> >>> <xi:include xxi:omit-xml-base="true" href="some-file.xbl"/> >>> >>> >>> Does this work for you? >>> >>> >>> >>> ---Philip >>> >>> >>> Markku Laine wrote: >>>> >>>> Hi, >>>> >>>> >>>> Yesterday, I authored a couple of XBL components just to test how >>>> they >>>> work. I managed to run my examples and to do the binding by >>>> including >>>> XBL inline into my XForms document. However, I would like to define >>>> XBL components in external files. How can I do that (can you give >>>> me a >>>> REALLY simple example)? I tried to do the binding in several ways >>>> (using <?xbl?> processing instruction, CSS, JavaScript) without >>>> success. >>>> >>>> Regards >>>> >>>> >>>> -Markku >>>> >>>> Ps. There is a devoted section for "Simple Example" on this Web >>>> page >>>> but it is still in progress. Maybe the example could be added to >>>> that >>>> section as well? >>>> http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Simple-example >>>> >>>> >>>> -- >>>> You receive this message as a subscriber of the [hidden email] >>>> mailing >>>> list. >>>> To unsubscribe: mailto:[hidden email] >>>> For general help: mailto:[hidden email]?subject=help >>>> OW2 mailing lists service home page: http://www.ow2.org/wws >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Authoring-XBL-Components-tp24493547p24503468.html >>> Sent from the ObjectWeb OPS - Users mailing list archive at >>> Nabble.com. >>> >>> >>> -- >>> You receive this message as a subscriber of the [hidden email] >>> mailing list. >>> To unsubscribe: mailto:[hidden email] >>> For general help: mailto:[hidden email]?subject=help >>> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> >> >> -- >> You receive this message as a subscriber of the [hidden email] >> mailing >> list. >> To unsubscribe: mailto:[hidden email] >> For general help: mailto:[hidden email]?subject=help >> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> > > -- > View this message in context: http://www.nabble.com/Authoring-XBL-Components-tp24493547p24518544.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Markku,
Ahh, I should have asked before how you were running Orbeon. It sounds like you're using it as an Eclipse plugin, whereas I'm using the full version of Orbeon and am running it through Tomcat. I don't know how Orbeon works through Eclipse, but I imagine there must be a way to change path configurations within Eclipse. Can you tell me a bit more about where you downloaded the plugin, and what version of Eclipse you're using? I can try and emulate your issue this weekend when I get some time. Also, if there's anyone who's familiar with running Orbeon through Eclipse feel free to step into this conversation. :) ---Philip
|
In reply to this post by Philip.Cantin
Hi Philip, all, I am trying to create my own component w/o using xi:include, but rather by putting them in WEB-INF/resources/xbl/appname/componentname/componentname.xbl, as specified by the Orbeon docs. If I place your smiley demo there and remove the xi:include from xhtml, the component s only found if I declare it at being in the fr namespace (http://orbeon.org/oxf/xml/form-runner). If you change it to any other namespace (in both XBL and XHTML files) and it will not be resolved. Furthermore, it must be in .../resources/xbl/orbeon/smiley/ ... can't change the "orbeon" part of the URL. Is the "by design", a bug, or PEBMAC? Where is this binding/config defined? I am using dev build orbeon-2010-23-02. Thanks in advance, -Gino
Gino Miceli
Forest Information Systems Specialist Food and Agriculture Organization of the United Nations FAO-Finland Cooperation Programme Sustainable Forest Management in a Changing Climate Forest Management Division, Rm. D-406 Viale delle Terme di Caracalla, s.n.c. 00153 Rome, Italy http://www.fao.org/forestry |
I have the same problems reported by geno-m.
|
I tweeted about this and got a reply back from Orbeon:
You must also have mapping property: http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-xforms#TOC-Automatic-inclusion-of-XBL-bindings This fixed the issue for me. |
Administrator
|
Markku, Philip, Gino, & all,
Here is the source of a very, very simple XBL control: https://gist.github.com/avernet/45b29c436d23c3fb8114. You would put the country-selector.xbl file in your resources folder (e.g. WEB-INF/resources) inside xbl/example/country-selector. If you look at the source of the control, you'll notice it is in the http://www.example.com/ namespace, so since I suggested you put it in the "example" directory under xbl, you need to add a property to map http://www.example.com/ to "example" (this is the first property below). You also need to tell Form Builder to put that control in its sidebar, which you do with the second property below. And you would place those 2 properties in your properties-local.xml. <property as="xs:string" name="oxf.xforms.xbl.mapping.example" value="http://www.example.com/"/> <property as="xs:string" name="oxf.fb.toolbox.group.example.*.*.*" value="oxf:/xbl/example/country-selector/country-selector.xbl"/> That's it! I hope this helps. Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |