One thing I haven't figured out how to do yet, after reading through
just about all of the Orbeon documentation, is how to load a particular instance document (out of many) into one XForm. For example, let's say I have a customer form that lists hyperlinks to outstanding customer orders. I'd like to be able to click on a customer order and go to an XForm to edit it. How can I formulate a hyperlink to load a particular order with an XForm? Thanks, -Jim -- 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 |
Administrator
|
Hi Jim,
On Mon, May 5, 2008 at 4:26 PM, Jim Logan <[hidden email]> wrote: > For example, let's say I have a customer form that lists hyperlinks to > outstanding customer orders. I'd like to be able to click on a customer > order and go to an XForm to edit it. How can I formulate a hyperlink to load > a particular order with an XForm? Let's say the path of the page to view an order is /order/view. You first map that this path to the XHTML+XForms in the page flow (<page path-info="/order/view" view="view-order.xhtml"/>). Then let's say you pass the order ID on the URL with ?order-id=123. In your XForms, on xforms-model-construct-done, you load the instance for that ID. You can access the ID in XPath with xxforms:get-request-parameter('order-id'). You will typically load the order document with a submission that calls an XPL, or a call to some other service. Does this help? Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- 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 |
Alessandro Vernet wrote:
> Let's say the path of the page to view an order is /order/view. You > first map that this path to the XHTML+XForms in the page flow (<page > path-info="/order/view" view="view-order.xhtml"/>). Then let's say you > pass the order ID on the URL with ?order-id=123. In your XForms, on > xforms-model-construct-done, you load the instance for that ID. You > can access the ID in XPath with > xxforms:get-request-parameter('order-id'). You will typically load the > order document with a submission that calls an XPL, or a call to some > other service. Does this help? > -Jim -- 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 Alessandro Vernet
My progress was also stopped by this at one time. The problem is that you cannot change the "action" attribute of a submission -- at least, I don't know how to do this in a dynamic way. (otherwise, you could change the action to the url of your data, then submit / get it .) So, you need a service you can rely on and pass a parameter to it. (and Alex can always answer these questions more quickly and thoroughly than I.) Cheers, Hank On May 5, 2008, at 5:15 PM, Alessandro Vernet wrote: > Hi Jim, > > On Mon, May 5, 2008 at 4:26 PM, Jim Logan <[hidden email]> > wrote: >> For example, let's say I have a customer form that lists >> hyperlinks to >> outstanding customer orders. I'd like to be able to click on a >> customer >> order and go to an XForm to edit it. How can I formulate a >> hyperlink to load >> a particular order with an XForm? > > Let's say the path of the page to view an order is /order/view. You > first map that this path to the XHTML+XForms in the page flow (<page > path-info="/order/view" view="view-order.xhtml"/>). Then let's say you > pass the order ID on the URL with ?order-id=123. In your XForms, on > xforms-model-construct-done, you load the instance for that ID. You > can access the ID in XPath with > xxforms:get-request-parameter('order-id'). You will typically load the > order document with a submission that calls an XPL, or a call to some > other service. Does this help? > > Alex > -- > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise > Orbeon's Blog: http://www.orbeon.com/blog/ > Personal Blog: http://avernet.blogspot.com/ > Twitter - http://twitter.com/avernet > > -- > 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 NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- 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 |
Administrator
|
Hi Hank,
On Mon, May 5, 2008 at 5:47 PM, Hank Ratzesberger <[hidden email]> wrote: > The problem is that you cannot change the "action" attribute > of a submission -- at least, I don't know how to do this > in a dynamic way. (otherwise, you could change the action to > the url of your data, then submit / get it .) Would AVTs work in this case? I.e. action="{xpath-expression}". > (and Alex can always answer these questions more quickly > and thoroughly than I.) (To be fair, you are doing hell of a job here answering questions here in the list! Thank you very much for your help!) Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- 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 |
Trying to do my part. I would bring this issue up with the xforms working group. I think it raises security issues if it is "easy" to change an action. Of course, it's not really a problem for your server-side code, and javascripted code is already vulnerable, so, yes, I suppose this might be a case where AVT would work, but I don't recall at what stage they are evaluated. So, perhaps yes, AVT for xform elements, evaluated when the element is processed. Cheers, Hank > Hi Hank, > > On Mon, May 5, 2008 at 5:47 PM, Hank Ratzesberger > <[hidden email]> wrote: >> The problem is that you cannot change the "action" attribute >> of a submission -- at least, I don't know how to do this >> in a dynamic way. (otherwise, you could change the action to >> the url of your data, then submit / get it .) > > Would AVTs work in this case? I.e. action="{xpath-expression}". > >> (and Alex can always answer these questions more quickly >> and thoroughly than I.) > > (To be fair, you are doing hell of a job here answering questions here > in the list! Thank you very much for your help!) > > Alex > -- > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise > Orbeon's Blog: http://www.orbeon.com/blog/ > Personal Blog: http://avernet.blogspot.com/ > Twitter - http://twitter.com/avernet > -- 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 |
Administrator
|
On Mon, May 5, 2008 at 8:55 PM, Hank Ratzesberger
<[hidden email]> wrote: > Of course, it's not really a problem for your server-side > code, and javascripted code is already vulnerable, > so, yes, I suppose this might be a case where AVT > would work, but I don't recall at what stage they > are evaluated. So, perhaps yes, AVT for xform > elements, evaluated when the element is processed. Yes, exactly; in the case of the submission, the AVTs in the action attribute will be evaluated when the submission runs. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- 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 Alessandro Vernet
Alessandro Vernet wrote:
> Hi Jim, > > On Mon, May 5, 2008 at 4:26 PM, Jim Logan <[hidden email]> wrote: > >> For example, let's say I have a customer form that lists hyperlinks to >> outstanding customer orders. I'd like to be able to click on a customer >> order and go to an XForm to edit it. How can I formulate a hyperlink to load >> a particular order with an XForm? >> > > Let's say the path of the page to view an order is /order/view. You > first map that this path to the XHTML+XForms in the page flow (<page > path-info="/order/view" view="view-order.xhtml"/>). Then let's say you > pass the order ID on the URL with ?order-id=123. In your XForms, on > xforms-model-construct-done, you load the instance for that ID. You > can access the ID in XPath with > xxforms:get-request-parameter('order-id'). You will typically load the > order document with a submission that calls an XPL, or a call to some > other service. Does this help? > > Alex > Is it possible to use a RESTful URL that has the instance ID embedded in it, like "http://modeldriven.org/orders/order/1234"? I don't see a way to get at the original URL. Thanks, -Jim -- 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 |
On May 8, 2008, at 8:49 AM, Jim Logan wrote: > Alessandro Vernet wrote: >> Hi Jim, >> >> On Mon, May 5, 2008 at 4:26 PM, Jim Logan <[hidden email]> >> wrote: >> >>> For example, let's say I have a customer form that lists >>> hyperlinks to >>> outstanding customer orders. I'd like to be able to click on a >>> customer >>> order and go to an XForm to edit it. How can I formulate a >>> hyperlink to load >>> a particular order with an XForm? >>> >> >> Let's say the path of the page to view an order is /order/view. You >> first map that this path to the XHTML+XForms in the page flow (<page >> path-info="/order/view" view="view-order.xhtml"/>). Then let's say >> you >> pass the order ID on the URL with ?order-id=123. In your XForms, on >> xforms-model-construct-done, you load the instance for that ID. You >> can access the ID in XPath with >> xxforms:get-request-parameter('order-id'). You will typically load >> the >> order document with a submission that calls an XPL, or a call to some >> other service. Does this help? >> >> Alex >> > Alex, > > Is it possible to use a RESTful URL that has the instance ID > embedded in it, like "http://modeldriven.org/orders/order/1234"? I > don't see a way to get at the original URL. > > Thanks, > -Jim > You can fashion a <page> element in page-flow.xml to use the 'matcher' attribute, and have one xpl that handles all path-info="/orders/order(.*)" documents. The matches are available in the pipeline in a way similar to xforms model. It's been a while since i used...you use <setvalue> to put the captured results in the instance input of your pipeline. HTH, Hank > > -- > 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 Hank Ratzesberger NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- 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 |
Hank Ratzesberger wrote:
> >> >> Is it possible to use a RESTful URL that has the instance ID embedded >> in it, like "http://modeldriven.org/orders/order/1234"? I don't see a >> way to get at the original URL. >> > > Hi Jim, > > You can fashion a <page> element in page-flow.xml to use the 'matcher' > attribute, and have > one xpl that handles all path-info="/orders/order(.*)" documents. The > matches are > available in the pipeline in a way similar to xforms model. > > It's been a while since i used...you use <setvalue> to put the > captured results in > the instance input of your pipeline. > > HTH, > Hank How does the XPL get the instance (or instance ID) to the the XForm? I haven't read much on the XPL stuff yet, as I didn't expect to need it. Thanks, -Jim -- 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 |
On May 8, 2008, at 6:48 PM, Jim Logan wrote: > Hank Ratzesberger wrote: >> >>> >>> Is it possible to use a RESTful URL that has the instance ID >>> embedded in it, like "http://modeldriven.org/orders/order/1234"? >>> I don't see a way to get at the original URL. >>> >> >> Hi Jim, >> >> You can fashion a <page> element in page-flow.xml to use the >> 'matcher' attribute, and have >> one xpl that handles all path-info="/orders/order(.*)" documents. >> The matches are >> available in the pipeline in a way similar to xforms model. >> >> It's been a while since i used...you use <setvalue> to put the >> captured results in >> the instance input of your pipeline. >> >> HTH, >> Hank > Hi Hank, > > How does the XPL get the instance (or instance ID) to the the > XForm? I haven't read much on the XPL stuff yet, as I didn't expect > to need it. > > Thanks, > -Jim > have the same xpl handle urls with the variable embedded in the url rather than passed as parameters (with ?...). Indeed there is still an issue of updating the instance in the xform, and submit is the way to do that. At first, I think it would be easier to use POST, because the URL, and therefore the submission attribute action="" would remain constant. The index('list-repeat') would reference what data to transmit -- not RESTful but I think it would work. One trigger, something like: <trigger> <action ev:event="DOMactivate"> <setvalue ref="instance('submit-inst')/order-no" value="instance('list-inst')/orders[index('list-repeat-id')]/ order-no"/> <send submission="the-post-submit"/> </action> </trigger> What I think you want, is to present a list, the user clicks on one of the items in the list, and the form is updated with the data the item (url) references. In my limited experience, I can't think of a way to do this without using POST to a service.... --Hank Hank Ratzesberger NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- 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 |
Free forum by Nabble | Edit this page |