Is there an easy way to get the document / form ID of a form? Essentially, I'm trying to make a very simple app that, upon saving of the form, grabs the document ID and emails it to a user, so they can resume at a later date if they want. I feel like I'm probably missing something simple.
-- I've tried using the following under the save-draft button: ... save then navigate("<a href="http://mydomain.com/blah.php?id={xxf:document-id()}">http://mydomain.com/blah.php?id={xxf:document-id()}")
That actually looks like it works, however the ID it submits does not match up to the ID of the actual form, it's some other value. Any ideas here?
Thanks! Nick You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
The actual document id can be obtained with:
xxf:instance('fr-parameters-instance')/document We need an API for that: https://github.com/orbeon/orbeon-forms/issues/1095 -Erik |
Thanks for the reply and excuse my ignorance, but it sounds like there's not a quick way to grab this during a form runner event (save / nagivate) and pop it into the URL bar? Ideally, I'm looking for an XPath value to use with 'navigate.'
Thanks! Nick On Fri, Jul 11, 2014 at 6:09 PM, Erik Bruchez <[hidden email]> wrote: The actual document id can be obtained with: Nick Yeager
Chief Technology Officer 80 Broad Street, 5th Floor New York, NY, 10004 484.274.3297 You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
With 4.6, you can place XPath in the `navigate` action. So yes, you can, e.g.:
navigate(uri = "/foo/{xxf:instance('fr-parameters-instance')/document}/bar") -Erik |
Hi Erik, sorry for the delays, I've done some digging and am attaching some relevant bits.
"There was an error running the process. Please contact the application administrator." The relevant lines in my properties-local.xml look like this: <property as="xs:string" name="oxf.fr.detail.process.save-draft.*.*" value='save then navigate(uri = "<a href="http://10.0.0.23/%7Bxxf:instance(%5C'fr-parameters-instance%5C')/document%7D'" target="_blank">http://10.0.0.23/{xxf:instance(\"fr-parameters-instance\")/document}")'/>
The traceback in the logs looks like the following: (Note, I've also tried difference combinations of quotes, unsuccessfully).
2014-08-13 22:09:57,321 ERROR XFormsServer - +----------------------------------------------------------------------------------------------------------------------+ 2014-08-13 22:09:57,321 ERROR XFormsServer - |An Error has Occurred | 2014-08-13 22:09:57,321 ERROR XFormsServer - |----------------------------------------------------------------------------------------------------------------------| 2014-08-13 22:09:57,321 ERROR XFormsServer - |Invalid source: | 2014-08-13 22:09:57,321 ERROR XFormsServer - |Invalid input '\', expected CombinatorActionPair, OptWhiteSpace or EOI (line 1, pos 98): | 2014-08-13 22:09:57,321 ERROR XFormsServer - |save | 2014-08-13 22:09:57,321 ERROR XFormsServer - | then navigate(uri="<a href="http://10.0.0.23/{xxf:instance(\">http://10.0.0.23/{xxf:instance(\"fr-form-instance\")/document}")\ | 2014-08-13 22:09:57,321 ERROR XFormsServer - | | 2014-08-13 22:09:57,321 ERROR XFormsServer - | ^ | 2014-08-13 22:09:57,321 ERROR XFormsServer - |----------------------------------------------------------------------------------------------------------------------| 2014-08-13 22:09:57,321 ERROR XFormsServer - |Application Call Stack | 2014-08-13 22:09:57,321 ERROR XFormsServer - |----------------------------------------------------------------------------------------------------------------------| 2014-08-13 22:09:57,321 ERROR XFormsServer - |----------------------------------------------------------------------------------------------------------------------| 2014-08-13 22:09:57,321 ERROR XFormsServer - |Exception: org.parboiled.errors.ParsingException | 2014-08-13 22:09:57,321 ERROR XFormsServer - |----------------------------------------------------------------------------------------------------------------------| 2014-08-13 22:09:57,321 ERROR XFormsServer - |org.orbeon.oxf.fr.process.ProcessParser$ |parse |ProcessParser.scala | 114| Thanks! On Mon, Jul 14, 2014 at 8:54 PM, Erik Bruchez <[hidden email]> wrote: With 4.6, you can place XPath in the `navigate` action. So yes, you can, Nick Yeager
Chief Technology Officer 80 Broad Street, 5th Floor New York, NY, 10004 484.274.3297 You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Administrator
|
Nabble messed up with my message, and maybe it messed up with yours too ;) Either way the advice holds if you are using 4.6:
<property as="xs:string" name="oxf.fr.detail.process.save-draft.*.*"> save then navigate(uri = "http://10.0.0.23/{xxf:instance('fr-parameters-instance')/document}" </property> This way you can avoid having to escape quotes. -Erik |
As always, thanks for your help, this is working now. Figured something simple was messed up! :)
-- -Nick On Thu, Aug 14, 2014 at 6:29 PM, Erik Bruchez <[hidden email]> wrote: Nabble messed up with my message, and maybe it messed up with yours too ;) Nick Yeager
Chief Technology Officer 80 Broad Street, 5th Floor New York, NY, 10004 <a href="tel:484.274.3297" value="+14842743297" target="_blank">484.274.3297 You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Free forum by Nabble | Edit this page |